@mebius-io/web 0.5.0 → 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 +18 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.global.js +18 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -262,6 +262,13 @@ declare class SignalingClient {
|
|
|
262
262
|
* Realtime captions SSE URL. Same play token as media — the engine's
|
|
263
263
|
* `PlayVerifier` gates both, so a viewer who can watch the stream can already
|
|
264
264
|
* read its captions with zero extra credential.
|
|
265
|
+
*
|
|
266
|
+
* `/api/v1/live/...`, NOT `/live/...`: unlike {@link scalePlaylistUrl}, which
|
|
267
|
+
* hits the engine's bare `/live/*` media-edge catch-all, captions are mounted
|
|
268
|
+
* under the versioned control-API group (mebius-stream-engine
|
|
269
|
+
* internal/api/routes.go) with the play-token middleware, not the proxy.
|
|
270
|
+
* Copying the media-edge prefix here 401s every request — the catch-all
|
|
271
|
+
* doesn't recognise the path and never reaches the captions handler at all.
|
|
265
272
|
*/
|
|
266
273
|
captionsUrl(streamId: string, lang: string): string;
|
|
267
274
|
private pathFor;
|
package/dist/index.d.ts
CHANGED
|
@@ -262,6 +262,13 @@ declare class SignalingClient {
|
|
|
262
262
|
* Realtime captions SSE URL. Same play token as media — the engine's
|
|
263
263
|
* `PlayVerifier` gates both, so a viewer who can watch the stream can already
|
|
264
264
|
* read its captions with zero extra credential.
|
|
265
|
+
*
|
|
266
|
+
* `/api/v1/live/...`, NOT `/live/...`: unlike {@link scalePlaylistUrl}, which
|
|
267
|
+
* hits the engine's bare `/live/*` media-edge catch-all, captions are mounted
|
|
268
|
+
* under the versioned control-API group (mebius-stream-engine
|
|
269
|
+
* internal/api/routes.go) with the play-token middleware, not the proxy.
|
|
270
|
+
* Copying the media-edge prefix here 401s every request — the catch-all
|
|
271
|
+
* doesn't recognise the path and never reaches the captions handler at all.
|
|
265
272
|
*/
|
|
266
273
|
captionsUrl(streamId: string, lang: string): string;
|
|
267
274
|
private pathFor;
|
package/dist/index.global.js
CHANGED
|
@@ -43047,6 +43047,7 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
43047
43047
|
var MAX_DRIFT_S = 2;
|
|
43048
43048
|
var EDGE_MARGIN_S = 0.4;
|
|
43049
43049
|
var AUDIO_RETRY_MS = 2500;
|
|
43050
|
+
var ESTIMATED_LATENCY_MS = 3e3;
|
|
43050
43051
|
function stalledWithData(video, ms) {
|
|
43051
43052
|
if (video.currentTime > 0) return Promise.resolve(false);
|
|
43052
43053
|
return new Promise((resolve) => {
|
|
@@ -43175,6 +43176,15 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
43175
43176
|
}
|
|
43176
43177
|
return { bitrateKbps, framesPerSecond, latencyMs: void 0 };
|
|
43177
43178
|
}
|
|
43179
|
+
/**
|
|
43180
|
+
* Estimate only — see {@link ESTIMATED_LATENCY_MS}. Without this, captions
|
|
43181
|
+
* never render on the FLV route at all: {@link MebiusCaptions} withholds
|
|
43182
|
+
* every segment until the playhead reaches its `epochMs`, and a transport
|
|
43183
|
+
* returning `null` here means the playhead comparison never runs.
|
|
43184
|
+
*/
|
|
43185
|
+
playheadEpochMs() {
|
|
43186
|
+
return Date.now() - ESTIMATED_LATENCY_MS;
|
|
43187
|
+
}
|
|
43178
43188
|
};
|
|
43179
43189
|
|
|
43180
43190
|
// src/internal/transport.ts
|
|
@@ -43759,10 +43769,17 @@ Schedule: ${scheduleItems.map((seg) => segmentToString(seg))} pos: ${this.timeli
|
|
|
43759
43769
|
* Realtime captions SSE URL. Same play token as media — the engine's
|
|
43760
43770
|
* `PlayVerifier` gates both, so a viewer who can watch the stream can already
|
|
43761
43771
|
* read its captions with zero extra credential.
|
|
43772
|
+
*
|
|
43773
|
+
* `/api/v1/live/...`, NOT `/live/...`: unlike {@link scalePlaylistUrl}, which
|
|
43774
|
+
* hits the engine's bare `/live/*` media-edge catch-all, captions are mounted
|
|
43775
|
+
* under the versioned control-API group (mebius-stream-engine
|
|
43776
|
+
* internal/api/routes.go) with the play-token middleware, not the proxy.
|
|
43777
|
+
* Copying the media-edge prefix here 401s every request — the catch-all
|
|
43778
|
+
* doesn't recognise the path and never reaches the captions handler at all.
|
|
43762
43779
|
*/
|
|
43763
43780
|
captionsUrl(streamId, lang) {
|
|
43764
43781
|
return this.withToken(
|
|
43765
|
-
`${this.base()}/live/${encodeURIComponent(streamId)}/captions?lang=${encodeURIComponent(lang)}`
|
|
43782
|
+
`${this.base()}/api/v1/live/${encodeURIComponent(streamId)}/captions?lang=${encodeURIComponent(lang)}`
|
|
43766
43783
|
);
|
|
43767
43784
|
}
|
|
43768
43785
|
// Maps a neutral session kind to the concrete signaling path segment. This
|