@7365admin1/layer-common 4.35.1-staging.413 → 4.35.1-staging.415
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/package.json +1 -1
- package/utils/robot-control.ts +22 -1
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.35.1-staging.
|
|
5
|
+
"version": "4.35.1-staging.415",
|
|
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.",
|
package/utils/robot-control.ts
CHANGED
|
@@ -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({
|
|
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;
|