Skip to content

NVR with realtime local object detection for IP cameras

fix mse buffer trim spinning in a remove loop (#24643)

Josh Hawkinscf67f0891311
diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsx
index e8daed4437..a8856d671e 100644
--- a/web/src/components/player/MsePlayer.tsx
+++ b/web/src/components/player/MsePlayer.tsx
@@ -473,7 +473,7 @@ function MSEPlayer({
} else if (sb.buffered && sb.buffered.length) {
const end = sb.buffered.end(sb.buffered.length - 1) - 15;
const start = sb.buffered.start(0);
- if (end > start) {
+ if (end - start > 1) {
sb.remove(start, end);
msRef.current?.setLiveSeekableRange(end, end + 15);
}