social-embeds 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Turn social media embed code or post URLs into working React components.
|
|
|
4
4
|
|
|
5
5
|
Pasting a platform's embed code into `dangerouslySetInnerHTML` does not work in React: the `<script>` tag never runs, every embed adds the same script again, and nothing initialises after client-side navigation. `social-embeds` recognises the platform, reads the post and its options from the embed code, drops the `<script>` tag, loads each platform script once per page and asks the platform to render the post. Iframe-based platforms get a responsive `<iframe>` instead.
|
|
6
6
|
|
|
7
|
+
**[Live demo](https://amitrev.github.io/social-embeds/)**: every platform from embed code and post URLs, and a box for your own, running the released version.
|
|
8
|
+
|
|
7
9
|
- X, Instagram, Threads, Facebook, TikTok, YouTube, Telegram, Snapchat, LinkedIn, Reddit, Pinterest, Spotify, Vimeo, Twitch, Dailymotion, Bluesky, SoundCloud, Apple Music, Apple Podcasts, Tumblr, Kick and Giphy
|
|
8
10
|
- React 19, Next.js App Router (Server Components, client navigation), or plain React
|
|
9
11
|
- Zero runtime dependencies, ESM only, typed
|
|
@@ -109,47 +111,47 @@ import {
|
|
|
109
111
|
|
|
110
112
|
<XEmbed url="https://x.com/jack/status/20" theme="dark" cards="hidden" />
|
|
111
113
|
|
|
112
|
-
<InstagramEmbed url="https://www.instagram.com/p/
|
|
114
|
+
<InstagramEmbed url="https://www.instagram.com/p/Df75lxnmIrF/" captioned />
|
|
113
115
|
|
|
114
|
-
<ThreadsEmbed url="https://www.threads.com/@instagram/post/
|
|
116
|
+
<ThreadsEmbed url="https://www.threads.com/@instagram/post/Df5MmLBm0O7" theme="auto" />
|
|
115
117
|
|
|
116
118
|
<FacebookEmbed
|
|
117
119
|
url="https://www.facebook.com/facebook/videos/10153231379946729/"
|
|
118
|
-
locale="
|
|
120
|
+
locale="en_GB"
|
|
119
121
|
showCaptions
|
|
120
122
|
/>
|
|
121
123
|
|
|
122
124
|
<TikTokEmbed
|
|
123
|
-
url="https://www.tiktok.com/@
|
|
125
|
+
url="https://www.tiktok.com/@tiktok/video/7704834703446117662"
|
|
124
126
|
musicInfo={false}
|
|
125
127
|
description={false}
|
|
126
128
|
/>
|
|
127
129
|
|
|
128
|
-
<YouTubeEmbed url="https://youtu.be/jNQXAC9IVRw?t=
|
|
130
|
+
<YouTubeEmbed url="https://youtu.be/jNQXAC9IVRw?t=11" nocookie controls={false} />
|
|
129
131
|
|
|
130
132
|
<TelegramEmbed url="https://t.me/telegram/83" dark userpic={false} />
|
|
131
133
|
|
|
132
134
|
<SnapchatEmbed url="https://www.snapchat.com/@teamsnapchat" />
|
|
133
135
|
|
|
134
136
|
<LinkedInEmbed
|
|
135
|
-
url="https://www.linkedin.com/feed/update/urn:li:
|
|
137
|
+
url="https://www.linkedin.com/feed/update/urn:li:ugcPost:7528828146767409153/"
|
|
136
138
|
collapsed
|
|
137
139
|
height={560}
|
|
138
140
|
/>
|
|
139
141
|
|
|
140
142
|
<RedditEmbed
|
|
141
|
-
url="https://www.reddit.com/r/
|
|
143
|
+
url="https://www.reddit.com/r/reddit/comments/11zso11/"
|
|
142
144
|
theme="dark"
|
|
143
|
-
locale="
|
|
145
|
+
locale="en-GB"
|
|
144
146
|
/>
|
|
145
147
|
|
|
146
|
-
<PinterestEmbed url="https://www.pinterest.com/pin/
|
|
148
|
+
<PinterestEmbed url="https://www.pinterest.com/pin/424605071145752542/" pinWidth="large" />
|
|
147
149
|
|
|
148
|
-
<SpotifyEmbed url="https://open.spotify.com/track/
|
|
150
|
+
<SpotifyEmbed url="https://open.spotify.com/track/0LrHzQHk5gYGbMsoVbKDuS" theme={0} />
|
|
149
151
|
|
|
150
152
|
<VimeoEmbed url="https://vimeo.com/76979871" muted title={false} t="1m2s" />
|
|
151
153
|
|
|
152
|
-
<TwitchEmbed url="https://www.twitch.tv/videos/
|
|
154
|
+
<TwitchEmbed url="https://www.twitch.tv/videos/1816688726" autoplay={false} time="30s" />
|
|
153
155
|
|
|
154
156
|
<DailymotionEmbed
|
|
155
157
|
url="https://www.dailymotion.com/video/x84sh87"
|
|
@@ -158,21 +160,21 @@ import {
|
|
|
158
160
|
/>
|
|
159
161
|
|
|
160
162
|
<BlueskyEmbed
|
|
161
|
-
url="https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/post/
|
|
163
|
+
url="https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/post/3mxu3hsnebc2v"
|
|
162
164
|
colorMode="dark"
|
|
163
165
|
/>
|
|
164
166
|
|
|
165
167
|
<SoundCloudEmbed url="https://soundcloud.com/forss/flickermood" visual={false} height={166} />
|
|
166
168
|
|
|
167
|
-
<AppleMusicEmbed url="https://music.apple.com/us/album/
|
|
169
|
+
<AppleMusicEmbed url="https://music.apple.com/us/album/birds-of-oaks-bottom-piano-solos/1357820591?i=1357820597" />
|
|
168
170
|
|
|
169
|
-
<ApplePodcastsEmbed url="https://podcasts.apple.com/us/podcast/the-
|
|
171
|
+
<ApplePodcastsEmbed url="https://podcasts.apple.com/us/podcast/monument-valley-meet-the-developer/id947965068" />
|
|
170
172
|
|
|
171
|
-
<TumblrEmbed url="https://staff.tumblr.com/post/
|
|
173
|
+
<TumblrEmbed url="https://staff.tumblr.com/post/828009069026721792" />
|
|
172
174
|
|
|
173
|
-
<KickEmbed url="https://kick.com/
|
|
175
|
+
<KickEmbed url="https://kick.com/kick" muted />
|
|
174
176
|
|
|
175
|
-
<GiphyEmbed url="https://giphy.com/gifs/
|
|
177
|
+
<GiphyEmbed url="https://giphy.com/gifs/originals-animation-kitten-logo-l41YlHs99JsSptZf2" maxWidth={480} />
|
|
176
178
|
```
|
|
177
179
|
|
|
178
180
|
| Component | Option props |
|
|
@@ -416,6 +418,7 @@ URL shapes, each tested against Facebook's plugins on `www.facebook.com`, `faceb
|
|
|
416
418
|
- Embed code from Dailymotion Studio carries the Player ID (`geo.dailymotion.com/player/{playerId}.html?video={id}`) and renders as given, also inside Dailymotion's responsive wrapper `div`.
|
|
417
419
|
- URLs, and code without a Player ID, render only through `DailymotionEmbed` with your `playerId`. A `playerId` prop also replaces the one in the embed code. `<SocialEmbed>` takes none: for that input it renders nothing and calls `onError`.
|
|
418
420
|
- The package never uses a Player ID you did not give it.
|
|
421
|
+
- Playback with a publisher's own Player ID is not yet tested. The sample Player ID from Dailymotion's docs loads the player and plays, but its stream is refused after a few plays (`docs/decisions.md` D69), so the demo's Dailymotion page may show "Playback error".
|
|
419
422
|
- Playlists are not supported.
|
|
420
423
|
|
|
421
424
|
### Bluesky
|