@sentinel-nvr/web 0.6.1 → 0.7.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.
@@ -76,9 +76,6 @@ declare class PlayerController {
76
76
  private rwPending;
77
77
  private rwLastSeekTs;
78
78
  private rwLastSeekAt;
79
- private rwRateBusy;
80
- private rwPendingRate;
81
- private rwLastRateAt;
82
79
  private relayPoll;
83
80
  private wdLastCt;
84
81
  private wdLastAt;
@@ -93,6 +90,11 @@ declare class PlayerController {
93
90
  private swapT;
94
91
  private posterFor;
95
92
  private scrubOffT;
93
+ private scrubMoves;
94
+ private rwTargetBusy;
95
+ private rwPendingTarget;
96
+ private rwLastTarget;
97
+ private rwLastTargetAt;
96
98
  private cmdSeq;
97
99
  private seekAt;
98
100
  private w;
@@ -149,8 +151,9 @@ declare class PlayerController {
149
151
  freezeHold(): void;
150
152
  /** Event click: the stored frame is the poster until the seek lands. */
151
153
  posterEvent(ts: number): void;
152
- /** Camera opened: newest snapshot in front of the black stage until live plays. */
153
- posterFromSnapshot(): void;
154
+ /** Camera opened: a picture in front of the black stage until live plays — the overview tile's snapshot when the host
155
+ * remembers one (browser cache → instant), else a fresh api/snapshot (1–3 s). */
156
+ posterFromSnapshot(tileUrl?: string): void;
154
157
  private posterShow;
155
158
  private safePlay;
156
159
  goLive(): void;
@@ -175,8 +178,10 @@ declare class PlayerController {
175
178
  private recFallbackMse;
176
179
  /** Hard server-side seek, coalesced: one in flight, latest wins, 150 ms floor. */
177
180
  private recRelaySeek;
178
- /** Scrub time-lapse rate, coalesced (120 ms floor, 15 % hysteresis). */
179
- private recRelayRate;
181
+ /** Scrub target (timeline centre), coalesced: one in flight, latest wins, 120 ms floor, 250 ms minimum step. */
182
+ private recRelayTarget;
183
+ /** profile on/off; `off` also ends the server's target steering, so it is sent even when the profile was never entered
184
+ * (single-notch gesture) as long as the gesture steered (`force`) */
180
185
  private recRelayScrub;
181
186
  private relayRecover;
182
187
  private startRelayPoll;
@@ -208,21 +213,17 @@ declare class PlayerController {
208
213
  fullscreen(): void;
209
214
  /** first gesture: scrub profile on (relay); MSE: freeze + pause */
210
215
  scrubBegin(): void;
211
- /** scroll position + velocity (timeline-ms per wall-s) while the gesture runs */
212
- scrubMove(_centerTs: number, vel: number, smoothTs: number): void;
213
- /** hold / release: land exactly on the centre at 1× (or go live near now) */
214
- scrubSeek(ts: number, srate?: number): void;
215
- /** true between the end of a gesture and its landing/profile switch (SCRUB_OFF_DELAY_MS): the timeline must not auto-follow
216
- * the playhead in that window — the time-lapse overshot the centre, following would drag the view away and the landing
217
- * seek would drag it back (visible back-and-forth of the timeline itself) */
216
+ /** true between the end of a gesture and the profile switch back (SCRUB_OFF_DELAY_MS): the timeline must not auto-follow
217
+ * the playhead in that window — the servo is still converging on the centre the user left */
218
218
  scrubSettling(): boolean;
219
- /** drift between the timeline centre and the playhead (null without a position) */
220
- private scrubDrift;
221
- /** brief hold mid-gesture (relay): time-lapse → 1× in place; a seek only when the picture is far off (each seek = ~2.4 s
222
- * of stale stream before the new picture — a seek per wheel step made the picture run back and forth). MSE: preview seek. */
219
+ /** scroll position while the gesture runs: the centre becomes the server's steering target (velocity unused since 0.7.0) */
220
+ scrubMove(centerTs: number, _vel: number, _smoothTs: number): void;
221
+ /** release / hard landing: near now → live; relay in scrub → just the final target (no seek: the servo stops there);
222
+ * MSE / no session → preview seek */
223
+ scrubSeek(ts: number, srate?: number): void;
224
+ /** brief hold mid-gesture: nothing to do on the relay (the target already stands), MSE: preview seek */
223
225
  scrubHold(ts: number): void;
224
- /** gesture settled → after SCRUB_OFF_DELAY_MS of quiet (a new gesture cancels it): land exactly on the centre if the
225
- * time-lapse drifted, then back to the normal profile. Landing per pause would be a seek per wheel step again. */
226
+ /** gesture settled → final target, then back to the normal profile after SCRUB_OFF_DELAY_MS of quiet (a new gesture cancels it) */
226
227
  scrubIdle(ts?: number): void;
227
228
  private hiddenTs;
228
229
  private onVisibility;
@@ -1,4 +1,4 @@
1
- export { P as PlayerController, a as PlayerLabel, b as PlayerOptions, c as PlayerRefs, d as PlayerState } from '../controller-D_79fqRP.js';
1
+ export { P as PlayerController, a as PlayerLabel, b as PlayerOptions, c as PlayerRefs, d as PlayerState } from '../controller-91737fq7.js';
2
2
  import { e as SentinelClient } from '../client-Dtfs8TX2.js';
3
3
 
4
4
  /**
@@ -4,7 +4,7 @@ import {
4
4
  mobileClient,
5
5
  rlog,
6
6
  setRlogClient
7
- } from "../chunk-2AXKPVPR.js";
7
+ } from "../chunk-ECFTCXR4.js";
8
8
  export {
9
9
  PlayerController,
10
10
  WebRtcSession,
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { e as SentinelClient, j as SentinelEventClass, l as SentinelRecentEvent, d as SentinelCamera, h as SentinelEvent, o as SentinelStats, f as SentinelClip } from '../client-Dtfs8TX2.js';
4
- import { d as PlayerState } from '../controller-D_79fqRP.js';
4
+ import { d as PlayerState } from '../controller-91737fq7.js';
5
5
 
6
6
  /**
7
7
  * Minimal translation core with the same dictionary semantics as HAPulse:
package/dist/ui/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  PlayerController,
21
21
  rlog
22
- } from "../chunk-2AXKPVPR.js";
22
+ } from "../chunk-ECFTCXR4.js";
23
23
 
24
24
  // src/ui/context.tsx
25
25
  import { createContext, useContext } from "react";
@@ -458,6 +458,17 @@ function EventsStrip({ events }) {
458
458
  // src/ui/components/CameraGrid.tsx
459
459
  import { useEffect, useState } from "react";
460
460
  import { Camera, WifiOff } from "lucide-react";
461
+
462
+ // src/ui/snapshot-cache.ts
463
+ var last = /* @__PURE__ */ new Map();
464
+ function rememberTileSnapshot(camId, url) {
465
+ last.set(camId, url);
466
+ }
467
+ function lastTileSnapshot(camId) {
468
+ return last.get(camId);
469
+ }
470
+
471
+ // src/ui/components/CameraGrid.tsx
461
472
  import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
462
473
  var SNAPSHOT_MS = 5e3;
463
474
  var RETRY_EVERY = 6;
@@ -488,7 +499,7 @@ function CameraTile({ cam, tick, n }) {
488
499
  },
489
500
  "aria-label": cam.name,
490
501
  children: [
491
- src ? /* @__PURE__ */ jsx4("img", { className: "nvr-camtile__img", src, alt: "", onError: () => setFailed((f) => Math.min(2, f + 1)) }) : /* @__PURE__ */ jsx4("div", { className: "nvr-camtile__placeholder", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(Camera, { size: 32, strokeWidth: 1.5 }) }),
502
+ src ? /* @__PURE__ */ jsx4("img", { className: "nvr-camtile__img", src, alt: "", onLoad: () => rememberTileSnapshot(cam.id, src), onError: () => setFailed((f) => Math.min(2, f + 1)) }) : /* @__PURE__ */ jsx4("div", { className: "nvr-camtile__placeholder", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(Camera, { size: 32, strokeWidth: 1.5 }) }),
492
503
  /* @__PURE__ */ jsxs2("span", { className: "nvr-camtile__name", children: [
493
504
  cam.name,
494
505
  cam.recording && /* @__PURE__ */ jsx4("i", { className: `nvr-camtile__dot${cam.online ? "" : " nvr-camtile__dot--off"}`, "aria-hidden": "true" })
@@ -1223,7 +1234,7 @@ function CameraPage(p) {
1223
1234
  setLoadError(false);
1224
1235
  loading.current.clear();
1225
1236
  if (startAt) c.posterEvent(posterTs || startAt);
1226
- else c.posterFromSnapshot();
1237
+ else c.posterFromSnapshot(lastTileSnapshot(camId));
1227
1238
  const t0 = todayStart();
1228
1239
  const target = startAt ? sentinelDayOf(startAt) : t0;
1229
1240
  Promise.all([ensureDay(target), ensureDay(target - SENTINEL_DAY_MS), target !== t0 ? ensureDay(t0) : Promise.resolve(), target === t0 ? Promise.resolve() : ensureDay(target + SENTINEL_DAY_MS)]).then(() => {