diff --git a/web/src/components/camera/AutoUpdatingCameraImage.tsx b/web/src/components/camera/AutoUpdatingCameraImage.tsx index 810ed82d1..d51768be7 100644 --- a/web/src/components/camera/AutoUpdatingCameraImage.tsx +++ b/web/src/components/camera/AutoUpdatingCameraImage.tsx @@ -23,6 +23,10 @@ export default function AutoUpdatingCameraImage({ const [timeoutId, setTimeoutId] = useState(); useEffect(() => { + if (reloadInterval == -1) { + return; + } + setKey(Date.now()); return () => { @@ -34,6 +38,10 @@ export default function AutoUpdatingCameraImage({ }, [reloadInterval]); const handleLoad = useCallback(() => { + if (reloadInterval == -1) { + return; + } + const loadTime = Date.now() - key; if (showFps) { diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index c19319ad7..c190fe9d1 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -62,6 +62,10 @@ export default function LivePlayer({ // camera still state const stillReloadInterval = useMemo(() => { + if (!windowVisible) { + return -1; // no reason to update the image when the window is not visible + } + if (liveReady) { return 60000; }