mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
UI changes (#11863)
* Delay live ready being dropped * Handle case of removed camera
This commit is contained in:
parent
18d561da0e
commit
962d213699
@ -74,8 +74,8 @@ export function AnimatedEventCard({
|
|||||||
// image behavior
|
// image behavior
|
||||||
|
|
||||||
const aspectRatio = useMemo(() => {
|
const aspectRatio = useMemo(() => {
|
||||||
if (!config) {
|
if (!config || !Object.keys(config.cameras).includes(event.camera)) {
|
||||||
return 1;
|
return 16 / 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
const detect = config.cameras[event.camera].detect;
|
const detect = config.cameras[event.camera].detect;
|
||||||
|
@ -85,7 +85,7 @@ export default function LivePlayer({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!cameraActive) {
|
if (!cameraActive) {
|
||||||
setLiveReady(false);
|
setTimeout(() => setLiveReady(false), 500);
|
||||||
}
|
}
|
||||||
// live mode won't change
|
// live mode won't change
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
@ -94,7 +94,7 @@ export default function LivePlayer({
|
|||||||
// camera still state
|
// camera still state
|
||||||
|
|
||||||
const stillReloadInterval = useMemo(() => {
|
const stillReloadInterval = useMemo(() => {
|
||||||
if (!windowVisible || offline) {
|
if (!windowVisible || offline || !showStillWithoutActivity) {
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,6 +113,7 @@ export default function LivePlayer({
|
|||||||
return 30000;
|
return 30000;
|
||||||
}, [
|
}, [
|
||||||
autoLive,
|
autoLive,
|
||||||
|
showStillWithoutActivity,
|
||||||
liveReady,
|
liveReady,
|
||||||
activeMotion,
|
activeMotion,
|
||||||
activeTracking,
|
activeTracking,
|
||||||
@ -262,7 +263,7 @@ export default function LivePlayer({
|
|||||||
camera={cameraConfig.name}
|
camera={cameraConfig.name}
|
||||||
showFps={false}
|
showFps={false}
|
||||||
reloadInterval={stillReloadInterval}
|
reloadInterval={stillReloadInterval}
|
||||||
cameraClasses="relative w-full h-full flex justify-center"
|
cameraClasses="relative size-full flex justify-center"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user