┌─────────────────────────────────────┐
│ [Album Art] │
│ 🏷️ Album Badge │
│ │
│ Album Title │
│ X tracks │
│ │
│ ▶️ Play 👍👎 🔗 Share 👁️ View │
│ │
│ [Add to Cart $9.99] │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ [Album Art] │
│ │
│ Song Title │
│ │
│ ▶️ Play 👍👎 🔗 Share 👁️ View │
│ │
│ [Add to Cart $0.99] │
└─────────────────────────────────────┘
Share Button Details:
- Layout:
icon_link(compact icon) - Size:
small - Position: Between Like/Dislike buttons and View button
┌──────────────────────────────────────────────────┐
│ │
│ [Large Album Art] │
│ │
│ Song Title │
│ │
│ ⏯️ Play 📤 Share (123) 🛒 Add to Cart │
│ │
│ Duration: 4:05 │
│ Preview Only (60 seconds) │
│ │
│ 👍 12 👎 3 │
│ │
│ ───────────────────────────────────── │
│ [Progress Bar] │
│ 0:00 ────────────────────────────── 4:05 │
│ │
└──────────────────────────────────────────────────┘
Share Button Details:
- Layout:
button_count(shows share count) - Size:
large - Position: Between Play button and Cart button
- Shows: "Share" text with count (e.g., "Share (123)")
┌──────────────────────────────────────────────────┐
│ │
│ [Large Album Art] │
│ │
│ Album Title │
│ │
│ ⏯️ Play 📤 Share (456) 🛒 Add to Cart │
│ │
│ 12 tracks │
│ Preview Only (60 seconds per track) │
│ │
│ 👍 45 👎 8 [Now Playing: Track 3] │
│ │
│ Track List: │
│ # | Title | Duration | Actions │
│ ────────────────────────────────────────── │
│ 1 | Track 1 | 3:45 | ▶️ │
│ 2 | Track 2 | 4:12 | ▶️ │
│ 3 | Track 3 ⏵ | 3:58 | ▶️ │
│ 4 | Track 4 | 4:32 | ▶️ │
│ │
│ ───────────────────────────────────── │
│ [Progress Bar] │
│ │
└──────────────────────────────────────────────────┘
Share Button Details:
- Layout:
button_count(shows share count) - Size:
large - Position: Between Play button and Cart button
- Shows: "Share" text with count
- Note: Only shown for albums, NOT for playlists
https://streamtunes.net/song/Song%20Title%20with%20Spaces
https://streamtunes.net/album/Album%20Name%20with%20Spaces
https://streamtunes.net/playlist/123
When a user shares a song, Facebook will scrape these meta tags:
<head>
<!-- Facebook App ID -->
<meta property="fb:app_id" content="YOUR_APP_ID">
<!-- URL being shared -->
<meta property="og:url" content="https://streamtunes.net/song/Amazing%20Song">
<!-- Content type -->
<meta property="og:type" content="music.song">
<!-- Title -->
<meta property="og:title" content="Amazing Song">
<!-- Album art image -->
<meta property="og:image" content="https://streamtunes.net/api/music/stream?path=Amazing%20Song.jpg">
<!-- Description -->
<meta property="og:description" content="Listen to Amazing Song on StreamTunes">
<!-- Music metadata -->
<meta property="music:genre" content="Rock">
<meta property="music:duration" content="245">
</head>When clicking a share button, users will see:
┌─────────────────────────────────────────────────┐
│ Share to Facebook [X] │
├─────────────────────────────────────────────────┤
│ │
│ [Your profile pic] John Doe │
│ │
│ Say something about this... │
│ ┌─────────────────────────────────────────┐ │
│ │ │ │
│ └─────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────┐ │
│ │ [Album Art Preview] │ │
│ │ streamtunes.net │ │
│ │ Amazing Song │ │
│ │ Listen to Amazing Song on StreamTunes │ │
│ └─────────────────────────────────────────┘ │
│ │
│ 👥 Friends ▼ │
│ │
│ [Cancel] [Post to Facebook] │
└─────────────────────────────────────────────────┘
App.razor (loads Facebook SDK)
├── Facebook SDK Script
└── Dynamic Meta Tags (for song/album pages)
MusicLibrary.razor
├── Album Cards
│ └── FacebookShareButton (icon_link, small)
└── Song Cards
└── FacebookShareButton (icon_link, small)
SongPlayer.razor
└── Action Controls
└── FacebookShareButton (button_count, large)
AlbumPlayer.razor
└── Action Controls
└── FacebookShareButton (button_count, large)
(Only for albums, not playlists)
FacebookShareButton.razor (Shared Component)
├── fb-share-button-wrapper div
│ └── Share link
│ ├── Facebook SDK rendering
│ └── Fallback direct link
/* Facebook Share Button Wrapper */
.fb-share-button-wrapper {
display: inline-flex;
align-items: center;
justify-content: center;
}
/* Share button in action controls */
.share-button-action {
display: inline-flex;
align-items: center;
}- Share buttons integrate seamlessly with existing Syncfusion UI
- Positioned using existing card action layouts
- Consistent styling with other action buttons
- All share buttons fully visible
- button_count layout shows share count inline
- icon_link layout shows compact icon
- Share buttons maintain visibility
- Count numbers may wrap on smaller tablets
- Share buttons remain functional
- icon_link layout preferred for space efficiency
- Facebook SDK optimizes share dialog for mobile
- ✅ Chrome/Edge (Latest)
- ✅ Firefox (Latest)
- ✅ Safari (Latest)
- ✅ Mobile Safari (iOS)
- ✅ Chrome Mobile (Android)
- JavaScript must be enabled
- Cookies must be enabled
- Third-party scripts allowed
- If Facebook SDK fails to load, direct share links still work
- No JavaScript required for basic share functionality
- Opens Facebook in new window/tab
ShareUrl (Required)
- Full URL to be shared
- Properly URL-encoded
- Example:
https://streamtunes.net/song/My%20Song
Layout (Optional, default: "button_count")
button: Simple share buttonbutton_count: Share button with countbox_count: Vertical count above buttonicon_link: Icon only (used in Music Library)
Size (Optional, default: "small")
small: Compact sizemedium: Default sizelarge: Larger size (used in players)
CssClass (Optional)
- Additional CSS classes
- Example:
share-button-action
ButtonText (Optional)
- Custom button text
- If not provided, Facebook SDK uses default
- Share counts are provided by Facebook
- Counts update in real-time from Facebook's servers
- No database storage required in application
- Count includes:
- Public shares
- Private shares (if user allows)
- Comments containing the link
- Reactions to shared posts
✅ Implemented:
- HTML entity encoding for meta tag content
- URL encoding for special characters in URLs
- HTTPS required for Facebook integration
- CSRF protection via Facebook App ID
- No sensitive data in Open Graph tags
- Keep Facebook App ID in configuration (not hardcoded)
- Restrict Facebook App domains in developer console
- Monitor Facebook App analytics for unusual activity