diff --git a/src/client/channel/components/ChannelMedia.tsx b/src/client/channel/components/ChannelMedia.tsx index 24bf6a5b4..f78e55f19 100644 --- a/src/client/channel/components/ChannelMedia.tsx +++ b/src/client/channel/components/ChannelMedia.tsx @@ -122,6 +122,7 @@ export function ChannelWatchVideo({ player, owned, paused, label, presentation, const outputFailed = useSyncExternalStore(playbackOutput.subscribe, () => playbackOutput.failedFor(player.video), () => false); const showOutputRecovery = outputFailed && !player.error && !player.blocked; const waiting = player.waitingForPicture && !player.error && !player.blocked; + const nativeWaiting = native.mounted && waiting; const ownerPaused = player.video?.paused ?? mediaState?.paused ?? paused; const audioAvailable = player.media.audioAvailable?.() !== false; const [htmlMedia, setMedia] = useState({ position: 0, duration: 0, volume: 1, muted: false, rate: 1 }); @@ -149,7 +150,7 @@ export function ChannelWatchVideo({ player, owned, paused, label, presentation, const openOriginal = !owned && website && originalPageAvailable ? onAppWatch : undefined; const settingsOriginal = !player.error && surface.kind !== "external" && openOriginal; const localControls = !!player.video || !!receivingSettings || !!settingsOriginal || owned && !embedded; - const hasControls = localControls || !embedded && !thumbnail && !!mediaState; + const hasControls = nativeWaiting || localControls || !embedded && !thumbnail && !!mediaState; const failure = channelErrorPresentation(player.error, t, receiving?.mode === "peer" ? "watch.forward.failed" : website && player.video ? "watch.browserFailed" : "watch.failed").message; const diagnosis = player.error ? diagnoseChannelFact({ area: "error", code: player.error }) : null; @@ -225,7 +226,7 @@ export function ChannelWatchVideo({ player, owned, paused, label, presentation, document.addEventListener("fullscreenchange", sync); sync(); return () => { for (const name of events) video.removeEventListener(name, sync); document.removeEventListener("fullscreenchange", sync); }; }, [player]); - return
@@ -290,6 +291,9 @@ export function ChannelWatchVideo({ player, owned, paused, label, presentation, {owned && onPlayback({ paused: !ownerPaused })} />} {!thumbnail &&
+ {nativeWaiting && + {t("watch.waiting")} + } {ended && {t("watch.ended")}} {live?.active && !seekAvailable && {t("watch.live")}} {(!live || seekAvailable) && {live ? timeReadout : <>{formatMediaTime(position)}{` / ${formatMediaTime(media.duration || Number.NaN)}`}}} diff --git a/src/client/channel/components/channel-media.css b/src/client/channel/components/channel-media.css index af49f4324..0cb8e4c9f 100644 --- a/src/client/channel/components/channel-media.css +++ b/src/client/channel/components/channel-media.css @@ -81,7 +81,7 @@ .c3-watch-timeline input { height: 32px; border-radius: 6px; cursor: pointer; touch-action: pan-y; } .c3-watch-timeline input:disabled { cursor: default; } .c3-watch-position { display: flex; align-items: center; gap: 6px; min-width: 0; padding-inline: 2px; font-size: 12px; line-height: 1.2; } -.c3-watch-status { flex: none; white-space: nowrap; font-weight: 650; } +.c3-watch-status { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; font-weight: 650; } .c3-watch-time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; } .c3-watch-time[data-live] { white-space: normal; text-overflow: clip; } .c3-watch-position[data-seeking] .c3-watch-time { color: var(--action); } @@ -266,6 +266,7 @@ .c3-watch-page-thumbnail > svg { flex: none; } .c3-watch-native-slot { flex: 1 0 180px; min-width: 0; aspect-ratio: 16 / 9; } +.c3-watch-player[data-native-mounted] > .c3-watch-native-slot { flex-shrink: 1; min-height: 0; } .c3-watch-player[data-native-page] > .c3-mini-message { position: absolute; inset: 0 0 auto; pointer-events: none; } .c3-watch-player[data-native-page] > .c3-mini-message button { pointer-events: auto; } .c3-watch-output .lr-capture-device { width: 100%; padding: 0; pointer-events: auto; }