Skip to content

Add object detection, tracking, mobile notifications, and search to any security camera.

i loop

roryclear2775b5c104b8
diff --git a/clearcam/player.html b/clearcam/player.html
index 2508749..8df6e2c 100644
--- a/clearcam/player.html
+++ b/clearcam/player.html
@@ -439,7 +439,8 @@
const oldTotalDuration = totalDuration;
let cumulativeStart = totalDuration;
- newSegments.forEach((segment) => {
+ for (let i = 0; i < newSegments.length; i++) {
+ const segment = newSegments[i];
const timeDifference = segment.timeDifference || segment.duration;
const lostFrames = timeDifference - segment.duration;
@@ -451,7 +452,8 @@
cumulativeStart: currentCumulativeStart,
lostFrames: lostFrames > 0 ? lostFrames : 0,
});
- });
+ }
+
totalDuration = segments.reduce((sum, seg) => sum + (seg.timeDifference || seg.duration), 0);