mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +03:00
Ensure still is updated on player live finish
This commit is contained in:
parent
6cbd6becc6
commit
89c06068a9
@ -29,6 +29,7 @@ export default function LivePlayer({
|
|||||||
windowVisible = true,
|
windowVisible = true,
|
||||||
}: LivePlayerProps) {
|
}: LivePlayerProps) {
|
||||||
// camera activity
|
// camera activity
|
||||||
|
|
||||||
const { activeMotion, activeAudio, activeTracking } =
|
const { activeMotion, activeAudio, activeTracking } =
|
||||||
useCameraActivity(cameraConfig);
|
useCameraActivity(cameraConfig);
|
||||||
|
|
||||||
@ -36,6 +37,9 @@ export default function LivePlayer({
|
|||||||
() => windowVisible && (activeMotion || activeTracking),
|
() => windowVisible && (activeMotion || activeTracking),
|
||||||
[activeMotion, activeTracking, windowVisible]
|
[activeMotion, activeTracking, windowVisible]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// camera live state
|
||||||
|
|
||||||
const liveMode = useCameraLiveMode(cameraConfig, preferredLiveMode);
|
const liveMode = useCameraLiveMode(cameraConfig, preferredLiveMode);
|
||||||
|
|
||||||
const [liveReady, setLiveReady] = useState(false);
|
const [liveReady, setLiveReady] = useState(false);
|
||||||
@ -55,6 +59,20 @@ export default function LivePlayer({
|
|||||||
|
|
||||||
const { payload: recording } = useRecordingsState(cameraConfig.name);
|
const { payload: recording } = useRecordingsState(cameraConfig.name);
|
||||||
|
|
||||||
|
// camera still state
|
||||||
|
|
||||||
|
const stillReloadInterval = useMemo(() => {
|
||||||
|
if (liveReady) {
|
||||||
|
return 60000;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cameraActive) {
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 30000;
|
||||||
|
}, []);
|
||||||
|
|
||||||
if (!cameraConfig) {
|
if (!cameraConfig) {
|
||||||
return <ActivityIndicator />;
|
return <ActivityIndicator />;
|
||||||
}
|
}
|
||||||
@ -120,7 +138,7 @@ export default function LivePlayer({
|
|||||||
className="w-full h-full"
|
className="w-full h-full"
|
||||||
camera={cameraConfig.name}
|
camera={cameraConfig.name}
|
||||||
showFps={false}
|
showFps={false}
|
||||||
reloadInterval={cameraActive && !liveReady ? 200 : 30000}
|
reloadInterval={stillReloadInterval}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user