@vindral/web-sdk 4.3.3 → 4.4.0-10-g4c28ac8ee
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/{BFPgdE3l.js → C2-H3s2r.js} +1 -1
- package/C5AsBfiL.js +166 -0
- package/{DAKX3dD2.js → CbHsK_A-.js} +1519 -1389
- package/{_2aj2ylj.js → CcbYM7Z2.js} +195 -164
- package/{CjPLLJi5.js → D7vM_Gpt.js} +1 -0
- package/core.d.ts +0 -36
- package/core.js +1 -1
- package/legacy.d.ts +0 -36
- package/legacy.es.js +2419 -2390
- package/legacy.umd.js +25 -22
- package/package.json +1 -1
- package/player.d.ts +36 -2
- package/player.js +3 -3
- package/react.d.ts +34 -2
- package/vindral-player-component.js +2 -2
- package/CLJilV9Y.js +0 -166
|
@@ -473,6 +473,9 @@ var nt = () => typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.protot
|
|
|
473
473
|
for (let [t, n] of x(Rt, this)) n.setDebug(e);
|
|
474
474
|
e ? (this.table = console.table.bind(console), this.count = console.count.bind(console)) : (this.table = () => {}, this.count = () => {});
|
|
475
475
|
}
|
|
476
|
+
getLevel() {
|
|
477
|
+
return x(Vt, this);
|
|
478
|
+
}
|
|
476
479
|
setLevel(e) {
|
|
477
480
|
S(Vt, this, e);
|
|
478
481
|
for (let [t, n] of x(Rt, this)) n.setLevel(e);
|
|
@@ -681,7 +684,16 @@ var A = class {
|
|
|
681
684
|
return typeof n == "object" && t.forEach((e) => {
|
|
682
685
|
delete n[e];
|
|
683
686
|
}), n;
|
|
684
|
-
}
|
|
687
|
+
};
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region ../../libs/utils/src/subtitleFontSize.ts
|
|
690
|
+
function sn(e, t, n) {
|
|
691
|
+
let r = t * .05, i = e * .035, a = Math.max(Math.round(Math.min(r, i)), 16);
|
|
692
|
+
return `${(n == null ? void 0 : n.max) == null ? a : Math.min(a, n.max)}px`;
|
|
693
|
+
}
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region ../../libs/utils/src/Timers.ts
|
|
696
|
+
var cn, j = class {
|
|
685
697
|
constructor() {
|
|
686
698
|
e(this, "pendingTimeouts", /* @__PURE__ */ new Set()), e(this, "pendingIntervals", /* @__PURE__ */ new Set()), e(this, "clearTimeout", (e) => {
|
|
687
699
|
this.pendingTimeouts.delete(e) && window.clearTimeout(e);
|
|
@@ -702,28 +714,28 @@ var A = class {
|
|
|
702
714
|
});
|
|
703
715
|
}
|
|
704
716
|
};
|
|
705
|
-
|
|
717
|
+
cn = j, e(j, "create", () => new cn());
|
|
706
718
|
//#endregion
|
|
707
719
|
//#region ../../libs/utils/src/timeRangesUtils.ts
|
|
708
|
-
var
|
|
720
|
+
var ln = (e, t = performance.now()) => {
|
|
709
721
|
let n = e.length;
|
|
710
722
|
if (n > 0) {
|
|
711
723
|
let r = e[n - 1];
|
|
712
724
|
r.end || (r.end = t);
|
|
713
725
|
}
|
|
714
|
-
},
|
|
715
|
-
|
|
716
|
-
},
|
|
726
|
+
}, un = (e, t = performance.now()) => {
|
|
727
|
+
ln(e, t), e.push({ start: t });
|
|
728
|
+
}, dn = (e) => e.reduce((e, t) => {
|
|
717
729
|
var n;
|
|
718
730
|
return e + (((n = t.end) == null ? performance.now() : n) - t.start);
|
|
719
|
-
}, 0),
|
|
731
|
+
}, 0), fn = (e, t, n = performance.now()) => e.reduce((e, r) => {
|
|
720
732
|
var i;
|
|
721
733
|
let a = Math.max(n - t, r.start), o = (i = r.end) == null ? n : i;
|
|
722
734
|
return Math.max(0, o - a) + e;
|
|
723
735
|
}, 0);
|
|
724
736
|
//#endregion
|
|
725
737
|
//#region ../../libs/utils/src/tryCatch.ts
|
|
726
|
-
function
|
|
738
|
+
function pn(e) {
|
|
727
739
|
try {
|
|
728
740
|
return e();
|
|
729
741
|
} catch (e) {
|
|
@@ -732,7 +744,7 @@ function fn(e) {
|
|
|
732
744
|
}
|
|
733
745
|
//#endregion
|
|
734
746
|
//#region ../../libs/utils/src/userAgentInformation.ts
|
|
735
|
-
var
|
|
747
|
+
var mn = class {
|
|
736
748
|
constructor() {
|
|
737
749
|
var t;
|
|
738
750
|
e(this, "highEntropyValues", void 0), (t = self.navigator.userAgentData) == null || t.getHighEntropyValues([
|
|
@@ -778,7 +790,7 @@ var pn = class {
|
|
|
778
790
|
}, r);
|
|
779
791
|
} else return w({ userAgent: window.navigator.userAgent }, r);
|
|
780
792
|
}
|
|
781
|
-
},
|
|
793
|
+
}, hn = () => {
|
|
782
794
|
let e = [...Array(256).keys()].map((e) => e.toString(16).padStart(2, "0")), t = crypto.getRandomValues(new Uint8Array(16));
|
|
783
795
|
return t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128, [...t.entries()].map(([t, n]) => [
|
|
784
796
|
4,
|
|
@@ -786,14 +798,14 @@ var pn = class {
|
|
|
786
798
|
8,
|
|
787
799
|
10
|
|
788
800
|
].includes(t) ? `-${e[n]}` : e[n]).join("");
|
|
789
|
-
},
|
|
801
|
+
}, gn = function() {
|
|
790
802
|
var e = t(function* (e) {
|
|
791
803
|
return new Promise((t) => setTimeout(t, e));
|
|
792
804
|
});
|
|
793
805
|
return function(t) {
|
|
794
806
|
return e.apply(this, arguments);
|
|
795
807
|
};
|
|
796
|
-
}(),
|
|
808
|
+
}(), _n = function() {
|
|
797
809
|
var e = t(function* (e, t = /* @__PURE__ */ Error("Timeout")) {
|
|
798
810
|
return new Promise((n, r) => setTimeout(() => r(t), e));
|
|
799
811
|
});
|
|
@@ -811,7 +823,7 @@ var pn = class {
|
|
|
811
823
|
})();
|
|
812
824
|
//#endregion
|
|
813
825
|
//#region ../../libs/data-types/src/Rendition.ts
|
|
814
|
-
var
|
|
826
|
+
var vn = (e) => "width" in e && typeof e.width == "number", yn = (e) => "sampleRate" in e && typeof e.sampleRate == "number", bn = (e) => {
|
|
815
827
|
switch (e.codec) {
|
|
816
828
|
case "opus": return "audio/mp4; codecs=\"opus\"";
|
|
817
829
|
case "mp3": return "audio/mpeg";
|
|
@@ -821,10 +833,10 @@ var _n = (e) => "width" in e && typeof e.width == "number", vn = (e) => "sampleR
|
|
|
821
833
|
case "h265": return e.codecString ? `video/mp4; codecs="${e.codecString}"` : "video/mp4";
|
|
822
834
|
case "av1": return e.codecString ? `video/mp4; codecs="${e.codecString}"` : "video/mp4";
|
|
823
835
|
}
|
|
824
|
-
},
|
|
836
|
+
}, xn = () => 2 ** 53 - 1, Sn = () => ({
|
|
825
837
|
width: 2 ** 53 - 1,
|
|
826
838
|
height: 2 ** 53 - 1
|
|
827
|
-
}),
|
|
839
|
+
}), Cn = (e) => !(typeof e != "object" || !e || !("type" in e)), wn = {
|
|
828
840
|
sizeBasedResolutionCapEnabled: !0,
|
|
829
841
|
pictureInPictureEnabled: !0,
|
|
830
842
|
abrEnabled: !0,
|
|
@@ -836,9 +848,9 @@ var _n = (e) => "width" in e && typeof e.width == "number", vn = (e) => "sampleR
|
|
|
836
848
|
minBufferTime: 1500,
|
|
837
849
|
maxBufferTime: 1500,
|
|
838
850
|
logLevel: Lt.OFF,
|
|
839
|
-
maxSize:
|
|
840
|
-
maxVideoBitRate:
|
|
841
|
-
maxAudioBitRate:
|
|
851
|
+
maxSize: Sn(),
|
|
852
|
+
maxVideoBitRate: xn(),
|
|
853
|
+
maxAudioBitRate: xn(),
|
|
842
854
|
maxInitialBitRate: 2.5 * 1e3 * 1e3,
|
|
843
855
|
tags: [],
|
|
844
856
|
media: "audio+video",
|
|
@@ -861,45 +873,45 @@ var _n = (e) => "width" in e && typeof e.width == "number", vn = (e) => "sampleR
|
|
|
861
873
|
};
|
|
862
874
|
//#endregion
|
|
863
875
|
//#region ../../libs/web-sdk/src/promiseFinally.ts
|
|
864
|
-
function
|
|
876
|
+
function Tn(e) {
|
|
865
877
|
return typeof e == "function" ? this.then((t) => Promise.resolve(e()).then(() => t), (t) => Promise.resolve(e()).then(() => {
|
|
866
878
|
throw t;
|
|
867
879
|
})) : this.then();
|
|
868
880
|
}
|
|
869
|
-
function
|
|
881
|
+
function En(e = Promise) {
|
|
870
882
|
return typeof e.prototype.finally != "function" && Object.defineProperty(e.prototype, "finally", {
|
|
871
883
|
configurable: !0,
|
|
872
884
|
enumerable: !1,
|
|
873
|
-
value:
|
|
885
|
+
value: Tn,
|
|
874
886
|
writable: !0
|
|
875
887
|
}), e.prototype.finally;
|
|
876
888
|
}
|
|
877
|
-
|
|
889
|
+
En();
|
|
878
890
|
//#endregion
|
|
879
891
|
//#region ../../libs/canvas-renderers/src/applyDefaultCanvasStyles.ts
|
|
880
|
-
var
|
|
892
|
+
var Dn = (e) => {
|
|
881
893
|
e.width = 320, e.height = 180, e.style.width = "100%", e.style.position = "relative", e.style.backgroundColor = "#000";
|
|
882
|
-
},
|
|
894
|
+
}, On = {
|
|
883
895
|
backgroundColor: "rgba(0,0,0,0.6)",
|
|
884
896
|
textPadding: 8,
|
|
885
897
|
fontSize: "28px",
|
|
886
898
|
lineGap: 16
|
|
887
|
-
},
|
|
899
|
+
}, kn = /* @__PURE__ */ new WeakMap(), An = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap(), Mn = /* @__PURE__ */ new WeakSet(), Nn = class {
|
|
888
900
|
constructor() {
|
|
889
|
-
C(this,
|
|
890
|
-
let t = x(
|
|
901
|
+
C(this, Mn), y(this, kn, []), y(this, An, document.createElement("canvas")), y(this, M, void 0), y(this, jn, window.devicePixelRatio || 1), e(this, "config", w({}, On));
|
|
902
|
+
let t = x(An, this).getContext("2d", { alpha: !0 });
|
|
891
903
|
if (!t) throw Error("Failed to create 2d context");
|
|
892
|
-
S(M, this, t), b(
|
|
904
|
+
S(M, this, t), b(Mn, this, Fn).call(this);
|
|
893
905
|
}
|
|
894
906
|
get canvas() {
|
|
895
|
-
return x(
|
|
907
|
+
return x(An, this);
|
|
896
908
|
}
|
|
897
909
|
setActiveCues(e) {
|
|
898
|
-
S(
|
|
910
|
+
S(kn, this, e);
|
|
899
911
|
}
|
|
900
912
|
render(e, t = !1) {
|
|
901
|
-
let n = x(
|
|
902
|
-
b(
|
|
913
|
+
let n = x(kn, this).flatMap((t) => t.text.split("\n").flatMap((t) => b(Mn, this, In).call(this, t, e.width)).map((e) => {
|
|
914
|
+
b(Mn, this, Fn).call(this);
|
|
903
915
|
let t = x(M, this).measureText(e);
|
|
904
916
|
return {
|
|
905
917
|
text: e,
|
|
@@ -910,21 +922,21 @@ var En = (e) => {
|
|
|
910
922
|
}
|
|
911
923
|
};
|
|
912
924
|
})), r = Math.max(...n.map((e) => e.size.width)), i = n.reduce((e, { size: t }) => e + t.height, 0) + (n.length - 1) * this.config.lineGap, a = 0;
|
|
913
|
-
b(
|
|
914
|
-
for (let { size: e, text: t } of n) b(
|
|
915
|
-
t && (x(M, this).strokeStyle = "red", x(M, this).strokeRect(0, 0, e.width, x(
|
|
925
|
+
b(Mn, this, Pn).call(this, r, i), x(M, this).clearRect(0, 0, x(An, this).width, x(An, this).height);
|
|
926
|
+
for (let { size: e, text: t } of n) b(Mn, this, Fn).call(this), x(M, this).fillStyle = this.config.backgroundColor, x(M, this).fillRect(0, a, e.width, e.height), b(Mn, this, Fn).call(this), x(M, this).fillText(t, this.config.textPadding, a + this.config.textPadding), a += e.height + this.config.lineGap;
|
|
927
|
+
t && (x(M, this).strokeStyle = "red", x(M, this).strokeRect(0, 0, e.width, x(An, this).height));
|
|
916
928
|
}
|
|
917
929
|
};
|
|
918
|
-
function
|
|
919
|
-
x(
|
|
930
|
+
function Pn(e, t) {
|
|
931
|
+
x(An, this).width = e * x(jn, this), x(An, this).height = t * x(jn, this), x(M, this).setTransform(x(jn, this), 0, 0, x(jn, this), 0, 0), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
|
|
920
932
|
}
|
|
921
|
-
function
|
|
933
|
+
function Fn() {
|
|
922
934
|
x(M, this).fillStyle = "white", x(M, this).textAlign = "left", x(M, this).textBaseline = "top", x(M, this).font = `${this.config.fontSize} sans-serif`;
|
|
923
935
|
}
|
|
924
|
-
function
|
|
936
|
+
function In(e, t) {
|
|
925
937
|
let n = [], r = e.split(" "), i = "";
|
|
926
938
|
for (; r.length > 0;) {
|
|
927
|
-
b(
|
|
939
|
+
b(Mn, this, Fn).call(this);
|
|
928
940
|
let e = 0;
|
|
929
941
|
for (; x(M, this).measureText(i + (i.length > 0 ? " " : "") + r[0]).width + this.config.textPadding * 2 <= t && r.length > 0;) e++, i += (i.length > 0 ? " " : "") + r.shift();
|
|
930
942
|
if (e === 0) {
|
|
@@ -937,10 +949,6 @@ function Fn(e, t) {
|
|
|
937
949
|
}
|
|
938
950
|
//#endregion
|
|
939
951
|
//#region ../../libs/canvas-renderers/src/subtitleLayout.ts
|
|
940
|
-
function In(e, t) {
|
|
941
|
-
let n = t * .05, r = e * .035;
|
|
942
|
-
return `${Math.max(Math.round(Math.min(n, r)), 16)}px`;
|
|
943
|
-
}
|
|
944
952
|
function Ln(e) {
|
|
945
953
|
var t;
|
|
946
954
|
let { subtitleWidth: n, subtitleHeight: r, canvasWidth: i, canvasHeight: a, containerWidth: o, bottomPadding: s } = e, c = (t = e.baseMargin) == null ? 20 : t, l = i / o, u = n * l, d = r * l;
|
|
@@ -975,7 +983,7 @@ var zn = {
|
|
|
975
983
|
}), e(this, "unload", () => {
|
|
976
984
|
this.context = null, this.subtitleRenderer = null, this.hasActiveSubtitles = !1, this.setSize(zn);
|
|
977
985
|
}), e(this, "setActiveCues", (e, t) => {
|
|
978
|
-
this.subtitleRenderer || (this.subtitleRenderer = new
|
|
986
|
+
this.subtitleRenderer || (this.subtitleRenderer = new Nn()), this.subtitleRenderer.config.fontSize = sn(t.width, t.height), this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t), this.hasActiveSubtitles = e.length > 0;
|
|
979
987
|
}), e(this, "render", (e, t = 0) => {
|
|
980
988
|
if (!this.context) return;
|
|
981
989
|
if (!e.videoFrame) {
|
|
@@ -1007,7 +1015,7 @@ var zn = {
|
|
|
1007
1015
|
this.context.drawImage(t, i.x, i.y, i.drawWidth, i.drawHeight);
|
|
1008
1016
|
}), e(this, "setSize", (e) => {
|
|
1009
1017
|
e.width === this.size.width && e.height === this.size.height || (this.size = e, this.canvas.width = e.width, this.canvas.height = e.height, this.context && (this.context.fillStyle = "#000", this.context.fillRect(0, 0, e.width, e.height)));
|
|
1010
|
-
}),
|
|
1018
|
+
}), Dn(this.canvas);
|
|
1011
1019
|
}
|
|
1012
1020
|
}, Vn = "\nprecision mediump float;\nuniform sampler2D texture;\n\nvarying vec2 texture_coordinate;\n\nvoid main() {\n float y = texture2D(texture, texture_coordinate).r;\n float a = texture2D(texture, texture_coordinate).a;\n\n gl_FragColor = vec4(y, y, y, a);\n}\n", Hn = "\n attribute vec2 position;\n varying vec2 texture_coordinate;\n uniform mat4 model;\n\n void main() {\n texture_coordinate = position;\n gl_Position = model * vec4(position, 0.0, 1.0);\n }\n", Un = (e, t) => {
|
|
1013
1021
|
let n = e.getContext("webgl", t);
|
|
@@ -1060,7 +1068,7 @@ var zn = {
|
|
|
1060
1068
|
return r;
|
|
1061
1069
|
}, N = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap(), Xn = /* @__PURE__ */ new WeakMap(), Zn = /* @__PURE__ */ new WeakMap(), Qn = /* @__PURE__ */ new WeakSet(), $n = /* @__PURE__ */ new WeakMap(), er = class {
|
|
1062
1070
|
constructor(t) {
|
|
1063
|
-
C(this, Qn), y(this, N, void 0), y(this, Jn, void 0), y(this, Yn, void 0), y(this, Xn, void 0), y(this, Zn, void 0), e(this, "subtitleRenderer", new
|
|
1071
|
+
C(this, Qn), y(this, N, void 0), y(this, Jn, void 0), y(this, Yn, void 0), y(this, Xn, void 0), y(this, Zn, void 0), e(this, "subtitleRenderer", new Nn()), y(this, $n, (e, t, n, r) => [
|
|
1064
1072
|
e,
|
|
1065
1073
|
0,
|
|
1066
1074
|
0,
|
|
@@ -1080,7 +1088,7 @@ var zn = {
|
|
|
1080
1088
|
]), S(N, this, t), S(Jn, this, Gn(t)), S(Yn, this, Wn(t, t.FRAGMENT_SHADER, Vn)), S(Xn, this, Wn(t, t.VERTEX_SHADER, Hn)), S(Zn, this, qn(t, x(Xn, this), x(Yn, this)));
|
|
1081
1089
|
}
|
|
1082
1090
|
setActiveCues(e, t) {
|
|
1083
|
-
this.subtitleRenderer.config.fontSize =
|
|
1091
|
+
this.subtitleRenderer.config.fontSize = sn(t.width, t.height), this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
|
|
1084
1092
|
}
|
|
1085
1093
|
render(e) {
|
|
1086
1094
|
let t = this.subtitleRenderer.canvas;
|
|
@@ -1199,7 +1207,7 @@ var rr = "\nprecision mediump float;\nuniform sampler2D y_texture;\nuniform samp
|
|
|
1199
1207
|
1,
|
|
1200
1208
|
0,
|
|
1201
1209
|
1
|
|
1202
|
-
]), this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1),
|
|
1210
|
+
]), this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1), Dn(this.canvas);
|
|
1203
1211
|
}
|
|
1204
1212
|
getTextRenderer() {
|
|
1205
1213
|
return this.textRenderer || (this.textRenderer = new er(this.context)), this.textRenderer;
|
|
@@ -3444,10 +3452,10 @@ function us(e) {
|
|
|
3444
3452
|
var ds = (e) => {
|
|
3445
3453
|
let t = window;
|
|
3446
3454
|
t.vindralInstances = t.vindralInstances || {}, t.vindralInstances[e.getStatistics().clientId.substring(0, 8)] = e;
|
|
3447
|
-
}, fs = class extends ge {
|
|
3448
|
-
constructor({ type:
|
|
3449
|
-
var
|
|
3450
|
-
super(),
|
|
3455
|
+
}, fs = class n extends ge {
|
|
3456
|
+
constructor({ type: r, autoplay: i, muted: a, volume: s, logger: c, poster: l }) {
|
|
3457
|
+
var u;
|
|
3458
|
+
super(), u = this, e(this, "element", void 0), e(this, "logger", void 0), e(this, "seekTimes", new v(10)), e(this, "seekStartTime", void 0), e(this, "_totalSeekTime", 0), e(this, "lastPlayableAt", void 0), e(this, "_userProvidedMuted", void 0), e(this, "timers", new j()), e(this, "_userHasProvidedInput", !1), e(this, "_isPaused", !0), e(this, "isActivated", !1), e(this, "dummy", void 0), e(this, "addEventListeners", () => {
|
|
3451
3459
|
this.element.addEventListener("stalled", this.onEvent), this.element.addEventListener("canplay", this.onEvent), this.element.addEventListener("loadeddata", this.onEvent), this.element.addEventListener("loadedmetadata", this.onEvent), this.element.addEventListener("canplaythrough", this.onEvent), this.element.addEventListener("waiting", this.onWaiting), this.element.addEventListener("playing", this.onPlayPause), this.element.addEventListener("pause", this.onPlayPause), this.element.addEventListener("seeked", this.onSeekEnd), this.element.addEventListener("seeking", this.onSeekStart), this.element.addEventListener("volumechange", this.onVolumeChange), this.element.addEventListener("timeupdate", this.onBufferStateChange), this.element.addEventListener("progress", this.onBufferStateChange);
|
|
3452
3460
|
}), e(this, "removeEventListeners", () => {
|
|
3453
3461
|
this.element.removeEventListener("stalled", this.onEvent), this.element.removeEventListener("canplay", this.onEvent), this.element.removeEventListener("loadeddata", this.onEvent), this.element.removeEventListener("loadedmetadata", this.onEvent), this.element.removeEventListener("canplaythrough", this.onEvent), this.element.removeEventListener("waiting", this.onWaiting), this.element.removeEventListener("playing", this.onPlayPause), this.element.removeEventListener("pause", this.onPlayPause), this.element.removeEventListener("seeked", this.onSeekEnd), this.element.removeEventListener("seeking", this.onSeekStart), this.element.removeEventListener("volumechange", this.onVolumeChange), this.element.removeEventListener("timeupdate", this.onBufferStateChange), this.element.removeEventListener("progress", this.onBufferStateChange);
|
|
@@ -3459,12 +3467,10 @@ var ds = (e) => {
|
|
|
3459
3467
|
}), e(this, "attach", (e) => {
|
|
3460
3468
|
this.element.remove(), e.appendChild(this.element);
|
|
3461
3469
|
}), e(this, "load", () => {
|
|
3462
|
-
this.timers.setInterval(this.onPlayPause, 500), this.timers.
|
|
3463
|
-
this.timers.setInterval(this.onBufferStateChange, 500);
|
|
3464
|
-
}, 1e4);
|
|
3470
|
+
this.timers.setInterval(this.onPlayPause, 500), this.onBufferStateChange(), this.timers.setInterval(this.onBufferStateChange, 500);
|
|
3465
3471
|
}), e(this, "unload", () => {
|
|
3466
3472
|
this.timers.unload(), this.removeEventListeners();
|
|
3467
|
-
}), e(this, "getPlaybackRate", () => this.element.playbackRate), e(this, "getPlaybackState", () => this.element.readyState >= this.element.HAVE_FUTURE_DATA ? "playing" : "buffering"), e(this, "getMediaElementState", () => this.element.paused ? "paused" : "playing"), e(this, "setPlaybackRate", (e) => void (this.element.playbackRate = e)), e(this, "getBuffer", () => {
|
|
3473
|
+
}), e(this, "getPlaybackRate", () => this.element.playbackRate), e(this, "getPlaybackState", () => this.element.readyState >= this.element.HAVE_FUTURE_DATA || this.element.seeking && this.lastPlayableAt !== void 0 && performance.now() - this.lastPlayableAt < n.SEEK_SETTLE_BUDGET_MS ? "playing" : "buffering"), e(this, "getMediaElementState", () => this.element.paused ? "paused" : "playing"), e(this, "setPlaybackRate", (e) => void (this.element.playbackRate = e)), e(this, "getBuffer", () => {
|
|
3468
3474
|
let e = [], t = this.element.buffered;
|
|
3469
3475
|
if (!t) return [];
|
|
3470
3476
|
for (let n = 0; n < t.length; n++) e.push({
|
|
@@ -3489,16 +3495,16 @@ var ds = (e) => {
|
|
|
3489
3495
|
});
|
|
3490
3496
|
}), e(this, "_play", t(function* () {
|
|
3491
3497
|
try {
|
|
3492
|
-
yield
|
|
3498
|
+
yield u.element.play(), u._userHasProvidedInput = !u.muted || u._userProvidedMuted;
|
|
3493
3499
|
} catch (e) {
|
|
3494
|
-
if (e instanceof Error && e.name === "NotAllowedError") if (
|
|
3500
|
+
if (e instanceof Error && e.name === "NotAllowedError") if (u._userHasProvidedInput = !1, u.element.muted) u.emit("needs user input", {
|
|
3495
3501
|
forAudio: !0,
|
|
3496
3502
|
forVideo: !0
|
|
3497
3503
|
});
|
|
3498
|
-
else return
|
|
3504
|
+
else return u.element.muted = !0, u.emit("needs user input", {
|
|
3499
3505
|
forAudio: !0,
|
|
3500
3506
|
forVideo: !1
|
|
3501
|
-
}),
|
|
3507
|
+
}), u._play();
|
|
3502
3508
|
else throw e;
|
|
3503
3509
|
}
|
|
3504
3510
|
})), e(this, "onEvent", (e) => {
|
|
@@ -3519,7 +3525,7 @@ var ds = (e) => {
|
|
|
3519
3525
|
});
|
|
3520
3526
|
}), e(this, "onPlayPause", () => {
|
|
3521
3527
|
this._isPaused !== this.element.paused && (this._isPaused = this.element.paused, this.logger.info("player pause change", { paused: this.element.paused }), this.emit("media element state", this.getMediaElementState()));
|
|
3522
|
-
}), e(this, "getBufferState", () => ({
|
|
3528
|
+
}), e(this, "getBufferState", () => (this.element.readyState >= this.element.HAVE_FUTURE_DATA && !this.element.seeking && (this.lastPlayableAt = performance.now()), {
|
|
3523
3529
|
isPaused: this.element.paused,
|
|
3524
3530
|
buffered: this.getBuffer(),
|
|
3525
3531
|
currentTime: this.currentTime,
|
|
@@ -3532,8 +3538,8 @@ var ds = (e) => {
|
|
|
3532
3538
|
if (!this.seekStartTime) return;
|
|
3533
3539
|
let e = performance.now() - this.seekStartTime;
|
|
3534
3540
|
this.seekTimes.push(e), this._totalSeekTime += e, this.seekStartTime = void 0;
|
|
3535
|
-
}), this.logger =
|
|
3536
|
-
!this.element || !
|
|
3541
|
+
}), this.logger = c, this._userProvidedMuted = a, this.element = document.createElement(r), this.element instanceof HTMLVideoElement && (this.element.playsInline = !0), this.element.controls = !1, this.element.autoplay = i, this.element.muted = a, s !== void 0 && (this.element.volume = s), this.element.style.display = "block", this.element.style.width = "100%", this.element.disableRemotePlayback = !0, this.element.setAttribute("poster", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEElEQVR42mNkIAAYRxWAAQAG9gAKqv6+AwAAAABJRU5ErkJggg=="), this.onPlayPause(), setTimeout(() => {
|
|
3542
|
+
!this.element || !l || this.element.setAttribute("poster", l);
|
|
3537
3543
|
}, 0), this.addEventListeners();
|
|
3538
3544
|
}
|
|
3539
3545
|
get seekTime() {
|
|
@@ -3575,7 +3581,11 @@ var ds = (e) => {
|
|
|
3575
3581
|
get isPaused() {
|
|
3576
3582
|
return this._isPaused;
|
|
3577
3583
|
}
|
|
3578
|
-
}
|
|
3584
|
+
};
|
|
3585
|
+
e(fs, "SEEK_SETTLE_BUDGET_MS", 1e3);
|
|
3586
|
+
//#endregion
|
|
3587
|
+
//#region ../../libs/web-sdk/src/mediaCapabilities.ts
|
|
3588
|
+
var ps = (e) => {
|
|
3579
3589
|
if (!navigator.mediaCapabilities) return Promise.resolve({
|
|
3580
3590
|
smooth: !0,
|
|
3581
3591
|
supported: !0,
|
|
@@ -3584,10 +3594,10 @@ var ds = (e) => {
|
|
|
3584
3594
|
});
|
|
3585
3595
|
if (e.codec === "webvtt") throw Error("WebVTT is not supported");
|
|
3586
3596
|
let t;
|
|
3587
|
-
return t =
|
|
3597
|
+
return t = yn(e) ? {
|
|
3588
3598
|
type: "media-source",
|
|
3589
3599
|
audio: {
|
|
3590
|
-
contentType:
|
|
3600
|
+
contentType: bn(e),
|
|
3591
3601
|
bitrate: e.bitRate,
|
|
3592
3602
|
channels: e.channels.toString(),
|
|
3593
3603
|
samplerate: e.sampleRate
|
|
@@ -3595,7 +3605,7 @@ var ds = (e) => {
|
|
|
3595
3605
|
} : {
|
|
3596
3606
|
type: "media-source",
|
|
3597
3607
|
video: {
|
|
3598
|
-
contentType:
|
|
3608
|
+
contentType: bn(e),
|
|
3599
3609
|
bitrate: e.bitRate,
|
|
3600
3610
|
width: e.width,
|
|
3601
3611
|
height: e.height,
|
|
@@ -3986,7 +3996,7 @@ var vc = /* @__PURE__ */ new WeakMap(), yc = /* @__PURE__ */ new WeakMap(), bc =
|
|
|
3986
3996
|
let n = new Uint8Array(t.data);
|
|
3987
3997
|
n[0] === x(yc, this) && e.enqueue(n.subarray(1));
|
|
3988
3998
|
}
|
|
3989
|
-
}), x(vc, this).addEventListener("error", () => e.error(/* @__PURE__ */ Error("WebSocket error"))), x(vc, this).addEventListener("close", () =>
|
|
3999
|
+
}), x(vc, this).addEventListener("error", () => e.error(/* @__PURE__ */ Error("WebSocket error"))), x(vc, this).addEventListener("close", () => pn(() => e.close()));
|
|
3990
4000
|
}
|
|
3991
4001
|
cancel(e) {
|
|
3992
4002
|
x(vc, this).close(void 0, e);
|
|
@@ -4008,7 +4018,7 @@ var vc = /* @__PURE__ */ new WeakMap(), yc = /* @__PURE__ */ new WeakMap(), bc =
|
|
|
4008
4018
|
]);
|
|
4009
4019
|
}
|
|
4010
4020
|
}
|
|
4011
|
-
}), S(Cc, this, () =>
|
|
4021
|
+
}), S(Cc, this, () => pn(() => e.close())), S(wc, this, () => e.error(/* @__PURE__ */ Error("WebSocket error"))), x(xc, this).addEventListener("message", x(Sc, this)), x(xc, this).addEventListener("error", x(wc, this)), x(xc, this).addEventListener("close", x(Cc, this));
|
|
4012
4022
|
}
|
|
4013
4023
|
cancel(e) {
|
|
4014
4024
|
x(Sc, this) && x(xc, this).removeEventListener("message", x(Sc, this)), x(wc, this) && x(xc, this).removeEventListener("error", x(wc, this)), x(Cc, this) && x(xc, this).removeEventListener("close", x(Cc, this));
|
|
@@ -5011,7 +5021,7 @@ var td = class {
|
|
|
5011
5021
|
let n = Math.max(0, Date.now() - x(ad, this)), r = Number(e.expires);
|
|
5012
5022
|
if (r > 0) {
|
|
5013
5023
|
let e = Math.max(t.minGraceTime, Math.min(r / 10, t.maxGraceTime)), i = Math.min(r - e - n, t.maxTimeout);
|
|
5014
|
-
Promise.race([
|
|
5024
|
+
Promise.race([gn(i), this.done().catch(o)]).then(() => x(od, this).resolve(this.expiryState())).catch(o);
|
|
5015
5025
|
}
|
|
5016
5026
|
x(nd, this).resolve(e);
|
|
5017
5027
|
}
|
|
@@ -5593,7 +5603,7 @@ var sf = 2e3, cf = /* @__PURE__ */ new WeakMap(), lf = /* @__PURE__ */ new WeakM
|
|
|
5593
5603
|
params: n
|
|
5594
5604
|
}, [s, c] = Xd(x(uf, r), o);
|
|
5595
5605
|
if (x(lf, r).update((e) => e.set(i, s)), yield x(uf, r).push(o), !(yield Promise.race([s.state.ok(), x(cf, r).closed()]))) throw Error("Session closed");
|
|
5596
|
-
return c.closed().then(() => Promise.race([
|
|
5606
|
+
return c.closed().then(() => Promise.race([gn(sf), r.closed()])).then(() => b(ff, r, hf).call(r, c.id)).catch(() => b(ff, r, hf).call(r, c.id)), c;
|
|
5597
5607
|
} catch (e) {
|
|
5598
5608
|
throw x(df, r).error("Error 'subscribe'", e), e;
|
|
5599
5609
|
}
|
|
@@ -5701,6 +5711,10 @@ var Tf = class {
|
|
|
5701
5711
|
transportType() {
|
|
5702
5712
|
return x(vf, this).transportType();
|
|
5703
5713
|
}
|
|
5714
|
+
getStats() {
|
|
5715
|
+
var e, t, n;
|
|
5716
|
+
return (e = (t = (n = x(vf, this)).getStats) == null ? void 0 : t.call(n)) == null ? Promise.resolve(void 0) : e;
|
|
5717
|
+
}
|
|
5704
5718
|
url() {
|
|
5705
5719
|
return x(vf, this).url();
|
|
5706
5720
|
}
|
|
@@ -5809,9 +5823,12 @@ function jf() {
|
|
|
5809
5823
|
}
|
|
5810
5824
|
//#endregion
|
|
5811
5825
|
//#region ../../libs/moq/src/protocol/StreamIdBufferWriter.ts
|
|
5812
|
-
var Mf = 128
|
|
5826
|
+
var Mf = 128;
|
|
5827
|
+
Mf - 1;
|
|
5828
|
+
var Nf = /* @__PURE__ */ new WeakMap(), Pf = /* @__PURE__ */ new WeakMap(), Ff = /* @__PURE__ */ new WeakMap(), If = /* @__PURE__ */ new WeakMap(), Lf = /* @__PURE__ */ new WeakMap(), Rf = /* @__PURE__ */ new WeakSet(), zf = class {
|
|
5813
5829
|
constructor(e, t, n) {
|
|
5814
|
-
C(this, Rf), y(this, Nf, void 0), y(this, Pf, void 0), y(this, Ff, !0), y(this, If, !1), y(this, Lf, void 0),
|
|
5830
|
+
if (C(this, Rf), y(this, Nf, void 0), y(this, Pf, void 0), y(this, Ff, !0), y(this, If, !1), y(this, Lf, void 0), !Number.isInteger(t) || t < 1 || t > 127) throw Error(`Invalid stream ID ${t}: must be an integer in 1..127`);
|
|
5831
|
+
S(Nf, this, e), S(Pf, this, t), S(Lf, this, n);
|
|
5815
5832
|
}
|
|
5816
5833
|
writeUnsigned8(e) {
|
|
5817
5834
|
var n = this;
|
|
@@ -5866,7 +5883,7 @@ function Vf(e = !0) {
|
|
|
5866
5883
|
//#region ../../libs/moq/src/transport/WebSocketConnection.ts
|
|
5867
5884
|
var Hf = /* @__PURE__ */ new WeakMap(), Uf = /* @__PURE__ */ new WeakMap(), Wf = /* @__PURE__ */ new WeakMap(), Gf = /* @__PURE__ */ new WeakMap(), Kf = /* @__PURE__ */ new WeakMap(), qf = /* @__PURE__ */ new WeakMap(), Jf = /* @__PURE__ */ new WeakMap(), Yf = /* @__PURE__ */ new WeakSet(), Xf = class {
|
|
5868
5885
|
constructor(e, t) {
|
|
5869
|
-
C(this, Yf), y(this, Hf, void 0), y(this, Uf, void 0), y(this, Wf, void 0), y(this, Gf, void 0), y(this, Kf, /* @__PURE__ */ new Map()), y(this, qf, O.get().createContext("WebSocketConnection")), y(this, Jf, new Set(Array(
|
|
5886
|
+
C(this, Yf), y(this, Hf, void 0), y(this, Uf, void 0), y(this, Wf, void 0), y(this, Gf, void 0), y(this, Kf, /* @__PURE__ */ new Map()), y(this, qf, O.get().createContext("WebSocketConnection")), y(this, Jf, new Set(Array(127).fill(0).map((e, t) => t + 1))), S(Hf, this, e), S(Uf, this, t), S(Wf, this, new ReadableStream(new Tc(e))), x(Hf, this).addEventListener("close", (e) => {
|
|
5870
5887
|
x(qf, this).info("WebSocket closed", {
|
|
5871
5888
|
code: e.code,
|
|
5872
5889
|
reason: e.reason,
|
|
@@ -5993,6 +6010,18 @@ var Qf = /* @__PURE__ */ new WeakMap(), $f = /* @__PURE__ */ new WeakMap(), ep =
|
|
|
5993
6010
|
return x(ep, e).pop();
|
|
5994
6011
|
})();
|
|
5995
6012
|
}
|
|
6013
|
+
getStats() {
|
|
6014
|
+
var e = this;
|
|
6015
|
+
return t(function* () {
|
|
6016
|
+
let t = x(Qf, e);
|
|
6017
|
+
if (typeof t.getStats != "function") return;
|
|
6018
|
+
let n = yield t.getStats();
|
|
6019
|
+
if (n != null) return {
|
|
6020
|
+
packetsLost: n.packetsLost,
|
|
6021
|
+
packetsSent: n.packetsSent
|
|
6022
|
+
};
|
|
6023
|
+
})();
|
|
6024
|
+
}
|
|
5996
6025
|
};
|
|
5997
6026
|
function op() {
|
|
5998
6027
|
var e = this;
|
|
@@ -6080,7 +6109,7 @@ function pp() {
|
|
|
6080
6109
|
session: yield up(e),
|
|
6081
6110
|
transportSelectionReason: void 0
|
|
6082
6111
|
};
|
|
6083
|
-
let t = up(e).catch(() => cp(e)), n = yield Promise.race([t,
|
|
6112
|
+
let t = up(e).catch(() => cp(e)), n = yield Promise.race([t, gn(e.websocketFallbackTimeoutMs)]);
|
|
6084
6113
|
return n ? {
|
|
6085
6114
|
session: n,
|
|
6086
6115
|
transportSelectionReason: n.transportType() === "websocket" ? "fallback" : void 0
|
|
@@ -6947,7 +6976,7 @@ function ih(e) {
|
|
|
6947
6976
|
try {
|
|
6948
6977
|
return yield e();
|
|
6949
6978
|
} catch (i) {
|
|
6950
|
-
if (t === n.catalog().current() && r && (yield Promise.race([r,
|
|
6979
|
+
if (t === n.catalog().current() && r && (yield Promise.race([r, gn(500)])), t !== n.catalog().current()) return e();
|
|
6951
6980
|
throw i;
|
|
6952
6981
|
}
|
|
6953
6982
|
})();
|
|
@@ -7096,7 +7125,7 @@ var Ch = 1e4, wh = /* @__PURE__ */ new WeakMap(), Th = /* @__PURE__ */ new WeakS
|
|
|
7096
7125
|
for (;;) {
|
|
7097
7126
|
let [t, n] = e.value.value();
|
|
7098
7127
|
try {
|
|
7099
|
-
yield Promise.race([
|
|
7128
|
+
yield Promise.race([_n(Ch, /* @__PURE__ */ Error("Idle timeout")), n]);
|
|
7100
7129
|
} catch (e) {
|
|
7101
7130
|
return e;
|
|
7102
7131
|
}
|
|
@@ -7491,7 +7520,7 @@ var $h = 1e4, Q = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMa
|
|
|
7491
7520
|
audioTrack: ne == null ? void 0 : ne.track,
|
|
7492
7521
|
burstMs: d.burstMs || 0
|
|
7493
7522
|
}),
|
|
7494
|
-
|
|
7523
|
+
_n($h, /* @__PURE__ */ Error("Timeout waiting for player to start")),
|
|
7495
7524
|
oe
|
|
7496
7525
|
]), v = new Tg(_.catalog());
|
|
7497
7526
|
u.set(bp(h.namespace), v), e.emit("received signal", {
|
|
@@ -7519,7 +7548,7 @@ var $h = 1e4, Q = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMa
|
|
|
7519
7548
|
function mg() {
|
|
7520
7549
|
var e = this;
|
|
7521
7550
|
return t(function* () {
|
|
7522
|
-
x(tg, e).transportType() === "websocket" && (yield
|
|
7551
|
+
x(tg, e).transportType() === "websocket" && (yield gn(5e3));
|
|
7523
7552
|
var t = !1, n = !1, r;
|
|
7524
7553
|
try {
|
|
7525
7554
|
for (var i = U(x($, e).stats()), a; t = !(a = yield i.next()).done; t = !1) {
|
|
@@ -7629,7 +7658,7 @@ function bg(e, n) {
|
|
|
7629
7658
|
let n = d.value;
|
|
7630
7659
|
{
|
|
7631
7660
|
var f;
|
|
7632
|
-
let s = bp(n.track.namespace), c = n.track.trackObject.language, l = fe((f = n.track.trackObject.codec) == null ? "" : f), u = n.track.trackObject.codec, d = l ?
|
|
7661
|
+
let s = bp(n.track.namespace), c = n.track.trackObject.language, l = fe((f = n.track.trackObject.codec) == null ? "" : f), u = n.track.trackObject.codec, d = l ? bn({
|
|
7633
7662
|
codec: l,
|
|
7634
7663
|
codecString: u
|
|
7635
7664
|
}) : void 0, ne = !!n.track.trackObject["com.vindral.drm"];
|
|
@@ -7644,9 +7673,9 @@ function bg(e, n) {
|
|
|
7644
7673
|
drmTransition: a !== void 0 && a !== ne
|
|
7645
7674
|
};
|
|
7646
7675
|
t = s, i = c, a = ne;
|
|
7647
|
-
let h = p.producerReferenceTime(), ee = x(cg, r).get(n.track.namespace)
|
|
7648
|
-
if (h &&
|
|
7649
|
-
x(cg, r).set(n.track.namespace,
|
|
7676
|
+
let h = p.producerReferenceTime(), ee = x(cg, r).get(n.track.namespace), te = performance.now();
|
|
7677
|
+
if (h && (ee === void 0 || te - ee > 1e3)) {
|
|
7678
|
+
x(cg, r).set(n.track.namespace, te);
|
|
7650
7679
|
let t = e.wallclock() - h.getTime();
|
|
7651
7680
|
x(eg, r).debug("timing-info", {
|
|
7652
7681
|
mediaType: p.mediaType(),
|
|
@@ -7719,12 +7748,12 @@ var Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg =
|
|
|
7719
7748
|
}
|
|
7720
7749
|
getAudioTrack(e) {
|
|
7721
7750
|
if (!e.codec) return;
|
|
7722
|
-
let t = x(Cg, this).filter((t) => !(!
|
|
7751
|
+
let t = x(Cg, this).filter((t) => !(!yn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
|
|
7723
7752
|
return t[t.length - 1];
|
|
7724
7753
|
}
|
|
7725
7754
|
getVideoTrack(e) {
|
|
7726
7755
|
if (!e.codec) return;
|
|
7727
|
-
let t = x(Cg, this).filter((t) => !(!
|
|
7756
|
+
let t = x(Cg, this).filter((t) => !(!vn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
|
|
7728
7757
|
return t[t.length - 1];
|
|
7729
7758
|
}
|
|
7730
7759
|
renditions() {
|
|
@@ -7811,7 +7840,7 @@ var Dg = (e, t) => {
|
|
|
7811
7840
|
if (i.isConnectInProgress) return i.logger.info("Connect already in progress"), !1;
|
|
7812
7841
|
if (i.isSuspended) return !1;
|
|
7813
7842
|
if (i.readyState() !== WebSocket.CLOSED && i.close("new connection in progress"), i.shouldContinueConnecting = !0, i._isConnectInProgress = !0, e && i.options.reconnectDelay > 0) {
|
|
7814
|
-
i.logger.info("Waiting for reconnect delay", w({}, i.options)), yield
|
|
7843
|
+
i.logger.info("Waiting for reconnect delay", w({}, i.options)), yield gn(i.options.reconnectDelay);
|
|
7815
7844
|
let e = yield i.options.reconnectHandler(i.reconnectState);
|
|
7816
7845
|
if (i.reconnectState.reconnectRetries++, !e) return i._isConnectInProgress = !1, i.emit("error", s()), !1;
|
|
7817
7846
|
}
|
|
@@ -7879,7 +7908,7 @@ var Dg = (e, t) => {
|
|
|
7879
7908
|
return;
|
|
7880
7909
|
}
|
|
7881
7910
|
let t = JSON.parse(e);
|
|
7882
|
-
if (
|
|
7911
|
+
if (Cn(t)) {
|
|
7883
7912
|
if (t.type === "pong") {
|
|
7884
7913
|
this.handleMessage(e);
|
|
7885
7914
|
return;
|
|
@@ -7917,7 +7946,7 @@ var Dg = (e, t) => {
|
|
|
7917
7946
|
if (e instanceof ArrayBuffer) this.emitter.emit("received data", e);
|
|
7918
7947
|
else {
|
|
7919
7948
|
let t = JSON.parse(e);
|
|
7920
|
-
if (!
|
|
7949
|
+
if (!Cn(t)) return;
|
|
7921
7950
|
switch (t.type) {
|
|
7922
7951
|
case "pong":
|
|
7923
7952
|
this.lastPingSentTime && (this.rtts.push(performance.now() - this.lastPingSentTime), this.isPingInFlight = !1, this.emitter.emit("rtt", Ot(this.rtts.items())));
|
|
@@ -8087,7 +8116,7 @@ var Ig = (e) => {
|
|
|
8087
8116
|
x(t_, this) !== void 0 && (clearTimeout(x(t_, this)), S(t_, this, void 0));
|
|
8088
8117
|
}), y(this, c_, function() {
|
|
8089
8118
|
var e = t(function* (e) {
|
|
8090
|
-
return (yield o.config.reconnectHandler({ reconnectRetries: x(Kg, o) })) ? (x(u_, o).call(o) ? (o.logger.info("Reconnect burst detected, applying backoff before retrying"), yield
|
|
8119
|
+
return (yield o.config.reconnectHandler({ reconnectRetries: x(Kg, o) })) ? (x(u_, o).call(o) ? (o.logger.info("Reconnect burst detected, applying backoff before retrying"), yield gn(n.RECONNECT_BACKOFF_MS)) : o.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), x(Wg, o)) : (o.emitter.emit("error", s()), !1);
|
|
8091
8120
|
});
|
|
8092
8121
|
return function(t) {
|
|
8093
8122
|
return e.apply(this, arguments);
|
|
@@ -8175,12 +8204,12 @@ e(f_, "PING_TIMEOUT", 1e3), e(f_, "RECONNECT_BACKOFF_MS", 1e3), e(f_, "RECONNECT
|
|
|
8175
8204
|
//#endregion
|
|
8176
8205
|
//#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
|
|
8177
8206
|
var m_, h_ = () => ({
|
|
8178
|
-
video: w(w({},
|
|
8179
|
-
audio: { bitRate:
|
|
8207
|
+
video: w(w({}, Sn()), {}, { bitRate: xn() }),
|
|
8208
|
+
audio: { bitRate: xn() }
|
|
8180
8209
|
}), g_ = () => ({
|
|
8181
8210
|
width: window.innerWidth,
|
|
8182
8211
|
height: window.innerHeight,
|
|
8183
|
-
bitRate:
|
|
8212
|
+
bitRate: xn()
|
|
8184
8213
|
}), __ = class t {
|
|
8185
8214
|
constructor(n, r, i, a) {
|
|
8186
8215
|
e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
|
|
@@ -8431,7 +8460,7 @@ var v_ = 5, y_ = 100, b_ = 1e3, x_ = class r {
|
|
|
8431
8460
|
break;
|
|
8432
8461
|
}
|
|
8433
8462
|
case "video": {
|
|
8434
|
-
let { VideoDecoderWorkerContext: n } = yield import("./
|
|
8463
|
+
let { VideoDecoderWorkerContext: n } = yield import("./C5AsBfiL.js"), r = yield n.create(i.createContext("VideoDecoderWorker"), a, c, l, u, d, () => s.currentTime);
|
|
8435
8464
|
p = r.isWebCodecs, h = r.usingOffscreenCanvas, t.set(e.type, {
|
|
8436
8465
|
buffer: [],
|
|
8437
8466
|
decoderContext: r,
|
|
@@ -8627,7 +8656,7 @@ var k_ = 1e3, A_ = 50, j_ = class t {
|
|
|
8627
8656
|
var r;
|
|
8628
8657
|
super(), r = this, e(this, "context", new (M_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
|
|
8629
8658
|
try {
|
|
8630
|
-
return yield Promise.race([r.context.resume(),
|
|
8659
|
+
return yield Promise.race([r.context.resume(), _n(1e3, p())]);
|
|
8631
8660
|
} catch (e) {
|
|
8632
8661
|
throw r.suspend().catch(o), e;
|
|
8633
8662
|
}
|
|
@@ -9820,12 +9849,12 @@ var vv, yv = () => ({
|
|
|
9820
9849
|
general: yv()
|
|
9821
9850
|
}), xv = class {
|
|
9822
9851
|
constructor(t, n, r) {
|
|
9823
|
-
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", bv()), e(this, "bufferFullness", new v(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", () => {
|
|
9824
|
-
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);
|
|
9852
|
+
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", bv()), e(this, "bufferFullness", new v(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, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
|
|
9853
|
+
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), this.emitter.on("connection state", this.onConnectionState);
|
|
9825
9854
|
}), e(this, "unload", () => {
|
|
9826
|
-
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();
|
|
9855
|
+
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.emitter.off("connection state", this.onConnectionState), this.suspend();
|
|
9827
9856
|
}), e(this, "suspend", () => {
|
|
9828
|
-
this.isSuspended = !0, this.timers.unload(), this.stopBuffering(), this.unsetActive();
|
|
9857
|
+
this.isSuspended = !0, this.timers.unload(), this.stopBuffering(), this.unsetActive(), this.hasPlayedInSession = !1;
|
|
9829
9858
|
}), e(this, "unsuspend", () => {
|
|
9830
9859
|
this.isSuspended = !1, this.currentLevel && this.setActive();
|
|
9831
9860
|
}), e(this, "fatalQosGraceTime", () => 1e4 * (this.fatalQosCount + 1)), e(this, "incrementFatalQosCount", () => {
|
|
@@ -9835,10 +9864,10 @@ var vv, yv = () => ({
|
|
|
9835
9864
|
let a = ((t = (n = e.video) == null ? void 0 : n.bitRate) == null ? 0 : t) + ((r = (i = e.audio) == null ? void 0 : i.bitRate) == null ? 0 : r);
|
|
9836
9865
|
return this.metrics.levels[a];
|
|
9837
9866
|
}), e(this, "getBufferFullnessRegression", () => this.bufferFullnessRegression), e(this, "getTargetBufferTime", () => this.targetBufferTime), e(this, "activeRatios", () => {
|
|
9838
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
9867
|
+
let e = /* @__PURE__ */ new Map(), t = dn(this.metrics.general.activeRanges);
|
|
9839
9868
|
if (Object.entries(this.metrics.levels).forEach(([n, r]) => {
|
|
9840
9869
|
var i;
|
|
9841
|
-
let a = parseInt(n, 10), o = t ?
|
|
9870
|
+
let a = parseInt(n, 10), o = t ? dn(r.activeRanges) / t : 0, s = this.getQualityIndex(a).toString();
|
|
9842
9871
|
e.set(s, ((i = e.get(s)) == null ? 0 : i) + o);
|
|
9843
9872
|
}), !this.hasAsserted) {
|
|
9844
9873
|
let t = e.size ? Math.abs(Array.from(e.values()).reduce((e, t) => e + t, 0) - 1) <= .02 : !0;
|
|
@@ -9846,17 +9875,17 @@ var vv, yv = () => ({
|
|
|
9846
9875
|
}
|
|
9847
9876
|
return e;
|
|
9848
9877
|
}), e(this, "bufferingRatios", () => {
|
|
9849
|
-
let e = /* @__PURE__ */ new Map(), t =
|
|
9878
|
+
let e = /* @__PURE__ */ new Map(), t = dn(this.metrics.general.bufferingRanges);
|
|
9850
9879
|
if (Object.entries(this.metrics.levels).forEach(([n, r]) => {
|
|
9851
9880
|
var i;
|
|
9852
|
-
let a = parseInt(n, 10), o = t ?
|
|
9881
|
+
let a = parseInt(n, 10), o = t ? dn(r.bufferingRanges) / t : 0, s = this.getQualityIndex(a).toString();
|
|
9853
9882
|
e.set(s, ((i = e.get(s)) == null ? 0 : i) + o);
|
|
9854
9883
|
}), !this.hasAsserted) {
|
|
9855
9884
|
let t = Array.from(e.values()).reduce((e, t) => e + t, 0) <= 1;
|
|
9856
9885
|
t || (this.hasAsserted = !0, console.assert(t, `Buffering ratios should be less than 1 - actual: ${Array.from(e.values()).reduce((e, t) => e + t, 0)}`));
|
|
9857
9886
|
}
|
|
9858
9887
|
return e;
|
|
9859
|
-
}), e(this, "bufferingEventsLast", (e) => this.metrics.general.bufferingRanges.filter((t) => t.start >= performance.now() - e).length), e(this, "timeSpentBufferingLast", (e) =>
|
|
9888
|
+
}), e(this, "bufferingEventsLast", (e) => this.metrics.general.bufferingRanges.filter((t) => t.start >= performance.now() - e).length), e(this, "timeSpentBufferingLast", (e) => fn(this.metrics.general.bufferingRanges, e)), e(this, "timeSpentActiveLast", (e) => fn(this.metrics.general.activeRanges, e)), e(this, "timeSpentPlayingInAtLeastLevelRatio", (e) => {
|
|
9860
9889
|
var t, n, r, i;
|
|
9861
9890
|
let a = this.timeSpentBuffering(), o = this.timeActive(), s = this.bufferingRatios(), c = this.activeRatios(), l = ((t = (n = e.video) == null ? void 0 : n.bitRate) == null ? 0 : t) + ((r = (i = e.audio) == null ? void 0 : i.bitRate) == null ? 0 : r), u = a / o;
|
|
9862
9891
|
return Object.keys(this.metrics.levels).map((e) => parseInt(e, 10)).filter((e) => e >= l).reduce((e, t) => {
|
|
@@ -9864,7 +9893,7 @@ var vv, yv = () => ({
|
|
|
9864
9893
|
let i = this.getQualityIndex(t).toString();
|
|
9865
9894
|
return ((n = c.get(i)) == null ? 0 : n) - ((r = s.get(i)) == null ? 0 : r) * u + e;
|
|
9866
9895
|
}, 0);
|
|
9867
|
-
}), e(this, "timeSpentBuffering", () =>
|
|
9896
|
+
}), e(this, "timeSpentBuffering", () => dn(this.metrics.general.bufferingRanges)), e(this, "timeActive", () => dn(this.metrics.general.activeRanges)), e(this, "getStatistics", () => {
|
|
9868
9897
|
let e = this.timeSpentBuffering(), t = this.timeActive(), n = this.metrics.general.bufferingRanges.length, r = this.activeRatios(), i = t / 6e4, a = t > 0 ? e / t : 0, o = Math.max(i, 1), s = i > 0 ? n / o : 0, c = [...r].reduce((e, [t, n]) => e + parseInt(t, 10) * n, 0), l = 6e4, u = this.timeSpentActiveLast(l), d = this.timeSpentBufferingLast(l), f = u > 0 ? d / u : 0, p = this.metrics.general.upgradesFromLevel.length + this.metrics.general.downgradesFromLevel.length, m = i > 0 ? p / o : 0, h = n > 0 ? e / n : 0;
|
|
9869
9898
|
return {
|
|
9870
9899
|
timeSpentBuffering: e,
|
|
@@ -9889,14 +9918,14 @@ var vv, yv = () => ({
|
|
|
9889
9918
|
if (e.from) {
|
|
9890
9919
|
var f;
|
|
9891
9920
|
let e = (f = this.metrics.levels[l]) == null ? yv() : f;
|
|
9892
|
-
l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()),
|
|
9921
|
+
l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), ln(e.activeRanges);
|
|
9893
9922
|
let t = e.bufferingRanges[e.bufferingRanges.length - 1];
|
|
9894
|
-
d = !!t && !t.end,
|
|
9923
|
+
d = !!t && !t.end, ln(e.bufferingRanges), this.metrics.levels[l] = e;
|
|
9895
9924
|
}
|
|
9896
9925
|
if (e.to) {
|
|
9897
9926
|
var p;
|
|
9898
9927
|
let e = (p = this.metrics.levels[u]) == null ? yv() : p;
|
|
9899
|
-
|
|
9928
|
+
un(e.activeRanges), d && un(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
|
|
9900
9929
|
}
|
|
9901
9930
|
}), e(this, "onBufferFullness", (e) => {
|
|
9902
9931
|
this.bufferFullness.push(e), this.metrics.bufferFullness = e, this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression && (this.bufferFullnessRegression = this.calculateLinearRegression());
|
|
@@ -9906,12 +9935,14 @@ var vv, yv = () => ({
|
|
|
9906
9935
|
currentLevel: this.currentLevel
|
|
9907
9936
|
}), e) {
|
|
9908
9937
|
case "playing":
|
|
9909
|
-
this.stopBuffering();
|
|
9938
|
+
this.hasPlayedInSession = !0, this.stopBuffering();
|
|
9910
9939
|
break;
|
|
9911
9940
|
case "buffering":
|
|
9912
|
-
this.isSuspended
|
|
9941
|
+
!this.isSuspended && this.hasPlayedInSession && this.startBuffering();
|
|
9913
9942
|
break;
|
|
9914
9943
|
}
|
|
9944
|
+
}), e(this, "onConnectionState", (e) => {
|
|
9945
|
+
e !== "connected" && this.isSuspended && (this.hasPlayedInSession = !1);
|
|
9915
9946
|
}), e(this, "onVideoDecodeRate", (e) => {
|
|
9916
9947
|
var t;
|
|
9917
9948
|
if (this.metrics.general.decodeRate = e, !this.currentLevel) return;
|
|
@@ -9925,21 +9956,21 @@ var vv, yv = () => ({
|
|
|
9925
9956
|
})))), e(this, "stopBuffering", () => {
|
|
9926
9957
|
if (this.currentLevel) {
|
|
9927
9958
|
let e = this.metrics.levels[this.currentLevel];
|
|
9928
|
-
e &&
|
|
9959
|
+
e && ln(e.bufferingRanges);
|
|
9929
9960
|
}
|
|
9930
|
-
|
|
9961
|
+
ln(this.metrics.general.bufferingRanges);
|
|
9931
9962
|
}), e(this, "startBuffering", () => {
|
|
9932
9963
|
if (this.currentLevel) {
|
|
9933
9964
|
let e = this.metrics.levels[this.currentLevel];
|
|
9934
|
-
e &&
|
|
9965
|
+
e && un(e.bufferingRanges);
|
|
9935
9966
|
}
|
|
9936
|
-
|
|
9967
|
+
un(this.metrics.general.bufferingRanges);
|
|
9937
9968
|
}), e(this, "unsetActive", () => {
|
|
9938
9969
|
if (this.currentLevel) {
|
|
9939
9970
|
let e = this.metrics.levels[this.currentLevel];
|
|
9940
|
-
e &&
|
|
9971
|
+
e && ln(e.activeRanges);
|
|
9941
9972
|
}
|
|
9942
|
-
|
|
9973
|
+
ln(this.metrics.general.activeRanges);
|
|
9943
9974
|
}), e(this, "getQualityIndex", (e) => {
|
|
9944
9975
|
if (!this.qualityIndexOrder.length) {
|
|
9945
9976
|
var t, n;
|
|
@@ -9959,9 +9990,9 @@ var vv, yv = () => ({
|
|
|
9959
9990
|
setActive() {
|
|
9960
9991
|
if (this.currentLevel) {
|
|
9961
9992
|
let e = this.metrics.levels[this.currentLevel];
|
|
9962
|
-
e &&
|
|
9993
|
+
e && un(e.activeRanges);
|
|
9963
9994
|
}
|
|
9964
|
-
|
|
9995
|
+
un(this.metrics.general.activeRanges);
|
|
9965
9996
|
}
|
|
9966
9997
|
};
|
|
9967
9998
|
vv = xv, e(xv, "create", (e, t, n) => new vv(e, t, n));
|
|
@@ -9981,16 +10012,16 @@ var Sv, Cv = class {
|
|
|
9981
10012
|
this.renditions.set(e, t);
|
|
9982
10013
|
}), e(this, "getLanguages", () => this.languages), e(this, "getVideoRendition", (e, t = this.getCurrentSubscription().channelId) => {
|
|
9983
10014
|
let n = this.getRendition(e, t);
|
|
9984
|
-
if (n &&
|
|
10015
|
+
if (n && vn(n)) return n;
|
|
9985
10016
|
}), e(this, "getAudioRenditions", (e) => {
|
|
9986
10017
|
let t = this.renditions.get(e);
|
|
9987
|
-
return t == null ? void 0 : t.filter((e) =>
|
|
10018
|
+
return t == null ? void 0 : t.filter((e) => yn(e));
|
|
9988
10019
|
}), e(this, "getVideoRenditions", (e) => {
|
|
9989
10020
|
let t = this.renditions.get(e);
|
|
9990
|
-
return t == null ? void 0 : t.filter((e) =>
|
|
10021
|
+
return t == null ? void 0 : t.filter((e) => vn(e));
|
|
9991
10022
|
}), e(this, "getAudioRendition", (e, t = this.getCurrentSubscription().channelId) => {
|
|
9992
10023
|
let n = this.getRendition(e, t);
|
|
9993
|
-
if (n &&
|
|
10024
|
+
if (n && yn(n)) return n;
|
|
9994
10025
|
}), e(this, "getRendition", (e, t = this.getCurrentSubscription().channelId) => {
|
|
9995
10026
|
var n;
|
|
9996
10027
|
return (n = this.renditions.get(t)) == null ? void 0 : n.find((t) => t.id === e);
|
|
@@ -10030,7 +10061,7 @@ var Sv, Cv = class {
|
|
|
10030
10061
|
}));
|
|
10031
10062
|
}), e(this, "createRenditionLevels", (e) => {
|
|
10032
10063
|
var t;
|
|
10033
|
-
let { video: n, audio: r, channelId: i } = e, a = (t = this.renditions.get(i)) == null ? [] : t, o = a.filter(
|
|
10064
|
+
let { video: n, audio: r, channelId: i } = e, a = (t = this.renditions.get(i)) == null ? [] : t, o = a.filter(vn).filter((e) => n && e.codec === n.codec), s = a.filter(yn).filter((e) => r && e.codec === r.codec && e.language === r.language), c = Math.max(o.length, s.length), l = [];
|
|
10034
10065
|
for (let e = 0; e < c; e++) {
|
|
10035
10066
|
let t = o[Math.min(o.length - 1, e)], n = s[Math.min(s.length - 1, e)];
|
|
10036
10067
|
l.push({
|
|
@@ -10671,7 +10702,7 @@ var Uv = class {
|
|
|
10671
10702
|
}
|
|
10672
10703
|
return "wasm";
|
|
10673
10704
|
}, Xv = (e, t, n) => {
|
|
10674
|
-
if (
|
|
10705
|
+
if (vn(t)) return w(w({}, e), {}, {
|
|
10675
10706
|
type: "video",
|
|
10676
10707
|
codec: t.codec,
|
|
10677
10708
|
isSync: Jo(e.flags),
|
|
@@ -10801,10 +10832,10 @@ var Uv = class {
|
|
|
10801
10832
|
return this.inFlight.set(e, o), o;
|
|
10802
10833
|
}), this.logger = n;
|
|
10803
10834
|
}
|
|
10804
|
-
}, sy = /* @__PURE__ */ new WeakMap(),
|
|
10835
|
+
}, sy = 1e4, cy = /* @__PURE__ */ new WeakMap(), ly = /* @__PURE__ */ new WeakMap(), uy = /* @__PURE__ */ new WeakMap(), dy = class n extends ge {
|
|
10805
10836
|
constructor(r) {
|
|
10806
10837
|
var i, a;
|
|
10807
|
-
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 ge()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId",
|
|
10838
|
+
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 ge()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", hn()), e(this, "_channels", []), e(this, "createdAt", performance.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 xe(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new mn()), e(this, "encryptedMediaExtensions", void 0), y(this, cy, 0), y(this, ly, []), 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), y(this, uy, void 0), e(this, "attach", (e) => {
|
|
10808
10839
|
var t;
|
|
10809
10840
|
(t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
|
|
10810
10841
|
}), e(this, "setElement", (e) => {
|
|
@@ -10847,7 +10878,7 @@ var Uv = class {
|
|
|
10847
10878
|
})), e(this, "onConnectInfo", function() {
|
|
10848
10879
|
var e = t(function* (e) {
|
|
10849
10880
|
var n;
|
|
10850
|
-
i.sessionId =
|
|
10881
|
+
i.sessionId = hn();
|
|
10851
10882
|
let r = i.modules.subscription.getTargetSubscription(), a = e.channels.find((e) => e.channelId === r.channelId);
|
|
10852
10883
|
if (i.emitter.emit("connect info", e), "timeshift" in e && e.timeshift ? (e.timeshift, i._channels = e.channels.map((t) => w(w({}, t), {}, { timeshift: e.timeshift })), i.emit("timeshift info", e.timeshift)) : i._channels = e.channels, i.updateTextTracks((n = a == null ? void 0 : a.renditions) == null ? [] : n), !i.textTrack && i.options.get("textTrack") && (i.textTrack = i.options.get("textTrack")), yield Promise.all(e.channels.map(function() {
|
|
10853
10884
|
var e = t(function* (e) {
|
|
@@ -10887,31 +10918,31 @@ var Uv = class {
|
|
|
10887
10918
|
}), e(this, "updateTextTracks", (e) => {
|
|
10888
10919
|
let t = e.filter((e) => e.codec === "webvtt");
|
|
10889
10920
|
t.forEach((e) => {
|
|
10890
|
-
if (!x(
|
|
10921
|
+
if (!x(ly, this).find((t) => t.language === e.language)) {
|
|
10891
10922
|
if (this.modules.canvasModule) {
|
|
10892
10923
|
let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
|
|
10893
|
-
x(
|
|
10924
|
+
x(ly, this).push(t);
|
|
10894
10925
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
10895
10926
|
let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
|
|
10896
|
-
x(
|
|
10927
|
+
x(ly, this).push(t);
|
|
10897
10928
|
}
|
|
10898
10929
|
}
|
|
10899
10930
|
});
|
|
10900
|
-
for (let e of x(
|
|
10931
|
+
for (let e of x(ly, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
|
|
10901
10932
|
this.emit("text tracks", this.textTracks);
|
|
10902
10933
|
}), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
|
|
10903
|
-
x(
|
|
10934
|
+
x(ly, this).forEach((t) => {
|
|
10904
10935
|
if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
|
|
10905
10936
|
});
|
|
10906
10937
|
}), e(this, "filterRenditions", function() {
|
|
10907
10938
|
var e = t(function* (e) {
|
|
10908
10939
|
let n = yield Promise.all(e.map(function() {
|
|
10909
10940
|
var e = t(function* (e) {
|
|
10910
|
-
if (
|
|
10941
|
+
if (yn(e)) {
|
|
10911
10942
|
var t;
|
|
10912
|
-
return i.willUseMediaSource() && !((t = Be()) != null && t.isTypeSupported(
|
|
10943
|
+
return i.willUseMediaSource() && !((t = Be()) != null && t.isTypeSupported(bn(e))) ? !1 : i.willUseMediaSource() || e.codec === "opus" ? !0 : i.isWebCodecsAudioAvailable(i.channelId) ? i.webCodecsRenditionSupport.checkAudioSupport(e) : !1;
|
|
10913
10944
|
}
|
|
10914
|
-
if (!
|
|
10945
|
+
if (!vn(e) || !i.isSupportedVideoCodecProfile(e.codec, e.codecString)) return !1;
|
|
10915
10946
|
if (!i.willUseMediaSource()) return i.isWebCodecsVideoAvailable(i.channelId) ? i.webCodecsRenditionSupport.checkVideoSupport(e) : !0;
|
|
10916
10947
|
let n = yield ps(e);
|
|
10917
10948
|
if (!n.supported) return !1;
|
|
@@ -10932,7 +10963,7 @@ var Uv = class {
|
|
|
10932
10963
|
a.length > 0 && i.logger.debug("unsupported renditions filtered out", { renditions: a.map((e) => w(w({
|
|
10933
10964
|
codec: e.codec,
|
|
10934
10965
|
codecString: e.codecString
|
|
10935
|
-
},
|
|
10966
|
+
}, vn(e) ? {
|
|
10936
10967
|
width: e.width,
|
|
10937
10968
|
height: e.height
|
|
10938
10969
|
} : {}), {}, { bitRate: e.bitRate })) });
|
|
@@ -10951,7 +10982,7 @@ var Uv = class {
|
|
|
10951
10982
|
}), r = r.filter((e) => e.codec !== "av1")), i.logger.debug("supported renditions", { renditions: r.map((e) => w(w({
|
|
10952
10983
|
codec: e.codec,
|
|
10953
10984
|
codecString: e.codecString
|
|
10954
|
-
},
|
|
10985
|
+
}, vn(e) ? {
|
|
10955
10986
|
width: e.width,
|
|
10956
10987
|
height: e.height
|
|
10957
10988
|
} : {}), {}, { bitRate: e.bitRate })) }), r;
|
|
@@ -10960,7 +10991,7 @@ var Uv = class {
|
|
|
10960
10991
|
return e.apply(this, arguments);
|
|
10961
10992
|
};
|
|
10962
10993
|
}()), e(this, "patchSubscription", (e, t) => {
|
|
10963
|
-
let n = this.options.get("maxInitialBitRate"), r = Math.min(this.options.get("maxVideoBitRate"), n, t, this.targetSubscription.video.bitRate), i = Math.min(this.options.get("maxAudioBitRate"), n, t, this.targetSubscription.audio.bitRate), a = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), o = this.supportedAudioCodecs(), s = e.renditions.filter(
|
|
10994
|
+
let n = this.options.get("maxInitialBitRate"), r = Math.min(this.options.get("maxVideoBitRate"), n, t, this.targetSubscription.video.bitRate), i = Math.min(this.options.get("maxAudioBitRate"), n, t, this.targetSubscription.audio.bitRate), a = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), o = this.supportedAudioCodecs(), s = e.renditions.filter(yn), c = e.renditions.filter(vn), l = o.find((e) => s.find((t) => t.codec === e) !== void 0), u = a.find((e) => c.find((t) => t.codec === e) !== void 0), d = s.map((e) => e.language);
|
|
10964
10995
|
if (this.logger.debug("supported and selected codecs", {
|
|
10965
10996
|
audioCodecs: o,
|
|
10966
10997
|
videoCodecs: a,
|
|
@@ -10990,7 +11021,7 @@ var Uv = class {
|
|
|
10990
11021
|
}), e(this, "isSupportedVideoCodecProfile", (e, t) => {
|
|
10991
11022
|
if (this.willUseMediaSource()) {
|
|
10992
11023
|
let n = Be();
|
|
10993
|
-
return n ? n.isTypeSupported(
|
|
11024
|
+
return n ? n.isTypeSupported(bn({
|
|
10994
11025
|
codec: e,
|
|
10995
11026
|
codecString: t
|
|
10996
11027
|
})) : !0;
|
|
@@ -11014,12 +11045,12 @@ var Uv = class {
|
|
|
11014
11045
|
});
|
|
11015
11046
|
if (t != null && t.video && n.push({
|
|
11016
11047
|
type: "video",
|
|
11017
|
-
mimeType:
|
|
11048
|
+
mimeType: bn(t.video),
|
|
11018
11049
|
codec: t.video.codec
|
|
11019
11050
|
}), t != null && t.audio && n.push({
|
|
11020
11051
|
type: "audio",
|
|
11021
11052
|
codec: t.audio.codec,
|
|
11022
|
-
mimeType:
|
|
11053
|
+
mimeType: bn(t.audio),
|
|
11023
11054
|
channels: t.audio.channels,
|
|
11024
11055
|
sampleRate: t.audio.sampleRate
|
|
11025
11056
|
}), n.length === 0) throw new g("Can't initialize decoding module without tracks", {
|
|
@@ -11033,7 +11064,7 @@ var Uv = class {
|
|
|
11033
11064
|
}
|
|
11034
11065
|
let a = i.shouldUseWebCodecs(i.channelId), o = i.options.get("webcodecsHardwareAcceleration", i.channelId), s = i.shouldUseOffscreenCanvas(i.channelId) && a, c = typeof OffscreenCanvas < "u" && typeof HTMLCanvasElement < "u" && typeof HTMLCanvasElement.prototype.transferControlToOffscreen == "function", l = s && c && typeof VideoDecoder < "u", u, d;
|
|
11035
11066
|
if (l) try {
|
|
11036
|
-
d = document.createElement("canvas"),
|
|
11067
|
+
d = document.createElement("canvas"), Dn(d), u = d.transferControlToOffscreen();
|
|
11037
11068
|
} catch (e) {
|
|
11038
11069
|
u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
|
|
11039
11070
|
}
|
|
@@ -11079,7 +11110,7 @@ var Uv = class {
|
|
|
11079
11110
|
ds(this);
|
|
11080
11111
|
}), e(this, "play", () => {
|
|
11081
11112
|
var e;
|
|
11082
|
-
this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), n.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play();
|
|
11113
|
+
this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), n.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && this.playbackSource.isActivated && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play();
|
|
11083
11114
|
}), e(this, "getStatistics", () => {
|
|
11084
11115
|
let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? w(w({}, e), t.getStatistics()) : e, this.getRuntimeInfo()), t = Math.round(this.timeActive > 0 ? (e.bytesReceived || 0) * 8 / (this.timeActive / 1e3) : 0), n = this.uptime / 36e5, r = Math.max(0, (e.connectCount || 0) - 1), i = n > 0 ? r / n : 0, a = this.timeActive / 6e4, o = Math.max(a, 1), s = a > 0 ? (e.seekAdjustmentCount || 0) / o : 0, c = a > 0 ? (e.timeshiftAdjustmentCount || 0) / o : 0;
|
|
11085
11116
|
return ty(w(w({}, e), {}, {
|
|
@@ -11091,12 +11122,12 @@ var Uv = class {
|
|
|
11091
11122
|
}), e(this, "resetModules", () => {
|
|
11092
11123
|
Object.values(this.modules).forEach((e) => {
|
|
11093
11124
|
e && "reset" in e && e.reset();
|
|
11094
|
-
}), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
11125
|
+
}), this.playbackSource instanceof fs && this.modules.adaptivity.reset(sy), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
11095
11126
|
}), e(this, "getRuntimeInfo", () => {
|
|
11096
11127
|
let e = this.modules.canvasModule instanceof J_ ? !0 : void 0;
|
|
11097
11128
|
return w({
|
|
11098
11129
|
uptime: this.uptime,
|
|
11099
|
-
version: "4.
|
|
11130
|
+
version: "4.4.0-10-g4c28ac8ee",
|
|
11100
11131
|
clientId: this.clientId,
|
|
11101
11132
|
sessionId: this.sessionId,
|
|
11102
11133
|
channelId: this.channelId,
|
|
@@ -11130,7 +11161,7 @@ var Uv = class {
|
|
|
11130
11161
|
}), e(this, "timeToFirstFrame", () => {
|
|
11131
11162
|
let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectStartTime;
|
|
11132
11163
|
if (t !== void 0 && e !== void 0) return Math.round(e - t);
|
|
11133
|
-
}), this.options = new Uv(w(w({},
|
|
11164
|
+
}), this.options = new Uv(w(w({}, wn), iy(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
11134
11165
|
let o = {
|
|
11135
11166
|
channelId: this.options.get("channelId"),
|
|
11136
11167
|
audio: {
|
|
@@ -11280,7 +11311,7 @@ var Uv = class {
|
|
|
11280
11311
|
case "upgrade":
|
|
11281
11312
|
{
|
|
11282
11313
|
var o, s, c, l, u;
|
|
11283
|
-
let e = Math.min(r + 1, i), n = t[e], d = (o = this.modules.connection.estimatedBandwidth) == null ?
|
|
11314
|
+
let e = Math.min(r + 1, i), n = t[e], d = (o = this.modules.connection.estimatedBandwidth) == null ? xn() : o, f = ((s = n == null || (c = n.audio) == null ? void 0 : c.bitRate) == null ? 0 : s) + ((l = n == null || (u = n.video) == null ? void 0 : u.bitRate) == null ? 0 : l), p = d * 2 > f;
|
|
11284
11315
|
n && p && this.modules.adaptivity.isQoSOk(n) && (a = e);
|
|
11285
11316
|
}
|
|
11286
11317
|
break;
|
|
@@ -11303,8 +11334,8 @@ var Uv = class {
|
|
|
11303
11334
|
audio: w(w({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
|
|
11304
11335
|
})), this.emitter.emit("adapted level");
|
|
11305
11336
|
}), this.emitter.on("text track data", (e) => {
|
|
11306
|
-
let t = x(
|
|
11307
|
-
if (S(
|
|
11337
|
+
let t = x(ly, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - x(cy, this);
|
|
11338
|
+
if (S(cy, this, n), t) {
|
|
11308
11339
|
if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
|
|
11309
11340
|
for (let r of e.cues) {
|
|
11310
11341
|
let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
|
|
@@ -11320,13 +11351,13 @@ var Uv = class {
|
|
|
11320
11351
|
this.clientIp = t.ip;
|
|
11321
11352
|
break;
|
|
11322
11353
|
case "renditions":
|
|
11323
|
-
this.updateTextTracks(t.renditions), S(
|
|
11354
|
+
this.updateTextTracks(t.renditions), S(uy, this, this.filterRenditions(t.renditions).then((e) => {
|
|
11324
11355
|
this.emitter.emit("renditions", {
|
|
11325
11356
|
renditions: e,
|
|
11326
11357
|
channelId: this.currentSubscription.channelId
|
|
11327
11358
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
|
|
11328
11359
|
}).finally(() => {
|
|
11329
|
-
S(
|
|
11360
|
+
S(uy, this, void 0);
|
|
11330
11361
|
}));
|
|
11331
11362
|
break;
|
|
11332
11363
|
case "subscription changed":
|
|
@@ -11447,7 +11478,7 @@ var Uv = class {
|
|
|
11447
11478
|
let be = function() {
|
|
11448
11479
|
var e = t(function* (e) {
|
|
11449
11480
|
let t = e.channelId;
|
|
11450
|
-
x(
|
|
11481
|
+
x(uy, i) && (yield x(uy, i));
|
|
11451
11482
|
let n = i.modules.renditions.getRendition(e.renditionId, t);
|
|
11452
11483
|
if (!Xo(e.flags)) {
|
|
11453
11484
|
if (Zo(e.flags)) {
|
|
@@ -11455,8 +11486,8 @@ var Uv = class {
|
|
|
11455
11486
|
if (e.renditionId !== 0) {
|
|
11456
11487
|
let e = ce(t);
|
|
11457
11488
|
if (e && e.language !== void 0) {
|
|
11458
|
-
let t = new cs().parse(e.content || ""), r = n / 1e3, a = x(
|
|
11459
|
-
if (S(
|
|
11489
|
+
let t = new cs().parse(e.content || ""), r = n / 1e3, a = x(ly, i).find((t) => t.language === e.language), o = r - x(cy, i);
|
|
11490
|
+
if (S(cy, i, r), a) {
|
|
11460
11491
|
if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
|
|
11461
11492
|
for (let e of t) {
|
|
11462
11493
|
let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
|
|
@@ -11479,7 +11510,7 @@ var Uv = class {
|
|
|
11479
11510
|
codec: n.codec
|
|
11480
11511
|
}, e), {}, { channelId: t }), o = Bo(a.codec, a.payload);
|
|
11481
11512
|
o && i.sizes.set(a.renditionId, o);
|
|
11482
|
-
let s =
|
|
11513
|
+
let s = bn({
|
|
11483
11514
|
codec: n.codec,
|
|
11484
11515
|
codecString: n.codecString
|
|
11485
11516
|
});
|
|
@@ -11506,7 +11537,7 @@ var Uv = class {
|
|
|
11506
11537
|
return e.apply(this, arguments);
|
|
11507
11538
|
};
|
|
11508
11539
|
}();
|
|
11509
|
-
this.options.get("maxVideoBitRate") !== 2 ** 53 - 1 && (this.maxVideoBitRate = this.options.get("maxVideoBitRate")), this.options.get("maxAudioBitRate") !== 2 ** 53 - 1 && (this.maxAudioBitRate = this.options.get("maxAudioBitRate")), Ft(this.options.get("maxSize"),
|
|
11540
|
+
this.options.get("maxVideoBitRate") !== 2 ** 53 - 1 && (this.maxVideoBitRate = this.options.get("maxVideoBitRate")), this.options.get("maxAudioBitRate") !== 2 ** 53 - 1 && (this.maxAudioBitRate = this.options.get("maxAudioBitRate")), Ft(this.options.get("maxSize"), Sn()) || (this.maxSize = this.options.get("maxSize")), this.options.get("burstEnabled") && te.enableBurst(this.targetBufferTime);
|
|
11510
11541
|
}
|
|
11511
11542
|
set volume(e) {
|
|
11512
11543
|
this.playbackSource.volume = e;
|
|
@@ -11599,7 +11630,7 @@ var Uv = class {
|
|
|
11599
11630
|
this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
|
|
11600
11631
|
}
|
|
11601
11632
|
set textTrack(e) {
|
|
11602
|
-
e !== this.textTrack && (x(
|
|
11633
|
+
e !== this.textTrack && (x(ly, this).forEach((t) => {
|
|
11603
11634
|
if (t.label === e) t.mode = "showing";
|
|
11604
11635
|
else {
|
|
11605
11636
|
if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
|
|
@@ -11608,11 +11639,11 @@ var Uv = class {
|
|
|
11608
11639
|
}), this.emitter.emit("text track", e));
|
|
11609
11640
|
}
|
|
11610
11641
|
get textTracks() {
|
|
11611
|
-
return x(
|
|
11642
|
+
return x(ly, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
|
|
11612
11643
|
}
|
|
11613
11644
|
get textTrack() {
|
|
11614
11645
|
var e;
|
|
11615
|
-
return (e = x(
|
|
11646
|
+
return (e = x(ly, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
|
|
11616
11647
|
}
|
|
11617
11648
|
get channelId() {
|
|
11618
11649
|
var e, t;
|
|
@@ -11630,7 +11661,7 @@ var Uv = class {
|
|
|
11630
11661
|
}
|
|
11631
11662
|
get maxSize() {
|
|
11632
11663
|
var e, t;
|
|
11633
|
-
let { width: n, height: r } = (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video) == null ?
|
|
11664
|
+
let { width: n, height: r } = (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video) == null ? Sn() : e;
|
|
11634
11665
|
return {
|
|
11635
11666
|
width: n,
|
|
11636
11667
|
height: r
|
|
@@ -11644,14 +11675,14 @@ var Uv = class {
|
|
|
11644
11675
|
}
|
|
11645
11676
|
get maxVideoBitRate() {
|
|
11646
11677
|
var e, t;
|
|
11647
|
-
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) == null ?
|
|
11678
|
+
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) == null ? xn() : e;
|
|
11648
11679
|
}
|
|
11649
11680
|
set maxVideoBitRate(e) {
|
|
11650
11681
|
this.modules.constraintCap.setUserSpecifiedCap({ video: { bitRate: e } }), this.alignSizeAndBitRate(this.targetSubscription);
|
|
11651
11682
|
}
|
|
11652
11683
|
get maxAudioBitRate() {
|
|
11653
11684
|
var e, t;
|
|
11654
|
-
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) == null ?
|
|
11685
|
+
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) == null ? xn() : e;
|
|
11655
11686
|
}
|
|
11656
11687
|
set maxAudioBitRate(e) {
|
|
11657
11688
|
this.modules.constraintCap.setUserSpecifiedCap({ audio: { bitRate: e } }), this.alignSizeAndBitRate(this.targetSubscription);
|
|
@@ -11765,6 +11796,6 @@ var Uv = class {
|
|
|
11765
11796
|
return t === void 0 ? this.shouldUseWebCodecs(e) : t;
|
|
11766
11797
|
}
|
|
11767
11798
|
};
|
|
11768
|
-
e(
|
|
11799
|
+
e(dy, "MAX_POOL_SIZE", 10), e(dy, "DISCONNECT_TIMEOUT", 15 * 1e3), e(dy, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
|
|
11769
11800
|
//#endregion
|
|
11770
|
-
export {
|
|
11801
|
+
export { Tt as _, mt as a, yt as c, gt as d, wt as f, xt as g, _t as h, dt as i, lt as l, bt as m, sn as n, ut as o, St as p, O as r, pt as s, dy as t, ft as u, $e as v, Qe as y };
|