@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.cjs
CHANGED
|
@@ -471,6 +471,7 @@ var LIVE_FLV_CONFIG = {
|
|
|
471
471
|
var MAX_DRIFT_S = 2;
|
|
472
472
|
var EDGE_MARGIN_S = 0.4;
|
|
473
473
|
var AUDIO_RETRY_MS = 2500;
|
|
474
|
+
var ESTIMATED_LATENCY_MS = 3e3;
|
|
474
475
|
function stalledWithData(video, ms) {
|
|
475
476
|
if (video.currentTime > 0) return Promise.resolve(false);
|
|
476
477
|
return new Promise((resolve) => {
|
|
@@ -599,6 +600,15 @@ var FlvViewTransport = class {
|
|
|
599
600
|
}
|
|
600
601
|
return { bitrateKbps, framesPerSecond, latencyMs: void 0 };
|
|
601
602
|
}
|
|
603
|
+
/**
|
|
604
|
+
* Estimate only — see {@link ESTIMATED_LATENCY_MS}. Without this, captions
|
|
605
|
+
* never render on the FLV route at all: {@link MebiusCaptions} withholds
|
|
606
|
+
* every segment until the playhead reaches its `epochMs`, and a transport
|
|
607
|
+
* returning `null` here means the playhead comparison never runs.
|
|
608
|
+
*/
|
|
609
|
+
playheadEpochMs() {
|
|
610
|
+
return Date.now() - ESTIMATED_LATENCY_MS;
|
|
611
|
+
}
|
|
602
612
|
};
|
|
603
613
|
|
|
604
614
|
// src/internal/transport.ts
|