@mebius-io/web 0.5.1 → 0.5.2
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/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +10 -0
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -429,6 +429,7 @@ var LIVE_FLV_CONFIG = {
|
|
|
429
429
|
var MAX_DRIFT_S = 2;
|
|
430
430
|
var EDGE_MARGIN_S = 0.4;
|
|
431
431
|
var AUDIO_RETRY_MS = 2500;
|
|
432
|
+
var ESTIMATED_LATENCY_MS = 3e3;
|
|
432
433
|
function stalledWithData(video, ms) {
|
|
433
434
|
if (video.currentTime > 0) return Promise.resolve(false);
|
|
434
435
|
return new Promise((resolve) => {
|
|
@@ -557,6 +558,15 @@ var FlvViewTransport = class {
|
|
|
557
558
|
}
|
|
558
559
|
return { bitrateKbps, framesPerSecond, latencyMs: void 0 };
|
|
559
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* Estimate only — see {@link ESTIMATED_LATENCY_MS}. Without this, captions
|
|
563
|
+
* never render on the FLV route at all: {@link MebiusCaptions} withholds
|
|
564
|
+
* every segment until the playhead reaches its `epochMs`, and a transport
|
|
565
|
+
* returning `null` here means the playhead comparison never runs.
|
|
566
|
+
*/
|
|
567
|
+
playheadEpochMs() {
|
|
568
|
+
return Date.now() - ESTIMATED_LATENCY_MS;
|
|
569
|
+
}
|
|
560
570
|
};
|
|
561
571
|
|
|
562
572
|
// src/internal/transport.ts
|