From 07c0f82293ca274e29fa37437ece26f5564d7349 Mon Sep 17 00:00:00 2001 From: neodk2004 Date: Sun, 16 Aug 2026 14:47:34 +0200 Subject: [PATCH] fix(stories): size the video player box to the real aspect ratio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The player box was full-bleed (w-full h-full) with object-fit: contain handling the letterboxing internally — visually correct but the box itself still spanned the whole screen, so the black letterbox area read as part of the player rather than just backdrop. Sizes the box itself to the story's aspectRatio (defaulting to 9:16 before Mux reports the real value), centered via flex — same visual result, but now only the actual content area is the "box". --- src/components/stories/StoryViewer.tsx | 87 +++++++++++++++----------- 1 file changed, 51 insertions(+), 36 deletions(-) diff --git a/src/components/stories/StoryViewer.tsx b/src/components/stories/StoryViewer.tsx index 25d8386..a2f492f 100644 --- a/src/components/stories/StoryViewer.tsx +++ b/src/components/stories/StoryViewer.tsx @@ -224,43 +224,58 @@ export function StoryViewer({ normal feed videos) — object-contain here matters even more: no fixed aspect-video box like VideoCard uses. */} {isVideo ? ( -
- {videoStatus === "READY" && videoPlaybackId ? ( - +
+ {videoStatus === "READY" && videoPlaybackId ? ( + + ) : videoStatus === "ERROR" ? ( +
+ {t("videoError")} +
+ ) : ( +
+ +
+ )} + {videoStatus === "READY" && ( + + )} + - ) : videoStatus === "ERROR" ? ( -
- {t("videoError")} -
- ) : ( -
- -
- )} - {videoStatus === "READY" && ( - - )} - +
) : ( mediaUrl && (