diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx
index f5e071c9f..4e23b698d 100644
--- a/web/src/components/player/LivePlayer.tsx
+++ b/web/src/components/player/LivePlayer.tsx
@@ -152,12 +152,12 @@ export default function LivePlayer({
}
return (
-
+
{(showStillWithoutActivity == false || activeMotion || activeTracking) &&
player}
{showStillWithoutActivity && !liveReady && (
-
+
2 ||
cameraConfig.detect.width / cameraConfig.detect.height < 1
- ? undefined
+ ? cameraConfig.detect.width / cameraConfig.detect.height
: 16 / 9
}
/>
diff --git a/web/src/hooks/use-camera-activity.ts b/web/src/hooks/use-camera-activity.ts
index 1493d6518..823220245 100644
--- a/web/src/hooks/use-camera-activity.ts
+++ b/web/src/hooks/use-camera-activity.ts
@@ -34,22 +34,26 @@ export default function useCameraActivity(
return;
}
- if (event.type == "end") {
- const eventIndex = activeObjects.indexOf(event.after.id);
+ const eventIndex = activeObjects.indexOf(event.after.id);
+ if (event.type == "end") {
if (eventIndex != -1) {
const newActiveObjects = [...activeObjects];
newActiveObjects.splice(eventIndex, 1);
setActiveObjects(newActiveObjects);
}
} else {
- if (!event.after.stationary) {
- const eventIndex = activeObjects.indexOf(event.after.id);
-
- if (eventIndex == -1) {
+ if (eventIndex == -1) {
+ // add unknown event to list if not stationary
+ if (!event.after.stationary) {
const newActiveObjects = [...activeObjects, event.after.id];
setActiveObjects(newActiveObjects);
}
+ } else {
+ // remove known event from list if it has become stationary
+ if (event.after.stationary) {
+ activeObjects.splice(eventIndex, 1);
+ }
}
}
}, [event, activeObjects]);