@sentinel-nvr/web 0.19.2 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{chunk-7W5ORHOB.js → chunk-ZC64YDB2.js} +29 -17
- package/dist/chunk-ZC64YDB2.js.map +1 -0
- package/dist/{controller-DwyUCzWR.d.ts → controller-Ch_YXh1_.d.ts} +5 -2
- package/dist/player/index.d.ts +1 -1
- package/dist/player/index.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +27 -17
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-7W5ORHOB.js.map +0 -1
package/dist/ui/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PlayerController,
|
|
3
3
|
rlog
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-ZC64YDB2.js";
|
|
5
5
|
import {
|
|
6
6
|
SENTINEL_CLASS_PRIORITY,
|
|
7
7
|
SENTINEL_DAY_MS,
|
|
@@ -2277,6 +2277,7 @@ function CameraPage(p) {
|
|
|
2277
2277
|
useEffect4(() => {
|
|
2278
2278
|
ctl.current?.setClips(merged.clips, merged.codecs, merged.rangeStart, merged.rangeEnd);
|
|
2279
2279
|
}, [merged]);
|
|
2280
|
+
const frameServer = useCallback3(() => Object.values(daysRef.current).some((d) => sentinelHasFeature(d, "frame")), []);
|
|
2280
2281
|
const fetchDay = useCallback3(
|
|
2281
2282
|
async (ds) => {
|
|
2282
2283
|
const d = await client.getJson(
|
|
@@ -2360,16 +2361,20 @@ function CameraPage(p) {
|
|
|
2360
2361
|
setClipEdge(null);
|
|
2361
2362
|
setLoadError(false);
|
|
2362
2363
|
loading.current.clear();
|
|
2363
|
-
if (startAt) {
|
|
2364
|
-
if (posterTs) c.posterEvent(posterTs);
|
|
2365
|
-
} else {
|
|
2364
|
+
if (!startAt) {
|
|
2366
2365
|
c.posterFromSnapshot(lastTileSnapshot(camId));
|
|
2367
2366
|
c.goLive();
|
|
2368
2367
|
}
|
|
2369
2368
|
const t0 = todayStart();
|
|
2370
2369
|
const target = startAt ? sentinelDayOf(startAt) : t0;
|
|
2370
|
+
const first = ensureDay(target);
|
|
2371
|
+
if (startAt && posterTs)
|
|
2372
|
+
first.then(() => {
|
|
2373
|
+
if (c.camId === camId && ctl.current === c) c.posterEvent(posterTs, frameServer() ? startAt : void 0);
|
|
2374
|
+
}).catch(() => {
|
|
2375
|
+
});
|
|
2371
2376
|
Promise.all([
|
|
2372
|
-
|
|
2377
|
+
first,
|
|
2373
2378
|
ensureDay(sentinelAddDays(target, -1)),
|
|
2374
2379
|
target !== t0 ? ensureDay(t0) : Promise.resolve(),
|
|
2375
2380
|
target === t0 ? Promise.resolve() : ensureDay(sentinelAddDays(target, 1))
|
|
@@ -2395,7 +2400,7 @@ function CameraPage(p) {
|
|
|
2395
2400
|
deepRef.current = key;
|
|
2396
2401
|
const c = ctl.current;
|
|
2397
2402
|
c.freezeCurrent();
|
|
2398
|
-
if (posterTs) c.posterEvent(posterTs);
|
|
2403
|
+
if (posterTs) c.posterEvent(posterTs, frameServer() ? startAt : void 0);
|
|
2399
2404
|
goToDay(sentinelDayOf(startAt), startAt).catch(() => setLoadError(true));
|
|
2400
2405
|
}, [startAt, posterTs]);
|
|
2401
2406
|
useEffect4(() => {
|
|
@@ -2429,14 +2434,18 @@ function CameraPage(p) {
|
|
|
2429
2434
|
ctl.current?.goLive();
|
|
2430
2435
|
setJump({ ts: Date.now(), n: Date.now() });
|
|
2431
2436
|
}, []);
|
|
2432
|
-
const playEvent = useCallback3(
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2437
|
+
const playEvent = useCallback3(
|
|
2438
|
+
(ev) => {
|
|
2439
|
+
const c = ctl.current;
|
|
2440
|
+
if (!c) return;
|
|
2441
|
+
setTab("tl");
|
|
2442
|
+
c.freezeCurrent();
|
|
2443
|
+
const start = sentinelEventPlayTs(ev);
|
|
2444
|
+
c.posterEvent(ev.timestamp, frameServer() ? start : void 0);
|
|
2445
|
+
c.playAt(start, {});
|
|
2446
|
+
},
|
|
2447
|
+
[frameServer]
|
|
2448
|
+
);
|
|
2440
2449
|
const seekTo = useCallback3(
|
|
2441
2450
|
(ts) => {
|
|
2442
2451
|
const c = ctl.current;
|
|
@@ -2508,10 +2517,11 @@ function CameraPage(p) {
|
|
|
2508
2517
|
const c = ctl.current;
|
|
2509
2518
|
if (!c) return;
|
|
2510
2519
|
c.freezeCurrent();
|
|
2511
|
-
|
|
2512
|
-
c.
|
|
2520
|
+
const start = Math.max(r.from, oldestRec ?? -Infinity);
|
|
2521
|
+
c.posterEvent(ev.timestamp, frameServer() ? start : void 0);
|
|
2522
|
+
c.playAt(start, {});
|
|
2513
2523
|
},
|
|
2514
|
-
[oldestRec]
|
|
2524
|
+
[oldestRec, frameServer]
|
|
2515
2525
|
);
|
|
2516
2526
|
const closeClip = useCallback3(() => {
|
|
2517
2527
|
setClip(null);
|