mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix live view updating when it shouldn't be (#11561)
* Simplify live image update logic * Fix case where go2rtc is not setup
This commit is contained in:
parent
c07f6999ca
commit
a86e22e0fc
@ -80,7 +80,7 @@ export default function LivePlayer({
|
|||||||
// camera still state
|
// camera still state
|
||||||
|
|
||||||
const stillReloadInterval = useMemo(() => {
|
const stillReloadInterval = useMemo(() => {
|
||||||
if (!windowVisible) {
|
if (!windowVisible || offline) {
|
||||||
return -1; // no reason to update the image when the window is not visible
|
return -1; // no reason to update the image when the window is not visible
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,12 +88,12 @@ export default function LivePlayer({
|
|||||||
return 60000;
|
return 60000;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cameraActive) {
|
if (activeMotion || activeTracking) {
|
||||||
return 200;
|
return 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 30000;
|
return 30000;
|
||||||
}, [liveReady, cameraActive, windowVisible]);
|
}, [liveReady, activeMotion, activeTracking, offline, windowVisible]);
|
||||||
|
|
||||||
if (!cameraConfig) {
|
if (!cameraConfig) {
|
||||||
return <ActivityIndicator />;
|
return <ActivityIndicator />;
|
||||||
@ -135,14 +135,18 @@ export default function LivePlayer({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else if (liveMode == "jsmpeg") {
|
} else if (liveMode == "jsmpeg") {
|
||||||
player = (
|
if (cameraActive) {
|
||||||
<JSMpegPlayer
|
player = (
|
||||||
className="flex size-full justify-center overflow-hidden rounded-lg md:rounded-2xl"
|
<JSMpegPlayer
|
||||||
camera={cameraConfig.live.stream_name}
|
className="flex size-full justify-center overflow-hidden rounded-lg md:rounded-2xl"
|
||||||
width={cameraConfig.detect.width}
|
camera={cameraConfig.live.stream_name}
|
||||||
height={cameraConfig.detect.height}
|
width={cameraConfig.detect.width}
|
||||||
/>
|
height={cameraConfig.detect.height}
|
||||||
);
|
/>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
player = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
player = <ActivityIndicator />;
|
player = <ActivityIndicator />;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user