Skip to content

Commit cc60a23

Browse files
committed
Add oEmbed providers for rich media
1 parent e6a9dee commit cc60a23

4 files changed

Lines changed: 66 additions & 3 deletions

File tree

‎data/stubs.php‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,45 @@
7777
'oembed' => 'https://www.tumblr.com/oembed/1.0',
7878
'notes' => 'Uses oEmbed HTML because Tumblr post embeds require provider-generated markup.',
7979
],
80+
[
81+
'name' => 'Bluesky',
82+
'website' => 'https://bsky.app',
83+
'status' => 'active',
84+
'category' => 'social',
85+
'example-url' => 'https://bsky.app/profile/bsky.app/post/3mbhel6ij7s2y',
86+
'url-match' => 'https://bsky\\.app/profile/([^/?#]+)/post/([^/?#]+)',
87+
'embed-width' => 600,
88+
'embed-height' => 600,
89+
'oembed' => 'https://embed.bsky.app/oembed',
90+
'id' => '$2/$3',
91+
'notes' => 'Uses provider-generated oEmbed HTML for social posts.',
92+
],
93+
[
94+
'name' => 'Flickr',
95+
'website' => 'https://www.flickr.com',
96+
'status' => 'active',
97+
'category' => 'social',
98+
'example-url' => 'https://www.flickr.com/photos/bees/2341623661/',
99+
'url-match' => 'https?://(?:www\\.)?flickr\\.com/photos/([^/?#]+)/([0-9]+)(?:/[^?#]*)?',
100+
'embed-width' => 1024,
101+
'embed-height' => 768,
102+
'oembed' => 'https://www.flickr.com/services/oembed/',
103+
'id' => '$2/$3',
104+
'notes' => 'Supports provider-generated oEmbed markup for photos and videos.',
105+
],
106+
[
107+
'name' => 'Speaker Deck',
108+
'website' => 'https://speakerdeck.com',
109+
'status' => 'active',
110+
'category' => 'social',
111+
'example-url' => 'https://speakerdeck.com/speakerdeck/introduction-to-speakerdeck',
112+
'url-match' => 'https?://speakerdeck\\.com/([^/?#]+)/([^/?#]+)',
113+
'embed-width' => 710,
114+
'embed-height' => 399,
115+
'oembed' => 'https://speakerdeck.com/oembed.json',
116+
'id' => '$2/$3',
117+
'notes' => 'Uses provider-generated oEmbed HTML for presentations.',
118+
],
80119
[
81120
'name' => 'Dailymotion',
82121
'website' => 'https://www.dailymotion.com',

‎docs/supported.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supported Media Services
22

3-
43 services (42 active, 1 legacy)
3+
46 services (45 active, 1 legacy)
44

55
Provider example URLs are covered by the release fixture matrix in `tests/Fixture/provider_urls.php`.
66

@@ -14,10 +14,12 @@ Provider example URLs are covered by the release fixture matrix in `tests/Fixtur
1414
| [Bilibili](https://www.bilibili.com) | active | video | iframe | |
1515
| [Bilibili (Legacy)](https://www.bilibili.com) | legacy | video | iframe | Legacy URL format kept for existing links. |
1616
| [BitChute](https://www.bitchute.com) | active | video | iframe | |
17+
| [Bluesky](https://bsky.app) | active | social | oEmbed | Uses provider-generated oEmbed HTML for social posts. |
1718
| [Coub](https://coub.com) | active | video | iframe | |
1819
| [Dailymotion](https://www.dailymotion.com) | active | video | iframe, thumbnail | |
1920
| [Deezer](https://www.deezer.com) | active | audio | iframe | Music content only (track, album, playlist, artist); podcasts are not supported. |
2021
| [Facebook](https://www.facebook.com) | active | social | iframe | |
22+
| [Flickr](https://www.flickr.com) | active | social | oEmbed | Supports provider-generated oEmbed markup for photos and videos. |
2123
| [Giphy](https://giphy.com) | active | video | iframe, thumbnail | |
2224
| [Instagram](https://www.instagram.com) | active | social | iframe | |
2325
| [Kick](https://kick.com) | active | streaming | iframe | |
@@ -36,6 +38,7 @@ Provider example URLs are covered by the release fixture matrix in `tests/Fixtur
3638
| [Screencast](https://www.screencast.com) | active | video | iframe, fetch | |
3739
| [Sketchfab](https://sketchfab.com) | active | 3d | iframe, oEmbed | |
3840
| [SoundCloud](https://soundcloud.com) | active | audio | iframe, oEmbed | |
41+
| [Speaker Deck](https://speakerdeck.com) | active | social | oEmbed | Uses provider-generated oEmbed HTML for presentations. |
3942
| [Spotify](https://open.spotify.com) | active | audio | iframe, oEmbed | |
4043
| [Spreaker](https://www.spreaker.com) | active | audio | iframe, oEmbed | Episode URLs only; show pages expose no numeric ID in the URL. |
4144
| [Streamable](https://streamable.com) | active | video | iframe | |

‎tests/Fixture/provider_urls.php‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,22 @@
262262
'id' => '822057428507049984',
263263
'oembedEndpoint' => 'https://www.tumblr.com/oembed/1.0?url=https%3A%2F%2Fstaff.tumblr.com%2Fpost%2F822057428507049984%2Fin-case-youre-looking-for-a-blog-thats-gone',
264264
],
265+
[
266+
'slug' => 'bluesky',
267+
'url' => 'https://bsky.app/profile/bsky.app/post/3mbhel6ij7s2y',
268+
'id' => 'bsky.app/3mbhel6ij7s2y',
269+
'oembedEndpoint' => 'https://embed.bsky.app/oembed?url=https%3A%2F%2Fbsky.app%2Fprofile%2Fbsky.app%2Fpost%2F3mbhel6ij7s2y',
270+
],
271+
[
272+
'slug' => 'flickr',
273+
'url' => 'https://www.flickr.com/photos/bees/2341623661/',
274+
'id' => 'bees/2341623661',
275+
'oembedEndpoint' => 'https://www.flickr.com/services/oembed/?url=https%3A%2F%2Fwww.flickr.com%2Fphotos%2Fbees%2F2341623661%2F',
276+
],
277+
[
278+
'slug' => 'speaker-deck',
279+
'url' => 'https://speakerdeck.com/speakerdeck/introduction-to-speakerdeck',
280+
'id' => 'speakerdeck/introduction-to-speakerdeck',
281+
'oembedEndpoint' => 'https://speakerdeck.com/oembed.json?url=https%3A%2F%2Fspeakerdeck.com%2Fspeakerdeck%2Fintroduction-to-speakerdeck',
282+
],
265283
];

‎tests/MediaEmbedTest.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class MediaEmbedTest extends TestCase {
3535
'https://www.facebook.com/demotivateurFood/videos/vl.184872862011827/1034411179983244/?type=1' => '1034411179983244',
3636
'https://staff.tumblr.com/post/822057428507049984/in-case-youre-looking-for-a-blog-thats-gone' => '822057428507049984',
3737
'https://www.tumblr.com/staff/822057428507049984/in-case-youre-looking-for-a-blog-thats-gone' => '822057428507049984',
38+
'https://bsky.app/profile/bsky.app/post/3mbhel6ij7s2y' => 'bsky.app/3mbhel6ij7s2y',
39+
'https://www.flickr.com/photos/bees/2341623661/' => 'bees/2341623661',
40+
'https://speakerdeck.com/speakerdeck/introduction-to-speakerdeck' => 'speakerdeck/introduction-to-speakerdeck',
3841
'http://vimeo.com/19570639' => '19570639',
3942
'http://vimeo.com/245928033/572c32a20d' => '245928033/572c32a20d',
4043
'http://vimeo.com/channels/staffpicks/99585787' => '99585787',
@@ -1152,7 +1155,7 @@ public function testGetHosts(): void {
11521155
$MediaEmbed = new MediaEmbed();
11531156

11541157
$hosts = $MediaEmbed->getHosts();
1155-
$this->assertCount(43, $hosts);
1158+
$this->assertCount(46, $hosts);
11561159

11571160
$hosts = $MediaEmbed->getHosts(['vimeo', 'youtube']);
11581161
$this->assertTrue(count($hosts) === 2);
@@ -1377,7 +1380,7 @@ public function testGetProviders(): void {
13771380
$MediaEmbed = new MediaEmbed();
13781381

13791382
$providers = $MediaEmbed->getProviders();
1380-
$this->assertCount(43, $providers);
1383+
$this->assertCount(46, $providers);
13811384
$this->assertTrue($providers->has('youtube'));
13821385
$this->assertTrue($providers->has('vimeo'));
13831386

0 commit comments

Comments
 (0)