From 661f36475a7e975988da6787b250fb04fe4d71b7 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sun, 16 Aug 2026 14:54:15 +0200 Subject: [PATCH] fix(stories): restore full-bleed mobile video rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The aspect-ratio-sized box from the previous commit caused a mobile-only bug — video appeared cropped/zoomed instead of fitting. Root cause not fully isolated (mux-player's object-fit default is contain, confirmed in its source, so it wasn't that), but the sized box is the only recent change in that path. Gates it to sm+ viewports via a CSS custom property + Tailwind arbitrary aspect-ratio, and reverts to full-bleed + explicit object-fit: contain below that — the combination already verified working before the box-sizing change. --- src/components/stories/StoryViewer.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/stories/StoryViewer.tsx b/src/components/stories/StoryViewer.tsx index a2f492f..61b1493 100644 --- a/src/components/stories/StoryViewer.tsx +++ b/src/components/stories/StoryViewer.tsx @@ -227,16 +227,19 @@ export function StoryViewer({ // The player BOX itself is sized to the video's real aspect // ratio (default 9:16 — most story videos are phone-shot // portrait — until Mux reports the actual value), not just the - // content inside a full-bleed box. object-fit: contain on a - // full-screen box still leaves a full-screen click/visual - // target with the letterboxing baked into the box; sizing the - // box itself means the black is purely the backdrop showing - // through, not part of the box. + // content inside a full-bleed box, on sm+ viewports. Below sm, + // stay full-bleed with object-fit: contain doing the letterbox- + // ing — sizing the box itself via computed aspect-ratio caused + // a mobile-only rendering bug (video appeared cropped/zoomed), + // so this only applies where it was actually verified to work.
{videoStatus === "READY" && videoPlaybackId ? ( @@ -245,7 +248,7 @@ export function StoryViewer({ streamType="on-demand" autoPlay muted={isMuted} - style={{ width: "100%", height: "100%" }} + style={{ width: "100%", height: "100%", objectFit: "contain" }} onTimeUpdate={handleVideoTimeUpdate} onEnded={handleVideoEnded} />