@vindral/web-sdk 4.1.5 → 4.1.6
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/{CR970t1n.js → BoVzlg5M.js} +1 -1
- package/{DROC3QN7.js → D1E3hbbb.js} +843 -831
- package/cast-sender.d.ts +8 -0
- package/core.d.ts +22 -14
- package/core.js +1 -1
- package/legacy.d.ts +22 -14
- package/legacy.es.js +596 -584
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.d.ts +23 -15
- package/player.js +285 -284
- package/react.d.ts +23 -15
- package/{BLdnaIls.js → xMUHexhV.js} +1 -1
package/legacy.es.js
CHANGED
|
@@ -22,10 +22,10 @@ var an = (i, A) => {
|
|
|
22
22
|
A.indexOf(e) < 0 && nn.call(i, e) && (t[e] = i[e]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var
|
|
25
|
+
var Je = (i) => {
|
|
26
26
|
var A;
|
|
27
27
|
return [, , , ur((A = i == null ? void 0 : i[ht("metadata")]) != null ? A : null)];
|
|
28
|
-
}, En = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"],
|
|
28
|
+
}, En = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], og = (i) => i !== void 0 && typeof i != "function" ? Lt("Function expected") : i, Sr = (i, A, t, e, g) => ({ kind: En[i], name: A, metadata: e, addInitializer: (B) => t._ ? Lt("Already initialized") : g.push(og(B || null)) }), ee = (i, A) => rB(A, ht("metadata"), i[3]), Me = (i, A, t, e) => {
|
|
29
29
|
for (var g = 0, B = i[A >> 1], C = B && B.length; g < C; g++) A & 1 ? B[g].call(t) : e = B[g].call(t, e);
|
|
30
30
|
return e;
|
|
31
31
|
}, GA = (i, A, t, e, g, B) => {
|
|
@@ -36,7 +36,7 @@ var Le = (i) => {
|
|
|
36
36
|
} }, t));
|
|
37
37
|
h ? u && h < 4 && Qn(B, (h > 2 ? "set " : h > 1 ? "get " : "") + t) : Qn(g, t);
|
|
38
38
|
for (var U = e.length - 1; U >= 0; U--)
|
|
39
|
-
a = Sr(h, t, o = {}, i[3], b), h && (a.static = d, a.private = u, c = a.access = { has: u ? (G) => yr(g, G) : (G) => t in G }, h ^ 3 && (c.get = u ? (G) => (h ^ 1 ? s : l)(G, g, h ^ 4 ? B : y.get) : (G) => G[t]), h > 2 && (c.set = u ? (G, K) => E(G, g, K, h ^ 4 ? B : y.set) : (G, K) => G[t] = K)), Q = (0, e[U])(h ? h < 4 ? u ? B : y[S] : h > 4 ? void 0 : { get: y.get, set: y.set } : g, a), o._ = 1, h ^ 4 || Q === void 0 ?
|
|
39
|
+
a = Sr(h, t, o = {}, i[3], b), h && (a.static = d, a.private = u, c = a.access = { has: u ? (G) => yr(g, G) : (G) => t in G }, h ^ 3 && (c.get = u ? (G) => (h ^ 1 ? s : l)(G, g, h ^ 4 ? B : y.get) : (G) => G[t]), h > 2 && (c.set = u ? (G, K) => E(G, g, K, h ^ 4 ? B : y.set) : (G, K) => G[t] = K)), Q = (0, e[U])(h ? h < 4 ? u ? B : y[S] : h > 4 ? void 0 : { get: y.get, set: y.set } : g, a), o._ = 1, h ^ 4 || Q === void 0 ? og(Q) && (h > 4 ? p.unshift(Q) : h ? u ? B = Q : y[S] = Q : g = Q) : typeof Q != "object" || Q === null ? Lt("Object expected") : (og(C = Q.get) && (y.get = C), og(C = Q.set) && (y.set = C), og(C = Q.init) && p.unshift(C));
|
|
40
40
|
return h || ee(i, g), y && EQ(g, t, y), u ? h ^ 4 ? B : y : g;
|
|
41
41
|
}, I = (i, A, t) => rB(i, typeof A != "symbol" ? A + "" : A, t), rQ = (i, A, t) => A.has(i) || Lt("Cannot " + t), yr = (i, A) => Object(A) !== A ? Lt('Cannot use the "in" operator on this value') : i.has(A), s = (i, A, t) => (rQ(i, A, "read from private field"), t ? t.call(i) : A.get(i)), n = (i, A, t) => A.has(i) ? Lt("Cannot add the same private member more than once") : A instanceof WeakSet ? A.add(i) : A.set(i, t), E = (i, A, t, e) => (rQ(i, A, "write to private field"), e ? e.call(i, t) : A.set(i, t), t), l = (i, A, t) => (rQ(i, A, "access private method"), t);
|
|
42
42
|
var tt = (i, A, t, e) => ({
|
|
@@ -389,13 +389,13 @@ const To = (i, A, t) => {
|
|
|
389
389
|
e = e * 256 + i[g];
|
|
390
390
|
return e;
|
|
391
391
|
};
|
|
392
|
-
var QA, qt,
|
|
392
|
+
var QA, qt, Qe;
|
|
393
393
|
class ig {
|
|
394
394
|
constructor(A) {
|
|
395
395
|
n(this, QA);
|
|
396
396
|
n(this, qt);
|
|
397
|
-
n(this,
|
|
398
|
-
E(this, qt, A), E(this,
|
|
397
|
+
n(this, Qe);
|
|
398
|
+
E(this, qt, A), E(this, Qe, new DataView(A.buffer, A.byteOffset, A.byteLength)), E(this, QA, 0);
|
|
399
399
|
}
|
|
400
400
|
position() {
|
|
401
401
|
return s(this, QA);
|
|
@@ -410,19 +410,19 @@ class ig {
|
|
|
410
410
|
return s(this, qt).length - s(this, QA);
|
|
411
411
|
}
|
|
412
412
|
readUint8() {
|
|
413
|
-
const A = s(this,
|
|
413
|
+
const A = s(this, Qe).getUint8(s(this, QA));
|
|
414
414
|
return E(this, QA, s(this, QA) + 1), A;
|
|
415
415
|
}
|
|
416
416
|
readUint24() {
|
|
417
|
-
const A = s(this,
|
|
417
|
+
const A = s(this, Qe).getUint32(s(this, QA)) >> 8 & 16777215;
|
|
418
418
|
return E(this, QA, s(this, QA) + 3), A;
|
|
419
419
|
}
|
|
420
420
|
readUint16() {
|
|
421
|
-
const A = s(this,
|
|
421
|
+
const A = s(this, Qe).getUint16(s(this, QA));
|
|
422
422
|
return E(this, QA, s(this, QA) + 2), A;
|
|
423
423
|
}
|
|
424
424
|
readUint32() {
|
|
425
|
-
const A = s(this,
|
|
425
|
+
const A = s(this, Qe).getUint32(s(this, QA));
|
|
426
426
|
return E(this, QA, s(this, QA) + 4), A;
|
|
427
427
|
}
|
|
428
428
|
readUint64() {
|
|
@@ -444,7 +444,7 @@ class ig {
|
|
|
444
444
|
return new TextDecoder().decode(new Uint8Array(A));
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
|
-
QA = new WeakMap(), qt = new WeakMap(),
|
|
447
|
+
QA = new WeakMap(), qt = new WeakMap(), Qe = new WeakMap();
|
|
448
448
|
class kr {
|
|
449
449
|
constructor(A = 100, t = 100) {
|
|
450
450
|
I(this, "resizeSteps");
|
|
@@ -521,7 +521,7 @@ function pa(i) {
|
|
|
521
521
|
t[e] = A.charCodeAt(e);
|
|
522
522
|
return t.buffer;
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Ig() {
|
|
525
525
|
const i = self.MediaSource, A = self.ManagedMediaSource;
|
|
526
526
|
return i != null ? i : A;
|
|
527
527
|
}
|
|
@@ -540,7 +540,7 @@ const Rr = /(android|bbd+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal
|
|
|
540
540
|
return !1;
|
|
541
541
|
}, Lr = () => UA.indexOf("CrKey") !== -1, Fa = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, iQ = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, Jr = () => UA.indexOf("iphone") >= 0 && UA.indexOf("like iphone") < 0 || UA.indexOf("ipad") >= 0 && UA.indexOf("like ipad") < 0 || UA.indexOf("ipod") >= 0 && UA.indexOf("like ipod") < 0 || iQ(), Mr = () => {
|
|
542
542
|
var i, A;
|
|
543
|
-
return iQ() ? !1 : (A = (i =
|
|
543
|
+
return iQ() ? !1 : (A = (i = Ig()) == null ? void 0 : i.isTypeSupported('audio/mp4; codecs="opus"')) != null ? A : !1;
|
|
544
544
|
}, Hr = () => /^(?!.*chrome).*safari/i.test(UA);
|
|
545
545
|
function qr() {
|
|
546
546
|
var i, A;
|
|
@@ -554,7 +554,7 @@ function vr() {
|
|
|
554
554
|
}
|
|
555
555
|
const Po = () => {
|
|
556
556
|
var t, e;
|
|
557
|
-
const i = !!
|
|
557
|
+
const i = !!Ig();
|
|
558
558
|
let A = !1;
|
|
559
559
|
return i && (A = Mr()), {
|
|
560
560
|
isMobile: Ur,
|
|
@@ -894,14 +894,14 @@ const ln = (i, A) => {
|
|
|
894
894
|
};
|
|
895
895
|
I(BC, "create", () => new BC());
|
|
896
896
|
let yA = BC;
|
|
897
|
-
const
|
|
897
|
+
const ve = (i, A = Date.now()) => {
|
|
898
898
|
const t = i.length;
|
|
899
899
|
if (t > 0) {
|
|
900
900
|
const e = t - 1, g = i[e];
|
|
901
901
|
g.end || (g.end = A);
|
|
902
902
|
}
|
|
903
903
|
}, qi = (i, A = Date.now()) => {
|
|
904
|
-
|
|
904
|
+
ve(i), i.push({ start: A });
|
|
905
905
|
}, vi = (i) => i.reduce((A, t) => {
|
|
906
906
|
var e;
|
|
907
907
|
return A + (((e = t.end) != null ? e : Date.now()) - t.start);
|
|
@@ -926,7 +926,7 @@ const Ra = (i) => {
|
|
|
926
926
|
}, wn = () => {
|
|
927
927
|
const i = [...Array(256).keys()].map((t) => t.toString(16).padStart(2, "0")), A = crypto.getRandomValues(new Uint8Array(16));
|
|
928
928
|
return A[6] = A[6] & 15 | 64, A[8] = A[8] & 63 | 128, [...A.entries()].map(([t, e]) => [4, 6, 8, 10].includes(t) ? `-${i[e]}` : i[e]).join("");
|
|
929
|
-
},
|
|
929
|
+
}, Ue = (i) => r(null, null, function* () {
|
|
930
930
|
return new Promise((A) => setTimeout(A, i));
|
|
931
931
|
}), xo = (t, ...e) => r(null, [t, ...e], function* (i, A = new Error("Timeout")) {
|
|
932
932
|
return new Promise((g, B) => setTimeout(() => B(A), i));
|
|
@@ -1287,7 +1287,7 @@ function Na(i) {
|
|
|
1287
1287
|
});
|
|
1288
1288
|
}).sort((A, t) => A.bitRate - t.bitRate);
|
|
1289
1289
|
}
|
|
1290
|
-
const Fi = (i) => "width" in i && typeof i.width == "number", Gi = (i) => "sampleRate" in i && typeof i.sampleRate == "number",
|
|
1290
|
+
const Fi = (i) => "width" in i && typeof i.width == "number", Gi = (i) => "sampleRate" in i && typeof i.sampleRate == "number", Ce = (i) => {
|
|
1291
1291
|
switch (i.codec) {
|
|
1292
1292
|
case "opus":
|
|
1293
1293
|
return 'audio/mp4; codecs="opus"';
|
|
@@ -1302,7 +1302,7 @@ const Fi = (i) => "width" in i && typeof i.width == "number", Gi = (i) => "sampl
|
|
|
1302
1302
|
case "av1":
|
|
1303
1303
|
return i.codecString ? `video/mp4; codecs="${i.codecString}"` : "video/mp4";
|
|
1304
1304
|
}
|
|
1305
|
-
},
|
|
1305
|
+
}, Re = () => Number.MAX_SAFE_INTEGER, RB = () => ({
|
|
1306
1306
|
width: Number.MAX_SAFE_INTEGER,
|
|
1307
1307
|
height: Number.MAX_SAFE_INTEGER
|
|
1308
1308
|
}), mn = (i) => !(typeof i != "object" || i === null || !("type" in i)), jr = {
|
|
@@ -1311,14 +1311,15 @@ const Fi = (i) => "width" in i && typeof i.width == "number", Gi = (i) => "sampl
|
|
|
1311
1311
|
abrEnabled: !0,
|
|
1312
1312
|
burstEnabled: !1,
|
|
1313
1313
|
mseEnabled: !0,
|
|
1314
|
-
mseOpusEnabled: !
|
|
1314
|
+
mseOpusEnabled: !0,
|
|
1315
1315
|
muted: !1,
|
|
1316
|
+
volume: 1,
|
|
1316
1317
|
minBufferTime: 1500,
|
|
1317
1318
|
maxBufferTime: 1500,
|
|
1318
1319
|
logLevel: Wr.OFF,
|
|
1319
1320
|
maxSize: RB(),
|
|
1320
|
-
maxVideoBitRate:
|
|
1321
|
-
maxAudioBitRate:
|
|
1321
|
+
maxVideoBitRate: Re(),
|
|
1322
|
+
maxAudioBitRate: Re(),
|
|
1322
1323
|
maxInitialBitRate: 2.5 * 1e3 * 1e3,
|
|
1323
1324
|
// 2.5 Mbps
|
|
1324
1325
|
tags: [],
|
|
@@ -1405,7 +1406,7 @@ const cc = (i, A) => new v(
|
|
|
1405
1406
|
code: sc,
|
|
1406
1407
|
type: "internal"
|
|
1407
1408
|
}
|
|
1408
|
-
), lc = () => new v("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }),
|
|
1409
|
+
), lc = () => new v("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), ng = (i) => new v("Disconnected From Edge Server", {
|
|
1409
1410
|
type: "external",
|
|
1410
1411
|
source: i,
|
|
1411
1412
|
isFatal: !1,
|
|
@@ -1655,7 +1656,7 @@ class bc extends IQ {
|
|
|
1655
1656
|
}
|
|
1656
1657
|
}
|
|
1657
1658
|
const Lc = 5e3;
|
|
1658
|
-
var Z, ze, vt, Bt, ut, hA,
|
|
1659
|
+
var Z, ze, vt, Bt, ut, hA, oe, ne, CC, II, _g, $g, nA, Ka, Ya, Ta, Pa, QC, oC, xa, rg, nC, Wa, Oa;
|
|
1659
1660
|
class Gn {
|
|
1660
1661
|
constructor(A, t, e = {}) {
|
|
1661
1662
|
n(this, nA);
|
|
@@ -1665,8 +1666,8 @@ class Gn {
|
|
|
1665
1666
|
n(this, Bt, new z());
|
|
1666
1667
|
n(this, ut);
|
|
1667
1668
|
n(this, hA);
|
|
1668
|
-
n(this,
|
|
1669
|
-
n(this,
|
|
1669
|
+
n(this, oe, /* @__PURE__ */ new Map());
|
|
1670
|
+
n(this, ne);
|
|
1670
1671
|
n(this, CC, Po());
|
|
1671
1672
|
/**
|
|
1672
1673
|
* Timeout to wait for new drm data when channel switch happens
|
|
@@ -1686,7 +1687,7 @@ class Gn {
|
|
|
1686
1687
|
var B, C;
|
|
1687
1688
|
s(this, Z).debug("Session message received", { event: A });
|
|
1688
1689
|
const t = A.target, e = A.message;
|
|
1689
|
-
if (!s(this,
|
|
1690
|
+
if (!s(this, oe).get(t)) {
|
|
1690
1691
|
s(this, Z).error("No active session found for event", { event: A });
|
|
1691
1692
|
return;
|
|
1692
1693
|
}
|
|
@@ -1695,10 +1696,10 @@ class Gn {
|
|
|
1695
1696
|
licenseServerUrl: (B = s(this, hA)) == null ? void 0 : B.licenseServerUrl
|
|
1696
1697
|
}), (C = s(this, hA)) == null || C.requestLicense(e).then((Q) => {
|
|
1697
1698
|
s(this, Z).debug("License received for session", { sessionId: t.sessionId }), t.update(Q).catch((o) => {
|
|
1698
|
-
l(this, nA,
|
|
1699
|
+
l(this, nA, rg).call(this, { message: "Failed to update session with license", isFatal: !1, error: o });
|
|
1699
1700
|
});
|
|
1700
1701
|
}).catch((Q) => {
|
|
1701
|
-
l(this, nA,
|
|
1702
|
+
l(this, nA, rg).call(this, { message: "Failed to request license", isFatal: !1, error: Q });
|
|
1702
1703
|
});
|
|
1703
1704
|
});
|
|
1704
1705
|
n(this, oC, (A) => {
|
|
@@ -1739,9 +1740,9 @@ class Gn {
|
|
|
1739
1740
|
}
|
|
1740
1741
|
unload() {
|
|
1741
1742
|
var A;
|
|
1742
|
-
s(this, Z).info("Unloading EncryptedMediaExtensions"), s(this, ze).off("received drm data", s(this, _g)), (A = s(this, vt)) == null || A.removeEventListener("encrypted", s(this, $g)), s(this,
|
|
1743
|
+
s(this, Z).info("Unloading EncryptedMediaExtensions"), s(this, ze).off("received drm data", s(this, _g)), (A = s(this, vt)) == null || A.removeEventListener("encrypted", s(this, $g)), s(this, oe).forEach((t, e) => {
|
|
1743
1744
|
e.close();
|
|
1744
|
-
}), s(this,
|
|
1745
|
+
}), s(this, oe).clear(), E(this, ne, void 0), E(this, hA, void 0);
|
|
1745
1746
|
}
|
|
1746
1747
|
set headers(A) {
|
|
1747
1748
|
s(this, ut).headers = A, s(this, hA) && (s(this, hA).headers = A);
|
|
@@ -1754,7 +1755,7 @@ class Gn {
|
|
|
1754
1755
|
s(this, Z).debug("DRM is not used, skipping channel switch handling");
|
|
1755
1756
|
return;
|
|
1756
1757
|
}
|
|
1757
|
-
Hr() && s(this, CC).platform.safariVersion < 18 && l(this, nA,
|
|
1758
|
+
Hr() && s(this, CC).platform.safariVersion < 18 && l(this, nA, rg).call(this, {
|
|
1758
1759
|
message: "DRM channel switch not supported on Safari < 18",
|
|
1759
1760
|
isFatal: !0
|
|
1760
1761
|
}), window.clearTimeout(s(this, II));
|
|
@@ -1764,12 +1765,12 @@ class Gn {
|
|
|
1764
1765
|
}, Lc));
|
|
1765
1766
|
}
|
|
1766
1767
|
}
|
|
1767
|
-
Z = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), Bt = new WeakMap(), ut = new WeakMap(), hA = new WeakMap(),
|
|
1768
|
+
Z = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), Bt = new WeakMap(), ut = new WeakMap(), hA = new WeakMap(), oe = new WeakMap(), ne = new WeakMap(), CC = new WeakMap(), II = new WeakMap(), _g = new WeakMap(), $g = new WeakMap(), nA = new WeakSet(), Ka = function(A) {
|
|
1768
1769
|
return r(this, null, function* () {
|
|
1769
1770
|
try {
|
|
1770
1771
|
yield l(this, nA, Ya).call(this), s(this, Z).debug("Media keys initialization completed"), yield l(this, nA, Ta).call(this, A.initData, A.initDataType);
|
|
1771
1772
|
} catch (t) {
|
|
1772
|
-
l(this, nA,
|
|
1773
|
+
l(this, nA, rg).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
|
|
1773
1774
|
}
|
|
1774
1775
|
});
|
|
1775
1776
|
}, Ya = function() {
|
|
@@ -1781,16 +1782,16 @@ Z = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), Bt = new WeakMap(), u
|
|
|
1781
1782
|
s(this, Z).debug("Media keys already set on media element");
|
|
1782
1783
|
return;
|
|
1783
1784
|
}
|
|
1784
|
-
if (s(this,
|
|
1785
|
-
s(this, Z).debug("Media keys initialization already in progress, waiting for completion"), yield s(this,
|
|
1785
|
+
if (s(this, ne)) {
|
|
1786
|
+
s(this, Z).debug("Media keys initialization already in progress, waiting for completion"), yield s(this, ne);
|
|
1786
1787
|
return;
|
|
1787
1788
|
}
|
|
1788
|
-
E(this,
|
|
1789
|
+
E(this, ne, r(this, null, function* () {
|
|
1789
1790
|
const e = yield s(this, nC).call(this, A);
|
|
1790
1791
|
s(this, Z).debug("CDM obtained", { cdm: e }), uA(s(this, vt), "No media element found"), uA(e, "No CDM found");
|
|
1791
1792
|
const g = yield e.getMediaKeys();
|
|
1792
1793
|
e.certificate && (yield l(this, nA, xa).call(this, g, e.certificate)), s(this, Z).debug("Setting media keys on media element"), yield s(this, vt).setMediaKeys(g), E(this, hA, e);
|
|
1793
|
-
})), yield s(this,
|
|
1794
|
+
})), yield s(this, ne);
|
|
1794
1795
|
});
|
|
1795
1796
|
}, Ta = function(A, t) {
|
|
1796
1797
|
return r(this, null, function* () {
|
|
@@ -1803,10 +1804,10 @@ Z = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), Bt = new WeakMap(), u
|
|
|
1803
1804
|
const g = e.createSession();
|
|
1804
1805
|
s(this, Z).debug("Creating new session", { session: g }), g.addEventListener("keystatuseschange", s(this, oC)), g.closed.then((B) => {
|
|
1805
1806
|
s(this, Z).info("Session is closed", { reason: B });
|
|
1806
|
-
}), g.addEventListener("message", s(this, QC)), s(this,
|
|
1807
|
+
}), g.addEventListener("message", s(this, QC)), s(this, oe).set(g, A), s(this, Z).debug("Generating request for session", { session: g, initDataType: t, initData: A }), yield g.generateRequest(t, A);
|
|
1807
1808
|
});
|
|
1808
1809
|
}, Pa = function(A) {
|
|
1809
|
-
for (const [t, e] of s(this,
|
|
1810
|
+
for (const [t, e] of s(this, oe))
|
|
1810
1811
|
if (fc(A, e)) return !1;
|
|
1811
1812
|
return !0;
|
|
1812
1813
|
}, QC = new WeakMap(), oC = new WeakMap(), xa = function(A, t) {
|
|
@@ -1817,7 +1818,7 @@ Z = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), Bt = new WeakMap(), u
|
|
|
1817
1818
|
s(this, Z).error("Failed to set server certificate", { error: e });
|
|
1818
1819
|
}
|
|
1819
1820
|
});
|
|
1820
|
-
},
|
|
1821
|
+
}, rg = function(A) {
|
|
1821
1822
|
const { message: t, isFatal: e, error: g } = A;
|
|
1822
1823
|
s(this, Z).error(t, { error: g }), s(this, ze).emit("error", Ha(t, e, g));
|
|
1823
1824
|
}, nC = new WeakMap(), /**
|
|
@@ -2075,22 +2076,22 @@ const Oi = class Oi {
|
|
|
2075
2076
|
};
|
|
2076
2077
|
I(Oi, "type", "emsg");
|
|
2077
2078
|
let NB = Oi;
|
|
2078
|
-
const
|
|
2079
|
+
const mg = class mg {
|
|
2079
2080
|
constructor(A) {
|
|
2080
|
-
I(this, "type",
|
|
2081
|
+
I(this, "type", mg.type);
|
|
2081
2082
|
I(this, "data");
|
|
2082
2083
|
this.data = A;
|
|
2083
2084
|
}
|
|
2084
2085
|
static decodeData(A) {
|
|
2085
2086
|
const t = A.readRemaining();
|
|
2086
|
-
return new
|
|
2087
|
+
return new mg(t);
|
|
2087
2088
|
}
|
|
2088
2089
|
};
|
|
2089
|
-
I(
|
|
2090
|
-
let bB =
|
|
2091
|
-
const
|
|
2090
|
+
I(mg, "type", "mdat");
|
|
2091
|
+
let bB = mg;
|
|
2092
|
+
const Sg = class Sg {
|
|
2092
2093
|
constructor(A, t, e) {
|
|
2093
|
-
I(this, "type",
|
|
2094
|
+
I(this, "type", Sg.type);
|
|
2094
2095
|
I(this, "extra");
|
|
2095
2096
|
/**
|
|
2096
2097
|
* The byte offset of the baseMediaDecodeTime field
|
|
@@ -2102,14 +2103,14 @@ const mg = class mg {
|
|
|
2102
2103
|
static decodeData(A) {
|
|
2103
2104
|
const t = te(A), e = A.byteOffset();
|
|
2104
2105
|
let g = 0;
|
|
2105
|
-
return t.version === 1 ? g = A.readUint64() : g = A.readUint32(), new
|
|
2106
|
+
return t.version === 1 ? g = A.readUint64() : g = A.readUint32(), new Sg(t, e, g);
|
|
2106
2107
|
}
|
|
2107
2108
|
};
|
|
2108
|
-
I(
|
|
2109
|
-
let LB =
|
|
2110
|
-
const jc = 1, zc = 2, _c = 8, $c = 16, Ah = 32,
|
|
2109
|
+
I(Sg, "type", "tfdt");
|
|
2110
|
+
let LB = Sg;
|
|
2111
|
+
const jc = 1, zc = 2, _c = 8, $c = 16, Ah = 32, yg = class yg {
|
|
2111
2112
|
constructor(A, t, e, g) {
|
|
2112
|
-
I(this, "type",
|
|
2113
|
+
I(this, "type", yg.type);
|
|
2113
2114
|
I(this, "extra");
|
|
2114
2115
|
I(this, "defaultSampleDuration");
|
|
2115
2116
|
I(this, "defaultSampleSize");
|
|
@@ -2119,11 +2120,11 @@ const jc = 1, zc = 2, _c = 8, $c = 16, Ah = 32, Sg = class Sg {
|
|
|
2119
2120
|
static decodeData(A) {
|
|
2120
2121
|
const t = te(A);
|
|
2121
2122
|
let e, g, B;
|
|
2122
|
-
return A.readUint32(), (t.flags & jc) > 0 && A.readUint64(), (t.flags & zc) > 0 && A.readUint32(), (t.flags & _c) > 0 && (e = A.readUint32()), (t.flags & $c) > 0 && (g = A.readUint32()), (t.flags & Ah) > 0 && (B = A.readUint32()), new
|
|
2123
|
+
return A.readUint32(), (t.flags & jc) > 0 && A.readUint64(), (t.flags & zc) > 0 && A.readUint32(), (t.flags & _c) > 0 && (e = A.readUint32()), (t.flags & $c) > 0 && (g = A.readUint32()), (t.flags & Ah) > 0 && (B = A.readUint32()), new yg(t, e, g, B);
|
|
2123
2124
|
}
|
|
2124
2125
|
};
|
|
2125
|
-
I(
|
|
2126
|
-
let JB =
|
|
2126
|
+
I(yg, "type", "tfhd");
|
|
2127
|
+
let JB = yg;
|
|
2127
2128
|
const IA = class IA {
|
|
2128
2129
|
constructor(A, t, e) {
|
|
2129
2130
|
I(this, "type", IA.type);
|
|
@@ -2155,9 +2156,9 @@ const IA = class IA {
|
|
|
2155
2156
|
};
|
|
2156
2157
|
I(IA, "TRUN_DATA_OFFSET", 1), I(IA, "TRUN_FIRST_SAMPLE_FLAGS", 4), I(IA, "SAMPLE_DURATION", 256), I(IA, "SAMPLE_SIZE", 512), I(IA, "SAMPLE_FLAGS", 1024), I(IA, "SAMPLE_CTS", 2048), I(IA, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), I(IA, "FLAG_SAMPLE_DEPENDS_NO", 33554432), I(IA, "FLAG_SAMPLE_DEPENDS_YES", 16777216), I(IA, "type", "trun");
|
|
2157
2158
|
let xg = IA;
|
|
2158
|
-
const
|
|
2159
|
+
const fg = class fg {
|
|
2159
2160
|
constructor(A, t, e) {
|
|
2160
|
-
I(this, "type",
|
|
2161
|
+
I(this, "type", fg.type);
|
|
2161
2162
|
I(this, "tfhd");
|
|
2162
2163
|
I(this, "tfdt");
|
|
2163
2164
|
I(this, "trun");
|
|
@@ -2169,14 +2170,14 @@ const yg = class yg {
|
|
|
2169
2170
|
const B = rt(A);
|
|
2170
2171
|
B instanceof JB && (t = B), B instanceof LB && (e = B), B instanceof xg && (g = B);
|
|
2171
2172
|
}
|
|
2172
|
-
return new
|
|
2173
|
+
return new fg(t, e, g);
|
|
2173
2174
|
}
|
|
2174
2175
|
};
|
|
2175
|
-
I(
|
|
2176
|
-
let MB =
|
|
2177
|
-
const
|
|
2176
|
+
I(fg, "type", "traf");
|
|
2177
|
+
let MB = fg;
|
|
2178
|
+
const pg = class pg {
|
|
2178
2179
|
constructor(A) {
|
|
2179
|
-
I(this, "type",
|
|
2180
|
+
I(this, "type", pg.type);
|
|
2180
2181
|
I(this, "traf");
|
|
2181
2182
|
this.traf = A;
|
|
2182
2183
|
}
|
|
@@ -2188,24 +2189,24 @@ const fg = class fg {
|
|
|
2188
2189
|
}
|
|
2189
2190
|
if (!t)
|
|
2190
2191
|
throw new Error("No traf found");
|
|
2191
|
-
return new
|
|
2192
|
+
return new pg(t);
|
|
2192
2193
|
}
|
|
2193
2194
|
};
|
|
2194
|
-
I(
|
|
2195
|
-
let HB =
|
|
2196
|
-
const
|
|
2195
|
+
I(pg, "type", "moof");
|
|
2196
|
+
let HB = pg;
|
|
2197
|
+
const Fg = class Fg {
|
|
2197
2198
|
constructor() {
|
|
2198
|
-
I(this, "type",
|
|
2199
|
+
I(this, "type", Fg.type);
|
|
2199
2200
|
}
|
|
2200
2201
|
static decodeData(A) {
|
|
2201
|
-
return new
|
|
2202
|
+
return new Fg();
|
|
2202
2203
|
}
|
|
2203
2204
|
};
|
|
2204
|
-
I(
|
|
2205
|
-
let qB =
|
|
2206
|
-
const
|
|
2205
|
+
I(Fg, "type", "mvhd");
|
|
2206
|
+
let qB = Fg;
|
|
2207
|
+
const Gg = class Gg {
|
|
2207
2208
|
constructor(A) {
|
|
2208
|
-
I(this, "type",
|
|
2209
|
+
I(this, "type", Gg.type);
|
|
2209
2210
|
I(this, "fourCC");
|
|
2210
2211
|
this.fourCC = A;
|
|
2211
2212
|
}
|
|
@@ -2224,11 +2225,11 @@ const Fg = class Fg {
|
|
|
2224
2225
|
static decodeData(A) {
|
|
2225
2226
|
te(A), A.readUint32();
|
|
2226
2227
|
const t = String.fromCharCode(...A.readBytes(4));
|
|
2227
|
-
return new
|
|
2228
|
+
return new Gg(t);
|
|
2228
2229
|
}
|
|
2229
2230
|
};
|
|
2230
|
-
I(
|
|
2231
|
-
let vB =
|
|
2231
|
+
I(Gg, "type", "hdlr");
|
|
2232
|
+
let vB = Gg;
|
|
2232
2233
|
const Vi = class Vi {
|
|
2233
2234
|
constructor(A, t, e, g) {
|
|
2234
2235
|
I(this, "type", Vi.type);
|
|
@@ -2250,9 +2251,9 @@ const Vi = class Vi {
|
|
|
2250
2251
|
};
|
|
2251
2252
|
I(Vi, "type", "mdhd");
|
|
2252
2253
|
let KB = Vi;
|
|
2253
|
-
const
|
|
2254
|
+
const kg = class kg {
|
|
2254
2255
|
constructor(A, t, e, g) {
|
|
2255
|
-
I(this, "type",
|
|
2256
|
+
I(this, "type", kg.type);
|
|
2256
2257
|
I(this, "av01");
|
|
2257
2258
|
I(this, "avc1");
|
|
2258
2259
|
I(this, "opus");
|
|
@@ -2292,14 +2293,14 @@ const Gg = class Gg {
|
|
|
2292
2293
|
break;
|
|
2293
2294
|
}
|
|
2294
2295
|
}
|
|
2295
|
-
return new
|
|
2296
|
+
return new kg(g, C, B, e);
|
|
2296
2297
|
}
|
|
2297
2298
|
};
|
|
2298
|
-
I(
|
|
2299
|
-
let YB =
|
|
2300
|
-
const
|
|
2299
|
+
I(kg, "type", "stsd");
|
|
2300
|
+
let YB = kg;
|
|
2301
|
+
const Rg = class Rg {
|
|
2301
2302
|
constructor(A) {
|
|
2302
|
-
I(this, "type",
|
|
2303
|
+
I(this, "type", Rg.type);
|
|
2303
2304
|
I(this, "stsd");
|
|
2304
2305
|
this.stsd = A;
|
|
2305
2306
|
}
|
|
@@ -2311,14 +2312,14 @@ const kg = class kg {
|
|
|
2311
2312
|
}
|
|
2312
2313
|
if (!t)
|
|
2313
2314
|
throw new Error("No stsd found");
|
|
2314
|
-
return new
|
|
2315
|
+
return new Rg(t);
|
|
2315
2316
|
}
|
|
2316
2317
|
};
|
|
2317
|
-
I(
|
|
2318
|
-
let TB =
|
|
2319
|
-
const
|
|
2318
|
+
I(Rg, "type", "stbl");
|
|
2319
|
+
let TB = Rg;
|
|
2320
|
+
const Ug = class Ug {
|
|
2320
2321
|
constructor(A) {
|
|
2321
|
-
I(this, "type",
|
|
2322
|
+
I(this, "type", Ug.type);
|
|
2322
2323
|
I(this, "stbl");
|
|
2323
2324
|
this.stbl = A;
|
|
2324
2325
|
}
|
|
@@ -2330,14 +2331,14 @@ const Rg = class Rg {
|
|
|
2330
2331
|
}
|
|
2331
2332
|
if (!t)
|
|
2332
2333
|
throw new Error("No stbl found");
|
|
2333
|
-
return new
|
|
2334
|
+
return new Ug(t);
|
|
2334
2335
|
}
|
|
2335
2336
|
};
|
|
2336
|
-
I(
|
|
2337
|
-
let PB =
|
|
2338
|
-
const
|
|
2337
|
+
I(Ug, "type", "minf");
|
|
2338
|
+
let PB = Ug;
|
|
2339
|
+
const Ng = class Ng {
|
|
2339
2340
|
constructor(A, t, e) {
|
|
2340
|
-
I(this, "type",
|
|
2341
|
+
I(this, "type", Ng.type);
|
|
2341
2342
|
I(this, "hdlr");
|
|
2342
2343
|
I(this, "minf");
|
|
2343
2344
|
I(this, "mdhd");
|
|
@@ -2355,14 +2356,14 @@ const Ug = class Ug {
|
|
|
2355
2356
|
throw new Error("No minf found");
|
|
2356
2357
|
if (!g)
|
|
2357
2358
|
throw new Error("No mdhd found");
|
|
2358
|
-
return new
|
|
2359
|
+
return new Ng(t, e, g);
|
|
2359
2360
|
}
|
|
2360
2361
|
};
|
|
2361
|
-
I(
|
|
2362
|
-
let xB =
|
|
2363
|
-
const
|
|
2362
|
+
I(Ng, "type", "mdia");
|
|
2363
|
+
let xB = Ng;
|
|
2364
|
+
const bg = class bg {
|
|
2364
2365
|
constructor(A, t, e, g, B, C, Q, o) {
|
|
2365
|
-
I(this, "type",
|
|
2366
|
+
I(this, "type", bg.type);
|
|
2366
2367
|
I(this, "modificationTime");
|
|
2367
2368
|
I(this, "creationTime");
|
|
2368
2369
|
I(this, "trackId");
|
|
@@ -2386,14 +2387,14 @@ const Ng = class Ng {
|
|
|
2386
2387
|
const a = A.readUint16();
|
|
2387
2388
|
A.readUint16();
|
|
2388
2389
|
const c = A.readUint16();
|
|
2389
|
-
return A.readUint16(), new
|
|
2390
|
+
return A.readUint16(), new bg(e, g, B, C, Q, o, a, c);
|
|
2390
2391
|
}
|
|
2391
2392
|
};
|
|
2392
|
-
I(
|
|
2393
|
-
let WB =
|
|
2394
|
-
const
|
|
2393
|
+
I(bg, "type", "tkhd");
|
|
2394
|
+
let WB = bg;
|
|
2395
|
+
const Lg = class Lg {
|
|
2395
2396
|
constructor(A, t) {
|
|
2396
|
-
I(this, "type",
|
|
2397
|
+
I(this, "type", Lg.type);
|
|
2397
2398
|
I(this, "tkhd");
|
|
2398
2399
|
I(this, "mdia");
|
|
2399
2400
|
this.tkhd = A, this.mdia = t;
|
|
@@ -2408,14 +2409,14 @@ const bg = class bg {
|
|
|
2408
2409
|
throw new Error("No tkhd found");
|
|
2409
2410
|
if (!e)
|
|
2410
2411
|
throw new Error("No mdia found");
|
|
2411
|
-
return new
|
|
2412
|
+
return new Lg(t, e);
|
|
2412
2413
|
}
|
|
2413
2414
|
};
|
|
2414
|
-
I(
|
|
2415
|
-
let OB =
|
|
2416
|
-
const
|
|
2415
|
+
I(Lg, "type", "trak");
|
|
2416
|
+
let OB = Lg;
|
|
2417
|
+
const Jg = class Jg {
|
|
2417
2418
|
constructor(A, t) {
|
|
2418
|
-
I(this, "type",
|
|
2419
|
+
I(this, "type", Jg.type);
|
|
2419
2420
|
I(this, "mvhd");
|
|
2420
2421
|
I(this, "traks");
|
|
2421
2422
|
this.mvhd = A, this.traks = t;
|
|
@@ -2429,14 +2430,14 @@ const Lg = class Lg {
|
|
|
2429
2430
|
}
|
|
2430
2431
|
if (!t)
|
|
2431
2432
|
throw new Error("No mvhd found");
|
|
2432
|
-
return new
|
|
2433
|
+
return new Jg(t, e);
|
|
2433
2434
|
}
|
|
2434
2435
|
};
|
|
2435
|
-
I(
|
|
2436
|
-
let VB =
|
|
2437
|
-
const
|
|
2436
|
+
I(Jg, "type", "moov");
|
|
2437
|
+
let VB = Jg;
|
|
2438
|
+
const Mg = class Mg {
|
|
2438
2439
|
constructor(A, t, e, g, B, C, Q, o) {
|
|
2439
|
-
I(this, "type",
|
|
2440
|
+
I(this, "type", Mg.type);
|
|
2440
2441
|
I(this, "configurationVersion");
|
|
2441
2442
|
I(this, "avcProfileIndication");
|
|
2442
2443
|
I(this, "profileCompatibility");
|
|
@@ -2458,7 +2459,7 @@ const Jg = class Jg {
|
|
|
2458
2459
|
const u = A.readBytes(A.readUint16());
|
|
2459
2460
|
h.push(u);
|
|
2460
2461
|
}
|
|
2461
|
-
return new
|
|
2462
|
+
return new Mg(
|
|
2462
2463
|
e,
|
|
2463
2464
|
g,
|
|
2464
2465
|
B,
|
|
@@ -2470,11 +2471,11 @@ const Jg = class Jg {
|
|
|
2470
2471
|
);
|
|
2471
2472
|
}
|
|
2472
2473
|
};
|
|
2473
|
-
I(
|
|
2474
|
-
let xQ =
|
|
2475
|
-
const
|
|
2474
|
+
I(Mg, "type", "avcC");
|
|
2475
|
+
let xQ = Mg;
|
|
2476
|
+
const Hg = class Hg {
|
|
2476
2477
|
constructor(A, t, e, g, B) {
|
|
2477
|
-
I(this, "type",
|
|
2478
|
+
I(this, "type", Hg.type);
|
|
2478
2479
|
I(this, "avcC");
|
|
2479
2480
|
I(this, "width");
|
|
2480
2481
|
I(this, "height");
|
|
@@ -2497,24 +2498,24 @@ const Mg = class Mg {
|
|
|
2497
2498
|
}
|
|
2498
2499
|
if (!C)
|
|
2499
2500
|
throw new Error("no avcC");
|
|
2500
|
-
return new
|
|
2501
|
+
return new Hg(C, t, e, g, B);
|
|
2501
2502
|
}
|
|
2502
2503
|
};
|
|
2503
|
-
I(
|
|
2504
|
-
let WQ =
|
|
2505
|
-
const
|
|
2504
|
+
I(Hg, "type", "avc1");
|
|
2505
|
+
let WQ = Hg;
|
|
2506
|
+
const qg = class qg {
|
|
2506
2507
|
constructor() {
|
|
2507
|
-
I(this, "type",
|
|
2508
|
+
I(this, "type", qg.type);
|
|
2508
2509
|
}
|
|
2509
2510
|
static decodeData(A) {
|
|
2510
|
-
return new
|
|
2511
|
+
return new qg();
|
|
2511
2512
|
}
|
|
2512
2513
|
};
|
|
2513
|
-
I(
|
|
2514
|
-
let OQ =
|
|
2515
|
-
const
|
|
2514
|
+
I(qg, "type", "dOps");
|
|
2515
|
+
let OQ = qg;
|
|
2516
|
+
const vg = class vg {
|
|
2516
2517
|
constructor(A, t, e) {
|
|
2517
|
-
I(this, "type",
|
|
2518
|
+
I(this, "type", vg.type);
|
|
2518
2519
|
I(this, "dops");
|
|
2519
2520
|
I(this, "channelCount");
|
|
2520
2521
|
I(this, "sampleRate");
|
|
@@ -2529,11 +2530,11 @@ const qg = class qg {
|
|
|
2529
2530
|
const g = A.readUint16();
|
|
2530
2531
|
A.readUint16(), t === 1 && (A.readUint64(), A.readUint64());
|
|
2531
2532
|
const B = Xc(OQ, A);
|
|
2532
|
-
return new
|
|
2533
|
+
return new vg(B, e, g);
|
|
2533
2534
|
}
|
|
2534
2535
|
};
|
|
2535
|
-
I(
|
|
2536
|
-
let VQ =
|
|
2536
|
+
I(vg, "type", "Opus");
|
|
2537
|
+
let VQ = vg;
|
|
2537
2538
|
const Zi = class Zi {
|
|
2538
2539
|
constructor(A, t) {
|
|
2539
2540
|
I(this, "type", Zi.type);
|
|
@@ -2969,9 +2970,9 @@ const oA = (i, A, t) => {
|
|
|
2969
2970
|
0,
|
|
2970
2971
|
0
|
|
2971
2972
|
])), i.writer.writeUint32(2);
|
|
2972
|
-
}, ja = (i) => "sequenceParameterSets" in i, XQ = (i) => "sequenceHeader" in i, ki = (i) => i.type == "video",
|
|
2973
|
+
}, ja = (i) => "sequenceParameterSets" in i, XQ = (i) => "sequenceHeader" in i, ki = (i) => i.type == "video", ug = (i) => i.type == "audio", rh = (i, A, t) => {
|
|
2973
2974
|
const e = i.writer.position();
|
|
2974
|
-
aA(i, X.tkhd, 0, 0, 3), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(A.trackId), i.writer.writeUint32(0), i.writer.writeUint32(A.duration * t / A.timescale), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint16(0), i.writer.writeUint16(
|
|
2975
|
+
aA(i, X.tkhd, 0, 0, 3), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(A.trackId), i.writer.writeUint32(0), i.writer.writeUint32(A.duration * t / A.timescale), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint16(0), i.writer.writeUint16(ug(A) ? 1 : 0), i.writer.writeUint16(ug(A) ? 256 : 0), i.writer.writeUint16(0), i.writer.writeBytes(new Uint8Array(
|
|
2975
2976
|
[
|
|
2976
2977
|
0,
|
|
2977
2978
|
1,
|
|
@@ -3010,7 +3011,7 @@ const oA = (i, A, t) => {
|
|
|
3010
3011
|
0,
|
|
3011
3012
|
0
|
|
3012
3013
|
]
|
|
3013
|
-
)), ki(A) ? (i.writer.writeUint32(A.width * 65536), i.writer.writeUint32(A.height * 65536)) :
|
|
3014
|
+
)), ki(A) ? (i.writer.writeUint32(A.width * 65536), i.writer.writeUint32(A.height * 65536)) : ug(A) && (i.writer.writeUint32(0), i.writer.writeUint32(0)), i.writer.writeUint32At(e, i.writer.position() - e);
|
|
3014
3015
|
}, ch = (i, A) => {
|
|
3015
3016
|
aA(i, X.mdhd, 20, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32(0), i.writer.writeUint32(A.timescale), i.writer.writeUint32(A.duration);
|
|
3016
3017
|
const t = A.lang || "und", e = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
|
|
@@ -3078,10 +3079,10 @@ const oA = (i, A, t) => {
|
|
|
3078
3079
|
const t = i.writer.position();
|
|
3079
3080
|
oA(i, X.stbl, 0);
|
|
3080
3081
|
const e = i.writer.position();
|
|
3081
|
-
aA(i, X.stsd, 0, 0, 0), i.writer.writeUint32(1), ki(A) ? wh(i, A) :
|
|
3082
|
+
aA(i, X.stsd, 0, 0, 0), i.writer.writeUint32(1), ki(A) ? wh(i, A) : ug(A) && yh(i, A), i.writer.writeUint32At(e, i.writer.position() - e), aA(i, N("stts"), 4, 0, 0), i.writer.writeUint32(0), aA(i, N("stsc"), 4, 0, 0), i.writer.writeUint32(0), aA(i, N("stsz"), 8, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32(0), aA(i, N("stco"), 4, 0, 0), i.writer.writeUint32(0), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
3082
3083
|
}, ph = (i, A) => {
|
|
3083
3084
|
const t = i.writer.position();
|
|
3084
|
-
oA(i, X.minf, 0), ki(A) ? (aA(i, X.vmhd, 8, 0, 1), i.writer.writeUint32(0), i.writer.writeUint32(0)) :
|
|
3085
|
+
oA(i, X.minf, 0), ki(A) ? (aA(i, X.vmhd, 8, 0, 1), i.writer.writeUint32(0), i.writer.writeUint32(0)) : ug(A) && (aA(i, X.smhd, 4, 0, 0), i.writer.writeUint16(0), i.writer.writeUint16(0)), dh(i), fh(i, A), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
3085
3086
|
}, Fh = (i, A) => {
|
|
3086
3087
|
const t = i.writer.position();
|
|
3087
3088
|
oA(i, X.mdia, 0), ch(i, A), hh(i, A), ph(i, A), i.writer.writeUint32At(t, i.writer.position() - t);
|
|
@@ -3448,7 +3449,7 @@ const oA = (i, A, t) => {
|
|
|
3448
3449
|
default:
|
|
3449
3450
|
throw new Error(`Unsupported codec ${i[0].codec}`);
|
|
3450
3451
|
}
|
|
3451
|
-
},
|
|
3452
|
+
}, wg = (i) => !!(i & 1), Ed = (i) => !!(i & 2), rd = (i) => !!(i & 4), cd = (i) => !!(i & 8), hd = (i) => !!(i & 16), dd = (i) => {
|
|
3452
3453
|
const A = new DataView(i, 0), t = A.getUint8(0), e = A.getUint16(1), g = A.getUint8(3), B = A.getUint8(4), C = To(new Uint8Array(i), 5, 12), Q = A.getUint32(13), o = hd(g) ? A.getInt16(17) : void 0, a = i.slice(e);
|
|
3453
3454
|
return { version: t, renditionId: B, flags: g, timestamp: C, timescale: Q, payload: a, compositionTimeOffset: o };
|
|
3454
3455
|
}, ld = "data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw", dB = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
|
|
@@ -3508,25 +3509,25 @@ class ud {
|
|
|
3508
3509
|
}
|
|
3509
3510
|
}
|
|
3510
3511
|
const wd = /\r\n|\r|\n/;
|
|
3511
|
-
var
|
|
3512
|
+
var ae, Kt;
|
|
3512
3513
|
class Ln {
|
|
3513
3514
|
constructor(A) {
|
|
3514
|
-
n(this,
|
|
3515
|
+
n(this, ae);
|
|
3515
3516
|
n(this, Kt);
|
|
3516
|
-
E(this,
|
|
3517
|
+
E(this, ae, A), E(this, Kt, 0);
|
|
3517
3518
|
}
|
|
3518
3519
|
skipEmptyLines() {
|
|
3519
3520
|
let A = 0;
|
|
3520
|
-
for (; s(this,
|
|
3521
|
+
for (; s(this, ae)[s(this, Kt)] === ""; )
|
|
3521
3522
|
tt(this, Kt)._++, A++;
|
|
3522
3523
|
return A;
|
|
3523
3524
|
}
|
|
3524
3525
|
readLine() {
|
|
3525
|
-
return s(this,
|
|
3526
|
+
return s(this, ae)[tt(this, Kt)._++];
|
|
3526
3527
|
}
|
|
3527
3528
|
takeUntilEmptyLine() {
|
|
3528
3529
|
const A = [];
|
|
3529
|
-
for (; s(this,
|
|
3530
|
+
for (; s(this, ae)[s(this, Kt)] !== ""; ) {
|
|
3530
3531
|
const t = this.readLine();
|
|
3531
3532
|
if (t === void 0)
|
|
3532
3533
|
break;
|
|
@@ -3535,10 +3536,10 @@ class Ln {
|
|
|
3535
3536
|
return A;
|
|
3536
3537
|
}
|
|
3537
3538
|
linesLeft() {
|
|
3538
|
-
return s(this,
|
|
3539
|
+
return s(this, ae).length - s(this, Kt);
|
|
3539
3540
|
}
|
|
3540
3541
|
}
|
|
3541
|
-
|
|
3542
|
+
ae = new WeakMap(), Kt = new WeakMap();
|
|
3542
3543
|
var Ri, AE, jQ;
|
|
3543
3544
|
class $a {
|
|
3544
3545
|
constructor() {
|
|
@@ -3595,7 +3596,7 @@ const Dd = (i) => {
|
|
|
3595
3596
|
A.vindralInstances = A.vindralInstances || {}, A.vindralInstances[i.getStatistics().clientId.substring(0, 8)] = i;
|
|
3596
3597
|
};
|
|
3597
3598
|
class zQ extends $A {
|
|
3598
|
-
constructor({ type: t, autoplay: e, muted: g,
|
|
3599
|
+
constructor({ type: t, autoplay: e, muted: g, volume: B, logger: C, poster: Q }) {
|
|
3599
3600
|
super();
|
|
3600
3601
|
I(this, "element");
|
|
3601
3602
|
I(this, "logger");
|
|
@@ -3706,11 +3707,11 @@ class zQ extends $A {
|
|
|
3706
3707
|
I(this, "onSeekEnd", () => {
|
|
3707
3708
|
this.seekStartTime && (this.seekTimes.push(Date.now() - this.seekStartTime), this.seekStartTime = void 0);
|
|
3708
3709
|
});
|
|
3709
|
-
this.logger =
|
|
3710
|
+
this.logger = C, this._userProvidedMuted = g, this.element = document.createElement(t), this.element instanceof HTMLVideoElement && (this.element.playsInline = !0), this.element.controls = !1, this.element.autoplay = e, this.element.muted = g, B !== void 0 && (this.element.volume = B), this.element.style.display = "block", this.element.style.width = "100%", this.element.disableRemotePlayback = !0, this.element.setAttribute(
|
|
3710
3711
|
"poster",
|
|
3711
3712
|
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAJCAQAAACRI2S5AAAAEElEQVR42mNkIAAYRxWAAQAG9gAKqv6+AwAAAABJRU5ErkJggg=="
|
|
3712
3713
|
), this.onPlayPause(), setTimeout(() => {
|
|
3713
|
-
!this.element || !
|
|
3714
|
+
!this.element || !Q || this.element.setAttribute("poster", Q);
|
|
3714
3715
|
}, 0), this.element.addEventListener("stalled", this.onEvent), this.element.addEventListener("canplay", this.onEvent), this.element.addEventListener("loadeddata", this.onEvent), this.element.addEventListener("loadedmetadata", this.onEvent), this.element.addEventListener("canplaythrough", this.onEvent), this.element.addEventListener("waiting", this.onEvent), this.element.addEventListener("playing", this.onPlayPause), this.element.addEventListener("pause", this.onPlayPause), this.element.addEventListener("seeked", this.onSeekEnd), this.element.addEventListener("seeking", this.onSeekStart), this.element.addEventListener("volumechange", this.onVolumeChange), this.element.addEventListener("timeupdate", this.onBufferStateChange), this.element.addEventListener("progress", this.onBufferStateChange);
|
|
3715
3716
|
}
|
|
3716
3717
|
get seekTime() {
|
|
@@ -3759,7 +3760,7 @@ const md = (i) => {
|
|
|
3759
3760
|
return Gi(i) ? A = {
|
|
3760
3761
|
type: "media-source",
|
|
3761
3762
|
audio: {
|
|
3762
|
-
contentType:
|
|
3763
|
+
contentType: Ce(i),
|
|
3763
3764
|
bitrate: i.bitRate,
|
|
3764
3765
|
channels: i.channels.toString(),
|
|
3765
3766
|
samplerate: i.sampleRate
|
|
@@ -3767,7 +3768,7 @@ const md = (i) => {
|
|
|
3767
3768
|
} : A = {
|
|
3768
3769
|
type: "media-source",
|
|
3769
3770
|
video: {
|
|
3770
|
-
contentType:
|
|
3771
|
+
contentType: Ce(i),
|
|
3771
3772
|
bitrate: i.bitRate,
|
|
3772
3773
|
width: i.width,
|
|
3773
3774
|
height: i.height,
|
|
@@ -4314,26 +4315,26 @@ function sE(i, A) {
|
|
|
4314
4315
|
}
|
|
4315
4316
|
});
|
|
4316
4317
|
}
|
|
4317
|
-
var
|
|
4318
|
+
var Ee, rs;
|
|
4318
4319
|
class Td {
|
|
4319
4320
|
constructor(A, t) {
|
|
4320
|
-
n(this,
|
|
4321
|
+
n(this, Ee);
|
|
4321
4322
|
n(this, rs);
|
|
4322
|
-
E(this,
|
|
4323
|
+
E(this, Ee, A), E(this, rs, t);
|
|
4323
4324
|
}
|
|
4324
4325
|
start(A) {
|
|
4325
|
-
s(this,
|
|
4326
|
+
s(this, Ee).addEventListener("message", (t) => {
|
|
4326
4327
|
if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
|
|
4327
4328
|
const e = new Uint8Array(t.data);
|
|
4328
4329
|
e[0] == s(this, rs) && A.enqueue(e.subarray(1));
|
|
4329
4330
|
}
|
|
4330
|
-
}), s(this,
|
|
4331
|
+
}), s(this, Ee).addEventListener("error", () => A.error(new Error("WebSocket error"))), s(this, Ee).addEventListener("close", () => ka(() => A.close()));
|
|
4331
4332
|
}
|
|
4332
4333
|
cancel(A) {
|
|
4333
|
-
s(this,
|
|
4334
|
+
s(this, Ee).close(void 0, A);
|
|
4334
4335
|
}
|
|
4335
4336
|
}
|
|
4336
|
-
|
|
4337
|
+
Ee = new WeakMap(), rs = new WeakMap();
|
|
4337
4338
|
var mt, _e, $e, Ai;
|
|
4338
4339
|
class Pd {
|
|
4339
4340
|
constructor(A) {
|
|
@@ -4359,7 +4360,7 @@ class Pd {
|
|
|
4359
4360
|
}
|
|
4360
4361
|
}
|
|
4361
4362
|
mt = new WeakMap(), _e = new WeakMap(), $e = new WeakMap(), Ai = new WeakMap();
|
|
4362
|
-
var St, cs, ti, yt, rC, j,
|
|
4363
|
+
var St, cs, ti, yt, rC, j, cg, DB, Ke, mB, ie;
|
|
4363
4364
|
class jB {
|
|
4364
4365
|
constructor(A, t) {
|
|
4365
4366
|
n(this, j);
|
|
@@ -4372,7 +4373,7 @@ class jB {
|
|
|
4372
4373
|
}
|
|
4373
4374
|
readUnsigned8() {
|
|
4374
4375
|
return r(this, null, function* () {
|
|
4375
|
-
return yield l(this, j,
|
|
4376
|
+
return yield l(this, j, Ke).call(this, 1), l(this, j, ie).call(this, 1)[0];
|
|
4376
4377
|
});
|
|
4377
4378
|
}
|
|
4378
4379
|
readString() {
|
|
@@ -4391,23 +4392,23 @@ class jB {
|
|
|
4391
4392
|
}
|
|
4392
4393
|
readBigVarInt() {
|
|
4393
4394
|
return r(this, null, function* () {
|
|
4394
|
-
yield l(this, j,
|
|
4395
|
+
yield l(this, j, Ke).call(this, 1);
|
|
4395
4396
|
const A = (l(this, j, mB).call(this, 1)[0] & 192) >> 6;
|
|
4396
4397
|
switch (s(this, St)[s(this, yt)] = l(this, j, mB).call(this, 1)[0] & 63, A) {
|
|
4397
4398
|
case 0:
|
|
4398
4399
|
return J(l(this, j, ie).call(this, 1)[0]);
|
|
4399
4400
|
case 1: {
|
|
4400
|
-
yield l(this, j,
|
|
4401
|
+
yield l(this, j, Ke).call(this, 2);
|
|
4401
4402
|
const t = l(this, j, ie).call(this, 2), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
4402
4403
|
return J(e.getUint16(0));
|
|
4403
4404
|
}
|
|
4404
4405
|
case 2: {
|
|
4405
|
-
yield l(this, j,
|
|
4406
|
+
yield l(this, j, Ke).call(this, 4);
|
|
4406
4407
|
const t = l(this, j, ie).call(this, 4), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
4407
4408
|
return J(e.getUint32(0));
|
|
4408
4409
|
}
|
|
4409
4410
|
case 3: {
|
|
4410
|
-
yield l(this, j,
|
|
4411
|
+
yield l(this, j, Ke).call(this, 8);
|
|
4411
4412
|
const t = l(this, j, ie).call(this, 8), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
4412
4413
|
if (typeof e.getBigUint64 != "undefined")
|
|
4413
4414
|
return J(e.getBigUint64(0));
|
|
@@ -4421,19 +4422,19 @@ class jB {
|
|
|
4421
4422
|
}
|
|
4422
4423
|
read(A) {
|
|
4423
4424
|
return r(this, null, function* () {
|
|
4424
|
-
return yield l(this, j,
|
|
4425
|
+
return yield l(this, j, Ke).call(this, A), l(this, j, ie).call(this, A);
|
|
4425
4426
|
});
|
|
4426
4427
|
}
|
|
4427
4428
|
readAll() {
|
|
4428
4429
|
return r(this, null, function* () {
|
|
4429
4430
|
for (; yield l(this, j, DB).call(this); )
|
|
4430
4431
|
;
|
|
4431
|
-
return l(this, j, ie).call(this, l(this, j,
|
|
4432
|
+
return l(this, j, ie).call(this, l(this, j, cg).call(this));
|
|
4432
4433
|
});
|
|
4433
4434
|
}
|
|
4434
4435
|
isDone() {
|
|
4435
4436
|
return r(this, null, function* () {
|
|
4436
|
-
return l(this, j,
|
|
4437
|
+
return l(this, j, cg).call(this) > 0 ? !1 : (yield l(this, j, DB).call(this)) == 0;
|
|
4437
4438
|
});
|
|
4438
4439
|
}
|
|
4439
4440
|
closed() {
|
|
@@ -4447,14 +4448,14 @@ class jB {
|
|
|
4447
4448
|
});
|
|
4448
4449
|
}
|
|
4449
4450
|
}
|
|
4450
|
-
St = new WeakMap(), cs = new WeakMap(), ti = new WeakMap(), yt = new WeakMap(), rC = new WeakMap(), j = new WeakSet(),
|
|
4451
|
+
St = new WeakMap(), cs = new WeakMap(), ti = new WeakMap(), yt = new WeakMap(), rC = new WeakMap(), j = new WeakSet(), cg = function() {
|
|
4451
4452
|
return s(this, St).length - s(this, yt);
|
|
4452
4453
|
}, DB = function() {
|
|
4453
4454
|
return r(this, null, function* () {
|
|
4454
4455
|
const { value: A, done: t } = yield s(this, ti).read();
|
|
4455
4456
|
if (t)
|
|
4456
4457
|
return Promise.resolve(0);
|
|
4457
|
-
if (l(this, j,
|
|
4458
|
+
if (l(this, j, cg).call(this) === 0)
|
|
4458
4459
|
E(this, St, A);
|
|
4459
4460
|
else {
|
|
4460
4461
|
const g = s(this, St).subarray(s(this, yt)), B = new Uint8Array(g.length + A.length);
|
|
@@ -4462,9 +4463,9 @@ St = new WeakMap(), cs = new WeakMap(), ti = new WeakMap(), yt = new WeakMap(),
|
|
|
4462
4463
|
}
|
|
4463
4464
|
return E(this, yt, 0), Promise.resolve(A.length);
|
|
4464
4465
|
});
|
|
4465
|
-
},
|
|
4466
|
+
}, Ke = function(A) {
|
|
4466
4467
|
return r(this, null, function* () {
|
|
4467
|
-
for (; l(this, j,
|
|
4468
|
+
for (; l(this, j, cg).call(this) < A; )
|
|
4468
4469
|
if ((yield l(this, j, DB).call(this)) === 0)
|
|
4469
4470
|
throw new Error("Read failed");
|
|
4470
4471
|
});
|
|
@@ -4516,10 +4517,10 @@ const CE = {
|
|
|
4516
4517
|
OPEN: 1
|
|
4517
4518
|
};
|
|
4518
4519
|
var HA, YA, ei, hC;
|
|
4519
|
-
const
|
|
4520
|
+
const Kg = class Kg {
|
|
4520
4521
|
constructor(A) {
|
|
4521
4522
|
n(this, HA, 0);
|
|
4522
|
-
n(this, YA, new Uint8Array(
|
|
4523
|
+
n(this, YA, new Uint8Array(Kg.DEFAULT_BUFFER_SIZE));
|
|
4523
4524
|
n(this, ei);
|
|
4524
4525
|
n(this, hC, new TextEncoder());
|
|
4525
4526
|
E(this, ei, A);
|
|
@@ -4555,14 +4556,14 @@ const vg = class vg {
|
|
|
4555
4556
|
flush() {
|
|
4556
4557
|
if (s(this, ei).readyState !== CE.OPEN)
|
|
4557
4558
|
throw new Error("Writer is not open");
|
|
4558
|
-
return s(this, ei).send(s(this, YA).subarray(0, s(this, HA))), E(this, HA, 0), E(this, YA, new Uint8Array(
|
|
4559
|
+
return s(this, ei).send(s(this, YA).subarray(0, s(this, HA))), E(this, HA, 0), E(this, YA, new Uint8Array(Kg.DEFAULT_BUFFER_SIZE)), Promise.resolve();
|
|
4559
4560
|
}
|
|
4560
4561
|
close() {
|
|
4561
4562
|
return s(this, ei).close(), Promise.resolve();
|
|
4562
4563
|
}
|
|
4563
4564
|
};
|
|
4564
|
-
HA = new WeakMap(), YA = new WeakMap(), ei = new WeakMap(), hC = new WeakMap(), I(
|
|
4565
|
-
let Og =
|
|
4565
|
+
HA = new WeakMap(), YA = new WeakMap(), ei = new WeakMap(), hC = new WeakMap(), I(Kg, "DEFAULT_BUFFER_SIZE", 1024);
|
|
4566
|
+
let Og = Kg;
|
|
4566
4567
|
const QE = 2 ** 6 - 1, oE = 2 ** 14 - 1, nE = 2 ** 30 - 1, xd = Number.MAX_SAFE_INTEGER, Wd = typeof BigInt == "function" ? J(2) ** J(62) - J(1) : J(Number.MAX_SAFE_INTEGER);
|
|
4567
4568
|
function BQ(i, A) {
|
|
4568
4569
|
return A[0] = i, A.subarray(0, 1);
|
|
@@ -4625,7 +4626,7 @@ function Wo(i, A) {
|
|
|
4625
4626
|
});
|
|
4626
4627
|
}
|
|
4627
4628
|
const zB = J(2);
|
|
4628
|
-
function
|
|
4629
|
+
function Bg(i) {
|
|
4629
4630
|
return r(this, null, function* () {
|
|
4630
4631
|
const A = yield i.readVarInt(), t = /* @__PURE__ */ new Map();
|
|
4631
4632
|
for (let e = 0; e < A; e++) {
|
|
@@ -4635,7 +4636,7 @@ function sg(i) {
|
|
|
4635
4636
|
return t;
|
|
4636
4637
|
});
|
|
4637
4638
|
}
|
|
4638
|
-
function
|
|
4639
|
+
function Cg(i, A) {
|
|
4639
4640
|
return r(this, null, function* () {
|
|
4640
4641
|
yield i.writeVarInt(A.size);
|
|
4641
4642
|
for (const [t, e] of A)
|
|
@@ -4647,13 +4648,13 @@ function Od(i) {
|
|
|
4647
4648
|
return {
|
|
4648
4649
|
type: R.Announce,
|
|
4649
4650
|
namespace: yield CQ(i),
|
|
4650
|
-
params: yield
|
|
4651
|
+
params: yield Bg(i)
|
|
4651
4652
|
};
|
|
4652
4653
|
});
|
|
4653
4654
|
}
|
|
4654
4655
|
function Vd(i, A) {
|
|
4655
4656
|
return r(this, null, function* () {
|
|
4656
|
-
yield Wo(i, A.namespace), yield
|
|
4657
|
+
yield Wo(i, A.namespace), yield Cg(i, A.params);
|
|
4657
4658
|
});
|
|
4658
4659
|
}
|
|
4659
4660
|
function Zd(i) {
|
|
@@ -4758,7 +4759,7 @@ function uE(i, A) {
|
|
|
4758
4759
|
}
|
|
4759
4760
|
function $d(i) {
|
|
4760
4761
|
return r(this, null, function* () {
|
|
4761
|
-
const A = yield i.readBigVarInt(), t = yield i.readBigVarInt(), e = yield CQ(i), g = yield i.readString(), B = yield i.readUnsigned8(), C = yield lE(i), Q = yield zd(i), o = yield
|
|
4762
|
+
const A = yield i.readBigVarInt(), t = yield i.readBigVarInt(), e = yield CQ(i), g = yield i.readString(), B = yield i.readUnsigned8(), C = yield lE(i), Q = yield zd(i), o = yield Bg(i);
|
|
4762
4763
|
if (Q.type === "absolute-range") {
|
|
4763
4764
|
const a = Q.start.group > Q.end.group, c = Q.start.group === Q.end.group && Q.start.object > Q.end.object;
|
|
4764
4765
|
if (a || c)
|
|
@@ -4779,7 +4780,7 @@ function $d(i) {
|
|
|
4779
4780
|
}
|
|
4780
4781
|
function Al(i, A) {
|
|
4781
4782
|
return r(this, null, function* () {
|
|
4782
|
-
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.trackAlias), yield Wo(i, A.namespace), yield i.writeString(A.name), yield i.writeUnsigned8(A.subscriberPriority), yield uE(i, A.groupOrder), yield _d(i, A.filterType), yield
|
|
4783
|
+
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.trackAlias), yield Wo(i, A.namespace), yield i.writeString(A.name), yield i.writeUnsigned8(A.subscriberPriority), yield uE(i, A.groupOrder), yield _d(i, A.filterType), yield Cg(i, A.params);
|
|
4783
4784
|
});
|
|
4784
4785
|
}
|
|
4785
4786
|
const eo = {
|
|
@@ -4833,7 +4834,7 @@ function gl(i) {
|
|
|
4833
4834
|
group: yield i.readBigVarInt(),
|
|
4834
4835
|
object: yield i.readBigVarInt()
|
|
4835
4836
|
});
|
|
4836
|
-
const C = yield
|
|
4837
|
+
const C = yield Bg(i);
|
|
4837
4838
|
return {
|
|
4838
4839
|
type: R.SubscribeOk,
|
|
4839
4840
|
id: A,
|
|
@@ -4846,12 +4847,12 @@ function gl(i) {
|
|
|
4846
4847
|
}
|
|
4847
4848
|
function sl(i, A) {
|
|
4848
4849
|
return r(this, null, function* () {
|
|
4849
|
-
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.expires), yield uE(i, A.groupOrder), yield i.writeUnsigned8(A.largestInfo ? 1 : 0), A.largestInfo && (yield i.writeBigVarInt(A.largestInfo.group), yield i.writeBigVarInt(A.largestInfo.object)), yield
|
|
4850
|
+
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.expires), yield uE(i, A.groupOrder), yield i.writeUnsigned8(A.largestInfo ? 1 : 0), A.largestInfo && (yield i.writeBigVarInt(A.largestInfo.group), yield i.writeBigVarInt(A.largestInfo.object)), yield Cg(i, A.params);
|
|
4850
4851
|
});
|
|
4851
4852
|
}
|
|
4852
4853
|
function Bl(i) {
|
|
4853
4854
|
return r(this, null, function* () {
|
|
4854
|
-
const A = yield i.readBigVarInt(), t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), g = yield i.readBigVarInt(), B = yield i.readBigVarInt(), C = yield i.readUnsigned8(), Q = yield
|
|
4855
|
+
const A = yield i.readBigVarInt(), t = yield i.readBigVarInt(), e = yield i.readBigVarInt(), g = yield i.readBigVarInt(), B = yield i.readBigVarInt(), C = yield i.readUnsigned8(), Q = yield Bg(i), o = t > g, a = t === g && e > B;
|
|
4855
4856
|
if (o || a)
|
|
4856
4857
|
throw new Error("Invalid filter range");
|
|
4857
4858
|
return {
|
|
@@ -4866,7 +4867,7 @@ function Bl(i) {
|
|
|
4866
4867
|
}
|
|
4867
4868
|
function Cl(i, A) {
|
|
4868
4869
|
return r(this, null, function* () {
|
|
4869
|
-
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.start.group), yield i.writeBigVarInt(A.start.object), yield i.writeBigVarInt(A.end.group), yield i.writeBigVarInt(A.end.object), yield i.writeUnsigned8(A.subscriberPriority), yield
|
|
4870
|
+
yield i.writeBigVarInt(A.id), yield i.writeBigVarInt(A.start.group), yield i.writeBigVarInt(A.start.object), yield i.writeBigVarInt(A.end.group), yield i.writeBigVarInt(A.end.object), yield i.writeUnsigned8(A.subscriberPriority), yield Cg(i, A.params);
|
|
4870
4871
|
});
|
|
4871
4872
|
}
|
|
4872
4873
|
const Ql = {
|
|
@@ -4892,7 +4893,7 @@ function ol(i, A) {
|
|
|
4892
4893
|
yield i.writeVarInt(A.supportedVersions.length);
|
|
4893
4894
|
for (const t of A.supportedVersions)
|
|
4894
4895
|
yield i.writeVarInt(t.value);
|
|
4895
|
-
yield
|
|
4896
|
+
yield Cg(i, A.parameters);
|
|
4896
4897
|
});
|
|
4897
4898
|
}
|
|
4898
4899
|
function nl(i) {
|
|
@@ -4900,7 +4901,7 @@ function nl(i) {
|
|
|
4900
4901
|
const A = [], t = yield i.readVarInt();
|
|
4901
4902
|
for (let g = 0; g < t; g++)
|
|
4902
4903
|
A.push(yield DE(i));
|
|
4903
|
-
const e = yield
|
|
4904
|
+
const e = yield Bg(i);
|
|
4904
4905
|
if (!e.has(_B.Role))
|
|
4905
4906
|
throw new Error("Role parameter is required");
|
|
4906
4907
|
return {
|
|
@@ -4912,7 +4913,7 @@ function nl(i) {
|
|
|
4912
4913
|
}
|
|
4913
4914
|
function al(i, A) {
|
|
4914
4915
|
return r(this, null, function* () {
|
|
4915
|
-
yield i.writeVarInt(A.selectedVersion.value), yield
|
|
4916
|
+
yield i.writeVarInt(A.selectedVersion.value), yield Cg(i, A.parameters);
|
|
4916
4917
|
});
|
|
4917
4918
|
}
|
|
4918
4919
|
function El(i) {
|
|
@@ -4920,7 +4921,7 @@ function El(i) {
|
|
|
4920
4921
|
const A = yield DE(i);
|
|
4921
4922
|
if (A.type !== "known")
|
|
4922
4923
|
throw new Error("Expected known version");
|
|
4923
|
-
const t = yield
|
|
4924
|
+
const t = yield Bg(i);
|
|
4924
4925
|
if (!t.has(_B.Role))
|
|
4925
4926
|
throw new Error("Role parameter is required");
|
|
4926
4927
|
return {
|
|
@@ -5223,12 +5224,12 @@ class Dl {
|
|
|
5223
5224
|
this.state = A;
|
|
5224
5225
|
}
|
|
5225
5226
|
}
|
|
5226
|
-
var DI,
|
|
5227
|
+
var DI, re, ii, uC, Ii, Qt;
|
|
5227
5228
|
const ji = class ji {
|
|
5228
5229
|
constructor(A) {
|
|
5229
5230
|
I(this, "subscribe");
|
|
5230
5231
|
n(this, DI, new z());
|
|
5231
|
-
n(this,
|
|
5232
|
+
n(this, re, new z());
|
|
5232
5233
|
n(this, ii, new z());
|
|
5233
5234
|
n(this, uC, Date.now());
|
|
5234
5235
|
n(this, Ii, new z());
|
|
@@ -5247,10 +5248,10 @@ const ji = class ji {
|
|
|
5247
5248
|
}
|
|
5248
5249
|
onError(A) {
|
|
5249
5250
|
const t = new Error(A.reason);
|
|
5250
|
-
return s(this, DI).reject(t), s(this,
|
|
5251
|
+
return s(this, DI).reject(t), s(this, re).reject(t), t;
|
|
5251
5252
|
}
|
|
5252
5253
|
onDone(A) {
|
|
5253
|
-
A.finalInfo && (s(this, Qt) || E(this, Qt, { startGroup: J(0) }), s(this, Qt).endGroup = A.finalInfo.group), s(this,
|
|
5254
|
+
A.finalInfo && (s(this, Qt) || E(this, Qt, { startGroup: J(0) }), s(this, Qt).endGroup = A.finalInfo.group), s(this, re).resolve(A);
|
|
5254
5255
|
}
|
|
5255
5256
|
onUnsubscribe(A) {
|
|
5256
5257
|
s(this, ii).resolve(A);
|
|
@@ -5259,12 +5260,12 @@ const ji = class ji {
|
|
|
5259
5260
|
const t = Math.max(0, Date.now() - s(this, uC)), e = Number(A.expires);
|
|
5260
5261
|
if (e > 0) {
|
|
5261
5262
|
const g = Math.max(ji.minGraceTime, Math.min(e / 10, ji.maxGraceTime));
|
|
5262
|
-
Promise.race([
|
|
5263
|
+
Promise.race([Ue(e - g - t), this.done().catch(H)]).then(() => s(this, Ii).resolve(this.expiryState())).catch(H);
|
|
5263
5264
|
}
|
|
5264
5265
|
s(this, DI).resolve(A);
|
|
5265
5266
|
}
|
|
5266
5267
|
done() {
|
|
5267
|
-
return s(this,
|
|
5268
|
+
return s(this, re).promise;
|
|
5268
5269
|
}
|
|
5269
5270
|
ok() {
|
|
5270
5271
|
return s(this, DI).promise;
|
|
@@ -5277,7 +5278,7 @@ const ji = class ji {
|
|
|
5277
5278
|
}
|
|
5278
5279
|
// Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
|
|
5279
5280
|
expiryState() {
|
|
5280
|
-
return s(this,
|
|
5281
|
+
return s(this, re).resolved && s(this, re).resolved.errorCode !== eo.Expired ? "done" : s(this, ii).pending ? "active" : "unsubscribed";
|
|
5281
5282
|
}
|
|
5282
5283
|
unsubscribed() {
|
|
5283
5284
|
return s(this, ii).promise;
|
|
@@ -5293,7 +5294,7 @@ const ji = class ji {
|
|
|
5293
5294
|
return s(this, Ii).promise;
|
|
5294
5295
|
}
|
|
5295
5296
|
};
|
|
5296
|
-
DI = new WeakMap(),
|
|
5297
|
+
DI = new WeakMap(), re = new WeakMap(), ii = new WeakMap(), uC = new WeakMap(), Ii = new WeakMap(), Qt = new WeakMap(), I(ji, "maxGraceTime", 15e3), I(ji, "minGraceTime", 3e3);
|
|
5297
5298
|
let AC = ji;
|
|
5298
5299
|
var fA, ws;
|
|
5299
5300
|
class ml {
|
|
@@ -5445,10 +5446,10 @@ class yl {
|
|
|
5445
5446
|
}
|
|
5446
5447
|
}
|
|
5447
5448
|
gi = new WeakMap(), fs = new WeakMap(), SI = new WeakMap(), ps = new WeakMap(), yI = new WeakMap();
|
|
5448
|
-
var Fs, si,
|
|
5449
|
+
var Fs, si, ce, Ti;
|
|
5449
5450
|
class fl {
|
|
5450
5451
|
constructor(A, t, e) {
|
|
5451
|
-
n(this,
|
|
5452
|
+
n(this, ce);
|
|
5452
5453
|
I(this, "state");
|
|
5453
5454
|
n(this, Fs);
|
|
5454
5455
|
n(this, si);
|
|
@@ -5474,19 +5475,19 @@ class fl {
|
|
|
5474
5475
|
});
|
|
5475
5476
|
}
|
|
5476
5477
|
invalidRange() {
|
|
5477
|
-
return l(this,
|
|
5478
|
+
return l(this, ce, Ti).call(this, J(1), "Invalid range");
|
|
5478
5479
|
}
|
|
5479
5480
|
retryTrackAlias() {
|
|
5480
|
-
return l(this,
|
|
5481
|
+
return l(this, ce, Ti).call(this, J(2), "Retry track alias");
|
|
5481
5482
|
}
|
|
5482
5483
|
trackDoesNotExist() {
|
|
5483
|
-
return l(this,
|
|
5484
|
+
return l(this, ce, Ti).call(this, J(3), "Track does not exist");
|
|
5484
5485
|
}
|
|
5485
5486
|
unauthorized() {
|
|
5486
|
-
return l(this,
|
|
5487
|
+
return l(this, ce, Ti).call(this, J(4), "Unauthorized");
|
|
5487
5488
|
}
|
|
5488
5489
|
timeout() {
|
|
5489
|
-
return l(this,
|
|
5490
|
+
return l(this, ce, Ti).call(this, J(5), "Timeout");
|
|
5490
5491
|
}
|
|
5491
5492
|
[Nt()]() {
|
|
5492
5493
|
return this.trackDoesNotExist();
|
|
@@ -5495,7 +5496,7 @@ class fl {
|
|
|
5495
5496
|
return this.trackDoesNotExist();
|
|
5496
5497
|
}
|
|
5497
5498
|
}
|
|
5498
|
-
Fs = new WeakMap(), si = new WeakMap(),
|
|
5499
|
+
Fs = new WeakMap(), si = new WeakMap(), ce = new WeakSet(), Ti = function(A, t) {
|
|
5499
5500
|
const e = {
|
|
5500
5501
|
type: R.SubscribeError,
|
|
5501
5502
|
id: this.state.subscribe.id,
|
|
@@ -5505,23 +5506,23 @@ Fs = new WeakMap(), si = new WeakMap(), re = new WeakSet(), Ti = function(A, t)
|
|
|
5505
5506
|
};
|
|
5506
5507
|
return s(this, si).push(e);
|
|
5507
5508
|
};
|
|
5508
|
-
var oa, fI, Gs, pI, Bi,
|
|
5509
|
+
var oa, fI, Gs, pI, Bi, he, de, le, MQ;
|
|
5509
5510
|
oa = [qA({ context: "Session", enter: "info", error: "error" })];
|
|
5510
5511
|
class io {
|
|
5511
5512
|
constructor(A, t, e) {
|
|
5512
|
-
|
|
5513
|
+
Me(MQ, 5, this);
|
|
5513
5514
|
n(this, fI);
|
|
5514
5515
|
n(this, Gs);
|
|
5515
5516
|
n(this, pI);
|
|
5516
5517
|
n(this, Bi, SA.get().createContext("Publisher"));
|
|
5517
|
-
n(this, ce, new bA(/* @__PURE__ */ new Map()));
|
|
5518
5518
|
n(this, he, new bA(/* @__PURE__ */ new Map()));
|
|
5519
|
-
n(this, de, new
|
|
5519
|
+
n(this, de, new bA(/* @__PURE__ */ new Map()));
|
|
5520
|
+
n(this, le, new eQ(10));
|
|
5520
5521
|
E(this, fI, A), E(this, Gs, t), E(this, pI, e);
|
|
5521
5522
|
}
|
|
5522
5523
|
announce(A) {
|
|
5523
5524
|
return r(this, null, function* () {
|
|
5524
|
-
if (s(this,
|
|
5525
|
+
if (s(this, he).current().has(A.join("/")))
|
|
5525
5526
|
throw new Error("Duplicate announcement");
|
|
5526
5527
|
const t = /* @__PURE__ */ new Map(), e = s(this, fI).authToken();
|
|
5527
5528
|
e && t.set(zB, { type: zB, payload: new TextEncoder().encode(e) });
|
|
@@ -5530,15 +5531,15 @@ class io {
|
|
|
5530
5531
|
namespace: A,
|
|
5531
5532
|
params: t
|
|
5532
5533
|
}, B = wl(g);
|
|
5533
|
-
if (s(this,
|
|
5534
|
+
if (s(this, he).update((Q) => Q.set(g.namespace.join("/"), B)), yield s(this, pI).push(g), !(yield Promise.race([B.state.ok(), s(this, fI).closed()])))
|
|
5534
5535
|
throw new Error("Session closed");
|
|
5535
5536
|
});
|
|
5536
5537
|
}
|
|
5537
5538
|
close() {
|
|
5538
|
-
s(this,
|
|
5539
|
+
s(this, de).current().forEach((A) => A.close()), s(this, de).close(), s(this, he).close(), s(this, le).close();
|
|
5539
5540
|
}
|
|
5540
5541
|
incomingSubscriptions() {
|
|
5541
|
-
return s(this,
|
|
5542
|
+
return s(this, le);
|
|
5542
5543
|
}
|
|
5543
5544
|
onMessage(A) {
|
|
5544
5545
|
return r(this, null, function* () {
|
|
@@ -5546,36 +5547,36 @@ class io {
|
|
|
5546
5547
|
case R.Subscribe:
|
|
5547
5548
|
{
|
|
5548
5549
|
const t = new AC(A);
|
|
5549
|
-
if (s(this,
|
|
5550
|
-
const e = yield s(this,
|
|
5550
|
+
if (s(this, de).update((e) => (e.set(A.id, t), e)), s(this, le).isFull()) {
|
|
5551
|
+
const e = yield s(this, le).pop();
|
|
5551
5552
|
yield e == null ? void 0 : e.timeout();
|
|
5552
5553
|
}
|
|
5553
|
-
yield s(this,
|
|
5554
|
+
yield s(this, le).push(
|
|
5554
5555
|
new fl(t, s(this, Gs), s(this, pI))
|
|
5555
5556
|
);
|
|
5556
5557
|
}
|
|
5557
5558
|
break;
|
|
5558
5559
|
case R.SubscribeUpdate:
|
|
5559
5560
|
{
|
|
5560
|
-
const t = s(this,
|
|
5561
|
+
const t = s(this, de).current().get(A.id);
|
|
5561
5562
|
t || s(this, Bi).debug("No subscription found", A), t == null || t.onUpdate(A);
|
|
5562
5563
|
}
|
|
5563
5564
|
break;
|
|
5564
5565
|
case R.Unsubscribe:
|
|
5565
5566
|
{
|
|
5566
|
-
const t = s(this,
|
|
5567
|
+
const t = s(this, de).current().get(A.id);
|
|
5567
5568
|
t || s(this, Bi).debug("No subscription found", A), t == null || t.onUnsubscribe(A);
|
|
5568
5569
|
}
|
|
5569
5570
|
break;
|
|
5570
5571
|
case R.AnnounceOk:
|
|
5571
5572
|
{
|
|
5572
|
-
const t = s(this,
|
|
5573
|
+
const t = s(this, he).current().get(A.namespace.join("/"));
|
|
5573
5574
|
t || s(this, Bi).debug("No announcement found", A), t == null || t.state.onOk(A);
|
|
5574
5575
|
}
|
|
5575
5576
|
break;
|
|
5576
5577
|
case R.AnnounceError:
|
|
5577
5578
|
{
|
|
5578
|
-
const t = s(this,
|
|
5579
|
+
const t = s(this, he).current().get(A.namespace.join("/"));
|
|
5579
5580
|
t || s(this, Bi).debug("No announcement found", A), t == null || t.state.onError(A);
|
|
5580
5581
|
}
|
|
5581
5582
|
break;
|
|
@@ -5583,7 +5584,7 @@ class io {
|
|
|
5583
5584
|
});
|
|
5584
5585
|
}
|
|
5585
5586
|
}
|
|
5586
|
-
MQ =
|
|
5587
|
+
MQ = Je(null), fI = new WeakMap(), Gs = new WeakMap(), pI = new WeakMap(), Bi = new WeakMap(), he = new WeakMap(), de = new WeakMap(), le = new WeakMap(), GA(MQ, 1, "announce", oa, io), ee(MQ, io);
|
|
5587
5588
|
function pl(i, A) {
|
|
5588
5589
|
const t = new AC(A), [e, g] = Yo(100), B = new Fl(t, e), C = new ME(i, t, g);
|
|
5589
5590
|
return [B, C];
|
|
@@ -5613,10 +5614,10 @@ class Fl {
|
|
|
5613
5614
|
}
|
|
5614
5615
|
}
|
|
5615
5616
|
Ci = new WeakMap();
|
|
5616
|
-
var na, FI, dA, GI, kI, HQ, RI,
|
|
5617
|
+
var na, FI, dA, GI, kI, HQ, RI, hg;
|
|
5617
5618
|
class ME {
|
|
5618
5619
|
constructor(A, t, e) {
|
|
5619
|
-
|
|
5620
|
+
Me(HQ, 5, this);
|
|
5620
5621
|
n(this, RI);
|
|
5621
5622
|
n(this, FI);
|
|
5622
5623
|
n(this, dA);
|
|
@@ -5777,23 +5778,23 @@ class ME {
|
|
|
5777
5778
|
});
|
|
5778
5779
|
}
|
|
5779
5780
|
[(na = [qA({ context: "SubscriptionConsumer", enter: "info" })], Nt())]() {
|
|
5780
|
-
return l(this, RI,
|
|
5781
|
+
return l(this, RI, hg).call(this);
|
|
5781
5782
|
}
|
|
5782
5783
|
[Symbol.asyncDispose]() {
|
|
5783
|
-
return l(this, RI,
|
|
5784
|
+
return l(this, RI, hg).call(this);
|
|
5784
5785
|
}
|
|
5785
5786
|
}
|
|
5786
|
-
HQ =
|
|
5787
|
+
HQ = Je(null), FI = new WeakMap(), dA = new WeakMap(), GI = new WeakMap(), kI = new WeakMap(), RI = new WeakSet(), hg = function() {
|
|
5787
5788
|
return r(this, null, function* () {
|
|
5788
5789
|
return yield this.close(), this.unsubscribe();
|
|
5789
5790
|
});
|
|
5790
|
-
},
|
|
5791
|
+
}, hg = GA(HQ, 17, "#dispose", na, RI, hg), ee(HQ, ME);
|
|
5791
5792
|
const Gl = 2e3;
|
|
5792
5793
|
var aa, Ea, ra, ca, Pt, TA, Qi, oi, Ki, Ut, yB, Pi;
|
|
5793
5794
|
ca = [qA({ context: "Session", return: "debug" })], ra = [qA({ context: "Session", enter: "info", error: "error" })], Ea = [qA({ context: "Session", enter: "debug" })], aa = [qA({ context: "Session", enter: "debug" })];
|
|
5794
5795
|
class SB {
|
|
5795
5796
|
constructor(A, t) {
|
|
5796
|
-
|
|
5797
|
+
Me(Ki, 5, this);
|
|
5797
5798
|
n(this, Ut);
|
|
5798
5799
|
// The owner session of the subscriber
|
|
5799
5800
|
n(this, Pt);
|
|
@@ -5822,7 +5823,7 @@ class SB {
|
|
|
5822
5823
|
}, [a, c] = pl(s(this, Qi), o);
|
|
5823
5824
|
if (s(this, TA).update((d) => d.set(C, a)), yield s(this, Qi).push(o), !(yield Promise.race([a.state.ok(), s(this, Pt).closed()])))
|
|
5824
5825
|
throw new Error("Session closed");
|
|
5825
|
-
return c.closed().then(() => Promise.race([
|
|
5826
|
+
return c.closed().then(() => Promise.race([Ue(Gl), this.closed()])).then(() => l(this, Ut, Pi).call(this, c.id)).catch(() => l(this, Ut, Pi).call(this, c.id)), c;
|
|
5826
5827
|
});
|
|
5827
5828
|
}
|
|
5828
5829
|
closed() {
|
|
@@ -5878,7 +5879,7 @@ class SB {
|
|
|
5878
5879
|
s(this, TA).current().forEach((A) => A.close()), s(this, TA).close();
|
|
5879
5880
|
}
|
|
5880
5881
|
}
|
|
5881
|
-
Ki =
|
|
5882
|
+
Ki = Je(null), Pt = new WeakMap(), TA = new WeakMap(), Qi = new WeakMap(), oi = new WeakMap(), Ut = new WeakSet(), yB = function() {
|
|
5882
5883
|
return r(this, null, function* () {
|
|
5883
5884
|
try {
|
|
5884
5885
|
for (var A = iA(s(this, TA)), t, e, g; t = !(e = yield A.next()).done; t = !1) {
|
|
@@ -5900,10 +5901,10 @@ Ki = Le(null), Pt = new WeakMap(), TA = new WeakMap(), Qi = new WeakMap(), oi =
|
|
|
5900
5901
|
}, Pi = function(A) {
|
|
5901
5902
|
s(this, TA).isClosed() || s(this, TA).update((t) => (t.delete(A), t));
|
|
5902
5903
|
}, yB = GA(Ki, 17, "#observeChanges", ca, Ut, yB), GA(Ki, 1, "subscribe", ra, SB), GA(Ki, 1, "close", Ea, SB), Pi = GA(Ki, 17, "#deleteSubscription", aa, Ut, Pi), ee(Ki, SB);
|
|
5903
|
-
var ha, da, la, ua, ot, ks, ni, UI, NI, cA, HE, qE, Yi, fB, pB, FB,
|
|
5904
|
+
var ha, da, la, ua, ot, ks, ni, UI, NI, cA, HE, qE, Yi, fB, pB, FB, dg;
|
|
5904
5905
|
class Oo {
|
|
5905
5906
|
constructor(A, t) {
|
|
5906
|
-
|
|
5907
|
+
Me(Yi, 5, this);
|
|
5907
5908
|
n(this, cA);
|
|
5908
5909
|
// The underlying transport implementation
|
|
5909
5910
|
n(this, ot);
|
|
@@ -5941,13 +5942,13 @@ class Oo {
|
|
|
5941
5942
|
}
|
|
5942
5943
|
}
|
|
5943
5944
|
[(ua = [qA({ context: "Session", return: "info", error: "error" })], la = [qA({ context: "Session", return: "info", error: "error" })], da = [qA({ context: "Session", return: "info", error: "error" })], ha = [qA({ context: "Session", enter: "debug" })], Ga())]() {
|
|
5944
|
-
l(this, cA,
|
|
5945
|
+
l(this, cA, dg).call(this);
|
|
5945
5946
|
}
|
|
5946
5947
|
[Symbol.dispose]() {
|
|
5947
|
-
l(this, cA,
|
|
5948
|
+
l(this, cA, dg).call(this);
|
|
5948
5949
|
}
|
|
5949
5950
|
}
|
|
5950
|
-
Yi =
|
|
5951
|
+
Yi = Je(null), ot = new WeakMap(), ks = new WeakMap(), ni = new WeakMap(), UI = new WeakMap(), NI = new WeakMap(), cA = new WeakSet(), HE = function(A) {
|
|
5951
5952
|
return r(this, null, function* () {
|
|
5952
5953
|
var t, e;
|
|
5953
5954
|
switch (s(this, UI).debug("received message", A), yield (t = this.subscriber) == null ? void 0 : t.onMessage(A), yield (e = this.publisher) == null ? void 0 : e.onMessage(A), A.type) {
|
|
@@ -6011,11 +6012,11 @@ Yi = Le(null), ot = new WeakMap(), ks = new WeakMap(), ni = new WeakMap(), UI =
|
|
|
6011
6012
|
return t;
|
|
6012
6013
|
}
|
|
6013
6014
|
});
|
|
6014
|
-
},
|
|
6015
|
+
}, dg = function() {
|
|
6015
6016
|
this.close();
|
|
6016
|
-
}, fB = GA(Yi, 17, "#runOutgoingMessages", ua, cA, fB), pB = GA(Yi, 17, "#runControl", la, cA, pB), FB = GA(Yi, 17, "#runObjects", da, cA, FB),
|
|
6017
|
+
}, fB = GA(Yi, 17, "#runOutgoingMessages", ua, cA, fB), pB = GA(Yi, 17, "#runControl", la, cA, pB), FB = GA(Yi, 17, "#runObjects", da, cA, FB), dg = GA(Yi, 17, "#dispose", ha, cA, dg), ee(Yi, Oo);
|
|
6017
6018
|
const kl = 128;
|
|
6018
|
-
var XA, Rs, ai, bI, Us, pA,
|
|
6019
|
+
var XA, Rs, ai, bI, Us, pA, Ye, Te;
|
|
6019
6020
|
class Rl {
|
|
6020
6021
|
constructor(A, t, e) {
|
|
6021
6022
|
n(this, pA);
|
|
@@ -6028,59 +6029,59 @@ class Rl {
|
|
|
6028
6029
|
}
|
|
6029
6030
|
writeUnsigned8(A) {
|
|
6030
6031
|
return r(this, null, function* () {
|
|
6031
|
-
return l(this, pA,
|
|
6032
|
+
return l(this, pA, Ye).call(this), yield l(this, pA, Te).call(this), s(this, XA).writeUnsigned8(A);
|
|
6032
6033
|
});
|
|
6033
6034
|
}
|
|
6034
6035
|
writeVarInt(A) {
|
|
6035
6036
|
return r(this, null, function* () {
|
|
6036
|
-
return l(this, pA,
|
|
6037
|
+
return l(this, pA, Ye).call(this), yield l(this, pA, Te).call(this), s(this, XA).writeVarInt(A);
|
|
6037
6038
|
});
|
|
6038
6039
|
}
|
|
6039
6040
|
writeBigVarInt(A) {
|
|
6040
6041
|
return r(this, null, function* () {
|
|
6041
|
-
return l(this, pA,
|
|
6042
|
+
return l(this, pA, Ye).call(this), yield l(this, pA, Te).call(this), s(this, XA).writeBigVarInt(A);
|
|
6042
6043
|
});
|
|
6043
6044
|
}
|
|
6044
6045
|
write(A) {
|
|
6045
6046
|
return r(this, null, function* () {
|
|
6046
|
-
return l(this, pA,
|
|
6047
|
+
return l(this, pA, Ye).call(this), yield l(this, pA, Te).call(this), s(this, XA).write(A);
|
|
6047
6048
|
});
|
|
6048
6049
|
}
|
|
6049
6050
|
writeString(A) {
|
|
6050
6051
|
return r(this, null, function* () {
|
|
6051
|
-
return l(this, pA,
|
|
6052
|
+
return l(this, pA, Ye).call(this), yield l(this, pA, Te).call(this), s(this, XA).writeString(A);
|
|
6052
6053
|
});
|
|
6053
6054
|
}
|
|
6054
6055
|
flush() {
|
|
6055
6056
|
return r(this, null, function* () {
|
|
6056
|
-
l(this, pA,
|
|
6057
|
+
l(this, pA, Ye).call(this), E(this, ai, !0), yield s(this, XA).flush();
|
|
6057
6058
|
});
|
|
6058
6059
|
}
|
|
6059
6060
|
close() {
|
|
6060
6061
|
return r(this, null, function* () {
|
|
6061
|
-
s(this, bI) || (E(this, ai, !0), yield l(this, pA,
|
|
6062
|
+
s(this, bI) || (E(this, ai, !0), yield l(this, pA, Te).call(this, !1), yield s(this, XA).flush(), E(this, bI, !0), s(this, Us).call(this));
|
|
6062
6063
|
});
|
|
6063
6064
|
}
|
|
6064
6065
|
}
|
|
6065
|
-
XA = new WeakMap(), Rs = new WeakMap(), ai = new WeakMap(), bI = new WeakMap(), Us = new WeakMap(), pA = new WeakSet(),
|
|
6066
|
+
XA = new WeakMap(), Rs = new WeakMap(), ai = new WeakMap(), bI = new WeakMap(), Us = new WeakMap(), pA = new WeakSet(), Ye = function() {
|
|
6066
6067
|
if (s(this, bI))
|
|
6067
6068
|
throw new Error("Stream is closed");
|
|
6068
|
-
},
|
|
6069
|
+
}, Te = function(A = !0) {
|
|
6069
6070
|
if (s(this, ai))
|
|
6070
6071
|
return E(this, ai, !1), s(this, XA).writeUnsigned8(s(this, Rs) | (A ? kl : 0));
|
|
6071
6072
|
};
|
|
6072
|
-
var
|
|
6073
|
+
var ue, xt, LI, Ei, Wt, JI, MI, DC, vE;
|
|
6073
6074
|
class Ul {
|
|
6074
6075
|
constructor(A, t) {
|
|
6075
6076
|
n(this, DC);
|
|
6076
|
-
n(this,
|
|
6077
|
+
n(this, ue);
|
|
6077
6078
|
n(this, xt);
|
|
6078
6079
|
n(this, LI);
|
|
6079
6080
|
n(this, Ei);
|
|
6080
6081
|
n(this, Wt, /* @__PURE__ */ new Map());
|
|
6081
6082
|
n(this, JI, SA.get().createContext("WebSocketConnection"));
|
|
6082
6083
|
n(this, MI, new Set(new Array(128).fill(0).map((A, t) => t + 1)));
|
|
6083
|
-
E(this,
|
|
6084
|
+
E(this, ue, A), E(this, xt, t), E(this, LI, new ReadableStream(new Pd(A))), s(this, ue).addEventListener("close", () => {
|
|
6084
6085
|
s(this, xt).markPostHandshake(), s(this, Wt).forEach((e) => e.close());
|
|
6085
6086
|
});
|
|
6086
6087
|
}
|
|
@@ -6089,14 +6090,14 @@ class Ul {
|
|
|
6089
6090
|
if (!A)
|
|
6090
6091
|
throw new Error("No stream IDs available");
|
|
6091
6092
|
return s(this, MI).delete(A), Promise.resolve(
|
|
6092
|
-
new Rl(new Og(s(this,
|
|
6093
|
+
new Rl(new Og(s(this, ue)), A, () => l(this, DC, vE).call(this, A))
|
|
6093
6094
|
);
|
|
6094
6095
|
}
|
|
6095
6096
|
transportType() {
|
|
6096
6097
|
return "websocket";
|
|
6097
6098
|
}
|
|
6098
6099
|
url() {
|
|
6099
|
-
return s(this,
|
|
6100
|
+
return s(this, ue).url;
|
|
6100
6101
|
}
|
|
6101
6102
|
afterHandshake() {
|
|
6102
6103
|
return s(this, xt).postHandshake();
|
|
@@ -6138,7 +6139,7 @@ class Ul {
|
|
|
6138
6139
|
}
|
|
6139
6140
|
close() {
|
|
6140
6141
|
var A;
|
|
6141
|
-
return s(this, xt).cancel().catch(H), s(this, LI).cancel("closing").catch(H), (A = s(this, Ei)) == null || A.cancel("closing").catch(H), s(this,
|
|
6142
|
+
return s(this, xt).cancel().catch(H), s(this, LI).cancel("closing").catch(H), (A = s(this, Ei)) == null || A.cancel("closing").catch(H), s(this, ue).close();
|
|
6142
6143
|
}
|
|
6143
6144
|
closed() {
|
|
6144
6145
|
return Promise.resolve();
|
|
@@ -6154,27 +6155,27 @@ class Ul {
|
|
|
6154
6155
|
});
|
|
6155
6156
|
}
|
|
6156
6157
|
}
|
|
6157
|
-
|
|
6158
|
+
ue = new WeakMap(), xt = new WeakMap(), LI = new WeakMap(), Ei = new WeakMap(), Wt = new WeakMap(), JI = new WeakMap(), MI = new WeakMap(), DC = new WeakSet(), /**
|
|
6158
6159
|
* Return a stream ID to the pool of available stream IDs
|
|
6159
6160
|
* @param streamId - The stream ID to return
|
|
6160
6161
|
*/
|
|
6161
6162
|
vE = function(A) {
|
|
6162
6163
|
s(this, MI).add(A);
|
|
6163
6164
|
};
|
|
6164
|
-
var Ot, Vt,
|
|
6165
|
+
var Ot, Vt, we, Ns, bs, mC, SC, KE;
|
|
6165
6166
|
class Nl {
|
|
6166
6167
|
constructor(A, t, e) {
|
|
6167
6168
|
n(this, SC);
|
|
6168
6169
|
n(this, Ot);
|
|
6169
6170
|
n(this, Vt);
|
|
6170
|
-
n(this,
|
|
6171
|
+
n(this, we, new eQ(100));
|
|
6171
6172
|
n(this, Ns);
|
|
6172
6173
|
n(this, bs, 0);
|
|
6173
6174
|
n(this, mC, SA.get().createContext("WebTransportConnection"));
|
|
6174
6175
|
E(this, Ns, e), E(this, Ot, A), E(this, Vt, t), l(this, SC, KE).call(this).catch((g) => {
|
|
6175
|
-
s(this, mC).debug("Incoming streams handling ended with error", g), s(this, Vt).markPostHandshake(), s(this,
|
|
6176
|
+
s(this, mC).debug("Incoming streams handling ended with error", g), s(this, Vt).markPostHandshake(), s(this, we).close();
|
|
6176
6177
|
}), s(this, Ot).closed.then(() => {
|
|
6177
|
-
s(this, Vt).markPostHandshake(), s(this,
|
|
6178
|
+
s(this, Vt).markPostHandshake(), s(this, we).close();
|
|
6178
6179
|
});
|
|
6179
6180
|
}
|
|
6180
6181
|
openSendStream() {
|
|
@@ -6212,21 +6213,21 @@ class Nl {
|
|
|
6212
6213
|
}
|
|
6213
6214
|
objectStream() {
|
|
6214
6215
|
return r(this, null, function* () {
|
|
6215
|
-
return s(this,
|
|
6216
|
+
return s(this, we).pop();
|
|
6216
6217
|
});
|
|
6217
6218
|
}
|
|
6218
6219
|
}
|
|
6219
|
-
Ot = new WeakMap(), Vt = new WeakMap(),
|
|
6220
|
+
Ot = new WeakMap(), Vt = new WeakMap(), we = new WeakMap(), Ns = new WeakMap(), bs = new WeakMap(), mC = new WeakMap(), SC = new WeakSet(), KE = function() {
|
|
6220
6221
|
return r(this, null, function* () {
|
|
6221
6222
|
const A = s(this, Ot).incomingUnidirectionalStreams.getReader();
|
|
6222
6223
|
for (; ; ) {
|
|
6223
6224
|
const { value: t, done: e } = yield A.read();
|
|
6224
6225
|
if (e) {
|
|
6225
|
-
s(this,
|
|
6226
|
+
s(this, we).close();
|
|
6226
6227
|
return;
|
|
6227
6228
|
}
|
|
6228
6229
|
const g = new jB(new Uint8Array(), t);
|
|
6229
|
-
yield s(this,
|
|
6230
|
+
yield s(this, we).push(sE(g, s(this, bs))), tt(this, bs)._++;
|
|
6230
6231
|
}
|
|
6231
6232
|
});
|
|
6232
6233
|
};
|
|
@@ -6265,7 +6266,7 @@ function bl(i) {
|
|
|
6265
6266
|
function Ll(i) {
|
|
6266
6267
|
return r(this, null, function* () {
|
|
6267
6268
|
if (self.WebTransport && (i == null ? void 0 : i.preferredTransport) !== "websocket" && i.url.protocol.startsWith("https")) {
|
|
6268
|
-
const A = bl(i).catch(() => fQ(i)), t = yield Promise.race([A,
|
|
6269
|
+
const A = bl(i).catch(() => fQ(i)), t = yield Promise.race([A, Ue(i.websocketFallbackTimeoutMs)]);
|
|
6269
6270
|
return t || fQ(i);
|
|
6270
6271
|
}
|
|
6271
6272
|
return fQ(i);
|
|
@@ -6333,7 +6334,7 @@ HI = new WeakMap(), Ls = new WeakMap();
|
|
|
6333
6334
|
function Jl(i, A) {
|
|
6334
6335
|
return ["com.vindral.moq", i];
|
|
6335
6336
|
}
|
|
6336
|
-
function
|
|
6337
|
+
function He(i) {
|
|
6337
6338
|
const A = i[1];
|
|
6338
6339
|
if (!A)
|
|
6339
6340
|
throw new Error("namespace must contain a channel ID");
|
|
@@ -6619,7 +6620,7 @@ nt = new WeakMap(), ci = new WeakMap(), Xt = new WeakMap(), pt = new WeakMap(),
|
|
|
6619
6620
|
return this.return();
|
|
6620
6621
|
});
|
|
6621
6622
|
}, qs = new WeakMap();
|
|
6622
|
-
let
|
|
6623
|
+
let Ne = tn;
|
|
6623
6624
|
const ql = "catalog";
|
|
6624
6625
|
function qn(i) {
|
|
6625
6626
|
const A = Hl(i.payload);
|
|
@@ -6627,31 +6628,31 @@ function qn(i) {
|
|
|
6627
6628
|
throw new Error("unexpected catalog type");
|
|
6628
6629
|
return A;
|
|
6629
6630
|
}
|
|
6630
|
-
var
|
|
6631
|
+
var De, vs, Ks, Ys, fC, TE;
|
|
6631
6632
|
const pC = class pC {
|
|
6632
6633
|
constructor(A, t, e) {
|
|
6633
6634
|
n(this, fC);
|
|
6634
|
-
n(this,
|
|
6635
|
+
n(this, De);
|
|
6635
6636
|
n(this, vs);
|
|
6636
6637
|
n(this, Ks);
|
|
6637
6638
|
n(this, Ys);
|
|
6638
|
-
E(this, vs, A), E(this,
|
|
6639
|
+
E(this, vs, A), E(this, De, t), E(this, Ks, e), E(this, Ys, l(this, fC, TE).call(this)), this.closed().finally(() => s(this, De).close()).catch(H);
|
|
6639
6640
|
}
|
|
6640
6641
|
catalog() {
|
|
6641
|
-
return s(this,
|
|
6642
|
+
return s(this, De);
|
|
6642
6643
|
}
|
|
6643
6644
|
closed() {
|
|
6644
6645
|
return s(this, Ys);
|
|
6645
6646
|
}
|
|
6646
6647
|
close() {
|
|
6647
6648
|
return r(this, null, function* () {
|
|
6648
|
-
return s(this,
|
|
6649
|
+
return s(this, De).close(), (yield s(this, vs).promise).unsubscribe();
|
|
6649
6650
|
});
|
|
6650
6651
|
}
|
|
6651
6652
|
static start(A, t) {
|
|
6652
6653
|
return r(this, null, function* () {
|
|
6653
6654
|
const e = z.fromPromise(
|
|
6654
|
-
|
|
6655
|
+
Ne.subscribe(
|
|
6655
6656
|
A,
|
|
6656
6657
|
new Ae().name(t.catalogName || ql).groupOrder("ascending").build()
|
|
6657
6658
|
)
|
|
@@ -6666,7 +6667,7 @@ const pC = class pC {
|
|
|
6666
6667
|
});
|
|
6667
6668
|
}
|
|
6668
6669
|
};
|
|
6669
|
-
|
|
6670
|
+
De = new WeakMap(), vs = new WeakMap(), Ks = new WeakMap(), Ys = new WeakMap(), fC = new WeakSet(), TE = function() {
|
|
6670
6671
|
return r(this, null, function* () {
|
|
6671
6672
|
const A = yield s(this, Ks).promise;
|
|
6672
6673
|
try {
|
|
@@ -6675,7 +6676,7 @@ we = new WeakMap(), vs = new WeakMap(), Ks = new WeakMap(), Ys = new WeakMap(),
|
|
|
6675
6676
|
if (C.objectStatus !== NA.Normal)
|
|
6676
6677
|
continue;
|
|
6677
6678
|
const Q = qn(C);
|
|
6678
|
-
s(this,
|
|
6679
|
+
s(this, De).update(Q);
|
|
6679
6680
|
}
|
|
6680
6681
|
} catch (g) {
|
|
6681
6682
|
B = [g];
|
|
@@ -6778,12 +6779,12 @@ const zi = class zi {
|
|
|
6778
6779
|
if (t.initTrack) {
|
|
6779
6780
|
const S = new Ae().name(t.initTrack).build(), [p, b] = yield Promise.all([
|
|
6780
6781
|
l(m = zi, FC, PE).call(m, A, S),
|
|
6781
|
-
|
|
6782
|
+
Ne.subscribe(A, c, { params: B, largestGroupId: g ? g - J(1) : void 0 })
|
|
6782
6783
|
]), y = new Rn(p);
|
|
6783
6784
|
return new zi(t, A.namespace(), b, y, e);
|
|
6784
6785
|
}
|
|
6785
6786
|
uA(t.initData, "no init data found on track");
|
|
6786
|
-
const h = pa(t.initData), d = new Rn(new Uint8Array(h)), u = yield
|
|
6787
|
+
const h = pa(t.initData), d = new Rn(new Uint8Array(h)), u = yield Ne.subscribe(A, c, {
|
|
6787
6788
|
params: B,
|
|
6788
6789
|
largestGroupId: g ? g - J(1) : void 0
|
|
6789
6790
|
});
|
|
@@ -6856,17 +6857,17 @@ Ws = new WeakMap(), Ft = new WeakMap(), Os = new WeakMap(), Vs = new WeakMap(),
|
|
|
6856
6857
|
}, n(zi, FC);
|
|
6857
6858
|
let Co = zi;
|
|
6858
6859
|
const vn = 1e4, Kl = 3e4;
|
|
6859
|
-
var GC,
|
|
6860
|
+
var GC, me, hi, Zs, Xs, js, bi, oo, xE;
|
|
6860
6861
|
const en = class en {
|
|
6861
6862
|
constructor(A, t, e) {
|
|
6862
6863
|
n(this, bi);
|
|
6863
6864
|
n(this, GC, SA.get().createContext("Timeline"));
|
|
6864
|
-
n(this,
|
|
6865
|
+
n(this, me, new bA([]));
|
|
6865
6866
|
n(this, hi);
|
|
6866
6867
|
n(this, Zs);
|
|
6867
6868
|
n(this, Xs);
|
|
6868
6869
|
n(this, js);
|
|
6869
|
-
E(this, Zs, A), E(this, Xs, e), E(this, hi, t), E(this, js, l(this, bi, oo).call(this, s(this, hi))), this.closed().finally(() => s(this,
|
|
6870
|
+
E(this, Zs, A), E(this, Xs, e), E(this, hi, t), E(this, js, l(this, bi, oo).call(this, s(this, hi))), this.closed().finally(() => s(this, me).close()).catch(H);
|
|
6870
6871
|
}
|
|
6871
6872
|
closed() {
|
|
6872
6873
|
return s(this, js);
|
|
@@ -6877,7 +6878,7 @@ const en = class en {
|
|
|
6877
6878
|
});
|
|
6878
6879
|
}
|
|
6879
6880
|
timeline() {
|
|
6880
|
-
const [A, t] = s(this,
|
|
6881
|
+
const [A, t] = s(this, me).value();
|
|
6881
6882
|
return A;
|
|
6882
6883
|
}
|
|
6883
6884
|
/**
|
|
@@ -6889,25 +6890,25 @@ const en = class en {
|
|
|
6889
6890
|
}
|
|
6890
6891
|
static start(A, t) {
|
|
6891
6892
|
const e = z.fromPromise(
|
|
6892
|
-
|
|
6893
|
+
Ne.subscribe(A, new Ae().name(t).groupOrder("ascending").build())
|
|
6893
6894
|
);
|
|
6894
6895
|
return new en(A, e, t);
|
|
6895
6896
|
}
|
|
6896
6897
|
waitForWallclockTime(A) {
|
|
6897
6898
|
return r(this, null, function* () {
|
|
6898
|
-
return yield s(this,
|
|
6899
|
+
return yield s(this, me).waitFor((t) => !!t.find((e) => e.wallclock >= A)), this.timeline();
|
|
6899
6900
|
});
|
|
6900
6901
|
}
|
|
6901
6902
|
waitForTimelineToHaveMinDuration() {
|
|
6902
6903
|
return r(this, null, function* () {
|
|
6903
|
-
return yield s(this,
|
|
6904
|
+
return yield s(this, me).waitFor((A) => {
|
|
6904
6905
|
const t = A[0], e = A[A.length - 1];
|
|
6905
6906
|
return !t || !e ? !1 : e.wallclock - t.wallclock > vn;
|
|
6906
6907
|
}), this.timeline();
|
|
6907
6908
|
});
|
|
6908
6909
|
}
|
|
6909
6910
|
};
|
|
6910
|
-
GC = new WeakMap(),
|
|
6911
|
+
GC = new WeakMap(), me = new WeakMap(), hi = new WeakMap(), Zs = new WeakMap(), Xs = new WeakMap(), js = new WeakMap(), bi = new WeakSet(), oo = function(A) {
|
|
6911
6912
|
return r(this, null, function* () {
|
|
6912
6913
|
const t = yield A.promise;
|
|
6913
6914
|
try {
|
|
@@ -6922,7 +6923,7 @@ GC = new WeakMap(), De = new WeakMap(), hi = new WeakMap(), Zs = new WeakMap(),
|
|
|
6922
6923
|
if (y.objectStatus !== NA.Normal)
|
|
6923
6924
|
continue;
|
|
6924
6925
|
const U = Yl(y.payload);
|
|
6925
|
-
s(this,
|
|
6926
|
+
s(this, me).update((G) => {
|
|
6926
6927
|
var K, L;
|
|
6927
6928
|
for (G.push(...U), G.sort((EA, AA) => EA.wallclock - AA.wallclock); G[0] && ((L = (K = G[G.length - 1]) == null ? void 0 : K.wallclock) != null ? L : 0) - G[0].wallclock > Kl; )
|
|
6928
6929
|
G.shift();
|
|
@@ -6965,7 +6966,7 @@ GC = new WeakMap(), De = new WeakMap(), hi = new WeakMap(), Zs = new WeakMap(),
|
|
|
6965
6966
|
if (!g || !B || B.wallclock - g.wallclock > vn)
|
|
6966
6967
|
return;
|
|
6967
6968
|
const C = z.fromPromise(
|
|
6968
|
-
|
|
6969
|
+
Ne.subscribe(
|
|
6969
6970
|
s(this, Zs),
|
|
6970
6971
|
new Ae().name(s(this, Xs)).groupOrder("ascending").range(t, t).build()
|
|
6971
6972
|
)
|
|
@@ -6994,33 +6995,33 @@ function Yl(i) {
|
|
|
6994
6995
|
function Tl(i) {
|
|
6995
6996
|
return typeof i.language == "string";
|
|
6996
6997
|
}
|
|
6997
|
-
var kC, zs,
|
|
6998
|
+
var kC, zs, Se, KI;
|
|
6998
6999
|
const In = class In {
|
|
6999
7000
|
constructor(A, t, e, g, B) {
|
|
7000
7001
|
n(this, kC, new $a());
|
|
7001
7002
|
n(this, zs);
|
|
7002
|
-
n(this,
|
|
7003
|
+
n(this, Se);
|
|
7003
7004
|
n(this, KI, 0);
|
|
7004
7005
|
I(this, "trackObject");
|
|
7005
7006
|
I(this, "namespace");
|
|
7006
|
-
E(this,
|
|
7007
|
+
E(this, Se, A), E(this, zs, t), this.trackObject = e, this.namespace = g, E(this, KI, B);
|
|
7007
7008
|
}
|
|
7008
7009
|
static subscribe(A, t, e) {
|
|
7009
7010
|
return r(this, null, function* () {
|
|
7010
7011
|
if (!Tl(t))
|
|
7011
7012
|
throw new Error("track object language is required");
|
|
7012
|
-
const g = new Ae().name(t.name).build(), B = yield
|
|
7013
|
+
const g = new Ae().name(t.name).build(), B = yield Ne.subscribe(A, g), C = B.objects();
|
|
7013
7014
|
return new In(B, C, t, A.namespace(), e);
|
|
7014
7015
|
});
|
|
7015
7016
|
}
|
|
7016
7017
|
largestGroupId() {
|
|
7017
|
-
return s(this,
|
|
7018
|
+
return s(this, Se).largestGroupId();
|
|
7018
7019
|
}
|
|
7019
7020
|
update(A, t) {
|
|
7020
|
-
return s(this,
|
|
7021
|
+
return s(this, Se).update(A, t);
|
|
7021
7022
|
}
|
|
7022
7023
|
unsubscribe() {
|
|
7023
|
-
return s(this,
|
|
7024
|
+
return s(this, Se).unsubscribe();
|
|
7024
7025
|
}
|
|
7025
7026
|
next() {
|
|
7026
7027
|
return r(this, null, function* () {
|
|
@@ -7040,7 +7041,7 @@ const In = class In {
|
|
|
7040
7041
|
}
|
|
7041
7042
|
return() {
|
|
7042
7043
|
return r(this, null, function* () {
|
|
7043
|
-
return yield s(this,
|
|
7044
|
+
return yield s(this, Se).return(), { done: !0, value: void 0 };
|
|
7044
7045
|
});
|
|
7045
7046
|
}
|
|
7046
7047
|
[Symbol.asyncIterator]() {
|
|
@@ -7053,9 +7054,9 @@ const In = class In {
|
|
|
7053
7054
|
return this.unsubscribe();
|
|
7054
7055
|
}
|
|
7055
7056
|
};
|
|
7056
|
-
kC = new WeakMap(), zs = new WeakMap(),
|
|
7057
|
+
kC = new WeakMap(), zs = new WeakMap(), Se = new WeakMap(), KI = new WeakMap();
|
|
7057
7058
|
let no = In;
|
|
7058
|
-
var wa, di, li, ui,
|
|
7059
|
+
var wa, di, li, ui, ye, qQ, YI, GB;
|
|
7059
7060
|
wa = [qA({ context: "Channel", enter: "info" })];
|
|
7060
7061
|
const _i = class _i {
|
|
7061
7062
|
constructor(A, t, e, g, B) {
|
|
@@ -7064,8 +7065,8 @@ const _i = class _i {
|
|
|
7064
7065
|
n(this, di);
|
|
7065
7066
|
n(this, li);
|
|
7066
7067
|
n(this, ui);
|
|
7067
|
-
n(this,
|
|
7068
|
-
this.namespace = g, E(this, di, A), E(this, li, t), E(this, ui, e), E(this,
|
|
7068
|
+
n(this, ye);
|
|
7069
|
+
this.namespace = g, E(this, di, A), E(this, li, t), E(this, ui, e), E(this, ye, B);
|
|
7069
7070
|
}
|
|
7070
7071
|
static start(A, t) {
|
|
7071
7072
|
return r(this, null, function* () {
|
|
@@ -7086,10 +7087,10 @@ const _i = class _i {
|
|
|
7086
7087
|
return s(this, li).timestampWallclockOffset();
|
|
7087
7088
|
}
|
|
7088
7089
|
timestampOffsetMs() {
|
|
7089
|
-
return s(this,
|
|
7090
|
+
return s(this, ye);
|
|
7090
7091
|
}
|
|
7091
7092
|
setTimestampOffsetMs(A) {
|
|
7092
|
-
E(this,
|
|
7093
|
+
E(this, ye, A);
|
|
7093
7094
|
}
|
|
7094
7095
|
waitForWallclockTime(A) {
|
|
7095
7096
|
return s(this, li).waitForWallclockTime(A);
|
|
@@ -7097,13 +7098,13 @@ const _i = class _i {
|
|
|
7097
7098
|
subscribeCmafTrack(A, t) {
|
|
7098
7099
|
const e = t == null ? void 0 : t.startGroup, g = t == null ? void 0 : t.params, B = this.catalog().current().tracks, C = A["com.vindral.variant_uid"] !== void 0 ? B.find((Q) => Q["com.vindral.variant_uid"] === A["com.vindral.variant_uid"]) : void 0;
|
|
7099
7100
|
return l(this, YI, GB).call(this, () => Co.subscribe(s(this, di), C != null ? C : A, {
|
|
7100
|
-
timestampOffsetMs: s(this,
|
|
7101
|
+
timestampOffsetMs: s(this, ye),
|
|
7101
7102
|
startGroup: e,
|
|
7102
7103
|
params: g
|
|
7103
7104
|
}));
|
|
7104
7105
|
}
|
|
7105
7106
|
subscribeWebVttTrack(A) {
|
|
7106
|
-
return l(this, YI, GB).call(this, () => no.subscribe(s(this, di), A, s(this,
|
|
7107
|
+
return l(this, YI, GB).call(this, () => no.subscribe(s(this, di), A, s(this, ye)));
|
|
7107
7108
|
}
|
|
7108
7109
|
subscribeTrack(A) {
|
|
7109
7110
|
return l(this, YI, GB).call(this, () => s(this, di).subscribe(A));
|
|
@@ -7115,18 +7116,18 @@ const _i = class _i {
|
|
|
7115
7116
|
return Promise.all([s(this, ui).close(), s(this, li).close()]);
|
|
7116
7117
|
}
|
|
7117
7118
|
};
|
|
7118
|
-
qQ =
|
|
7119
|
+
qQ = Je(null), di = new WeakMap(), li = new WeakMap(), ui = new WeakMap(), ye = new WeakMap(), YI = new WeakSet(), GB = function(A) {
|
|
7119
7120
|
return r(this, null, function* () {
|
|
7120
7121
|
const [t, e] = this.catalog().value();
|
|
7121
7122
|
try {
|
|
7122
7123
|
return yield A();
|
|
7123
7124
|
} catch (g) {
|
|
7124
|
-
if (t === this.catalog().current() && e && (yield Promise.race([e,
|
|
7125
|
+
if (t === this.catalog().current() && e && (yield Promise.race([e, Ue(500)])), t !== this.catalog().current())
|
|
7125
7126
|
return A();
|
|
7126
7127
|
throw g;
|
|
7127
7128
|
}
|
|
7128
7129
|
});
|
|
7129
|
-
}, GA(qQ, 9, "start", wa, _i), ee(qQ, _i),
|
|
7130
|
+
}, GA(qQ, 9, "start", wa, _i), ee(qQ, _i), Me(qQ, 3, _i);
|
|
7130
7131
|
let eC = _i;
|
|
7131
7132
|
const Pl = J(8);
|
|
7132
7133
|
function xl(i) {
|
|
@@ -7370,10 +7371,10 @@ class pQ {
|
|
|
7370
7371
|
}
|
|
7371
7372
|
}
|
|
7372
7373
|
PI = new WeakMap(), AB = new WeakMap(), tB = new WeakMap();
|
|
7373
|
-
var Da, ma, Sa, xI, WI, Di, DA, at, Et,
|
|
7374
|
+
var Da, ma, Sa, xI, WI, Di, DA, at, Et, fe, OI, eB, Eg, jt, LA, kB, lg, VE, ro;
|
|
7374
7375
|
let zl = (Sa = [qA({ context: "Player", enter: "info" })], ma = [qA({ context: "Player", enter: "info", return: "info" })], Da = [qA({ context: "Player", enter: "info" })], jt = class {
|
|
7375
7376
|
constructor(A, t, e) {
|
|
7376
|
-
|
|
7377
|
+
Me(Eg, 5, this);
|
|
7377
7378
|
n(this, LA);
|
|
7378
7379
|
n(this, xI);
|
|
7379
7380
|
n(this, WI);
|
|
@@ -7381,10 +7382,10 @@ let zl = (Sa = [qA({ context: "Player", enter: "info" })], ma = [qA({ context: "
|
|
|
7381
7382
|
n(this, DA);
|
|
7382
7383
|
n(this, at, new bA(void 0));
|
|
7383
7384
|
n(this, Et, new bA(void 0));
|
|
7384
|
-
n(this,
|
|
7385
|
+
n(this, fe, new bA(void 0));
|
|
7385
7386
|
n(this, OI);
|
|
7386
7387
|
n(this, eB);
|
|
7387
|
-
I(this, "subtitles", new pQ(s(this,
|
|
7388
|
+
I(this, "subtitles", new pQ(s(this, fe), "subtitles"));
|
|
7388
7389
|
I(this, "video", new pQ(s(this, Et), "video"));
|
|
7389
7390
|
I(this, "audio", new pQ(s(this, at), "audio"));
|
|
7390
7391
|
E(this, xI, A), E(this, WI, ao.start(e)), E(this, Di, e), E(this, DA, new bA(t)), E(this, OI, new jl(t)), E(this, eB, Promise.race([e.idleTimeout(), l(this, LA, VE).call(this), s(this, OI).closed()])), s(this, xI).closed().then(() => this.close()).catch(H);
|
|
@@ -7454,7 +7455,7 @@ let zl = (Sa = [qA({ context: "Player", enter: "info" })], ma = [qA({ context: "
|
|
|
7454
7455
|
// Close the consumers so that the iterators will stop
|
|
7455
7456
|
l(this, LA, kB).call(this, s(this, at)),
|
|
7456
7457
|
l(this, LA, kB).call(this, s(this, Et)),
|
|
7457
|
-
l(this, LA, kB).call(this, s(this,
|
|
7458
|
+
l(this, LA, kB).call(this, s(this, fe))
|
|
7458
7459
|
]);
|
|
7459
7460
|
}
|
|
7460
7461
|
zap(A, t) {
|
|
@@ -7475,32 +7476,32 @@ let zl = (Sa = [qA({ context: "Player", enter: "info" })], ma = [qA({ context: "
|
|
|
7475
7476
|
return r(this, null, function* () {
|
|
7476
7477
|
var e, g;
|
|
7477
7478
|
if (!A) {
|
|
7478
|
-
yield (e = s(this,
|
|
7479
|
+
yield (e = s(this, fe).current()) == null ? void 0 : e.unsubscribe();
|
|
7479
7480
|
return;
|
|
7480
7481
|
}
|
|
7481
7482
|
const [t] = yield Promise.all([
|
|
7482
7483
|
s(this, DA).current().subscribeWebVttTrack(A),
|
|
7483
|
-
(g = s(this,
|
|
7484
|
+
(g = s(this, fe).current()) == null ? void 0 : g.unsubscribe()
|
|
7484
7485
|
]);
|
|
7485
|
-
s(this,
|
|
7486
|
+
s(this, fe).update(t);
|
|
7486
7487
|
});
|
|
7487
7488
|
}
|
|
7488
7489
|
setVideoTrack(A, t) {
|
|
7489
7490
|
return r(this, null, function* () {
|
|
7490
|
-
const e = yield l(this, LA,
|
|
7491
|
+
const e = yield l(this, LA, lg).call(this, s(this, DA).current(), A, s(this, Et).current(), t);
|
|
7491
7492
|
s(this, Et).update(e);
|
|
7492
7493
|
});
|
|
7493
7494
|
}
|
|
7494
7495
|
setAudioTrack(A, t) {
|
|
7495
7496
|
return r(this, null, function* () {
|
|
7496
|
-
const e = yield l(this, LA,
|
|
7497
|
+
const e = yield l(this, LA, lg).call(this, s(this, DA).current(), A, s(this, at).current(), t);
|
|
7497
7498
|
s(this, at).update(e);
|
|
7498
7499
|
});
|
|
7499
7500
|
}
|
|
7500
|
-
},
|
|
7501
|
+
}, Eg = Je(null), xI = new WeakMap(), WI = new WeakMap(), Di = new WeakMap(), DA = new WeakMap(), at = new WeakMap(), Et = new WeakMap(), fe = new WeakMap(), OI = new WeakMap(), eB = new WeakMap(), LA = new WeakSet(), kB = function(A) {
|
|
7501
7502
|
const t = A.current(), e = t == null ? void 0 : t.largestGroupId();
|
|
7502
7503
|
return A.isClosed() || A.update(void 0), A.close(), e ? t == null ? void 0 : t.update(e, e) : t == null ? void 0 : t.unsubscribe();
|
|
7503
|
-
},
|
|
7504
|
+
}, lg = function(A, t, e, g) {
|
|
7504
7505
|
return r(this, null, function* () {
|
|
7505
7506
|
const B = e == null ? void 0 : e.largestGroupId(), [C, Q] = yield Promise.all([
|
|
7506
7507
|
A.subscribeCmafTrack(t, {
|
|
@@ -7559,13 +7560,13 @@ let zl = (Sa = [qA({ context: "Player", enter: "info" })], ma = [qA({ context: "
|
|
|
7559
7560
|
t.update(yield s(this, DA).current().subscribeCmafTrack(Q));
|
|
7560
7561
|
}
|
|
7561
7562
|
});
|
|
7562
|
-
}, GA(
|
|
7563
|
+
}, GA(Eg, 1, "close", Sa, jt), GA(Eg, 1, "zap", ma, jt), lg = GA(Eg, 17, "#replaceTrack", Da, LA, lg), ee(Eg, jt), jt);
|
|
7563
7564
|
function FQ(i, A, t) {
|
|
7564
7565
|
const e = new URL("/voq/subscribe", i);
|
|
7565
7566
|
return e.searchParams.set("sessionId", A.sessionId), e.searchParams.set("clientId", A.clientId), e.searchParams.set("channelId", A.channelId), t && e.searchParams.set("authToken", t), e;
|
|
7566
7567
|
}
|
|
7567
7568
|
const _l = 1e4;
|
|
7568
|
-
var lA, RA, zA, mi, gA,
|
|
7569
|
+
var lA, RA, zA, mi, gA, pe, iB, VI, IB, ZI, JA, ZE, XI, gB, jI, XE, jE, zE, _E, ho;
|
|
7569
7570
|
const Bn = class Bn {
|
|
7570
7571
|
constructor(A, t, e, g, B, C, Q) {
|
|
7571
7572
|
n(this, JA);
|
|
@@ -7574,7 +7575,7 @@ const Bn = class Bn {
|
|
|
7574
7575
|
n(this, zA);
|
|
7575
7576
|
n(this, mi, "disconnected");
|
|
7576
7577
|
n(this, gA);
|
|
7577
|
-
n(this,
|
|
7578
|
+
n(this, pe, /* @__PURE__ */ new Map());
|
|
7578
7579
|
n(this, iB);
|
|
7579
7580
|
n(this, VI);
|
|
7580
7581
|
n(this, IB);
|
|
@@ -7584,7 +7585,7 @@ const Bn = class Bn {
|
|
|
7584
7585
|
s(this, gA).setSubtitleTrack(void 0).catch(H);
|
|
7585
7586
|
return;
|
|
7586
7587
|
}
|
|
7587
|
-
const t = s(this,
|
|
7588
|
+
const t = s(this, pe).get(He(s(this, gA).namespace())), e = t == null ? void 0 : t.getTextTrack(A);
|
|
7588
7589
|
e && s(this, gA).setSubtitleTrack(e).catch(H);
|
|
7589
7590
|
});
|
|
7590
7591
|
n(this, gB, (A) => {
|
|
@@ -7619,7 +7620,7 @@ const Bn = class Bn {
|
|
|
7619
7620
|
I(this, "disconnect", (A = "Disconnect Requested") => {
|
|
7620
7621
|
s(this, RA).info("Disconnecting", A), s(this, zA).close(), s(this, gA).close().catch(H), E(this, ZI, /* @__PURE__ */ new Map()), E(this, mi, "disconnected");
|
|
7621
7622
|
});
|
|
7622
|
-
E(this, lA, A), E(this, RA, t), E(this, zA, e), E(this, gA, g), E(this,
|
|
7623
|
+
E(this, lA, A), E(this, RA, t), E(this, zA, e), E(this, gA, g), E(this, pe, B), E(this, iB, C), E(this, VI, Q), s(this, lA).on("send signal", s(this, gB)), s(this, lA).on("disconnect", this.disconnect), s(this, lA).on("text track", s(this, XI)), l(this, JA, ZE).call(this).catch(H), l(this, JA, zE).call(this).catch(H);
|
|
7623
7624
|
}
|
|
7624
7625
|
get estimatedBandwidth() {
|
|
7625
7626
|
return s(this, IB);
|
|
@@ -7642,7 +7643,7 @@ const Bn = class Bn {
|
|
|
7642
7643
|
var y, U, G, K;
|
|
7643
7644
|
const C = new Map(
|
|
7644
7645
|
g.connectInfo.channels.map((L) => [
|
|
7645
|
-
|
|
7646
|
+
He(L.catalog.namespace),
|
|
7646
7647
|
new GQ(new bA(L.catalog))
|
|
7647
7648
|
])
|
|
7648
7649
|
), Q = yield g.onConnectInfo(g.connectInfo), o = g.options.get("authenticationToken");
|
|
@@ -7658,7 +7659,7 @@ const Bn = class Bn {
|
|
|
7658
7659
|
}
|
|
7659
7660
|
const h = (y = g.connectInfo.channels.find((L) => L.channelId === Q.channelId)) == null ? void 0 : y.catalog;
|
|
7660
7661
|
t.debug("Resolved edge url", { edgeUrl: a, edgeWsUrl: c }), uA(h, "no catalog found");
|
|
7661
|
-
const d = (U = C.get(
|
|
7662
|
+
const d = (U = C.get(He(h.namespace))) == null ? void 0 : U.getVideoTrack(Q.video), u = (G = C.get(He(h.namespace))) == null ? void 0 : G.getAudioTrack(Q.audio), m = yield Ll({
|
|
7662
7663
|
url: a,
|
|
7663
7664
|
wsUrl: c,
|
|
7664
7665
|
authToken: g.options.get("authenticationToken"),
|
|
@@ -7676,7 +7677,7 @@ const Bn = class Bn {
|
|
|
7676
7677
|
xo(_l, new Error("Timeout waiting for player to start")),
|
|
7677
7678
|
Zr(m.closed(), "Session closed before player started")
|
|
7678
7679
|
]), p = new GQ(S.catalog());
|
|
7679
|
-
C.set(
|
|
7680
|
+
C.set(He(h.namespace), p), A.emit("received signal", {
|
|
7680
7681
|
type: "client ip",
|
|
7681
7682
|
ip: S.connectionInfo().ip
|
|
7682
7683
|
}), S.drm().then((L) => {
|
|
@@ -7698,9 +7699,9 @@ const Bn = class Bn {
|
|
|
7698
7699
|
return Promise.race([s(this, zA).closed(), s(this, gA).closed()]);
|
|
7699
7700
|
}
|
|
7700
7701
|
};
|
|
7701
|
-
lA = new WeakMap(), RA = new WeakMap(), zA = new WeakMap(), mi = new WeakMap(), gA = new WeakMap(),
|
|
7702
|
+
lA = new WeakMap(), RA = new WeakMap(), zA = new WeakMap(), mi = new WeakMap(), gA = new WeakMap(), pe = new WeakMap(), iB = new WeakMap(), VI = new WeakMap(), IB = new WeakMap(), ZI = new WeakMap(), JA = new WeakSet(), ZE = function() {
|
|
7702
7703
|
return r(this, null, function* () {
|
|
7703
|
-
s(this, zA).transportType() === "websocket" && (yield
|
|
7704
|
+
s(this, zA).transportType() === "websocket" && (yield Ue(5e3));
|
|
7704
7705
|
try {
|
|
7705
7706
|
for (var A = iA(s(this, gA).stats()), t, e, g; t = !(e = yield A.next()).done; t = !1) {
|
|
7706
7707
|
const { rtt: B, estimatedBandwidth: C } = e.value;
|
|
@@ -7733,8 +7734,8 @@ lA = new WeakMap(), RA = new WeakMap(), zA = new WeakMap(), mi = new WeakMap(),
|
|
|
7733
7734
|
var C, Q, o;
|
|
7734
7735
|
s(this, RA).info("handle subscription", A);
|
|
7735
7736
|
const t = s(this, gA);
|
|
7736
|
-
let e = s(this,
|
|
7737
|
-
if (e || (e = new GQ(new bA(yield l(this, JA, XE).call(this, A.channelId))), s(this,
|
|
7737
|
+
let e = s(this, pe).get(A.channelId);
|
|
7738
|
+
if (e || (e = new GQ(new bA(yield l(this, JA, XE).call(this, A.channelId))), s(this, pe).set(A.channelId, e)), t.namespace().join("/") !== e.namespace().join("/")) {
|
|
7738
7739
|
s(this, RA).info("changing channel", A.channelId);
|
|
7739
7740
|
const a = e.getVideoTrack(A.video), c = e.getAudioTrack(A.audio);
|
|
7740
7741
|
yield t.zap(
|
|
@@ -7749,7 +7750,7 @@ lA = new WeakMap(), RA = new WeakMap(), zA = new WeakMap(), mi = new WeakMap(),
|
|
|
7749
7750
|
h && s(this, lA).emit("received drm data", h.value);
|
|
7750
7751
|
}).catch((h) => {
|
|
7751
7752
|
s(this, RA).error("Error getting DRM data", h);
|
|
7752
|
-
}), s(this, RA).info("switched channel", A.channelId), (C = s(this,
|
|
7753
|
+
}), s(this, RA).info("switched channel", A.channelId), (C = s(this, pe).get(He(t.namespace()))) == null || C.updateCatalog(t.catalog()), s(this, lA).emit("received signal", {
|
|
7753
7754
|
type: "subscription changed",
|
|
7754
7755
|
subscription: A
|
|
7755
7756
|
});
|
|
@@ -7802,7 +7803,7 @@ lA = new WeakMap(), RA = new WeakMap(), zA = new WeakMap(), mi = new WeakMap(),
|
|
|
7802
7803
|
try {
|
|
7803
7804
|
for (var d = iA(t), u, m, S; u = !(m = yield d.next()).done; u = !1) {
|
|
7804
7805
|
const p = m.value;
|
|
7805
|
-
const b =
|
|
7806
|
+
const b = He(p.track.namespace), y = p.track.trackObject.language, U = PQ((Q = p.track.trackObject.codec) != null ? Q : ""), G = p.track.trackObject.codec, K = U ? Ce({ codec: U, codecString: G }) : void 0, L = !!p.track.trackObject["com.vindral.drm"];
|
|
7806
7807
|
try {
|
|
7807
7808
|
for (var o = iA(p), a, c, h; a = !(c = yield o.next()).done; a = !1) {
|
|
7808
7809
|
const [EA, AA] = c.value;
|
|
@@ -7979,19 +7980,19 @@ class tu extends $A {
|
|
|
7979
7980
|
isSuspended: this.isSuspended
|
|
7980
7981
|
})), this.close("one websocket was closed"), t.code) {
|
|
7981
7982
|
case 4e3:
|
|
7982
|
-
this.emit("error", UB(
|
|
7983
|
+
this.emit("error", UB(ng()));
|
|
7983
7984
|
break;
|
|
7984
7985
|
case 4001:
|
|
7985
|
-
this.emit("error", UB(
|
|
7986
|
+
this.emit("error", UB(ng()));
|
|
7986
7987
|
break;
|
|
7987
7988
|
case 4002:
|
|
7988
|
-
this.emit("error", uc(
|
|
7989
|
+
this.emit("error", uc(ng()));
|
|
7989
7990
|
break;
|
|
7990
7991
|
case 4003:
|
|
7991
|
-
this.emit("error", Ja("internal",
|
|
7992
|
+
this.emit("error", Ja("internal", ng()));
|
|
7992
7993
|
break;
|
|
7993
7994
|
case 4010:
|
|
7994
|
-
this.emit("error", wc("internal",
|
|
7995
|
+
this.emit("error", wc("internal", ng()));
|
|
7995
7996
|
break;
|
|
7996
7997
|
}
|
|
7997
7998
|
this.emit("close", this);
|
|
@@ -8009,7 +8010,7 @@ class tu extends $A {
|
|
|
8009
8010
|
if (this.isSuspended)
|
|
8010
8011
|
return !1;
|
|
8011
8012
|
if (this.readyState() !== WebSocket.CLOSED && this.close("new connection in progress"), this.shouldContinueConnecting = !0, this._isConnectInProgress = !0, t && this.options.reconnectDelay > 0) {
|
|
8012
|
-
this.logger.info("Waiting for reconnect delay", D({}, this.options)), yield
|
|
8013
|
+
this.logger.info("Waiting for reconnect delay", D({}, this.options)), yield Ue(this.options.reconnectDelay);
|
|
8013
8014
|
const e = yield this.options.reconnectHandler(this.reconnectState);
|
|
8014
8015
|
if (this.reconnectState.reconnectRetries++, !e)
|
|
8015
8016
|
return this._isConnectInProgress = !1, this.emit("error", Ma()), !1;
|
|
@@ -8226,11 +8227,11 @@ I(dt, "PING_INTERVAL", 5e3), I(dt, "MAX_MISSED_PINGS", 4), I(dt, "TLS_ROUNDTRIPS
|
|
|
8226
8227
|
Q.transport.once("error", (o) => C(o)), Q.transport.once("open", () => B(Q));
|
|
8227
8228
|
}));
|
|
8228
8229
|
let lo = dt;
|
|
8229
|
-
var zI,
|
|
8230
|
+
var zI, Fe, _I;
|
|
8230
8231
|
class su {
|
|
8231
8232
|
constructor(A) {
|
|
8232
8233
|
n(this, zI);
|
|
8233
|
-
n(this,
|
|
8234
|
+
n(this, Fe, []);
|
|
8234
8235
|
n(this, _I);
|
|
8235
8236
|
E(this, zI, A);
|
|
8236
8237
|
}
|
|
@@ -8247,8 +8248,8 @@ class su {
|
|
|
8247
8248
|
select(A) {
|
|
8248
8249
|
if (s(this, zI).edgeUrl)
|
|
8249
8250
|
return s(this, zI).edgeUrl;
|
|
8250
|
-
s(this,
|
|
8251
|
-
const t = s(this,
|
|
8251
|
+
s(this, Fe).length === 0 && E(this, Fe, s(this, Fe).concat(A));
|
|
8252
|
+
const t = s(this, Fe).shift();
|
|
8252
8253
|
if (E(this, _I, t), t)
|
|
8253
8254
|
return t;
|
|
8254
8255
|
}
|
|
@@ -8263,10 +8264,10 @@ class su {
|
|
|
8263
8264
|
* Resets the cached list of edges
|
|
8264
8265
|
*/
|
|
8265
8266
|
reset() {
|
|
8266
|
-
E(this, _I, void 0), E(this,
|
|
8267
|
+
E(this, _I, void 0), E(this, Fe, []);
|
|
8267
8268
|
}
|
|
8268
8269
|
}
|
|
8269
|
-
zI = new WeakMap(),
|
|
8270
|
+
zI = new WeakMap(), Fe = new WeakMap(), _I = new WeakMap();
|
|
8270
8271
|
var Gt, kt, $I, _t, Ag, tg, eg, LC, JC, MC, Ar;
|
|
8271
8272
|
const $i = class $i {
|
|
8272
8273
|
constructor(A, t, e) {
|
|
@@ -8335,7 +8336,7 @@ const $i = class $i {
|
|
|
8335
8336
|
n(this, JC, () => r(this, null, function* () {
|
|
8336
8337
|
const A = Date.now(), t = () => Date.now() - A;
|
|
8337
8338
|
return Promise.race([
|
|
8338
|
-
|
|
8339
|
+
Ue($i.PING_TIMEOUT),
|
|
8339
8340
|
fetch(new URL("/api/v4/connect/ping", this.config.options.get("url")).toString(), {
|
|
8340
8341
|
method: "HEAD"
|
|
8341
8342
|
})
|
|
@@ -8412,7 +8413,7 @@ Gt = new WeakMap(), kt = new WeakMap(), $I = new WeakMap(), _t = new WeakMap(),
|
|
|
8412
8413
|
this.emitter.emit("error", Ma());
|
|
8413
8414
|
break;
|
|
8414
8415
|
}
|
|
8415
|
-
if (yield
|
|
8416
|
+
if (yield Ue(1e3), !s(this, kt))
|
|
8416
8417
|
break;
|
|
8417
8418
|
}
|
|
8418
8419
|
E(this, $I, void 0);
|
|
@@ -8421,15 +8422,15 @@ Gt = new WeakMap(), kt = new WeakMap(), $I = new WeakMap(), _t = new WeakMap(),
|
|
|
8421
8422
|
let uo = $i;
|
|
8422
8423
|
const kQ = () => ({
|
|
8423
8424
|
video: Y(D({}, RB()), {
|
|
8424
|
-
bitRate:
|
|
8425
|
+
bitRate: Re()
|
|
8425
8426
|
}),
|
|
8426
8427
|
audio: {
|
|
8427
|
-
bitRate:
|
|
8428
|
+
bitRate: Re()
|
|
8428
8429
|
}
|
|
8429
8430
|
}), Bu = () => ({
|
|
8430
8431
|
width: window.innerWidth,
|
|
8431
8432
|
height: window.innerHeight,
|
|
8432
|
-
bitRate:
|
|
8433
|
+
bitRate: Re()
|
|
8433
8434
|
}), AI = class AI {
|
|
8434
8435
|
constructor(A, t, e, g) {
|
|
8435
8436
|
I(this, "emitter");
|
|
@@ -8810,6 +8811,111 @@ const et = class et {
|
|
|
8810
8811
|
};
|
|
8811
8812
|
I(et, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), I(et, "NO_DATA_TIMEOUT", 5 * 1e3), I(et, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), I(et, "create", (A) => new et(A));
|
|
8812
8813
|
let So = et;
|
|
8814
|
+
const Yn = 1e3, Tn = 50;
|
|
8815
|
+
class Xo {
|
|
8816
|
+
constructor(A) {
|
|
8817
|
+
I(this, "logger");
|
|
8818
|
+
I(this, "trackingState", /* @__PURE__ */ new Map());
|
|
8819
|
+
// Running jitter calculation (RFC 3550 style - exponential moving average with /16)
|
|
8820
|
+
I(this, "runningJitter", /* @__PURE__ */ new Map());
|
|
8821
|
+
// Recent jitter samples for spike detection
|
|
8822
|
+
I(this, "recentJitterSamples", /* @__PURE__ */ new Map());
|
|
8823
|
+
I(this, "load", () => {
|
|
8824
|
+
this.logger.debug("JitterModule loaded");
|
|
8825
|
+
});
|
|
8826
|
+
I(this, "unload", () => {
|
|
8827
|
+
this.trackingState.clear(), this.runningJitter.clear(), this.recentJitterSamples.clear(), this.logger.debug("JitterModule unloaded");
|
|
8828
|
+
});
|
|
8829
|
+
this.logger = A;
|
|
8830
|
+
}
|
|
8831
|
+
static create(A) {
|
|
8832
|
+
return new Xo(A);
|
|
8833
|
+
}
|
|
8834
|
+
/**
|
|
8835
|
+
* Get a unique key for tracking per rendition
|
|
8836
|
+
*/
|
|
8837
|
+
getTrackingKey(A, t) {
|
|
8838
|
+
return `${A}-${t}`;
|
|
8839
|
+
}
|
|
8840
|
+
/**
|
|
8841
|
+
* Record a sample arrival for jitter calculation.
|
|
8842
|
+
* Should be called when a sample/fragment is received.
|
|
8843
|
+
*
|
|
8844
|
+
* Jitter is calculated by comparing the expected inter-arrival time
|
|
8845
|
+
* (derived from media timestamps) with the actual inter-arrival time.
|
|
8846
|
+
*/
|
|
8847
|
+
recordSample(A) {
|
|
8848
|
+
var d, u, m, S;
|
|
8849
|
+
const t = this.getTrackingKey(A.type, A.renditionId), e = (m = (u = (d = globalThis.performance) == null ? void 0 : d.now) == null ? void 0 : u.call(d)) != null ? m : Date.now(), g = A.timestamp / A.timescale * 1e3, B = this.trackingState.get(t);
|
|
8850
|
+
if (!B) {
|
|
8851
|
+
this.trackingState.set(t, {
|
|
8852
|
+
lastArrivalTime: e,
|
|
8853
|
+
lastTimestampMs: g,
|
|
8854
|
+
jitterSamples: new sA(Yn),
|
|
8855
|
+
interArrivalTimes: new sA(Yn)
|
|
8856
|
+
}), this.runningJitter.set(t, 0), this.recentJitterSamples.set(t, new sA(Tn));
|
|
8857
|
+
return;
|
|
8858
|
+
}
|
|
8859
|
+
const C = g - B.lastTimestampMs;
|
|
8860
|
+
if (C <= 0) {
|
|
8861
|
+
B.lastArrivalTime = e, B.lastTimestampMs = g;
|
|
8862
|
+
return;
|
|
8863
|
+
}
|
|
8864
|
+
const Q = e - B.lastArrivalTime, o = Math.abs(Q - C);
|
|
8865
|
+
B.jitterSamples.push(o), B.interArrivalTimes.push(Q);
|
|
8866
|
+
const a = (S = this.runningJitter.get(t)) != null ? S : 0, c = a + (o - a) / 16;
|
|
8867
|
+
this.runningJitter.set(t, c);
|
|
8868
|
+
let h = this.recentJitterSamples.get(t);
|
|
8869
|
+
h || (h = new sA(Tn), this.recentJitterSamples.set(t, h)), h.push(o), B.lastArrivalTime = e, B.lastTimestampMs = g;
|
|
8870
|
+
}
|
|
8871
|
+
/**
|
|
8872
|
+
* Get jitter statistics for a specific media type.
|
|
8873
|
+
* Returns undefined if no data is available.
|
|
8874
|
+
* All jitter values are rounded to integer milliseconds for cleaner statistics aggregation.
|
|
8875
|
+
*/
|
|
8876
|
+
getJitterForType(A) {
|
|
8877
|
+
var t, e, g;
|
|
8878
|
+
for (const [B, C] of this.trackingState)
|
|
8879
|
+
if (B.startsWith(A)) {
|
|
8880
|
+
if (C.jitterSamples.items().length < 1)
|
|
8881
|
+
return;
|
|
8882
|
+
const o = (t = this.runningJitter.get(B)) != null ? t : 0, a = (g = (e = this.recentJitterSamples.get(B)) == null ? void 0 : e.items()) != null ? g : [], { min: c, max: h, average: d } = Be(a);
|
|
8883
|
+
return {
|
|
8884
|
+
min: Math.round(c),
|
|
8885
|
+
max: Math.round(h),
|
|
8886
|
+
last: Math.round(d),
|
|
8887
|
+
average: Math.round(o)
|
|
8888
|
+
};
|
|
8889
|
+
}
|
|
8890
|
+
}
|
|
8891
|
+
/**
|
|
8892
|
+
* Get the current running jitter value
|
|
8893
|
+
*/
|
|
8894
|
+
getRunningJitter(A) {
|
|
8895
|
+
for (const [t, e] of this.runningJitter)
|
|
8896
|
+
if (t.startsWith(A))
|
|
8897
|
+
return e;
|
|
8898
|
+
}
|
|
8899
|
+
/**
|
|
8900
|
+
* Reset jitter tracking for a specific rendition or all renditions.
|
|
8901
|
+
*/
|
|
8902
|
+
reset(A, t) {
|
|
8903
|
+
if (A !== void 0 && t !== void 0) {
|
|
8904
|
+
const e = this.getTrackingKey(A, t);
|
|
8905
|
+
this.trackingState.delete(e), this.runningJitter.delete(e), this.recentJitterSamples.delete(e);
|
|
8906
|
+
} else if (A !== void 0)
|
|
8907
|
+
for (const e of this.trackingState.keys())
|
|
8908
|
+
e.startsWith(A) && (this.trackingState.delete(e), this.runningJitter.delete(e), this.recentJitterSamples.delete(e));
|
|
8909
|
+
else
|
|
8910
|
+
this.trackingState.clear(), this.runningJitter.clear(), this.recentJitterSamples.clear();
|
|
8911
|
+
}
|
|
8912
|
+
getStatistics() {
|
|
8913
|
+
return {
|
|
8914
|
+
audioJitter: this.getJitterForType("audio"),
|
|
8915
|
+
videoJitter: this.getJitterForType("video")
|
|
8916
|
+
};
|
|
8917
|
+
}
|
|
8918
|
+
}
|
|
8813
8919
|
const au = () => window.AudioContext || window.webkitAudioContext, qC = class qC extends $A {
|
|
8814
8920
|
constructor() {
|
|
8815
8921
|
super();
|
|
@@ -9117,7 +9223,7 @@ void main() {
|
|
|
9117
9223
|
texture_coordinate = position;
|
|
9118
9224
|
gl_Position = model * vec4(position, 0.0, 1.0);
|
|
9119
9225
|
}
|
|
9120
|
-
`,
|
|
9226
|
+
`, Pn = (i, A) => {
|
|
9121
9227
|
let t = i.getContext("webgl", A);
|
|
9122
9228
|
if (t || (t = i.getContext("experimental-webgl", A)), !t)
|
|
9123
9229
|
throw new v("Failed to create webgl context", {
|
|
@@ -9137,7 +9243,7 @@ void main() {
|
|
|
9137
9243
|
});
|
|
9138
9244
|
}
|
|
9139
9245
|
return e;
|
|
9140
|
-
},
|
|
9246
|
+
}, Pe = (i) => {
|
|
9141
9247
|
const A = i.createTexture();
|
|
9142
9248
|
if (!A)
|
|
9143
9249
|
throw new v("Failed to create texture", {
|
|
@@ -9145,7 +9251,7 @@ void main() {
|
|
|
9145
9251
|
code: "failed_to_create_texture"
|
|
9146
9252
|
});
|
|
9147
9253
|
return i.bindTexture(i.TEXTURE_2D, A), 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), A;
|
|
9148
|
-
},
|
|
9254
|
+
}, xn = (i, A) => {
|
|
9149
9255
|
const t = i.createBuffer();
|
|
9150
9256
|
if (!t)
|
|
9151
9257
|
throw new v("Failed to create buffer", {
|
|
@@ -9169,16 +9275,16 @@ void main() {
|
|
|
9169
9275
|
}
|
|
9170
9276
|
return e;
|
|
9171
9277
|
};
|
|
9172
|
-
var KC, V, BB, CB, QB,
|
|
9278
|
+
var KC, V, BB, CB, QB, Ge, gg, ir, Ir, YC;
|
|
9173
9279
|
class hu {
|
|
9174
9280
|
constructor(A) {
|
|
9175
|
-
n(this,
|
|
9281
|
+
n(this, gg);
|
|
9176
9282
|
n(this, KC, 96);
|
|
9177
9283
|
n(this, V);
|
|
9178
9284
|
n(this, BB);
|
|
9179
9285
|
n(this, CB);
|
|
9180
9286
|
n(this, QB);
|
|
9181
|
-
n(this,
|
|
9287
|
+
n(this, Ge);
|
|
9182
9288
|
I(this, "subtitleRenderer", new Eu());
|
|
9183
9289
|
// biome-ignore format: special formatting
|
|
9184
9290
|
n(this, YC, (A, t, e, g) => [
|
|
@@ -9199,14 +9305,14 @@ class hu {
|
|
|
9199
9305
|
0,
|
|
9200
9306
|
1
|
|
9201
9307
|
]);
|
|
9202
|
-
E(this, V, A), E(this, BB,
|
|
9308
|
+
E(this, V, A), E(this, BB, Pe(A)), E(this, CB, Wi(A, A.FRAGMENT_SHADER, ru)), E(this, QB, Wi(A, A.VERTEX_SHADER, cu)), E(this, Ge, fo(A, s(this, QB), s(this, CB))), this.subtitleRenderer.config.fontSize = "64px";
|
|
9203
9309
|
}
|
|
9204
9310
|
setActiveCues(A, t) {
|
|
9205
9311
|
this.subtitleRenderer.setActiveCues(A), this.subtitleRenderer.render(t);
|
|
9206
9312
|
}
|
|
9207
9313
|
render(A) {
|
|
9208
9314
|
const t = this.subtitleRenderer.canvas, e = (A.padding + s(this, KC)) * window.devicePixelRatio;
|
|
9209
|
-
t.width !== 0 && (s(this, V).useProgram(s(this,
|
|
9315
|
+
t.width !== 0 && (s(this, V).useProgram(s(this, Ge)), l(this, gg, ir).call(this), l(this, gg, Ir).call(this, this.subtitleRenderer.canvas.width / A.width, this.subtitleRenderer.canvas.height / A.height, -this.subtitleRenderer.canvas.width / A.width / 2, -(1 - (this.subtitleRenderer.canvas.height + e) / A.height)), s(this, V).uniform1i(s(this, V).getUniformLocation(s(this, Ge), "texture"), 4), s(this, V).activeTexture(s(this, V).TEXTURE4), s(this, V).bindTexture(s(this, V).TEXTURE_2D, s(this, BB)), s(this, V).enable(s(this, V).BLEND), s(this, V).blendFunc(s(this, V).SRC_ALPHA, s(this, V).ONE_MINUS_SRC_ALPHA), s(this, V).texImage2D(
|
|
9210
9316
|
s(this, V).TEXTURE_2D,
|
|
9211
9317
|
0,
|
|
9212
9318
|
s(this, V).RGBA,
|
|
@@ -9216,14 +9322,14 @@ class hu {
|
|
|
9216
9322
|
), s(this, V).texParameteri(s(this, V).TEXTURE_2D, s(this, V).TEXTURE_MAG_FILTER, s(this, V).LINEAR), s(this, V).drawArrays(s(this, V).TRIANGLE_STRIP, 0, 4));
|
|
9217
9323
|
}
|
|
9218
9324
|
}
|
|
9219
|
-
KC = new WeakMap(), V = new WeakMap(), BB = new WeakMap(), CB = new WeakMap(), QB = new WeakMap(),
|
|
9220
|
-
const A = s(this, V).getAttribLocation(s(this,
|
|
9325
|
+
KC = new WeakMap(), V = new WeakMap(), BB = new WeakMap(), CB = new WeakMap(), QB = new WeakMap(), Ge = new WeakMap(), gg = new WeakSet(), ir = function() {
|
|
9326
|
+
const A = s(this, V).getAttribLocation(s(this, Ge), "position");
|
|
9221
9327
|
s(this, V).enableVertexAttribArray(A), s(this, V).vertexAttribPointer(A, 2, s(this, V).FLOAT, !1, 0, 0);
|
|
9222
9328
|
}, Ir = function(A, t, e, g) {
|
|
9223
|
-
const B = s(this, V).getUniformLocation(s(this,
|
|
9329
|
+
const B = s(this, V).getUniformLocation(s(this, Ge), "model");
|
|
9224
9330
|
s(this, V).uniformMatrix4fv(B, !1, s(this, YC).call(this, A, t, e, g));
|
|
9225
9331
|
}, YC = new WeakMap();
|
|
9226
|
-
const
|
|
9332
|
+
const Wn = `
|
|
9227
9333
|
precision mediump float;
|
|
9228
9334
|
uniform sampler2D y_texture;
|
|
9229
9335
|
uniform sampler2D u_texture;
|
|
@@ -9239,7 +9345,7 @@ void main() {
|
|
|
9239
9345
|
|
|
9240
9346
|
gl_FragColor = vec4(y, u, v, 1) * conversion;
|
|
9241
9347
|
}
|
|
9242
|
-
`,
|
|
9348
|
+
`, On = `
|
|
9243
9349
|
attribute vec2 position;
|
|
9244
9350
|
varying vec2 texture_coordinate;
|
|
9245
9351
|
uniform mat4 model;
|
|
@@ -9248,49 +9354,49 @@ void main() {
|
|
|
9248
9354
|
texture_coordinate = position;
|
|
9249
9355
|
gl_Position = model * vec4(position, 0.0, 1.0);
|
|
9250
9356
|
}
|
|
9251
|
-
`,
|
|
9357
|
+
`, Vn = {
|
|
9252
9358
|
width: 256,
|
|
9253
9359
|
codedWidth: 256,
|
|
9254
9360
|
height: 144,
|
|
9255
9361
|
codedHeight: 144
|
|
9256
|
-
},
|
|
9362
|
+
}, Zn = {
|
|
9257
9363
|
preserveDrawingBuffer: !1,
|
|
9258
9364
|
alpha: !1,
|
|
9259
9365
|
depth: !1,
|
|
9260
9366
|
stencil: !1,
|
|
9261
9367
|
antialias: !1,
|
|
9262
9368
|
premultipliedAlpha: !1
|
|
9263
|
-
},
|
|
9369
|
+
}, Yg = class Yg extends $A {
|
|
9264
9370
|
constructor() {
|
|
9265
9371
|
super();
|
|
9266
9372
|
I(this, "canvas", document.createElement("canvas"));
|
|
9267
|
-
I(this, "context",
|
|
9268
|
-
I(this, "pixelShader", Wi(this.context, this.context.FRAGMENT_SHADER,
|
|
9269
|
-
I(this, "vertexShader", Wi(this.context, this.context.VERTEX_SHADER,
|
|
9270
|
-
I(this, "buffer",
|
|
9373
|
+
I(this, "context", Pn(this.canvas, Zn));
|
|
9374
|
+
I(this, "pixelShader", Wi(this.context, this.context.FRAGMENT_SHADER, Wn));
|
|
9375
|
+
I(this, "vertexShader", Wi(this.context, this.context.VERTEX_SHADER, On));
|
|
9376
|
+
I(this, "buffer", xn(this.context, Yg.SQUARE_VERTICES));
|
|
9271
9377
|
I(this, "program", fo(this.context, this.vertexShader, this.pixelShader));
|
|
9272
9378
|
I(this, "textures", {
|
|
9273
|
-
y:
|
|
9274
|
-
u:
|
|
9275
|
-
v:
|
|
9379
|
+
y: Pe(this.context),
|
|
9380
|
+
u: Pe(this.context),
|
|
9381
|
+
v: Pe(this.context)
|
|
9276
9382
|
});
|
|
9277
9383
|
// Lazy loaded when needed
|
|
9278
9384
|
I(this, "textRenderer");
|
|
9279
|
-
I(this, "size",
|
|
9385
|
+
I(this, "size", Vn);
|
|
9280
9386
|
I(this, "onContextLost", (t) => {
|
|
9281
9387
|
this.textRenderer = void 0;
|
|
9282
9388
|
const e = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
|
|
9283
9389
|
this.emit("context lost", Sc(e)), t.preventDefault();
|
|
9284
9390
|
});
|
|
9285
9391
|
I(this, "onContextRestored", () => {
|
|
9286
|
-
this.emit("context restored"), this.context =
|
|
9287
|
-
y:
|
|
9288
|
-
u:
|
|
9289
|
-
v:
|
|
9392
|
+
this.emit("context restored"), this.context = Pn(this.canvas, Zn), this.pixelShader = Wi(this.context, this.context.FRAGMENT_SHADER, Wn), this.vertexShader = Wi(this.context, this.context.VERTEX_SHADER, On), this.buffer = xn(this.context, Yg.SQUARE_VERTICES), this.program = fo(this.context, this.vertexShader, this.pixelShader), this.textures = {
|
|
9393
|
+
y: Pe(this.context),
|
|
9394
|
+
u: Pe(this.context),
|
|
9395
|
+
v: Pe(this.context)
|
|
9290
9396
|
}, this.load();
|
|
9291
9397
|
});
|
|
9292
9398
|
I(this, "load", () => {
|
|
9293
|
-
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(
|
|
9399
|
+
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(Vn), 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());
|
|
9294
9400
|
});
|
|
9295
9401
|
I(this, "unload", () => {
|
|
9296
9402
|
var e;
|
|
@@ -9399,8 +9505,8 @@ void main() {
|
|
|
9399
9505
|
return this.textRenderer || (this.textRenderer = new hu(this.context)), this.textRenderer;
|
|
9400
9506
|
}
|
|
9401
9507
|
};
|
|
9402
|
-
I(
|
|
9403
|
-
let po =
|
|
9508
|
+
I(Yg, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
|
|
9509
|
+
let po = Yg;
|
|
9404
9510
|
const TC = class TC {
|
|
9405
9511
|
constructor(A, t, e, g) {
|
|
9406
9512
|
I(this, "oldTimestampLimit", 400);
|
|
@@ -9469,11 +9575,11 @@ const TC = class TC {
|
|
|
9469
9575
|
};
|
|
9470
9576
|
I(TC, "create", (A, t, e, g) => new TC(A, t, e, g));
|
|
9471
9577
|
let IC = TC;
|
|
9472
|
-
var
|
|
9578
|
+
var ke;
|
|
9473
9579
|
class gr {
|
|
9474
9580
|
constructor() {
|
|
9475
|
-
n(this,
|
|
9476
|
-
E(this,
|
|
9581
|
+
n(this, ke, []);
|
|
9582
|
+
E(this, ke, []);
|
|
9477
9583
|
}
|
|
9478
9584
|
addTextTrack(A, t, e) {
|
|
9479
9585
|
const g = [], B = {
|
|
@@ -9490,24 +9596,24 @@ class gr {
|
|
|
9490
9596
|
Q !== -1 && g.splice(Q, 1);
|
|
9491
9597
|
}
|
|
9492
9598
|
};
|
|
9493
|
-
return s(this,
|
|
9599
|
+
return s(this, ke).push(B), B;
|
|
9494
9600
|
}
|
|
9495
9601
|
set language(A) {
|
|
9496
|
-
s(this,
|
|
9602
|
+
s(this, ke).forEach((t) => {
|
|
9497
9603
|
t.language === A ? t.mode = "showing" : t.mode = "hidden";
|
|
9498
9604
|
});
|
|
9499
9605
|
}
|
|
9500
9606
|
get language() {
|
|
9501
9607
|
var A;
|
|
9502
|
-
return (A = s(this,
|
|
9608
|
+
return (A = s(this, ke).find((t) => t.mode === "showing")) == null ? void 0 : A.language;
|
|
9503
9609
|
}
|
|
9504
9610
|
getActiveCues(A) {
|
|
9505
|
-
const t = s(this,
|
|
9611
|
+
const t = s(this, ke).find((e) => e.mode === "showing");
|
|
9506
9612
|
return t ? t.cues.filter(({ startTime: e, endTime: g }) => A >= e && A <= g) : [];
|
|
9507
9613
|
}
|
|
9508
9614
|
}
|
|
9509
|
-
|
|
9510
|
-
const
|
|
9615
|
+
ke = new WeakMap();
|
|
9616
|
+
const qe = (i, A) => {
|
|
9511
9617
|
let t;
|
|
9512
9618
|
for (t = A; i > 1; i--) t += A;
|
|
9513
9619
|
return t;
|
|
@@ -9520,13 +9626,13 @@ class du {
|
|
|
9520
9626
|
A.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
9521
9627
|
const t = A.children.item(0);
|
|
9522
9628
|
if (t instanceof HTMLAudioElement)
|
|
9523
|
-
this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
9629
|
+
this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + qe(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + qe(16, "gICA") + qe(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + qe(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + qe(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + qe(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + qe(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
9524
9630
|
else
|
|
9525
9631
|
throw new Error("Failed to create audio tag");
|
|
9526
9632
|
}
|
|
9527
9633
|
}
|
|
9528
9634
|
const PC = class PC {
|
|
9529
|
-
constructor(A, t, e, g, B) {
|
|
9635
|
+
constructor(A, t, e, g, B, C) {
|
|
9530
9636
|
I(this, "logger");
|
|
9531
9637
|
I(this, "emitter");
|
|
9532
9638
|
I(this, "audioPlayer");
|
|
@@ -9577,7 +9683,7 @@ const PC = class PC {
|
|
|
9577
9683
|
this.logger = t, this.emitter = A, this.pool = e, this.audioPlayer = iC.create(this.logger.createContext("AudioPlayerModule"), g, {
|
|
9578
9684
|
muted: B,
|
|
9579
9685
|
reInitWhenStuck: !0
|
|
9580
|
-
}), this.audioPlayer.on("stuck", () => {
|
|
9686
|
+
}), C !== void 0 && (this.audioPlayer.volume = C), this.audioPlayer.on("stuck", () => {
|
|
9581
9687
|
this.isDisconnected = !0;
|
|
9582
9688
|
}), this.audioPlayer.on("state change", () => {
|
|
9583
9689
|
this.emitter.emit("volume state", {
|
|
@@ -9637,10 +9743,10 @@ const PC = class PC {
|
|
|
9637
9743
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
9638
9744
|
}
|
|
9639
9745
|
};
|
|
9640
|
-
I(PC, "create", (A, t, e, g, B) => new PC(A, t, e, g, B));
|
|
9746
|
+
I(PC, "create", (A, t, e, g, B, C) => new PC(A, t, e, g, B, C));
|
|
9641
9747
|
let Fo = PC;
|
|
9642
9748
|
const xC = class xC {
|
|
9643
|
-
constructor(A, t, e, g, { muted: B,
|
|
9749
|
+
constructor(A, t, e, g, { muted: B, volume: C, type: Q, poster: o }) {
|
|
9644
9750
|
I(this, "logger");
|
|
9645
9751
|
I(this, "emitter");
|
|
9646
9752
|
I(this, "mediaElement");
|
|
@@ -9709,23 +9815,24 @@ const xC = class xC {
|
|
|
9709
9815
|
Li(A, this.volumeState) || (this.volumeState = A, this.emitter.emit("volume state", this.volumeState));
|
|
9710
9816
|
});
|
|
9711
9817
|
this.logger = t, this.emitter = A, this.pool = e, this._userProvidedMuted = B, this.mediaElement = new zQ({
|
|
9712
|
-
poster:
|
|
9713
|
-
type:
|
|
9818
|
+
poster: o,
|
|
9819
|
+
type: Q,
|
|
9714
9820
|
muted: B,
|
|
9821
|
+
volume: C,
|
|
9715
9822
|
autoplay: !1,
|
|
9716
9823
|
logger: this.logger.createContext("MediaElement")
|
|
9717
|
-
}), this.mediaElement.on("volume state", (
|
|
9718
|
-
this.updateVolumeState(), !
|
|
9719
|
-
}), this.mediaElement.on("media element state", (
|
|
9720
|
-
|
|
9824
|
+
}), this.mediaElement.on("volume state", (a) => {
|
|
9825
|
+
this.updateVolumeState(), !a.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(H), a.isMuted || (this._userProvidedMuted = !1);
|
|
9826
|
+
}), this.mediaElement.on("media element state", (a) => {
|
|
9827
|
+
a === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", a);
|
|
9721
9828
|
}), this.audioPlayer = iC.create(this.logger.createContext("AudioPlayerModule"), g, {
|
|
9722
9829
|
muted: !1,
|
|
9723
9830
|
// Never muted because its the media element that limits audio output,
|
|
9724
9831
|
reInitWhenStuck: !1
|
|
9725
9832
|
}), this.audioPlayer.on("stuck", () => {
|
|
9726
9833
|
this.isDisconnected = !0;
|
|
9727
|
-
}), this.audioPlayer.on("state change", (
|
|
9728
|
-
|
|
9834
|
+
}), this.audioPlayer.on("state change", (a) => {
|
|
9835
|
+
a === "suspended" || a === "interrupted" ? this.mediaElement.muted = !0 : a === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
|
|
9729
9836
|
}), this.videoPlayer = IC.create(
|
|
9730
9837
|
this.logger.createContext("VideoPlayerModule"),
|
|
9731
9838
|
this.audioPlayer,
|
|
@@ -9785,7 +9892,7 @@ const xC = class xC {
|
|
|
9785
9892
|
};
|
|
9786
9893
|
I(xC, "create", (A, t, e, g, B) => new xC(A, t, e, g, B));
|
|
9787
9894
|
let Go = xC;
|
|
9788
|
-
const lu = () => (i) => sr(i.buffered.start(0), i.buffered.end(i.buffered.length - 1)), sr = (i, A) => (t) => t.remove(Math.max(0, i), Math.min(Number.POSITIVE_INFINITY, A)),
|
|
9895
|
+
const lu = () => (i) => sr(i.buffered.start(0), i.buffered.end(i.buffered.length - 1)), sr = (i, A) => (t) => t.remove(Math.max(0, i), Math.min(Number.POSITIVE_INFINITY, A)), Xn = (i) => (A) => A.appendBuffer(i), uu = (i) => (A) => A.changeType(i), wu = (i) => (A) => i(A);
|
|
9789
9896
|
class Du {
|
|
9790
9897
|
constructor(A) {
|
|
9791
9898
|
I(this, "commandQueue", []);
|
|
@@ -9797,10 +9904,10 @@ class Du {
|
|
|
9797
9904
|
});
|
|
9798
9905
|
I(this, "appendBuffer", (A, t) => new Promise((e, g) => {
|
|
9799
9906
|
if (t && this.currentInit !== t) {
|
|
9800
|
-
const C = new Hi(
|
|
9907
|
+
const C = new Hi(Xn(t), e, g);
|
|
9801
9908
|
this.commandQueue.push(C), this.currentInit = t;
|
|
9802
9909
|
}
|
|
9803
|
-
const B = new Hi(
|
|
9910
|
+
const B = new Hi(Xn(A), e, g);
|
|
9804
9911
|
this.commandQueue.push(B), this.handleQueue();
|
|
9805
9912
|
}));
|
|
9806
9913
|
I(this, "execute", (A) => new Promise((t, e) => {
|
|
@@ -9829,7 +9936,7 @@ class Du {
|
|
|
9829
9936
|
class Br extends $A {
|
|
9830
9937
|
constructor() {
|
|
9831
9938
|
super();
|
|
9832
|
-
I(this, "MediaSource",
|
|
9939
|
+
I(this, "MediaSource", Ig());
|
|
9833
9940
|
I(this, "mediaSource", new this.MediaSource());
|
|
9834
9941
|
I(this, "isOpen", () => this.mediaSource.readyState === "open");
|
|
9835
9942
|
I(this, "isClosed", () => this.mediaSource.readyState === "closed");
|
|
@@ -9886,7 +9993,7 @@ class Br extends $A {
|
|
|
9886
9993
|
}
|
|
9887
9994
|
I(Br, "isTypeSupported", (t) => {
|
|
9888
9995
|
var e, g;
|
|
9889
|
-
return (g = (e =
|
|
9996
|
+
return (g = (e = Ig()) == null ? void 0 : e.isTypeSupported(t)) != null ? g : !1;
|
|
9890
9997
|
});
|
|
9891
9998
|
class Cr {
|
|
9892
9999
|
constructor() {
|
|
@@ -9913,7 +10020,7 @@ function mu(i, { mediaSource: A, mimeType: t, codec: e }) {
|
|
|
9913
10020
|
lastBufferCleanupTime: Date.now()
|
|
9914
10021
|
});
|
|
9915
10022
|
}
|
|
9916
|
-
function
|
|
10023
|
+
function jn({
|
|
9917
10024
|
initSegments: i,
|
|
9918
10025
|
pendingSamples: A
|
|
9919
10026
|
}) {
|
|
@@ -9979,7 +10086,7 @@ const WC = class WC {
|
|
|
9979
10086
|
const g = (Q = (C = A.get(e)) == null ? void 0 : C.pendingSamples) != null ? Q : [], B = (o = A.get(e)) == null ? void 0 : o.initSegments;
|
|
9980
10087
|
for (; g.length > 0 && !((a = g[0]) != null && a.isSync); )
|
|
9981
10088
|
g.shift();
|
|
9982
|
-
this.trackContexts.set(e,
|
|
10089
|
+
this.trackContexts.set(e, jn({ pendingSamples: g, initSegments: B }));
|
|
9983
10090
|
});
|
|
9984
10091
|
});
|
|
9985
10092
|
I(this, "setSourceBuffers", (A) => r(this, null, function* () {
|
|
@@ -10001,7 +10108,7 @@ const WC = class WC {
|
|
|
10001
10108
|
}
|
|
10002
10109
|
for (const e of A) {
|
|
10003
10110
|
let g = this.trackContexts.get(e.type);
|
|
10004
|
-
g || (g =
|
|
10111
|
+
g || (g = jn({ pendingSamples: [], initSegments: new Cr() }), this.trackContexts.set(e.type, g)), g.state === "initialized" ? e.mimeType !== g.mimeType && (yield g.sourceBuffer.changeType(e.mimeType)) : this.trackContexts.set(
|
|
10005
10112
|
e.type,
|
|
10006
10113
|
mu(g, {
|
|
10007
10114
|
mimeType: e.mimeType,
|
|
@@ -10173,7 +10280,7 @@ I(WC, "create", (A, t, e) => {
|
|
|
10173
10280
|
return g.setTrackContexts(), g.mediaSource.on("source ended", g.onSourceEnded), g.mediaSource.on("source open", g.onSourceOpen), g.mediaSource.attach(e), g;
|
|
10174
10281
|
});
|
|
10175
10282
|
let ko = WC;
|
|
10176
|
-
const
|
|
10283
|
+
const zn = (i, A) => {
|
|
10177
10284
|
var Q;
|
|
10178
10285
|
const t = i.renditionId !== A.renditionId, e = i.channelId !== A.channelId, g = ((Q = i.timestamp) != null ? Q : 0) > A.timestamp, B = i.type === "video" && A.type === "video" && "levelIdc" in i && "levelIdc" in A && i.levelIdc !== A.levelIdc;
|
|
10179
10286
|
let C = !1;
|
|
@@ -10186,7 +10293,7 @@ const Xn = (i, A) => {
|
|
|
10186
10293
|
g = Q;
|
|
10187
10294
|
const o = i.pendingSamples[Q], a = i.pendingSamples[Q + 1];
|
|
10188
10295
|
if (o && (e.push(o), a)) {
|
|
10189
|
-
if (
|
|
10296
|
+
if (zn(o, a))
|
|
10190
10297
|
break;
|
|
10191
10298
|
const c = (o.timestamp + o.duration) / o.timescale;
|
|
10192
10299
|
if (a.timestamp / a.timescale - c > 0.1)
|
|
@@ -10198,7 +10305,7 @@ const Xn = (i, A) => {
|
|
|
10198
10305
|
const B = e[0];
|
|
10199
10306
|
if (!B)
|
|
10200
10307
|
break;
|
|
10201
|
-
const C = i.previousSample ?
|
|
10308
|
+
const C = i.previousSample ? zn(i.previousSample, B) : !0;
|
|
10202
10309
|
yield A(e, C), i.pendingSamples = i.pendingSamples.slice(g + 1), i.previousSample = e[e.length - 1];
|
|
10203
10310
|
}
|
|
10204
10311
|
i.isWorkingOnPendingSamples = !1;
|
|
@@ -10400,9 +10507,9 @@ const No = () => ({
|
|
|
10400
10507
|
let g = !1;
|
|
10401
10508
|
if (A.from) {
|
|
10402
10509
|
const U = (b = this.metrics.levels[t]) != null ? b : No();
|
|
10403
|
-
t < e ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()),
|
|
10510
|
+
t < e ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), ve(U.activeRanges);
|
|
10404
10511
|
const G = U.bufferingRanges[U.bufferingRanges.length - 1];
|
|
10405
|
-
g = !!G && !G.end,
|
|
10512
|
+
g = !!G && !G.end, ve(U.bufferingRanges), this.metrics.levels[t] = U;
|
|
10406
10513
|
}
|
|
10407
10514
|
if (A.to) {
|
|
10408
10515
|
const U = (y = this.metrics.levels[e]) != null ? y : No();
|
|
@@ -10441,9 +10548,9 @@ const No = () => ({
|
|
|
10441
10548
|
I(this, "stopBuffering", () => {
|
|
10442
10549
|
if (this.currentLevel) {
|
|
10443
10550
|
const A = this.metrics.levels[this.currentLevel];
|
|
10444
|
-
A &&
|
|
10551
|
+
A && ve(A.bufferingRanges);
|
|
10445
10552
|
}
|
|
10446
|
-
|
|
10553
|
+
ve(this.metrics.general.bufferingRanges);
|
|
10447
10554
|
});
|
|
10448
10555
|
I(this, "startBuffering", () => {
|
|
10449
10556
|
if (this.currentLevel) {
|
|
@@ -10455,9 +10562,9 @@ const No = () => ({
|
|
|
10455
10562
|
I(this, "unsetActive", () => {
|
|
10456
10563
|
if (this.currentLevel) {
|
|
10457
10564
|
const A = this.metrics.levels[this.currentLevel];
|
|
10458
|
-
A &&
|
|
10565
|
+
A && ve(A.activeRanges);
|
|
10459
10566
|
}
|
|
10460
|
-
|
|
10567
|
+
ve(this.metrics.general.activeRanges);
|
|
10461
10568
|
});
|
|
10462
10569
|
I(this, "getQualityIndex", (A) => {
|
|
10463
10570
|
var e, g;
|
|
@@ -10587,7 +10694,7 @@ const XC = class XC {
|
|
|
10587
10694
|
};
|
|
10588
10695
|
I(XC, "create", (A, t) => new XC(A, t));
|
|
10589
10696
|
let Lo = XC;
|
|
10590
|
-
const
|
|
10697
|
+
const ag = (i) => JSON.parse(JSON.stringify(i)), fu = 1e4, jC = class jC {
|
|
10591
10698
|
constructor(A, t, e) {
|
|
10592
10699
|
I(this, "logger");
|
|
10593
10700
|
I(this, "timers", new yA());
|
|
@@ -10641,13 +10748,13 @@ const ng = (i) => JSON.parse(JSON.stringify(i)), fu = 1e4, jC = class jC {
|
|
|
10641
10748
|
return !Li(ln(this.currentSubscription, A), ln(this.targetSubscription, A));
|
|
10642
10749
|
});
|
|
10643
10750
|
I(this, "onSubscriptionChanged", ({ to: A, reset: t }) => {
|
|
10644
|
-
this.logger.debug("onSubscriptionChanged", { to: A, reset: t }), t ? this.targetSubscription =
|
|
10751
|
+
this.logger.debug("onSubscriptionChanged", { to: A, reset: t }), t ? this.targetSubscription = ag(this.currentSubscription) : this.currentSubscription = ag(A), this._isSwitchingSubscription = this.isNewSubscription();
|
|
10645
10752
|
});
|
|
10646
10753
|
I(this, "scheduleSubscriptionChange", () => {
|
|
10647
|
-
this.targetSubscription =
|
|
10754
|
+
this.targetSubscription = ag(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
|
|
10648
10755
|
const A = this.currentSubscription.channelId, t = this.targetSubscription.channelId, e = A !== t;
|
|
10649
10756
|
this._isSwitchingSubscription && (e && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), e && this.timers.setTimeout(() => {
|
|
10650
|
-
this.currentSubscription.channelId === A && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription =
|
|
10757
|
+
this.currentSubscription.channelId === A && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = ag(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
|
|
10651
10758
|
}, fu), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
|
|
10652
10759
|
() => this.emitter.emit("send signal", {
|
|
10653
10760
|
type: "subscribe",
|
|
@@ -10656,12 +10763,12 @@ const ng = (i) => JSON.parse(JSON.stringify(i)), fu = 1e4, jC = class jC {
|
|
|
10656
10763
|
0
|
|
10657
10764
|
));
|
|
10658
10765
|
});
|
|
10659
|
-
this.logger = A, this.targetSubscription = t, this.currentSubscription =
|
|
10766
|
+
this.logger = A, this.targetSubscription = t, this.currentSubscription = ag(t), this.emitter = e, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
10660
10767
|
}
|
|
10661
10768
|
};
|
|
10662
10769
|
I(jC, "create", (A, t, e) => new jC(A, e, t));
|
|
10663
10770
|
let Jo = jC;
|
|
10664
|
-
const
|
|
10771
|
+
const _n = 5e3, pu = () => Fa() || iQ() || Lr(), $n = () => pu() ? 100 : 0, Aa = (i) => (A) => A > i, zC = class zC {
|
|
10665
10772
|
constructor(A, t, e, g, B) {
|
|
10666
10773
|
I(this, "emitter");
|
|
10667
10774
|
I(this, "logger");
|
|
@@ -10693,8 +10800,8 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10693
10800
|
maxBehind: 50,
|
|
10694
10801
|
multiplier: 1,
|
|
10695
10802
|
maxBehindAllowed: 600,
|
|
10696
|
-
overshoot:
|
|
10697
|
-
minOvershootAllowed:
|
|
10803
|
+
overshoot: $n(),
|
|
10804
|
+
minOvershootAllowed: $n(),
|
|
10698
10805
|
maxOvershootAllowed: 500
|
|
10699
10806
|
});
|
|
10700
10807
|
/**
|
|
@@ -10790,7 +10897,7 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10790
10897
|
var g;
|
|
10791
10898
|
if (!A.channelId)
|
|
10792
10899
|
throw new Error("Sample must be assigned to a channel");
|
|
10793
|
-
this.currentChannelId || (this.currentChannelId = A.channelId), this.timestampOffset || (this.timestampOffset = A.timestamp / A.timescale * 1e3 -
|
|
10900
|
+
this.currentChannelId || (this.currentChannelId = A.channelId), this.timestampOffset || (this.timestampOffset = A.timestamp / A.timescale * 1e3 - _n);
|
|
10794
10901
|
const t = A.type === "video" && A.isSync;
|
|
10795
10902
|
if (this.currentChannelId !== A.channelId) {
|
|
10796
10903
|
let B = Number.MAX_SAFE_INTEGER;
|
|
@@ -10813,7 +10920,7 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10813
10920
|
const e = t.mediaType();
|
|
10814
10921
|
if (!e)
|
|
10815
10922
|
throw new Error("Fragment must have a media type");
|
|
10816
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
10923
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - _n);
|
|
10817
10924
|
const g = t.mediaType() === "video" && t.startsWithKeyframe();
|
|
10818
10925
|
this.currentChannelId !== A ? (console.assert(this.highestSeenTimestamps.size !== 0, "no known timestamps"), this.highestSeenTimestamps.forEach((Q) => {
|
|
10819
10926
|
}), this.currentChannelId = A) : (g || this.timeshiftOnAudio) && this.tryTimeshiftSync();
|
|
@@ -10859,7 +10966,7 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10859
10966
|
}
|
|
10860
10967
|
if (!this.timestampOffset)
|
|
10861
10968
|
return;
|
|
10862
|
-
const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, e = this.timeShiftAdjustments.filter(
|
|
10969
|
+
const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, e = this.timeShiftAdjustments.filter(Aa(t)).length;
|
|
10863
10970
|
if (e && this.timeshiftSync.multiplier > 2)
|
|
10864
10971
|
return this.logger.debug("Too many diff timeShifts within sliding window", {
|
|
10865
10972
|
timeShiftsCooldownMs: t,
|
|
@@ -10887,7 +10994,7 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10887
10994
|
const A = (Q = this.drift) != null ? Q : 0;
|
|
10888
10995
|
if (A < 0 && -A < this.currentSyncMaxAhead() || A > 0 && A < this.currentSyncMaxBehind() || Math.abs(A) < 1 || !this.isSeekCooldownExpired())
|
|
10889
10996
|
return;
|
|
10890
|
-
const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, e = this.driftAdjustments.filter(
|
|
10997
|
+
const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, e = this.driftAdjustments.filter(Aa(t)).length;
|
|
10891
10998
|
if (e && this.syncMaxBehindMultiplier > 2)
|
|
10892
10999
|
return this.logger.debug("Too many diff adjustments within sliding window", {
|
|
10893
11000
|
adjustmentsCooldownMs: t,
|
|
@@ -10972,111 +11079,6 @@ const jn = 5e3, pu = () => Fa() || iQ() || Lr(), zn = () => pu() ? 100 : 0, _n =
|
|
|
10972
11079
|
};
|
|
10973
11080
|
I(zC, "create", (A, t, e, g, B) => new zC(A, t, e, g, B));
|
|
10974
11081
|
let Mo = zC;
|
|
10975
|
-
const $n = 1e3, Aa = 50;
|
|
10976
|
-
class Xo {
|
|
10977
|
-
constructor(A) {
|
|
10978
|
-
I(this, "logger");
|
|
10979
|
-
I(this, "trackingState", /* @__PURE__ */ new Map());
|
|
10980
|
-
// Running jitter calculation (RFC 3550 style - exponential moving average with /16)
|
|
10981
|
-
I(this, "runningJitter", /* @__PURE__ */ new Map());
|
|
10982
|
-
// Recent jitter samples for spike detection
|
|
10983
|
-
I(this, "recentJitterSamples", /* @__PURE__ */ new Map());
|
|
10984
|
-
I(this, "load", () => {
|
|
10985
|
-
this.logger.debug("JitterModule loaded");
|
|
10986
|
-
});
|
|
10987
|
-
I(this, "unload", () => {
|
|
10988
|
-
this.trackingState.clear(), this.runningJitter.clear(), this.recentJitterSamples.clear(), this.logger.debug("JitterModule unloaded");
|
|
10989
|
-
});
|
|
10990
|
-
this.logger = A;
|
|
10991
|
-
}
|
|
10992
|
-
static create(A) {
|
|
10993
|
-
return new Xo(A);
|
|
10994
|
-
}
|
|
10995
|
-
/**
|
|
10996
|
-
* Get a unique key for tracking per rendition
|
|
10997
|
-
*/
|
|
10998
|
-
getTrackingKey(A, t) {
|
|
10999
|
-
return `${A}-${t}`;
|
|
11000
|
-
}
|
|
11001
|
-
/**
|
|
11002
|
-
* Record a sample arrival for jitter calculation.
|
|
11003
|
-
* Should be called when a sample/fragment is received.
|
|
11004
|
-
*
|
|
11005
|
-
* Jitter is calculated by comparing the expected inter-arrival time
|
|
11006
|
-
* (derived from media timestamps) with the actual inter-arrival time.
|
|
11007
|
-
*/
|
|
11008
|
-
recordSample(A) {
|
|
11009
|
-
var d, u, m, S;
|
|
11010
|
-
const t = this.getTrackingKey(A.type, A.renditionId), e = (m = (u = (d = globalThis.performance) == null ? void 0 : d.now) == null ? void 0 : u.call(d)) != null ? m : Date.now(), g = A.timestamp / A.timescale * 1e3, B = this.trackingState.get(t);
|
|
11011
|
-
if (!B) {
|
|
11012
|
-
this.trackingState.set(t, {
|
|
11013
|
-
lastArrivalTime: e,
|
|
11014
|
-
lastTimestampMs: g,
|
|
11015
|
-
jitterSamples: new sA($n),
|
|
11016
|
-
interArrivalTimes: new sA($n)
|
|
11017
|
-
}), this.runningJitter.set(t, 0), this.recentJitterSamples.set(t, new sA(Aa));
|
|
11018
|
-
return;
|
|
11019
|
-
}
|
|
11020
|
-
const C = g - B.lastTimestampMs;
|
|
11021
|
-
if (C <= 0) {
|
|
11022
|
-
B.lastArrivalTime = e, B.lastTimestampMs = g;
|
|
11023
|
-
return;
|
|
11024
|
-
}
|
|
11025
|
-
const Q = e - B.lastArrivalTime, o = Math.abs(Q - C);
|
|
11026
|
-
B.jitterSamples.push(o), B.interArrivalTimes.push(Q);
|
|
11027
|
-
const a = (S = this.runningJitter.get(t)) != null ? S : 0, c = a + (o - a) / 16;
|
|
11028
|
-
this.runningJitter.set(t, c);
|
|
11029
|
-
let h = this.recentJitterSamples.get(t);
|
|
11030
|
-
h || (h = new sA(Aa), this.recentJitterSamples.set(t, h)), h.push(o), B.lastArrivalTime = e, B.lastTimestampMs = g;
|
|
11031
|
-
}
|
|
11032
|
-
/**
|
|
11033
|
-
* Get jitter statistics for a specific media type.
|
|
11034
|
-
* Returns undefined if no data is available.
|
|
11035
|
-
* All jitter values are rounded to integer milliseconds for cleaner statistics aggregation.
|
|
11036
|
-
*/
|
|
11037
|
-
getJitterForType(A) {
|
|
11038
|
-
var t, e, g;
|
|
11039
|
-
for (const [B, C] of this.trackingState)
|
|
11040
|
-
if (B.startsWith(A)) {
|
|
11041
|
-
if (C.jitterSamples.items().length < 1)
|
|
11042
|
-
return;
|
|
11043
|
-
const o = (t = this.runningJitter.get(B)) != null ? t : 0, a = (g = (e = this.recentJitterSamples.get(B)) == null ? void 0 : e.items()) != null ? g : [], { min: c, max: h, average: d } = Be(a);
|
|
11044
|
-
return {
|
|
11045
|
-
min: Math.round(c),
|
|
11046
|
-
max: Math.round(h),
|
|
11047
|
-
last: Math.round(d),
|
|
11048
|
-
average: Math.round(o)
|
|
11049
|
-
};
|
|
11050
|
-
}
|
|
11051
|
-
}
|
|
11052
|
-
/**
|
|
11053
|
-
* Get the current running jitter value
|
|
11054
|
-
*/
|
|
11055
|
-
getRunningJitter(A) {
|
|
11056
|
-
for (const [t, e] of this.runningJitter)
|
|
11057
|
-
if (t.startsWith(A))
|
|
11058
|
-
return e;
|
|
11059
|
-
}
|
|
11060
|
-
/**
|
|
11061
|
-
* Reset jitter tracking for a specific rendition or all renditions.
|
|
11062
|
-
*/
|
|
11063
|
-
reset(A, t) {
|
|
11064
|
-
if (A !== void 0 && t !== void 0) {
|
|
11065
|
-
const e = this.getTrackingKey(A, t);
|
|
11066
|
-
this.trackingState.delete(e), this.runningJitter.delete(e), this.recentJitterSamples.delete(e);
|
|
11067
|
-
} else if (A !== void 0)
|
|
11068
|
-
for (const e of this.trackingState.keys())
|
|
11069
|
-
e.startsWith(A) && (this.trackingState.delete(e), this.runningJitter.delete(e), this.recentJitterSamples.delete(e));
|
|
11070
|
-
else
|
|
11071
|
-
this.trackingState.clear(), this.runningJitter.clear(), this.recentJitterSamples.clear();
|
|
11072
|
-
}
|
|
11073
|
-
getStatistics() {
|
|
11074
|
-
return {
|
|
11075
|
-
audioJitter: this.getJitterForType("audio"),
|
|
11076
|
-
videoJitter: this.getJitterForType("video")
|
|
11077
|
-
};
|
|
11078
|
-
}
|
|
11079
|
-
}
|
|
11080
11082
|
const Fu = {
|
|
11081
11083
|
enabled: !0,
|
|
11082
11084
|
interval: 3e4,
|
|
@@ -11257,8 +11259,8 @@ const Uu = 6, Nu = (i) => {
|
|
|
11257
11259
|
let A = [i], t = 0, e = 0, g = !1;
|
|
11258
11260
|
const B = (Q, o) => {
|
|
11259
11261
|
var p, b, y;
|
|
11260
|
-
Q.flags &&
|
|
11261
|
-
const a = Q.timestamp / Q.timescale, h = o.flags &&
|
|
11262
|
+
Q.flags && wg(Q.flags) && (t = (p = Q.compositionTimeOffset) != null ? p : 0), Q.timestamp += t, Q.compositionTimeOffset = ((b = Q.compositionTimeOffset) != null ? b : 0) - t;
|
|
11263
|
+
const a = Q.timestamp / Q.timescale, h = o.flags && wg(o.flags) ? (y = o.compositionTimeOffset) != null ? y : 0 : t, u = (o.timestamp + h) / o.timescale, m = Math.max(0, Math.round((u - a) * Q.timescale));
|
|
11262
11264
|
return m > 0 && (e = m), Y(D({}, Q), {
|
|
11263
11265
|
/*
|
|
11264
11266
|
During resync timeshifts we may end up with negative durations (normalized to 0 above) which is not allowed in mse (the MseModule
|
|
@@ -11268,7 +11270,7 @@ const Uu = 6, Nu = (i) => {
|
|
|
11268
11270
|
});
|
|
11269
11271
|
};
|
|
11270
11272
|
return (Q, o = !1) => {
|
|
11271
|
-
if (Q.flags &&
|
|
11273
|
+
if (Q.flags && wg(Q.flags) && o && (g = !g), !(o && A.length < Uu && g) && A.length > 0) {
|
|
11272
11274
|
g = !1;
|
|
11273
11275
|
let c = Q;
|
|
11274
11276
|
for (let d = A.length - 1; d > 0; d--) {
|
|
@@ -11289,7 +11291,7 @@ const Uu = 6, Nu = (i) => {
|
|
|
11289
11291
|
return D(Y(D({}, i), {
|
|
11290
11292
|
type: "video",
|
|
11291
11293
|
codec: A.codec,
|
|
11292
|
-
isSync:
|
|
11294
|
+
isSync: wg(i.flags),
|
|
11293
11295
|
data: i.payload,
|
|
11294
11296
|
duration: 0,
|
|
11295
11297
|
width: A.width,
|
|
@@ -11303,7 +11305,7 @@ const Uu = 6, Nu = (i) => {
|
|
|
11303
11305
|
sampleRate: A.sampleRate,
|
|
11304
11306
|
codec: A.codec,
|
|
11305
11307
|
language: A.language,
|
|
11306
|
-
isSync:
|
|
11308
|
+
isSync: wg(i.flags),
|
|
11307
11309
|
data: i.payload,
|
|
11308
11310
|
duration: 0
|
|
11309
11311
|
});
|
|
@@ -11546,14 +11548,14 @@ const Mt = class Mt extends $A {
|
|
|
11546
11548
|
I(this, "filterRenditions", (t) => r(this, null, function* () {
|
|
11547
11549
|
const e = yield Promise.all(
|
|
11548
11550
|
t.map((Q) => r(this, null, function* () {
|
|
11549
|
-
var c, h, d;
|
|
11551
|
+
var c, h, d, u;
|
|
11550
11552
|
if (Gi(Q))
|
|
11551
|
-
return !
|
|
11553
|
+
return !(this.willUseMediaSource() && !((c = Ig()) != null && c.isTypeSupported(Ce(Q))));
|
|
11552
11554
|
if (!Fi(Q) || !this.isSupportedVideoCodecProfile(Q.codec, Q.codecString))
|
|
11553
11555
|
return !1;
|
|
11554
11556
|
if (!this.willUseMediaSource()) {
|
|
11555
|
-
const
|
|
11556
|
-
return Q.bitRate <=
|
|
11557
|
+
const m = this.options.get("advanced"), S = (h = m.wasmDecodingConstraint.bitRate) != null ? h : Number.MAX_SAFE_INTEGER, p = (d = m.wasmDecodingConstraint.width) != null ? d : Number.MAX_SAFE_INTEGER, b = (u = m.wasmDecodingConstraint.height) != null ? u : Number.MAX_SAFE_INTEGER;
|
|
11558
|
+
return Q.bitRate <= S && Q.width <= p && Q.height <= b;
|
|
11557
11559
|
}
|
|
11558
11560
|
const o = yield md(Q);
|
|
11559
11561
|
if (!o.supported || Q.codec == "av1" && !o.smooth && !o.powerEfficient)
|
|
@@ -11602,8 +11604,8 @@ const Mt = class Mt extends $A {
|
|
|
11602
11604
|
});
|
|
11603
11605
|
I(this, "isSupportedVideoCodecProfile", (t, e) => {
|
|
11604
11606
|
if (this.willUseMediaSource()) {
|
|
11605
|
-
const g =
|
|
11606
|
-
return g ? g.isTypeSupported(
|
|
11607
|
+
const g = Ig();
|
|
11608
|
+
return g ? g.isTypeSupported(Ce({ codec: t, codecString: e })) : !0;
|
|
11607
11609
|
}
|
|
11608
11610
|
if (t === "h264") {
|
|
11609
11611
|
const g = !!(e != null && e.startsWith("avc1.42")), B = !!(e != null && e.startsWith("avc1.66."));
|
|
@@ -11615,7 +11617,7 @@ const Mt = class Mt extends $A {
|
|
|
11615
11617
|
if (this.options.get("media") === "video")
|
|
11616
11618
|
return [];
|
|
11617
11619
|
const t = [];
|
|
11618
|
-
return (this.browser.supportsMp4Opus && this.options.get("mseOpusEnabled") || !this.willUseMediaSource()) && t.push("opus"),
|
|
11620
|
+
return this.willUseMediaSource() && t.push("aac"), (this.browser.supportsMp4Opus && this.options.get("mseOpusEnabled") || !this.willUseMediaSource()) && t.push("opus"), t;
|
|
11619
11621
|
});
|
|
11620
11622
|
I(this, "initializeDecodingModule", () => r(this, null, function* () {
|
|
11621
11623
|
var g, B;
|
|
@@ -11624,12 +11626,12 @@ const Mt = class Mt extends $A {
|
|
|
11624
11626
|
throw new v("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
|
|
11625
11627
|
if (t != null && t.video && e.push({
|
|
11626
11628
|
type: "video",
|
|
11627
|
-
mimeType:
|
|
11629
|
+
mimeType: Ce(t.video),
|
|
11628
11630
|
codec: t.video.codec
|
|
11629
11631
|
}), t != null && t.audio && e.push({
|
|
11630
11632
|
type: "audio",
|
|
11631
11633
|
codec: t.audio.codec,
|
|
11632
|
-
mimeType:
|
|
11634
|
+
mimeType: Ce(t.audio)
|
|
11633
11635
|
}), e.length === 0)
|
|
11634
11636
|
throw new v("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
|
|
11635
11637
|
if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
|
|
@@ -11726,7 +11728,7 @@ const Mt = class Mt extends $A {
|
|
|
11726
11728
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
11727
11729
|
return D({
|
|
11728
11730
|
uptime: Date.now() - this.createdAt,
|
|
11729
|
-
version: "4.1.
|
|
11731
|
+
version: "4.1.6",
|
|
11730
11732
|
clientId: this.clientId,
|
|
11731
11733
|
sessionId: this.sessionId,
|
|
11732
11734
|
channelId: this.channelId,
|
|
@@ -11814,6 +11816,7 @@ const Mt = class Mt extends $A {
|
|
|
11814
11816
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11815
11817
|
autoplay: !1,
|
|
11816
11818
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11819
|
+
volume: this.options.get("volume"),
|
|
11817
11820
|
logger: this.logger.createContext("MediaElement"),
|
|
11818
11821
|
poster: S
|
|
11819
11822
|
});
|
|
@@ -11827,6 +11830,7 @@ const Mt = class Mt extends $A {
|
|
|
11827
11830
|
{
|
|
11828
11831
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11829
11832
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11833
|
+
volume: this.options.get("volume"),
|
|
11830
11834
|
poster: S
|
|
11831
11835
|
}
|
|
11832
11836
|
), f = w.element();
|
|
@@ -11837,7 +11841,8 @@ const Mt = class Mt extends $A {
|
|
|
11837
11841
|
this.logger.createContext("LegacyCanvasModule"),
|
|
11838
11842
|
this.pool,
|
|
11839
11843
|
this,
|
|
11840
|
-
this.options.get("muted") || this.options.get("media") === "video"
|
|
11844
|
+
this.options.get("muted") || this.options.get("media") === "video",
|
|
11845
|
+
this.options.get("volume")
|
|
11841
11846
|
);
|
|
11842
11847
|
this.element = w.element(), this.playbackSource = w, y = w, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new ud());
|
|
11843
11848
|
}
|
|
@@ -11959,8 +11964,8 @@ const Mt = class Mt extends $A {
|
|
|
11959
11964
|
switch (w) {
|
|
11960
11965
|
case "upgrade":
|
|
11961
11966
|
{
|
|
11962
|
-
const P = Math.min(O + 1, q), FA = f[P], Ji = (F = this.modules.connection.estimatedBandwidth) != null ? F :
|
|
11963
|
-
FA &&
|
|
11967
|
+
const P = Math.min(O + 1, q), FA = f[P], Ji = (F = this.modules.connection.estimatedBandwidth) != null ? F : Re(), Qg = ((T = (k = FA == null ? void 0 : FA.audio) == null ? void 0 : k.bitRate) != null ? T : 0) + ((M = (tA = FA == null ? void 0 : FA.video) == null ? void 0 : tA.bitRate) != null ? M : 0), be = Ji * 2 > Qg;
|
|
11968
|
+
FA && be && this.modules.adaptivity.isQoSOk(FA) && (x = P);
|
|
11964
11969
|
}
|
|
11965
11970
|
break;
|
|
11966
11971
|
case "downgrade":
|
|
@@ -12143,7 +12148,7 @@ const Mt = class Mt extends $A {
|
|
|
12143
12148
|
channelId: f
|
|
12144
12149
|
}), x = Bd(q.codec, q.payload);
|
|
12145
12150
|
x && this.sizes.set(q.renditionId, x);
|
|
12146
|
-
const $ =
|
|
12151
|
+
const $ = Ce({ codec: W.codec, codecString: W.codecString });
|
|
12147
12152
|
this.emitter.emit("init segment", { initSegment: q, mimeType: $ }), this.emit("initialized media");
|
|
12148
12153
|
} else {
|
|
12149
12154
|
const q = bu(w, W, this.sizes.get(w.renditionId));
|
|
@@ -12360,7 +12365,14 @@ const Mt = class Mt extends $A {
|
|
|
12360
12365
|
* Set the current language
|
|
12361
12366
|
*/
|
|
12362
12367
|
set language(t) {
|
|
12363
|
-
this.
|
|
12368
|
+
if (t === this.language)
|
|
12369
|
+
return;
|
|
12370
|
+
const e = this.languages;
|
|
12371
|
+
if (t !== void 0 && e.length > 0 && !e.includes(t)) {
|
|
12372
|
+
this.logger.warn(`Language "${t}" is not available. Available languages: ${e.join(", ")}`);
|
|
12373
|
+
return;
|
|
12374
|
+
}
|
|
12375
|
+
this.modules.subscription.setLanguage(t), this.alignSizeAndBitRate(this.targetSubscription);
|
|
12364
12376
|
}
|
|
12365
12377
|
/**
|
|
12366
12378
|
* Set the active text track
|
|
@@ -12435,7 +12447,7 @@ const Mt = class Mt extends $A {
|
|
|
12435
12447
|
*/
|
|
12436
12448
|
get maxVideoBitRate() {
|
|
12437
12449
|
var t, e;
|
|
12438
|
-
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? e :
|
|
12450
|
+
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? e : Re();
|
|
12439
12451
|
}
|
|
12440
12452
|
/**
|
|
12441
12453
|
* Set max video bit rate that will be subscribed to
|
|
@@ -12452,7 +12464,7 @@ const Mt = class Mt extends $A {
|
|
|
12452
12464
|
*/
|
|
12453
12465
|
get maxAudioBitRate() {
|
|
12454
12466
|
var t, e;
|
|
12455
|
-
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? e :
|
|
12467
|
+
return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? e : Re();
|
|
12456
12468
|
}
|
|
12457
12469
|
/**
|
|
12458
12470
|
* Set max audio bit rate that will be subscribed to
|
|
@@ -13109,19 +13121,19 @@ class jw extends At {
|
|
|
13109
13121
|
const zw = "_fullscreen_1v9d8_1", _w = {
|
|
13110
13122
|
fullscreen: zw
|
|
13111
13123
|
}, LQ = _w.fullscreen;
|
|
13112
|
-
var
|
|
13124
|
+
var sg, cr, hr;
|
|
13113
13125
|
const AQ = class AQ extends $A {
|
|
13114
13126
|
constructor(t) {
|
|
13115
13127
|
super();
|
|
13116
|
-
n(this,
|
|
13128
|
+
n(this, sg);
|
|
13117
13129
|
I(this, "container");
|
|
13118
13130
|
I(this, "unload", () => {
|
|
13119
13131
|
document.removeEventListener("webkitfullscreenchange", this.onChange), document.removeEventListener("mozfullscreenchange", this.onChange), document.removeEventListener("fullscreenchange", this.onChange), this.container.removeEventListener("webkitendfullscreen", this.onChange);
|
|
13120
13132
|
});
|
|
13121
|
-
I(this, "request", () => l(this,
|
|
13133
|
+
I(this, "request", () => l(this, sg, cr).call(this).catch((t) => {
|
|
13122
13134
|
throw this.onChange(), t;
|
|
13123
13135
|
}));
|
|
13124
|
-
I(this, "exit", () => l(this,
|
|
13136
|
+
I(this, "exit", () => l(this, sg, hr).call(this).catch((t) => {
|
|
13125
13137
|
throw this.onChange(), t;
|
|
13126
13138
|
}));
|
|
13127
13139
|
I(this, "onChange", () => this.emit("on fullscreen change", this.isFullscreen()));
|
|
@@ -13131,12 +13143,12 @@ const AQ = class AQ extends $A {
|
|
|
13131
13143
|
this.container = t, document.addEventListener("webkitfullscreenchange", this.onChange), document.addEventListener("mozfullscreenchange", this.onChange), document.addEventListener("fullscreenchange", this.onChange), this.container.addEventListener("webkitendfullscreen", this.onChange);
|
|
13132
13144
|
}
|
|
13133
13145
|
};
|
|
13134
|
-
|
|
13146
|
+
sg = new WeakSet(), cr = function() {
|
|
13135
13147
|
return this.container.requestFullscreen ? this.container.requestFullscreen() : this.container.webkitRequestFullscreen ? this.container.webkitRequestFullscreen() : this.container.webkitEnterFullscreen ? this.container.webkitEnterFullscreen() : this.container.mozRequestFullScreen ? this.container.mozRequestFullScreen() : (this.container.classList.add(LQ), Promise.resolve());
|
|
13136
13148
|
}, hr = function() {
|
|
13137
13149
|
return document.exitFullscreen ? document.exitFullscreen() : document.webkitFullscreenElement && document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozFullscreenElement && document.mozCancelFullScreen ? document.mozCancelFullScreen() : this.container.webkitExitFullscreen ? this.container.webkitExitFullscreen() : (this.container.classList.remove(LQ), Promise.resolve());
|
|
13138
13150
|
}, I(AQ, "isFullscreenApiSupported", (t) => (t.requestFullscreen || t.webkitRequestFullscreen || t.webkitEnterFullscreen || t.mozRequestFullScreen) !== void 0);
|
|
13139
|
-
let
|
|
13151
|
+
let Dg = AQ;
|
|
13140
13152
|
const $w = "_player_j1uto_1", zo = {
|
|
13141
13153
|
player: $w,
|
|
13142
13154
|
"one-to-one": "_one-to-one_j1uto_19",
|
|
@@ -13357,10 +13369,10 @@ class cD {
|
|
|
13357
13369
|
var o, a, c, h, d, u, m;
|
|
13358
13370
|
const e = D(D({}, CD), t);
|
|
13359
13371
|
this.options = e, this.playerElement.className = sD, QD(A) ? this.core = A : this.core = new Ho(A);
|
|
13360
|
-
const g = !
|
|
13372
|
+
const g = !Dg.isFullscreenApiSupported(this.playerElement) && Dg.isFullscreenApiSupported(this.core.mediaElement) ? this.core.mediaElement : this.playerElement;
|
|
13361
13373
|
this.state = {
|
|
13362
13374
|
isBuffering: !1,
|
|
13363
|
-
fullscreen: new
|
|
13375
|
+
fullscreen: new Dg(g),
|
|
13364
13376
|
lastInteractionTime: 0
|
|
13365
13377
|
}, this.needsThumbnails() && (this.thumbnailModule = new gD({
|
|
13366
13378
|
vindral: this.core,
|
|
@@ -13527,28 +13539,28 @@ var oD = (function() {
|
|
|
13527
13539
|
}, b: function() {
|
|
13528
13540
|
}, a: function(F, k, T, tA) {
|
|
13529
13541
|
for (var M = 0, P = 0; P < T; P++) {
|
|
13530
|
-
for (var FA = S[k + 8 * P >> 2], Ji = S[k + (8 * P + 4) >> 2],
|
|
13531
|
-
var
|
|
13532
|
-
if (
|
|
13533
|
-
|
|
13534
|
-
for (var ct = nQ, bt = 0,
|
|
13542
|
+
for (var FA = S[k + 8 * P >> 2], Ji = S[k + (8 * P + 4) >> 2], Qg = 0; Qg < Ji; Qg++) {
|
|
13543
|
+
var be = m[FA + Qg], nQ = W[F];
|
|
13544
|
+
if (be === 0 || be === 10) {
|
|
13545
|
+
be = F === 1 ? o : a;
|
|
13546
|
+
for (var ct = nQ, bt = 0, Le = bt + NaN, Mi = bt; ct[Mi] && !(Mi >= Le); ) ++Mi;
|
|
13535
13547
|
if (16 < Mi - bt && ct.subarray && u) ct = u.decode(ct.subarray(bt, Mi));
|
|
13536
13548
|
else {
|
|
13537
|
-
for (
|
|
13549
|
+
for (Le = ""; bt < Mi; ) {
|
|
13538
13550
|
var KA = ct[bt++];
|
|
13539
13551
|
if (KA & 128) {
|
|
13540
13552
|
var aQ = ct[bt++] & 63;
|
|
13541
|
-
if ((KA & 224) == 192)
|
|
13553
|
+
if ((KA & 224) == 192) Le += String.fromCharCode((KA & 31) << 6 | aQ);
|
|
13542
13554
|
else {
|
|
13543
13555
|
var Cn = ct[bt++] & 63;
|
|
13544
|
-
KA = (KA & 240) == 224 ? (KA & 15) << 12 | aQ << 6 | Cn : (KA & 7) << 18 | aQ << 12 | Cn << 6 | ct[bt++] & 63, 65536 > KA ?
|
|
13556
|
+
KA = (KA & 240) == 224 ? (KA & 15) << 12 | aQ << 6 | Cn : (KA & 7) << 18 | aQ << 12 | Cn << 6 | ct[bt++] & 63, 65536 > KA ? Le += String.fromCharCode(KA) : (KA -= 65536, Le += String.fromCharCode(55296 | KA >> 10, 56320 | KA & 1023));
|
|
13545
13557
|
}
|
|
13546
|
-
} else
|
|
13558
|
+
} else Le += String.fromCharCode(KA);
|
|
13547
13559
|
}
|
|
13548
|
-
ct =
|
|
13560
|
+
ct = Le;
|
|
13549
13561
|
}
|
|
13550
|
-
|
|
13551
|
-
} else nQ.push(
|
|
13562
|
+
be(ct), nQ.length = 0;
|
|
13563
|
+
} else nQ.push(be);
|
|
13552
13564
|
}
|
|
13553
13565
|
M += Ji;
|
|
13554
13566
|
}
|
|
@@ -13671,7 +13683,7 @@ I(it, "MAX_OPUS_BUFFER", 1e3 * 1e3), I(it, "MAX_SAMPLES", 6 * 960), I(it, "creat
|
|
|
13671
13683
|
return new it(yield oD(), A, t);
|
|
13672
13684
|
}));
|
|
13673
13685
|
let qo = it;
|
|
13674
|
-
const
|
|
13686
|
+
const Tg = class Tg {
|
|
13675
13687
|
constructor(A) {
|
|
13676
13688
|
I(this, "decodedSamples", []);
|
|
13677
13689
|
I(this, "decoder");
|
|
@@ -13705,10 +13717,10 @@ const Yg = class Yg {
|
|
|
13705
13717
|
return this.errors.pop();
|
|
13706
13718
|
}
|
|
13707
13719
|
};
|
|
13708
|
-
I(
|
|
13709
|
-
return new
|
|
13720
|
+
I(Tg, "create", (A, t) => r(null, null, function* () {
|
|
13721
|
+
return new Tg(yield qo.create(A, t));
|
|
13710
13722
|
}));
|
|
13711
|
-
let vo =
|
|
13723
|
+
let vo = Tg;
|
|
13712
13724
|
const nD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13713
13725
|
__proto__: null,
|
|
13714
13726
|
OpusDecoderContext: vo
|
|
@@ -13732,7 +13744,7 @@ function aD(i) {
|
|
|
13732
13744
|
);
|
|
13733
13745
|
}
|
|
13734
13746
|
}
|
|
13735
|
-
const
|
|
13747
|
+
const Pg = class Pg {
|
|
13736
13748
|
constructor(A, t) {
|
|
13737
13749
|
I(this, "decodedSamples", []);
|
|
13738
13750
|
I(this, "codedSamples", []);
|
|
@@ -13796,7 +13808,7 @@ const Tg = class Tg {
|
|
|
13796
13808
|
return this.errors.pop();
|
|
13797
13809
|
}
|
|
13798
13810
|
};
|
|
13799
|
-
I(
|
|
13811
|
+
I(Pg, "create", (A) => r(null, null, function* () {
|
|
13800
13812
|
const t = new aD();
|
|
13801
13813
|
return yield new Promise((e, g) => {
|
|
13802
13814
|
const B = (C) => {
|
|
@@ -13811,9 +13823,9 @@ I(Tg, "create", (A) => r(null, null, function* () {
|
|
|
13811
13823
|
}
|
|
13812
13824
|
};
|
|
13813
13825
|
t.addEventListener("message", B);
|
|
13814
|
-
}), new
|
|
13826
|
+
}), new Pg(t, A);
|
|
13815
13827
|
}));
|
|
13816
|
-
let Ko =
|
|
13828
|
+
let Ko = Pg;
|
|
13817
13829
|
const ED = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
13818
13830
|
__proto__: null,
|
|
13819
13831
|
H264DecoderWorkerContext: Ko
|