feat(embeds): apply review findings + fix TikTok portrait padding
From the review-agent audit:
- Dailymotion: move off the Sept-2024-deprecated /embed/video path to
geo.dailymotion.com/player.html.
- Reddit: point at embed.reddit.com (www.redditmedia.com now 301s there).
- Vimeo: parse the unlisted hash (vimeo.com/{id}/{hash}) and pass &h=…, add dnt=1.
- Tidal: layout=gridify + ~275px height for albums/playlists (fixes narrow player).
- YouTube/Shorts: playsinline=1 (iOS keeps playback inline); parse /live/ +
music.youtube.com.
- Apple Music: /music-video/ renders 16:9 instead of a fixed audio height.
- Re-add a minimal sandbox to all media iframes (omits allow-top-navigation →
blocks phishing redirects) — defense-in-depth atop the CSP frame-src allowlist.
- Self-resize Instagram + Reddit post embeds via a shared useIframeAutoHeight hook
(also now covers the Tweet embed; matches platform.x.com origin too); drop the
fixed 720/480 heights. Cap tweet/post columns at ~550px, centered.
Also from user feedback: TikTok portrait player dropped music_info/description,
which forced TikTok's wide 'video + info panel' layout and left empty space
beside the video — now a clean 9:16 player that fills the box.
Tests 726 pass. CSP frame-src gains embed.reddit.com (separate desktop commit).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -270,11 +270,14 @@ export const EmbedIframe = style([
|
||||
},
|
||||
]);
|
||||
|
||||
// Variable-height iframe that sizes itself (X/Twitter post embed — height set inline).
|
||||
// Variable-height iframe that sizes itself (X/Twitter, Instagram, Reddit posts —
|
||||
// height set inline). Capped ~550px (X/IG native max) + centered in the wide card.
|
||||
export const EmbedIframeStatic = style([
|
||||
DefaultReset,
|
||||
{
|
||||
width: '100%',
|
||||
maxWidth: toRem(550),
|
||||
margin: '0 auto',
|
||||
border: 0,
|
||||
display: 'block',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user