@vindral/web-sdk 4.2.0-39-ga28acfd3 → 4.2.0-40-g922061e1
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/{1VLuVA6L.js → BT8UHpCp.js} +165 -155
- package/{CIZnVE4T.js → CIR1d13o.js} +1 -1
- package/core.js +1 -1
- package/legacy.es.js +297 -287
- package/legacy.umd.js +7 -7
- package/package.json +1 -1
- package/player.js +2 -2
- package/vindral-player-component.js +2 -2
|
@@ -8528,7 +8528,7 @@ var l_ = 1e3, u_ = 50, d_ = class t {
|
|
|
8528
8528
|
e(p_, "CHECK_INTERVAL", 1e3);
|
|
8529
8529
|
//#endregion
|
|
8530
8530
|
//#region ../../libs/web-audio-player/src/AudioPlayer.ts
|
|
8531
|
-
var m_, h_ = 400, g_ = class extends _e {
|
|
8531
|
+
var m_, h_ = 150, g_ = 400, __ = (e) => e === void 0 ? 5 : e <= h_ ? 1 : e <= g_ ? 2 : 5, v_ = class extends _e {
|
|
8532
8532
|
get isContextRunning() {
|
|
8533
8533
|
var e;
|
|
8534
8534
|
return ((e = this.audio) == null ? void 0 : e.state) === "running";
|
|
@@ -8565,12 +8565,18 @@ var m_, h_ = 400, g_ = class extends _e {
|
|
|
8565
8565
|
set currentTime(e) {
|
|
8566
8566
|
this.logger.debug("setting current time to", { currentTime: e }), this.startTimeIsInvalidated = !0;
|
|
8567
8567
|
}
|
|
8568
|
+
get bufferTime() {
|
|
8569
|
+
return this._bufferTime;
|
|
8570
|
+
}
|
|
8571
|
+
set bufferTime(e) {
|
|
8572
|
+
this._bufferTime = e, this.audioBufferMultiplier = __(e);
|
|
8573
|
+
}
|
|
8568
8574
|
get audioNode() {
|
|
8569
8575
|
return this.splitter;
|
|
8570
8576
|
}
|
|
8571
8577
|
constructor(n, r, { muted: i, reInitWhenStuck: a, bufferTime: s }) {
|
|
8572
8578
|
var c;
|
|
8573
|
-
super(), c = this, e(this, "logger", void 0), e(this, "audio", void 0), e(this, "gainNode", void 0), e(this, "splitter", void 0), e(this, "_volume", 1), e(this, "_userProvidedMuted", !1), e(this, "_muted", !1), e(this, "startTime", 0), e(this, "samples", new Float32Array()), e(this, "preInitSampleQueue", new _(500)), e(this, "unplayedBufferSources", new _(100)), e(this, "sampleRate", 48e3), e(this, "channels", 2), e(this, "index", 0), e(this, "clockSource", void 0), e(this, "clockDelta", void 0), e(this, "startTimeIsInvalidated", !0), e(this, "lastSampleTimestamp", 0), e(this, "reInitWhenStuck", void 0), e(this, "ignoreSuspendCalls", !1), e(this, "audioBufferMultiplier", void 0), e(this, "isActivated", !1), e(this, "unload", t(function* () {
|
|
8579
|
+
super(), c = this, e(this, "logger", void 0), e(this, "audio", void 0), e(this, "gainNode", void 0), e(this, "splitter", void 0), e(this, "_volume", 1), e(this, "_userProvidedMuted", !1), e(this, "_muted", !1), e(this, "startTime", 0), e(this, "samples", new Float32Array()), e(this, "preInitSampleQueue", new _(500)), e(this, "unplayedBufferSources", new _(100)), e(this, "sampleRate", 48e3), e(this, "channels", 2), e(this, "index", 0), e(this, "clockSource", void 0), e(this, "clockDelta", void 0), e(this, "startTimeIsInvalidated", !0), e(this, "lastSampleTimestamp", 0), e(this, "reInitWhenStuck", void 0), e(this, "ignoreSuspendCalls", !1), e(this, "_bufferTime", void 0), e(this, "audioBufferMultiplier", void 0), e(this, "isActivated", !1), e(this, "unload", t(function* () {
|
|
8574
8580
|
var e, t;
|
|
8575
8581
|
(e = c.gainNode) == null || e.disconnect(), yield (t = c.audio) == null ? void 0 : t.unload(), c.reset(), c.audio = void 0, c.gainNode = void 0;
|
|
8576
8582
|
})), e(this, "suspend", () => {
|
|
@@ -8660,7 +8666,7 @@ var m_, h_ = 400, g_ = class extends _e {
|
|
|
8660
8666
|
}), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
|
|
8661
8667
|
}), e(this, "setGain", (e) => {
|
|
8662
8668
|
this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
|
|
8663
|
-
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this.
|
|
8669
|
+
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = __(s);
|
|
8664
8670
|
}
|
|
8665
8671
|
useMediaStreamDestination() {
|
|
8666
8672
|
var e;
|
|
@@ -8673,10 +8679,10 @@ var m_, h_ = 400, g_ = class extends _e {
|
|
|
8673
8679
|
return (e = this.gainNode) == null || e.connect(t), t;
|
|
8674
8680
|
}
|
|
8675
8681
|
};
|
|
8676
|
-
m_ =
|
|
8682
|
+
m_ = v_, e(v_, "create", (e, t, n) => new m_(e, t, n));
|
|
8677
8683
|
//#endregion
|
|
8678
8684
|
//#region ../../libs/web-sdk/src/players/VideoPlayer.ts
|
|
8679
|
-
var
|
|
8685
|
+
var y_, b_ = class {
|
|
8680
8686
|
constructor(t, n, r, i, a, o) {
|
|
8681
8687
|
e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new rr()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
|
|
8682
8688
|
this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
|
|
@@ -8766,12 +8772,12 @@ var __, v_ = class {
|
|
|
8766
8772
|
}), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
|
|
8767
8773
|
}
|
|
8768
8774
|
};
|
|
8769
|
-
|
|
8775
|
+
y_ = b_, e(b_, "create", (e, t, n, r, i, a) => new y_(e, t, n, r, i, a));
|
|
8770
8776
|
//#endregion
|
|
8771
8777
|
//#region ../../libs/web-sdk/src/TextTracks.ts
|
|
8772
|
-
var
|
|
8778
|
+
var x_ = /* @__PURE__ */ new WeakMap(), S_ = class {
|
|
8773
8779
|
constructor() {
|
|
8774
|
-
v(this,
|
|
8780
|
+
v(this, x_, []), x(x_, this, []);
|
|
8775
8781
|
}
|
|
8776
8782
|
addTextTrack(e, t, n) {
|
|
8777
8783
|
let r = [], i = {
|
|
@@ -8788,40 +8794,40 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
8788
8794
|
t !== -1 && r.splice(t, 1);
|
|
8789
8795
|
}
|
|
8790
8796
|
};
|
|
8791
|
-
return b(
|
|
8797
|
+
return b(x_, this).push(i), i;
|
|
8792
8798
|
}
|
|
8793
8799
|
set language(e) {
|
|
8794
|
-
b(
|
|
8800
|
+
b(x_, this).forEach((t) => {
|
|
8795
8801
|
t.language === e ? t.mode = "showing" : t.mode = "hidden";
|
|
8796
8802
|
});
|
|
8797
8803
|
}
|
|
8798
8804
|
get language() {
|
|
8799
8805
|
var e;
|
|
8800
|
-
return (e = b(
|
|
8806
|
+
return (e = b(x_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
|
|
8801
8807
|
}
|
|
8802
8808
|
getActiveCues(e) {
|
|
8803
|
-
let t = b(
|
|
8809
|
+
let t = b(x_, this).find((e) => e.mode === "showing");
|
|
8804
8810
|
return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
|
|
8805
8811
|
}
|
|
8806
|
-
},
|
|
8812
|
+
}, C_ = (e, t) => {
|
|
8807
8813
|
let n;
|
|
8808
8814
|
for (n = t; e > 1; e--) n += t;
|
|
8809
8815
|
return n;
|
|
8810
|
-
},
|
|
8816
|
+
}, w_ = class {
|
|
8811
8817
|
constructor() {
|
|
8812
8818
|
e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
|
|
8813
8819
|
let t = document.createElement("div");
|
|
8814
8820
|
t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
8815
8821
|
let n = t.children.item(0);
|
|
8816
|
-
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
8822
|
+
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + C_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + C_(16, "gICA") + C_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + C_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + C_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + C_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + C_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
8817
8823
|
else throw Error("Failed to create audio tag");
|
|
8818
8824
|
}
|
|
8819
|
-
},
|
|
8825
|
+
}, T_, E_ = class {
|
|
8820
8826
|
constructor(t, n, r, i, a, o, s, c) {
|
|
8821
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new
|
|
8827
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new w_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new S_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
|
|
8822
8828
|
this.audioPlayer.useDefaultDestination(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.isLoaded = !0, this.isVideoRenderingEnabled && (this.videoPlayer.load(), this.isVideoPlayerLoaded = !0, this.startTextTrackInterval());
|
|
8823
8829
|
}), e(this, "unload", () => {
|
|
8824
|
-
this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
|
|
8830
|
+
this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
|
|
8825
8831
|
}), e(this, "suspend", () => {
|
|
8826
8832
|
this.isSuspended = !0, this.isVideoRenderingEnabled && this.videoPlayer.suspend(), this.audioPlayer.suspend();
|
|
8827
8833
|
}), e(this, "unsuspend", () => {
|
|
@@ -8845,6 +8851,8 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
8845
8851
|
}, 100);
|
|
8846
8852
|
}), e(this, "flushBuffers", () => {
|
|
8847
8853
|
this.audioPlayer.flushBuffer();
|
|
8854
|
+
}), e(this, "onTargetBufferTime", (e) => {
|
|
8855
|
+
this.audioPlayer.bufferTime = e;
|
|
8848
8856
|
}), e(this, "activateAudioPlayer", () => (this.isDisconnected && (this.isDisconnected = !1, this.audioPlayer.useDefaultDestination()), this._isPaused = !1, this.unmuter.unmute(), this.audioPlayer.play())), e(this, "onDecodedFrame", (e) => {
|
|
8849
8857
|
try {
|
|
8850
8858
|
this.audioPlayer.onDecodedFrame(e);
|
|
@@ -8852,7 +8860,7 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
8852
8860
|
e instanceof Error && this.emitter.emit("error", re(!1, e));
|
|
8853
8861
|
}
|
|
8854
8862
|
this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
|
|
8855
|
-
}), this.logger = n, this.emitter = t, this.pool = r, this.audioPlayer =
|
|
8863
|
+
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = v_.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
8856
8864
|
muted: a,
|
|
8857
8865
|
reInitWhenStuck: !0,
|
|
8858
8866
|
bufferTime: c
|
|
@@ -8863,7 +8871,7 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
8863
8871
|
volume: this.volume,
|
|
8864
8872
|
isMuted: this.muted
|
|
8865
8873
|
});
|
|
8866
|
-
}), this.videoPlayer =
|
|
8874
|
+
}), this.videoPlayer = b_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
|
|
8867
8875
|
}
|
|
8868
8876
|
get volume() {
|
|
8869
8877
|
return this.audioPlayer.volume;
|
|
@@ -8919,12 +8927,12 @@ var y_ = /* @__PURE__ */ new WeakMap(), b_ = class {
|
|
|
8919
8927
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
8920
8928
|
}
|
|
8921
8929
|
};
|
|
8922
|
-
|
|
8930
|
+
T_ = E_, e(E_, "create", (e, t, n, r, i, a, o, s) => new T_(e, t, n, r, i, a, o, s));
|
|
8923
8931
|
//#endregion
|
|
8924
8932
|
//#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
|
|
8925
|
-
var
|
|
8933
|
+
var D_, O_ = class {
|
|
8926
8934
|
constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
|
|
8927
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new
|
|
8935
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new S_()), e(this, "reset", () => {}), e(this, "load", () => {
|
|
8928
8936
|
this.mediaElement.load(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.nativeTextTrack = this.mediaElement.element.addTextTrack("subtitles", "", ""), this.nativeTextTrack.mode = "showing", this.timers.setInterval(() => {
|
|
8929
8937
|
if (!this.textTracks.language) {
|
|
8930
8938
|
this.clearNativeTrackCues();
|
|
@@ -8934,13 +8942,15 @@ var T_, E_ = class {
|
|
|
8934
8942
|
this.updateNativeTrackCues(e);
|
|
8935
8943
|
}, 100);
|
|
8936
8944
|
}), e(this, "unload", () => {
|
|
8937
|
-
this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.clearNativeTrackCues(), this.nativeTextTrack = void 0, this.mediaElement.unload(), this.timers.unload(), this.audioPlayer.unload(), this.videoPlayer.unload();
|
|
8945
|
+
this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.clearNativeTrackCues(), this.nativeTextTrack = void 0, this.mediaElement.unload(), this.timers.unload(), this.audioPlayer.unload(), this.videoPlayer.unload();
|
|
8938
8946
|
}), e(this, "suspend", () => {
|
|
8939
8947
|
this.videoPlayer.suspend(), this.audioPlayer.suspend();
|
|
8940
8948
|
}), e(this, "unsuspend", () => {
|
|
8941
8949
|
this.videoPlayer.unsuspend(), this.audioPlayer.unsuspend();
|
|
8942
8950
|
}), e(this, "element", () => this.mediaElement), e(this, "getStatistics", () => this.videoPlayer.getStatistics()), e(this, "activateAudioPlayer", () => (this.isDisconnected && this.connectStreams(), this.audioPlayer.play())), e(this, "flushBuffers", () => {
|
|
8943
8951
|
this.audioPlayer.flushBuffer();
|
|
8952
|
+
}), e(this, "onTargetBufferTime", (e) => {
|
|
8953
|
+
this.audioPlayer.bufferTime = e;
|
|
8944
8954
|
}), e(this, "resetCanvasSize", () => {
|
|
8945
8955
|
this.videoPlayer.resetSize();
|
|
8946
8956
|
}), e(this, "onEnterIOSHack", () => {
|
|
@@ -8998,7 +9008,7 @@ var T_, E_ = class {
|
|
|
8998
9008
|
volume: this.volume
|
|
8999
9009
|
};
|
|
9000
9010
|
Nt(e, this.volumeState) || (this.volumeState = e, this.emitter.emit("volume state", this.volumeState));
|
|
9001
|
-
}), this.logger = n, this.emitter = t, this.pool = r, this._userProvidedMuted = a, this.offscreenCanvas = u, this.mediaElement = new cs({
|
|
9011
|
+
}), this.logger = n, this.emitter = t, this.pool = r, this._userProvidedMuted = a, this.offscreenCanvas = u, this.emitter.on("target buffer time", this.onTargetBufferTime), this.mediaElement = new cs({
|
|
9002
9012
|
poster: l,
|
|
9003
9013
|
type: c,
|
|
9004
9014
|
muted: a,
|
|
@@ -9009,7 +9019,7 @@ var T_, E_ = class {
|
|
|
9009
9019
|
this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
|
|
9010
9020
|
}), this.mediaElement.on("media element state", (e) => {
|
|
9011
9021
|
e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
|
|
9012
|
-
}), this.audioPlayer =
|
|
9022
|
+
}), this.audioPlayer = v_.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
9013
9023
|
muted: !1,
|
|
9014
9024
|
reInitWhenStuck: !1,
|
|
9015
9025
|
bufferTime: d
|
|
@@ -9017,7 +9027,7 @@ var T_, E_ = class {
|
|
|
9017
9027
|
this.isDisconnected = !0;
|
|
9018
9028
|
}), this.audioPlayer.on("state change", (e) => {
|
|
9019
9029
|
e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
|
|
9020
|
-
}), this.videoPlayer =
|
|
9030
|
+
}), this.videoPlayer = b_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
|
|
9021
9031
|
volume: this.volume,
|
|
9022
9032
|
isMuted: this.muted
|
|
9023
9033
|
};
|
|
@@ -9075,10 +9085,10 @@ var T_, E_ = class {
|
|
|
9075
9085
|
this.mediaElement.pause();
|
|
9076
9086
|
}
|
|
9077
9087
|
};
|
|
9078
|
-
|
|
9088
|
+
D_ = O_, e(O_, "create", (e, t, n, r, i) => new D_(e, t, n, r, i));
|
|
9079
9089
|
//#endregion
|
|
9080
9090
|
//#region ../../libs/mse/src/AsyncSourceBuffer.ts
|
|
9081
|
-
var
|
|
9091
|
+
var k_ = () => (e) => A_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), A_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), j_ = (e) => (t) => t.appendBuffer(e), M_ = (e) => (t) => t.changeType(e), N_ = (e) => (t) => e(t), P_ = class {
|
|
9082
9092
|
constructor(t) {
|
|
9083
9093
|
e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "errorCallback", void 0), e(this, "currentInit", void 0), e(this, "setErrorCallback", (e) => {
|
|
9084
9094
|
this.errorCallback = e;
|
|
@@ -9092,30 +9102,30 @@ var D_ = () => (e) => O_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9092
9102
|
}
|
|
9093
9103
|
}), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
|
|
9094
9104
|
if (t && this.currentInit !== t) {
|
|
9095
|
-
let e = new Dt(
|
|
9105
|
+
let e = new Dt(j_(t), n, r);
|
|
9096
9106
|
this.commandQueue.push(e), this.currentInit = t;
|
|
9097
9107
|
}
|
|
9098
|
-
let i = new Dt(
|
|
9108
|
+
let i = new Dt(j_(e), n, r);
|
|
9099
9109
|
this.commandQueue.push(i), this.handleQueue();
|
|
9100
9110
|
})), e(this, "execute", (e) => new Promise((t, n) => {
|
|
9101
|
-
let r = new Dt(
|
|
9111
|
+
let r = new Dt(N_(e), t, n);
|
|
9102
9112
|
this.commandQueue.push(r), this.handleQueue();
|
|
9103
9113
|
})), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
|
|
9104
9114
|
this.dispose(), e.removeSourceBuffer(this.sourceBuffer);
|
|
9105
9115
|
}), e(this, "dispose", () => {
|
|
9106
9116
|
this.sourceBuffer.removeEventListener("updateend", this.handleQueue), this.sourceBuffer.removeEventListener("error", this.onError), this.commandQueue = [], this.errorCallback = void 0;
|
|
9107
9117
|
}), e(this, "changeType", (e) => new Promise((t, n) => {
|
|
9108
|
-
let r = new Dt(
|
|
9118
|
+
let r = new Dt(M_(e), t, n);
|
|
9109
9119
|
this.commandQueue.push(r), this.handleQueue();
|
|
9110
9120
|
})), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
|
|
9111
|
-
let i = new Dt(
|
|
9121
|
+
let i = new Dt(A_(e, t), n, r);
|
|
9112
9122
|
this.commandQueue.push(i), this.handleQueue();
|
|
9113
9123
|
})), e(this, "flush", () => new Promise((e, t) => {
|
|
9114
|
-
let n = new Dt(
|
|
9124
|
+
let n = new Dt(k_, e, t);
|
|
9115
9125
|
this.commandQueue.push(n), this.handleQueue();
|
|
9116
9126
|
})), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue), this.sourceBuffer.addEventListener("error", this.onError);
|
|
9117
9127
|
}
|
|
9118
|
-
},
|
|
9128
|
+
}, F_ = class extends _e {
|
|
9119
9129
|
constructor() {
|
|
9120
9130
|
super(), e(this, "MediaSource", Ve()), e(this, "mediaSource", new this.MediaSource()), e(this, "isOpen", () => this.mediaSource.readyState === "open"), e(this, "isClosed", () => this.mediaSource.readyState === "closed"), e(this, "isEnded", () => this.mediaSource.readyState === "ended"), e(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource)), e(this, "attach", (e) => {
|
|
9121
9131
|
let t = e;
|
|
@@ -9131,7 +9141,7 @@ var D_ = () => (e) => O_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9131
9141
|
this.mediaSource.endOfStream();
|
|
9132
9142
|
} catch (e) {}
|
|
9133
9143
|
e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
|
|
9134
|
-
}), e(this, "addSourceBuffer", (e) => new
|
|
9144
|
+
}), e(this, "addSourceBuffer", (e) => new P_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
|
|
9135
9145
|
e.removeFromMediaSource(this.mediaSource);
|
|
9136
9146
|
}), e(this, "endOfStream", (e) => {
|
|
9137
9147
|
this.mediaSource.endOfStream(e);
|
|
@@ -9148,13 +9158,13 @@ var D_ = () => (e) => O_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9148
9158
|
}), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
|
|
9149
9159
|
}
|
|
9150
9160
|
};
|
|
9151
|
-
e(
|
|
9161
|
+
e(F_, "isTypeSupported", (e) => {
|
|
9152
9162
|
var t, n;
|
|
9153
9163
|
return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
|
|
9154
9164
|
});
|
|
9155
9165
|
//#endregion
|
|
9156
9166
|
//#region ../../libs/web-sdk/src/modules/MseModule.ts
|
|
9157
|
-
var
|
|
9167
|
+
var I_, L_ = class {
|
|
9158
9168
|
constructor() {
|
|
9159
9169
|
e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
|
|
9160
9170
|
var r;
|
|
@@ -9166,7 +9176,7 @@ var P_, F_ = class {
|
|
|
9166
9176
|
});
|
|
9167
9177
|
}
|
|
9168
9178
|
};
|
|
9169
|
-
function
|
|
9179
|
+
function R_(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
9170
9180
|
return C(C({}, e), {}, {
|
|
9171
9181
|
state: "initialized",
|
|
9172
9182
|
mimeType: n,
|
|
@@ -9178,10 +9188,10 @@ function I_(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
|
9178
9188
|
lastBufferCleanupTime: Date.now()
|
|
9179
9189
|
});
|
|
9180
9190
|
}
|
|
9181
|
-
function
|
|
9191
|
+
function z_({ initSegments: e, pendingSamples: t }) {
|
|
9182
9192
|
return {
|
|
9183
9193
|
state: "uninitialized",
|
|
9184
|
-
initSegments: e == null ? new
|
|
9194
|
+
initSegments: e == null ? new L_() : e,
|
|
9185
9195
|
sequenceNumber: 0,
|
|
9186
9196
|
isWorkingOnPendingSamples: !1,
|
|
9187
9197
|
hasFirstSync: !!t,
|
|
@@ -9191,10 +9201,10 @@ function L_({ initSegments: e, pendingSamples: t }) {
|
|
|
9191
9201
|
successfulAppendCalls: 0
|
|
9192
9202
|
};
|
|
9193
9203
|
}
|
|
9194
|
-
var
|
|
9204
|
+
var B_ = class {
|
|
9195
9205
|
constructor(n, a, s) {
|
|
9196
9206
|
var u = this;
|
|
9197
|
-
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new
|
|
9207
|
+
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new F_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "load", () => {
|
|
9198
9208
|
this.emitter.on("init segment", this.init), this.emitter.on("coded sample", this.onCodedSample), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("fragment", this.onFragment);
|
|
9199
9209
|
}), e(this, "unload", () => {
|
|
9200
9210
|
this.logger.debug("Unloading module..."), this.emitter.off("init segment", this.init), this.emitter.off("coded sample", this.onCodedSample), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("fragment", this.onFragment), this.mediaSource.off("source ended", this.onSourceEnded), this.mediaSource.off("source open", this.onSourceOpen), this.mediaElement.removeEventListener("error", this.onMediaElementError), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
|
|
@@ -9230,7 +9240,7 @@ var R_ = class {
|
|
|
9230
9240
|
var n, r, i;
|
|
9231
9241
|
let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
|
|
9232
9242
|
for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
|
|
9233
|
-
let l =
|
|
9243
|
+
let l = z_({
|
|
9234
9244
|
pendingSamples: o,
|
|
9235
9245
|
initSegments: s
|
|
9236
9246
|
});
|
|
@@ -9256,12 +9266,12 @@ var R_ = class {
|
|
|
9256
9266
|
}
|
|
9257
9267
|
for (let t of e) {
|
|
9258
9268
|
let e = u.trackContexts.get(t.type);
|
|
9259
|
-
if (e || (e =
|
|
9269
|
+
if (e || (e = z_({
|
|
9260
9270
|
pendingSamples: [],
|
|
9261
|
-
initSegments: new
|
|
9271
|
+
initSegments: new L_()
|
|
9262
9272
|
}), u.trackContexts.set(t.type, e)), e.state === "initialized") t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType);
|
|
9263
9273
|
else {
|
|
9264
|
-
let n =
|
|
9274
|
+
let n = R_(e, {
|
|
9265
9275
|
mimeType: t.mimeType,
|
|
9266
9276
|
mediaSource: u.mediaSource,
|
|
9267
9277
|
codec: t.codec
|
|
@@ -9387,7 +9397,7 @@ var R_ = class {
|
|
|
9387
9397
|
let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
9388
9398
|
r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
9389
9399
|
}
|
|
9390
|
-
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples ||
|
|
9400
|
+
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || W_(t, this.append, this.maxChunkSize).catch((n) => {
|
|
9391
9401
|
if (t.isWorkingOnPendingSamples = !1, !this.isReopening && n instanceof Error) {
|
|
9392
9402
|
if (this.logger.error("append failed", {
|
|
9393
9403
|
message: n.message,
|
|
@@ -9436,24 +9446,24 @@ var R_ = class {
|
|
|
9436
9446
|
}), this.logger = n, this.mediaElement = s, this.emitter = a;
|
|
9437
9447
|
}
|
|
9438
9448
|
};
|
|
9439
|
-
|
|
9440
|
-
let r = new
|
|
9449
|
+
I_ = B_, e(B_, "create", (e, t, n) => {
|
|
9450
|
+
let r = new I_(e, t, n);
|
|
9441
9451
|
return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), r.mediaSource.attach(n), r;
|
|
9442
9452
|
});
|
|
9443
|
-
var
|
|
9453
|
+
var V_ = (e, t) => {
|
|
9444
9454
|
var n;
|
|
9445
9455
|
let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
|
|
9446
9456
|
return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
|
|
9447
|
-
},
|
|
9457
|
+
}, H_ = 32, U_ = (e) => {
|
|
9448
9458
|
let t = e.pendingSamplesOffset;
|
|
9449
9459
|
if (t !== 0) {
|
|
9450
9460
|
if (t >= e.pendingSamples.length) {
|
|
9451
9461
|
e.pendingSamples = [], e.pendingSamplesOffset = 0;
|
|
9452
9462
|
return;
|
|
9453
9463
|
}
|
|
9454
|
-
t <
|
|
9464
|
+
t < H_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
|
|
9455
9465
|
}
|
|
9456
|
-
},
|
|
9466
|
+
}, W_ = function() {
|
|
9457
9467
|
var e = t(function* (e, t, n) {
|
|
9458
9468
|
for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
|
|
9459
9469
|
let r = [], i = e.pendingSamplesOffset;
|
|
@@ -9461,7 +9471,7 @@ var z_ = (e, t) => {
|
|
|
9461
9471
|
i = t;
|
|
9462
9472
|
let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
|
|
9463
9473
|
if (a && (r.push(a), o)) {
|
|
9464
|
-
if (
|
|
9474
|
+
if (V_(a, o)) break;
|
|
9465
9475
|
let e = (a.timestamp + a.duration) / a.timescale;
|
|
9466
9476
|
if (o.timestamp / o.timescale - e > .1) break;
|
|
9467
9477
|
}
|
|
@@ -9469,14 +9479,14 @@ var z_ = (e, t) => {
|
|
|
9469
9479
|
}
|
|
9470
9480
|
let a = r[0];
|
|
9471
9481
|
if (!a) break;
|
|
9472
|
-
yield t(r, e.previousSample ?
|
|
9482
|
+
yield t(r, e.previousSample ? V_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], U_(e);
|
|
9473
9483
|
}
|
|
9474
9484
|
e.isWorkingOnPendingSamples = !1;
|
|
9475
9485
|
});
|
|
9476
9486
|
return function(t, n, r) {
|
|
9477
9487
|
return e.apply(this, arguments);
|
|
9478
9488
|
};
|
|
9479
|
-
}(),
|
|
9489
|
+
}(), G_, K_ = class {
|
|
9480
9490
|
constructor(n, r) {
|
|
9481
9491
|
var i = this;
|
|
9482
9492
|
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
|
|
@@ -9508,10 +9518,10 @@ var z_ = (e, t) => {
|
|
|
9508
9518
|
}()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
|
|
9509
9519
|
}
|
|
9510
9520
|
};
|
|
9511
|
-
|
|
9521
|
+
G_ = K_, e(K_, "create", (e, t) => new G_(e, t));
|
|
9512
9522
|
//#endregion
|
|
9513
9523
|
//#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
|
|
9514
|
-
var
|
|
9524
|
+
var q_, J_ = class {
|
|
9515
9525
|
constructor(t, n, r, i) {
|
|
9516
9526
|
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
|
|
9517
9527
|
this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
|
|
@@ -9529,24 +9539,24 @@ var G_, K_ = class {
|
|
|
9529
9539
|
}), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
|
|
9530
9540
|
}
|
|
9531
9541
|
};
|
|
9532
|
-
|
|
9542
|
+
q_ = J_, e(J_, "create", (e, t, n, r) => new q_(e, t, n, r));
|
|
9533
9543
|
//#endregion
|
|
9534
9544
|
//#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
|
|
9535
|
-
var
|
|
9545
|
+
var Y_, X_ = () => ({
|
|
9536
9546
|
upgradesFromLevel: [],
|
|
9537
9547
|
downgradesFromLevel: [],
|
|
9538
9548
|
bufferingRanges: [],
|
|
9539
9549
|
activeRanges: [],
|
|
9540
9550
|
decodeRate: 2 ** 53 - 1
|
|
9541
|
-
}),
|
|
9551
|
+
}), Z_ = () => ({
|
|
9542
9552
|
levels: {},
|
|
9543
9553
|
levelDowngrades: [],
|
|
9544
9554
|
levelUpgrades: [],
|
|
9545
9555
|
bufferFullness: 0,
|
|
9546
|
-
general:
|
|
9547
|
-
}),
|
|
9556
|
+
general: X_()
|
|
9557
|
+
}), Q_ = class {
|
|
9548
9558
|
constructor(t, n, r) {
|
|
9549
|
-
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics",
|
|
9559
|
+
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", Z_()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
|
|
9550
9560
|
this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
|
|
9551
9561
|
}), e(this, "unload", () => {
|
|
9552
9562
|
this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.suspend();
|
|
@@ -9614,14 +9624,14 @@ var q_, J_ = () => ({
|
|
|
9614
9624
|
let d = !1;
|
|
9615
9625
|
if (e.from) {
|
|
9616
9626
|
var f;
|
|
9617
|
-
let e = (f = this.metrics.levels[l]) == null ?
|
|
9627
|
+
let e = (f = this.metrics.levels[l]) == null ? X_() : f;
|
|
9618
9628
|
l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), on(e.activeRanges);
|
|
9619
9629
|
let t = e.bufferingRanges[e.bufferingRanges.length - 1];
|
|
9620
9630
|
d = !!t && !t.end, on(e.bufferingRanges), this.metrics.levels[l] = e;
|
|
9621
9631
|
}
|
|
9622
9632
|
if (e.to) {
|
|
9623
9633
|
var p;
|
|
9624
|
-
let e = (p = this.metrics.levels[u]) == null ?
|
|
9634
|
+
let e = (p = this.metrics.levels[u]) == null ? X_() : p;
|
|
9625
9635
|
sn(e.activeRanges), d && sn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
|
|
9626
9636
|
}
|
|
9627
9637
|
}), e(this, "onBufferFullness", (e) => {
|
|
@@ -9690,10 +9700,10 @@ var q_, J_ = () => ({
|
|
|
9690
9700
|
sn(this.metrics.general.activeRanges);
|
|
9691
9701
|
}
|
|
9692
9702
|
};
|
|
9693
|
-
|
|
9703
|
+
Y_ = Q_, e(Q_, "create", (e, t, n) => new Y_(e, t, n));
|
|
9694
9704
|
//#endregion
|
|
9695
9705
|
//#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
|
|
9696
|
-
var
|
|
9706
|
+
var $_, ev = class {
|
|
9697
9707
|
constructor(t, n) {
|
|
9698
9708
|
e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
|
|
9699
9709
|
this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
|
|
@@ -9768,10 +9778,10 @@ var Z_, Q_ = class {
|
|
|
9768
9778
|
}), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
9769
9779
|
}
|
|
9770
9780
|
};
|
|
9771
|
-
|
|
9781
|
+
$_ = ev, e(ev, "create", (e, t) => new $_(e, t));
|
|
9772
9782
|
//#endregion
|
|
9773
9783
|
//#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
|
|
9774
|
-
var
|
|
9784
|
+
var tv, nv = (e) => JSON.parse(JSON.stringify(e)), rv = 1e4, iv = class {
|
|
9775
9785
|
constructor(t, n, r) {
|
|
9776
9786
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
|
|
9777
9787
|
this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
|
|
@@ -9809,23 +9819,23 @@ var $_, ev = (e) => JSON.parse(JSON.stringify(e)), tv = 1e4, nv = class {
|
|
|
9809
9819
|
this.logger.debug("onSubscriptionChanged", {
|
|
9810
9820
|
to: e,
|
|
9811
9821
|
reset: t
|
|
9812
|
-
}), t ? this.targetSubscription =
|
|
9822
|
+
}), t ? this.targetSubscription = nv(this.currentSubscription) : this.currentSubscription = nv(e), this._isSwitchingSubscription = this.isNewSubscription();
|
|
9813
9823
|
}), e(this, "scheduleSubscriptionChange", () => {
|
|
9814
|
-
this.targetSubscription =
|
|
9824
|
+
this.targetSubscription = nv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
|
|
9815
9825
|
let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
|
|
9816
9826
|
this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
|
|
9817
|
-
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription =
|
|
9818
|
-
},
|
|
9827
|
+
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = nv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
|
|
9828
|
+
}, rv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
|
|
9819
9829
|
type: "subscribe",
|
|
9820
9830
|
subscription: this.getTargetSubscription()
|
|
9821
9831
|
}), 0));
|
|
9822
|
-
}), this.logger = t, this.targetSubscription = n, this.currentSubscription =
|
|
9832
|
+
}), this.logger = t, this.targetSubscription = n, this.currentSubscription = nv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
9823
9833
|
}
|
|
9824
9834
|
};
|
|
9825
|
-
|
|
9835
|
+
tv = iv, e(iv, "create", (e, t, n) => new tv(e, n, t));
|
|
9826
9836
|
//#endregion
|
|
9827
9837
|
//#region ../../libs/web-sdk/src/modules/SyncModule.ts
|
|
9828
|
-
var
|
|
9838
|
+
var av, ov = 5e3, sv = () => Ye() || Ke(), cv = (e) => e && sv() ? 100 : 0, lv = (e) => (t) => t > e, uv = {
|
|
9829
9839
|
seek: {
|
|
9830
9840
|
toleranceMs: 200,
|
|
9831
9841
|
toleranceMaxMs: 2500,
|
|
@@ -9857,7 +9867,7 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
9857
9867
|
decayCooldownMultiplier: 3,
|
|
9858
9868
|
decayCheckInterval: 15e3
|
|
9859
9869
|
}
|
|
9860
|
-
},
|
|
9870
|
+
}, dv = class {
|
|
9861
9871
|
get driftSamplesToAverage() {
|
|
9862
9872
|
return this._driftSamplesToAverage;
|
|
9863
9873
|
}
|
|
@@ -9903,7 +9913,7 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
9903
9913
|
}), e(this, "processSample", (e) => {
|
|
9904
9914
|
var t;
|
|
9905
9915
|
if (!e.channelId) throw Error("Sample must be assigned to a channel");
|
|
9906
|
-
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 -
|
|
9916
|
+
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - ov);
|
|
9907
9917
|
let n = e.type === "video" && e.isSync;
|
|
9908
9918
|
if (this.currentChannelId !== e.channelId) {
|
|
9909
9919
|
let t = 2 ** 53 - 1;
|
|
@@ -9920,7 +9930,7 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
9920
9930
|
this.currentChannelId || (this.currentChannelId = e);
|
|
9921
9931
|
let r = t.mediaType();
|
|
9922
9932
|
if (!r) throw Error("Fragment must have a media type");
|
|
9923
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
9933
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - ov);
|
|
9924
9934
|
let i = t.mediaType() === "video" && t.startsWithKeyframe();
|
|
9925
9935
|
if (this.currentChannelId !== e) {
|
|
9926
9936
|
let t = 2 ** 53 - 1;
|
|
@@ -10028,7 +10038,7 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
10028
10038
|
return;
|
|
10029
10039
|
}
|
|
10030
10040
|
if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
|
|
10031
|
-
let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(
|
|
10041
|
+
let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(lv(r)).length;
|
|
10032
10042
|
if (i && this.state.timeshiftToleranceMultiplier > 2) {
|
|
10033
10043
|
this.logger.info("Too many timeshifts within sliding window", {
|
|
10034
10044
|
timeshiftCooldownThreshold: r,
|
|
@@ -10075,7 +10085,7 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
10075
10085
|
if (this.driftSamples.push(t), this.driftSamples.items().length < this.driftSamplesToAverage && Math.abs(t) < 2e3) return;
|
|
10076
10086
|
let n = Ot(this.driftSamples.items());
|
|
10077
10087
|
if (this.tryPlaybackRateSync(n) || n < 0 && -n < this.currentAheadToleranceMs() || n > 0 && n < this.currentSeekToleranceMs() || Math.abs(n) < 1 || !this.isSeekCooldownExpired()) return;
|
|
10078
|
-
let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter(
|
|
10088
|
+
let r = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, i = this.seekAdjustmentTimestamps.filter(lv(r)).length;
|
|
10079
10089
|
if (i && this.state.seekToleranceMultiplier > 2) {
|
|
10080
10090
|
this.logger.info("Too many seek adjustments within sliding window", {
|
|
10081
10091
|
seekCooldownThreshold: r,
|
|
@@ -10090,11 +10100,11 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
10090
10100
|
let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
|
|
10091
10101
|
if (t && r) return n;
|
|
10092
10102
|
}
|
|
10093
|
-
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.seekOvershoot =
|
|
10094
|
-
seek: C({},
|
|
10095
|
-
timeshift: C({},
|
|
10096
|
-
playbackRate: C({},
|
|
10097
|
-
backoff: C({},
|
|
10103
|
+
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.seekOvershoot = cv(o), this.config = {
|
|
10104
|
+
seek: C({}, uv.seek),
|
|
10105
|
+
timeshift: C({}, uv.timeshift),
|
|
10106
|
+
playbackRate: C({}, uv.playbackRate),
|
|
10107
|
+
backoff: C({}, uv.backoff)
|
|
10098
10108
|
}, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
|
|
10099
10109
|
seekToleranceMultiplier: 1,
|
|
10100
10110
|
timeshiftToleranceMultiplier: 1
|
|
@@ -10150,10 +10160,10 @@ var rv, iv = 5e3, av = () => Ye() || Ke(), ov = (e) => e && av() ? 100 : 0, sv =
|
|
|
10150
10160
|
return this.serverCurrentTime - this.playbackSource.currentTime;
|
|
10151
10161
|
}
|
|
10152
10162
|
};
|
|
10153
|
-
|
|
10163
|
+
av = dv, e(dv, "create", (e, t, n, r, i, a = !0) => new av(e, t, n, r, i, a));
|
|
10154
10164
|
//#endregion
|
|
10155
10165
|
//#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
|
|
10156
|
-
var
|
|
10166
|
+
var fv, pv = {
|
|
10157
10167
|
enabled: !0,
|
|
10158
10168
|
interval: 3e4,
|
|
10159
10169
|
includeErrors: !0,
|
|
@@ -10162,11 +10172,11 @@ var uv, dv = {
|
|
|
10162
10172
|
maxRetries: 10,
|
|
10163
10173
|
maxErrorReports: 50,
|
|
10164
10174
|
maxEvents: 50
|
|
10165
|
-
},
|
|
10175
|
+
}, mv = (e, t) => C(C({}, t), {}, {
|
|
10166
10176
|
type: e,
|
|
10167
10177
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10168
10178
|
discriminator: "web"
|
|
10169
|
-
}),
|
|
10179
|
+
}), hv = class {
|
|
10170
10180
|
constructor(n, r, i, a) {
|
|
10171
10181
|
var o = this;
|
|
10172
10182
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new _(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
|
|
@@ -10183,7 +10193,7 @@ var uv, dv = {
|
|
|
10183
10193
|
initiator: "interval"
|
|
10184
10194
|
}, n = {}) => {
|
|
10185
10195
|
if (!this.options.includeStats) return;
|
|
10186
|
-
let r = this.parentContext.getStatistics(), i =
|
|
10196
|
+
let r = this.parentContext.getStatistics(), i = mv("stats", C(C(C({}, n), r), {}, {
|
|
10187
10197
|
isFinal: e,
|
|
10188
10198
|
initiator: t,
|
|
10189
10199
|
count: this.statsCount++
|
|
@@ -10191,7 +10201,7 @@ var uv, dv = {
|
|
|
10191
10201
|
this.unsentLines.push(i);
|
|
10192
10202
|
}), e(this, "addEvent", (e) => {
|
|
10193
10203
|
if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
|
|
10194
|
-
let t =
|
|
10204
|
+
let t = mv("event", C(C({}, this.parentContext.getStatistics()), e));
|
|
10195
10205
|
this.eventCount++, this.unsentLines.push(t);
|
|
10196
10206
|
}), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
|
|
10197
10207
|
var e = t(function* (e) {
|
|
@@ -10237,15 +10247,15 @@ var uv, dv = {
|
|
|
10237
10247
|
if (t && e instanceof g) {
|
|
10238
10248
|
if (this.errorCount++, this.errorCount > n) return;
|
|
10239
10249
|
let t = this.parentContext.getStatistics();
|
|
10240
|
-
this.unsentLines.push(
|
|
10250
|
+
this.unsentLines.push(mv("error", C(C({}, t), e.toStringifiable())));
|
|
10241
10251
|
}
|
|
10242
|
-
}), this.logger = n, this.emitter = r, this.options = C(C({},
|
|
10252
|
+
}), this.logger = n, this.emitter = r, this.options = C(C({}, pv), i), this.parentContext = a;
|
|
10243
10253
|
}
|
|
10244
10254
|
};
|
|
10245
|
-
|
|
10255
|
+
fv = hv, e(hv, "create", (e, t, n, r) => new fv(e, t, n, r));
|
|
10246
10256
|
//#endregion
|
|
10247
10257
|
//#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
|
|
10248
|
-
var
|
|
10258
|
+
var gv, _v = class {
|
|
10249
10259
|
constructor(t, n, r) {
|
|
10250
10260
|
e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
|
|
10251
10261
|
this.timers.unload();
|
|
@@ -10254,10 +10264,10 @@ var mv, hv = class {
|
|
|
10254
10264
|
}), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
|
|
10255
10265
|
}
|
|
10256
10266
|
};
|
|
10257
|
-
|
|
10267
|
+
gv = _v, e(_v, "create", (e, t, n) => new gv(e, t, n));
|
|
10258
10268
|
//#endregion
|
|
10259
10269
|
//#region ../../libs/web-sdk/src/OptionsProvider.ts
|
|
10260
|
-
var
|
|
10270
|
+
var vv = [
|
|
10261
10271
|
"minBufferTime",
|
|
10262
10272
|
"maxBufferTime",
|
|
10263
10273
|
"burstEnabled",
|
|
@@ -10267,10 +10277,10 @@ var gv = [
|
|
|
10267
10277
|
"offscreenCanvasEnabled",
|
|
10268
10278
|
"videoCodecs"
|
|
10269
10279
|
];
|
|
10270
|
-
function
|
|
10271
|
-
return
|
|
10280
|
+
function yv(e) {
|
|
10281
|
+
return vv.includes(e);
|
|
10272
10282
|
}
|
|
10273
|
-
var
|
|
10283
|
+
var bv = class {
|
|
10274
10284
|
constructor(t) {
|
|
10275
10285
|
e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
|
|
10276
10286
|
}
|
|
@@ -10284,7 +10294,7 @@ var vv = class {
|
|
|
10284
10294
|
this.options[e] = t;
|
|
10285
10295
|
}
|
|
10286
10296
|
get(e, t) {
|
|
10287
|
-
if (t &&
|
|
10297
|
+
if (t && yv(e)) {
|
|
10288
10298
|
var n;
|
|
10289
10299
|
let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
10290
10300
|
if (r !== void 0) return r;
|
|
@@ -10295,7 +10305,7 @@ var vv = class {
|
|
|
10295
10305
|
var n;
|
|
10296
10306
|
return (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
10297
10307
|
}
|
|
10298
|
-
},
|
|
10308
|
+
}, xv = 6, Sv = (e) => {
|
|
10299
10309
|
let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
|
|
10300
10310
|
var i, a;
|
|
10301
10311
|
if (e.flags && Wo(e.flags)) {
|
|
@@ -10307,7 +10317,7 @@ var vv = class {
|
|
|
10307
10317
|
return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
|
|
10308
10318
|
};
|
|
10309
10319
|
return (e, n = !1) => {
|
|
10310
|
-
if (e.flags && Wo(e.flags) && n && (i = !i), !(n && t.length <
|
|
10320
|
+
if (e.flags && Wo(e.flags) && n && (i = !i), !(n && t.length < xv && i) && t.length > 0) {
|
|
10311
10321
|
i = !1;
|
|
10312
10322
|
let n = e;
|
|
10313
10323
|
for (let e = t.length - 1; e > 0; e--) {
|
|
@@ -10320,13 +10330,13 @@ var vv = class {
|
|
|
10320
10330
|
}
|
|
10321
10331
|
return t.push(e), [];
|
|
10322
10332
|
};
|
|
10323
|
-
},
|
|
10333
|
+
}, Cv = ["mse", "wasm"], wv = (e) => e == null ? Cv : e, Tv = (e) => {
|
|
10324
10334
|
if (!e) return !1;
|
|
10325
10335
|
let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
|
|
10326
10336
|
return !!(t || n);
|
|
10327
|
-
},
|
|
10328
|
-
if (
|
|
10329
|
-
let r =
|
|
10337
|
+
}, Ev = (e, t, n) => {
|
|
10338
|
+
if (Tv(n)) return "mse";
|
|
10339
|
+
let r = wv(e);
|
|
10330
10340
|
for (let e of r) switch (e) {
|
|
10331
10341
|
case "mse":
|
|
10332
10342
|
if (t) return "mse";
|
|
@@ -10337,7 +10347,7 @@ var vv = class {
|
|
|
10337
10347
|
case "wasm": return "wasm";
|
|
10338
10348
|
}
|
|
10339
10349
|
return "wasm";
|
|
10340
|
-
},
|
|
10350
|
+
}, Dv = (e, t, n) => {
|
|
10341
10351
|
if (hn(t)) return C(C({}, e), {}, {
|
|
10342
10352
|
type: "video",
|
|
10343
10353
|
codec: t.codec,
|
|
@@ -10358,8 +10368,8 @@ var vv = class {
|
|
|
10358
10368
|
data: e.payload,
|
|
10359
10369
|
duration: 0
|
|
10360
10370
|
});
|
|
10361
|
-
},
|
|
10362
|
-
if (!
|
|
10371
|
+
}, Ov = (e, t) => e && typeof e == "object" && t in e, kv = (e) => !(typeof e != "object" || !Ov(e, "channelId") || typeof e.channelId != "string" || !Ov(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Av = (e) => {
|
|
10372
|
+
if (!kv(e)) throw new g("Invalid options", {
|
|
10363
10373
|
isFatal: !0,
|
|
10364
10374
|
code: "invalid_options"
|
|
10365
10375
|
});
|
|
@@ -10368,13 +10378,13 @@ var vv = class {
|
|
|
10368
10378
|
let n = t;
|
|
10369
10379
|
n[e] === void 0 && delete n[e];
|
|
10370
10380
|
}), t;
|
|
10371
|
-
},
|
|
10381
|
+
}, jv = (e) => {
|
|
10372
10382
|
if (typeof e != "object" || !e) throw Error("not an object");
|
|
10373
10383
|
if (!("video" in e)) throw Error("missing video in subscription");
|
|
10374
10384
|
if (!("audio" in e)) throw Error("missing audio in subscription");
|
|
10375
10385
|
if (!("channelId" in e)) throw Error("missing channelId");
|
|
10376
10386
|
return !0;
|
|
10377
|
-
},
|
|
10387
|
+
}, Mv = class {
|
|
10378
10388
|
constructor(n) {
|
|
10379
10389
|
var r = this;
|
|
10380
10390
|
e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
|
|
@@ -10435,10 +10445,10 @@ var vv = class {
|
|
|
10435
10445
|
return this.inFlight.set(e, o), o;
|
|
10436
10446
|
}), this.logger = n;
|
|
10437
10447
|
}
|
|
10438
|
-
},
|
|
10448
|
+
}, Nv = /* @__PURE__ */ new WeakMap(), Pv = /* @__PURE__ */ new WeakMap(), Fv = /* @__PURE__ */ new WeakMap(), Iv = class n extends _e {
|
|
10439
10449
|
constructor(r) {
|
|
10440
10450
|
var i, a;
|
|
10441
|
-
super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this,
|
|
10451
|
+
super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", fn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new dn()), e(this, "encryptedMediaExtensions", void 0), v(this, Nv, 0), v(this, Pv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Fv, void 0), e(this, "attach", (e) => {
|
|
10442
10452
|
var t;
|
|
10443
10453
|
(t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
|
|
10444
10454
|
}), e(this, "setElement", (e) => {
|
|
@@ -10521,20 +10531,20 @@ var vv = class {
|
|
|
10521
10531
|
}), e(this, "updateTextTracks", (e) => {
|
|
10522
10532
|
let t = e.filter((e) => e.codec === "webvtt");
|
|
10523
10533
|
t.forEach((e) => {
|
|
10524
|
-
if (!b(
|
|
10534
|
+
if (!b(Pv, this).find((t) => t.language === e.language)) {
|
|
10525
10535
|
if (this.modules.canvasModule) {
|
|
10526
10536
|
let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
|
|
10527
|
-
b(
|
|
10537
|
+
b(Pv, this).push(t);
|
|
10528
10538
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
10529
10539
|
let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
|
|
10530
|
-
b(
|
|
10540
|
+
b(Pv, this).push(t);
|
|
10531
10541
|
}
|
|
10532
10542
|
}
|
|
10533
10543
|
});
|
|
10534
|
-
for (let e of b(
|
|
10544
|
+
for (let e of b(Pv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
|
|
10535
10545
|
this.emit("text tracks", this.textTracks);
|
|
10536
10546
|
}), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
|
|
10537
|
-
b(
|
|
10547
|
+
b(Pv, this).forEach((t) => {
|
|
10538
10548
|
if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
|
|
10539
10549
|
});
|
|
10540
10550
|
}), e(this, "filterRenditions", function() {
|
|
@@ -10669,7 +10679,7 @@ var vv = class {
|
|
|
10669
10679
|
}
|
|
10670
10680
|
else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
|
|
10671
10681
|
let f = yield t_.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
|
|
10672
|
-
if (m instanceof
|
|
10682
|
+
if (m instanceof E_) if (p === "OffscreenCanvas" && d) {
|
|
10673
10683
|
m.setVideoRenderingEnabled(!1);
|
|
10674
10684
|
let e = i.element;
|
|
10675
10685
|
e.parentElement ? e.parentElement.replaceChild(d, e) : i.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), i.offscreenCanvasElement = d, i.setElement(d);
|
|
@@ -10681,10 +10691,10 @@ var vv = class {
|
|
|
10681
10691
|
t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
|
|
10682
10692
|
}
|
|
10683
10693
|
}
|
|
10684
|
-
else m instanceof
|
|
10694
|
+
else m instanceof O_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
|
|
10685
10695
|
(e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
|
|
10686
10696
|
})), e(this, "setupOffscreenSubtitleRouting", () => {
|
|
10687
|
-
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof
|
|
10697
|
+
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof O_) return;
|
|
10688
10698
|
let e = this.modules.decoder, t = this.modules.canvasModule;
|
|
10689
10699
|
if (!t) return;
|
|
10690
10700
|
let n = !1;
|
|
@@ -10723,10 +10733,10 @@ var vv = class {
|
|
|
10723
10733
|
e && "reset" in e && e.reset();
|
|
10724
10734
|
}), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
10725
10735
|
}), e(this, "getRuntimeInfo", () => {
|
|
10726
|
-
let e = this.modules.canvasModule instanceof
|
|
10736
|
+
let e = this.modules.canvasModule instanceof O_ ? !0 : void 0;
|
|
10727
10737
|
return C({
|
|
10728
10738
|
uptime: Date.now() - this.createdAt,
|
|
10729
|
-
version: "4.2.0-
|
|
10739
|
+
version: "4.2.0-40-g922061e1",
|
|
10730
10740
|
clientId: this.clientId,
|
|
10731
10741
|
sessionId: this.sessionId,
|
|
10732
10742
|
channelId: this.channelId,
|
|
@@ -10750,7 +10760,7 @@ var vv = class {
|
|
|
10750
10760
|
}), e(this, "timeToFirstFrame", () => {
|
|
10751
10761
|
let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
|
|
10752
10762
|
if (t && e) return e - t;
|
|
10753
|
-
}), this.options = new
|
|
10763
|
+
}), this.options = new bv(C(C({}, xn), Av(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
10754
10764
|
let o = {
|
|
10755
10765
|
channelId: this.options.get("channelId"),
|
|
10756
10766
|
audio: {
|
|
@@ -10763,16 +10773,16 @@ var vv = class {
|
|
|
10763
10773
|
height: this.options.get("maxSize").height
|
|
10764
10774
|
}
|
|
10765
10775
|
}, s = O.get();
|
|
10766
|
-
s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new
|
|
10776
|
+
s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Mv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
|
|
10767
10777
|
let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
|
|
10768
10778
|
c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
|
|
10769
10779
|
let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
|
|
10770
10780
|
l && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), l && !f && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
|
|
10771
|
-
let p =
|
|
10781
|
+
let p = K_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = Kg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
|
|
10772
10782
|
reconnectHandler: this.options.get("reconnectHandler"),
|
|
10773
10783
|
options: this.options,
|
|
10774
10784
|
onConnectInfo: this.onConnectInfo
|
|
10775
|
-
}), te =
|
|
10785
|
+
}), te = iv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = ev.create(this.emitter, te), re = Q_.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = J_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
|
|
10776
10786
|
this.encryptedMediaExtensions = new Rr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
|
|
10777
10787
|
setHeaders: (e) => {
|
|
10778
10788
|
this.encryptedMediaExtensions.headers = e;
|
|
@@ -10791,9 +10801,9 @@ var vv = class {
|
|
|
10791
10801
|
logger: this.logger.createContext("MediaElement"),
|
|
10792
10802
|
poster: se
|
|
10793
10803
|
});
|
|
10794
|
-
e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ =
|
|
10804
|
+
e.on("buffer state", (e) => this.emitter.emit("buffer state", e)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Rr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = B_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = _v.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
|
|
10795
10805
|
} else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
|
|
10796
|
-
let e =
|
|
10806
|
+
let e = O_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
|
|
10797
10807
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
10798
10808
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
10799
10809
|
volume: this.options.get("volume"),
|
|
@@ -10803,10 +10813,10 @@ var vv = class {
|
|
|
10803
10813
|
}), t = e.element();
|
|
10804
10814
|
this.element = t.element, this.playbackSource = e, S = e;
|
|
10805
10815
|
let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
|
|
10806
|
-
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y =
|
|
10816
|
+
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = _v.create(this.logger.createContext("UnpauseModule"), t, ae));
|
|
10807
10817
|
} else {
|
|
10808
10818
|
let e;
|
|
10809
|
-
e =
|
|
10819
|
+
e = E_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
|
|
10810
10820
|
this.setElement(e.element());
|
|
10811
10821
|
}, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Qo());
|
|
10812
10822
|
}
|
|
@@ -10820,9 +10830,9 @@ var vv = class {
|
|
|
10820
10830
|
}, this.emitter.on("error", (e) => {
|
|
10821
10831
|
if (e.type() === "external" && this.emit("error", e), e.isFatal()) return () => void this.unload();
|
|
10822
10832
|
});
|
|
10823
|
-
let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de =
|
|
10833
|
+
let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de = dv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, ie, ue, ce), fe = d_.create(this.logger.createContext("JitterModule")), pe = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), me = new URL("/telemetry", pe).toString();
|
|
10824
10834
|
this.modules = {
|
|
10825
|
-
telemetry:
|
|
10835
|
+
telemetry: hv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
|
|
10826
10836
|
url: me,
|
|
10827
10837
|
enabled: this.options.get("telemetryEnabled"),
|
|
10828
10838
|
includeStats: !1,
|
|
@@ -10888,7 +10898,7 @@ var vv = class {
|
|
|
10888
10898
|
let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
|
|
10889
10899
|
if (e.telemetry) {
|
|
10890
10900
|
var i;
|
|
10891
|
-
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry =
|
|
10901
|
+
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = hv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
|
|
10892
10902
|
}
|
|
10893
10903
|
}), this.emitter.on("adapt level", (e) => {
|
|
10894
10904
|
this.logger.debug("adapt level", { direction: e });
|
|
@@ -10920,8 +10930,8 @@ var vv = class {
|
|
|
10920
10930
|
audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
|
|
10921
10931
|
})), this.emitter.emit("adapted level");
|
|
10922
10932
|
}), this.emitter.on("text track data", (e) => {
|
|
10923
|
-
let t = b(
|
|
10924
|
-
if (x(
|
|
10933
|
+
let t = b(Pv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Nv, this);
|
|
10934
|
+
if (x(Nv, this, n), t) {
|
|
10925
10935
|
if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
|
|
10926
10936
|
for (let r of e.cues) {
|
|
10927
10937
|
let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
|
|
@@ -10935,19 +10945,19 @@ var vv = class {
|
|
|
10935
10945
|
this.clientIp = t.ip;
|
|
10936
10946
|
break;
|
|
10937
10947
|
case "renditions":
|
|
10938
|
-
this.updateTextTracks(t.renditions), x(
|
|
10948
|
+
this.updateTextTracks(t.renditions), x(Fv, this, this.filterRenditions(t.renditions).then((e) => {
|
|
10939
10949
|
this.emitter.emit("renditions", {
|
|
10940
10950
|
renditions: e,
|
|
10941
10951
|
channelId: this.currentSubscription.channelId
|
|
10942
10952
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
|
|
10943
10953
|
}).finally(() => {
|
|
10944
|
-
x(
|
|
10954
|
+
x(Fv, this, void 0);
|
|
10945
10955
|
}));
|
|
10946
10956
|
break;
|
|
10947
10957
|
case "subscription changed":
|
|
10948
10958
|
var r;
|
|
10949
10959
|
try {
|
|
10950
|
-
|
|
10960
|
+
jv(t.subscription);
|
|
10951
10961
|
} catch (e) {
|
|
10952
10962
|
this.emitter.emit("error", new g("Subscription failed validation", {
|
|
10953
10963
|
source: e instanceof Error ? e : void 0,
|
|
@@ -11062,7 +11072,7 @@ var vv = class {
|
|
|
11062
11072
|
let ye = function() {
|
|
11063
11073
|
var e = t(function* (e) {
|
|
11064
11074
|
let t = e.channelId;
|
|
11065
|
-
b(
|
|
11075
|
+
b(Fv, i) && (yield b(Fv, i));
|
|
11066
11076
|
let n = i.modules.renditions.getRendition(e.renditionId, t);
|
|
11067
11077
|
if (!Ko(e.flags)) {
|
|
11068
11078
|
if (qo(e.flags)) {
|
|
@@ -11070,8 +11080,8 @@ var vv = class {
|
|
|
11070
11080
|
if (e.renditionId !== 0) {
|
|
11071
11081
|
let e = le(t);
|
|
11072
11082
|
if (e && e.language !== void 0) {
|
|
11073
|
-
let t = new is().parse(e.content || ""), r = n / 1e3, a = b(
|
|
11074
|
-
if (x(
|
|
11083
|
+
let t = new is().parse(e.content || ""), r = n / 1e3, a = b(Pv, i).find((t) => t.language === e.language), o = r - b(Nv, i);
|
|
11084
|
+
if (x(Nv, i, r), a) {
|
|
11075
11085
|
if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
|
|
11076
11086
|
for (let e of t) {
|
|
11077
11087
|
let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
|
|
@@ -11103,10 +11113,10 @@ var vv = class {
|
|
|
11103
11113
|
mimeType: s
|
|
11104
11114
|
}), i.emit("initialized media");
|
|
11105
11115
|
} else {
|
|
11106
|
-
let t =
|
|
11116
|
+
let t = Dv(e, n, i.sizes.get(e.renditionId));
|
|
11107
11117
|
i.modules.jitter.recordSample(t);
|
|
11108
11118
|
let a = i.sampleProcessingSesssions.get(r);
|
|
11109
|
-
if (!a) a =
|
|
11119
|
+
if (!a) a = Sv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
|
|
11110
11120
|
else {
|
|
11111
11121
|
let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
|
|
11112
11122
|
n.forEach((e) => {
|
|
@@ -11214,7 +11224,7 @@ var vv = class {
|
|
|
11214
11224
|
this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
|
|
11215
11225
|
}
|
|
11216
11226
|
set textTrack(e) {
|
|
11217
|
-
e !== this.textTrack && (b(
|
|
11227
|
+
e !== this.textTrack && (b(Pv, this).forEach((t) => {
|
|
11218
11228
|
if (t.label === e) t.mode = "showing";
|
|
11219
11229
|
else {
|
|
11220
11230
|
if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
|
|
@@ -11223,11 +11233,11 @@ var vv = class {
|
|
|
11223
11233
|
}), this.emitter.emit("text track", e));
|
|
11224
11234
|
}
|
|
11225
11235
|
get textTracks() {
|
|
11226
|
-
return b(
|
|
11236
|
+
return b(Pv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
|
|
11227
11237
|
}
|
|
11228
11238
|
get textTrack() {
|
|
11229
11239
|
var e;
|
|
11230
|
-
return (e = b(
|
|
11240
|
+
return (e = b(Pv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
|
|
11231
11241
|
}
|
|
11232
11242
|
get channelId() {
|
|
11233
11243
|
var e, t;
|
|
@@ -11361,7 +11371,7 @@ var vv = class {
|
|
|
11361
11371
|
return this.modules.subscription.getTargetSubscription();
|
|
11362
11372
|
}
|
|
11363
11373
|
resolvedDecoder(e) {
|
|
11364
|
-
return
|
|
11374
|
+
return Ev(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
|
|
11365
11375
|
}
|
|
11366
11376
|
willUseMediaSource() {
|
|
11367
11377
|
return this.resolvedDecoder() === "mse";
|
|
@@ -11380,6 +11390,6 @@ var vv = class {
|
|
|
11380
11390
|
return t === void 0 ? this.shouldUseWebCodecs(e) : t;
|
|
11381
11391
|
}
|
|
11382
11392
|
};
|
|
11383
|
-
e(
|
|
11393
|
+
e(Iv, "MAX_POOL_SIZE", 10), e(Iv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Iv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
|
|
11384
11394
|
//#endregion
|
|
11385
|
-
export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s,
|
|
11395
|
+
export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Iv as t, gt as u, Qe as v };
|