@7365admin1/layer-common 4.59.2 → 4.59.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.59.3
4
+
5
+ ### Patch Changes
6
+
7
+ - cae7fd1: Robot live view: turn on hls.js low-latency mode so the 1.2x catch-up actually runs after a hiccup (without it hls.js never changes the playback rate).
8
+ - 40b1293: Robot live view: sit 6 s behind the newest picture instead of hls.js's default 12 s, catch up at up to 1.2x after a hiccup, jump forward past 14 s.
9
+
3
10
  ## 4.59.2
4
11
 
5
12
  ### Patch Changes
@@ -1648,11 +1655,11 @@
1648
1655
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1649
1656
  own rule from two endpoints the console already calls, unprojected:
1650
1657
 
1651
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1652
- GET /api/roles/id/:role that membership's role document
1658
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1659
+ GET /api/roles/id/:role that membership's role document
1653
1660
 
1654
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1655
- staff = member.type === "admin" && role.type === "admin"
1661
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1662
+ staff = member.type === "admin" && role.type === "admin"
1656
1663
 
1657
1664
  `role.default` is the marker because it is the only property of a platform
1658
1665
  staff role no API caller can set - `role.controller.ts` validates create and
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.59.2",
5
+ "version": "4.59.3",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -180,6 +180,27 @@ export function writeLivePref(storage: Pick<Storage, "setItem"> | undefined, on:
180
180
  /** hls.js errors that mean "this browser cannot decode the codec", not "the camera is down". */
181
181
  const CODEC_ERRORS = new Set(["manifestIncompatibleCodecsError", "bufferAddCodecError", "bufferIncompatibleCodecsError"]);
182
182
 
183
+ /**
184
+ * hls.js live settings. The robot camera (EZVIZ via PadBot) serves plain HLS
185
+ * v3: 4 s segments, a 3-segment window, no LL-HLS parts. hls.js's default
186
+ * sits 3 segments (12 s) behind the newest picture and never catches up after
187
+ * a hiccup - the owner's "10-15 s delay". Now: 6 s behind (1.5 segments, so
188
+ * one late segment does not stall), play up to 1.2x to win back time lost to
189
+ * a hiccup, and jump forward if it ever falls 14 s behind.
190
+ * `lowLatencyMode` must be on for the catch-up: hls.js only adjusts the
191
+ * playback rate in low-latency mode (it is harmless on a plain playlist - no
192
+ * parts, nothing else changes).
193
+ * ponytail: a lower-latency protocol (FLV / WebRTC) is not offered by PadBot's
194
+ * §6.5 video API; ask PadBot if 6 s is still too slow.
195
+ */
196
+ export const LIVE_HLS_CONFIG = {
197
+ enableWorker: true,
198
+ lowLatencyMode: true,
199
+ liveSyncDuration: 6,
200
+ liveMaxLatencyDuration: 14,
201
+ maxLiveSyncPlaybackRate: 1.2,
202
+ } as const;
203
+
183
204
  /**
184
205
  * Plays one live-view URL into `video`. Returns a stop function that frees the
185
206
  * player and the connection.
@@ -286,7 +307,7 @@ export function startLivePlayer(
286
307
  video.addEventListener("error", noteDecode);
287
308
  let recoveries = 0;
288
309
  const Base = Hls.DefaultConfig?.loader;
289
- const h = (hls = new Hls({ enableWorker: true, lowLatencyMode: false, ...(Base ? { fLoader: strayAudLoader(Base) } : {}) }));
310
+ const h = (hls = new Hls({ ...LIVE_HLS_CONFIG, ...(Base ? { fLoader: strayAudLoader(Base) } : {}) }));
290
311
  h.on("hlsError", (_e, data) => {
291
312
  noteDecode();
292
313
  if (!data.fatal) return;