don't flash when going to still image

This commit is contained in:
Nicolas Mowen 2024-02-09 07:36:29 -07:00
parent caf4ed0854
commit b6ca0d17f9
2 changed files with 12 additions and 17 deletions

View File

@ -7,7 +7,6 @@ type AutoUpdatingCameraImageProps = {
showFps?: boolean; showFps?: boolean;
className?: string; className?: string;
reloadInterval?: number; reloadInterval?: number;
fitAspect?: number;
}; };
const MIN_LOAD_TIMEOUT_MS = 200; const MIN_LOAD_TIMEOUT_MS = 200;

View File

@ -157,22 +157,18 @@ export default function LivePlayer({
{(showStillWithoutActivity == false || activeMotion || activeTracking) && {(showStillWithoutActivity == false || activeMotion || activeTracking) &&
player} player}
{showStillWithoutActivity && !liveReady && ( <div
<div className="absolute left-0 top-0 right-0 bottom-0 w-full"> className={`absolute left-0 top-0 right-0 bottom-0 w-full ${
showStillWithoutActivity && !liveReady ? "visible" : "invisible"
}`}
>
<AutoUpdatingCameraImage <AutoUpdatingCameraImage
className="w-full h-full" className="w-full h-full"
camera={cameraConfig.name} camera={cameraConfig.name}
showFps={false} showFps={false}
reloadInterval={30000} reloadInterval={30000}
fitAspect={
cameraConfig.detect.width / cameraConfig.detect.height > 2 ||
cameraConfig.detect.width / cameraConfig.detect.height < 1
? cameraConfig.detect.width / cameraConfig.detect.height
: 16 / 9
}
/> />
</div> </div>
)}
<div className="absolute flex left-2 top-2 gap-2"> <div className="absolute flex left-2 top-2 gap-2">
<Chip <Chip