From d3c1c641b4addd871a4252437739a52a930ec38f Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 4 Jul 2026 12:48:15 +0800 Subject: [PATCH] fix(webui): show control bar in single-file fullscreen; theme the overlay The single-file player fullscreened the inner video-area element, which is not an ancestor of the control bar, so the bar was never visible in fullscreen. Fullscreen the player root instead so the floating control bar is included and the existing show-on-move / hide-after-idle logic works (YouTube-style). Also make the control-bar colors theme-aware in all cases. The fullscreen floating overlay now uses bg-card/90 + backdrop-blur + foreground text instead of a hardcoded dark overlay, so it follows the app light/dark theme. The former themedChrome prop is renamed to floatOverlayInFullScreen (default true = single-file floating overlay; compare passes false to keep its bar in-flow). --- .../compare/compare-control-bar.tsx | 2 +- .../components/viewers/video-control-bar.tsx | 39 +++++++------------ .../webui/components/viewers/video-player.tsx | 6 ++- 3 files changed, 18 insertions(+), 29 deletions(-) diff --git a/packages/webui/components/compare/compare-control-bar.tsx b/packages/webui/components/compare/compare-control-bar.tsx index 1f5fb776..6edc2925 100644 --- a/packages/webui/components/compare/compare-control-bar.tsx +++ b/packages/webui/components/compare/compare-control-bar.tsx @@ -76,7 +76,7 @@ export function CompareControlBar({ state={state} zoom={activeState.zoom} isControlsVisible - themedChrome + floatOverlayInFullScreen={false} buffered={v.buffered} data={data} resolutions={v.resolutions as DisplayTranscode[]} diff --git a/packages/webui/components/viewers/video-control-bar.tsx b/packages/webui/components/viewers/video-control-bar.tsx index 4d99d337..f1838b1e 100644 --- a/packages/webui/components/viewers/video-control-bar.tsx +++ b/packages/webui/components/viewers/video-control-bar.tsx @@ -68,11 +68,11 @@ export interface ControlBarProps { currentFrame: number seekToFrame: (frame: number) => Promise | void /** - * When true, keep the normal theme-aware chrome (bg-card / foreground text) - * even while fullscreen, instead of the dark video overlay style. Used by - * compare mode so its fullscreen bar follows the app light/dark theme. + * Whether the bar floats as an absolute overlay over the media while + * fullscreen (single-file player). Compare mode sets this false so the bar + * stays in-flow. Colors are always theme-aware regardless of this flag. */ - themedChrome?: boolean + floatOverlayInFullScreen?: boolean } export const VideoControlBar: React.FC = ({ @@ -96,7 +96,7 @@ export const VideoControlBar: React.FC = ({ totalFrames, currentFrame, seekToFrame, - themedChrome = false, + floatOverlayInFullScreen = true, }) => { const { videoTimeDisplayMode, setVideoTimeDisplayMode } = useUiStore() @@ -104,9 +104,9 @@ export const VideoControlBar: React.FC = ({ return null } - // Whether to render the dark video overlay chrome. Compare mode opts out - // (themedChrome) so its fullscreen bar follows the app light/dark theme. - const overlay = state.isFullScreen && !themedChrome + // Whether to render the bar as a floating overlay over the media (single-file + // fullscreen). Compare keeps it in-flow. Colors stay theme-aware either way. + const overlay = state.isFullScreen && floatOverlayInFullScreen const previewResolutions = resolutions.filter((r) => !r.isRaw) @@ -122,9 +122,9 @@ export const VideoControlBar: React.FC = ({ return (
= ({
{/* Lower Controls Row */} -
+
{/* Left Side: Play, Vol, Time */}
diff --git a/packages/webui/components/viewers/video-player.tsx b/packages/webui/components/viewers/video-player.tsx index 02ffec3f..7ea029f2 100644 --- a/packages/webui/components/viewers/video-player.tsx +++ b/packages/webui/components/viewers/video-player.tsx @@ -40,6 +40,7 @@ const VideoPlayer: React.FC = ({ // We use a container ref to manually append the video element const videoContainerRef = useRef(null) const containerRef = useRef(null) + const rootRef = useRef(null) const controlsTimeoutRef = useRef | null>(null) const [videoHtmlEl, setVideoHtmlEl] = useState(undefined) @@ -488,9 +489,9 @@ const VideoPlayer: React.FC = ({ } const toggleFullScreen = () => { - if (!containerRef.current) return + if (!rootRef.current) return if (!document.fullscreenElement) { - containerRef.current.requestFullscreen() + rootRef.current.requestFullscreen() setState((prev) => ({ ...prev, isFullScreen: true })) } else { document.exitFullscreen() @@ -543,6 +544,7 @@ const VideoPlayer: React.FC = ({ return (