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;
className?: string;
reloadInterval?: number;
fitAspect?: number;
};
const MIN_LOAD_TIMEOUT_MS = 200;

View File

@ -157,22 +157,18 @@ export default function LivePlayer({
{(showStillWithoutActivity == false || activeMotion || activeTracking) &&
player}
{showStillWithoutActivity && !liveReady && (
<div className="absolute left-0 top-0 right-0 bottom-0 w-full">
<div
className={`absolute left-0 top-0 right-0 bottom-0 w-full ${
showStillWithoutActivity && !liveReady ? "visible" : "invisible"
}`}
>
<AutoUpdatingCameraImage
className="w-full h-full"
camera={cameraConfig.name}
showFps={false}
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 className="absolute flex left-2 top-2 gap-2">
<Chip