From 398652672c49694c6ec70d61a6c73a6a3584134d Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 10 Jun 2024 14:27:56 -0600 Subject: [PATCH] Delay live ready being dropped --- web/src/components/player/LivePlayer.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index ffa1579dc..9343f7b16 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -85,7 +85,7 @@ export default function LivePlayer({ } if (!cameraActive) { - setLiveReady(false); + setTimeout(() => setLiveReady(false), 500); } // live mode won't change // eslint-disable-next-line react-hooks/exhaustive-deps @@ -94,7 +94,7 @@ export default function LivePlayer({ // camera still state const stillReloadInterval = useMemo(() => { - if (!windowVisible || offline) { + if (!windowVisible || offline || !showStillWithoutActivity) { return -1; // no reason to update the image when the window is not visible } @@ -113,6 +113,7 @@ export default function LivePlayer({ return 30000; }, [ autoLive, + showStillWithoutActivity, liveReady, activeMotion, activeTracking, @@ -252,7 +253,7 @@ export default function LivePlayer({ camera={cameraConfig.name} showFps={false} reloadInterval={stillReloadInterval} - cameraClasses="relative w-full h-full flex justify-center" + cameraClasses="relative size-full flex justify-center" />