@vindral/web-sdk 4.0.0-108-gc670c963 → 4.0.0-110-ge5c8e532
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/{POtuHPD4.js → BdRUEsWx.js} +495 -449
- package/{C80BN8Qb.js → Bg1SqXxu.js} +34 -33
- package/{B2rv1w4T.js → C2E9fx_I.js} +1 -1
- package/{CLvfXJtA.js → CTUR22Wg.js} +1675 -1660
- package/{C242AA0I.js → DUVlYJes.js} +1 -1
- package/api-client.js +1 -1
- package/core.js +1 -1
- package/legacy.es.js +2378 -2318
- package/legacy.umd.js +9 -9
- package/package.json +1 -1
- package/player.js +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var pn = Object.defineProperty, wn = Object.defineProperties;
|
|
2
|
+
var Sn = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ns = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
4
|
+
var vn = Object.prototype.hasOwnProperty, bn = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var rs = (i) => {
|
|
6
6
|
throw TypeError(i);
|
|
7
7
|
};
|
|
8
|
-
var bi = (i, e, t) => e in i ?
|
|
8
|
+
var bi = (i, e, t) => e in i ? pn(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, A = (i, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
|
-
|
|
10
|
+
vn.call(e, t) && bi(i, t, e[t]);
|
|
11
11
|
if (ns)
|
|
12
12
|
for (var t of ns(e))
|
|
13
|
-
|
|
13
|
+
bn.call(e, t) && bi(i, t, e[t]);
|
|
14
14
|
return i;
|
|
15
|
-
}, R = (i, e) =>
|
|
15
|
+
}, R = (i, e) => wn(i, Sn(e));
|
|
16
16
|
var n = (i, e, t) => bi(i, typeof e != "symbol" ? e + "" : e, t), yi = (i, e, t) => e.has(i) || rs("Cannot " + t);
|
|
17
17
|
var d = (i, e, t) => (yi(i, e, "read from private field"), t ? t.call(i) : e.get(i)), w = (i, e, t) => e.has(i) ? rs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), S = (i, e, t, s) => (yi(i, e, "write to private field"), s ? s.call(i, t) : e.set(i, t), t), F = (i, e, t) => (yi(i, e, "access private method"), t);
|
|
18
18
|
var mt = (i, e, t, s) => ({
|
|
@@ -23,7 +23,7 @@ var mt = (i, e, t, s) => ({
|
|
|
23
23
|
return d(i, e, s);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
var
|
|
26
|
+
var E = (i, e, t) => new Promise((s, r) => {
|
|
27
27
|
var o = (h) => {
|
|
28
28
|
try {
|
|
29
29
|
c(t.next(h));
|
|
@@ -40,7 +40,7 @@ var y = (i, e, t) => new Promise((s, r) => {
|
|
|
40
40
|
c((t = t.apply(i, e)).next());
|
|
41
41
|
});
|
|
42
42
|
import { E as Pe } from "./Bx7s5QdT.js";
|
|
43
|
-
import { a as ae, A as
|
|
43
|
+
import { a as ae, A as yn, d as En, i as Tn, p as Cn, t as In, e as Bn } from "./Bg1SqXxu.js";
|
|
44
44
|
class os {
|
|
45
45
|
constructor(e) {
|
|
46
46
|
n(this, "maxSize", 0);
|
|
@@ -144,7 +144,7 @@ class J {
|
|
|
144
144
|
}
|
|
145
145
|
const le = () => {
|
|
146
146
|
};
|
|
147
|
-
class
|
|
147
|
+
class Fs {
|
|
148
148
|
constructor(e, t = 0) {
|
|
149
149
|
n(this, "buffer");
|
|
150
150
|
n(this, "bytes");
|
|
@@ -183,13 +183,13 @@ function vt() {
|
|
|
183
183
|
const i = self.MediaSource, e = self.ManagedMediaSource;
|
|
184
184
|
return i != null ? i : e;
|
|
185
185
|
}
|
|
186
|
-
const
|
|
186
|
+
const Rn = new RegExp(
|
|
187
187
|
"(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/",
|
|
188
188
|
"i"
|
|
189
|
-
), K = navigator.userAgent.toLowerCase(),
|
|
189
|
+
), K = navigator.userAgent.toLowerCase(), kn = Rn.test(K), Pn = () => {
|
|
190
190
|
const i = document.createElement("video");
|
|
191
191
|
return i.canPlayType("application/vnd.apple.mpegURL") !== "" || i.canPlayType("audio/mpegurl") !== "";
|
|
192
|
-
},
|
|
192
|
+
}, xn = () => {
|
|
193
193
|
try {
|
|
194
194
|
if (typeof WebAssembly == "object" && typeof WebAssembly.instantiate == "function") {
|
|
195
195
|
const i = new WebAssembly.Module(Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0));
|
|
@@ -199,33 +199,33 @@ const kn = new RegExp(
|
|
|
199
199
|
return !1;
|
|
200
200
|
}
|
|
201
201
|
return !1;
|
|
202
|
-
},
|
|
202
|
+
}, Un = () => K.indexOf("CrKey") !== -1, Ns = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, pi = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, Mn = () => K.indexOf("iphone") >= 0 && K.indexOf("like iphone") < 0 || K.indexOf("ipad") >= 0 && K.indexOf("like ipad") < 0 || K.indexOf("ipod") >= 0 && K.indexOf("like ipod") < 0 || pi(), Ln = () => {
|
|
203
203
|
var i, e;
|
|
204
204
|
return pi() ? !1 : (e = (i = vt()) == null ? void 0 : i.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
|
|
205
205
|
}, Ja = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, Ya = () => /^(?!.*chrome).*safari/i.test(K);
|
|
206
|
-
function
|
|
206
|
+
function _n() {
|
|
207
207
|
var i, e;
|
|
208
208
|
if (/(iPhone|iPod|iPad)/i.test(K))
|
|
209
209
|
return (e = (i = K == null ? void 0 : K.match(/OS [\d_]+/i)) == null ? void 0 : i[0]) == null ? void 0 : e.substring(3).split("_").map((t) => parseInt(t))[0];
|
|
210
210
|
}
|
|
211
|
-
const
|
|
211
|
+
const Dn = () => {
|
|
212
212
|
var t;
|
|
213
213
|
const i = !!vt();
|
|
214
214
|
let e = !1;
|
|
215
|
-
return i && (e =
|
|
216
|
-
isMobile:
|
|
215
|
+
return i && (e = Ln()), {
|
|
216
|
+
isMobile: kn,
|
|
217
217
|
supportsMp4Opus: e,
|
|
218
218
|
supportsMediaSource: i,
|
|
219
|
-
supportsHls:
|
|
220
|
-
supportsWebAssembly:
|
|
219
|
+
supportsHls: Pn(),
|
|
220
|
+
supportsWebAssembly: xn(),
|
|
221
221
|
platform: {
|
|
222
|
-
iosVersion: (t =
|
|
222
|
+
iosVersion: (t = _n()) != null ? t : Number.MAX_SAFE_INTEGER,
|
|
223
223
|
isIpadOS: pi(),
|
|
224
|
-
isMacOS:
|
|
225
|
-
isIOS:
|
|
224
|
+
isMacOS: Ns(),
|
|
225
|
+
isIOS: Mn()
|
|
226
226
|
}
|
|
227
227
|
};
|
|
228
|
-
},
|
|
228
|
+
}, Vs = (i, e, t) => {
|
|
229
229
|
let s = 0;
|
|
230
230
|
for (let r = e; r <= t; r++)
|
|
231
231
|
if (r === e) {
|
|
@@ -272,7 +272,7 @@ class as {
|
|
|
272
272
|
return S(this, z, d(this, z) + 4), e;
|
|
273
273
|
}
|
|
274
274
|
readUint64() {
|
|
275
|
-
const e =
|
|
275
|
+
const e = Vs(d(this, Ae), d(this, z), d(this, z) + 7);
|
|
276
276
|
return S(this, z, d(this, z) + 8), e;
|
|
277
277
|
}
|
|
278
278
|
readBytes(e) {
|
|
@@ -291,7 +291,7 @@ class as {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
z = new WeakMap(), Ae = new WeakMap(), ye = new WeakMap();
|
|
294
|
-
class
|
|
294
|
+
class On {
|
|
295
295
|
constructor(e = 100, t = 100) {
|
|
296
296
|
n(this, "resizeSteps");
|
|
297
297
|
n(this, "internalBuffer");
|
|
@@ -377,7 +377,7 @@ const Ut = (i) => i.reduce((e, t) => e + t, 0) / i.length, Ye = (i) => ({
|
|
|
377
377
|
average: i.length === 0 ? 0 : Ut(i),
|
|
378
378
|
max: i.length === 0 ? 0 : Math.max(...i),
|
|
379
379
|
min: i.length === 0 ? 0 : Math.min(...i)
|
|
380
|
-
}),
|
|
380
|
+
}), Fn = (i) => {
|
|
381
381
|
let e = 0, t = 0, s = 0, r = 0, o = 0;
|
|
382
382
|
for (let u = 0; u < i.length; u++) {
|
|
383
383
|
const { x: l, y: m } = i[u];
|
|
@@ -389,7 +389,7 @@ const Ut = (i) => i.reduce((e, t) => e + t, 0) / i.length, Ye = (i) => ({
|
|
|
389
389
|
);
|
|
390
390
|
return { slope: a, intercept: c, r2: h, predict: (u) => a * (i.length + u) + c };
|
|
391
391
|
};
|
|
392
|
-
class
|
|
392
|
+
class Nn {
|
|
393
393
|
constructor(e = 10) {
|
|
394
394
|
n(this, "rates");
|
|
395
395
|
n(this, "_total", 0);
|
|
@@ -419,7 +419,7 @@ const je = (i, e) => {
|
|
|
419
419
|
for (const r in e)
|
|
420
420
|
if (s += 1, !(r in i) || !je(i[r], e[r])) return !1;
|
|
421
421
|
return t == s;
|
|
422
|
-
}, cs = ["off", "error", "warn", "info", "debug", "trace"],
|
|
422
|
+
}, cs = ["off", "error", "warn", "info", "debug", "trace"], Vn = {
|
|
423
423
|
ERROR: "error",
|
|
424
424
|
WARN: "warn",
|
|
425
425
|
INFO: "info",
|
|
@@ -528,7 +528,7 @@ const ds = (i, e) => {
|
|
|
528
528
|
var c;
|
|
529
529
|
const o = Math.max(t - e, r.start), a = (c = r.end) != null ? c : t;
|
|
530
530
|
return Math.max(0, a - o) + s;
|
|
531
|
-
}, 0),
|
|
531
|
+
}, 0), Gt = class Gt {
|
|
532
532
|
constructor() {
|
|
533
533
|
n(this, "pendingTimeouts", /* @__PURE__ */ new Set());
|
|
534
534
|
n(this, "pendingIntervals", /* @__PURE__ */ new Set());
|
|
@@ -555,14 +555,14 @@ const ds = (i, e) => {
|
|
|
555
555
|
});
|
|
556
556
|
}
|
|
557
557
|
};
|
|
558
|
-
n(
|
|
559
|
-
let q =
|
|
558
|
+
n(Gt, "create", () => new Gt());
|
|
559
|
+
let q = Gt;
|
|
560
560
|
const us = () => {
|
|
561
561
|
const i = [...Array(256).keys()].map((t) => t.toString(16).padStart(2, "0")), e = crypto.getRandomValues(new Uint8Array(16));
|
|
562
562
|
return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, [...e.entries()].map(([t, s]) => [4, 6, 8, 10].includes(t) ? `-${i[s]}` : i[s]).join("");
|
|
563
|
-
}, Ui = (i) =>
|
|
563
|
+
}, Ui = (i) => E(void 0, null, function* () {
|
|
564
564
|
return new Promise((e) => setTimeout(e, i));
|
|
565
|
-
}),
|
|
565
|
+
}), zn = (t, ...s) => E(void 0, [t, ...s], function* (i, e = new Error("Timeout")) {
|
|
566
566
|
return new Promise((r, o) => setTimeout(() => o(e), i));
|
|
567
567
|
}), st = (i) => "width" in i && typeof i.width == "number", nt = (i) => "sampleRate" in i && typeof i.sampleRate == "number", $e = (i) => {
|
|
568
568
|
switch (i.codec) {
|
|
@@ -582,13 +582,13 @@ const us = () => {
|
|
|
582
582
|
}, ke = () => Number.MAX_SAFE_INTEGER, Vt = () => ({
|
|
583
583
|
width: Number.MAX_SAFE_INTEGER,
|
|
584
584
|
height: Number.MAX_SAFE_INTEGER
|
|
585
|
-
}), ls = (i) => !(typeof i != "object" || i === null || !("type" in i)),
|
|
586
|
-
function
|
|
585
|
+
}), ls = (i) => !(typeof i != "object" || i === null || !("type" in i)), Hn = !0;
|
|
586
|
+
function Qn() {
|
|
587
587
|
return {
|
|
588
|
-
moqEnabled:
|
|
588
|
+
moqEnabled: Hn
|
|
589
589
|
};
|
|
590
590
|
}
|
|
591
|
-
const
|
|
591
|
+
const Wn = {
|
|
592
592
|
sizeBasedResolutionCapEnabled: !0,
|
|
593
593
|
pictureInPictureEnabled: !0,
|
|
594
594
|
abrEnabled: !0,
|
|
@@ -598,7 +598,7 @@ const Gn = {
|
|
|
598
598
|
muted: !1,
|
|
599
599
|
minBufferTime: 1500,
|
|
600
600
|
maxBufferTime: 1500,
|
|
601
|
-
logLevel:
|
|
601
|
+
logLevel: Vn.OFF,
|
|
602
602
|
maxSize: Vt(),
|
|
603
603
|
maxVideoBitRate: ke(),
|
|
604
604
|
maxAudioBitRate: ke(),
|
|
@@ -620,7 +620,7 @@ const Gn = {
|
|
|
620
620
|
},
|
|
621
621
|
videoCodecs: ["av1", "h264"],
|
|
622
622
|
webtransportEnabled: !0
|
|
623
|
-
},
|
|
623
|
+
}, Xn = "connection_failed", Gn = "connection_failed_will_not_attempt_again", jn = "authentication_error", qn = "authentication_expired", Zn = "channel_not_found", Jn = "no_incoming_data_error", Yn = "connection_inactivity", Kn = "missing_init_segment", $n = "no_track_context", er = "invalid_track_context_state", tr = "disconnected_by_edge", ir = "decoder_error", sr = "audio_player_error", nr = "media_source_error", rr = "webgl_context_lost_error", or = "access_forbidden", ar = "channel_switch_failed";
|
|
624
624
|
class T extends Error {
|
|
625
625
|
constructor(t, s, r = {}) {
|
|
626
626
|
super(t);
|
|
@@ -663,42 +663,42 @@ class T extends Error {
|
|
|
663
663
|
this.props = s, this.extra = r, Object.setPrototypeOf(this, new.target.prototype);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
const
|
|
666
|
+
const cr = (i, e) => new T(
|
|
667
667
|
"MediaElement Error",
|
|
668
668
|
{ isFatal: i, code: "media_element_error", source: e },
|
|
669
669
|
{ mediaErrorCode: e.code }
|
|
670
|
-
),
|
|
670
|
+
), dr = (i, e) => new T("Decoder Error", { isFatal: i, code: ir, source: e, type: "internal" }), zs = (i, e) => new T("Audio Player Error", { isFatal: i, code: sr, source: e, type: "internal" }), hr = (i, e) => new T(`No init segment for rendition id ${i} for channel ${e}`, {
|
|
671
671
|
isFatal: !1,
|
|
672
|
-
code:
|
|
672
|
+
code: Kn,
|
|
673
673
|
type: "internal"
|
|
674
674
|
}), ms = (i, e, t, s) => new T(
|
|
675
675
|
"MediaSource Error",
|
|
676
|
-
{ isFatal: i, code:
|
|
676
|
+
{ isFatal: i, code: nr, source: e, type: "internal" },
|
|
677
677
|
{ type: s, consecutiveErrorsCount: t }
|
|
678
678
|
), _t = (i, e) => new T(`No track context for ${i}${e ? `, rendition id ${e}` : ""}`, {
|
|
679
679
|
isFatal: !1,
|
|
680
|
-
code:
|
|
680
|
+
code: $n,
|
|
681
681
|
type: "internal"
|
|
682
|
-
}),
|
|
682
|
+
}), ur = (i, e) => new T(
|
|
683
683
|
`Track context is in an invalid state for ${i}${e ? `, rendition id ${e}` : ""}`,
|
|
684
684
|
{
|
|
685
685
|
isFatal: !1,
|
|
686
|
-
code:
|
|
686
|
+
code: er,
|
|
687
687
|
type: "internal"
|
|
688
688
|
}
|
|
689
689
|
), lr = () => new T("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), ft = (i) => new T("Disconnected From Edge Server", {
|
|
690
690
|
type: "external",
|
|
691
691
|
source: i,
|
|
692
692
|
isFatal: !1,
|
|
693
|
-
code:
|
|
694
|
-
}), zt = (i) => new T("Authentication Failed", { isFatal: !0, code:
|
|
693
|
+
code: tr
|
|
694
|
+
}), zt = (i) => new T("Authentication Failed", { isFatal: !0, code: jn, source: i }), mr = (i) => new T("Authentication Expired", { isFatal: !0, code: qn, source: i }), fr = (i, e) => new T("Connection closed due to inactivity", { isFatal: !1, code: Yn, source: e, type: i }), Hs = (i, e) => new T("Channel not found", { isFatal: !1, code: Zn, source: e, type: i }), Ar = (i) => new T("No Incoming Data", { isFatal: !1, code: Jn, source: i }), gr = (i) => new T("Connection attempt failed", {
|
|
695
695
|
isFatal: !1,
|
|
696
|
-
code:
|
|
696
|
+
code: Xn,
|
|
697
697
|
source: i
|
|
698
|
-
}),
|
|
698
|
+
}), Qs = () => new T("Connection failed - no more reconnect attempts", {
|
|
699
699
|
isFatal: !0,
|
|
700
|
-
code:
|
|
701
|
-
}), pr = (i) => new T("WebGL Context Lost", { isFatal: !1, code:
|
|
700
|
+
code: Gn
|
|
701
|
+
}), pr = (i) => new T("WebGL Context Lost", { isFatal: !1, code: rr, source: i, type: "internal" }), fs = (i) => new T(i, { isFatal: !0, code: or }), As = (i) => new T(`Channel switch to '${i}' failed`, { isFatal: !1, code: ar }), gs = (i, e) => i && typeof i == "object" && e in i, wr = (i) => !(typeof i != "object" || !gs(i, "channelId") || typeof i.channelId != "string" || !gs(i, "url") || typeof i.url != "string" || i.channelId.length === 0 || i.url.length === 0), Sr = (i) => {
|
|
702
702
|
if (!wr(i))
|
|
703
703
|
throw new T("Invalid options", { isFatal: !0, code: "invalid_options" });
|
|
704
704
|
const e = A({}, i);
|
|
@@ -747,17 +747,17 @@ const dr = (i, e) => new T(
|
|
|
747
747
|
keySystem: "org.w3.clearkey",
|
|
748
748
|
supportedConfig: Ei
|
|
749
749
|
}
|
|
750
|
-
},
|
|
750
|
+
}, Ws = (i, e) => E(void 0, null, function* () {
|
|
751
751
|
return navigator.requestMediaKeySystemAccess(i, [e]).catch(() => {
|
|
752
752
|
});
|
|
753
|
-
}),
|
|
753
|
+
}), ps = (i, e, t, s, r, o) => E(void 0, null, function* () {
|
|
754
754
|
let a;
|
|
755
755
|
for (const c of s) {
|
|
756
756
|
const h = t == null ? void 0 : t.map((l) => R(A({}, l), {
|
|
757
757
|
robustness: c,
|
|
758
758
|
contentType: o ? `${r === "audioCapabilities" ? "audio/mp4" : "video/mp4"}; codecs="${o}"` : l.contentType
|
|
759
759
|
}));
|
|
760
|
-
if (!(yield
|
|
760
|
+
if (!(yield Ws(i, {
|
|
761
761
|
initDataTypes: e,
|
|
762
762
|
[r]: h
|
|
763
763
|
})))
|
|
@@ -765,9 +765,9 @@ const dr = (i, e) => new T(
|
|
|
765
765
|
a = h;
|
|
766
766
|
}
|
|
767
767
|
return a;
|
|
768
|
-
}), yr = (i, e, t) =>
|
|
768
|
+
}), yr = (i, e, t) => E(void 0, null, function* () {
|
|
769
769
|
const { keySystem: s, supportedConfig: r } = br[i], { initDataTypes: o, videoCapabilities: a, audioCapabilities: c } = r, h = vr[i], [u, l] = yield Promise.all([
|
|
770
|
-
|
|
770
|
+
ps(
|
|
771
771
|
s,
|
|
772
772
|
o,
|
|
773
773
|
a,
|
|
@@ -775,7 +775,7 @@ const dr = (i, e) => new T(
|
|
|
775
775
|
"videoCapabilities",
|
|
776
776
|
e
|
|
777
777
|
),
|
|
778
|
-
|
|
778
|
+
ps(
|
|
779
779
|
s,
|
|
780
780
|
o,
|
|
781
781
|
c,
|
|
@@ -784,12 +784,12 @@ const dr = (i, e) => new T(
|
|
|
784
784
|
t
|
|
785
785
|
)
|
|
786
786
|
]);
|
|
787
|
-
return !u && !l ? void 0 : yield
|
|
787
|
+
return !u && !l ? void 0 : yield Ws(s, {
|
|
788
788
|
initDataTypes: o,
|
|
789
789
|
videoCapabilities: u,
|
|
790
790
|
audioCapabilities: l
|
|
791
791
|
});
|
|
792
|
-
}), Er = (i, e, t) =>
|
|
792
|
+
}), Er = (i, e, t) => E(void 0, null, function* () {
|
|
793
793
|
let s;
|
|
794
794
|
for (const r of i)
|
|
795
795
|
if (s = yield yr(r, e, t), s)
|
|
@@ -818,12 +818,12 @@ class wi {
|
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
820
|
getMediaKeys() {
|
|
821
|
-
return
|
|
821
|
+
return E(this, null, function* () {
|
|
822
822
|
return d(this, Ne) ? d(this, Ne) : (S(this, Ne, yield d(this, Fe).createMediaKeys()), d(this, Ne));
|
|
823
823
|
});
|
|
824
824
|
}
|
|
825
825
|
requestLicense(e) {
|
|
826
|
-
return
|
|
826
|
+
return E(this, null, function* () {
|
|
827
827
|
const t = new URL(this.licenseServerUrl);
|
|
828
828
|
for (const [o, a] of Object.entries(this.queryParams))
|
|
829
829
|
t.searchParams.append(o, a);
|
|
@@ -841,7 +841,7 @@ class wi {
|
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
Fe = new WeakMap(), Ne = new WeakMap();
|
|
844
|
-
function
|
|
844
|
+
function Xs(i) {
|
|
845
845
|
const e = window.atob(i.replace(/-/g, "+").replace(/_/g, "/"));
|
|
846
846
|
let t = "";
|
|
847
847
|
for (let s = 0; s < e.length; s++)
|
|
@@ -873,7 +873,7 @@ class Ir extends wi {
|
|
|
873
873
|
for (let u = 0; u < o.kids.length; u++) {
|
|
874
874
|
const l = o.kids[u];
|
|
875
875
|
if (l) {
|
|
876
|
-
const m =
|
|
876
|
+
const m = Xs(l).toLowerCase(), g = d(this, Et)[m];
|
|
877
877
|
g && a.push({
|
|
878
878
|
kty: "oct",
|
|
879
879
|
alg: "A128KW",
|
|
@@ -902,8 +902,8 @@ const Rr = (i) => {
|
|
|
902
902
|
if (s) {
|
|
903
903
|
const m = s.getElementsByTagName("name"), g = s.getElementsByTagName("value");
|
|
904
904
|
for (let p = 0; p < m.length; p++) {
|
|
905
|
-
const
|
|
906
|
-
|
|
905
|
+
const y = (c = m[p]) == null ? void 0 : c.childNodes[0], U = (h = g[p]) == null ? void 0 : h.childNodes[0];
|
|
906
|
+
y != null && y.nodeValue && U && U.nodeValue && (r[y.nodeValue] = U.nodeValue);
|
|
907
907
|
}
|
|
908
908
|
}
|
|
909
909
|
const o = t.getElementsByTagName("Challenge")[0];
|
|
@@ -921,7 +921,7 @@ class kr extends wi {
|
|
|
921
921
|
super("playready", e, t);
|
|
922
922
|
}
|
|
923
923
|
requestLicense(e) {
|
|
924
|
-
return
|
|
924
|
+
return E(this, null, function* () {
|
|
925
925
|
ae(this.licenseServerUrl, "No license server URL set");
|
|
926
926
|
const t = new URL(this.licenseServerUrl);
|
|
927
927
|
for (const [o, a] of Object.entries(this.queryParams))
|
|
@@ -942,10 +942,10 @@ class Pr extends wi {
|
|
|
942
942
|
super("widevine", e, t);
|
|
943
943
|
}
|
|
944
944
|
}
|
|
945
|
-
var k, Ve, ge, ze, Tt, Ct, de, Ee, Te, It, Bt,
|
|
946
|
-
class
|
|
945
|
+
var k, Ve, ge, ze, Tt, Ct, de, Ee, Te, It, Bt, G, Gs, js, qs, Zs, jt, qt, Js, Ft, Zt, Ys;
|
|
946
|
+
class ws {
|
|
947
947
|
constructor(e, t, s, r) {
|
|
948
|
-
w(this,
|
|
948
|
+
w(this, G);
|
|
949
949
|
w(this, k);
|
|
950
950
|
w(this, Ve);
|
|
951
951
|
w(this, ge);
|
|
@@ -959,7 +959,7 @@ class Ss {
|
|
|
959
959
|
d(this, k).debug("Received DRM data", { options: e }), d(this, ze).resolve(e);
|
|
960
960
|
});
|
|
961
961
|
w(this, Bt, (e) => {
|
|
962
|
-
d(this, k).info("Encrypted event received", { event: e }), F(this,
|
|
962
|
+
d(this, k).info("Encrypted event received", { event: e }), F(this, G, Gs).call(this, e);
|
|
963
963
|
});
|
|
964
964
|
w(this, jt, (e) => {
|
|
965
965
|
var o;
|
|
@@ -971,24 +971,24 @@ class Ss {
|
|
|
971
971
|
}
|
|
972
972
|
d(this, k).debug("Requesting license for session", { sessionId: t.sessionId }), (o = d(this, de)) == null || o.requestLicense(s).then((a) => {
|
|
973
973
|
d(this, k).debug("License received for session", { sessionId: t.sessionId }), t.update(a).catch((c) => {
|
|
974
|
-
F(this,
|
|
974
|
+
F(this, G, Ft).call(this, { message: "Failed to update session with license", code: "eme", isFatal: !1, error: c });
|
|
975
975
|
});
|
|
976
976
|
}).catch((a) => {
|
|
977
|
-
F(this,
|
|
977
|
+
F(this, G, Ft).call(this, { message: "Failed to request license", code: "eme", isFatal: !1, error: a });
|
|
978
978
|
});
|
|
979
979
|
});
|
|
980
980
|
w(this, qt, (e) => {
|
|
981
981
|
const t = e.target;
|
|
982
982
|
d(this, k).debug("Key status changed for session", { sessionId: t.sessionId }), t.keyStatuses.forEach((s, r) => {
|
|
983
|
-
const o =
|
|
983
|
+
const o = Xs(window.btoa(String.fromCharCode(...new Uint8Array(r))));
|
|
984
984
|
d(this, k).debug("Key status", { base64kid: o, status: s });
|
|
985
985
|
});
|
|
986
986
|
});
|
|
987
987
|
/**
|
|
988
988
|
* Get the CDM based on the options and the supported key systems
|
|
989
989
|
*/
|
|
990
|
-
w(this, Zt, (e) =>
|
|
991
|
-
const t = F(this,
|
|
990
|
+
w(this, Zt, (e) => E(this, null, function* () {
|
|
991
|
+
const t = F(this, G, Ys).call(this, e);
|
|
992
992
|
d(this, k).debug("Prioritized key system list", { keySystemList: t });
|
|
993
993
|
const s = yield Er(t, e.videoCodec, e.audioCodec);
|
|
994
994
|
if (!s)
|
|
@@ -1017,16 +1017,16 @@ class Ss {
|
|
|
1017
1017
|
}), d(this, Ee).clear(), S(this, Te, null), S(this, de, null);
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
k = new WeakMap(), Ve = new WeakMap(), ge = new WeakMap(), ze = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), de = new WeakMap(), Ee = new WeakMap(), Te = new WeakMap(), It = new WeakMap(), Bt = new WeakMap(),
|
|
1021
|
-
return
|
|
1020
|
+
k = new WeakMap(), Ve = new WeakMap(), ge = new WeakMap(), ze = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), de = new WeakMap(), Ee = new WeakMap(), Te = new WeakMap(), It = new WeakMap(), Bt = new WeakMap(), G = new WeakSet(), Gs = function(e) {
|
|
1021
|
+
return E(this, null, function* () {
|
|
1022
1022
|
try {
|
|
1023
|
-
yield F(this,
|
|
1023
|
+
yield F(this, G, js).call(this), d(this, k).debug("Media keys initialization completed"), yield F(this, G, qs).call(this, e.initData, e.initDataType);
|
|
1024
1024
|
} catch (t) {
|
|
1025
|
-
F(this,
|
|
1025
|
+
F(this, G, Ft).call(this, { message: "Failed to handle encrypted event", code: "eme", isFatal: !0, error: t });
|
|
1026
1026
|
}
|
|
1027
1027
|
});
|
|
1028
|
-
},
|
|
1029
|
-
return
|
|
1028
|
+
}, js = function() {
|
|
1029
|
+
return E(this, null, function* () {
|
|
1030
1030
|
var e;
|
|
1031
1031
|
if (d(this, k).debug("Initializing media keys"), (e = d(this, ge)) != null && e.mediaKeys) {
|
|
1032
1032
|
d(this, k).debug("Media keys already set on media element");
|
|
@@ -1036,18 +1036,18 @@ k = new WeakMap(), Ve = new WeakMap(), ge = new WeakMap(), ze = new WeakMap(), T
|
|
|
1036
1036
|
d(this, k).debug("Media keys initialization already in progress, waiting for completion"), yield d(this, Te);
|
|
1037
1037
|
return;
|
|
1038
1038
|
}
|
|
1039
|
-
S(this, Te,
|
|
1039
|
+
S(this, Te, E(this, null, function* () {
|
|
1040
1040
|
const t = yield d(this, ze).promise, s = yield d(this, Zt).call(this, t);
|
|
1041
1041
|
d(this, k).debug("CDM obtained", { cdm: s }), ae(d(this, ge), "No media element found"), ae(s, "No CDM found");
|
|
1042
1042
|
const r = yield s.getMediaKeys();
|
|
1043
|
-
s.certificate && (yield F(this,
|
|
1043
|
+
s.certificate && (yield F(this, G, Js).call(this, r, s.certificate)), d(this, k).debug("Setting media keys on media element"), yield d(this, ge).setMediaKeys(r), S(this, de, s);
|
|
1044
1044
|
})), yield d(this, Te);
|
|
1045
1045
|
});
|
|
1046
|
-
},
|
|
1047
|
-
return
|
|
1046
|
+
}, qs = function(e, t) {
|
|
1047
|
+
return E(this, null, function* () {
|
|
1048
1048
|
ae(d(this, de), "No CDM manager found");
|
|
1049
1049
|
const s = yield d(this, de).getMediaKeys();
|
|
1050
|
-
if (!e || !F(this,
|
|
1050
|
+
if (!e || !F(this, G, Zs).call(this, e)) {
|
|
1051
1051
|
d(this, k).debug("Duplicate initData, no need to create new session", { initData: e });
|
|
1052
1052
|
return;
|
|
1053
1053
|
}
|
|
@@ -1056,12 +1056,12 @@ k = new WeakMap(), Ve = new WeakMap(), ge = new WeakMap(), ze = new WeakMap(), T
|
|
|
1056
1056
|
d(this, k).info("Session is closed", { reason: o });
|
|
1057
1057
|
}), r.addEventListener("message", d(this, jt)), d(this, Ee).set(r, e), d(this, k).debug("Generating request for session", { session: r, initDataType: t, initData: e }), yield r.generateRequest(t, e);
|
|
1058
1058
|
});
|
|
1059
|
-
},
|
|
1059
|
+
}, Zs = function(e) {
|
|
1060
1060
|
for (const [t, s] of d(this, Ee))
|
|
1061
1061
|
if (Cr(e, s)) return !1;
|
|
1062
1062
|
return !0;
|
|
1063
|
-
}, jt = new WeakMap(), qt = new WeakMap(),
|
|
1064
|
-
return
|
|
1063
|
+
}, jt = new WeakMap(), qt = new WeakMap(), Js = function(e, t) {
|
|
1064
|
+
return E(this, null, function* () {
|
|
1065
1065
|
try {
|
|
1066
1066
|
d(this, k).debug("Setting server certificate", { certificate: t }), (yield e.setServerCertificate(t)) || d(this, k).warn("Server certificates are not supported by the CDM.");
|
|
1067
1067
|
} catch (s) {
|
|
@@ -1077,7 +1077,7 @@ k = new WeakMap(), Ve = new WeakMap(), ge = new WeakMap(), ze = new WeakMap(), T
|
|
|
1077
1077
|
* If clearkeys are provided, it will be the first in the list.
|
|
1078
1078
|
* Playready will be prioritized over Widevine, some browsers support both but playready may support higher robustness level.
|
|
1079
1079
|
*/
|
|
1080
|
-
|
|
1080
|
+
Ys = function(e) {
|
|
1081
1081
|
const t = [];
|
|
1082
1082
|
return e.clearkeys && t.push("clearkey"), e.playreadyLicenseUrl && t.push("playready"), e.widevineLicenseUrl && t.push("widevine"), e.fairplayLicenseUrl && e.fairplayCertificate && t.push("fairplay"), t;
|
|
1083
1083
|
};
|
|
@@ -1085,7 +1085,7 @@ const xr = 7, Ur = 8, Mr = (i) => {
|
|
|
1085
1085
|
const e = i.getUint32(0, !1), t = i.getUint8(0) << 16 | i.getUint16(1, !1);
|
|
1086
1086
|
let s = 0;
|
|
1087
1087
|
return t === 1 ? s += 3 : e === 1 && (s += 4), s;
|
|
1088
|
-
}, Lr = (i) => Mr(new DataView(i, 0)) !== 0,
|
|
1088
|
+
}, Lr = (i) => Mr(new DataView(i, 0)) !== 0, Ss = (i, e = 0) => {
|
|
1089
1089
|
for (let t = e; t < i.byteLength - 4; t++) {
|
|
1090
1090
|
const s = i.getUint32(t) === 1, r = (i.getUint8(t) << 16 | i.getUint16(t + 1)) === 1;
|
|
1091
1091
|
if (s || r)
|
|
@@ -1093,14 +1093,14 @@ const xr = 7, Ur = 8, Mr = (i) => {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
}, _r = (i) => i & 31, Dr = (i, e) => {
|
|
1095
1095
|
const t = new DataView(i, 0);
|
|
1096
|
-
let s =
|
|
1096
|
+
let s = Ss(t);
|
|
1097
1097
|
for (; s; ) {
|
|
1098
|
-
const { position: r, nalPrefixSize: o } = s, a =
|
|
1098
|
+
const { position: r, nalPrefixSize: o } = s, a = Ss(t, r + 4), c = a ? a.position - r - o : void 0;
|
|
1099
1099
|
if (!e(new DataView(i, r + o, c), o))
|
|
1100
1100
|
return;
|
|
1101
1101
|
s = a;
|
|
1102
1102
|
}
|
|
1103
|
-
},
|
|
1103
|
+
}, Ks = (i) => {
|
|
1104
1104
|
const e = [], t = [];
|
|
1105
1105
|
if (!Lr(i)) {
|
|
1106
1106
|
const s = new DataView(i, 0), r = s.getUint8(5) & 31;
|
|
@@ -1133,8 +1133,8 @@ const xr = 7, Ur = 8, Mr = (i) => {
|
|
|
1133
1133
|
return !0;
|
|
1134
1134
|
}), { sequenceParameterSets: e, pictureParameterSets: t };
|
|
1135
1135
|
}, Or = (i) => {
|
|
1136
|
-
var
|
|
1137
|
-
const e = new DataView(i), t = e.getUint8(1), s = e.getUint8(2), r = e.getUint8(3), o = new
|
|
1136
|
+
var y;
|
|
1137
|
+
const e = new DataView(i), t = e.getUint8(1), s = e.getUint8(2), r = e.getUint8(3), o = new Fs(i, 4 * 8);
|
|
1138
1138
|
o.readUnsignedExpGolomb();
|
|
1139
1139
|
let a = 1;
|
|
1140
1140
|
switch (t) {
|
|
@@ -1172,14 +1172,14 @@ const xr = 7, Ur = 8, Mr = (i) => {
|
|
|
1172
1172
|
l === 0 && o.readBit(), o.readBit();
|
|
1173
1173
|
let m = h + 1, g = u + 1;
|
|
1174
1174
|
if (g *= 2 - l, g *= 16, m *= 16, o.readBit()) {
|
|
1175
|
-
const
|
|
1175
|
+
const U = a == 1 ? 1 : 0, X = 1 << (a == 1 || a == 2 ? 1 : 0), L = 2 - l << U, _ = o.readUnsignedExpGolomb() * X, Z = o.readUnsignedExpGolomb() * X, te = o.readUnsignedExpGolomb() * L, me = o.readUnsignedExpGolomb() * L;
|
|
1176
1176
|
m -= _ + Z, g -= te + me;
|
|
1177
1177
|
}
|
|
1178
1178
|
let p = {
|
|
1179
1179
|
numerator: 1,
|
|
1180
1180
|
denumerator: 1
|
|
1181
1181
|
};
|
|
1182
|
-
return o.readBit() && o.readBit() && (p = (
|
|
1182
|
+
return o.readBit() && o.readBit() && (p = (y = Fr[o.readBits(8)]) != null ? y : { numerator: 0, denumerator: 0 }), {
|
|
1183
1183
|
width: m,
|
|
1184
1184
|
height: g,
|
|
1185
1185
|
pixelAspectRatio: p,
|
|
@@ -1214,7 +1214,7 @@ function Vr(i) {
|
|
|
1214
1214
|
const o = new as(e.readBytes(s.size));
|
|
1215
1215
|
return {
|
|
1216
1216
|
header: t,
|
|
1217
|
-
txx:
|
|
1217
|
+
txx: Wr(o)
|
|
1218
1218
|
};
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
@@ -1240,7 +1240,7 @@ function Qr(i) {
|
|
|
1240
1240
|
flags: s
|
|
1241
1241
|
};
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function Wr(i) {
|
|
1244
1244
|
const e = i.readUint8(), t = i.readUtf8String(), s = i.readUtf8String();
|
|
1245
1245
|
return {
|
|
1246
1246
|
encoding: e,
|
|
@@ -1254,7 +1254,7 @@ function b(i) {
|
|
|
1254
1254
|
t[s] = i.charCodeAt(s);
|
|
1255
1255
|
return new Uint8Array(e);
|
|
1256
1256
|
}
|
|
1257
|
-
const
|
|
1257
|
+
const x = {
|
|
1258
1258
|
ftyp: b("ftyp"),
|
|
1259
1259
|
mvhd: b("mvhd"),
|
|
1260
1260
|
moov: b("moov"),
|
|
@@ -1294,7 +1294,7 @@ const P = {
|
|
|
1294
1294
|
prft: b("prft"),
|
|
1295
1295
|
dOps: b("dOps"),
|
|
1296
1296
|
emsg: b("emsg")
|
|
1297
|
-
},
|
|
1297
|
+
}, Xr = 1e3, bt = b("iso6"), vs = new Uint8Array([0, 0, 2, 0]), Gr = [
|
|
1298
1298
|
bt,
|
|
1299
1299
|
new Uint8Array([105, 115, 111, 109]),
|
|
1300
1300
|
// isom
|
|
@@ -1323,23 +1323,23 @@ const P = {
|
|
|
1323
1323
|
new Uint8Array([109, 112, 52, 49])
|
|
1324
1324
|
// mp41
|
|
1325
1325
|
];
|
|
1326
|
-
class
|
|
1326
|
+
class $s {
|
|
1327
1327
|
constructor() {
|
|
1328
|
-
n(this, "writer", new
|
|
1328
|
+
n(this, "writer", new On());
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
1331
|
const H = (i, e, t) => {
|
|
1332
1332
|
i.writer.writeUint32(t + 8), i.writer.writeBytes(e);
|
|
1333
|
-
},
|
|
1333
|
+
}, W = (i, e, t, s, r) => {
|
|
1334
1334
|
H(i, e, t + 4), i.writer.writeUint8(s), i.writer.writeUint24(r);
|
|
1335
1335
|
}, Ti = (i, e) => {
|
|
1336
1336
|
H(
|
|
1337
1337
|
i,
|
|
1338
|
-
|
|
1339
|
-
bt.byteLength +
|
|
1340
|
-
), i.writer.writeBytes(bt), i.writer.writeBytes(
|
|
1338
|
+
x.ftyp,
|
|
1339
|
+
bt.byteLength + vs.byteLength + e.reduce((t, s) => t + s.byteLength, 0)
|
|
1340
|
+
), i.writer.writeBytes(bt), i.writer.writeBytes(vs), e.forEach((t) => i.writer.writeBytes(t));
|
|
1341
1341
|
}, Zr = (i, e, t) => {
|
|
1342
|
-
|
|
1342
|
+
W(i, x.mvhd, 96, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(t), i.writer.writeUint32(e), i.writer.writeUint32(65536), i.writer.writeUint16(256), i.writer.writeBytes(new Uint8Array([
|
|
1343
1343
|
// reserved and unused junk
|
|
1344
1344
|
0,
|
|
1345
1345
|
0,
|
|
@@ -1412,9 +1412,9 @@ const H = (i, e, t) => {
|
|
|
1412
1412
|
0,
|
|
1413
1413
|
0
|
|
1414
1414
|
])), i.writer.writeUint32(2);
|
|
1415
|
-
},
|
|
1415
|
+
}, en = (i) => "sequenceParameterSets" in i, Mi = (i) => "sequenceHeader" in i, Xe = (i) => i.type == "video", gt = (i) => i.type == "audio", Jr = (i, e, t) => {
|
|
1416
1416
|
const s = i.writer.position();
|
|
1417
|
-
|
|
1417
|
+
W(i, x.tkhd, 0, 0, 3), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(e.trackId), i.writer.writeUint32(0), i.writer.writeUint32(e.duration * t / e.timescale), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint16(0), i.writer.writeUint16(gt(e) ? 1 : 0), i.writer.writeUint16(gt(e) ? 256 : 0), i.writer.writeUint16(0), i.writer.writeBytes(new Uint8Array(
|
|
1418
1418
|
[
|
|
1419
1419
|
0,
|
|
1420
1420
|
1,
|
|
@@ -1453,20 +1453,20 @@ const H = (i, e, t) => {
|
|
|
1453
1453
|
0,
|
|
1454
1454
|
0
|
|
1455
1455
|
]
|
|
1456
|
-
)),
|
|
1456
|
+
)), Xe(e) ? (i.writer.writeUint32(e.width * 65536), i.writer.writeUint32(e.height * 65536)) : gt(e) && (i.writer.writeUint32(0), i.writer.writeUint32(0)), i.writer.writeUint32At(s, i.writer.position() - s);
|
|
1457
1457
|
}, Yr = (i, e) => {
|
|
1458
|
-
|
|
1458
|
+
W(i, x.mdhd, 20, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(e.timescale), i.writer.writeUint32(e.duration);
|
|
1459
1459
|
const t = e.lang || "und", s = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
|
|
1460
1460
|
i.writer.writeUint16(s), i.writer.writeUint16(0);
|
|
1461
1461
|
}, Kr = (i, e) => {
|
|
1462
1462
|
const t = i.writer.position();
|
|
1463
|
-
|
|
1463
|
+
W(i, x.hdlr, 0, 0, 0), i.writer.writeUint32(0), i.writer.writeBytes(b(Xe(e) ? "vide" : "soun")), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeBytes(b(Xe(e) ? "VideoHandler\0" : "SoundHandler\0")), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1464
1464
|
}, $r = (i) => {
|
|
1465
1465
|
const e = i.writer.position();
|
|
1466
|
-
H(i,
|
|
1466
|
+
H(i, x.dinf, 0), W(i, x.dref, 16, 0, 0), i.writer.writeUint32(1), W(i, b("url "), 0, 0, 1), i.writer.writeUint32At(e, i.writer.position() - e);
|
|
1467
1467
|
}, eo = (i, e) => {
|
|
1468
1468
|
const t = i.writer.position();
|
|
1469
|
-
H(i,
|
|
1469
|
+
H(i, x.avcC, 0), i.writer.writeUint8(1), i.writer.writeUint8(e.sequenceParameterSets[0][1]), i.writer.writeUint8(e.sequenceParameterSets[0][2]), i.writer.writeUint8(e.sequenceParameterSets[0][3]), i.writer.writeUint8(255), i.writer.writeUint8(224 | e.sequenceParameterSets.length), e.sequenceParameterSets.forEach((s) => {
|
|
1470
1470
|
i.writer.writeUint16(s.byteLength), i.writer.writeBytes(s);
|
|
1471
1471
|
}), i.writer.writeUint8(e.pictureParameterSets.length), e.pictureParameterSets.forEach((s) => {
|
|
1472
1472
|
i.writer.writeUint16(s.byteLength), i.writer.writeBytes(s);
|
|
@@ -1474,14 +1474,14 @@ const H = (i, e, t) => {
|
|
|
1474
1474
|
}, to = (i, e) => {
|
|
1475
1475
|
var c, h;
|
|
1476
1476
|
const t = i.writer.position();
|
|
1477
|
-
H(i,
|
|
1477
|
+
H(i, x.av1C, 0);
|
|
1478
1478
|
const { seqProfile: s, operatingPoints: r, colorConfig: o } = e.parsedSequenceHeader, a = r[0];
|
|
1479
1479
|
i.writer.writeUint8(129), i.writer.writeUint8(s << 5 | ((c = a == null ? void 0 : a.seqLevelIdx) != null ? c : 0)), i.writer.writeUint8(
|
|
1480
1480
|
((h = a == null ? void 0 : a.tier) != null ? h : 0) | (o.highBitDepth ? 1 : 0) | (o.bitDepth === 12 ? 1 : 0) << 5 | (o.monoChrome ? 1 : 0) << 4 | o.subsamplingX << 3 | o.subsamplingY << 2 | o.chromaSamplePosition & 65535
|
|
1481
1481
|
), i.writer.writeUint8(0), i.writer.writeBytes(e.sequenceHeader), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1482
1482
|
}, io = (i, e) => {
|
|
1483
|
-
const t = i.writer.position(), s = Mi(e) ?
|
|
1484
|
-
H(i, s, 0), i.writer.writeUint32(0), i.writer.writeUint16(0), i.writer.writeUint16(1), i.writer.writeUint16(0), i.writer.writeUint16(0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint16(e.width), i.writer.writeUint16(e.height), i.writer.writeUint32(4718592), i.writer.writeUint32(4718592), i.writer.writeUint32(0), i.writer.writeUint16(1), i.writer.writeUint8(0), i.writer.writeBytes(new Uint8Array(31)), i.writer.writeUint16(24), i.writer.writeUint16(-1),
|
|
1483
|
+
const t = i.writer.position(), s = Mi(e) ? x.av01 : x.avc1;
|
|
1484
|
+
H(i, s, 0), i.writer.writeUint32(0), i.writer.writeUint16(0), i.writer.writeUint16(1), i.writer.writeUint16(0), i.writer.writeUint16(0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint16(e.width), i.writer.writeUint16(e.height), i.writer.writeUint32(4718592), i.writer.writeUint32(4718592), i.writer.writeUint32(0), i.writer.writeUint16(1), i.writer.writeUint8(0), i.writer.writeBytes(new Uint8Array(31)), i.writer.writeUint16(24), i.writer.writeUint16(-1), en(e) ? eo(i, e) : Mi(e) && (to(i, e), e.parsedSequenceHeader.colorConfig && (H(i, b("colr"), 11), i.writer.writeBytes(x.nclx), i.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), i.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), i.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), i.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (H(i, b("pasp"), 8), i.writer.writeUint32(e.pixelAspectRatio.numerator), i.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (H(i, b("btrt"), 12), i.writer.writeUint32(0), i.writer.writeUint32(e.bitrate), i.writer.writeUint32(e.bitrate)), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1485
1485
|
}, Dt = (i, e, t) => {
|
|
1486
1486
|
let s = 3;
|
|
1487
1487
|
for (i.writer.writeUint8(e); s > 0; s--)
|
|
@@ -1489,7 +1489,7 @@ const H = (i, e, t) => {
|
|
|
1489
1489
|
i.writer.writeUint8(t & 127);
|
|
1490
1490
|
}, so = (i, e) => {
|
|
1491
1491
|
const t = e.decoderConfig.byteLength > 0 ? e.decoderConfig.byteLength + 5 : 0, s = i.writer.position();
|
|
1492
|
-
|
|
1492
|
+
W(i, x.esds, 0, 0, 0), Dt(i, 3, 21 + t + 5 + 1), i.writer.writeUint16(e.trackId), i.writer.writeUint8(0), Dt(i, 4, 13 + t);
|
|
1493
1493
|
const r = e.codec === "mp3" && e.sampleRate > 24e3 ? 107 : 64;
|
|
1494
1494
|
i.writer.writeUint8(r), i.writer.writeUint8(21), i.writer.writeUint24(0), i.writer.writeUint32(e.bitrate || 0), i.writer.writeUint32(e.bitrate || 0), e.decoderConfig.byteLength > 0 && (Dt(i, 5, e.decoderConfig.byteLength), i.writer.writeBytes(e.decoderConfig)), Dt(i, 6, 1), i.writer.writeUint8(2), i.writer.writeUint32At(s, i.writer.position() - s);
|
|
1495
1495
|
}, no = (i) => {
|
|
@@ -1519,32 +1519,32 @@ const H = (i, e, t) => {
|
|
|
1519
1519
|
e.bitrate && (H(i, b("btrt"), 12), i.writer.writeUint32(0), i.writer.writeUint32(e.bitrate), i.writer.writeUint32(e.bitrate)), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1520
1520
|
}, ao = (i, e) => {
|
|
1521
1521
|
const t = i.writer.position();
|
|
1522
|
-
H(i,
|
|
1522
|
+
H(i, x.stbl, 0);
|
|
1523
1523
|
const s = i.writer.position();
|
|
1524
|
-
|
|
1524
|
+
W(i, x.stsd, 0, 0, 0), i.writer.writeUint32(1), Xe(e) ? io(i, e) : gt(e) && oo(i, e), i.writer.writeUint32At(s, i.writer.position() - s), W(i, b("stts"), 4, 0, 0), i.writer.writeUint32(0), W(i, b("stsc"), 4, 0, 0), i.writer.writeUint32(0), W(i, b("stsz"), 8, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32(0), W(i, b("stco"), 4, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1525
1525
|
}, co = (i, e) => {
|
|
1526
1526
|
const t = i.writer.position();
|
|
1527
|
-
H(i,
|
|
1527
|
+
H(i, x.minf, 0), Xe(e) ? (W(i, x.vmhd, 8, 0, 1), i.writer.writeUint32(0), i.writer.writeUint32(0)) : gt(e) && (W(i, x.smhd, 4, 0, 0), i.writer.writeUint16(0), i.writer.writeUint16(0)), $r(i), ao(i, e), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1528
1528
|
}, ho = (i, e) => {
|
|
1529
1529
|
const t = i.writer.position();
|
|
1530
|
-
H(i,
|
|
1530
|
+
H(i, x.mdia, 0), Yr(i, e), Kr(i, e), co(i, e), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1531
1531
|
}, uo = (i, e, t) => {
|
|
1532
1532
|
const s = i.writer.position();
|
|
1533
|
-
H(i,
|
|
1533
|
+
H(i, x.trak, 0), Jr(i, e, t), ho(i, e), i.writer.writeUint32At(s, i.writer.position() - s);
|
|
1534
1534
|
}, lo = (i, e) => {
|
|
1535
|
-
|
|
1535
|
+
W(i, x.trex, 20, 0, 0), i.writer.writeUint32(e.trackId), i.writer.writeUint32(1), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(0);
|
|
1536
1536
|
}, mo = (i, e) => {
|
|
1537
1537
|
const t = i.writer.position();
|
|
1538
|
-
H(i,
|
|
1538
|
+
H(i, x.mvex, 0), e.forEach((s) => lo(i, s)), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1539
1539
|
}, fo = (i, e, t, s) => {
|
|
1540
1540
|
const r = i.writer.position();
|
|
1541
|
-
H(i,
|
|
1541
|
+
H(i, x.moov, 0), Zr(i, 0, t), e.forEach((o) => uo(i, o, t)), mo(i, e), i.writer.writeUint32At(r, i.writer.position() - r);
|
|
1542
1542
|
}, Ao = (i, e) => {
|
|
1543
1543
|
const t = i.writer.position();
|
|
1544
|
-
|
|
1544
|
+
W(i, x.tfhd, 16, 0, 56), i.writer.writeUint32(e.trackId), i.writer.writeUint32(e.defaultDuration || 0), i.writer.writeUint32(e.defaultSize || 0), i.writer.writeUint32(e.defaultFlags || 0), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1545
1545
|
}, go = (i, e) => {
|
|
1546
1546
|
const t = i.writer.position();
|
|
1547
|
-
|
|
1547
|
+
W(i, x.tfdt, 8, 1, 0);
|
|
1548
1548
|
const s = Math.floor(e.timestamp / 4294967296), r = (e.timestamp & 4294967295) >>> 0;
|
|
1549
1549
|
i.writer.writeUint32(s), i.writer.writeUint32(r), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1550
1550
|
}, po = (i, e) => {
|
|
@@ -1554,7 +1554,7 @@ const H = (i, e, t) => {
|
|
|
1554
1554
|
let o = 1;
|
|
1555
1555
|
s && (o |= 4), t && (o |= 2048), r && (o |= 512, o |= 256, o |= 1024);
|
|
1556
1556
|
const a = i.writer.position();
|
|
1557
|
-
|
|
1557
|
+
W(i, x.trun, 16, 1, o), i.writer.writeUint32(e.samples.length);
|
|
1558
1558
|
const c = i.writer.position();
|
|
1559
1559
|
i.writer.writeUint32(0), s && i.writer.writeUint32(Ci(e.samples[0]));
|
|
1560
1560
|
for (const h of e.samples)
|
|
@@ -1562,20 +1562,20 @@ const H = (i, e, t) => {
|
|
|
1562
1562
|
i.writer.writeUint32At(c, i.writer.position() + 8), i.writer.writeUint32At(a, i.writer.position() - a);
|
|
1563
1563
|
}, Ci = (i) => i.isSync ? 33554432 : 16842752, wo = (i, e) => {
|
|
1564
1564
|
const t = i.writer.position();
|
|
1565
|
-
H(i,
|
|
1565
|
+
H(i, x.traf, 0), Ao(i, e), go(i, e), po(i, e), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1566
1566
|
}, So = (i, e) => {
|
|
1567
|
-
|
|
1567
|
+
W(i, x.mfhd, 4, 0, 0), i.writer.writeUint32(e);
|
|
1568
1568
|
}, vo = (i, e) => {
|
|
1569
1569
|
const t = i.writer.position();
|
|
1570
|
-
H(i,
|
|
1570
|
+
H(i, x.moof, 0), So(i, e.sequenceNumber), wo(i, e), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
1571
1571
|
}, bo = (i, e) => {
|
|
1572
1572
|
const t = e.samples.reduce((s, r) => s + r.data.byteLength, 0);
|
|
1573
|
-
H(i,
|
|
1573
|
+
H(i, x.mdat, t), e.samples.forEach((s) => i.writer.writeBytes(s.data));
|
|
1574
1574
|
}, Si = (i, e) => {
|
|
1575
|
-
const t = new
|
|
1576
|
-
return i.filter((o) =>
|
|
1575
|
+
const t = new $s(), s = i.filter((o) => Xe(o) && en(o)).length > 0;
|
|
1576
|
+
return i.filter((o) => Xe(o) && Mi(o)).length > 0 ? Ti(t, jr) : s ? Ti(t, Gr) : Ti(t, qr), fo(t, i, Xr), t.writer.buffer();
|
|
1577
1577
|
}, vi = (i) => {
|
|
1578
|
-
const e = new
|
|
1578
|
+
const e = new $s();
|
|
1579
1579
|
return vo(e, i), bo(e, i), e.writer.buffer();
|
|
1580
1580
|
}, yo = (i, e) => {
|
|
1581
1581
|
const t = i.map((a) => R(A({}, a), {
|
|
@@ -1604,8 +1604,8 @@ const H = (i, e, t) => {
|
|
|
1604
1604
|
duration: 0,
|
|
1605
1605
|
trackId: 1
|
|
1606
1606
|
}
|
|
1607
|
-
]),
|
|
1608
|
-
const { sequenceParameterSets: e, pictureParameterSets: t } =
|
|
1607
|
+
]), tn = (i) => {
|
|
1608
|
+
const { sequenceParameterSets: e, pictureParameterSets: t } = Ks(i), s = e[0], r = t[0];
|
|
1609
1609
|
if (!s || !r)
|
|
1610
1610
|
throw new Error("No sps or pps provided");
|
|
1611
1611
|
return Or(s);
|
|
@@ -1626,7 +1626,7 @@ const H = (i, e, t) => {
|
|
|
1626
1626
|
samples: t
|
|
1627
1627
|
});
|
|
1628
1628
|
}, Co = (i, e) => {
|
|
1629
|
-
const { sequenceParameterSets: t, pictureParameterSets: s } =
|
|
1629
|
+
const { sequenceParameterSets: t, pictureParameterSets: s } = Ks(i), r = tn(i);
|
|
1630
1630
|
return Si([
|
|
1631
1631
|
{
|
|
1632
1632
|
type: "video",
|
|
@@ -1666,8 +1666,8 @@ const H = (i, e, t) => {
|
|
|
1666
1666
|
defaultDuration: o,
|
|
1667
1667
|
samples: t
|
|
1668
1668
|
});
|
|
1669
|
-
},
|
|
1670
|
-
const e = new
|
|
1669
|
+
}, sn = (i) => {
|
|
1670
|
+
const e = new Fs(i);
|
|
1671
1671
|
return e.peekBit() === 1 && e.readBits(32), Po(e), Fo(e);
|
|
1672
1672
|
}, Ro = (i) => {
|
|
1673
1673
|
let e = 0;
|
|
@@ -1700,7 +1700,7 @@ const H = (i, e, t) => {
|
|
|
1700
1700
|
numUnitsInDisplayTick: e,
|
|
1701
1701
|
numTicksPerPicture: r
|
|
1702
1702
|
};
|
|
1703
|
-
},
|
|
1703
|
+
}, bs = 2, Ii = 2, Uo = 1, Mo = 2, Lo = 2, _o = 13, Do = 0, Oo = 2, ys = 0, Fo = (i) => {
|
|
1704
1704
|
const e = i.readBits(3), s = i.readBit() !== 0, r = i.readBit() !== 0;
|
|
1705
1705
|
let o, a = !1, c = !1, h = !1, u = 0, l = 0;
|
|
1706
1706
|
const m = [];
|
|
@@ -1710,8 +1710,8 @@ const H = (i, e, t) => {
|
|
|
1710
1710
|
if (c = i.readBit() !== 0, c && (o = xo(i), a = i.readBit() !== 0, a))
|
|
1711
1711
|
throw new Error("Not implemented");
|
|
1712
1712
|
h = i.readBit() !== 0;
|
|
1713
|
-
const
|
|
1714
|
-
for (let D = 0; D <
|
|
1713
|
+
const I = i.readBits(5) + 1;
|
|
1714
|
+
for (let D = 0; D < I; D++) {
|
|
1715
1715
|
const ie = i.readBits(12), O = i.readBits(5);
|
|
1716
1716
|
let Q = 0;
|
|
1717
1717
|
if (O > 7 && (Q = i.readBit()), a)
|
|
@@ -1719,13 +1719,13 @@ const H = (i, e, t) => {
|
|
|
1719
1719
|
h && i.readBit() !== 0 && i.readBits(4), m.push({ tier: Q, operatingPointIdc: ie, seqLevelIdx: O });
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
|
-
const g = i.readBits(4) + 1, p = i.readBits(4) + 1,
|
|
1722
|
+
const g = i.readBits(4) + 1, p = i.readBits(4) + 1, y = i.readBits(g) + 1, U = i.readBits(p) + 1;
|
|
1723
1723
|
let N = !1;
|
|
1724
1724
|
r ? N = !1 : N = i.readBit() !== 0, N && (u = i.readBits(4) + 2, l = i.readBits(3) + 1);
|
|
1725
|
-
const
|
|
1726
|
-
let Z = !1, te = !1, me = !1, Mt = !1, fe = !1, lt = !1, Lt = !1, xe =
|
|
1727
|
-
r || (Z = i.readBit() !== 0, te = i.readBit() !== 0, me = i.readBit() !== 0, Mt = i.readBit() !== 0, fe = i.readBit() !== 0, fe && (lt = i.readBit() !== 0, Lt = i.readBit() !== 0), i.readBit() !== 0 ? xe =
|
|
1728
|
-
const v = i.readBit() !== 0,
|
|
1725
|
+
const X = i.readBit() !== 0, L = i.readBit() !== 0, _ = i.readBit() !== 0;
|
|
1726
|
+
let Z = !1, te = !1, me = !1, Mt = !1, fe = !1, lt = !1, Lt = !1, xe = bs, Ue = Ii, f = 0;
|
|
1727
|
+
r || (Z = i.readBit() !== 0, te = i.readBit() !== 0, me = i.readBit() !== 0, Mt = i.readBit() !== 0, fe = i.readBit() !== 0, fe && (lt = i.readBit() !== 0, Lt = i.readBit() !== 0), i.readBit() !== 0 ? xe = bs : xe = i.readBit(), xe > 0 ? i.readBit() > 0 ? Ue = Ii : Ue = i.readBit() : Ue = Ii, fe ? f = i.readBits(3) : f = 0);
|
|
1728
|
+
const v = i.readBit() !== 0, M = i.readBit() !== 0, P = i.readBit() !== 0;
|
|
1729
1729
|
return {
|
|
1730
1730
|
seqProfile: e,
|
|
1731
1731
|
stillPicture: s,
|
|
@@ -1742,12 +1742,12 @@ const H = (i, e, t) => {
|
|
|
1742
1742
|
operatingPoints: m,
|
|
1743
1743
|
frameWidthBits: g,
|
|
1744
1744
|
frameHeightBits: p,
|
|
1745
|
-
maxFrameWidth:
|
|
1746
|
-
maxFrameHeight:
|
|
1745
|
+
maxFrameWidth: y,
|
|
1746
|
+
maxFrameHeight: U,
|
|
1747
1747
|
frameIdNumbersPresentFlag: N,
|
|
1748
1748
|
deltaFrameIdLength: u,
|
|
1749
1749
|
additionalFrameIdLength: l,
|
|
1750
|
-
use_128x128Superblock:
|
|
1750
|
+
use_128x128Superblock: X,
|
|
1751
1751
|
enableFilterIntra: L,
|
|
1752
1752
|
enableIntraEdgeFilter: _,
|
|
1753
1753
|
enableInterintraCompound: Z,
|
|
@@ -1761,8 +1761,8 @@ const H = (i, e, t) => {
|
|
|
1761
1761
|
seqForceIntegerMv: Ue,
|
|
1762
1762
|
orderHintBits: f,
|
|
1763
1763
|
enableSuperres: v,
|
|
1764
|
-
enableCdef:
|
|
1765
|
-
enableRestoration:
|
|
1764
|
+
enableCdef: M,
|
|
1765
|
+
enableRestoration: P,
|
|
1766
1766
|
colorConfig: No(i, e),
|
|
1767
1767
|
filmGrainParamsPresent: i.readBit() !== 0
|
|
1768
1768
|
};
|
|
@@ -1771,8 +1771,8 @@ const H = (i, e, t) => {
|
|
|
1771
1771
|
let s = 8, r = !1;
|
|
1772
1772
|
e === 2 && t ? s = i.readBit() !== 0 ? 12 : 10 : e <= 2 && (s = t ? 10 : 8), e === 1 ? r = !1 : r = i.readBit() !== 0;
|
|
1773
1773
|
const o = r ? 1 : 3, a = i.readBit() !== 0;
|
|
1774
|
-
let c = Mo, h = Lo, u = Oo, l = !1, m = 0, g = 0, p =
|
|
1775
|
-
return a && (c = i.readBits(8), h = i.readBits(8), u = i.readBits(8)), r ? (l = i.readBit() !== 0, m = 1, g = 1, p =
|
|
1774
|
+
let c = Mo, h = Lo, u = Oo, l = !1, m = 0, g = 0, p = ys, y = !1;
|
|
1775
|
+
return a && (c = i.readBits(8), h = i.readBits(8), u = i.readBits(8)), r ? (l = i.readBit() !== 0, m = 1, g = 1, p = ys, y = !1, {
|
|
1776
1776
|
highBitDepth: t,
|
|
1777
1777
|
bitDepth: s,
|
|
1778
1778
|
monoChrome: r,
|
|
@@ -1781,7 +1781,7 @@ const H = (i, e, t) => {
|
|
|
1781
1781
|
colorRange: l,
|
|
1782
1782
|
matrixCoefficients: u,
|
|
1783
1783
|
numPlanes: o,
|
|
1784
|
-
separateUvDeltaQ:
|
|
1784
|
+
separateUvDeltaQ: y,
|
|
1785
1785
|
subsamplingX: m,
|
|
1786
1786
|
subsamplingY: g,
|
|
1787
1787
|
transferCharacteristics: h
|
|
@@ -1794,11 +1794,11 @@ const H = (i, e, t) => {
|
|
|
1794
1794
|
colorRange: l,
|
|
1795
1795
|
matrixCoefficients: u,
|
|
1796
1796
|
numPlanes: o,
|
|
1797
|
-
separateUvDeltaQ:
|
|
1797
|
+
separateUvDeltaQ: y,
|
|
1798
1798
|
subsamplingX: m,
|
|
1799
1799
|
subsamplingY: g,
|
|
1800
1800
|
transferCharacteristics: h
|
|
1801
|
-
}) : (l = i.readBit() !== 0, e === 0 ? (m = 1, g = 1) : e === 1 ? (m = 0, g = 0) : s === 12 ? (m = i.readBit(), m !== 0 ? g = i.readBit() : g = 0) : (m = 1, g = 0), m !== 0 && g !== 0 && (p = i.readBits(2)),
|
|
1801
|
+
}) : (l = i.readBit() !== 0, e === 0 ? (m = 1, g = 1) : e === 1 ? (m = 0, g = 0) : s === 12 ? (m = i.readBit(), m !== 0 ? g = i.readBit() : g = 0) : (m = 1, g = 0), m !== 0 && g !== 0 && (p = i.readBits(2)), y = i.readBit() !== 0, {
|
|
1802
1802
|
highBitDepth: t,
|
|
1803
1803
|
bitDepth: s,
|
|
1804
1804
|
monoChrome: r,
|
|
@@ -1807,13 +1807,13 @@ const H = (i, e, t) => {
|
|
|
1807
1807
|
colorRange: l,
|
|
1808
1808
|
matrixCoefficients: u,
|
|
1809
1809
|
numPlanes: o,
|
|
1810
|
-
separateUvDeltaQ:
|
|
1810
|
+
separateUvDeltaQ: y,
|
|
1811
1811
|
subsamplingX: m,
|
|
1812
1812
|
subsamplingY: g,
|
|
1813
1813
|
transferCharacteristics: h
|
|
1814
1814
|
});
|
|
1815
1815
|
}, Vo = (i) => {
|
|
1816
|
-
const e =
|
|
1816
|
+
const e = sn(i);
|
|
1817
1817
|
if (e)
|
|
1818
1818
|
return {
|
|
1819
1819
|
width: e.maxFrameWidth,
|
|
@@ -1836,7 +1836,7 @@ const H = (i, e, t) => {
|
|
|
1836
1836
|
samples: t
|
|
1837
1837
|
});
|
|
1838
1838
|
}, Ho = (i, e) => {
|
|
1839
|
-
const t =
|
|
1839
|
+
const t = sn(i);
|
|
1840
1840
|
if (!t)
|
|
1841
1841
|
throw new Error("Failed to parse sequence header");
|
|
1842
1842
|
return Si([
|
|
@@ -1854,9 +1854,9 @@ const H = (i, e, t) => {
|
|
|
1854
1854
|
}, Qo = (i, e, t) => {
|
|
1855
1855
|
switch (i) {
|
|
1856
1856
|
case "h264":
|
|
1857
|
-
return
|
|
1857
|
+
return Xo(e, t);
|
|
1858
1858
|
case "av1":
|
|
1859
|
-
return
|
|
1859
|
+
return Go(e, t);
|
|
1860
1860
|
case "opus":
|
|
1861
1861
|
return jo(e, t);
|
|
1862
1862
|
case "aac":
|
|
@@ -1864,14 +1864,14 @@ const H = (i, e, t) => {
|
|
|
1864
1864
|
default:
|
|
1865
1865
|
throw new Error(`Failed to initialize ${i} segment`);
|
|
1866
1866
|
}
|
|
1867
|
-
},
|
|
1867
|
+
}, Wo = (i, e) => {
|
|
1868
1868
|
switch (i) {
|
|
1869
1869
|
case "h264":
|
|
1870
|
-
return
|
|
1870
|
+
return tn(e);
|
|
1871
1871
|
case "av1":
|
|
1872
1872
|
return Vo(e);
|
|
1873
1873
|
}
|
|
1874
|
-
},
|
|
1874
|
+
}, Xo = (i, e) => Co(i, e), Go = (i, e) => Ho(i, e), jo = (i, e) => Io(new Uint8Array(i), 2, e), qo = (i, e) => Eo(new Uint8Array(i), 2, e, e), Zo = (i, e) => {
|
|
1875
1875
|
if (!i[0])
|
|
1876
1876
|
throw new Error("At least one sample must be provided");
|
|
1877
1877
|
switch (i[0].codec) {
|
|
@@ -1887,7 +1887,7 @@ const H = (i, e, t) => {
|
|
|
1887
1887
|
throw new Error(`Unsupported codec ${i[0].codec}`);
|
|
1888
1888
|
}
|
|
1889
1889
|
}, pt = (i) => !!(i & 1), Jo = (i) => !!(i & 2), Yo = (i) => !!(i & 4), Ko = (i) => !!(i & 8), $o = (i) => !!(i & 16), ea = (i) => {
|
|
1890
|
-
const e = new DataView(i, 0), t = e.getUint8(0), s = e.getUint16(1), r = e.getUint8(3), o = e.getUint8(4), a =
|
|
1890
|
+
const e = new DataView(i, 0), t = e.getUint8(0), s = e.getUint16(1), r = e.getUint8(3), o = e.getUint8(4), a = Vs(new Uint8Array(i), 5, 12), c = e.getUint32(13), h = $o(r) ? e.getInt16(17) : void 0, u = i.slice(s);
|
|
1891
1891
|
return { version: t, renditionId: o, flags: r, timestamp: a, timescale: c, payload: u, compositionTimeOffset: h };
|
|
1892
1892
|
}, ta = "data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw", Ot = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
|
|
1893
1893
|
class ia {
|
|
@@ -1925,7 +1925,7 @@ class ia {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
}
|
|
1927
1927
|
enable() {
|
|
1928
|
-
return
|
|
1928
|
+
return E(this, null, function* () {
|
|
1929
1929
|
var e, t;
|
|
1930
1930
|
return Ot() ? navigator.wakeLock.request("screen").then((s) => {
|
|
1931
1931
|
this._wakeLock = s, this.enabled = !0, this._wakeLock.addEventListener("release", () => {
|
|
@@ -1947,7 +1947,7 @@ class ia {
|
|
|
1947
1947
|
}
|
|
1948
1948
|
const sa = /\r\n|\r|\n/;
|
|
1949
1949
|
var Ce, pe;
|
|
1950
|
-
class
|
|
1950
|
+
class Es {
|
|
1951
1951
|
constructor(e) {
|
|
1952
1952
|
w(this, Ce);
|
|
1953
1953
|
w(this, pe);
|
|
@@ -1977,27 +1977,27 @@ class Ts {
|
|
|
1977
1977
|
}
|
|
1978
1978
|
}
|
|
1979
1979
|
Ce = new WeakMap(), pe = new WeakMap();
|
|
1980
|
-
var
|
|
1980
|
+
var Ge, nn, Li;
|
|
1981
1981
|
class na {
|
|
1982
1982
|
constructor() {
|
|
1983
|
-
w(this,
|
|
1983
|
+
w(this, Ge);
|
|
1984
1984
|
}
|
|
1985
1985
|
parse(e) {
|
|
1986
|
-
const t = [], s = e.split(sa), r = new
|
|
1986
|
+
const t = [], s = e.split(sa), r = new Es(s), o = r.readLine();
|
|
1987
1987
|
if (!o || !o.startsWith("WEBVTT"))
|
|
1988
1988
|
throw new Error("missing 'WEBVTT' signature");
|
|
1989
1989
|
for (; r.readLine() !== ""; )
|
|
1990
1990
|
;
|
|
1991
1991
|
for (; r.linesLeft() > 0; ) {
|
|
1992
|
-
const a = F(this,
|
|
1992
|
+
const a = F(this, Ge, nn).call(this, r);
|
|
1993
1993
|
t.push(a), r.skipEmptyLines();
|
|
1994
1994
|
}
|
|
1995
1995
|
return t;
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
|
-
|
|
1998
|
+
Ge = new WeakSet(), nn = function(e) {
|
|
1999
1999
|
e.skipEmptyLines();
|
|
2000
|
-
const t = e.takeUntilEmptyLine(), s = new
|
|
2000
|
+
const t = e.takeUntilEmptyLine(), s = new Es(t);
|
|
2001
2001
|
let r = s.readLine(), o;
|
|
2002
2002
|
if (r != null && r.includes("-->") || (o = r, r = s.readLine()), r === void 0)
|
|
2003
2003
|
throw new Error("expected cue line");
|
|
@@ -2010,7 +2010,7 @@ We = new WeakSet(), rn = function(e) {
|
|
|
2010
2010
|
const l = s.readLine();
|
|
2011
2011
|
if (!l)
|
|
2012
2012
|
throw new Error("missing text");
|
|
2013
|
-
const m = F(this,
|
|
2013
|
+
const m = F(this, Ge, Li).call(this, a), g = F(this, Ge, Li).call(this, h);
|
|
2014
2014
|
return {
|
|
2015
2015
|
id: o,
|
|
2016
2016
|
startTime: m,
|
|
@@ -2096,7 +2096,7 @@ class _i extends Pe {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
});
|
|
2098
2098
|
});
|
|
2099
|
-
n(this, "_play", () =>
|
|
2099
|
+
n(this, "_play", () => E(this, null, function* () {
|
|
2100
2100
|
try {
|
|
2101
2101
|
yield this.element.play(), this._userHasProvidedInput = !this.muted || this._userProvidedMuted;
|
|
2102
2102
|
} catch (t) {
|
|
@@ -2276,7 +2276,7 @@ const ca = (i) => {
|
|
|
2276
2276
|
framerate: i.frameRate[0] / i.frameRate[1]
|
|
2277
2277
|
}
|
|
2278
2278
|
}, navigator.mediaCapabilities.decodingInfo(e);
|
|
2279
|
-
}, ha = 0.15, ua = 0.2,
|
|
2279
|
+
}, ha = 0.15, ua = 0.2, Ts = 0.4, la = 0.5, ma = 0.6, Bi = 15, fa = {
|
|
2280
2280
|
cooldownTime: 3e3,
|
|
2281
2281
|
maxBufferingEvents: {
|
|
2282
2282
|
last10Seconds: 0
|
|
@@ -2348,7 +2348,7 @@ const ca = (i) => {
|
|
|
2348
2348
|
const { bufferFullness: t, general: s } = this.qualityOfServiceSource.getMetrics(), r = this.qualityOfServiceSource.getBufferFullnessRegression();
|
|
2349
2349
|
if (!r)
|
|
2350
2350
|
return;
|
|
2351
|
-
const o = 10 * 1e3, { slope: a } = r, c = r.predict(Bi), h = a < 0, u = r.predict(Bi) <
|
|
2351
|
+
const o = 10 * 1e3, { slope: a } = r, c = r.predict(Bi), h = a < 0, u = r.predict(Bi) < Ts && r.slope < 0, l = r.predict(Bi) > ma, m = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), g = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), p = m / g;
|
|
2352
2352
|
if (t < 0.15 && p > 0.8) {
|
|
2353
2353
|
this.adaptLevel("reconnect");
|
|
2354
2354
|
return;
|
|
@@ -2357,7 +2357,7 @@ const ca = (i) => {
|
|
|
2357
2357
|
this.adaptLevel("downgrade");
|
|
2358
2358
|
return;
|
|
2359
2359
|
}
|
|
2360
|
-
u || t < ha ? h && t <
|
|
2360
|
+
u || t < ha ? h && t < Ts && c < ua && this.adaptLevel(e.playbackState === "buffering" ? "double downgrade" : "downgrade") : t > la && l && !this.tooMuchTimeBuffering(o) && !this.tooManyBufferingEvents(o) && this.adaptLevel("upgrade");
|
|
2361
2361
|
});
|
|
2362
2362
|
n(this, "onAdaptedLevel", () => {
|
|
2363
2363
|
this.reset();
|
|
@@ -2510,7 +2510,7 @@ class pa extends Pe {
|
|
|
2510
2510
|
this.emit("error", mr(ft()));
|
|
2511
2511
|
break;
|
|
2512
2512
|
case 4003:
|
|
2513
|
-
this.emit("error",
|
|
2513
|
+
this.emit("error", Hs("internal", ft()));
|
|
2514
2514
|
break;
|
|
2515
2515
|
case 4010:
|
|
2516
2516
|
this.emit("error", fr("internal", ft()));
|
|
@@ -2525,7 +2525,7 @@ class pa extends Pe {
|
|
|
2525
2525
|
* @returns a promise that resolves true if the connect steps succeeded
|
|
2526
2526
|
* and false if any checks stopped the connection
|
|
2527
2527
|
*/
|
|
2528
|
-
n(this, "connect", (t = !1) =>
|
|
2528
|
+
n(this, "connect", (t = !1) => E(this, null, function* () {
|
|
2529
2529
|
if (this.isConnectInProgress)
|
|
2530
2530
|
return this.logger.info("Connect already in progress"), !1;
|
|
2531
2531
|
if (this.isSuspended)
|
|
@@ -2534,7 +2534,7 @@ class pa extends Pe {
|
|
|
2534
2534
|
this.logger.info("Waiting for reconnect delay", A({}, this.options)), yield Ui(this.options.reconnectDelay);
|
|
2535
2535
|
const s = yield this.options.reconnectHandler(this.reconnectState);
|
|
2536
2536
|
if (this.reconnectState.reconnectRetries++, !s)
|
|
2537
|
-
return this._isConnectInProgress = !1, this.emit("error",
|
|
2537
|
+
return this._isConnectInProgress = !1, this.emit("error", Qs()), !1;
|
|
2538
2538
|
}
|
|
2539
2539
|
this._connectionAttemptCount++;
|
|
2540
2540
|
try {
|
|
@@ -2650,7 +2650,7 @@ const wa = 65536 * 8, Sa = 0.9, ki = (i) => wa * Sa * 1e3 / i, ce = class ce {
|
|
|
2650
2650
|
}
|
|
2651
2651
|
this.handleMessage(e, t);
|
|
2652
2652
|
});
|
|
2653
|
-
n(this, "resolveEdgeUrl", () =>
|
|
2653
|
+
n(this, "resolveEdgeUrl", () => E(this, null, function* () {
|
|
2654
2654
|
const e = this.config.connectInfo, t = yield this.config.onConnectInfo(e), s = this.config.options.getOverride(
|
|
2655
2655
|
"separateVideoSocketEnabled",
|
|
2656
2656
|
t.channelId
|
|
@@ -2810,7 +2810,7 @@ class va {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
at = new WeakMap(), Ie = new WeakMap(), ct = new WeakMap();
|
|
2813
|
-
var he, dt, we, ht, Yt, Kt, $t,
|
|
2813
|
+
var he, dt, we, ht, Yt, Kt, $t, rn;
|
|
2814
2814
|
const tt = class tt {
|
|
2815
2815
|
constructor(e, t, s) {
|
|
2816
2816
|
w(this, $t);
|
|
@@ -2847,7 +2847,7 @@ const tt = class tt {
|
|
|
2847
2847
|
connectionProtocol: void 0
|
|
2848
2848
|
});
|
|
2849
2849
|
n(this, "connect", () => {
|
|
2850
|
-
S(this, he, !0), !d(this, dt) && S(this, dt, F(this, $t,
|
|
2850
|
+
S(this, he, !0), !d(this, dt) && S(this, dt, F(this, $t, rn).call(this));
|
|
2851
2851
|
});
|
|
2852
2852
|
n(this, "disconnect", (e = "Disconnect Requested") => {
|
|
2853
2853
|
var t;
|
|
@@ -2856,21 +2856,21 @@ const tt = class tt {
|
|
|
2856
2856
|
n(this, "reconnect", (e) => {
|
|
2857
2857
|
this.disconnect(e), this.connect();
|
|
2858
2858
|
});
|
|
2859
|
-
w(this, Yt, () =>
|
|
2859
|
+
w(this, Yt, () => E(this, null, function* () {
|
|
2860
2860
|
try {
|
|
2861
2861
|
return yield this.apiClient.connect(this.config.options.getOptions());
|
|
2862
2862
|
} catch (e) {
|
|
2863
|
-
if (
|
|
2863
|
+
if (En(e))
|
|
2864
2864
|
switch (e.status) {
|
|
2865
2865
|
case 401:
|
|
2866
2866
|
throw this.emitter.emit("error", zt(e)), zt(e);
|
|
2867
2867
|
case 403:
|
|
2868
|
-
throw this.emitter.emit("error",
|
|
2868
|
+
throw this.emitter.emit("error", fs(e.message)), fs(e.message);
|
|
2869
2869
|
}
|
|
2870
2870
|
throw this.emitter.emit("error", gr(e instanceof Error ? e : void 0)), e;
|
|
2871
2871
|
}
|
|
2872
2872
|
}));
|
|
2873
|
-
w(this, Kt, () =>
|
|
2873
|
+
w(this, Kt, () => E(this, null, function* () {
|
|
2874
2874
|
const e = Date.now(), t = () => Date.now() - e;
|
|
2875
2875
|
return Promise.race([
|
|
2876
2876
|
Ui(tt.PING_TIMEOUT),
|
|
@@ -2879,7 +2879,7 @@ const tt = class tt {
|
|
|
2879
2879
|
})
|
|
2880
2880
|
]).then(t, t);
|
|
2881
2881
|
}));
|
|
2882
|
-
this.logger = t, this.emitter = e, this.config = s, this.apiClient = new
|
|
2882
|
+
this.logger = t, this.emitter = e, this.config = s, this.apiClient = new yn({
|
|
2883
2883
|
publicEndpoint: this.config.options.get("url").toString(),
|
|
2884
2884
|
tokenFactory: () => this.config.options.get("authenticationToken")
|
|
2885
2885
|
});
|
|
@@ -2907,8 +2907,8 @@ const tt = class tt {
|
|
|
2907
2907
|
return (e = this.connectionImpl) == null ? void 0 : e.lastConnectionTime;
|
|
2908
2908
|
}
|
|
2909
2909
|
};
|
|
2910
|
-
he = new WeakMap(), dt = new WeakMap(), we = new WeakMap(), ht = new WeakMap(), Yt = new WeakMap(), Kt = new WeakMap(), $t = new WeakSet(),
|
|
2911
|
-
return
|
|
2910
|
+
he = new WeakMap(), dt = new WeakMap(), we = new WeakMap(), ht = new WeakMap(), Yt = new WeakMap(), Kt = new WeakMap(), $t = new WeakSet(), rn = function() {
|
|
2911
|
+
return E(this, null, function* () {
|
|
2912
2912
|
var t;
|
|
2913
2913
|
const e = new va({ edgeUrl: this.config.options.get("edgeUrl") });
|
|
2914
2914
|
for (S(this, we, 0); ; ) {
|
|
@@ -2920,9 +2920,9 @@ he = new WeakMap(), dt = new WeakMap(), we = new WeakMap(), ht = new WeakMap(),
|
|
|
2920
2920
|
const c = e.select(r.edges);
|
|
2921
2921
|
if (!c)
|
|
2922
2922
|
throw new T("Failed to resolve edge url", { isFatal: !0, code: "failed_to_resolve_edge_url" });
|
|
2923
|
-
if (
|
|
2924
|
-
if (
|
|
2925
|
-
const { MoqConnectionAdapter: h } = yield import("./
|
|
2923
|
+
if (Tn(r)) {
|
|
2924
|
+
if (Qn().moqEnabled) {
|
|
2925
|
+
const { MoqConnectionAdapter: h } = yield import("./CTUR22Wg.js");
|
|
2926
2926
|
this.connectionImpl = yield h.start(this.emitter, this.logger, this.apiClient, R(A({}, this.config), {
|
|
2927
2927
|
connectInfo: r,
|
|
2928
2928
|
estimatedRtt: a,
|
|
@@ -2949,7 +2949,7 @@ he = new WeakMap(), dt = new WeakMap(), we = new WeakMap(), ht = new WeakMap(),
|
|
|
2949
2949
|
if (!(yield this.config.reconnectHandler({
|
|
2950
2950
|
reconnectRetries: d(this, we)
|
|
2951
2951
|
}))) {
|
|
2952
|
-
this.emitter.emit("error",
|
|
2952
|
+
this.emitter.emit("error", Qs());
|
|
2953
2953
|
break;
|
|
2954
2954
|
}
|
|
2955
2955
|
if (yield Ui(1e3), !d(this, he))
|
|
@@ -3131,7 +3131,7 @@ class ss {
|
|
|
3131
3131
|
var r, o;
|
|
3132
3132
|
let s;
|
|
3133
3133
|
for (; (s = (o = (r = t.decoderContext).error) == null ? void 0 : o.call(r)) !== void 0; )
|
|
3134
|
-
this.emitter.emit("error",
|
|
3134
|
+
this.emitter.emit("error", dr(!1, s));
|
|
3135
3135
|
for (; (e = t.decoderContext.take()) !== void 0; ) {
|
|
3136
3136
|
const { statistics: a } = e;
|
|
3137
3137
|
a && (t.decodeTime.push(a.decodeTime), t.transportTime.push(
|
|
@@ -3167,12 +3167,12 @@ class ss {
|
|
|
3167
3167
|
this.logger = t, this.emitter = e, this.trackContexts = s, this.playbackSource = r;
|
|
3168
3168
|
}
|
|
3169
3169
|
static create(e, t, s, r, o) {
|
|
3170
|
-
return
|
|
3170
|
+
return E(this, null, function* () {
|
|
3171
3171
|
const a = /* @__PURE__ */ new Map();
|
|
3172
3172
|
for (const c of s)
|
|
3173
3173
|
switch (c.type) {
|
|
3174
3174
|
case "audio": {
|
|
3175
|
-
const { OpusDecoderContext: h } = yield import("./
|
|
3175
|
+
const { OpusDecoderContext: h } = yield import("./C2E9fx_I.js");
|
|
3176
3176
|
a.set(c.type, {
|
|
3177
3177
|
buffer: [],
|
|
3178
3178
|
decoderContext: yield h.create(48e3, 2),
|
|
@@ -3183,7 +3183,7 @@ class ss {
|
|
|
3183
3183
|
break;
|
|
3184
3184
|
}
|
|
3185
3185
|
case "video": {
|
|
3186
|
-
const { H264DecoderWorkerContext: h } = yield import("./
|
|
3186
|
+
const { H264DecoderWorkerContext: h } = yield import("./DUVlYJes.js");
|
|
3187
3187
|
a.set(c.type, {
|
|
3188
3188
|
buffer: [],
|
|
3189
3189
|
decoderContext: yield h.create(o),
|
|
@@ -3318,7 +3318,7 @@ const ne = class ne {
|
|
|
3318
3318
|
});
|
|
3319
3319
|
n(this, "add", (e, t) => {
|
|
3320
3320
|
let s = this.bytesReceived.get(e);
|
|
3321
|
-
s || (s = new
|
|
3321
|
+
s || (s = new Nn(20), this.bytesReceived.set(e, s)), t > 0 && (this.lastBytesUpdated = Date.now(), this.timeoutInterval || (this.timeoutInterval = this.timers.setInterval(
|
|
3322
3322
|
this.checkTimeout,
|
|
3323
3323
|
ne.UPDATE_RECEIVED_BYTES_INTERVAL
|
|
3324
3324
|
))), s.add(t);
|
|
@@ -3366,14 +3366,14 @@ const Ia = () => window.AudioContext || window.webkitAudioContext, ti = class ti
|
|
|
3366
3366
|
n(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination));
|
|
3367
3367
|
n(this, "getDefaultDestination", () => this.context.destination);
|
|
3368
3368
|
n(this, "createSplitter", () => this.context.createChannelSplitter(2));
|
|
3369
|
-
n(this, "resume", () =>
|
|
3369
|
+
n(this, "resume", () => E(this, null, function* () {
|
|
3370
3370
|
try {
|
|
3371
|
-
return yield Promise.race([this.context.resume(),
|
|
3371
|
+
return yield Promise.race([this.context.resume(), zn(1e3, lr())]);
|
|
3372
3372
|
} catch (t) {
|
|
3373
3373
|
throw this.suspend().catch(le), t;
|
|
3374
3374
|
}
|
|
3375
3375
|
}));
|
|
3376
|
-
n(this, "suspend", () =>
|
|
3376
|
+
n(this, "suspend", () => E(this, null, function* () {
|
|
3377
3377
|
var t;
|
|
3378
3378
|
yield (t = this.context.suspend()) != null ? t : Promise.resolve();
|
|
3379
3379
|
}));
|
|
@@ -3399,7 +3399,7 @@ const Ia = () => window.AudioContext || window.webkitAudioContext, ti = class ti
|
|
|
3399
3399
|
}
|
|
3400
3400
|
};
|
|
3401
3401
|
n(ti, "CHECK_INTERVAL", 1e3);
|
|
3402
|
-
let
|
|
3402
|
+
let Wi = ti;
|
|
3403
3403
|
const ii = class ii extends Pe {
|
|
3404
3404
|
constructor(t, s, { muted: r, reInitWhenStuck: o }) {
|
|
3405
3405
|
super();
|
|
@@ -3427,7 +3427,7 @@ const ii = class ii extends Pe {
|
|
|
3427
3427
|
n(this, "reInitWhenStuck");
|
|
3428
3428
|
n(this, "ignoreSuspendCalls", !1);
|
|
3429
3429
|
n(this, "isActivated", !1);
|
|
3430
|
-
n(this, "unload", () =>
|
|
3430
|
+
n(this, "unload", () => E(this, null, function* () {
|
|
3431
3431
|
var t, s;
|
|
3432
3432
|
(t = this.gainNode) == null || t.disconnect(), yield (s = this.audio) == null ? void 0 : s.unload(), this.reset(), this.audio = void 0, this.gainNode = void 0;
|
|
3433
3433
|
}));
|
|
@@ -3436,7 +3436,7 @@ const ii = class ii extends Pe {
|
|
|
3436
3436
|
});
|
|
3437
3437
|
n(this, "unsuspend", () => {
|
|
3438
3438
|
var t;
|
|
3439
|
-
this.setGain(this._volume), this.ignoreSuspendCalls = !!this.audio, (t = this.audio) == null || t.suspend().then(() =>
|
|
3439
|
+
this.setGain(this._volume), this.ignoreSuspendCalls = !!this.audio, (t = this.audio) == null || t.suspend().then(() => E(this, null, function* () {
|
|
3440
3440
|
yield this.resume(), this.ignoreSuspendCalls = !1;
|
|
3441
3441
|
})).catch(() => {
|
|
3442
3442
|
this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
|
|
@@ -3487,7 +3487,7 @@ const ii = class ii extends Pe {
|
|
|
3487
3487
|
}
|
|
3488
3488
|
});
|
|
3489
3489
|
// Left empty since we don't do anything without user input
|
|
3490
|
-
n(this, "play", () =>
|
|
3490
|
+
n(this, "play", () => E(this, null, function* () {
|
|
3491
3491
|
this.audio = this.getAudioContext(), yield this.resume();
|
|
3492
3492
|
}));
|
|
3493
3493
|
n(this, "pause", () => {
|
|
@@ -3495,7 +3495,7 @@ const ii = class ii extends Pe {
|
|
|
3495
3495
|
n(this, "flushBuffer", () => {
|
|
3496
3496
|
this.unplayedBufferSources.items().forEach(([t, s]) => s.stop()), this.index = 0;
|
|
3497
3497
|
});
|
|
3498
|
-
n(this, "resume", () =>
|
|
3498
|
+
n(this, "resume", () => E(this, null, function* () {
|
|
3499
3499
|
var t;
|
|
3500
3500
|
if (!this._userProvidedMuted)
|
|
3501
3501
|
try {
|
|
@@ -3510,7 +3510,7 @@ const ii = class ii extends Pe {
|
|
|
3510
3510
|
n(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext());
|
|
3511
3511
|
n(this, "setupContext", () => {
|
|
3512
3512
|
var t, s, r;
|
|
3513
|
-
return (t = this.audio) == null || t.unload(), this.audio = new
|
|
3513
|
+
return (t = this.audio) == null || t.unload(), this.audio = new Wi(), this.audio.on("state", (o) => {
|
|
3514
3514
|
this.logger.info("AudioContext state change", { state: o }), o === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", o);
|
|
3515
3515
|
}), this.audio.on("stuck", () => {
|
|
3516
3516
|
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(le), this.emit("stuck"));
|
|
@@ -3571,7 +3571,7 @@ const ii = class ii extends Pe {
|
|
|
3571
3571
|
n(ii, "create", (t, s, r) => new ii(t, s, r));
|
|
3572
3572
|
let Ht = ii;
|
|
3573
3573
|
var Be;
|
|
3574
|
-
class
|
|
3574
|
+
class on {
|
|
3575
3575
|
constructor() {
|
|
3576
3576
|
w(this, Be, []);
|
|
3577
3577
|
S(this, Be, []);
|
|
@@ -3626,7 +3626,7 @@ class Ba {
|
|
|
3626
3626
|
throw new Error("Failed to create audio tag");
|
|
3627
3627
|
}
|
|
3628
3628
|
}
|
|
3629
|
-
var Rt, ue, j, He, ee,
|
|
3629
|
+
var Rt, ue, j, He, ee, an, Ke, cn;
|
|
3630
3630
|
class Ra {
|
|
3631
3631
|
constructor() {
|
|
3632
3632
|
w(this, ee);
|
|
@@ -3653,7 +3653,7 @@ class Ra {
|
|
|
3653
3653
|
}
|
|
3654
3654
|
render(e, t = !1) {
|
|
3655
3655
|
const s = d(this, Rt).flatMap((c) => c.text.split(`
|
|
3656
|
-
`).flatMap((u) => F(this, ee,
|
|
3656
|
+
`).flatMap((u) => F(this, ee, cn).call(this, u, e.width)).map((u) => {
|
|
3657
3657
|
F(this, ee, Ke).call(this);
|
|
3658
3658
|
const l = d(this, j).measureText(u);
|
|
3659
3659
|
return {
|
|
@@ -3666,17 +3666,17 @@ class Ra {
|
|
|
3666
3666
|
};
|
|
3667
3667
|
})), r = Math.max(...s.map((c) => c.size.width)), o = s.reduce((c, { size: h }) => c + h.height, 0) + (s.length - 1) * this.config.lineGap;
|
|
3668
3668
|
let a = 0;
|
|
3669
|
-
F(this, ee,
|
|
3669
|
+
F(this, ee, an).call(this, r, o), d(this, j).clearRect(0, 0, d(this, ue).width, d(this, ue).height);
|
|
3670
3670
|
for (const { size: c, text: h } of s)
|
|
3671
3671
|
F(this, ee, Ke).call(this), d(this, j).fillStyle = this.config.backgroundColor, d(this, j).fillRect(0, a, c.width, c.height), F(this, ee, Ke).call(this), d(this, j).fillText(h, this.config.textPadding, a + this.config.textPadding), a += c.height + this.config.lineGap;
|
|
3672
3672
|
t && (d(this, j).strokeStyle = "red", d(this, j).strokeRect(0, 0, e.width, d(this, ue).height));
|
|
3673
3673
|
}
|
|
3674
3674
|
}
|
|
3675
|
-
Rt = new WeakMap(), ue = new WeakMap(), j = new WeakMap(), He = new WeakMap(), ee = new WeakSet(),
|
|
3675
|
+
Rt = new WeakMap(), ue = new WeakMap(), j = new WeakMap(), He = new WeakMap(), ee = new WeakSet(), an = function(e, t) {
|
|
3676
3676
|
d(this, ue).width = e * d(this, He), d(this, ue).height = t * d(this, He), d(this, j).scale(d(this, He), d(this, He)), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
|
|
3677
3677
|
}, Ke = function() {
|
|
3678
3678
|
d(this, j).fillStyle = "white", d(this, j).textAlign = "left", d(this, j).textBaseline = "top", d(this, j).font = `${this.config.fontSize} sans-serif`;
|
|
3679
|
-
},
|
|
3679
|
+
}, cn = function(e, t) {
|
|
3680
3680
|
const s = [], r = e.split(" ");
|
|
3681
3681
|
let o = "";
|
|
3682
3682
|
for (; r.length > 0; ) {
|
|
@@ -3713,7 +3713,7 @@ void main() {
|
|
|
3713
3713
|
texture_coordinate = position;
|
|
3714
3714
|
gl_Position = model * vec4(position, 0.0, 1.0);
|
|
3715
3715
|
}
|
|
3716
|
-
`,
|
|
3716
|
+
`, Cs = (i, e) => {
|
|
3717
3717
|
let t = i.getContext("webgl", e);
|
|
3718
3718
|
if (t || (t = i.getContext("experimental-webgl", e)), !t)
|
|
3719
3719
|
throw new T("Failed to create webgl context", {
|
|
@@ -3741,7 +3741,7 @@ void main() {
|
|
|
3741
3741
|
code: "failed_to_create_texture"
|
|
3742
3742
|
});
|
|
3743
3743
|
return i.bindTexture(i.TEXTURE_2D, e), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MAG_FILTER, i.NEAREST), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_MIN_FILTER, i.NEAREST), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE), e;
|
|
3744
|
-
},
|
|
3744
|
+
}, Is = (i, e) => {
|
|
3745
3745
|
const t = i.createBuffer();
|
|
3746
3746
|
if (!t)
|
|
3747
3747
|
throw new T("Failed to create buffer", {
|
|
@@ -3749,7 +3749,7 @@ void main() {
|
|
|
3749
3749
|
code: "failed_to_create_buffer"
|
|
3750
3750
|
});
|
|
3751
3751
|
return i.bindBuffer(i.ARRAY_BUFFER, t), i.bufferData(i.ARRAY_BUFFER, e.buffer, i.STATIC_DRAW), t;
|
|
3752
|
-
},
|
|
3752
|
+
}, Xi = (i, e, t) => {
|
|
3753
3753
|
const s = i.createProgram();
|
|
3754
3754
|
if (!s)
|
|
3755
3755
|
throw new T("Failed to create program", {
|
|
@@ -3765,12 +3765,12 @@ void main() {
|
|
|
3765
3765
|
}
|
|
3766
3766
|
return s;
|
|
3767
3767
|
};
|
|
3768
|
-
var si,
|
|
3768
|
+
var si, B, kt, Pt, xt, Re, ut, dn, hn, ni;
|
|
3769
3769
|
class xa {
|
|
3770
3770
|
constructor(e) {
|
|
3771
3771
|
w(this, ut);
|
|
3772
3772
|
w(this, si, 96);
|
|
3773
|
-
w(this,
|
|
3773
|
+
w(this, B);
|
|
3774
3774
|
w(this, kt);
|
|
3775
3775
|
w(this, Pt);
|
|
3776
3776
|
w(this, xt);
|
|
@@ -3795,31 +3795,31 @@ class xa {
|
|
|
3795
3795
|
0,
|
|
3796
3796
|
1
|
|
3797
3797
|
]);
|
|
3798
|
-
S(this,
|
|
3798
|
+
S(this, B, e), S(this, kt, _e(e)), S(this, Pt, et(e, e.FRAGMENT_SHADER, ka)), S(this, xt, et(e, e.VERTEX_SHADER, Pa)), S(this, Re, Xi(e, d(this, xt), d(this, Pt))), this.subtitleRenderer.config.fontSize = "64px";
|
|
3799
3799
|
}
|
|
3800
3800
|
setActiveCues(e, t) {
|
|
3801
3801
|
this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
|
|
3802
3802
|
}
|
|
3803
3803
|
render(e) {
|
|
3804
3804
|
const t = this.subtitleRenderer.canvas, s = (e.padding + d(this, si)) * window.devicePixelRatio;
|
|
3805
|
-
t.width !== 0 && (d(this,
|
|
3806
|
-
d(this,
|
|
3805
|
+
t.width !== 0 && (d(this, B).useProgram(d(this, Re)), F(this, ut, dn).call(this), F(this, ut, hn).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + s) / e.height)), d(this, B).uniform1i(d(this, B).getUniformLocation(d(this, Re), "texture"), 4), d(this, B).activeTexture(d(this, B).TEXTURE4), d(this, B).bindTexture(d(this, B).TEXTURE_2D, d(this, kt)), d(this, B).enable(d(this, B).BLEND), d(this, B).blendFunc(d(this, B).SRC_ALPHA, d(this, B).ONE_MINUS_SRC_ALPHA), d(this, B).texImage2D(
|
|
3806
|
+
d(this, B).TEXTURE_2D,
|
|
3807
3807
|
0,
|
|
3808
|
-
d(this,
|
|
3809
|
-
d(this,
|
|
3810
|
-
d(this,
|
|
3808
|
+
d(this, B).RGBA,
|
|
3809
|
+
d(this, B).RGBA,
|
|
3810
|
+
d(this, B).UNSIGNED_BYTE,
|
|
3811
3811
|
t
|
|
3812
|
-
), d(this,
|
|
3812
|
+
), d(this, B).texParameteri(d(this, B).TEXTURE_2D, d(this, B).TEXTURE_MAG_FILTER, d(this, B).LINEAR), d(this, B).drawArrays(d(this, B).TRIANGLE_STRIP, 0, 4));
|
|
3813
3813
|
}
|
|
3814
3814
|
}
|
|
3815
|
-
si = new WeakMap(),
|
|
3816
|
-
const e = d(this,
|
|
3817
|
-
d(this,
|
|
3818
|
-
},
|
|
3819
|
-
const o = d(this,
|
|
3820
|
-
d(this,
|
|
3815
|
+
si = new WeakMap(), B = new WeakMap(), kt = new WeakMap(), Pt = new WeakMap(), xt = new WeakMap(), Re = new WeakMap(), ut = new WeakSet(), dn = function() {
|
|
3816
|
+
const e = d(this, B).getAttribLocation(d(this, Re), "position");
|
|
3817
|
+
d(this, B).enableVertexAttribArray(e), d(this, B).vertexAttribPointer(e, 2, d(this, B).FLOAT, !1, 0, 0);
|
|
3818
|
+
}, hn = function(e, t, s, r) {
|
|
3819
|
+
const o = d(this, B).getUniformLocation(d(this, Re), "model");
|
|
3820
|
+
d(this, B).uniformMatrix4fv(o, !1, d(this, ni).call(this, e, t, s, r));
|
|
3821
3821
|
}, ni = new WeakMap();
|
|
3822
|
-
const
|
|
3822
|
+
const Bs = `
|
|
3823
3823
|
precision mediump float;
|
|
3824
3824
|
uniform sampler2D y_texture;
|
|
3825
3825
|
uniform sampler2D u_texture;
|
|
@@ -3835,7 +3835,7 @@ void main() {
|
|
|
3835
3835
|
|
|
3836
3836
|
gl_FragColor = vec4(y, u, v, 1) * conversion;
|
|
3837
3837
|
}
|
|
3838
|
-
`,
|
|
3838
|
+
`, Rs = `
|
|
3839
3839
|
attribute vec2 position;
|
|
3840
3840
|
varying vec2 texture_coordinate;
|
|
3841
3841
|
uniform mat4 model;
|
|
@@ -3844,12 +3844,12 @@ void main() {
|
|
|
3844
3844
|
texture_coordinate = position;
|
|
3845
3845
|
gl_Position = model * vec4(position, 0.0, 1.0);
|
|
3846
3846
|
}
|
|
3847
|
-
`,
|
|
3847
|
+
`, ks = {
|
|
3848
3848
|
width: 256,
|
|
3849
3849
|
codedWidth: 256,
|
|
3850
3850
|
height: 144,
|
|
3851
3851
|
codedHeight: 144
|
|
3852
|
-
},
|
|
3852
|
+
}, Ps = {
|
|
3853
3853
|
preserveDrawingBuffer: !1,
|
|
3854
3854
|
alpha: !1,
|
|
3855
3855
|
depth: !1,
|
|
@@ -3860,11 +3860,11 @@ void main() {
|
|
|
3860
3860
|
constructor() {
|
|
3861
3861
|
super();
|
|
3862
3862
|
n(this, "canvas", document.createElement("canvas"));
|
|
3863
|
-
n(this, "context",
|
|
3864
|
-
n(this, "pixelShader", et(this.context, this.context.FRAGMENT_SHADER,
|
|
3865
|
-
n(this, "vertexShader", et(this.context, this.context.VERTEX_SHADER,
|
|
3866
|
-
n(this, "buffer",
|
|
3867
|
-
n(this, "program",
|
|
3863
|
+
n(this, "context", Cs(this.canvas, Ps));
|
|
3864
|
+
n(this, "pixelShader", et(this.context, this.context.FRAGMENT_SHADER, Bs));
|
|
3865
|
+
n(this, "vertexShader", et(this.context, this.context.VERTEX_SHADER, Rs));
|
|
3866
|
+
n(this, "buffer", Is(this.context, wt.SQUARE_VERTICES));
|
|
3867
|
+
n(this, "program", Xi(this.context, this.vertexShader, this.pixelShader));
|
|
3868
3868
|
n(this, "textures", {
|
|
3869
3869
|
y: _e(this.context),
|
|
3870
3870
|
u: _e(this.context),
|
|
@@ -3872,21 +3872,21 @@ void main() {
|
|
|
3872
3872
|
});
|
|
3873
3873
|
// Lazy loaded when needed
|
|
3874
3874
|
n(this, "textRenderer");
|
|
3875
|
-
n(this, "size",
|
|
3875
|
+
n(this, "size", ks);
|
|
3876
3876
|
n(this, "onContextLost", (t) => {
|
|
3877
3877
|
this.textRenderer = void 0;
|
|
3878
3878
|
const s = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
|
|
3879
3879
|
this.emit("context lost", pr(s)), t.preventDefault();
|
|
3880
3880
|
});
|
|
3881
3881
|
n(this, "onContextRestored", () => {
|
|
3882
|
-
this.emit("context restored"), this.context =
|
|
3882
|
+
this.emit("context restored"), this.context = Cs(this.canvas, Ps), this.pixelShader = et(this.context, this.context.FRAGMENT_SHADER, Bs), this.vertexShader = et(this.context, this.context.VERTEX_SHADER, Rs), this.buffer = Is(this.context, wt.SQUARE_VERTICES), this.program = Xi(this.context, this.vertexShader, this.pixelShader), this.textures = {
|
|
3883
3883
|
y: _e(this.context),
|
|
3884
3884
|
u: _e(this.context),
|
|
3885
3885
|
v: _e(this.context)
|
|
3886
3886
|
}, this.load();
|
|
3887
3887
|
});
|
|
3888
3888
|
n(this, "load", () => {
|
|
3889
|
-
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(
|
|
3889
|
+
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(ks), this.context.uniform1i(this.context.getUniformLocation(this.program, "y_texture"), 0), this.context.uniform1i(this.context.getUniformLocation(this.program, "u_texture"), 1), this.context.uniform1i(this.context.getUniformLocation(this.program, "v_texture"), 2), this.setConversionMatrix(this.rec709());
|
|
3890
3890
|
});
|
|
3891
3891
|
n(this, "unload", () => {
|
|
3892
3892
|
var s;
|
|
@@ -3996,13 +3996,13 @@ void main() {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
};
|
|
3998
3998
|
n(wt, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
|
|
3999
|
-
let
|
|
3999
|
+
let Gi = wt;
|
|
4000
4000
|
const ri = class ri {
|
|
4001
4001
|
constructor(e, t, s, r) {
|
|
4002
4002
|
n(this, "oldTimestampLimit", 400);
|
|
4003
4003
|
n(this, "pool");
|
|
4004
4004
|
n(this, "logger");
|
|
4005
|
-
n(this, "videoRenderer", new
|
|
4005
|
+
n(this, "videoRenderer", new Gi());
|
|
4006
4006
|
n(this, "renderQueue", []);
|
|
4007
4007
|
n(this, "clockSource");
|
|
4008
4008
|
n(this, "isFirstFrame", !0);
|
|
@@ -4076,7 +4076,7 @@ const oi = class oi {
|
|
|
4076
4076
|
n(this, "_isPaused", !1);
|
|
4077
4077
|
n(this, "isDisconnected", !1);
|
|
4078
4078
|
n(this, "timers", new q());
|
|
4079
|
-
n(this, "textTracks", new
|
|
4079
|
+
n(this, "textTracks", new on());
|
|
4080
4080
|
n(this, "playbackRate");
|
|
4081
4081
|
n(this, "reset", () => {
|
|
4082
4082
|
});
|
|
@@ -4110,7 +4110,7 @@ const oi = class oi {
|
|
|
4110
4110
|
try {
|
|
4111
4111
|
this.audioPlayer.onDecodedFrame(e);
|
|
4112
4112
|
} catch (t) {
|
|
4113
|
-
t instanceof Error && this.emitter.emit("error",
|
|
4113
|
+
t instanceof Error && this.emitter.emit("error", zs(!1, t));
|
|
4114
4114
|
}
|
|
4115
4115
|
this.videoPlayer.onDecodedFrame(e);
|
|
4116
4116
|
});
|
|
@@ -4191,7 +4191,7 @@ const ai = class ai {
|
|
|
4191
4191
|
n(this, "_userProvidedMuted", !1);
|
|
4192
4192
|
n(this, "timers", new q());
|
|
4193
4193
|
n(this, "volumeState");
|
|
4194
|
-
n(this, "textTracks", new
|
|
4194
|
+
n(this, "textTracks", new on());
|
|
4195
4195
|
n(this, "reset", () => {
|
|
4196
4196
|
});
|
|
4197
4197
|
n(this, "load", () => {
|
|
@@ -4233,7 +4233,7 @@ const ai = class ai {
|
|
|
4233
4233
|
try {
|
|
4234
4234
|
this.audioPlayer.onDecodedFrame(e);
|
|
4235
4235
|
} catch (t) {
|
|
4236
|
-
t instanceof Error && this.emitter.emit("error",
|
|
4236
|
+
t instanceof Error && this.emitter.emit("error", zs(!1, t));
|
|
4237
4237
|
}
|
|
4238
4238
|
this.videoPlayer.onDecodedFrame(e);
|
|
4239
4239
|
});
|
|
@@ -4325,7 +4325,7 @@ const ai = class ai {
|
|
|
4325
4325
|
};
|
|
4326
4326
|
n(ai, "create", (e, t, s, r, o) => new ai(e, t, s, r, o));
|
|
4327
4327
|
let qi = ai;
|
|
4328
|
-
const Ua = () => (i) =>
|
|
4328
|
+
const Ua = () => (i) => un(i.buffered.start(0), i.buffered.end(i.buffered.length - 1)), un = (i, e) => (t) => t.remove(Math.max(0, i), Math.min(Number.POSITIVE_INFINITY, e)), xs = (i) => (e) => e.appendBuffer(i), Ma = (i) => (e) => e.changeType(i), La = (i) => (e) => i(e);
|
|
4329
4329
|
class _a {
|
|
4330
4330
|
constructor(e) {
|
|
4331
4331
|
n(this, "commandQueue", []);
|
|
@@ -4337,10 +4337,10 @@ class _a {
|
|
|
4337
4337
|
});
|
|
4338
4338
|
n(this, "appendBuffer", (e, t) => new Promise((s, r) => {
|
|
4339
4339
|
if (t && this.currentInit !== t) {
|
|
4340
|
-
const a = new qe(
|
|
4340
|
+
const a = new qe(xs(t), s, r);
|
|
4341
4341
|
this.commandQueue.push(a), this.currentInit = t;
|
|
4342
4342
|
}
|
|
4343
|
-
const o = new qe(
|
|
4343
|
+
const o = new qe(xs(e), s, r);
|
|
4344
4344
|
this.commandQueue.push(o), this.handleQueue();
|
|
4345
4345
|
}));
|
|
4346
4346
|
n(this, "execute", (e) => new Promise((t, s) => {
|
|
@@ -4356,7 +4356,7 @@ class _a {
|
|
|
4356
4356
|
this.commandQueue.push(r), this.handleQueue();
|
|
4357
4357
|
}));
|
|
4358
4358
|
n(this, "removeBuffer", (e, t) => new Promise((s, r) => {
|
|
4359
|
-
const o = new qe(
|
|
4359
|
+
const o = new qe(un(e, t), s, r);
|
|
4360
4360
|
this.commandQueue.push(o), this.handleQueue();
|
|
4361
4361
|
}));
|
|
4362
4362
|
n(this, "flush", () => new Promise((e, t) => {
|
|
@@ -4366,7 +4366,7 @@ class _a {
|
|
|
4366
4366
|
this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
|
|
4367
4367
|
}
|
|
4368
4368
|
}
|
|
4369
|
-
class
|
|
4369
|
+
class ln extends Pe {
|
|
4370
4370
|
constructor() {
|
|
4371
4371
|
super();
|
|
4372
4372
|
n(this, "MediaSource", vt());
|
|
@@ -4424,11 +4424,11 @@ class mn extends Pe {
|
|
|
4424
4424
|
this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
|
|
4425
4425
|
}
|
|
4426
4426
|
}
|
|
4427
|
-
n(
|
|
4427
|
+
n(ln, "isTypeSupported", (t) => {
|
|
4428
4428
|
var s, r;
|
|
4429
4429
|
return (r = (s = vt()) == null ? void 0 : s.isTypeSupported(t)) != null ? r : !1;
|
|
4430
4430
|
});
|
|
4431
|
-
class
|
|
4431
|
+
class mn {
|
|
4432
4432
|
constructor() {
|
|
4433
4433
|
n(this, "initSegments", /* @__PURE__ */ new Map());
|
|
4434
4434
|
n(this, "set", (e, t, s) => {
|
|
@@ -4442,23 +4442,24 @@ class fn {
|
|
|
4442
4442
|
});
|
|
4443
4443
|
}
|
|
4444
4444
|
}
|
|
4445
|
-
function Da(i, { mediaSource: e, mimeType: t }) {
|
|
4445
|
+
function Da(i, { mediaSource: e, mimeType: t, codec: s }) {
|
|
4446
4446
|
return R(A({}, i), {
|
|
4447
4447
|
state: "initialized",
|
|
4448
4448
|
mimeType: t,
|
|
4449
|
+
codec: s,
|
|
4449
4450
|
sourceBuffer: e.addSourceBuffer(t),
|
|
4450
4451
|
isWorkingOnPendingSamples: !1,
|
|
4451
4452
|
sequenceNumber: 0,
|
|
4452
4453
|
lastBufferCleanupTime: Date.now()
|
|
4453
4454
|
});
|
|
4454
4455
|
}
|
|
4455
|
-
function
|
|
4456
|
+
function Us({
|
|
4456
4457
|
initSegments: i,
|
|
4457
4458
|
pendingSamples: e
|
|
4458
4459
|
}) {
|
|
4459
4460
|
return {
|
|
4460
4461
|
state: "uninitialized",
|
|
4461
|
-
initSegments: i != null ? i : new
|
|
4462
|
+
initSegments: i != null ? i : new mn(),
|
|
4462
4463
|
sequenceNumber: 0,
|
|
4463
4464
|
isWorkingOnPendingSamples: !1,
|
|
4464
4465
|
hasFirstSync: !!e,
|
|
@@ -4476,7 +4477,7 @@ const ci = class ci {
|
|
|
4476
4477
|
n(this, "timers", q.create());
|
|
4477
4478
|
n(this, "emitter");
|
|
4478
4479
|
n(this, "mediaElement");
|
|
4479
|
-
n(this, "mediaSource", new
|
|
4480
|
+
n(this, "mediaSource", new ln());
|
|
4480
4481
|
n(this, "trackContexts", /* @__PURE__ */ new Map());
|
|
4481
4482
|
n(this, "autoRecoverFromMediaErrors", !0);
|
|
4482
4483
|
n(this, "quotaErrorCount", 0);
|
|
@@ -4518,10 +4519,10 @@ const ci = class ci {
|
|
|
4518
4519
|
const r = (c = (a = e.get(s)) == null ? void 0 : a.pendingSamples) != null ? c : [], o = (h = e.get(s)) == null ? void 0 : h.initSegments;
|
|
4519
4520
|
for (; r.length > 0 && !((u = r[0]) != null && u.isSync); )
|
|
4520
4521
|
r.shift();
|
|
4521
|
-
this.trackContexts.set(s,
|
|
4522
|
+
this.trackContexts.set(s, Us({ pendingSamples: r, initSegments: o }));
|
|
4522
4523
|
});
|
|
4523
4524
|
});
|
|
4524
|
-
n(this, "setSourceBuffers", (e) =>
|
|
4525
|
+
n(this, "setSourceBuffers", (e) => E(this, null, function* () {
|
|
4525
4526
|
if (this.mediaSource.isClosed()) {
|
|
4526
4527
|
this.pendingTracksToAddSourceBuffers = e;
|
|
4527
4528
|
return;
|
|
@@ -4540,9 +4541,13 @@ const ci = class ci {
|
|
|
4540
4541
|
}
|
|
4541
4542
|
for (const s of e) {
|
|
4542
4543
|
let r = this.trackContexts.get(s.type);
|
|
4543
|
-
r || (r =
|
|
4544
|
+
r || (r = Us({ pendingSamples: [], initSegments: new mn() }), this.trackContexts.set(s.type, r)), r.state === "initialized" ? s.mimeType !== r.mimeType && (yield r.sourceBuffer.changeType(s.mimeType)) : this.trackContexts.set(
|
|
4544
4545
|
s.type,
|
|
4545
|
-
Da(r, {
|
|
4546
|
+
Da(r, {
|
|
4547
|
+
mimeType: s.mimeType,
|
|
4548
|
+
mediaSource: this.mediaSource,
|
|
4549
|
+
codec: s.codec
|
|
4550
|
+
})
|
|
4546
4551
|
);
|
|
4547
4552
|
}
|
|
4548
4553
|
}));
|
|
@@ -4571,9 +4576,9 @@ const ci = class ci {
|
|
|
4571
4576
|
throw _t(e.type, e.renditionId);
|
|
4572
4577
|
s.state === "initialized" && (s.mimeType = t);
|
|
4573
4578
|
const r = Qo(e.codec, e.data, e.timescale);
|
|
4574
|
-
r && s.initSegments.set(e.channelId, e.renditionId, r);
|
|
4579
|
+
r && s.initSegments.set(e.channelId, e.renditionId, new Uint8Array(r));
|
|
4575
4580
|
});
|
|
4576
|
-
n(this, "append", (e, t) =>
|
|
4581
|
+
n(this, "append", (e, t) => E(this, null, function* () {
|
|
4577
4582
|
var c;
|
|
4578
4583
|
const s = e[0];
|
|
4579
4584
|
if (!s)
|
|
@@ -4582,11 +4587,11 @@ const ci = class ci {
|
|
|
4582
4587
|
if (this.mediaSource.isClosed())
|
|
4583
4588
|
return;
|
|
4584
4589
|
if (!o)
|
|
4585
|
-
throw
|
|
4590
|
+
throw hr(s.renditionId, s.channelId);
|
|
4586
4591
|
if (!r)
|
|
4587
4592
|
throw _t(s.type, s.renditionId);
|
|
4588
4593
|
if (r.state === "uninitialized")
|
|
4589
|
-
throw
|
|
4594
|
+
throw ur(s.type, s.renditionId);
|
|
4590
4595
|
if (t) {
|
|
4591
4596
|
const h = (s.timestamp + ((c = s.compositionTimeOffset) != null ? c : 0)) / s.timescale;
|
|
4592
4597
|
yield r.sourceBuffer.removeBuffer(h, Number.POSITIVE_INFINITY);
|
|
@@ -4596,30 +4601,60 @@ const ci = class ci {
|
|
|
4596
4601
|
yield r.sourceBuffer.changeType(r.mimeType);
|
|
4597
4602
|
} catch (l) {
|
|
4598
4603
|
}
|
|
4599
|
-
yield r.sourceBuffer.appendBuffer(o);
|
|
4604
|
+
"fragmented" in s || (yield r.sourceBuffer.appendBuffer(o));
|
|
4600
4605
|
}
|
|
4601
4606
|
const a = Math.max(0, s.timestamp / s.timescale - this.maxSecondsInBuffer);
|
|
4602
4607
|
a > 0 && Date.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = Date.now(), yield r.sourceBuffer.removeBuffer(0, a + 10));
|
|
4603
4608
|
try {
|
|
4604
4609
|
let h = r.sequenceNumber;
|
|
4605
|
-
|
|
4606
|
-
|
|
4610
|
+
if ("fragmented" in s)
|
|
4611
|
+
for (const u of e)
|
|
4612
|
+
"initData" in u && (yield r.sourceBuffer.appendBuffer(u.data, u.initData));
|
|
4613
|
+
else {
|
|
4614
|
+
const u = Zo(e, h++);
|
|
4615
|
+
yield r.sourceBuffer.appendBuffer(u);
|
|
4616
|
+
}
|
|
4617
|
+
r.sequenceNumber = h, r.consecutiveQuotaExceededErrorCount = 0, r.successfulAppendCalls++;
|
|
4607
4618
|
} catch (h) {
|
|
4608
4619
|
throw h instanceof DOMException && (h.code === DOMException.QUOTA_EXCEEDED_ERR ? (this.quotaErrorCount++, r.consecutiveQuotaExceededErrorCount++, this.logger.error("quota exceeded error", { error: h }), r.pendingSamples.unshift(...e)) : this.mediaElement.error && r.pendingSamples.unshift(...e)), h;
|
|
4609
4620
|
}
|
|
4610
4621
|
}));
|
|
4611
|
-
n(this, "onFragment", ({
|
|
4612
|
-
|
|
4613
|
-
|
|
4622
|
+
n(this, "onFragment", ({
|
|
4623
|
+
fragment: e,
|
|
4624
|
+
mimeType: t,
|
|
4625
|
+
codec: s,
|
|
4626
|
+
channelId: r,
|
|
4627
|
+
renditionId: o
|
|
4628
|
+
}) => {
|
|
4629
|
+
const a = e.mediaType(), c = e.rawBytes(), h = e.header().rawBytes(), u = e.baseMediaDecodeTime(), l = e.timescale(), m = e.duration(), g = a === "video" ? e.startsWithKeyframe() : !0, p = e.compositionTimeOffset(0);
|
|
4630
|
+
if (a === "text") {
|
|
4631
|
+
this.logger.warn("Skipping unexpected text fragment");
|
|
4632
|
+
return;
|
|
4633
|
+
}
|
|
4634
|
+
if (!s) {
|
|
4635
|
+
this.logger.warn("Skipping fragment with no codec");
|
|
4614
4636
|
return;
|
|
4615
|
-
const s = this.trackContexts.get(t);
|
|
4616
|
-
if (!s)
|
|
4617
|
-
throw _t(t);
|
|
4618
|
-
if (!this.mediaSource.isClosed()) {
|
|
4619
|
-
if (s.state === "uninitialized")
|
|
4620
|
-
throw fs(t);
|
|
4621
|
-
s.sourceBuffer.appendBuffer(e.rawBytes(), e.header().rawBytes()).catch((r) => console.log(r));
|
|
4622
4637
|
}
|
|
4638
|
+
const y = this.trackContexts.get(a);
|
|
4639
|
+
if (!y)
|
|
4640
|
+
throw _t(a);
|
|
4641
|
+
y.state === "initialized" && t && (y.mimeType = t, y.initSegments.set(r, o, h));
|
|
4642
|
+
const U = {
|
|
4643
|
+
fragmented: !0,
|
|
4644
|
+
type: a,
|
|
4645
|
+
data: c,
|
|
4646
|
+
initData: h,
|
|
4647
|
+
timestamp: u,
|
|
4648
|
+
duration: m,
|
|
4649
|
+
timescale: l,
|
|
4650
|
+
channelId: r,
|
|
4651
|
+
renditionId: o,
|
|
4652
|
+
isSync: g,
|
|
4653
|
+
codec: s,
|
|
4654
|
+
fragment: e,
|
|
4655
|
+
compositionTimeOffset: p
|
|
4656
|
+
};
|
|
4657
|
+
this.onCodedSample(U);
|
|
4623
4658
|
});
|
|
4624
4659
|
n(this, "onCodedSample", (e) => {
|
|
4625
4660
|
if (e.duration === 0)
|
|
@@ -4631,7 +4666,7 @@ const ci = class ci {
|
|
|
4631
4666
|
if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
|
|
4632
4667
|
this.hasAddedInitialPosterFrame = !1;
|
|
4633
4668
|
const s = A({}, e);
|
|
4634
|
-
s.timestamp = 0, t.pendingSamples.push(s);
|
|
4669
|
+
"fragment" in s ? (s.fragment = s.fragment.clone(), s.fragment.updateBaseMediaDecodeTime(0), s.data = s.fragment.rawBytes()) : s.timestamp = 0, t.pendingSamples.push(s);
|
|
4635
4670
|
}
|
|
4636
4671
|
t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || Oa(t, this.append, this.maxChunkSize).catch((s) => {
|
|
4637
4672
|
if (t.isWorkingOnPendingSamples = !1, s instanceof Error) {
|
|
@@ -4655,12 +4690,12 @@ const ci = class ci {
|
|
|
4655
4690
|
n(this, "onSourceEnded", () => {
|
|
4656
4691
|
const { error: e } = this.mediaElement;
|
|
4657
4692
|
if (e) {
|
|
4658
|
-
const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, s =
|
|
4693
|
+
const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, s = cr(t, e);
|
|
4659
4694
|
if (this.logger.error("MediaElement error", { error: s }), this.emitter.emit("error", s), !s.isFatal()) {
|
|
4660
4695
|
this.logger.info("Re-opening MediaSource"), this.emitter.emit("recovered from media error", { error: s, count: this.recoveredFromErrorCount }), this.recoveredFromErrorCount++;
|
|
4661
4696
|
const r = !this.mediaElement.paused, o = [];
|
|
4662
4697
|
this.trackContexts.forEach((a, c) => {
|
|
4663
|
-
a.state === "initialized" && o.push({ type: c, mimeType: a.mimeType });
|
|
4698
|
+
a.state === "initialized" && o.push({ type: c, mimeType: a.mimeType, codec: a.codec });
|
|
4664
4699
|
}), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = o, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), r && this.mediaElement.play().catch(le);
|
|
4665
4700
|
}
|
|
4666
4701
|
}
|
|
@@ -4674,12 +4709,12 @@ n(ci, "create", (e, t, s) => {
|
|
|
4674
4709
|
return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), r.mediaSource.attach(s), r;
|
|
4675
4710
|
});
|
|
4676
4711
|
let Zi = ci;
|
|
4677
|
-
const
|
|
4712
|
+
const Ms = (i, e) => {
|
|
4678
4713
|
var c;
|
|
4679
|
-
const t = i.renditionId !== e.renditionId, s = i.channelId !== e.channelId, r = ((c = i.timestamp) != null ? c : 0) > e.timestamp, o = i.type === "video" && e.type === "video" && i.levelIdc !== e.levelIdc;
|
|
4714
|
+
const t = i.renditionId !== e.renditionId, s = i.channelId !== e.channelId, r = ((c = i.timestamp) != null ? c : 0) > e.timestamp, o = i.type === "video" && e.type === "video" && "levelIdc" in i && "levelIdc" in e && i.levelIdc !== e.levelIdc;
|
|
4680
4715
|
let a = !1;
|
|
4681
|
-
return i.type === "video" && e.type === "video" && (a = e.width !== i.width || e.height !== i.height), s || t || r || a || o;
|
|
4682
|
-
}, Oa = (i, e, t) =>
|
|
4716
|
+
return i.type === "video" && e.type === "video" && "width" in i && "width" in e && (a = e.width !== i.width || e.height !== i.height), s || t || r || a || o;
|
|
4717
|
+
}, Oa = (i, e, t) => E(void 0, null, function* () {
|
|
4683
4718
|
for (i.isWorkingOnPendingSamples = !0; i.pendingSamples.length > 0; ) {
|
|
4684
4719
|
const s = [];
|
|
4685
4720
|
let r = 0;
|
|
@@ -4687,7 +4722,7 @@ const Ls = (i, e) => {
|
|
|
4687
4722
|
r = c;
|
|
4688
4723
|
const h = i.pendingSamples[c], u = i.pendingSamples[c + 1];
|
|
4689
4724
|
if (h && (s.push(h), u)) {
|
|
4690
|
-
if (
|
|
4725
|
+
if (Ms(h, u))
|
|
4691
4726
|
break;
|
|
4692
4727
|
const l = (h.timestamp + h.duration) / h.timescale;
|
|
4693
4728
|
if (u.timestamp / u.timescale - l > 0.1)
|
|
@@ -4699,7 +4734,7 @@ const Ls = (i, e) => {
|
|
|
4699
4734
|
const o = s[0];
|
|
4700
4735
|
if (!o)
|
|
4701
4736
|
break;
|
|
4702
|
-
const a = i.previousSample ?
|
|
4737
|
+
const a = i.previousSample ? Ms(i.previousSample, o) : !0;
|
|
4703
4738
|
yield e(s, a), i.pendingSamples = i.pendingSamples.slice(r + 1), i.previousSample = s[s.length - 1];
|
|
4704
4739
|
}
|
|
4705
4740
|
i.isWorkingOnPendingSamples = !1;
|
|
@@ -4728,16 +4763,16 @@ const Ls = (i, e) => {
|
|
|
4728
4763
|
isPictureInPictureActive: this.isPictureInPictureActive()
|
|
4729
4764
|
}));
|
|
4730
4765
|
/* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-call */
|
|
4731
|
-
n(this, "requestStandardPictureInPicture", () =>
|
|
4766
|
+
n(this, "requestStandardPictureInPicture", () => E(this, null, function* () {
|
|
4732
4767
|
return yield this.element.requestPictureInPicture();
|
|
4733
4768
|
}));
|
|
4734
|
-
n(this, "exitStandardPictureInPicture", () =>
|
|
4769
|
+
n(this, "exitStandardPictureInPicture", () => E(this, null, function* () {
|
|
4735
4770
|
return yield document.exitPictureInPicture();
|
|
4736
4771
|
}));
|
|
4737
4772
|
n(this, "isStandardPictureInPictureSupported", () => !!this.element && !!this.element.requestPictureInPicture && !!document.pictureInPictureEnabled);
|
|
4738
4773
|
n(this, "isStandardPictureInPictureActive", () => !!this.element && !!document.pictureInPictureElement);
|
|
4739
4774
|
n(this, "isWebkitPresentationModeActive", () => !!this.element && this.element.webkitPresentationMode === "picture-in-picture");
|
|
4740
|
-
n(this, "requestWebkitPresentationMode", (e) =>
|
|
4775
|
+
n(this, "requestWebkitPresentationMode", (e) => E(this, null, function* () {
|
|
4741
4776
|
return this.element.webkitSetPresentationMode(e), Promise.resolve();
|
|
4742
4777
|
}));
|
|
4743
4778
|
n(this, "isWebkitPresentationModeSupported", () => !!this.element && !!this.element.webkitSetPresentationMode);
|
|
@@ -4874,8 +4909,8 @@ const Ki = () => ({
|
|
|
4874
4909
|
const t = this.timeSpentBuffering(), s = this.timeActive(), r = this.bufferingRatios(), o = this.activeRatios(), a = ((u = (h = e.video) == null ? void 0 : h.bitRate) != null ? u : 0) + ((m = (l = e.audio) == null ? void 0 : l.bitRate) != null ? m : 0), c = t / s;
|
|
4875
4910
|
return Object.keys(this.metrics.levels).map((g) => parseInt(g, 10)).filter((g) => g >= a).reduce(
|
|
4876
4911
|
(g, p) => {
|
|
4877
|
-
var
|
|
4878
|
-
return ((
|
|
4912
|
+
var y, U;
|
|
4913
|
+
return ((y = o.get(p.toString())) != null ? y : 0) - ((U = r.get(p.toString())) != null ? U : 0) * c + g;
|
|
4879
4914
|
},
|
|
4880
4915
|
0
|
|
4881
4916
|
);
|
|
@@ -4889,12 +4924,12 @@ const Ki = () => ({
|
|
|
4889
4924
|
fatalQosCount: this.fatalQosCount
|
|
4890
4925
|
}));
|
|
4891
4926
|
n(this, "onRenditionLevelChanged", (e) => {
|
|
4892
|
-
var o, a, c, h, u, l, m, g, p,
|
|
4893
|
-
const t = ((c = (a = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : a.bitRate) != null ? c : 0) + ((l = (u = (h = e.from) == null ? void 0 : h.audio) == null ? void 0 : u.bitRate) != null ? l : 0), s = ((p = (g = (m = e.to) == null ? void 0 : m.video) == null ? void 0 : g.bitRate) != null ? p : 0) + ((N = (
|
|
4927
|
+
var o, a, c, h, u, l, m, g, p, y, U, N, X, L;
|
|
4928
|
+
const t = ((c = (a = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : a.bitRate) != null ? c : 0) + ((l = (u = (h = e.from) == null ? void 0 : h.audio) == null ? void 0 : u.bitRate) != null ? l : 0), s = ((p = (g = (m = e.to) == null ? void 0 : m.video) == null ? void 0 : g.bitRate) != null ? p : 0) + ((N = (U = (y = e.to) == null ? void 0 : y.audio) == null ? void 0 : U.bitRate) != null ? N : 0);
|
|
4894
4929
|
this.logger.info("rendition level changed", { fromLevel: t, toLevel: s }), this.metrics.general.activeRanges.length === 0 && this.setActive(), e.from && e.to && (t < s ? this.metrics.general.upgradesFromLevel.push(Date.now()) : this.metrics.general.downgradesFromLevel.push(Date.now()));
|
|
4895
4930
|
let r = !1;
|
|
4896
4931
|
if (e.from) {
|
|
4897
|
-
const _ = (
|
|
4932
|
+
const _ = (X = this.metrics.levels[t]) != null ? X : Ki();
|
|
4898
4933
|
t < s ? _.upgradesFromLevel.push(Date.now()) : _.downgradesFromLevel.push(Date.now()), Le(_.activeRanges);
|
|
4899
4934
|
const Z = _.bufferingRanges[_.bufferingRanges.length - 1];
|
|
4900
4935
|
r = !!Z && !Z.end, Le(_.bufferingRanges), this.metrics.levels[t] = _;
|
|
@@ -4924,7 +4959,7 @@ const Ki = () => ({
|
|
|
4924
4959
|
const t = this.metrics.levels[(s = this.currentLevel) != null ? s : 0];
|
|
4925
4960
|
t && (t.decodeRate = e);
|
|
4926
4961
|
});
|
|
4927
|
-
n(this, "calculateLinearRegression", () =>
|
|
4962
|
+
n(this, "calculateLinearRegression", () => Fn(
|
|
4928
4963
|
this.bufferFullness.items().map((e, t) => ({
|
|
4929
4964
|
x: t,
|
|
4930
4965
|
y: e
|
|
@@ -5141,7 +5176,7 @@ const At = (i) => JSON.parse(JSON.stringify(i)), Na = 1e4, mi = class mi {
|
|
|
5141
5176
|
};
|
|
5142
5177
|
n(mi, "create", (e, t, s) => new mi(e, s, t));
|
|
5143
5178
|
let ts = mi;
|
|
5144
|
-
const
|
|
5179
|
+
const Ls = 5e3, Va = () => Ns() || pi() || Un(), _s = () => Va() ? 100 : 0, Ds = (i) => (e) => e > i, fi = class fi {
|
|
5145
5180
|
constructor(e, t, s, r, o) {
|
|
5146
5181
|
n(this, "emitter");
|
|
5147
5182
|
n(this, "logger");
|
|
@@ -5173,8 +5208,8 @@ const _s = 5e3, Va = () => Vs() || pi() || Mn(), Ds = () => Va() ? 100 : 0, Os =
|
|
|
5173
5208
|
maxBehind: 50,
|
|
5174
5209
|
multiplier: 1,
|
|
5175
5210
|
maxBehindAllowed: 600,
|
|
5176
|
-
overshoot:
|
|
5177
|
-
minOvershootAllowed:
|
|
5211
|
+
overshoot: _s(),
|
|
5212
|
+
minOvershootAllowed: _s(),
|
|
5178
5213
|
maxOvershootAllowed: 500
|
|
5179
5214
|
});
|
|
5180
5215
|
/**
|
|
@@ -5270,7 +5305,7 @@ const _s = 5e3, Va = () => Vs() || pi() || Mn(), Ds = () => Va() ? 100 : 0, Os =
|
|
|
5270
5305
|
var r;
|
|
5271
5306
|
if (!e.channelId)
|
|
5272
5307
|
throw new Error("Sample must be assigned to a channel");
|
|
5273
|
-
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 -
|
|
5308
|
+
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Ls);
|
|
5274
5309
|
const t = e.type === "video" && e.isSync;
|
|
5275
5310
|
if (this.currentChannelId !== e.channelId) {
|
|
5276
5311
|
let o = Number.MAX_SAFE_INTEGER;
|
|
@@ -5293,7 +5328,7 @@ const _s = 5e3, Va = () => Vs() || pi() || Mn(), Ds = () => Va() ? 100 : 0, Os =
|
|
|
5293
5328
|
const s = t.mediaType();
|
|
5294
5329
|
if (!s)
|
|
5295
5330
|
throw new Error("Fragment must have a media type");
|
|
5296
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
5331
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Ls);
|
|
5297
5332
|
const r = t.mediaType() === "video" && t.startsWithKeyframe();
|
|
5298
5333
|
this.currentChannelId !== e ? (console.assert(this.highestSeenTimestamps.size !== 0, "no known timestamps"), this.highestSeenTimestamps.forEach((c) => {
|
|
5299
5334
|
}), this.currentChannelId = e) : (r || this.timeshiftOnAudio) && this.tryTimeshiftSync();
|
|
@@ -5339,7 +5374,7 @@ const _s = 5e3, Va = () => Vs() || pi() || Mn(), Ds = () => Va() ? 100 : 0, Os =
|
|
|
5339
5374
|
}
|
|
5340
5375
|
if (!this.timestampOffset)
|
|
5341
5376
|
return;
|
|
5342
|
-
const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, s = this.timeShiftAdjustments.filter(
|
|
5377
|
+
const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, s = this.timeShiftAdjustments.filter(Ds(t)).length;
|
|
5343
5378
|
if (s && this.timeshiftSync.multiplier > 2)
|
|
5344
5379
|
return this.logger.debug("Too many diff timeShifts within sliding window", {
|
|
5345
5380
|
timeShiftsCooldownMs: t,
|
|
@@ -5367,7 +5402,7 @@ const _s = 5e3, Va = () => Vs() || pi() || Mn(), Ds = () => Va() ? 100 : 0, Os =
|
|
|
5367
5402
|
const e = (c = this.drift) != null ? c : 0;
|
|
5368
5403
|
if (e < 0 && -e < this.currentSyncMaxAhead() || e > 0 && e < this.currentSyncMaxBehind() || Math.abs(e) < 1 || !this.isSeekCooldownExpired())
|
|
5369
5404
|
return;
|
|
5370
|
-
const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, s = this.driftAdjustments.filter(
|
|
5405
|
+
const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, s = this.driftAdjustments.filter(Ds(t)).length;
|
|
5371
5406
|
if (s && this.syncMaxBehindMultiplier > 2)
|
|
5372
5407
|
return this.logger.debug("Too many diff adjustments within sliding window", {
|
|
5373
5408
|
adjustmentsCooldownMs: t,
|
|
@@ -5496,7 +5531,7 @@ const za = {
|
|
|
5496
5531
|
n(this, "getStatistics", () => ({
|
|
5497
5532
|
errorCount: this.errorCount
|
|
5498
5533
|
}));
|
|
5499
|
-
n(this, "send", (e) =>
|
|
5534
|
+
n(this, "send", (e) => E(this, null, function* () {
|
|
5500
5535
|
if (this.options.enabled && !(this.retries >= this.options.maxRetries) && !this.unsentLines.isEmpty()) {
|
|
5501
5536
|
this.logger.debug("Sending telemetry", { lines: this.unsentLines.items() });
|
|
5502
5537
|
try {
|
|
@@ -5511,7 +5546,7 @@ const za = {
|
|
|
5511
5546
|
this.parentContext.connectionState === "connected" ? this.emitter.emit("send signal", {
|
|
5512
5547
|
type: "telemetry",
|
|
5513
5548
|
body: t
|
|
5514
|
-
}) : yield
|
|
5549
|
+
}) : yield Cn(new URL(this.options.url), { body: t, headers: { "Content-Type": "text/plain" } });
|
|
5515
5550
|
break;
|
|
5516
5551
|
}
|
|
5517
5552
|
this.retries = 0, this.unsentLines.clear();
|
|
@@ -5543,7 +5578,7 @@ const za = {
|
|
|
5543
5578
|
}
|
|
5544
5579
|
};
|
|
5545
5580
|
n(Ai, "create", (e, t, s, r) => new Ai(e, t, s, r));
|
|
5546
|
-
let
|
|
5581
|
+
let Wt = Ai;
|
|
5547
5582
|
const gi = class gi {
|
|
5548
5583
|
constructor(e, t, s) {
|
|
5549
5584
|
n(this, "logger");
|
|
@@ -5560,19 +5595,19 @@ const gi = class gi {
|
|
|
5560
5595
|
}
|
|
5561
5596
|
};
|
|
5562
5597
|
n(gi, "create", (e, t, s) => new gi(e, t, s));
|
|
5563
|
-
let
|
|
5598
|
+
let Xt = gi;
|
|
5564
5599
|
const Ha = 6, Qa = (i) => {
|
|
5565
5600
|
let e = [i], t = 0, s = 0, r = !1;
|
|
5566
5601
|
const o = (c, h) => {
|
|
5567
|
-
var N,
|
|
5568
|
-
c.flags && pt(c.flags) && (t = (N = c.compositionTimeOffset) != null ? N : 0), c.timestamp += t, c.compositionTimeOffset = ((
|
|
5569
|
-
const u = c.timestamp / c.timescale, m = h.flags && pt(h.flags) ? (L = h.compositionTimeOffset) != null ? L : 0 : t, p = (h.timestamp + m) / h.timescale,
|
|
5570
|
-
return
|
|
5602
|
+
var N, X, L;
|
|
5603
|
+
c.flags && pt(c.flags) && (t = (N = c.compositionTimeOffset) != null ? N : 0), c.timestamp += t, c.compositionTimeOffset = ((X = c.compositionTimeOffset) != null ? X : 0) - t;
|
|
5604
|
+
const u = c.timestamp / c.timescale, m = h.flags && pt(h.flags) ? (L = h.compositionTimeOffset) != null ? L : 0 : t, p = (h.timestamp + m) / h.timescale, y = Math.max(0, Math.round((p - u) * c.timescale));
|
|
5605
|
+
return y > 0 && (s = y), R(A({}, c), {
|
|
5571
5606
|
/*
|
|
5572
5607
|
During resync timeshifts we may end up with negative durations (normalized to 0 above) which is not allowed in mse (the MseModule
|
|
5573
5608
|
drops the frame) so we use the last known duration instead. This is not ideal but it's better than dropping the frame.
|
|
5574
5609
|
*/
|
|
5575
|
-
duration:
|
|
5610
|
+
duration: y > 0 ? y : s
|
|
5576
5611
|
});
|
|
5577
5612
|
};
|
|
5578
5613
|
return (c, h = !1) => {
|
|
@@ -5592,7 +5627,7 @@ const Ha = 6, Qa = (i) => {
|
|
|
5592
5627
|
}
|
|
5593
5628
|
return e.push(c), [];
|
|
5594
5629
|
};
|
|
5595
|
-
},
|
|
5630
|
+
}, Wa = (i, e, t) => {
|
|
5596
5631
|
if (st(e))
|
|
5597
5632
|
return A(R(A({}, i), {
|
|
5598
5633
|
type: "video",
|
|
@@ -5616,7 +5651,7 @@ const Ha = 6, Qa = (i) => {
|
|
|
5616
5651
|
duration: 0
|
|
5617
5652
|
});
|
|
5618
5653
|
};
|
|
5619
|
-
class
|
|
5654
|
+
class Xa {
|
|
5620
5655
|
constructor() {
|
|
5621
5656
|
n(this, "highEntropyValues");
|
|
5622
5657
|
var e;
|
|
@@ -5638,20 +5673,20 @@ class Ga {
|
|
|
5638
5673
|
g.sort((L, _) => L.brand.localeCompare(_.brand));
|
|
5639
5674
|
const p = [...(c = this.highEntropyValues.fullVersionList) != null ? c : []];
|
|
5640
5675
|
p.sort((L, _) => L.brand.localeCompare(_.brand));
|
|
5641
|
-
const
|
|
5676
|
+
const y = p.map((L) => L.version), U = g.map((L) => L.brand), N = g.map((L) => L.version), X = parseInt((u = (h = this.highEntropyValues.platformVersion) == null ? void 0 : h.split(".")[0]) != null ? u : m);
|
|
5642
5677
|
return A({
|
|
5643
5678
|
userAgentLegacy: window.navigator.userAgent,
|
|
5644
5679
|
ua: {
|
|
5645
5680
|
browser: {
|
|
5646
|
-
brands:
|
|
5647
|
-
fullVersionBrands:
|
|
5681
|
+
brands: U,
|
|
5682
|
+
fullVersionBrands: y,
|
|
5648
5683
|
majorVersions: N
|
|
5649
5684
|
},
|
|
5650
5685
|
device: this.highEntropyValues.model || "Other",
|
|
5651
5686
|
os: {
|
|
5652
5687
|
family: this.highEntropyValues.platform || "Other",
|
|
5653
5688
|
version: (l = this.highEntropyValues.platformVersion) != null ? l : m,
|
|
5654
|
-
major_version: Number.isFinite(
|
|
5689
|
+
major_version: Number.isFinite(X) ? X : 0
|
|
5655
5690
|
}
|
|
5656
5691
|
}
|
|
5657
5692
|
}, r);
|
|
@@ -5661,7 +5696,7 @@ class Ga {
|
|
|
5661
5696
|
}, r);
|
|
5662
5697
|
}
|
|
5663
5698
|
}
|
|
5664
|
-
const
|
|
5699
|
+
const Ga = (i) => {
|
|
5665
5700
|
if (typeof i != "object" || i === null)
|
|
5666
5701
|
throw new Error("not an object");
|
|
5667
5702
|
if (!("video" in i))
|
|
@@ -5672,7 +5707,7 @@ const Wa = (i) => {
|
|
|
5672
5707
|
throw new Error("missing channelId");
|
|
5673
5708
|
return !0;
|
|
5674
5709
|
};
|
|
5675
|
-
var Qe, Y,
|
|
5710
|
+
var Qe, Y, We;
|
|
5676
5711
|
const $ = class $ extends Pe {
|
|
5677
5712
|
constructor(t) {
|
|
5678
5713
|
var xe, Ue;
|
|
@@ -5682,7 +5717,7 @@ const $ = class $ extends Pe {
|
|
|
5682
5717
|
* Picture in picture
|
|
5683
5718
|
*/
|
|
5684
5719
|
n(this, "pictureInPicture");
|
|
5685
|
-
n(this, "browser",
|
|
5720
|
+
n(this, "browser", Dn());
|
|
5686
5721
|
n(this, "options");
|
|
5687
5722
|
n(this, "element");
|
|
5688
5723
|
n(this, "playbackSource");
|
|
@@ -5698,7 +5733,7 @@ const $ = class $ extends Pe {
|
|
|
5698
5733
|
n(this, "latestEmittedLanguages", []);
|
|
5699
5734
|
n(this, "wakeLock");
|
|
5700
5735
|
n(this, "pool", new os($.MAX_POOL_SIZE));
|
|
5701
|
-
n(this, "userAgentInformation", new
|
|
5736
|
+
n(this, "userAgentInformation", new Xa());
|
|
5702
5737
|
n(this, "encryptedMediaExtensions");
|
|
5703
5738
|
w(this, Qe, 0);
|
|
5704
5739
|
w(this, Y, []);
|
|
@@ -5706,7 +5741,7 @@ const $ = class $ extends Pe {
|
|
|
5706
5741
|
n(this, "sizes", /* @__PURE__ */ new Map());
|
|
5707
5742
|
n(this, "isSuspended", !0);
|
|
5708
5743
|
n(this, "disconnectTimeout");
|
|
5709
|
-
w(this,
|
|
5744
|
+
w(this, We);
|
|
5710
5745
|
/**
|
|
5711
5746
|
* Attaches the video view to a DOM element. The Vindral video view will be sized to fill this element while
|
|
5712
5747
|
* maintaining the correct aspect ratio.
|
|
@@ -5770,16 +5805,16 @@ const $ = class $ extends Pe {
|
|
|
5770
5805
|
media: this.options.get("media"),
|
|
5771
5806
|
drm: this.options.get("drm")
|
|
5772
5807
|
}));
|
|
5773
|
-
n(this, "onConnectInfo", (t) =>
|
|
5808
|
+
n(this, "onConnectInfo", (t) => E(this, null, function* () {
|
|
5774
5809
|
var u;
|
|
5775
5810
|
this.sessionId = us();
|
|
5776
5811
|
const s = this.modules.subscription.getTargetSubscription(), r = t.channels.find((l) => l.channelId === s.channelId);
|
|
5777
5812
|
if (this.emitter.emit("connect info", t), this._channels = t.channels, this.updateTextTracks((u = r == null ? void 0 : r.renditions) != null ? u : []), !this.textTrack && this.options.get("textTrack") && (this.textTrack = this.options.get("textTrack")), yield Promise.all(
|
|
5778
|
-
t.channels.map((l) =>
|
|
5813
|
+
t.channels.map((l) => E(this, null, function* () {
|
|
5779
5814
|
l.overrides && this.options.addOverrides(l.channelId, l.overrides), l.renditions = yield this.filterRenditions(l.renditions), this.modules.renditions.setRenditions(l.channelId, l.renditions);
|
|
5780
5815
|
}))
|
|
5781
5816
|
), !r)
|
|
5782
|
-
throw
|
|
5817
|
+
throw Hs("external");
|
|
5783
5818
|
const o = this.options.getOverride(
|
|
5784
5819
|
"sizeBasedResolutionCapEnabled",
|
|
5785
5820
|
this.channelId
|
|
@@ -5841,17 +5876,17 @@ const $ = class $ extends Pe {
|
|
|
5841
5876
|
r.endTime * 1e3 < t - 2e3 && s.removeCue(r);
|
|
5842
5877
|
});
|
|
5843
5878
|
});
|
|
5844
|
-
n(this, "filterRenditions", (t) =>
|
|
5879
|
+
n(this, "filterRenditions", (t) => E(this, null, function* () {
|
|
5845
5880
|
const s = yield Promise.all(
|
|
5846
|
-
t.map((c) =>
|
|
5881
|
+
t.map((c) => E(this, null, function* () {
|
|
5847
5882
|
var l, m, g;
|
|
5848
5883
|
if (nt(c))
|
|
5849
5884
|
return !0;
|
|
5850
5885
|
if (!st(c) || !this.isSupportedVideoCodecProfile(c.codec, c.codecString))
|
|
5851
5886
|
return !1;
|
|
5852
5887
|
if (!this.willUseMediaSource()) {
|
|
5853
|
-
const p = this.options.get("advanced"),
|
|
5854
|
-
return c.bitRate <=
|
|
5888
|
+
const p = this.options.get("advanced"), y = (l = p.wasmDecodingConstraint.bitRate) != null ? l : Number.MAX_SAFE_INTEGER, U = (m = p.wasmDecodingConstraint.width) != null ? m : Number.MAX_SAFE_INTEGER, N = (g = p.wasmDecodingConstraint.height) != null ? g : Number.MAX_SAFE_INTEGER;
|
|
5889
|
+
return c.bitRate <= y && c.width <= U && c.height <= N;
|
|
5855
5890
|
}
|
|
5856
5891
|
const h = yield da(c);
|
|
5857
5892
|
if (!h.supported || c.codec == "av1" && !h.smooth && !h.powerEfficient)
|
|
@@ -5879,13 +5914,13 @@ const $ = class $ extends Pe {
|
|
|
5879
5914
|
$.INITIAL_MAX_BIT_RATE,
|
|
5880
5915
|
s,
|
|
5881
5916
|
this.targetSubscription.audio.bitRate
|
|
5882
|
-
), a = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), c = this.supportedAudioCodecs(), h = t.renditions.filter(nt), u = t.renditions.filter(st), l = c.find((
|
|
5917
|
+
), a = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), c = this.supportedAudioCodecs(), h = t.renditions.filter(nt), u = t.renditions.filter(st), l = c.find((y) => h.find((U) => U.codec === y) !== void 0), m = a.find((y) => u.find((U) => U.codec === y) !== void 0), g = h.map((y) => y.language);
|
|
5883
5918
|
if (this.logger.debug("supported and selected codecs", { audioCodecs: c, videoCodecs: a, audioCodec: l, videoCodec: m }), m) {
|
|
5884
|
-
const
|
|
5919
|
+
const y = this.options.get("maxSize");
|
|
5885
5920
|
this.modules.subscription.setVideoConstraint(A({
|
|
5886
5921
|
codec: m,
|
|
5887
5922
|
bitRate: this.abrEnabled ? r : this.options.get("maxVideoBitRate")
|
|
5888
|
-
},
|
|
5923
|
+
}, y));
|
|
5889
5924
|
}
|
|
5890
5925
|
l && (this.modules.subscription.setAudioConstraint({
|
|
5891
5926
|
codec: l,
|
|
@@ -5915,16 +5950,18 @@ const $ = class $ extends Pe {
|
|
|
5915
5950
|
const t = [];
|
|
5916
5951
|
return (this.browser.supportsMp4Opus && this.options.get("mseOpusEnabled") || !this.willUseMediaSource()) && t.push("opus"), this.willUseMediaSource() && t.push("aac"), t;
|
|
5917
5952
|
});
|
|
5918
|
-
n(this, "initializeDecodingModule", () =>
|
|
5953
|
+
n(this, "initializeDecodingModule", () => E(this, null, function* () {
|
|
5919
5954
|
var r, o;
|
|
5920
5955
|
const t = this.currentRenditionLevel, s = [];
|
|
5921
5956
|
if (!t)
|
|
5922
5957
|
throw new T("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
|
|
5923
5958
|
if (t != null && t.video && s.push({
|
|
5924
5959
|
type: "video",
|
|
5925
|
-
mimeType: $e(t.video)
|
|
5960
|
+
mimeType: $e(t.video),
|
|
5961
|
+
codec: t.video.codec
|
|
5926
5962
|
}), t != null && t.audio && s.push({
|
|
5927
5963
|
type: "audio",
|
|
5964
|
+
codec: t.audio.codec,
|
|
5928
5965
|
mimeType: $e(t.audio)
|
|
5929
5966
|
}), s.length === 0)
|
|
5930
5967
|
throw new T("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
|
|
@@ -5945,7 +5982,7 @@ const $ = class $ extends Pe {
|
|
|
5945
5982
|
* Fully unloads the instance. This disconnects the clients and stops any background tasks.
|
|
5946
5983
|
* This client instance can not be used after this has been called.
|
|
5947
5984
|
*/
|
|
5948
|
-
n(this, "unload", () =>
|
|
5985
|
+
n(this, "unload", () => E(this, null, function* () {
|
|
5949
5986
|
var t, s, r;
|
|
5950
5987
|
this.logger.debug("Unloading modules..."), yield Promise.all(Object.values(this.modules).map((o) => o == null ? void 0 : o.unload())), (t = this.wakeLock) == null || t.unload(), this.pool = new os($.MAX_POOL_SIZE), (r = (s = this.playbackSource).unload) == null || r.call(s), this.element.remove(), this.emitter.reset(), this.encryptedMediaExtensions.unload(), this.reset(), this.logger.debug("Unloaded modules");
|
|
5951
5988
|
}));
|
|
@@ -6015,7 +6052,7 @@ const $ = class $ extends Pe {
|
|
|
6015
6052
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
6016
6053
|
return A({
|
|
6017
6054
|
uptime: Date.now() - this.createdAt,
|
|
6018
|
-
version: "4.0.0-
|
|
6055
|
+
version: "4.0.0-110-ge5c8e532",
|
|
6019
6056
|
clientId: this.clientId,
|
|
6020
6057
|
sessionId: this.sessionId,
|
|
6021
6058
|
channelId: this.channelId,
|
|
@@ -6047,7 +6084,7 @@ const $ = class $ extends Pe {
|
|
|
6047
6084
|
if (s && t)
|
|
6048
6085
|
return t - s;
|
|
6049
6086
|
});
|
|
6050
|
-
this.options = new aa(A(A({},
|
|
6087
|
+
this.options = new aa(A(A({}, Wn), Sr(t)));
|
|
6051
6088
|
const s = ["localhost", "127.0.0.1"];
|
|
6052
6089
|
t.telemetryEnabled === void 0 && s.includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
6053
6090
|
const r = {
|
|
@@ -6083,23 +6120,23 @@ const $ = class $ extends Pe {
|
|
|
6083
6120
|
this,
|
|
6084
6121
|
this.options.get("minBufferTime")
|
|
6085
6122
|
);
|
|
6086
|
-
this.encryptedMediaExtensions = new
|
|
6123
|
+
this.encryptedMediaExtensions = new ws(
|
|
6087
6124
|
this.emitter,
|
|
6088
6125
|
this.logger.createContext("EncryptedMediaExtensions"),
|
|
6089
6126
|
(xe = t.drm) == null ? void 0 : xe.headers,
|
|
6090
6127
|
(Ue = t.drm) == null ? void 0 : Ue.queryParams
|
|
6091
6128
|
);
|
|
6092
|
-
const p = zi.create(this.emitter),
|
|
6093
|
-
let N,
|
|
6129
|
+
const p = zi.create(this.emitter), y = this.options.get("poster"), U = y === !0 ? this.getThumbnailUrl() : y || void 0;
|
|
6130
|
+
let N, X, L;
|
|
6094
6131
|
if (this.willUseMediaSource()) {
|
|
6095
6132
|
const f = new _i({
|
|
6096
6133
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
6097
6134
|
autoplay: !1,
|
|
6098
6135
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
6099
6136
|
logger: this.logger.createContext("MediaElement"),
|
|
6100
|
-
poster:
|
|
6137
|
+
poster: U
|
|
6101
6138
|
});
|
|
6102
|
-
f.on("buffer state", (v) => this.emitter.emit("buffer state", v)), f.on("needs user input", (v) => this.emitter.emit("needs user input", v)), f.on("volume state", (v) => this.emit("volume state", v)), f.on("media element state", (v) => this.onMediaElementState(v)), this.element = f.element, this.playbackSource = f,
|
|
6139
|
+
f.on("buffer state", (v) => this.emitter.emit("buffer state", v)), f.on("needs user input", (v) => this.emitter.emit("needs user input", v)), f.on("volume state", (v) => this.emit("volume state", v)), f.on("media element state", (v) => this.onMediaElementState(v)), this.element = f.element, this.playbackSource = f, ws.isSupported() && this.encryptedMediaExtensions.attach(f.element), N = Zi.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (X = Xt.create(this.logger.createContext("UnpauseModule"), f, p)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: f.element });
|
|
6103
6140
|
} else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
|
|
6104
6141
|
const f = qi.create(
|
|
6105
6142
|
this.emitter,
|
|
@@ -6109,10 +6146,10 @@ const $ = class $ extends Pe {
|
|
|
6109
6146
|
{
|
|
6110
6147
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
6111
6148
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
6112
|
-
poster:
|
|
6149
|
+
poster: U
|
|
6113
6150
|
}
|
|
6114
6151
|
), v = f.element();
|
|
6115
|
-
this.element = v.element, this.playbackSource = f, L = f, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (
|
|
6152
|
+
this.element = v.element, this.playbackSource = f, L = f, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (X = Xt.create(this.logger.createContext("UnpauseModule"), v, p));
|
|
6116
6153
|
} else {
|
|
6117
6154
|
const f = ji.create(
|
|
6118
6155
|
this.emitter,
|
|
@@ -6140,7 +6177,7 @@ const $ = class $ extends Pe {
|
|
|
6140
6177
|
this.playbackSource,
|
|
6141
6178
|
g,
|
|
6142
6179
|
this.willUseMediaSource() && !_
|
|
6143
|
-
), te = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), me = new URL("/telemetry", te).toString(), Mt =
|
|
6180
|
+
), te = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), me = new URL("/telemetry", te).toString(), Mt = Wt.create(
|
|
6144
6181
|
this.logger.createContext("TelemetryModule"),
|
|
6145
6182
|
this.emitter,
|
|
6146
6183
|
{
|
|
@@ -6189,13 +6226,13 @@ const $ = class $ extends Pe {
|
|
|
6189
6226
|
renditions: l,
|
|
6190
6227
|
qualityOfService: m,
|
|
6191
6228
|
mseModule: N,
|
|
6192
|
-
unpause:
|
|
6229
|
+
unpause: X,
|
|
6193
6230
|
canvasModule: L
|
|
6194
6231
|
}, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (f) => {
|
|
6195
6232
|
var v;
|
|
6196
6233
|
f && typeof this.disconnectTimeout == "number" && (this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = void 0), f ? this.playbackSource.isPaused || (this.logger.debug("Unsuspending"), this.unsuspend()) : (this.logger.debug("Suspending"), this.suspend(), this.modules.decoder ? this.options.get("iosBackgroundPlayEnabled") ? (this.modules.decoder.unsuspend(), (v = this.modules.canvasModule) == null || v.unsuspend()) : this.modules.connection.disconnect() : (this.disconnectTimeout && this.modules.timer.clearInterval(this.disconnectTimeout), this.disconnectTimeout = this.modules.timer.setInterval(() => {
|
|
6197
|
-
const
|
|
6198
|
-
this.connectionState === "connected" &&
|
|
6234
|
+
const M = this.playbackState === "paused" || this.muted;
|
|
6235
|
+
this.connectionState === "connected" && M && (this.emitter.emit("flush buffers"), this.modules.connection.disconnect("Page inactive timeout"));
|
|
6199
6236
|
}, $.DISCONNECT_TIMEOUT)));
|
|
6200
6237
|
});
|
|
6201
6238
|
let fe;
|
|
@@ -6222,86 +6259,86 @@ const $ = class $ extends Pe {
|
|
|
6222
6259
|
}), this.emitter.on("recovered from media error", () => {
|
|
6223
6260
|
this.modules.adaptivity.reset(this.targetBufferTime * 2);
|
|
6224
6261
|
}), this.emitter.once("connect info", (f) => {
|
|
6225
|
-
var
|
|
6226
|
-
const
|
|
6227
|
-
f.telemetry && ((
|
|
6262
|
+
var P, C, I;
|
|
6263
|
+
const M = ((C = (P = f.telemetry) == null ? void 0 : P.probability) != null ? C : 1) >= Math.random();
|
|
6264
|
+
f.telemetry && ((I = this.modules.telemetry) == null || I.unload(), this.modules.telemetry = Wt.create(
|
|
6228
6265
|
this.logger.createContext("TelemetryModule"),
|
|
6229
6266
|
this.emitter,
|
|
6230
6267
|
R(A({}, f.telemetry), {
|
|
6231
|
-
enabled: this.options.get("telemetryEnabled") &&
|
|
6268
|
+
enabled: this.options.get("telemetryEnabled") && M
|
|
6232
6269
|
}),
|
|
6233
6270
|
this
|
|
6234
6271
|
), this.modules.telemetry.load());
|
|
6235
6272
|
}), this.emitter.on("adapt level", (f) => {
|
|
6236
6273
|
var ie, O, Q, re, se;
|
|
6237
6274
|
this.logger.debug("adapt level", { direction: f });
|
|
6238
|
-
const v = this.modules.renditions.getRenditionLevels(),
|
|
6239
|
-
let
|
|
6275
|
+
const v = this.modules.renditions.getRenditionLevels(), M = this.modules.renditions.getRenditionLevel(), P = v.findIndex((V) => V === M), C = v.length - 1;
|
|
6276
|
+
let I = P;
|
|
6240
6277
|
switch (f) {
|
|
6241
6278
|
case "upgrade":
|
|
6242
6279
|
{
|
|
6243
|
-
const V = Math.min(
|
|
6244
|
-
oe &&
|
|
6280
|
+
const V = Math.min(P + 1, C), oe = v[V], fn = (ie = this.modules.connection.estimatedBandwidth) != null ? ie : ke(), An = ((Q = (O = oe == null ? void 0 : oe.audio) == null ? void 0 : O.bitRate) != null ? Q : 0) + ((se = (re = oe == null ? void 0 : oe.video) == null ? void 0 : re.bitRate) != null ? se : 0), gn = fn * 2 > An;
|
|
6281
|
+
oe && gn && this.modules.adaptivity.isQoSOk(oe) && (I = V);
|
|
6245
6282
|
}
|
|
6246
6283
|
break;
|
|
6247
6284
|
case "downgrade":
|
|
6248
|
-
|
|
6285
|
+
I = Math.max(P - 1, 0);
|
|
6249
6286
|
break;
|
|
6250
6287
|
case "double downgrade":
|
|
6251
|
-
|
|
6288
|
+
I = Math.max(P - 2, 0);
|
|
6252
6289
|
break;
|
|
6253
6290
|
case "reconnect":
|
|
6254
|
-
if (
|
|
6291
|
+
if (P === 0 || this.modules.qualityOfService.timeSpentBufferingLast(6e3) > 5e3) {
|
|
6255
6292
|
if (!this.modules.connection.lastConnectionTime || Date.now() - this.modules.connection.lastConnectionTime < this.modules.qualityOfService.fatalQosGraceTime() || this.modules.connection.getState() !== "connected")
|
|
6256
6293
|
return;
|
|
6257
6294
|
this.modules.qualityOfService.incrementFatalQosCount(), this.logger.info("Reconnecting due to poor qos"), this.modules.connection.reconnect("Fatal QOS"), this.emitter.emit("adapted level");
|
|
6258
6295
|
return;
|
|
6259
6296
|
} else
|
|
6260
|
-
|
|
6297
|
+
I = 0;
|
|
6261
6298
|
}
|
|
6262
|
-
if (
|
|
6299
|
+
if (I === P)
|
|
6263
6300
|
return;
|
|
6264
|
-
const D = v[
|
|
6301
|
+
const D = v[I];
|
|
6265
6302
|
this.alignSizeAndBitRate(R(A({}, this.targetSubscription), {
|
|
6266
6303
|
video: A(A({}, this.targetSubscription.video), D == null ? void 0 : D.video),
|
|
6267
6304
|
audio: A(A({}, this.targetSubscription.audio), D == null ? void 0 : D.audio)
|
|
6268
6305
|
})), this.emitter.emit("adapted level");
|
|
6269
6306
|
}), this.emitter.on("text track data", (f) => {
|
|
6270
|
-
const v = d(this, Y).find((
|
|
6271
|
-
if (S(this, Qe,
|
|
6307
|
+
const v = d(this, Y).find((I) => I.language === f.language), P = this.modules.sync.getTimeshiftOffset() / 1e3, C = P - d(this, Qe);
|
|
6308
|
+
if (S(this, Qe, P), v) {
|
|
6272
6309
|
if (v.cues)
|
|
6273
|
-
for (const
|
|
6274
|
-
|
|
6275
|
-
for (const
|
|
6276
|
-
const D = new VTTCue(
|
|
6310
|
+
for (const I of v.cues)
|
|
6311
|
+
I.startTime -= C, I.endTime -= C;
|
|
6312
|
+
for (const I of f.cues) {
|
|
6313
|
+
const D = new VTTCue(I.startTime - P, I.endTime - P, I.text);
|
|
6277
6314
|
v.addCue(D);
|
|
6278
6315
|
}
|
|
6279
6316
|
}
|
|
6280
6317
|
}), this.emitter.on("received signal", (f) => {
|
|
6281
|
-
var
|
|
6282
|
-
const v = f,
|
|
6318
|
+
var P;
|
|
6319
|
+
const v = f, M = this.modules.subscription.getCurrentSubscription();
|
|
6283
6320
|
switch (this.logger.debug("received", A({}, v)), v.type) {
|
|
6284
6321
|
case "client ip":
|
|
6285
6322
|
this.clientIp = v.ip;
|
|
6286
6323
|
break;
|
|
6287
6324
|
case "renditions":
|
|
6288
|
-
this.updateTextTracks(v.renditions), S(this,
|
|
6325
|
+
this.updateTextTracks(v.renditions), S(this, We, this.filterRenditions(v.renditions).then((C) => {
|
|
6289
6326
|
this.emitter.emit("renditions", {
|
|
6290
|
-
renditions:
|
|
6327
|
+
renditions: C,
|
|
6291
6328
|
channelId: this.currentSubscription.channelId
|
|
6292
6329
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
|
|
6293
6330
|
}).finally(() => {
|
|
6294
|
-
S(this,
|
|
6331
|
+
S(this, We, void 0);
|
|
6295
6332
|
}));
|
|
6296
6333
|
break;
|
|
6297
6334
|
case "subscription changed":
|
|
6298
6335
|
try {
|
|
6299
|
-
|
|
6300
|
-
} catch (
|
|
6336
|
+
Ga(v.subscription);
|
|
6337
|
+
} catch (C) {
|
|
6301
6338
|
this.emitter.emit(
|
|
6302
6339
|
"error",
|
|
6303
6340
|
new T("Subscription failed validation", {
|
|
6304
|
-
source:
|
|
6341
|
+
source: C instanceof Error ? C : void 0,
|
|
6305
6342
|
isFatal: !1,
|
|
6306
6343
|
code: "subscription_failed_validation"
|
|
6307
6344
|
})
|
|
@@ -6311,25 +6348,33 @@ const $ = class $ extends Pe {
|
|
|
6311
6348
|
reset: v.reset,
|
|
6312
6349
|
to: v.subscription,
|
|
6313
6350
|
from: this.modules.subscription.getCurrentSubscription()
|
|
6314
|
-
}), v.reset &&
|
|
6351
|
+
}), v.reset && M.channelId !== v.subscription.channelId && (this.emit("error", As(v.subscription.channelId)), this.emit("channel switch failed", { channelId: M.channelId })), this.modules.sync.timeshiftOnAudio = !((P = v.subscription.video) != null && P.codec), this.modules.adaptivity.reset();
|
|
6315
6352
|
break;
|
|
6316
6353
|
case "timing info":
|
|
6317
6354
|
this.modules.sync.updateChannelSyncInfo(v.timingInfo.channelId, v.timingInfo), this.emit("server wallclock time", v.timingInfo.wallclockTime);
|
|
6318
6355
|
break;
|
|
6319
6356
|
}
|
|
6320
6357
|
}), this.emitter.on("channel switch timeout", (f) => {
|
|
6321
|
-
this.emit("error",
|
|
6358
|
+
this.emit("error", As(f)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
|
|
6322
6359
|
}), this.emitter.on("received data", (f) => {
|
|
6323
|
-
const v = this.modules.subscription.getCurrentSubscription(),
|
|
6360
|
+
const v = this.modules.subscription.getCurrentSubscription(), M = ea(f);
|
|
6324
6361
|
if (!v) {
|
|
6325
|
-
this.logger.warn("Received unwanted message", A({},
|
|
6362
|
+
this.logger.warn("Received unwanted message", A({}, M));
|
|
6326
6363
|
return;
|
|
6327
6364
|
}
|
|
6328
|
-
Lt(R(A({},
|
|
6365
|
+
Lt(R(A({}, M), { channelId: v.channelId }));
|
|
6329
6366
|
}), this.emitter.on("received moq data", (f) => {
|
|
6330
|
-
var
|
|
6331
|
-
const v = f.payload.mediaType(),
|
|
6332
|
-
if (
|
|
6367
|
+
var I, D, ie;
|
|
6368
|
+
const v = f.payload.mediaType(), M = f.channelId, P = f.renditionId, C = this.modules.sync.processFragment(M, f.payload);
|
|
6369
|
+
if (f.switchInfo.channelId && this.modules.event.addEvent({
|
|
6370
|
+
type: "channel switch",
|
|
6371
|
+
channelId: f.switchInfo.channelId,
|
|
6372
|
+
timestamp: C.baseMediaDecodeTime() / C.timescale() * 1e3
|
|
6373
|
+
}), f.switchInfo.language && this.modules.event.addEvent({
|
|
6374
|
+
type: "language switch",
|
|
6375
|
+
language: f.switchInfo.language,
|
|
6376
|
+
timestamp: C.baseMediaDecodeTime() / C.timescale() * 1e3
|
|
6377
|
+
}), this.modules.incomingData.add(v, f.payload.rawBytes().byteLength), C.fragment().emsgs.forEach((O) => {
|
|
6333
6378
|
if (!O.presentationTime)
|
|
6334
6379
|
return;
|
|
6335
6380
|
const Q = Vr(O.data);
|
|
@@ -6340,15 +6385,15 @@ const $ = class $ extends Pe {
|
|
|
6340
6385
|
type: "metadata"
|
|
6341
6386
|
});
|
|
6342
6387
|
}), this.modules.decoder) {
|
|
6343
|
-
const O = (
|
|
6388
|
+
const O = (I = C.header().init().moov.traks[0]) == null ? void 0 : I.mdia.minf.stbl.stsd, Q = (D = O == null ? void 0 : O.avc1) == null ? void 0 : D.avcC.bytes, re = (ie = O == null ? void 0 : O.codec) != null ? ie : "h264";
|
|
6344
6389
|
if (Q) {
|
|
6345
6390
|
const se = Q.buffer.slice(Q.byteOffset, Q.byteOffset + Q.byteLength);
|
|
6346
6391
|
if (v === "text")
|
|
6347
6392
|
throw new Error("Subtitles are not supported");
|
|
6348
6393
|
this.emitter.emit("init segment", {
|
|
6349
6394
|
initSegment: {
|
|
6350
|
-
channelId:
|
|
6351
|
-
renditionId:
|
|
6395
|
+
channelId: M,
|
|
6396
|
+
renditionId: P,
|
|
6352
6397
|
data: se,
|
|
6353
6398
|
timescale: 1e3,
|
|
6354
6399
|
type: v,
|
|
@@ -6358,30 +6403,30 @@ const $ = class $ extends Pe {
|
|
|
6358
6403
|
// mediaType !== mimeType - but the sw decoder doesn't care
|
|
6359
6404
|
});
|
|
6360
6405
|
}
|
|
6361
|
-
for (let se = 0; se <
|
|
6362
|
-
const V =
|
|
6406
|
+
for (let se = 0; se < C.samplesCount(); se++) {
|
|
6407
|
+
const V = C.sample(se);
|
|
6363
6408
|
V && this.emitter.emit("coded sample", R(A({}, V), {
|
|
6364
|
-
renditionId:
|
|
6365
|
-
channelId:
|
|
6409
|
+
renditionId: P,
|
|
6410
|
+
channelId: M,
|
|
6366
6411
|
data: V.data.buffer.slice(V.data.byteOffset, V.data.byteOffset + V.data.byteLength)
|
|
6367
6412
|
}));
|
|
6368
6413
|
}
|
|
6369
6414
|
} else
|
|
6370
|
-
this.emitter.emit("fragment", { fragment:
|
|
6415
|
+
this.emitter.emit("fragment", { mimeType: f.mimeType, codec: f.codec, fragment: C, channelId: M, renditionId: P });
|
|
6371
6416
|
});
|
|
6372
6417
|
const lt = this.options.get("container");
|
|
6373
6418
|
lt && this.attach(lt), this.logger.info("Created Vindral instance", { options: this.options });
|
|
6374
|
-
const Lt = (f) =>
|
|
6419
|
+
const Lt = (f) => E(this, null, function* () {
|
|
6375
6420
|
const v = f.channelId;
|
|
6376
|
-
d(this,
|
|
6377
|
-
const
|
|
6421
|
+
d(this, We) && (yield d(this, We));
|
|
6422
|
+
const M = this.modules.renditions.getRendition(f.renditionId, v);
|
|
6378
6423
|
if (!Yo(f.flags)) {
|
|
6379
6424
|
if (Ko(f.flags)) {
|
|
6380
|
-
const
|
|
6425
|
+
const C = new TextDecoder().decode(f.payload), I = this.modules.sync.getTimeshiftOffset();
|
|
6381
6426
|
if (f.renditionId !== 0) {
|
|
6382
|
-
const D =
|
|
6427
|
+
const D = In(C);
|
|
6383
6428
|
if (D && D.language !== void 0) {
|
|
6384
|
-
const O = new na().parse(D.content || ""), Q =
|
|
6429
|
+
const O = new na().parse(D.content || ""), Q = I / 1e3, re = d(this, Y).find((V) => V.language === D.language), se = Q - d(this, Qe);
|
|
6385
6430
|
if (S(this, Qe, Q), re) {
|
|
6386
6431
|
if (re.cues)
|
|
6387
6432
|
for (const V of re.cues)
|
|
@@ -6395,37 +6440,37 @@ const $ = class $ extends Pe {
|
|
|
6395
6440
|
} else
|
|
6396
6441
|
this.modules.event.addEvent({
|
|
6397
6442
|
timestamp: f.timestamp / f.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
|
|
6398
|
-
content:
|
|
6443
|
+
content: C,
|
|
6399
6444
|
type: "metadata"
|
|
6400
6445
|
});
|
|
6401
|
-
} else if (
|
|
6402
|
-
const
|
|
6403
|
-
if (
|
|
6446
|
+
} else if (M != null && M.codec) {
|
|
6447
|
+
const P = Bn(M.codec);
|
|
6448
|
+
if (P === "text")
|
|
6404
6449
|
throw new Error("Subtitles are not supported");
|
|
6405
|
-
if (this.modules.incomingData.add(
|
|
6406
|
-
const
|
|
6407
|
-
type:
|
|
6450
|
+
if (this.modules.incomingData.add(P, f.payload.byteLength), Jo(f.flags)) {
|
|
6451
|
+
const C = R(A({
|
|
6452
|
+
type: P,
|
|
6408
6453
|
data: f.payload,
|
|
6409
|
-
codec:
|
|
6454
|
+
codec: M.codec
|
|
6410
6455
|
}, f), {
|
|
6411
6456
|
channelId: v
|
|
6412
|
-
}),
|
|
6413
|
-
|
|
6414
|
-
const D = $e({ codec:
|
|
6415
|
-
this.emitter.emit("init segment", { initSegment:
|
|
6457
|
+
}), I = Wo(C.codec, C.payload);
|
|
6458
|
+
I && this.sizes.set(C.renditionId, I);
|
|
6459
|
+
const D = $e({ codec: M.codec, codecString: M.codecString });
|
|
6460
|
+
this.emitter.emit("init segment", { initSegment: C, mimeType: D }), this.emit("initialized media");
|
|
6416
6461
|
} else {
|
|
6417
|
-
const
|
|
6418
|
-
let
|
|
6419
|
-
if (!
|
|
6420
|
-
|
|
6421
|
-
this.modules.sync.processSample(
|
|
6422
|
-
), this.sampleProcessingSesssions.set(
|
|
6462
|
+
const C = Wa(f, M, this.sizes.get(f.renditionId));
|
|
6463
|
+
let I = this.sampleProcessingSesssions.get(P);
|
|
6464
|
+
if (!I)
|
|
6465
|
+
I = Qa(
|
|
6466
|
+
this.modules.sync.processSample(C)
|
|
6467
|
+
), this.sampleProcessingSesssions.set(P, I);
|
|
6423
6468
|
else {
|
|
6424
|
-
const D =
|
|
6425
|
-
this.modules.sync.processSample(
|
|
6426
|
-
this.isSwitchingRenditionLevel &&
|
|
6469
|
+
const D = I(
|
|
6470
|
+
this.modules.sync.processSample(C),
|
|
6471
|
+
this.isSwitchingRenditionLevel && C.type === "video"
|
|
6427
6472
|
);
|
|
6428
|
-
let ie =
|
|
6473
|
+
let ie = C;
|
|
6429
6474
|
D.forEach((O) => {
|
|
6430
6475
|
this.modules.event.extractEvent(O, ie), this.emitter.emit("coded sample", O), ie = O;
|
|
6431
6476
|
});
|
|
@@ -6840,35 +6885,36 @@ const $ = class $ extends Pe {
|
|
|
6840
6885
|
return this.browser.supportsMediaSource && this.options.get("mseEnabled");
|
|
6841
6886
|
}
|
|
6842
6887
|
};
|
|
6843
|
-
Qe = new WeakMap(), Y = new WeakMap(),
|
|
6844
|
-
let
|
|
6888
|
+
Qe = new WeakMap(), Y = new WeakMap(), We = new WeakMap(), n($, "MAX_POOL_SIZE", 10), n($, "INITIAL_MAX_BIT_RATE", 2.5 * 1e3 * 1e3), n($, "DISCONNECT_TIMEOUT", 15 * 1e3), n($, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
|
|
6889
|
+
let Os = $;
|
|
6845
6890
|
export {
|
|
6846
|
-
|
|
6891
|
+
or as A,
|
|
6847
6892
|
as as B,
|
|
6848
|
-
|
|
6893
|
+
Xn as C,
|
|
6849
6894
|
St as D,
|
|
6850
6895
|
J as F,
|
|
6851
|
-
|
|
6896
|
+
Yn as I,
|
|
6852
6897
|
Nt as L,
|
|
6853
|
-
|
|
6854
|
-
|
|
6898
|
+
Jn as N,
|
|
6899
|
+
Os as V,
|
|
6855
6900
|
na as W,
|
|
6856
6901
|
Ut as a,
|
|
6857
|
-
|
|
6902
|
+
Vs as b,
|
|
6858
6903
|
nt as c,
|
|
6859
|
-
|
|
6904
|
+
dr as d,
|
|
6860
6905
|
st as e,
|
|
6861
6906
|
Ya as f,
|
|
6862
|
-
|
|
6863
|
-
|
|
6907
|
+
$e as g,
|
|
6908
|
+
Ja as h,
|
|
6864
6909
|
Ka as i,
|
|
6865
6910
|
qn as j,
|
|
6866
|
-
|
|
6867
|
-
|
|
6911
|
+
jn as k,
|
|
6912
|
+
Zn as l,
|
|
6868
6913
|
Ye as m,
|
|
6869
6914
|
le as n,
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6915
|
+
Gn as o,
|
|
6916
|
+
tr as p,
|
|
6917
|
+
T as q,
|
|
6918
|
+
zn as t,
|
|
6873
6919
|
Ui as w
|
|
6874
6920
|
};
|