From e928662bc93e88171bb226d1fcd833ba14f61da4 Mon Sep 17 00:00:00 2001 From: Nitish Agarwal <1592163+nitishagar@users.noreply.github.com> Date: Sun, 16 Nov 2025 12:12:50 +0530 Subject: [PATCH] fix: show HDMI overlays in fullscreen mode Fixes #919 where HDMI error overlays ("No HDMI signal detected") were not visible when video was in fullscreen mode. Changes: - Add fullscreenContainerRef to target the container div - Update requestFullscreen() to make container fullscreen instead of video - Update releaseKeyboardLock() to check container instead of video - Attach ref to container div that includes both video and overlays This ensures overlays are descendants of the fullscreen element and thus visible according to the Fullscreen API specification. Previously: video element went fullscreen, overlays (siblings) invisible Now: container with video + overlays goes fullscreen, all visible --- ui/src/components/WebRTCVideo.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ui/src/components/WebRTCVideo.tsx b/ui/src/components/WebRTCVideo.tsx index ec3920127..c54d2b8d4 100644 --- a/ui/src/components/WebRTCVideo.tsx +++ b/ui/src/components/WebRTCVideo.tsx @@ -26,6 +26,7 @@ import { m } from "@localizations/messages.js"; export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssues: boolean }) { // Video and stream related refs and states const videoElm = useRef(null); + const fullscreenContainerRef = useRef(null); const { mediaStream, peerConnectionState } = useRTCStore(); const [isPlaying, setIsPlaying] = useState(false); const [isPointerLockActive, setIsPointerLockActive] = useState(false); @@ -150,7 +151,7 @@ export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssu }, [checkNavigatorPermissions, setIsKeyboardLockActive]); const releaseKeyboardLock = useCallback(async () => { - if (videoElm.current === null || document.fullscreenElement !== videoElm.current) return; + if (fullscreenContainerRef.current === null || document.fullscreenElement !== fullscreenContainerRef.current) return; if (navigator && "keyboard" in navigator) { try { @@ -187,7 +188,7 @@ export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssu }, [isPointerLockPossible]); const requestFullscreen = useCallback(async () => { - if (!isFullscreenEnabled || !videoElm.current) return; + if (!isFullscreenEnabled || !fullscreenContainerRef.current) return; // per https://wicg.github.io/keyboard-lock/#system-key-press-handler // If keyboard lock is activated after fullscreen is already in effect, then the user my @@ -196,7 +197,7 @@ export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssu await requestKeyboardLock(); await requestPointerLock(); - await videoElm.current.requestFullscreen({ + await fullscreenContainerRef.current.requestFullscreen({ navigationUI: "show", }); }, [isFullscreenEnabled, requestKeyboardLock, requestPointerLock]); @@ -512,7 +513,10 @@ export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssu {/* In relative mouse mode and under https, we enable the pointer lock, and to do so we need a bar to show the user to click on the video to enable mouse control */}
-
+