feat(embeds): add Bluesky, Loom, Kick
From the coverage-review agent's ranked recommendations (clean iframes, ids in
the URL, one CSP host each):
- Bluesky: bsky.app/profile/{authority}/post/{rkey} → embed.bsky.app (rich, self-
resizing like the other post embeds).
- Loom: loom.com/share|embed/{id} → www.loom.com/embed/{id} (16:9).
- Kick: kick.com/{channel} → player.kick.com/{channel} (live channels only; VODs/
clips have no clean embed and fall back to a link).
Parsers unit-tested. CSP frame-src gains embed.bsky.app / www.loom.com /
player.kick.com (desktop + live web, both updated). Needs live verification once
deployed since the embeds themselves can't be exercised from here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,9 @@ import {
|
||||
getTidalEmbed,
|
||||
getInstagramEmbed,
|
||||
getRedditPostEmbed,
|
||||
getBlueskyEmbed,
|
||||
getLoomId,
|
||||
getKickChannel,
|
||||
buildVideoEmbedUrl,
|
||||
spotifyEmbedHeight,
|
||||
parseMediaEmbed,
|
||||
@@ -230,6 +233,30 @@ test('parseMediaEmbed: Instagram/Reddit → rich, Tidal → audio', () => {
|
||||
assert.equal(parseMediaEmbed('https://tidal.com/browse/track/1', 'h')?.provider, 'tidal');
|
||||
});
|
||||
|
||||
test('Bluesky / Loom / Kick', () => {
|
||||
assert.equal(
|
||||
getBlueskyEmbed('https://bsky.app/profile/alice.bsky.social/post/3kabc'),
|
||||
'https://embed.bsky.app/embed/alice.bsky.social/app.bsky.feed.post/3kabc',
|
||||
);
|
||||
assert.equal(getBlueskyEmbed('https://bsky.app/profile/alice.bsky.social'), null);
|
||||
assert.equal(parseMediaEmbed('https://bsky.app/profile/a.bsky.social/post/3k', 'h')?.kind, 'rich');
|
||||
|
||||
assert.equal(getLoomId('https://www.loom.com/share/abc123DEF'), 'abc123DEF');
|
||||
assert.equal(getLoomId('https://www.loom.com/embed/abc123DEF'), 'abc123DEF');
|
||||
assert.equal(
|
||||
parseMediaEmbed('https://www.loom.com/share/xyz', 'h')?.embedUrl,
|
||||
'https://www.loom.com/embed/xyz',
|
||||
);
|
||||
|
||||
assert.equal(getKickChannel('https://kick.com/somestreamer'), 'somestreamer');
|
||||
assert.equal(getKickChannel('https://kick.com/streamer/videos/123'), null); // VOD → no embed
|
||||
assert.ok(
|
||||
parseMediaEmbed('https://kick.com/streamer', 'h')?.embedUrl.includes(
|
||||
'player.kick.com/streamer?autoplay=true',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
test('parseMediaEmbed: Twitch embed carries the parent host', () => {
|
||||
const chan = parseMediaEmbed('https://twitch.tv/streamer', HOST);
|
||||
assert.equal(chan?.provider, 'twitch');
|
||||
|
||||
Reference in New Issue
Block a user