@vindral/web-sdk 4.1.4-19-g8547e5cc → 4.1.4-20-g9f477019
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/{V7C-2S1T.js → DYshyTUA.js} +686 -669
- package/{BGsPPvx4.js → MIEZaUMK.js} +1 -1
- package/core.d.ts +3 -3
- package/core.js +1 -1
- package/{D8oScnm-.js → khx9Y_Dv.js} +1 -1
- package/legacy.d.ts +3 -3
- package/legacy.es.js +31 -14
- package/legacy.umd.js +7 -7
- package/package.json +1 -1
- package/player.d.ts +3 -3
- package/player.js +1 -1
- package/react.d.ts +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var rm = Object.create;
|
|
2
2
|
var Wc = Object.defineProperty, am = Object.defineProperties, om = Object.getOwnPropertyDescriptor, cm = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var Za = Object.getOwnPropertySymbols;
|
|
4
4
|
var wu = Object.prototype.hasOwnProperty, bu = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var dt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Bt = (s) => {
|
|
6
6
|
throw TypeError(s);
|
|
@@ -8,38 +8,38 @@ var dt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Bt = (s) =>
|
|
|
8
8
|
var $a = (s, e, t) => e in s ? Wc(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, v = (s, e) => {
|
|
9
9
|
for (var t in e || (e = {}))
|
|
10
10
|
wu.call(e, t) && $a(s, t, e[t]);
|
|
11
|
-
if (
|
|
12
|
-
for (var t of
|
|
11
|
+
if (Za)
|
|
12
|
+
for (var t of Za(e))
|
|
13
13
|
bu.call(e, t) && $a(s, t, e[t]);
|
|
14
14
|
return s;
|
|
15
|
-
},
|
|
15
|
+
}, M = (s, e) => am(s, cm(e)), Au = (s, e) => Wc(s, "name", { value: e, configurable: !0 });
|
|
16
16
|
var yu = (s, e) => {
|
|
17
17
|
var t = {};
|
|
18
18
|
for (var i in s)
|
|
19
19
|
wu.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
|
|
20
|
-
if (s != null &&
|
|
21
|
-
for (var i of
|
|
20
|
+
if (s != null && Za)
|
|
21
|
+
for (var i of Za(s))
|
|
22
22
|
e.indexOf(i) < 0 && bu.call(s, i) && (t[i] = s[i]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
25
|
var Ci = (s) => {
|
|
26
26
|
var e;
|
|
27
27
|
return [, , , rm((e = s == null ? void 0 : s[dt("metadata")]) != null ? e : null)];
|
|
28
|
-
}, vu = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Yn = (s) => s !== void 0 && typeof s != "function" ? Bt("Function expected") : s, hm = (s, e, t, i, n) => ({ kind: vu[s], name: e, metadata: i, addInitializer: (o) => t._ ? Bt("Already initialized") : n.push(Yn(o || null)) }),
|
|
28
|
+
}, vu = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Yn = (s) => s !== void 0 && typeof s != "function" ? Bt("Function expected") : s, hm = (s, e, t, i, n) => ({ kind: vu[s], name: e, metadata: i, addInitializer: (o) => t._ ? Bt("Already initialized") : n.push(Yn(o || null)) }), Jt = (s, e) => $a(e, dt("metadata"), s[3]), ki = (s, e, t, i) => {
|
|
29
29
|
for (var n = 0, o = s[e >> 1], c = o && o.length; n < c; n++) e & 1 ? o[n].call(t) : i = o[n].call(t, i);
|
|
30
30
|
return i;
|
|
31
31
|
}, ye = (s, e, t, i, n, o) => {
|
|
32
|
-
var c, h, u, m, p, g = e & 7, w = !!(e & 8), b = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0, I = vu[g + 5],
|
|
32
|
+
var c, h, u, m, p, g = e & 7, w = !!(e & 8), b = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0, I = vu[g + 5], k = g > 3 && (s[S - 1] = []), D = s[S] || (s[S] = []), T = g && (!b && !w && (n = n.prototype), g < 5 && (g > 3 || !b) && om(g < 4 ? n : { get [t]() {
|
|
33
33
|
return a(this, o);
|
|
34
34
|
}, set [t](R) {
|
|
35
35
|
return l(this, o, R);
|
|
36
36
|
} }, t));
|
|
37
37
|
g ? b && g < 4 && Au(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : Au(n, t);
|
|
38
38
|
for (var P = i.length - 1; P >= 0; P--)
|
|
39
|
-
m = hm(g, t, u = {}, s[3], D), g && (m.static = w, m.private = b, p = m.access = { has: b ? (R) => um(n, R) : (R) => t in R }, g ^ 3 && (p.get = b ? (R) => (g ^ 1 ? a : A)(R, n, g ^ 4 ? o : T.get) : (R) => R[t]), g > 2 && (p.set = b ? (R,
|
|
40
|
-
return g ||
|
|
39
|
+
m = hm(g, t, u = {}, s[3], D), g && (m.static = w, m.private = b, p = m.access = { has: b ? (R) => um(n, R) : (R) => t in R }, g ^ 3 && (p.get = b ? (R) => (g ^ 1 ? a : A)(R, n, g ^ 4 ? o : T.get) : (R) => R[t]), g > 2 && (p.set = b ? (R, X) => l(R, n, X, g ^ 4 ? o : T.set) : (R, X) => R[t] = X)), h = (0, i[P])(g ? g < 4 ? b ? o : T[I] : g > 4 ? void 0 : { get: T.get, set: T.set } : n, m), u._ = 1, g ^ 4 || h === void 0 ? Yn(h) && (g > 4 ? k.unshift(h) : g ? b ? o = h : T[I] = h : n = h) : typeof h != "object" || h === null ? Bt("Object expected") : (Yn(c = h.get) && (T.get = c), Yn(c = h.set) && (T.set = c), Yn(c = h.init) && k.unshift(c));
|
|
40
|
+
return g || Jt(s, n), T && Wc(n, t, T), b ? g ^ 4 ? o : T : n;
|
|
41
41
|
}, r = (s, e, t) => $a(s, typeof e != "symbol" ? e + "" : e, t), zc = (s, e, t) => e.has(s) || Bt("Cannot " + t), um = (s, e) => Object(e) !== e ? Bt('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => (zc(s, e, "read from private field"), t ? t.call(s) : e.get(s)), d = (s, e, t) => e.has(s) ? Bt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), l = (s, e, t, i) => (zc(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), A = (s, e, t) => (zc(s, e, "access private method"), t);
|
|
42
|
-
var
|
|
42
|
+
var Ze = (s, e, t, i) => ({
|
|
43
43
|
set _(n) {
|
|
44
44
|
l(s, e, n, t);
|
|
45
45
|
},
|
|
@@ -62,12 +62,12 @@ var f = (s, e, t) => new Promise((i, n) => {
|
|
|
62
62
|
}
|
|
63
63
|
}, h = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(o, c);
|
|
64
64
|
h((t = t.apply(s, e)).next());
|
|
65
|
-
}),
|
|
65
|
+
}), q = function(s, e) {
|
|
66
66
|
this[0] = s, this[1] = e;
|
|
67
67
|
}, Rt = (s, e, t) => {
|
|
68
68
|
var i = (c, h, u, m) => {
|
|
69
69
|
try {
|
|
70
|
-
var p = t[c](h), g = (h = p.value) instanceof
|
|
70
|
+
var p = t[c](h), g = (h = p.value) instanceof q, w = p.done;
|
|
71
71
|
Promise.resolve(g ? h[0] : h).then((b) => g ? i(c === "return" ? c : "next", h[1] ? { done: b.done, value: b.value } : b, u, m) : u({ value: b, done: w })).catch((b) => i("throw", b, u, m));
|
|
72
72
|
} catch (b) {
|
|
73
73
|
m(b);
|
|
@@ -83,7 +83,7 @@ var f = (s, e, t) => new Promise((i, n) => {
|
|
|
83
83
|
}
|
|
84
84
|
return t = !0, {
|
|
85
85
|
done: !1,
|
|
86
|
-
value: new
|
|
86
|
+
value: new q(new Promise((h) => {
|
|
87
87
|
var u = e[o](c);
|
|
88
88
|
u instanceof Object || Bt("Object expected"), h(u);
|
|
89
89
|
}), 1)
|
|
@@ -121,7 +121,7 @@ var Ve = (s, e, t) => {
|
|
|
121
121
|
return o();
|
|
122
122
|
};
|
|
123
123
|
import { E as Ei } from "./Bx7s5QdT.js";
|
|
124
|
-
import { a as
|
|
124
|
+
import { a as Xe, p as vd, i as Sd, c as dm, b as lm, A as mm, d as fm, t as pm, e as gm } from "./CPEMXA01.js";
|
|
125
125
|
class Su {
|
|
126
126
|
constructor(e) {
|
|
127
127
|
r(this, "maxSize", 0);
|
|
@@ -156,7 +156,7 @@ class Su {
|
|
|
156
156
|
return this._borrowedBuffers;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const O = () => {
|
|
160
160
|
};
|
|
161
161
|
class z {
|
|
162
162
|
constructor() {
|
|
@@ -186,7 +186,7 @@ class z {
|
|
|
186
186
|
}, this.reject = (i) => {
|
|
187
187
|
this.pending = !1, t(i);
|
|
188
188
|
};
|
|
189
|
-
}), this.promise.catch(
|
|
189
|
+
}), this.promise.catch(O);
|
|
190
190
|
}
|
|
191
191
|
static resolved(e) {
|
|
192
192
|
const t = new z();
|
|
@@ -226,11 +226,11 @@ class oe {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
function tu(s) {
|
|
229
|
-
const e = new
|
|
229
|
+
const e = new Mc(s);
|
|
230
230
|
return [e, e];
|
|
231
231
|
}
|
|
232
232
|
var Pt, Hs, Ye, Lr;
|
|
233
|
-
class
|
|
233
|
+
class Mc {
|
|
234
234
|
constructor(e) {
|
|
235
235
|
/// The internal queue
|
|
236
236
|
d(this, Pt);
|
|
@@ -251,7 +251,7 @@ class Oc {
|
|
|
251
251
|
}
|
|
252
252
|
abort(e) {
|
|
253
253
|
var t, i;
|
|
254
|
-
(t = a(this, Ye)) == null || t.promise.catch(
|
|
254
|
+
(t = a(this, Ye)) == null || t.promise.catch(O), (i = a(this, Ye)) == null || i.reject(e);
|
|
255
255
|
}
|
|
256
256
|
push(e) {
|
|
257
257
|
return f(this, null, function* () {
|
|
@@ -309,12 +309,12 @@ class Ed {
|
|
|
309
309
|
r(this, "peekBit", () => this.getBit(a(this, mt), a(this, Ke)));
|
|
310
310
|
r(this, "readBit", () => {
|
|
311
311
|
const e = this.peekBit();
|
|
312
|
-
return
|
|
312
|
+
return Ze(this, Ke)._++, e;
|
|
313
313
|
});
|
|
314
314
|
r(this, "readBits", (e) => {
|
|
315
315
|
let t = 0;
|
|
316
316
|
for (let i = 0; i < e; i++)
|
|
317
|
-
t = t << 1 | (this.getBit(a(this, mt),
|
|
317
|
+
t = t << 1 | (this.getBit(a(this, mt), Ze(this, Ke)._++) ? 1 : 0);
|
|
318
318
|
return t;
|
|
319
319
|
});
|
|
320
320
|
r(this, "remainingBits", () => a(this, mt).byteLength * 8 - a(this, Ke));
|
|
@@ -324,11 +324,11 @@ class Ed {
|
|
|
324
324
|
});
|
|
325
325
|
r(this, "readUnsignedExpGolomb", () => {
|
|
326
326
|
let e = 0;
|
|
327
|
-
for (; this.getBit(a(this, mt),
|
|
327
|
+
for (; this.getBit(a(this, mt), Ze(this, Ke)._++) === 0; )
|
|
328
328
|
e++;
|
|
329
329
|
let t = 1 << e;
|
|
330
330
|
for (let i = e - 1; i >= 0; i--)
|
|
331
|
-
t |= this.getBit(a(this, mt),
|
|
331
|
+
t |= this.getBit(a(this, mt), Ze(this, Ke)._++) << i;
|
|
332
332
|
return t - 1;
|
|
333
333
|
});
|
|
334
334
|
// Safety: We assume that base has enough elements
|
|
@@ -355,7 +355,7 @@ const iu = (s, e, t) => {
|
|
|
355
355
|
return i;
|
|
356
356
|
};
|
|
357
357
|
var se, xt, ti;
|
|
358
|
-
class
|
|
358
|
+
class qn {
|
|
359
359
|
constructor(e) {
|
|
360
360
|
d(this, se);
|
|
361
361
|
d(this, xt);
|
|
@@ -551,9 +551,9 @@ class Cs {
|
|
|
551
551
|
}
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
const
|
|
554
|
+
const Qt = (s) => s.reduce((e, t) => e + t, 0) / s.length, ei = (s) => ({
|
|
555
555
|
last: s[s.length - 1] || 0,
|
|
556
|
-
average: s.length === 0 ? 0 :
|
|
556
|
+
average: s.length === 0 ? 0 : Qt(s),
|
|
557
557
|
max: s.length === 0 ? 0 : Math.max(...s),
|
|
558
558
|
min: s.length === 0 ? 0 : Math.min(...s)
|
|
559
559
|
}), Bm = (s) => {
|
|
@@ -584,7 +584,7 @@ class Rm {
|
|
|
584
584
|
return this._total;
|
|
585
585
|
}
|
|
586
586
|
get average() {
|
|
587
|
-
return this.rates.isEmpty() ? 0 :
|
|
587
|
+
return this.rates.isEmpty() ? 0 : Qt(this.rates.items());
|
|
588
588
|
}
|
|
589
589
|
get minMaxAverage() {
|
|
590
590
|
return ei(this.rates.items());
|
|
@@ -601,13 +601,13 @@ const Is = (s, e) => {
|
|
|
601
601
|
}, Eu = ["off", "error", "warn", "info", "debug", "trace"], Um = {
|
|
602
602
|
OFF: "off"
|
|
603
603
|
};
|
|
604
|
-
var
|
|
604
|
+
var Mi, Or, Fi, Qs, Xs;
|
|
605
605
|
const $t = class $t {
|
|
606
606
|
constructor({ context: e, logLevel: t, debug: i }) {
|
|
607
|
-
d(this,
|
|
608
|
-
d(this,
|
|
607
|
+
d(this, Mi, /* @__PURE__ */ new Map());
|
|
608
|
+
d(this, Or, "");
|
|
609
609
|
d(this, Fi, !1);
|
|
610
|
-
d(this,
|
|
610
|
+
d(this, Qs, "off");
|
|
611
611
|
r(this, "trace", (...e) => {
|
|
612
612
|
});
|
|
613
613
|
r(this, "debug", (...e) => {
|
|
@@ -622,19 +622,19 @@ const $t = class $t {
|
|
|
622
622
|
});
|
|
623
623
|
r(this, "count", (...e) => {
|
|
624
624
|
});
|
|
625
|
-
l(this,
|
|
625
|
+
l(this, Or, e), l(this, Qs, t), l(this, Fi, i || !1), this.setLevel(t), this.setDebug(a(this, Fi));
|
|
626
626
|
}
|
|
627
627
|
setDebug(e) {
|
|
628
628
|
l(this, Fi, e);
|
|
629
|
-
for (const [t, i] of a(this,
|
|
629
|
+
for (const [t, i] of a(this, Mi))
|
|
630
630
|
i.setDebug(e);
|
|
631
631
|
e ? (this.table = console.table.bind(console), this.count = console.count.bind(console)) : (this.table = () => {
|
|
632
632
|
}, this.count = () => {
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
635
|
setLevel(e) {
|
|
636
|
-
l(this,
|
|
637
|
-
for (const [i, n] of a(this,
|
|
636
|
+
l(this, Qs, e);
|
|
637
|
+
for (const [i, n] of a(this, Mi))
|
|
638
638
|
n.setLevel(e);
|
|
639
639
|
const t = Eu.indexOf(e);
|
|
640
640
|
for (const [i, n] of Eu.entries())
|
|
@@ -644,23 +644,23 @@ const $t = class $t {
|
|
|
644
644
|
"font-weight:bold;",
|
|
645
645
|
n.toUpperCase(),
|
|
646
646
|
"font-weight:normal;",
|
|
647
|
-
a(this,
|
|
647
|
+
a(this, Or)
|
|
648
648
|
) : this[n] = () => {
|
|
649
649
|
});
|
|
650
650
|
}
|
|
651
651
|
createContext(e) {
|
|
652
|
-
const t = a(this,
|
|
652
|
+
const t = a(this, Mi).get(e);
|
|
653
653
|
if (!t) {
|
|
654
|
-
const i = new $t({ context: `${e}`, logLevel: a(this,
|
|
655
|
-
return a(this,
|
|
654
|
+
const i = new $t({ context: `${e}`, logLevel: a(this, Qs), debug: a(this, Fi) });
|
|
655
|
+
return a(this, Mi).set(e, i), i;
|
|
656
656
|
}
|
|
657
657
|
return t;
|
|
658
658
|
}
|
|
659
659
|
static get() {
|
|
660
|
-
return a($t,
|
|
660
|
+
return a($t, Xs) || l($t, Xs, new $t({ context: "Vindral", logLevel: "off" })), a($t, Xs);
|
|
661
661
|
}
|
|
662
662
|
};
|
|
663
|
-
|
|
663
|
+
Mi = new WeakMap(), Or = new WeakMap(), Fi = new WeakMap(), Qs = new WeakMap(), Xs = new WeakMap(), d($t, Xs);
|
|
664
664
|
let ge = $t;
|
|
665
665
|
function Pe(s) {
|
|
666
666
|
const e = ge.get().createContext(s.context);
|
|
@@ -688,10 +688,10 @@ function kt() {
|
|
|
688
688
|
function kd() {
|
|
689
689
|
return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: Symbol.for("dispose") }), Symbol.dispose;
|
|
690
690
|
}
|
|
691
|
-
var
|
|
691
|
+
var Mr, oh;
|
|
692
692
|
class Pm {
|
|
693
693
|
constructor(e, t) {
|
|
694
|
-
d(this,
|
|
694
|
+
d(this, Mr);
|
|
695
695
|
r(this, "value");
|
|
696
696
|
r(this, "unlocker");
|
|
697
697
|
this.value = e, this.unlocker = t;
|
|
@@ -701,13 +701,13 @@ class Pm {
|
|
|
701
701
|
return (e = this.unlocker) == null ? void 0 : e.promise;
|
|
702
702
|
}
|
|
703
703
|
[kd()]() {
|
|
704
|
-
A(this,
|
|
704
|
+
A(this, Mr, oh).call(this);
|
|
705
705
|
}
|
|
706
706
|
[Symbol.dispose]() {
|
|
707
|
-
A(this,
|
|
707
|
+
A(this, Mr, oh).call(this);
|
|
708
708
|
}
|
|
709
709
|
}
|
|
710
|
-
|
|
710
|
+
Mr = new WeakSet(), oh = function() {
|
|
711
711
|
this.unlocker.resolve(this.value);
|
|
712
712
|
};
|
|
713
713
|
var _i, Ni;
|
|
@@ -728,7 +728,7 @@ class xm {
|
|
|
728
728
|
const e = new z();
|
|
729
729
|
e.promise.then((i) => {
|
|
730
730
|
l(this, _i, i);
|
|
731
|
-
}).catch(
|
|
731
|
+
}).catch(O);
|
|
732
732
|
const t = a(this, Ni).promise.then(() => e);
|
|
733
733
|
return l(this, Ni, e), yield t, new Pm(a(this, _i), e);
|
|
734
734
|
});
|
|
@@ -789,7 +789,7 @@ class Ie {
|
|
|
789
789
|
const [e, t] = this.value();
|
|
790
790
|
if (yield e, !t)
|
|
791
791
|
return;
|
|
792
|
-
yield new
|
|
792
|
+
yield new q(t);
|
|
793
793
|
}
|
|
794
794
|
});
|
|
795
795
|
}
|
|
@@ -861,7 +861,7 @@ const Cu = () => {
|
|
|
861
861
|
return new Promise((n, o) => setTimeout(() => o(e), s));
|
|
862
862
|
}), Lm = (s, e) => f(null, null, function* () {
|
|
863
863
|
throw yield s, new Error(e);
|
|
864
|
-
}), ws = (s) => "width" in s && typeof s.width == "number", bs = (s) => "sampleRate" in s && typeof s.sampleRate == "number",
|
|
864
|
+
}), ws = (s) => "width" in s && typeof s.width == "number", bs = (s) => "sampleRate" in s && typeof s.sampleRate == "number", Oi = (s) => {
|
|
865
865
|
switch (s.codec) {
|
|
866
866
|
case "opus":
|
|
867
867
|
return 'audio/mp4; codecs="opus"';
|
|
@@ -879,7 +879,7 @@ const Cu = () => {
|
|
|
879
879
|
}, Si = () => Number.MAX_SAFE_INTEGER, lo = () => ({
|
|
880
880
|
width: Number.MAX_SAFE_INTEGER,
|
|
881
881
|
height: Number.MAX_SAFE_INTEGER
|
|
882
|
-
}), ku = (s) => !(typeof s != "object" || s === null || !("type" in s)), Dm = "connection_failed",
|
|
882
|
+
}), ku = (s) => !(typeof s != "object" || s === null || !("type" in s)), Dm = "connection_failed", Om = "connection_failed_will_not_attempt_again", Mm = "authentication_error", Fm = "authentication_expired", _m = "channel_not_found", Nm = "no_incoming_data_error", Vm = "connection_inactivity", Gm = "missing_init_segment", jm = "no_track_context", Wm = "invalid_track_context_state", zm = "disconnected_by_edge", Hm = "decoder_error", Qm = "audio_player_error", Xm = "media_source_error", qm = "webgl_context_lost_error", Jm = "access_forbidden", Zm = "channel_switch_failed", $m = "drm_error";
|
|
883
883
|
class x extends Error {
|
|
884
884
|
constructor(t, i, n = {}) {
|
|
885
885
|
super(t);
|
|
@@ -910,7 +910,7 @@ class x extends Error {
|
|
|
910
910
|
r(this, "toStringifiable", () => {
|
|
911
911
|
var n;
|
|
912
912
|
const t = this.source(), i = t instanceof Error ? t.stack : this.stack;
|
|
913
|
-
return
|
|
913
|
+
return M(v({}, this.extra), {
|
|
914
914
|
code: this.props.code,
|
|
915
915
|
isFatal: this.props.isFatal,
|
|
916
916
|
type: this.props.type,
|
|
@@ -926,13 +926,13 @@ const Ym = (s, e) => new x(
|
|
|
926
926
|
"MediaElement Error",
|
|
927
927
|
{ isFatal: s, code: "media_element_error", source: e },
|
|
928
928
|
{ mediaErrorCode: e.code }
|
|
929
|
-
), Km = (s, e) => new x("Decoder Error", { isFatal: s, code: Hm, source: e, type: "internal" }), Rd = (s, e) => new x("Audio Player Error", { isFatal: s, code:
|
|
929
|
+
), Km = (s, e) => new x("Decoder Error", { isFatal: s, code: Hm, source: e, type: "internal" }), Rd = (s, e) => new x("Audio Player Error", { isFatal: s, code: Qm, source: e, type: "internal" }), ef = (s, e) => new x(`No init segment for rendition id ${s} for channel ${e}`, {
|
|
930
930
|
isFatal: !1,
|
|
931
931
|
code: Gm,
|
|
932
932
|
type: "internal"
|
|
933
933
|
}), Bu = (s, e, t, i) => new x(
|
|
934
934
|
"MediaSource Error",
|
|
935
|
-
{ isFatal: s, code:
|
|
935
|
+
{ isFatal: s, code: Xm, source: e, type: "internal" },
|
|
936
936
|
{ type: i, consecutiveErrorsCount: t }
|
|
937
937
|
), Ya = (s, e) => new x(`No track context for ${s}${e ? `, rendition id ${e}` : ""}`, {
|
|
938
938
|
isFatal: !1,
|
|
@@ -950,14 +950,14 @@ const Ym = (s, e) => new x(
|
|
|
950
950
|
source: s,
|
|
951
951
|
isFatal: !1,
|
|
952
952
|
code: zm
|
|
953
|
-
}), mo = (s) => new x("Authentication Failed", { isFatal: !0, code:
|
|
953
|
+
}), mo = (s) => new x("Authentication Failed", { isFatal: !0, code: Mm, source: s }), nf = (s) => new x("Authentication Expired", { isFatal: !0, code: Fm, source: s }), rf = (s, e) => new x("Connection closed due to inactivity", { isFatal: !1, code: Vm, source: e, type: s }), Ud = (s, e) => new x("Channel not found", { isFatal: !1, code: _m, source: e, type: s }), af = (s) => new x("No Incoming Data", { isFatal: !1, code: Nm, source: s }), of = (s) => new x("Connection attempt failed", {
|
|
954
954
|
isFatal: !1,
|
|
955
955
|
code: Dm,
|
|
956
956
|
source: s
|
|
957
957
|
}), Pd = () => new x("Connection failed - no more reconnect attempts", {
|
|
958
958
|
isFatal: !0,
|
|
959
|
-
code:
|
|
960
|
-
}), cf = (s) => new x("WebGL Context Lost", { isFatal: !1, code:
|
|
959
|
+
code: Om
|
|
960
|
+
}), cf = (s) => new x("WebGL Context Lost", { isFatal: !1, code: qm, source: s, type: "internal" }), Ru = (s) => new x(s, { isFatal: !0, code: Jm }), Uu = (s) => new x(`Channel switch to '${s}' failed`, { isFatal: !1, code: Zm }), xd = (s, e = !1, t) => new x(s, { isFatal: e, code: $m, source: t }), hf = {
|
|
961
961
|
sizeBasedResolutionCapEnabled: !0,
|
|
962
962
|
pictureInPictureEnabled: !0,
|
|
963
963
|
abrEnabled: !0,
|
|
@@ -1089,7 +1089,7 @@ const Pu = {
|
|
|
1089
1089
|
widevine: ["SW_SECURE_CRYPTO", "SW_SECURE_DECODE", "HW_SECURE_CRYPTO", "HW_SECURE_DECODE", "HW_SECURE_ALL"],
|
|
1090
1090
|
fairplay: [""],
|
|
1091
1091
|
clearkey: [""]
|
|
1092
|
-
},
|
|
1092
|
+
}, Qc = {
|
|
1093
1093
|
initDataTypes: ["cenc"],
|
|
1094
1094
|
audioCapabilities: [
|
|
1095
1095
|
{
|
|
@@ -1115,15 +1115,15 @@ const Pu = {
|
|
|
1115
1115
|
},
|
|
1116
1116
|
playready: {
|
|
1117
1117
|
keySystem: "com.microsoft.playready",
|
|
1118
|
-
supportedConfig:
|
|
1118
|
+
supportedConfig: Qc
|
|
1119
1119
|
},
|
|
1120
1120
|
widevine: {
|
|
1121
1121
|
keySystem: "com.widevine.alpha",
|
|
1122
|
-
supportedConfig:
|
|
1122
|
+
supportedConfig: Qc
|
|
1123
1123
|
},
|
|
1124
1124
|
clearkey: {
|
|
1125
1125
|
keySystem: "org.w3.clearkey",
|
|
1126
|
-
supportedConfig:
|
|
1126
|
+
supportedConfig: Qc
|
|
1127
1127
|
}
|
|
1128
1128
|
}, Dd = (s, e) => f(null, null, function* () {
|
|
1129
1129
|
return navigator.requestMediaKeySystemAccess(s, [e]).catch(() => {
|
|
@@ -1131,7 +1131,7 @@ const Pu = {
|
|
|
1131
1131
|
}), xu = (s, e, t, i, n, o) => f(null, null, function* () {
|
|
1132
1132
|
let c;
|
|
1133
1133
|
for (const h of i) {
|
|
1134
|
-
const u = t == null ? void 0 : t.map((p) =>
|
|
1134
|
+
const u = t == null ? void 0 : t.map((p) => M(v({}, p), {
|
|
1135
1135
|
robustness: h,
|
|
1136
1136
|
contentType: o ? `${n === "audioCapabilities" ? "audio/mp4" : "video/mp4"}; codecs="${o}"` : p.contentType
|
|
1137
1137
|
}));
|
|
@@ -1208,7 +1208,7 @@ class wf extends _c {
|
|
|
1208
1208
|
}
|
|
1209
1209
|
requestLicense(e) {
|
|
1210
1210
|
return f(this, null, function* () {
|
|
1211
|
-
|
|
1211
|
+
Xe(this.licenseServerUrl, "No license server URL set");
|
|
1212
1212
|
const t = new URL(this.licenseServerUrl);
|
|
1213
1213
|
for (const [o, c] of Object.entries(this.queryParams))
|
|
1214
1214
|
t.searchParams.append(o, c);
|
|
@@ -1229,7 +1229,7 @@ class bf extends _c {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
const yf = 5e3;
|
|
1232
|
-
var V, ji, Lt, tt, ft, de, ii, si, zo,
|
|
1232
|
+
var V, ji, Lt, tt, ft, de, ii, si, zo, qs, _r, Nr, re, Od, Md, Fd, _d, Ho, Qo, Nd, ir, Xo, Vd, Gd;
|
|
1233
1233
|
class Lu {
|
|
1234
1234
|
constructor(e, t, i = {}) {
|
|
1235
1235
|
d(this, re);
|
|
@@ -1245,16 +1245,16 @@ class Lu {
|
|
|
1245
1245
|
/**
|
|
1246
1246
|
* Timeout to wait for new drm data when channel switch happens
|
|
1247
1247
|
*/
|
|
1248
|
-
d(this,
|
|
1248
|
+
d(this, qs);
|
|
1249
1249
|
d(this, _r, (e) => {
|
|
1250
|
-
if (a(this, V).info("Received DRM data", { drmData: e }), window.clearTimeout(a(this,
|
|
1250
|
+
if (a(this, V).info("Received DRM data", { drmData: e }), window.clearTimeout(a(this, qs)), a(this, de)) {
|
|
1251
1251
|
const t = A(this, re, Gd).call(this, e)[a(this, de).keySystem];
|
|
1252
1252
|
t && (a(this, de).licenseServerUrl = t);
|
|
1253
1253
|
}
|
|
1254
1254
|
a(this, tt).resolve(e);
|
|
1255
1255
|
});
|
|
1256
1256
|
d(this, Nr, (e) => {
|
|
1257
|
-
a(this, V).info("Encrypted event received", { event: e }), A(this, re,
|
|
1257
|
+
a(this, V).info("Encrypted event received", { event: e }), A(this, re, Od).call(this, e);
|
|
1258
1258
|
});
|
|
1259
1259
|
d(this, Ho, (e) => {
|
|
1260
1260
|
var o, c;
|
|
@@ -1275,7 +1275,7 @@ class Lu {
|
|
|
1275
1275
|
A(this, re, ir).call(this, { message: "Failed to request license", isFatal: !1, error: h });
|
|
1276
1276
|
});
|
|
1277
1277
|
});
|
|
1278
|
-
d(this,
|
|
1278
|
+
d(this, Qo, (e) => {
|
|
1279
1279
|
const t = e.target;
|
|
1280
1280
|
a(this, V).debug("Key status changed for session", { sessionId: t.sessionId }), t.keyStatuses.forEach((i, n) => {
|
|
1281
1281
|
const o = Ld(window.btoa(String.fromCharCode(...new Uint8Array(n))));
|
|
@@ -1285,7 +1285,7 @@ class Lu {
|
|
|
1285
1285
|
/**
|
|
1286
1286
|
* Get the CDM based on the DRM data and the supported key systems
|
|
1287
1287
|
*/
|
|
1288
|
-
d(this,
|
|
1288
|
+
d(this, Xo, (e) => f(this, null, function* () {
|
|
1289
1289
|
const t = A(this, re, Vd).call(this, e);
|
|
1290
1290
|
a(this, V).debug("Prioritized key system list", { keySystemList: t });
|
|
1291
1291
|
const i = yield pf(t, e.videoCodec, e.audioCodec, {
|
|
@@ -1297,7 +1297,7 @@ class Lu {
|
|
|
1297
1297
|
a(this, V).debug("Supported key system found", i.mediaKeySystemAccess.getConfiguration());
|
|
1298
1298
|
const { keySystem: n, mediaKeySystemAccess: o } = i;
|
|
1299
1299
|
let c = null;
|
|
1300
|
-
return n === "clearkey" ? (
|
|
1300
|
+
return n === "clearkey" ? (Xe(e.clearkeys, "No clearkeys found"), c = new lf(o, e.clearkeys)) : n === "playready" ? (Xe(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new wf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Xe(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new bf(o, e.widevineLicenseUrl)) : n === "fairplay" && (Xe(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Xe(e.fairplayCertificate, "No fairplayCertificate found"), c = new gf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, ft).headers || {}, c.queryParams = a(this, ft).queryParams || {}), c;
|
|
1301
1301
|
}));
|
|
1302
1302
|
l(this, ji, e), l(this, V, t), l(this, ft, i), a(this, ji).on("received drm data", a(this, _r));
|
|
1303
1303
|
}
|
|
@@ -1331,22 +1331,22 @@ class Lu {
|
|
|
1331
1331
|
Im() && a(this, zo).platform.safariVersion < 18 && A(this, re, ir).call(this, {
|
|
1332
1332
|
message: "DRM channel switch not supported on Safari < 18",
|
|
1333
1333
|
isFatal: !0
|
|
1334
|
-
}), window.clearTimeout(a(this,
|
|
1334
|
+
}), window.clearTimeout(a(this, qs));
|
|
1335
1335
|
const e = a(this, tt).resolved;
|
|
1336
|
-
l(this, tt, new z()), l(this,
|
|
1336
|
+
l(this, tt, new z()), l(this, qs, window.setTimeout(() => {
|
|
1337
1337
|
a(this, tt).resolve(e);
|
|
1338
1338
|
}, yf));
|
|
1339
1339
|
}
|
|
1340
1340
|
}
|
|
1341
|
-
V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), ft = new WeakMap(), de = new WeakMap(), ii = new WeakMap(), si = new WeakMap(), zo = new WeakMap(),
|
|
1341
|
+
V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), ft = new WeakMap(), de = new WeakMap(), ii = new WeakMap(), si = new WeakMap(), zo = new WeakMap(), qs = new WeakMap(), _r = new WeakMap(), Nr = new WeakMap(), re = new WeakSet(), Od = function(e) {
|
|
1342
1342
|
return f(this, null, function* () {
|
|
1343
1343
|
try {
|
|
1344
|
-
yield A(this, re,
|
|
1344
|
+
yield A(this, re, Md).call(this), a(this, V).debug("Media keys initialization completed"), yield A(this, re, Fd).call(this, e.initData, e.initDataType);
|
|
1345
1345
|
} catch (t) {
|
|
1346
1346
|
A(this, re, ir).call(this, { message: "Failed to handle encrypted event", isFatal: !0, error: t });
|
|
1347
1347
|
}
|
|
1348
1348
|
});
|
|
1349
|
-
},
|
|
1349
|
+
}, Md = function() {
|
|
1350
1350
|
return f(this, null, function* () {
|
|
1351
1351
|
var t;
|
|
1352
1352
|
a(this, V).debug("Initializing media keys");
|
|
@@ -1360,22 +1360,22 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), f
|
|
|
1360
1360
|
return;
|
|
1361
1361
|
}
|
|
1362
1362
|
l(this, si, f(this, null, function* () {
|
|
1363
|
-
const i = yield a(this,
|
|
1364
|
-
a(this, V).debug("CDM obtained", { cdm: i }),
|
|
1363
|
+
const i = yield a(this, Xo).call(this, e);
|
|
1364
|
+
a(this, V).debug("CDM obtained", { cdm: i }), Xe(a(this, Lt), "No media element found"), Xe(i, "No CDM found");
|
|
1365
1365
|
const n = yield i.getMediaKeys();
|
|
1366
1366
|
i.certificate && (yield A(this, re, Nd).call(this, n, i.certificate)), a(this, V).debug("Setting media keys on media element"), yield a(this, Lt).setMediaKeys(n), l(this, de, i);
|
|
1367
1367
|
})), yield a(this, si);
|
|
1368
1368
|
});
|
|
1369
1369
|
}, Fd = function(e, t) {
|
|
1370
1370
|
return f(this, null, function* () {
|
|
1371
|
-
|
|
1371
|
+
Xe(a(this, de), "No CDM manager found");
|
|
1372
1372
|
const i = yield a(this, de).getMediaKeys();
|
|
1373
1373
|
if (!e || !A(this, re, _d).call(this, e)) {
|
|
1374
1374
|
a(this, V).debug("Duplicate initData, no need to create new session", { initData: e });
|
|
1375
1375
|
return;
|
|
1376
1376
|
}
|
|
1377
1377
|
const n = i.createSession();
|
|
1378
|
-
a(this, V).debug("Creating new session", { session: n }), n.addEventListener("keystatuseschange", a(this,
|
|
1378
|
+
a(this, V).debug("Creating new session", { session: n }), n.addEventListener("keystatuseschange", a(this, Qo)), n.closed.then((o) => {
|
|
1379
1379
|
a(this, V).info("Session is closed", { reason: o });
|
|
1380
1380
|
}), n.addEventListener("message", a(this, Ho)), a(this, ii).set(n, e), a(this, V).debug("Generating request for session", { session: n, initDataType: t, initData: e }), yield n.generateRequest(t, e);
|
|
1381
1381
|
});
|
|
@@ -1383,7 +1383,7 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), f
|
|
|
1383
1383
|
for (const [t, i] of a(this, ii))
|
|
1384
1384
|
if (df(e, i)) return !1;
|
|
1385
1385
|
return !0;
|
|
1386
|
-
}, Ho = new WeakMap(),
|
|
1386
|
+
}, Ho = new WeakMap(), Qo = new WeakMap(), Nd = function(e, t) {
|
|
1387
1387
|
return f(this, null, function* () {
|
|
1388
1388
|
try {
|
|
1389
1389
|
a(this, V).debug("Setting server certificate", { certificate: t }), (yield e.setServerCertificate(t)) || a(this, V).warn("Server certificates are not supported by the CDM.");
|
|
@@ -1394,7 +1394,7 @@ V = new WeakMap(), ji = new WeakMap(), Lt = new WeakMap(), tt = new WeakMap(), f
|
|
|
1394
1394
|
}, ir = function(e) {
|
|
1395
1395
|
const { message: t, isFatal: i, error: n } = e;
|
|
1396
1396
|
a(this, V).error(t, { error: n }), a(this, ji).emit("error", xd(t, i, n));
|
|
1397
|
-
},
|
|
1397
|
+
}, Xo = new WeakMap(), /**
|
|
1398
1398
|
* Get the prioritized key system list based on the DRM data provided.
|
|
1399
1399
|
* The order of the key systems in the list is the order in which they will be tried.
|
|
1400
1400
|
* If clearkeys are provided, it will be the first in the list.
|
|
@@ -1480,12 +1480,12 @@ const vf = 7, Sf = 8, Ef = (s) => {
|
|
|
1480
1480
|
case 138:
|
|
1481
1481
|
case 144: {
|
|
1482
1482
|
if (c = o.readUnsignedExpGolomb(), c === 3 && o.readBits(1), o.readUnsignedExpGolomb() + 8, o.readUnsignedExpGolomb() + 8, o.readBit(), o.readBit()) {
|
|
1483
|
-
for (let
|
|
1483
|
+
for (let k = 0; k < (c != 3 ? 8 : 12); k++)
|
|
1484
1484
|
if (o.readBit()) {
|
|
1485
|
-
const T =
|
|
1486
|
-
let P = 0, R = 8,
|
|
1487
|
-
for (let
|
|
1488
|
-
|
|
1485
|
+
const T = k < 6 ? 16 : 64;
|
|
1486
|
+
let P = 0, R = 8, X = 8;
|
|
1487
|
+
for (let Q = 0; Q < T; Q++)
|
|
1488
|
+
X != 0 && (P = o.readSignedExpGolomb(), X = (R + P + 256) % 256), R = X == 0 ? R : X;
|
|
1489
1489
|
}
|
|
1490
1490
|
}
|
|
1491
1491
|
break;
|
|
@@ -1502,8 +1502,8 @@ const vf = 7, Sf = 8, Ef = (s) => {
|
|
|
1502
1502
|
p === 0 && o.readBit(), o.readBit();
|
|
1503
1503
|
let g = u + 1, w = m + 1;
|
|
1504
1504
|
if (w *= 2 - p, w *= 16, g *= 16, o.readBit()) {
|
|
1505
|
-
const I = c == 1 ? 1 : 0, D = 1 << (c == 1 || c == 2 ? 1 : 0), T = 2 - p << I, P = o.readUnsignedExpGolomb() * D, R = o.readUnsignedExpGolomb() * D,
|
|
1506
|
-
g -= P + R, w -=
|
|
1505
|
+
const I = c == 1 ? 1 : 0, D = 1 << (c == 1 || c == 2 ? 1 : 0), T = 2 - p << I, P = o.readUnsignedExpGolomb() * D, R = o.readUnsignedExpGolomb() * D, X = o.readUnsignedExpGolomb() * T, Q = o.readUnsignedExpGolomb() * T;
|
|
1506
|
+
g -= P + R, w -= X + Q;
|
|
1507
1507
|
}
|
|
1508
1508
|
let b = {
|
|
1509
1509
|
numerator: 1,
|
|
@@ -1537,11 +1537,11 @@ const vf = 7, Sf = 8, Ef = (s) => {
|
|
|
1537
1537
|
{ numerator: 2, denumerator: 1 }
|
|
1538
1538
|
], Rf = 184549376;
|
|
1539
1539
|
function Uf(s) {
|
|
1540
|
-
const e = new
|
|
1540
|
+
const e = new qn(s), t = Pf(e);
|
|
1541
1541
|
(t.flags & Rf) !== 0 && xf(e);
|
|
1542
1542
|
const i = Lf(e);
|
|
1543
1543
|
if (String.fromCharCode(...i.frameId) === "TXXX") {
|
|
1544
|
-
const o = new
|
|
1544
|
+
const o = new qn(e.readBytes(i.size));
|
|
1545
1545
|
return {
|
|
1546
1546
|
header: t,
|
|
1547
1547
|
txx: Df(o)
|
|
@@ -1587,21 +1587,21 @@ function Wd(s) {
|
|
|
1587
1587
|
type: i
|
|
1588
1588
|
};
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1591
|
-
const t = Wd(e), i = new
|
|
1590
|
+
function Of(s, e) {
|
|
1591
|
+
const t = Wd(e), i = new qn(e.readBytes(t.size));
|
|
1592
1592
|
if (t.type !== s.type)
|
|
1593
1593
|
throw new Error(`invalid error type: ${t.type}, expected ${s.type}`);
|
|
1594
1594
|
const n = s.decodeData(i);
|
|
1595
1595
|
return i.readRemaining(), n;
|
|
1596
1596
|
}
|
|
1597
|
-
function
|
|
1597
|
+
function qt(s) {
|
|
1598
1598
|
const e = s.readUint8(), t = s.readUint24();
|
|
1599
1599
|
return {
|
|
1600
1600
|
version: e,
|
|
1601
1601
|
flags: t
|
|
1602
1602
|
};
|
|
1603
1603
|
}
|
|
1604
|
-
const
|
|
1604
|
+
const Os = class Os {
|
|
1605
1605
|
constructor({
|
|
1606
1606
|
timescale: e,
|
|
1607
1607
|
presentationTime: t,
|
|
@@ -1612,7 +1612,7 @@ const Ms = class Ms {
|
|
|
1612
1612
|
id: h,
|
|
1613
1613
|
data: u
|
|
1614
1614
|
}) {
|
|
1615
|
-
r(this, "type",
|
|
1615
|
+
r(this, "type", Os.type);
|
|
1616
1616
|
r(this, "timescale");
|
|
1617
1617
|
r(this, "presentationTime");
|
|
1618
1618
|
r(this, "presentationTimeDelta");
|
|
@@ -1624,11 +1624,11 @@ const Ms = class Ms {
|
|
|
1624
1624
|
this.timescale = e, this.presentationTime = t, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = o, this.eventDuration = c, this.id = h, this.data = u;
|
|
1625
1625
|
}
|
|
1626
1626
|
static decodeData(e) {
|
|
1627
|
-
const { version: t } =
|
|
1627
|
+
const { version: t } = qt(e);
|
|
1628
1628
|
switch (t) {
|
|
1629
1629
|
case 1: {
|
|
1630
1630
|
const i = e.readUint32(), n = e.readUint64(), o = e.readUint32(), c = e.readUint32(), h = e.readUtf8String(), u = e.readUtf8String(), m = e.remaining(), p = e.readBytes(m);
|
|
1631
|
-
return new
|
|
1631
|
+
return new Os({
|
|
1632
1632
|
timescale: i,
|
|
1633
1633
|
presentationTime: n,
|
|
1634
1634
|
eventDuration: o,
|
|
@@ -1640,15 +1640,15 @@ const Ms = class Ms {
|
|
|
1640
1640
|
}
|
|
1641
1641
|
case 0: {
|
|
1642
1642
|
const i = e.readUtf8String(), n = e.readUtf8String(), o = e.readUint32(), c = e.readUint32(), h = e.readUint32(), u = e.readUint32(), m = e.remaining(), p = e.readBytes(m);
|
|
1643
|
-
return new
|
|
1643
|
+
return new Os({ timescale: o, presentationTimeDelta: c, schemeIdUri: i, value: n, eventDuration: h, id: u, data: p });
|
|
1644
1644
|
}
|
|
1645
1645
|
default:
|
|
1646
1646
|
throw new Error(`unsupported version ${t}`);
|
|
1647
1647
|
}
|
|
1648
1648
|
}
|
|
1649
1649
|
};
|
|
1650
|
-
r(
|
|
1651
|
-
let fo =
|
|
1650
|
+
r(Os, "type", "emsg");
|
|
1651
|
+
let fo = Os;
|
|
1652
1652
|
const hr = class hr {
|
|
1653
1653
|
constructor(e) {
|
|
1654
1654
|
r(this, "type", hr.type);
|
|
@@ -1674,14 +1674,14 @@ const ur = class ur {
|
|
|
1674
1674
|
this.extra = e, this.byteOffset = t, this.baseMediaDecodeTime = i;
|
|
1675
1675
|
}
|
|
1676
1676
|
static decodeData(e) {
|
|
1677
|
-
const t =
|
|
1677
|
+
const t = qt(e), i = e.byteOffset();
|
|
1678
1678
|
let n = 0;
|
|
1679
1679
|
return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new ur(t, i, n);
|
|
1680
1680
|
}
|
|
1681
1681
|
};
|
|
1682
1682
|
r(ur, "type", "tfdt");
|
|
1683
1683
|
let go = ur;
|
|
1684
|
-
const
|
|
1684
|
+
const Mf = 1, Ff = 2, _f = 8, Nf = 16, Vf = 32, dr = class dr {
|
|
1685
1685
|
constructor(e, t, i, n) {
|
|
1686
1686
|
r(this, "type", dr.type);
|
|
1687
1687
|
r(this, "extra");
|
|
@@ -1691,9 +1691,9 @@ const Of = 1, Ff = 2, _f = 8, Nf = 16, Vf = 32, dr = class dr {
|
|
|
1691
1691
|
this.extra = e, this.defaultSampleDuration = t, this.defaultSampleSize = i, this.defaultSampleFlags = n;
|
|
1692
1692
|
}
|
|
1693
1693
|
static decodeData(e) {
|
|
1694
|
-
const t =
|
|
1694
|
+
const t = qt(e);
|
|
1695
1695
|
let i, n, o;
|
|
1696
|
-
return e.readUint32(), (t.flags &
|
|
1696
|
+
return e.readUint32(), (t.flags & Mf) > 0 && e.readUint64(), (t.flags & Ff) > 0 && e.readUint32(), (t.flags & _f) > 0 && (i = e.readUint32()), (t.flags & Nf) > 0 && (n = e.readUint32()), (t.flags & Vf) > 0 && (o = e.readUint32()), new dr(t, i, n, o);
|
|
1697
1697
|
}
|
|
1698
1698
|
};
|
|
1699
1699
|
r(dr, "type", "tfhd");
|
|
@@ -1718,7 +1718,7 @@ const Y = class Y {
|
|
|
1718
1718
|
return (this.firstSampleFlags & t) === 0;
|
|
1719
1719
|
}
|
|
1720
1720
|
static decodeData(e) {
|
|
1721
|
-
const { flags: t } =
|
|
1721
|
+
const { flags: t } = qt(e), i = e.readUint32();
|
|
1722
1722
|
let n, o;
|
|
1723
1723
|
t & Y.TRUN_DATA_OFFSET && (n = e.readUint32()), t & Y.TRUN_FIRST_SAMPLE_FLAGS && (o = e.readUint32());
|
|
1724
1724
|
const c = new Y(i, n, o);
|
|
@@ -1796,16 +1796,16 @@ const pr = class pr {
|
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
1798
|
static decodeData(e) {
|
|
1799
|
-
|
|
1799
|
+
qt(e), e.readUint32();
|
|
1800
1800
|
const t = String.fromCharCode(...e.readBytes(4));
|
|
1801
1801
|
return new pr(t);
|
|
1802
1802
|
}
|
|
1803
1803
|
};
|
|
1804
1804
|
r(pr, "type", "hdlr");
|
|
1805
1805
|
let vo = pr;
|
|
1806
|
-
const
|
|
1806
|
+
const Ms = class Ms {
|
|
1807
1807
|
constructor(e, t, i, n) {
|
|
1808
|
-
r(this, "type",
|
|
1808
|
+
r(this, "type", Ms.type);
|
|
1809
1809
|
r(this, "creationTime");
|
|
1810
1810
|
r(this, "modificationTime");
|
|
1811
1811
|
r(this, "timescale");
|
|
@@ -1813,17 +1813,17 @@ const Os = class Os {
|
|
|
1813
1813
|
this.creationTime = e, this.modificationTime = t, this.timescale = i, this.duration = n;
|
|
1814
1814
|
}
|
|
1815
1815
|
static decodeData(e) {
|
|
1816
|
-
const { version: t } =
|
|
1816
|
+
const { version: t } = qt(e);
|
|
1817
1817
|
if (t === 1) {
|
|
1818
1818
|
const h = e.readUint64(), u = e.readUint64(), m = e.readUint32(), p = e.readUint64();
|
|
1819
|
-
return new
|
|
1819
|
+
return new Ms(h, u, m, p);
|
|
1820
1820
|
}
|
|
1821
1821
|
const i = e.readUint32(), n = e.readUint32(), o = e.readUint32(), c = e.readUint32();
|
|
1822
|
-
return new
|
|
1822
|
+
return new Ms(i, n, o, c);
|
|
1823
1823
|
}
|
|
1824
1824
|
};
|
|
1825
|
-
r(
|
|
1826
|
-
let So =
|
|
1825
|
+
r(Ms, "type", "mdhd");
|
|
1826
|
+
let So = Ms;
|
|
1827
1827
|
const gr = class gr {
|
|
1828
1828
|
constructor(e, t, i, n) {
|
|
1829
1829
|
r(this, "type", gr.type);
|
|
@@ -1845,7 +1845,7 @@ const gr = class gr {
|
|
|
1845
1845
|
return (e = this.avc1) == null ? void 0 : e.height;
|
|
1846
1846
|
}
|
|
1847
1847
|
static decodeData(e) {
|
|
1848
|
-
|
|
1848
|
+
qt(e);
|
|
1849
1849
|
const t = e.readUint32();
|
|
1850
1850
|
let i, n, o, c;
|
|
1851
1851
|
for (let h = 0; h < t; h++)
|
|
@@ -1948,7 +1948,7 @@ const yr = class yr {
|
|
|
1948
1948
|
this.modificationTime = e, this.creationTime = t, this.trackId = i, this.duration = n, this.alternateGroup = o, this.volume = c, this.width = h, this.height = u;
|
|
1949
1949
|
}
|
|
1950
1950
|
static decodeData(e) {
|
|
1951
|
-
const t =
|
|
1951
|
+
const t = qt(e);
|
|
1952
1952
|
let i = 0, n = 0;
|
|
1953
1953
|
t.version === 1 ? (i = e.readUint64(), n = e.readUint64()) : (i = e.readUint32(), n = e.readUint32());
|
|
1954
1954
|
const o = e.readUint32();
|
|
@@ -2102,7 +2102,7 @@ const Cr = class Cr {
|
|
|
2102
2102
|
e.readUint16(), e.readUint32();
|
|
2103
2103
|
const n = e.readUint16();
|
|
2104
2104
|
e.readUint16(), t === 1 && (e.readUint64(), e.readUint64());
|
|
2105
|
-
const o =
|
|
2105
|
+
const o = Of(uh, e);
|
|
2106
2106
|
return new Cr(o, i, n);
|
|
2107
2107
|
}
|
|
2108
2108
|
};
|
|
@@ -2120,7 +2120,7 @@ const Fs = class Fs {
|
|
|
2120
2120
|
return new Date(n.getTime() + i);
|
|
2121
2121
|
}
|
|
2122
2122
|
static decodeData(e) {
|
|
2123
|
-
const { version: t } =
|
|
2123
|
+
const { version: t } = qt(e);
|
|
2124
2124
|
e.readUint32();
|
|
2125
2125
|
const i = e.readUint32(), n = e.readUint32();
|
|
2126
2126
|
if (t === 1) {
|
|
@@ -2172,7 +2172,7 @@ const jf = {
|
|
|
2172
2172
|
emsg: fo
|
|
2173
2173
|
};
|
|
2174
2174
|
function ct(s) {
|
|
2175
|
-
const e = Wd(s), t = jf[e.type], i = new
|
|
2175
|
+
const e = Wd(s), t = jf[e.type], i = new qn(s.readBytes(e.size));
|
|
2176
2176
|
if (!t) {
|
|
2177
2177
|
const o = new Gf(e, i);
|
|
2178
2178
|
return i.readRemaining(), o;
|
|
@@ -2183,7 +2183,7 @@ function ct(s) {
|
|
|
2183
2183
|
function Wf(s) {
|
|
2184
2184
|
if (s.byteLength < 8)
|
|
2185
2185
|
throw new Error("Buffer too small");
|
|
2186
|
-
const e = new
|
|
2186
|
+
const e = new qn(s), t = /* @__PURE__ */ new Map();
|
|
2187
2187
|
for (; e.remaining() > 0; ) {
|
|
2188
2188
|
const o = ct(e);
|
|
2189
2189
|
t.set(o.type, o);
|
|
@@ -2201,7 +2201,7 @@ function Wf(s) {
|
|
|
2201
2201
|
function zf(s) {
|
|
2202
2202
|
if (s.byteLength < 8)
|
|
2203
2203
|
throw new Error("Buffer too small");
|
|
2204
|
-
const e = new
|
|
2204
|
+
const e = new qn(s), t = /* @__PURE__ */ new Map(), i = [];
|
|
2205
2205
|
for (; e.remaining() > 0; ) {
|
|
2206
2206
|
const h = ct(e);
|
|
2207
2207
|
h instanceof fo && i.push(h), t.set(h.type, h);
|
|
@@ -2318,11 +2318,11 @@ const hu = class hu {
|
|
|
2318
2318
|
return ((e = a(this, H).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
|
|
2319
2319
|
}
|
|
2320
2320
|
sample(e) {
|
|
2321
|
-
var S, I,
|
|
2322
|
-
const t = (S = a(this, Re).init().moov.traks[0]) == null ? void 0 : S.mdia.minf.stbl.stsd.codec, i = ((I = a(this, H).moof.traf.trun) == null ? void 0 : I.samplesCount) || 0, n = (
|
|
2321
|
+
var S, I, k, D, T, P, R, X, Q, Fe, te, Je, ht, Be, y;
|
|
2322
|
+
const t = (S = a(this, Re).init().moov.traks[0]) == null ? void 0 : S.mdia.minf.stbl.stsd.codec, i = ((I = a(this, H).moof.traf.trun) == null ? void 0 : I.samplesCount) || 0, n = (k = a(this, H).moof.traf.tfdt) == null ? void 0 : k.baseMediaDecodeTime;
|
|
2323
2323
|
if (e >= i || typeof n == "undefined" || !t)
|
|
2324
2324
|
return;
|
|
2325
|
-
const o = this.compositionTimeOffset(e), c = ((D = a(this, H).moof.traf.trun) == null ? void 0 : D.sampleDurations[e]) || 0, h = ((T = a(this, H).moof.traf.trun) == null ? void 0 : T.sampleDurations.slice(0, e).reduce((E, F) => E + F, 0)) || 0, u = n + h, m = ((P = a(this, Re).init().moov.traks[0]) == null ? void 0 : P.mdia.mdhd.timescale) || 1e3, p = ((R = a(this, H).moof.traf.trun) == null ? void 0 : R.sampleSizes[e]) || a(this, H).mdat.data.byteLength, g = ((
|
|
2325
|
+
const o = this.compositionTimeOffset(e), c = ((D = a(this, H).moof.traf.trun) == null ? void 0 : D.sampleDurations[e]) || 0, h = ((T = a(this, H).moof.traf.trun) == null ? void 0 : T.sampleDurations.slice(0, e).reduce((E, F) => E + F, 0)) || 0, u = n + h, m = ((P = a(this, Re).init().moov.traks[0]) == null ? void 0 : P.mdia.mdhd.timescale) || 1e3, p = ((R = a(this, H).moof.traf.trun) == null ? void 0 : R.sampleSizes[e]) || a(this, H).mdat.data.byteLength, g = ((X = a(this, H).moof.traf.trun) == null ? void 0 : X.sampleSizes.slice(0, e).reduce((E, F) => E + F, 0)) || 0, w = a(this, H).mdat.data.subarray(g, g + p), b = ((Q = a(this, H).moof.traf.trun) == null ? void 0 : Q.is_sync_sample(e)) || !1;
|
|
2326
2326
|
if (this.mediaType() === "video") {
|
|
2327
2327
|
const E = ((Fe = a(this, Re).init().moov.traks[0]) == null ? void 0 : Fe.tkhd.width) || 0, F = ((te = a(this, Re).init().moov.traks[0]) == null ? void 0 : te.tkhd.height) || 0;
|
|
2328
2328
|
return {
|
|
@@ -2341,7 +2341,7 @@ const hu = class hu {
|
|
|
2341
2341
|
return {
|
|
2342
2342
|
type: "audio",
|
|
2343
2343
|
codec: t,
|
|
2344
|
-
channels: ((ht = (
|
|
2344
|
+
channels: ((ht = (Je = a(this, Re).init().moov.traks[0]) == null ? void 0 : Je.mdia.minf.stbl.stsd.opus) == null ? void 0 : ht.channelCount) || 0,
|
|
2345
2345
|
sampleRate: ((y = (Be = a(this, Re).init().moov.traks[0]) == null ? void 0 : Be.mdia.minf.stbl.stsd.opus) == null ? void 0 : y.sampleRate) || 0,
|
|
2346
2346
|
duration: c,
|
|
2347
2347
|
isSync: b,
|
|
@@ -2360,67 +2360,67 @@ const hu = class hu {
|
|
|
2360
2360
|
};
|
|
2361
2361
|
ve = new WeakMap(), Re = new WeakMap(), H = new WeakMap();
|
|
2362
2362
|
let lh = hu;
|
|
2363
|
-
var
|
|
2364
|
-
class
|
|
2363
|
+
var Js;
|
|
2364
|
+
class Ou {
|
|
2365
2365
|
constructor(e) {
|
|
2366
|
-
d(this,
|
|
2367
|
-
l(this,
|
|
2366
|
+
d(this, Js);
|
|
2367
|
+
l(this, Js, new Hf(e));
|
|
2368
2368
|
}
|
|
2369
2369
|
header() {
|
|
2370
|
-
return a(this,
|
|
2370
|
+
return a(this, Js);
|
|
2371
2371
|
}
|
|
2372
2372
|
createFragment(e) {
|
|
2373
|
-
return new lh(a(this,
|
|
2373
|
+
return new lh(a(this, Js), e);
|
|
2374
2374
|
}
|
|
2375
2375
|
}
|
|
2376
|
-
|
|
2377
|
-
function
|
|
2376
|
+
Js = new WeakMap();
|
|
2377
|
+
function B(s) {
|
|
2378
2378
|
const e = new ArrayBuffer(s.length), t = new Uint8Array(e);
|
|
2379
2379
|
for (let i = 0, n = s.length; i < n; i++)
|
|
2380
2380
|
t[i] = s.charCodeAt(i);
|
|
2381
2381
|
return new Uint8Array(e);
|
|
2382
2382
|
}
|
|
2383
2383
|
const j = {
|
|
2384
|
-
ftyp:
|
|
2385
|
-
mvhd:
|
|
2386
|
-
moov:
|
|
2387
|
-
trak:
|
|
2388
|
-
tkhd:
|
|
2389
|
-
mdia:
|
|
2390
|
-
mdhd:
|
|
2391
|
-
hdlr:
|
|
2392
|
-
minf:
|
|
2393
|
-
vmhd:
|
|
2394
|
-
smhd:
|
|
2395
|
-
dinf:
|
|
2396
|
-
dref:
|
|
2397
|
-
stbl:
|
|
2398
|
-
stsd:
|
|
2399
|
-
avc1:
|
|
2400
|
-
av01:
|
|
2401
|
-
av1C:
|
|
2402
|
-
avcC:
|
|
2403
|
-
esds:
|
|
2404
|
-
colr:
|
|
2405
|
-
nclx:
|
|
2406
|
-
mvex:
|
|
2407
|
-
trex:
|
|
2408
|
-
udta:
|
|
2409
|
-
meta:
|
|
2410
|
-
ilst:
|
|
2411
|
-
moof:
|
|
2412
|
-
mfhd:
|
|
2413
|
-
traf:
|
|
2414
|
-
tfhd:
|
|
2415
|
-
tfdt:
|
|
2416
|
-
trun:
|
|
2417
|
-
mdat:
|
|
2418
|
-
mp4a:
|
|
2419
|
-
Opus:
|
|
2420
|
-
prft:
|
|
2421
|
-
dOps:
|
|
2422
|
-
emsg:
|
|
2423
|
-
},
|
|
2384
|
+
ftyp: B("ftyp"),
|
|
2385
|
+
mvhd: B("mvhd"),
|
|
2386
|
+
moov: B("moov"),
|
|
2387
|
+
trak: B("trak"),
|
|
2388
|
+
tkhd: B("tkhd"),
|
|
2389
|
+
mdia: B("mdia"),
|
|
2390
|
+
mdhd: B("mdhd"),
|
|
2391
|
+
hdlr: B("hdlr"),
|
|
2392
|
+
minf: B("minf"),
|
|
2393
|
+
vmhd: B("vmhd"),
|
|
2394
|
+
smhd: B("smhd"),
|
|
2395
|
+
dinf: B("dinf"),
|
|
2396
|
+
dref: B("dref"),
|
|
2397
|
+
stbl: B("stbl"),
|
|
2398
|
+
stsd: B("stsd"),
|
|
2399
|
+
avc1: B("avc1"),
|
|
2400
|
+
av01: B("av01"),
|
|
2401
|
+
av1C: B("av1C"),
|
|
2402
|
+
avcC: B("avcC"),
|
|
2403
|
+
esds: B("esds"),
|
|
2404
|
+
colr: B("colr"),
|
|
2405
|
+
nclx: B("nclx"),
|
|
2406
|
+
mvex: B("mvex"),
|
|
2407
|
+
trex: B("trex"),
|
|
2408
|
+
udta: B("udta"),
|
|
2409
|
+
meta: B("meta"),
|
|
2410
|
+
ilst: B("ilst"),
|
|
2411
|
+
moof: B("moof"),
|
|
2412
|
+
mfhd: B("mfhd"),
|
|
2413
|
+
traf: B("traf"),
|
|
2414
|
+
tfhd: B("tfhd"),
|
|
2415
|
+
tfdt: B("tfdt"),
|
|
2416
|
+
trun: B("trun"),
|
|
2417
|
+
mdat: B("mdat"),
|
|
2418
|
+
mp4a: B("mp4a"),
|
|
2419
|
+
Opus: B("Opus"),
|
|
2420
|
+
prft: B("prft"),
|
|
2421
|
+
dOps: B("dOps"),
|
|
2422
|
+
emsg: B("emsg")
|
|
2423
|
+
}, Qf = 1e3, Pr = B("iso6"), Mu = new Uint8Array([0, 0, 2, 0]), Xf = [
|
|
2424
2424
|
Pr,
|
|
2425
2425
|
new Uint8Array([105, 115, 111, 109]),
|
|
2426
2426
|
// isom
|
|
@@ -2430,7 +2430,7 @@ const j = {
|
|
|
2430
2430
|
// avc1
|
|
2431
2431
|
new Uint8Array([109, 112, 52, 49])
|
|
2432
2432
|
// mp41
|
|
2433
|
-
],
|
|
2433
|
+
], qf = [
|
|
2434
2434
|
Pr,
|
|
2435
2435
|
new Uint8Array([105, 115, 111, 109]),
|
|
2436
2436
|
// isom
|
|
@@ -2440,7 +2440,7 @@ const j = {
|
|
|
2440
2440
|
// av01
|
|
2441
2441
|
new Uint8Array([109, 112, 52, 49])
|
|
2442
2442
|
// mp41
|
|
2443
|
-
],
|
|
2443
|
+
], Jf = [
|
|
2444
2444
|
Pr,
|
|
2445
2445
|
new Uint8Array([105, 115, 111, 109]),
|
|
2446
2446
|
// isom
|
|
@@ -2459,15 +2459,15 @@ const ne = (s, e, t) => {
|
|
|
2459
2459
|
s.writer.writeUint32(t + 8), s.writer.writeBytes(e);
|
|
2460
2460
|
}, ae = (s, e, t, i, n) => {
|
|
2461
2461
|
ne(s, e, t + 4), s.writer.writeUint8(i), s.writer.writeUint24(n);
|
|
2462
|
-
},
|
|
2462
|
+
}, Xc = (s, e) => {
|
|
2463
2463
|
ne(
|
|
2464
2464
|
s,
|
|
2465
2465
|
j.ftyp,
|
|
2466
|
-
Pr.byteLength +
|
|
2467
|
-
), s.writer.writeBytes(Pr), s.writer.writeBytes(
|
|
2468
|
-
},
|
|
2466
|
+
Pr.byteLength + Mu.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
|
|
2467
|
+
), s.writer.writeBytes(Pr), s.writer.writeBytes(Mu), e.forEach((t) => s.writer.writeBytes(t));
|
|
2468
|
+
}, Zf = 2 ** 32, $f = 2208988800, Yf = (s, e, t, i) => {
|
|
2469
2469
|
ae(s, j.prft, 20, 1, 0);
|
|
2470
|
-
const o = t / 1e3, c = Math.floor(o), u = (o - c) * 1e3 * 1e3 *
|
|
2470
|
+
const o = t / 1e3, c = Math.floor(o), u = (o - c) * 1e3 * 1e3 * Zf / 1e6;
|
|
2471
2471
|
s.writer.writeUint32(e), s.writer.writeUint32(c + $f), s.writer.writeUint32(u), s.writer.writeUint64(i);
|
|
2472
2472
|
}, Kf = (s, e, t) => {
|
|
2473
2473
|
ae(s, j.mvhd, 96, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(t), s.writer.writeUint32(e), s.writer.writeUint32(65536), s.writer.writeUint16(256), s.writer.writeBytes(new Uint8Array([
|
|
@@ -2591,10 +2591,10 @@ const ne = (s, e, t) => {
|
|
|
2591
2591
|
s.writer.writeUint16(i), s.writer.writeUint16(0);
|
|
2592
2592
|
}, ip = (s, e) => {
|
|
2593
2593
|
const t = s.writer.position();
|
|
2594
|
-
ae(s, j.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(
|
|
2594
|
+
ae(s, j.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(B(ys(e) ? "vide" : "soun")), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeBytes(B(ys(e) ? "VideoHandler\0" : "SoundHandler\0")), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2595
2595
|
}, sp = (s) => {
|
|
2596
2596
|
const e = s.writer.position();
|
|
2597
|
-
ne(s, j.dinf, 0), ae(s, j.dref, 16, 0, 0), s.writer.writeUint32(1), ae(s,
|
|
2597
|
+
ne(s, j.dinf, 0), ae(s, j.dref, 16, 0, 0), s.writer.writeUint32(1), ae(s, B("url "), 0, 0, 1), s.writer.writeUint32At(e, s.writer.position() - e);
|
|
2598
2598
|
}, np = (s, e) => {
|
|
2599
2599
|
const t = s.writer.position();
|
|
2600
2600
|
ne(s, j.avcC, 0), s.writer.writeUint8(1), s.writer.writeUint8(e.sequenceParameterSets[0][1]), s.writer.writeUint8(e.sequenceParameterSets[0][2]), s.writer.writeUint8(e.sequenceParameterSets[0][3]), s.writer.writeUint8(255), s.writer.writeUint8(224 | e.sequenceParameterSets.length), e.sequenceParameterSets.forEach((i) => {
|
|
@@ -2612,7 +2612,7 @@ const ne = (s, e, t) => {
|
|
|
2612
2612
|
), s.writer.writeUint8(0), s.writer.writeBytes(e.sequenceHeader), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2613
2613
|
}, ap = (s, e) => {
|
|
2614
2614
|
const t = s.writer.position(), i = mh(e) ? j.av01 : j.avc1;
|
|
2615
|
-
ne(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), Hd(e) ? np(s, e) : mh(e) && (rp(s, e), e.parsedSequenceHeader.colorConfig && (ne(s,
|
|
2615
|
+
ne(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), Hd(e) ? np(s, e) : mh(e) && (rp(s, e), e.parsedSequenceHeader.colorConfig && (ne(s, B("colr"), 11), s.writer.writeBytes(j.nclx), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), s.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (ne(s, B("pasp"), 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (ne(s, B("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2616
2616
|
}, Ka = (s, e, t) => {
|
|
2617
2617
|
let i = 3;
|
|
2618
2618
|
for (s.writer.writeUint8(e); i > 0; i--)
|
|
@@ -2633,12 +2633,12 @@ const ne = (s, e, t) => {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
}, hp = (s, e) => {
|
|
2635
2635
|
const t = s.writer.position();
|
|
2636
|
-
ne(s,
|
|
2636
|
+
ne(s, B("dOps"), 0), s.writer.writeUint8(0);
|
|
2637
2637
|
const i = e.decoderConfig, n = new DataView(i.buffer, i.byteOffset, i.byteLength);
|
|
2638
2638
|
s.writer.writeUint8(n.getUint8(9)), s.writer.writeUint16(n.getUint16(10, !0)), s.writer.writeUint32(n.getUint32(12, !0)), s.writer.writeUint16(n.getUint16(16, !0)), s.writer.writeBytes(e.decoderConfig.slice(18)), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2639
2639
|
}, up = (s, e) => {
|
|
2640
2640
|
const t = s.writer.position();
|
|
2641
|
-
switch (ne(s,
|
|
2641
|
+
switch (ne(s, B(cp(e.codec)), 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint16(e.channelCount), s.writer.writeUint16(16), s.writer.writeUint32(0), s.writer.writeUint16(e.sampleRate), s.writer.writeUint16(0), e.codec) {
|
|
2642
2642
|
case "aac":
|
|
2643
2643
|
case "mp3":
|
|
2644
2644
|
op(s, e);
|
|
@@ -2647,12 +2647,12 @@ const ne = (s, e, t) => {
|
|
|
2647
2647
|
hp(s, e);
|
|
2648
2648
|
break;
|
|
2649
2649
|
}
|
|
2650
|
-
e.bitrate && (ne(s,
|
|
2650
|
+
e.bitrate && (ne(s, B("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2651
2651
|
}, dp = (s, e) => {
|
|
2652
2652
|
const t = s.writer.position();
|
|
2653
2653
|
ne(s, j.stbl, 0);
|
|
2654
2654
|
const i = s.writer.position();
|
|
2655
|
-
ae(s, j.stsd, 0, 0, 0), s.writer.writeUint32(1), ys(e) ? ap(s, e) : or(e) && up(s, e), s.writer.writeUint32At(i, s.writer.position() - i), ae(s,
|
|
2655
|
+
ae(s, j.stsd, 0, 0, 0), s.writer.writeUint32(1), ys(e) ? ap(s, e) : or(e) && up(s, e), s.writer.writeUint32At(i, s.writer.position() - i), ae(s, B("stts"), 4, 0, 0), s.writer.writeUint32(0), ae(s, B("stsc"), 4, 0, 0), s.writer.writeUint32(0), ae(s, B("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), ae(s, B("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2656
2656
|
}, lp = (s, e) => {
|
|
2657
2657
|
const t = s.writer.position();
|
|
2658
2658
|
ne(s, j.minf, 0), ys(e) ? (ae(s, j.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : or(e) && (ae(s, j.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), sp(s), dp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
@@ -2681,17 +2681,17 @@ const ne = (s, e, t) => {
|
|
|
2681
2681
|
}, yp = (s, e) => {
|
|
2682
2682
|
if (!e.samples[0])
|
|
2683
2683
|
throw new Error("At least one sample must be provided");
|
|
2684
|
-
const t = e.samples.some((u) => !!u.compositionTimeOffset), i =
|
|
2684
|
+
const t = e.samples.some((u) => !!u.compositionTimeOffset), i = qc(e.samples[0]) !== e.defaultFlags, n = e.samples.length > 1;
|
|
2685
2685
|
let o = 1;
|
|
2686
2686
|
i && (o |= 4), t && (o |= 2048), n && (o |= 512, o |= 256, o |= 1024);
|
|
2687
2687
|
const c = s.writer.position();
|
|
2688
2688
|
ae(s, j.trun, 16, 1, o), s.writer.writeUint32(e.samples.length);
|
|
2689
2689
|
const h = s.writer.position();
|
|
2690
|
-
s.writer.writeUint32(0), i && s.writer.writeUint32(
|
|
2690
|
+
s.writer.writeUint32(0), i && s.writer.writeUint32(qc(e.samples[0]));
|
|
2691
2691
|
for (const u of e.samples)
|
|
2692
|
-
n && (s.writer.writeUint32(u.duration), s.writer.writeUint32(u.data.byteLength), s.writer.writeUint32(
|
|
2692
|
+
n && (s.writer.writeUint32(u.duration), s.writer.writeUint32(u.data.byteLength), s.writer.writeUint32(qc(u))), t && s.writer.writeUint32(u.compositionTimeOffset || 0);
|
|
2693
2693
|
s.writer.writeUint32At(h, s.writer.position() - s.moofOffset + 8), s.writer.writeUint32At(c, s.writer.position() - c);
|
|
2694
|
-
},
|
|
2694
|
+
}, qc = (s) => s.isSync ? 33554432 : 16842752, vp = (s, e) => {
|
|
2695
2695
|
const t = s.writer.position();
|
|
2696
2696
|
ne(s, j.traf, 0), wp(s, e), bp(s, e), yp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
|
|
2697
2697
|
}, Sp = (s, e) => {
|
|
@@ -2704,13 +2704,13 @@ const ne = (s, e, t) => {
|
|
|
2704
2704
|
ne(s, j.mdat, t), e.samples.forEach((i) => s.writer.writeBytes(i.data));
|
|
2705
2705
|
}, Nc = (s, e) => {
|
|
2706
2706
|
const t = new zd(), i = s.filter((o) => ys(o) && Hd(o)).length > 0;
|
|
2707
|
-
return s.filter((o) => ys(o) && mh(o)).length > 0 ?
|
|
2707
|
+
return s.filter((o) => ys(o) && mh(o)).length > 0 ? Xc(t, qf) : i ? Xc(t, Xf) : Xc(t, Jf), Ap(t, s, Qf), t.writer.buffer();
|
|
2708
2708
|
}, Vc = (s) => {
|
|
2709
2709
|
var t;
|
|
2710
2710
|
const e = new zd();
|
|
2711
2711
|
return ((t = s.samples[0]) == null ? void 0 : t.producerReferenceTime) !== void 0 && Yf(e, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), e.moofOffset = e.writer.position(), Ep(e, s), Tp(e, s), e.writer.buffer();
|
|
2712
2712
|
}, Ip = (s, e) => {
|
|
2713
|
-
const t = s.map((c) =>
|
|
2713
|
+
const t = s.map((c) => M(v({}, c), {
|
|
2714
2714
|
data: new Uint8Array(c.data)
|
|
2715
2715
|
}));
|
|
2716
2716
|
if (!t[0])
|
|
@@ -2736,13 +2736,13 @@ const ne = (s, e, t) => {
|
|
|
2736
2736
|
duration: 0,
|
|
2737
2737
|
trackId: 1
|
|
2738
2738
|
}
|
|
2739
|
-
]),
|
|
2739
|
+
]), Qd = (s) => {
|
|
2740
2740
|
const { sequenceParameterSets: e, pictureParameterSets: t } = jd(s), i = e[0], n = t[0];
|
|
2741
2741
|
if (!i || !n)
|
|
2742
2742
|
throw new Error("No sps or pps provided");
|
|
2743
2743
|
return kf(i);
|
|
2744
2744
|
}, kp = (s, e) => {
|
|
2745
|
-
const t = s.map((h) =>
|
|
2745
|
+
const t = s.map((h) => M(v({}, h), {
|
|
2746
2746
|
data: new Uint8Array(h.data)
|
|
2747
2747
|
}));
|
|
2748
2748
|
if (!t[0])
|
|
@@ -2758,7 +2758,7 @@ const ne = (s, e, t) => {
|
|
|
2758
2758
|
samples: t
|
|
2759
2759
|
});
|
|
2760
2760
|
}, Bp = (s, e) => {
|
|
2761
|
-
const { sequenceParameterSets: t, pictureParameterSets: i } = jd(s), n =
|
|
2761
|
+
const { sequenceParameterSets: t, pictureParameterSets: i } = jd(s), n = Qd(s);
|
|
2762
2762
|
return Nc([
|
|
2763
2763
|
{
|
|
2764
2764
|
type: "video",
|
|
@@ -2783,7 +2783,7 @@ const ne = (s, e, t) => {
|
|
|
2783
2783
|
sampleRate: 48e3
|
|
2784
2784
|
}
|
|
2785
2785
|
]), Up = (s, e) => {
|
|
2786
|
-
const t = s.map((c) =>
|
|
2786
|
+
const t = s.map((c) => M(v({}, c), {
|
|
2787
2787
|
data: new Uint8Array(c.data)
|
|
2788
2788
|
}));
|
|
2789
2789
|
if (!t[0])
|
|
@@ -2798,7 +2798,7 @@ const ne = (s, e, t) => {
|
|
|
2798
2798
|
defaultDuration: o,
|
|
2799
2799
|
samples: t
|
|
2800
2800
|
});
|
|
2801
|
-
},
|
|
2801
|
+
}, Xd = (s) => {
|
|
2802
2802
|
const e = new Ed(s);
|
|
2803
2803
|
return e.peekBit() === 1 && e.readBits(32), Lp(e), Gp(e);
|
|
2804
2804
|
}, Pp = (s) => {
|
|
@@ -2835,7 +2835,7 @@ const ne = (s, e, t) => {
|
|
|
2835
2835
|
numUnitsInDisplayTick: e,
|
|
2836
2836
|
numTicksPerPicture: n
|
|
2837
2837
|
};
|
|
2838
|
-
}, Fu = 2,
|
|
2838
|
+
}, Fu = 2, Jc = 2, Op = 1, Mp = 2, Fp = 2, _p = 13, Np = 0, Vp = 2, _u = 0, Gp = (s) => {
|
|
2839
2839
|
const e = s.readBits(3), i = s.readBit() !== 0, n = s.readBit() !== 0;
|
|
2840
2840
|
let o, c = !1, h = !1, u = !1, m = 0, p = 0;
|
|
2841
2841
|
const g = [];
|
|
@@ -2845,21 +2845,21 @@ const ne = (s, e, t) => {
|
|
|
2845
2845
|
if (h = s.readBit() !== 0, h && (o = Dp(s), c = s.readBit() !== 0, c))
|
|
2846
2846
|
throw new Error("Not implemented");
|
|
2847
2847
|
u = s.readBit() !== 0;
|
|
2848
|
-
const
|
|
2849
|
-
for (let xe = 0; xe <
|
|
2850
|
-
const
|
|
2848
|
+
const J = s.readBits(5) + 1;
|
|
2849
|
+
for (let xe = 0; xe < J; xe++) {
|
|
2850
|
+
const Z = s.readBits(12), ce = s.readBits(5);
|
|
2851
2851
|
let _e = 0;
|
|
2852
2852
|
if (ce > 7 && (_e = s.readBit()), c)
|
|
2853
2853
|
throw new Error("decoderModelInfoPresentFlag==1");
|
|
2854
|
-
u && s.readBit() !== 0 && s.readBits(4), g.push({ tier: _e, operatingPointIdc:
|
|
2854
|
+
u && s.readBit() !== 0 && s.readBits(4), g.push({ tier: _e, operatingPointIdc: Z, seqLevelIdx: ce });
|
|
2855
2855
|
}
|
|
2856
2856
|
}
|
|
2857
2857
|
const w = s.readBits(4) + 1, b = s.readBits(4) + 1, S = s.readBits(w) + 1, I = s.readBits(b) + 1;
|
|
2858
|
-
let
|
|
2859
|
-
n ?
|
|
2858
|
+
let k = !1;
|
|
2859
|
+
n ? k = !1 : k = s.readBit() !== 0, k && (m = s.readBits(4) + 2, p = s.readBits(3) + 1);
|
|
2860
2860
|
const D = s.readBit() !== 0, T = s.readBit() !== 0, P = s.readBit() !== 0;
|
|
2861
|
-
let R = !1,
|
|
2862
|
-
n || (R = s.readBit() !== 0,
|
|
2861
|
+
let R = !1, X = !1, Q = !1, Fe = !1, te = !1, Je = !1, ht = !1, Be = Fu, y = Jc, E = 0;
|
|
2862
|
+
n || (R = s.readBit() !== 0, X = s.readBit() !== 0, Q = s.readBit() !== 0, Fe = s.readBit() !== 0, te = s.readBit() !== 0, te && (Je = s.readBit() !== 0, ht = s.readBit() !== 0), s.readBit() !== 0 ? Be = Fu : Be = s.readBit(), Be > 0 ? s.readBit() > 0 ? y = Jc : y = s.readBit() : y = Jc, te ? E = s.readBits(3) : E = 0);
|
|
2863
2863
|
const F = s.readBit() !== 0, G = s.readBit() !== 0, L = s.readBit() !== 0;
|
|
2864
2864
|
return {
|
|
2865
2865
|
seqProfile: e,
|
|
@@ -2879,18 +2879,18 @@ const ne = (s, e, t) => {
|
|
|
2879
2879
|
frameHeightBits: b,
|
|
2880
2880
|
maxFrameWidth: S,
|
|
2881
2881
|
maxFrameHeight: I,
|
|
2882
|
-
frameIdNumbersPresentFlag:
|
|
2882
|
+
frameIdNumbersPresentFlag: k,
|
|
2883
2883
|
deltaFrameIdLength: m,
|
|
2884
2884
|
additionalFrameIdLength: p,
|
|
2885
2885
|
use_128x128Superblock: D,
|
|
2886
2886
|
enableFilterIntra: T,
|
|
2887
2887
|
enableIntraEdgeFilter: P,
|
|
2888
2888
|
enableInterintraCompound: R,
|
|
2889
|
-
enableMaskedCompound:
|
|
2890
|
-
enableWarpedMotion:
|
|
2889
|
+
enableMaskedCompound: X,
|
|
2890
|
+
enableWarpedMotion: Q,
|
|
2891
2891
|
enableDualFilter: Fe,
|
|
2892
2892
|
enableOrderHint: te,
|
|
2893
|
-
enableJntComp:
|
|
2893
|
+
enableJntComp: Je,
|
|
2894
2894
|
enableRefFrameMvs: ht,
|
|
2895
2895
|
seqForceScreenContentTools: Be,
|
|
2896
2896
|
seqForceIntegerMv: y,
|
|
@@ -2906,7 +2906,7 @@ const ne = (s, e, t) => {
|
|
|
2906
2906
|
let i = 8, n = !1;
|
|
2907
2907
|
e === 2 && t ? i = s.readBit() !== 0 ? 12 : 10 : e <= 2 && (i = t ? 10 : 8), e === 1 ? n = !1 : n = s.readBit() !== 0;
|
|
2908
2908
|
const o = n ? 1 : 3, c = s.readBit() !== 0;
|
|
2909
|
-
let h =
|
|
2909
|
+
let h = Mp, u = Fp, m = Vp, p = !1, g = 0, w = 0, b = _u, S = !1;
|
|
2910
2910
|
return c && (h = s.readBits(8), u = s.readBits(8), m = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, w = 1, b = _u, S = !1, {
|
|
2911
2911
|
highBitDepth: t,
|
|
2912
2912
|
bitDepth: i,
|
|
@@ -2920,7 +2920,7 @@ const ne = (s, e, t) => {
|
|
|
2920
2920
|
subsamplingX: g,
|
|
2921
2921
|
subsamplingY: w,
|
|
2922
2922
|
transferCharacteristics: u
|
|
2923
|
-
}) : h ===
|
|
2923
|
+
}) : h === Op && u == _p && m == Np ? (p = !0, g = 0, w = 0, {
|
|
2924
2924
|
highBitDepth: t,
|
|
2925
2925
|
bitDepth: i,
|
|
2926
2926
|
monoChrome: n,
|
|
@@ -2948,14 +2948,14 @@ const ne = (s, e, t) => {
|
|
|
2948
2948
|
transferCharacteristics: u
|
|
2949
2949
|
});
|
|
2950
2950
|
}, Wp = (s) => {
|
|
2951
|
-
const e =
|
|
2951
|
+
const e = Xd(s);
|
|
2952
2952
|
if (e)
|
|
2953
2953
|
return {
|
|
2954
2954
|
width: e.maxFrameWidth,
|
|
2955
2955
|
height: e.maxFrameHeight
|
|
2956
2956
|
};
|
|
2957
2957
|
}, zp = (s, e) => {
|
|
2958
|
-
const t = s.map((h) =>
|
|
2958
|
+
const t = s.map((h) => M(v({}, h), {
|
|
2959
2959
|
data: new Uint8Array(h.data)
|
|
2960
2960
|
}));
|
|
2961
2961
|
if (!t[0])
|
|
@@ -2971,7 +2971,7 @@ const ne = (s, e, t) => {
|
|
|
2971
2971
|
samples: t
|
|
2972
2972
|
});
|
|
2973
2973
|
}, Hp = (s, e) => {
|
|
2974
|
-
const t =
|
|
2974
|
+
const t = Xd(s);
|
|
2975
2975
|
if (!t)
|
|
2976
2976
|
throw new Error("Failed to parse sequence header");
|
|
2977
2977
|
return Nc([
|
|
@@ -2986,28 +2986,28 @@ const ne = (s, e, t) => {
|
|
|
2986
2986
|
trackId: 1
|
|
2987
2987
|
}
|
|
2988
2988
|
]);
|
|
2989
|
-
},
|
|
2989
|
+
}, Qp = (s) => {
|
|
2990
2990
|
const { codec: e, initData: t, timescale: i } = s;
|
|
2991
2991
|
switch (e) {
|
|
2992
2992
|
case "h264":
|
|
2993
|
-
return
|
|
2993
|
+
return qp(t, i);
|
|
2994
2994
|
case "av1":
|
|
2995
|
-
return
|
|
2995
|
+
return Jp(t, i);
|
|
2996
2996
|
case "opus":
|
|
2997
|
-
return
|
|
2997
|
+
return Zp(t, i, s.channelCount || 2);
|
|
2998
2998
|
case "aac":
|
|
2999
2999
|
return $p(t, i, s.channelCount || 2);
|
|
3000
3000
|
default:
|
|
3001
3001
|
throw new Error(`Failed to initialize ${e} segment`);
|
|
3002
3002
|
}
|
|
3003
|
-
},
|
|
3003
|
+
}, Xp = (s, e) => {
|
|
3004
3004
|
switch (s) {
|
|
3005
3005
|
case "h264":
|
|
3006
|
-
return
|
|
3006
|
+
return Qd(e);
|
|
3007
3007
|
case "av1":
|
|
3008
3008
|
return Wp(e);
|
|
3009
3009
|
}
|
|
3010
|
-
},
|
|
3010
|
+
}, qp = (s, e) => Bp(s, e), Jp = (s, e) => Hp(s, e), Zp = (s, e, t) => Rp(new Uint8Array(s), t, e), $p = (s, e, t) => Cp(new Uint8Array(s), t, e, e), Yp = (s, e) => {
|
|
3011
3011
|
if (!s[0])
|
|
3012
3012
|
throw new Error("At least one sample must be provided");
|
|
3013
3013
|
switch (s[0].codec) {
|
|
@@ -3092,11 +3092,11 @@ class Nu {
|
|
|
3092
3092
|
skipEmptyLines() {
|
|
3093
3093
|
let e = 0;
|
|
3094
3094
|
for (; a(this, ni)[a(this, Dt)] === ""; )
|
|
3095
|
-
|
|
3095
|
+
Ze(this, Dt)._++, e++;
|
|
3096
3096
|
return e;
|
|
3097
3097
|
}
|
|
3098
3098
|
readLine() {
|
|
3099
|
-
return a(this, ni)[
|
|
3099
|
+
return a(this, ni)[Ze(this, Dt)._++];
|
|
3100
3100
|
}
|
|
3101
3101
|
takeUntilEmptyLine() {
|
|
3102
3102
|
const e = [];
|
|
@@ -3113,8 +3113,8 @@ class Nu {
|
|
|
3113
3113
|
}
|
|
3114
3114
|
}
|
|
3115
3115
|
ni = new WeakMap(), Dt = new WeakMap();
|
|
3116
|
-
var vs,
|
|
3117
|
-
class
|
|
3116
|
+
var vs, Jd, fh;
|
|
3117
|
+
class qd {
|
|
3118
3118
|
constructor() {
|
|
3119
3119
|
d(this, vs);
|
|
3120
3120
|
}
|
|
@@ -3125,13 +3125,13 @@ class Jd {
|
|
|
3125
3125
|
for (; n.readLine() !== ""; )
|
|
3126
3126
|
;
|
|
3127
3127
|
for (; n.linesLeft() > 0; ) {
|
|
3128
|
-
const c = A(this, vs,
|
|
3128
|
+
const c = A(this, vs, Jd).call(this, n);
|
|
3129
3129
|
c && t.push(c), n.skipEmptyLines();
|
|
3130
3130
|
}
|
|
3131
3131
|
return t;
|
|
3132
3132
|
}
|
|
3133
3133
|
}
|
|
3134
|
-
vs = new WeakSet(),
|
|
3134
|
+
vs = new WeakSet(), Jd = function(e) {
|
|
3135
3135
|
e.skipEmptyLines();
|
|
3136
3136
|
const t = e.takeUntilEmptyLine(), i = new Nu(t);
|
|
3137
3137
|
let n = i.readLine(), o;
|
|
@@ -3227,7 +3227,7 @@ class ph extends Ei {
|
|
|
3227
3227
|
});
|
|
3228
3228
|
/// This method is used to try to play the media element without throwing an error if it fails.
|
|
3229
3229
|
r(this, "tryPlay", () => {
|
|
3230
|
-
this.element.muted = this._userProvidedMuted, this._play().catch(
|
|
3230
|
+
this.element.muted = this._userProvidedMuted, this._play().catch(O);
|
|
3231
3231
|
});
|
|
3232
3232
|
/// This method is used to play the media element and will throw an error if it fails.
|
|
3233
3233
|
r(this, "play", () => {
|
|
@@ -3288,7 +3288,7 @@ class ph extends Ei {
|
|
|
3288
3288
|
}, 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);
|
|
3289
3289
|
}
|
|
3290
3290
|
get seekTime() {
|
|
3291
|
-
return this.seekTimes.isEmpty() ? 0 :
|
|
3291
|
+
return this.seekTimes.isEmpty() ? 0 : Qt(this.seekTimes.items());
|
|
3292
3292
|
}
|
|
3293
3293
|
get isSeeking() {
|
|
3294
3294
|
return this.element.seeking;
|
|
@@ -3333,7 +3333,7 @@ const cg = (s) => {
|
|
|
3333
3333
|
return bs(s) ? e = {
|
|
3334
3334
|
type: "media-source",
|
|
3335
3335
|
audio: {
|
|
3336
|
-
contentType:
|
|
3336
|
+
contentType: Oi(s),
|
|
3337
3337
|
bitrate: s.bitRate,
|
|
3338
3338
|
channels: s.channels.toString(),
|
|
3339
3339
|
samplerate: s.sampleRate
|
|
@@ -3341,14 +3341,14 @@ const cg = (s) => {
|
|
|
3341
3341
|
} : e = {
|
|
3342
3342
|
type: "media-source",
|
|
3343
3343
|
video: {
|
|
3344
|
-
contentType:
|
|
3344
|
+
contentType: Oi(s),
|
|
3345
3345
|
bitrate: s.bitRate,
|
|
3346
3346
|
width: s.width,
|
|
3347
3347
|
height: s.height,
|
|
3348
3348
|
framerate: s.frameRate[0] / s.frameRate[1]
|
|
3349
3349
|
}
|
|
3350
3350
|
}, navigator.mediaCapabilities.decodingInfo(e);
|
|
3351
|
-
}, hg = 0.15, ug = 0.2, Vu = 0.4, dg = 0.5, lg = 0.6,
|
|
3351
|
+
}, hg = 0.15, ug = 0.2, Vu = 0.4, dg = 0.5, lg = 0.6, Zc = 15, mg = {
|
|
3352
3352
|
cooldownTime: 3e3,
|
|
3353
3353
|
maxBufferingEvents: {
|
|
3354
3354
|
last10Seconds: 0
|
|
@@ -3363,7 +3363,7 @@ const cg = (s) => {
|
|
|
3363
3363
|
ratio: 0.1
|
|
3364
3364
|
},
|
|
3365
3365
|
maxCooldownRatio: 2
|
|
3366
|
-
}, $c = (s) => (e) => e > s,
|
|
3366
|
+
}, $c = (s) => (e) => e > s, qo = class qo {
|
|
3367
3367
|
constructor(e, t, i, n) {
|
|
3368
3368
|
r(this, "qualityOfServiceSource");
|
|
3369
3369
|
r(this, "config");
|
|
@@ -3420,7 +3420,7 @@ const cg = (s) => {
|
|
|
3420
3420
|
const { bufferFullness: t, general: i } = this.qualityOfServiceSource.getMetrics(), n = this.qualityOfServiceSource.getBufferFullnessRegression();
|
|
3421
3421
|
if (!n)
|
|
3422
3422
|
return;
|
|
3423
|
-
const o = 10 * 1e3, c = 30 * 1e3, { slope: h } = n, u = n.predict(
|
|
3423
|
+
const o = 10 * 1e3, c = 30 * 1e3, { slope: h } = n, u = n.predict(Zc), m = h < 0, p = n.predict(Zc) < Vu && n.slope < 0, g = n.predict(Zc) > lg, w = this.qualityOfServiceSource.timeSpentBufferingLast(c), b = this.qualityOfServiceSource.timeSpentActiveLast(c), S = this.qualityOfServiceSource.bufferingEventsLast(c), I = b > 0 ? w / b : 0, k = this.qualityOfServiceSource.getTargetBufferTime();
|
|
3424
3424
|
if (t < 0.15 && I > 0.8) {
|
|
3425
3425
|
this.adaptLevel("reconnect");
|
|
3426
3426
|
return;
|
|
@@ -3433,7 +3433,7 @@ const cg = (s) => {
|
|
|
3433
3433
|
this.adaptLevel("upgrade");
|
|
3434
3434
|
return;
|
|
3435
3435
|
}
|
|
3436
|
-
if (
|
|
3436
|
+
if (k < 1e3) {
|
|
3437
3437
|
e.playbackState === "buffering" && (S > 5 || I > 0.3) && this.adaptLevel("downgrade");
|
|
3438
3438
|
return;
|
|
3439
3439
|
}
|
|
@@ -3452,8 +3452,8 @@ const cg = (s) => {
|
|
|
3452
3452
|
return this.qualityOfServiceSource.timeSpentBufferingLast(e) > this.config.maxBufferingEvents.last10Seconds;
|
|
3453
3453
|
}
|
|
3454
3454
|
};
|
|
3455
|
-
r(
|
|
3456
|
-
let gh =
|
|
3455
|
+
r(qo, "create", (e, t, i, n = {}) => new qo(e, t, i, n));
|
|
3456
|
+
let gh = qo;
|
|
3457
3457
|
const fg = {
|
|
3458
3458
|
minBufferTime: 1500,
|
|
3459
3459
|
maxBufferTime: 1500,
|
|
@@ -3523,7 +3523,7 @@ const Te = {
|
|
|
3523
3523
|
EndOfGroup: 3,
|
|
3524
3524
|
EndOfTrackAndGroup: 4
|
|
3525
3525
|
};
|
|
3526
|
-
function
|
|
3526
|
+
function Zd(s) {
|
|
3527
3527
|
switch (s) {
|
|
3528
3528
|
case Te.Normal:
|
|
3529
3529
|
case Te.ObjectDoesNotExist:
|
|
@@ -3534,24 +3534,24 @@ function qd(s) {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
throw new Error("Unknown object status " + s);
|
|
3536
3536
|
}
|
|
3537
|
-
var pt,
|
|
3537
|
+
var pt, Zs, $s, zr, Hr, Ys, Qr, Xr;
|
|
3538
3538
|
class pg {
|
|
3539
3539
|
constructor(e, t, i, n, o, c) {
|
|
3540
3540
|
d(this, pt);
|
|
3541
|
-
d(this,
|
|
3541
|
+
d(this, Zs);
|
|
3542
3542
|
d(this, $s);
|
|
3543
3543
|
d(this, zr);
|
|
3544
3544
|
d(this, Hr);
|
|
3545
3545
|
d(this, Ys, new z());
|
|
3546
|
-
d(this,
|
|
3547
|
-
d(this,
|
|
3548
|
-
l(this, pt, e), l(this,
|
|
3546
|
+
d(this, Qr, 0);
|
|
3547
|
+
d(this, Xr);
|
|
3548
|
+
l(this, pt, e), l(this, Zs, t), l(this, $s, i), l(this, zr, n), l(this, Hr, o), l(this, Xr, c);
|
|
3549
3549
|
}
|
|
3550
3550
|
endStatus() {
|
|
3551
3551
|
return a(this, Ys).promise;
|
|
3552
3552
|
}
|
|
3553
3553
|
groupId() {
|
|
3554
|
-
return a(this,
|
|
3554
|
+
return a(this, Zs);
|
|
3555
3555
|
}
|
|
3556
3556
|
subscribeId() {
|
|
3557
3557
|
return a(this, $s);
|
|
@@ -3562,9 +3562,9 @@ class pg {
|
|
|
3562
3562
|
return { done: !0, value: void 0 };
|
|
3563
3563
|
if (yield a(this, pt).isDone())
|
|
3564
3564
|
return { done: !0, value: void 0 };
|
|
3565
|
-
const e = a(this,
|
|
3565
|
+
const e = a(this, Qr) === 0 ? a(this, Zs) : yield a(this, pt).readBigVarInt(), t = yield a(this, pt).readBigVarInt(), i = yield a(this, pt).readVarInt();
|
|
3566
3566
|
let n = 0, o = new Uint8Array();
|
|
3567
|
-
return i > 0 ? o = yield a(this, pt).read(i) : n = yield a(this, pt).readVarInt(),
|
|
3567
|
+
return i > 0 ? o = yield a(this, pt).read(i) : n = yield a(this, pt).readVarInt(), Zd(n), (n === Te.EndOfTrackAndGroup || n === Te.EndOfGroup) && a(this, Ys).resolve(n), Ze(this, Qr)._++, {
|
|
3568
3568
|
done: !1,
|
|
3569
3569
|
value: {
|
|
3570
3570
|
subscribeId: a(this, $s),
|
|
@@ -3573,7 +3573,7 @@ class pg {
|
|
|
3573
3573
|
subGroupId: U(0),
|
|
3574
3574
|
objectId: t,
|
|
3575
3575
|
subscriberPriority: a(this, Hr),
|
|
3576
|
-
streamId: a(this,
|
|
3576
|
+
streamId: a(this, Xr),
|
|
3577
3577
|
objectStatus: n,
|
|
3578
3578
|
payload: o
|
|
3579
3579
|
}
|
|
@@ -3597,17 +3597,17 @@ class pg {
|
|
|
3597
3597
|
return Promise.resolve();
|
|
3598
3598
|
}
|
|
3599
3599
|
}
|
|
3600
|
-
pt = new WeakMap(),
|
|
3601
|
-
var gt, Ks,
|
|
3600
|
+
pt = new WeakMap(), Zs = new WeakMap(), $s = new WeakMap(), zr = new WeakMap(), Hr = new WeakMap(), Ys = new WeakMap(), Qr = new WeakMap(), Xr = new WeakMap();
|
|
3601
|
+
var gt, Ks, qr, Jr, en, Ss, $d, wh;
|
|
3602
3602
|
class gg {
|
|
3603
3603
|
constructor(e, t, i, n, o) {
|
|
3604
3604
|
d(this, Ss);
|
|
3605
3605
|
d(this, gt);
|
|
3606
3606
|
d(this, Ks);
|
|
3607
|
+
d(this, qr);
|
|
3607
3608
|
d(this, Jr);
|
|
3608
|
-
d(this, Zr);
|
|
3609
3609
|
d(this, en);
|
|
3610
|
-
l(this, gt, e), l(this, Ks, t), l(this,
|
|
3610
|
+
l(this, gt, e), l(this, Ks, t), l(this, qr, i), l(this, Jr, n), l(this, en, o);
|
|
3611
3611
|
}
|
|
3612
3612
|
/**
|
|
3613
3613
|
* @returns The underlying stream id that provided this object group
|
|
@@ -3636,18 +3636,18 @@ class gg {
|
|
|
3636
3636
|
return A(this, Ss, wh).call(this);
|
|
3637
3637
|
}
|
|
3638
3638
|
}
|
|
3639
|
-
gt = new WeakMap(), Ks = new WeakMap(),
|
|
3639
|
+
gt = new WeakMap(), Ks = new WeakMap(), qr = new WeakMap(), Jr = new WeakMap(), en = new WeakMap(), Ss = new WeakSet(), $d = function() {
|
|
3640
3640
|
return Rt(this, null, function* () {
|
|
3641
|
-
for (; !(yield new
|
|
3642
|
-
const e = yield new
|
|
3641
|
+
for (; !(yield new q(a(this, gt).isDone())); ) {
|
|
3642
|
+
const e = yield new q(a(this, gt).readBigVarInt()), t = new pg(
|
|
3643
3643
|
a(this, gt),
|
|
3644
3644
|
e,
|
|
3645
3645
|
a(this, Ks),
|
|
3646
|
+
a(this, qr),
|
|
3646
3647
|
a(this, Jr),
|
|
3647
|
-
a(this, Zr),
|
|
3648
3648
|
a(this, en)
|
|
3649
3649
|
);
|
|
3650
|
-
if (yield t, (yield new
|
|
3650
|
+
if (yield t, (yield new q(Promise.race([t.endStatus(), a(this, gt).closed()]))) === Te.EndOfTrackAndGroup)
|
|
3651
3651
|
return;
|
|
3652
3652
|
}
|
|
3653
3653
|
});
|
|
@@ -3655,20 +3655,20 @@ gt = new WeakMap(), Ks = new WeakMap(), Jr = new WeakMap(), Zr = new WeakMap(),
|
|
|
3655
3655
|
return a(this, gt).close().catch(() => {
|
|
3656
3656
|
});
|
|
3657
3657
|
};
|
|
3658
|
-
var it, tn,
|
|
3658
|
+
var it, tn, Zr, sn, $r, Yr, Kr, nn, Jo, Es, Yd, bh;
|
|
3659
3659
|
class Ag {
|
|
3660
3660
|
constructor(e, t, i, n, o, c, h) {
|
|
3661
3661
|
d(this, Es);
|
|
3662
3662
|
d(this, it);
|
|
3663
3663
|
d(this, tn);
|
|
3664
|
-
d(this,
|
|
3664
|
+
d(this, Zr);
|
|
3665
3665
|
d(this, sn);
|
|
3666
3666
|
d(this, $r);
|
|
3667
3667
|
d(this, Yr);
|
|
3668
3668
|
d(this, Kr, !1);
|
|
3669
3669
|
d(this, nn);
|
|
3670
|
-
d(this,
|
|
3671
|
-
l(this, it, e), l(this, tn, t), l(this,
|
|
3670
|
+
d(this, Jo, ge.get().createContext("GroupReader"));
|
|
3671
|
+
l(this, it, e), l(this, tn, t), l(this, Zr, i), l(this, sn, n), l(this, $r, o), l(this, Yr, c), l(this, nn, h);
|
|
3672
3672
|
}
|
|
3673
3673
|
/**
|
|
3674
3674
|
* @returns The underlying stream id that provided this object group
|
|
@@ -3689,11 +3689,11 @@ class Ag {
|
|
|
3689
3689
|
return { done: !0, value: void 0 };
|
|
3690
3690
|
const e = yield a(this, it).readBigVarInt(), t = yield a(this, it).readVarInt();
|
|
3691
3691
|
let i = 0, n = new Uint8Array();
|
|
3692
|
-
return t > 0 ? n = yield a(this, it).read(t) : i = yield a(this, it).readVarInt(),
|
|
3692
|
+
return t > 0 ? n = yield a(this, it).read(t) : i = yield a(this, it).readVarInt(), Zd(i), i === Te.EndOfGroup && l(this, Kr, !0), {
|
|
3693
3693
|
done: !1,
|
|
3694
3694
|
value: {
|
|
3695
3695
|
subscribeId: a(this, tn),
|
|
3696
|
-
trackAlias: a(this,
|
|
3696
|
+
trackAlias: a(this, Zr),
|
|
3697
3697
|
groupId: a(this, sn),
|
|
3698
3698
|
subGroupId: a(this, $r),
|
|
3699
3699
|
subscriberPriority: a(this, Yr),
|
|
@@ -3704,7 +3704,7 @@ class Ag {
|
|
|
3704
3704
|
}
|
|
3705
3705
|
};
|
|
3706
3706
|
} catch (e) {
|
|
3707
|
-
return a(this,
|
|
3707
|
+
return a(this, Jo).info("Error reading object", { error: e }), { done: !0, value: void 0 };
|
|
3708
3708
|
}
|
|
3709
3709
|
});
|
|
3710
3710
|
}
|
|
@@ -3727,7 +3727,7 @@ class Ag {
|
|
|
3727
3727
|
return A(this, Es, bh).call(this);
|
|
3728
3728
|
}
|
|
3729
3729
|
}
|
|
3730
|
-
it = new WeakMap(), tn = new WeakMap(),
|
|
3730
|
+
it = new WeakMap(), tn = new WeakMap(), Zr = new WeakMap(), sn = new WeakMap(), $r = new WeakMap(), Yr = new WeakMap(), Kr = new WeakMap(), nn = new WeakMap(), Jo = new WeakMap(), Es = new WeakSet(), Yd = function() {
|
|
3731
3731
|
return Rt(this, null, function* () {
|
|
3732
3732
|
yield this;
|
|
3733
3733
|
});
|
|
@@ -3797,26 +3797,26 @@ class bg {
|
|
|
3797
3797
|
}
|
|
3798
3798
|
}
|
|
3799
3799
|
At = new WeakMap(), Wi = new WeakMap(), zi = new WeakMap(), Hi = new WeakMap();
|
|
3800
|
-
var wt, ta,
|
|
3800
|
+
var wt, ta, Qi, bt, Zo, W, sr, io, Pi, so, Zt;
|
|
3801
3801
|
class xo {
|
|
3802
3802
|
constructor(e, t) {
|
|
3803
3803
|
d(this, W);
|
|
3804
3804
|
d(this, wt);
|
|
3805
3805
|
d(this, ta);
|
|
3806
|
-
d(this,
|
|
3806
|
+
d(this, Qi);
|
|
3807
3807
|
d(this, bt, 0);
|
|
3808
|
-
d(this,
|
|
3809
|
-
l(this, wt, e), l(this, ta, t), l(this,
|
|
3808
|
+
d(this, Zo, new TextDecoder());
|
|
3809
|
+
l(this, wt, e), l(this, ta, t), l(this, Qi, t.getReader());
|
|
3810
3810
|
}
|
|
3811
3811
|
readUnsigned8() {
|
|
3812
3812
|
return f(this, null, function* () {
|
|
3813
|
-
return yield A(this, W, Pi).call(this, 1), A(this, W,
|
|
3813
|
+
return yield A(this, W, Pi).call(this, 1), A(this, W, Zt).call(this, 1)[0];
|
|
3814
3814
|
});
|
|
3815
3815
|
}
|
|
3816
3816
|
readString() {
|
|
3817
3817
|
return f(this, null, function* () {
|
|
3818
3818
|
const e = yield this.readVarInt(), t = yield this.read(e);
|
|
3819
|
-
return a(this,
|
|
3819
|
+
return a(this, Zo).decode(t);
|
|
3820
3820
|
});
|
|
3821
3821
|
}
|
|
3822
3822
|
readVarInt() {
|
|
@@ -3833,20 +3833,20 @@ class xo {
|
|
|
3833
3833
|
const e = (A(this, W, so).call(this, 1)[0] & 192) >> 6;
|
|
3834
3834
|
switch (a(this, wt)[a(this, bt)] = A(this, W, so).call(this, 1)[0] & 63, e) {
|
|
3835
3835
|
case 0:
|
|
3836
|
-
return U(A(this, W,
|
|
3836
|
+
return U(A(this, W, Zt).call(this, 1)[0]);
|
|
3837
3837
|
case 1: {
|
|
3838
3838
|
yield A(this, W, Pi).call(this, 2);
|
|
3839
|
-
const t = A(this, W,
|
|
3839
|
+
const t = A(this, W, Zt).call(this, 2), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3840
3840
|
return U(i.getUint16(0));
|
|
3841
3841
|
}
|
|
3842
3842
|
case 2: {
|
|
3843
3843
|
yield A(this, W, Pi).call(this, 4);
|
|
3844
|
-
const t = A(this, W,
|
|
3844
|
+
const t = A(this, W, Zt).call(this, 4), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3845
3845
|
return U(i.getUint32(0));
|
|
3846
3846
|
}
|
|
3847
3847
|
case 3: {
|
|
3848
3848
|
yield A(this, W, Pi).call(this, 8);
|
|
3849
|
-
const t = A(this, W,
|
|
3849
|
+
const t = A(this, W, Zt).call(this, 8), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3850
3850
|
if (typeof i.getBigUint64 != "undefined")
|
|
3851
3851
|
return U(i.getBigUint64(0));
|
|
3852
3852
|
const n = iu(t, 0, 7);
|
|
@@ -3859,14 +3859,14 @@ class xo {
|
|
|
3859
3859
|
}
|
|
3860
3860
|
read(e) {
|
|
3861
3861
|
return f(this, null, function* () {
|
|
3862
|
-
return yield A(this, W, Pi).call(this, e), A(this, W,
|
|
3862
|
+
return yield A(this, W, Pi).call(this, e), A(this, W, Zt).call(this, e);
|
|
3863
3863
|
});
|
|
3864
3864
|
}
|
|
3865
3865
|
readAll() {
|
|
3866
3866
|
return f(this, null, function* () {
|
|
3867
3867
|
for (; yield A(this, W, io).call(this); )
|
|
3868
3868
|
;
|
|
3869
|
-
return A(this, W,
|
|
3869
|
+
return A(this, W, Zt).call(this, A(this, W, sr).call(this));
|
|
3870
3870
|
});
|
|
3871
3871
|
}
|
|
3872
3872
|
isDone() {
|
|
@@ -3876,20 +3876,20 @@ class xo {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
closed() {
|
|
3878
3878
|
return f(this, null, function* () {
|
|
3879
|
-
return a(this,
|
|
3879
|
+
return a(this, Qi).closed;
|
|
3880
3880
|
});
|
|
3881
3881
|
}
|
|
3882
3882
|
close() {
|
|
3883
3883
|
return f(this, null, function* () {
|
|
3884
|
-
return a(this,
|
|
3884
|
+
return a(this, Qi).releaseLock(), a(this, ta).cancel();
|
|
3885
3885
|
});
|
|
3886
3886
|
}
|
|
3887
3887
|
}
|
|
3888
|
-
wt = new WeakMap(), ta = new WeakMap(),
|
|
3888
|
+
wt = new WeakMap(), ta = new WeakMap(), Qi = new WeakMap(), bt = new WeakMap(), Zo = new WeakMap(), W = new WeakSet(), sr = function() {
|
|
3889
3889
|
return a(this, wt).length - a(this, bt);
|
|
3890
3890
|
}, io = function() {
|
|
3891
3891
|
return f(this, null, function* () {
|
|
3892
|
-
const { value: e, done: t } = yield a(this,
|
|
3892
|
+
const { value: e, done: t } = yield a(this, Qi).read();
|
|
3893
3893
|
if (t)
|
|
3894
3894
|
return Promise.resolve(0);
|
|
3895
3895
|
if (A(this, W, sr).call(this) === 0)
|
|
@@ -3908,18 +3908,18 @@ wt = new WeakMap(), ta = new WeakMap(), Xi = new WeakMap(), bt = new WeakMap(),
|
|
|
3908
3908
|
});
|
|
3909
3909
|
}, so = function(e) {
|
|
3910
3910
|
return a(this, wt).subarray(a(this, bt), a(this, bt) + e);
|
|
3911
|
-
},
|
|
3911
|
+
}, Zt = function(e) {
|
|
3912
3912
|
const t = A(this, W, so).call(this, e);
|
|
3913
3913
|
return l(this, bt, a(this, bt) + t.length), t;
|
|
3914
3914
|
};
|
|
3915
|
-
var rn, an,
|
|
3915
|
+
var rn, an, Ot, $o;
|
|
3916
3916
|
class el {
|
|
3917
3917
|
constructor(e) {
|
|
3918
3918
|
d(this, rn, new Uint8Array(8));
|
|
3919
3919
|
d(this, an);
|
|
3920
|
-
d(this,
|
|
3920
|
+
d(this, Ot);
|
|
3921
3921
|
d(this, $o, new TextEncoder());
|
|
3922
|
-
l(this, an, e), l(this,
|
|
3922
|
+
l(this, an, e), l(this, Ot, a(this, an).getWriter());
|
|
3923
3923
|
}
|
|
3924
3924
|
writeString(e) {
|
|
3925
3925
|
return f(this, null, function* () {
|
|
@@ -3928,16 +3928,16 @@ class el {
|
|
|
3928
3928
|
});
|
|
3929
3929
|
}
|
|
3930
3930
|
write(e) {
|
|
3931
|
-
return a(this,
|
|
3931
|
+
return a(this, Ot).write(e);
|
|
3932
3932
|
}
|
|
3933
3933
|
writeUnsigned8(e) {
|
|
3934
|
-
return a(this,
|
|
3934
|
+
return a(this, Ot).write(Gc(e, a(this, rn)));
|
|
3935
3935
|
}
|
|
3936
3936
|
writeVarInt(e) {
|
|
3937
|
-
return a(this,
|
|
3937
|
+
return a(this, Ot).write(hl(e, a(this, rn)));
|
|
3938
3938
|
}
|
|
3939
3939
|
writeBigVarInt(e) {
|
|
3940
|
-
return a(this,
|
|
3940
|
+
return a(this, Ot).write(ul(e, a(this, rn)));
|
|
3941
3941
|
}
|
|
3942
3942
|
flush() {
|
|
3943
3943
|
return f(this, null, function* () {
|
|
@@ -3945,22 +3945,22 @@ class el {
|
|
|
3945
3945
|
}
|
|
3946
3946
|
close() {
|
|
3947
3947
|
return f(this, null, function* () {
|
|
3948
|
-
a(this,
|
|
3948
|
+
a(this, Ot).releaseLock(), yield a(this, an).close();
|
|
3949
3949
|
});
|
|
3950
3950
|
}
|
|
3951
3951
|
}
|
|
3952
|
-
rn = new WeakMap(), an = new WeakMap(),
|
|
3952
|
+
rn = new WeakMap(), an = new WeakMap(), Ot = new WeakMap(), $o = new WeakMap();
|
|
3953
3953
|
const tl = {
|
|
3954
3954
|
OPEN: 1
|
|
3955
3955
|
};
|
|
3956
|
-
var Ue, Le,
|
|
3956
|
+
var Ue, Le, Xi, Yo;
|
|
3957
3957
|
const kr = class kr {
|
|
3958
3958
|
constructor(e) {
|
|
3959
3959
|
d(this, Ue, 0);
|
|
3960
3960
|
d(this, Le, new Uint8Array(kr.DEFAULT_BUFFER_SIZE));
|
|
3961
|
-
d(this,
|
|
3961
|
+
d(this, Xi);
|
|
3962
3962
|
d(this, Yo, new TextEncoder());
|
|
3963
|
-
l(this,
|
|
3963
|
+
l(this, Xi, e);
|
|
3964
3964
|
}
|
|
3965
3965
|
writeString(e) {
|
|
3966
3966
|
return f(this, null, function* () {
|
|
@@ -3991,15 +3991,15 @@ const kr = class kr {
|
|
|
3991
3991
|
return this.ensureBufferSpace(8), l(this, Ue, a(this, Ue) + ul(e, a(this, Le).subarray(a(this, Ue))).byteLength), Promise.resolve();
|
|
3992
3992
|
}
|
|
3993
3993
|
flush() {
|
|
3994
|
-
if (a(this,
|
|
3994
|
+
if (a(this, Xi).readyState !== tl.OPEN)
|
|
3995
3995
|
throw new Error("Writer is not open");
|
|
3996
|
-
return a(this,
|
|
3996
|
+
return a(this, Xi).send(a(this, Le).subarray(0, a(this, Ue))), l(this, Ue, 0), l(this, Le, new Uint8Array(kr.DEFAULT_BUFFER_SIZE)), Promise.resolve();
|
|
3997
3997
|
}
|
|
3998
3998
|
close() {
|
|
3999
|
-
return a(this,
|
|
3999
|
+
return a(this, Xi).close(), Promise.resolve();
|
|
4000
4000
|
}
|
|
4001
4001
|
};
|
|
4002
|
-
Ue = new WeakMap(), Le = new WeakMap(),
|
|
4002
|
+
Ue = new WeakMap(), Le = new WeakMap(), Xi = new WeakMap(), Yo = new WeakMap(), r(kr, "DEFAULT_BUFFER_SIZE", 1024);
|
|
4003
4003
|
let xr = kr;
|
|
4004
4004
|
const il = 2 ** 6 - 1, sl = 2 ** 14 - 1, nl = 2 ** 30 - 1, yg = Number.MAX_SAFE_INTEGER, vg = typeof BigInt == "function" ? U(2) ** U(62) - U(1) : U(Number.MAX_SAFE_INTEGER);
|
|
4005
4005
|
function Gc(s, e) {
|
|
@@ -4063,7 +4063,7 @@ function nu(s, e) {
|
|
|
4063
4063
|
});
|
|
4064
4064
|
}
|
|
4065
4065
|
const Lo = U(2);
|
|
4066
|
-
function
|
|
4066
|
+
function Zn(s) {
|
|
4067
4067
|
return f(this, null, function* () {
|
|
4068
4068
|
const e = yield s.readVarInt(), t = /* @__PURE__ */ new Map();
|
|
4069
4069
|
for (let i = 0; i < e; i++) {
|
|
@@ -4085,7 +4085,7 @@ function Sg(s) {
|
|
|
4085
4085
|
return {
|
|
4086
4086
|
type: C.Announce,
|
|
4087
4087
|
namespace: yield jc(s),
|
|
4088
|
-
params: yield
|
|
4088
|
+
params: yield Zn(s)
|
|
4089
4089
|
};
|
|
4090
4090
|
});
|
|
4091
4091
|
}
|
|
@@ -4196,7 +4196,7 @@ function ll(s, e) {
|
|
|
4196
4196
|
}
|
|
4197
4197
|
function Rg(s) {
|
|
4198
4198
|
return f(this, null, function* () {
|
|
4199
|
-
const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield jc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield dl(s), h = yield kg(s), u = yield
|
|
4199
|
+
const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield jc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield dl(s), h = yield kg(s), u = yield Zn(s);
|
|
4200
4200
|
if (h.type === "absolute-range") {
|
|
4201
4201
|
const m = h.start.group > h.end.group, p = h.start.group === h.end.group && h.start.object > h.end.object;
|
|
4202
4202
|
if (m || p)
|
|
@@ -4261,7 +4261,7 @@ function Dg(s, e) {
|
|
|
4261
4261
|
yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.errorCode), yield s.writeString(e.reason), yield s.writeBigVarInt(e.trackAlias);
|
|
4262
4262
|
});
|
|
4263
4263
|
}
|
|
4264
|
-
function
|
|
4264
|
+
function Og(s) {
|
|
4265
4265
|
return f(this, null, function* () {
|
|
4266
4266
|
const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield dl(s), n = (yield s.readUnsigned8()) == 1;
|
|
4267
4267
|
let o;
|
|
@@ -4271,7 +4271,7 @@ function Mg(s) {
|
|
|
4271
4271
|
group: yield s.readBigVarInt(),
|
|
4272
4272
|
object: yield s.readBigVarInt()
|
|
4273
4273
|
});
|
|
4274
|
-
const c = yield
|
|
4274
|
+
const c = yield Zn(s);
|
|
4275
4275
|
return {
|
|
4276
4276
|
type: C.SubscribeOk,
|
|
4277
4277
|
id: e,
|
|
@@ -4282,14 +4282,14 @@ function Mg(s) {
|
|
|
4282
4282
|
};
|
|
4283
4283
|
});
|
|
4284
4284
|
}
|
|
4285
|
-
function
|
|
4285
|
+
function Mg(s, e) {
|
|
4286
4286
|
return f(this, null, function* () {
|
|
4287
4287
|
yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield ll(s, e.groupOrder), yield s.writeUnsigned8(e.largestInfo ? 1 : 0), e.largestInfo && (yield s.writeBigVarInt(e.largestInfo.group), yield s.writeBigVarInt(e.largestInfo.object)), yield $n(s, e.params);
|
|
4288
4288
|
});
|
|
4289
4289
|
}
|
|
4290
4290
|
function Fg(s) {
|
|
4291
4291
|
return f(this, null, function* () {
|
|
4292
|
-
const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readUnsigned8(), h = yield
|
|
4292
|
+
const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readUnsigned8(), h = yield Zn(s), u = t > n, m = t === n && i > o;
|
|
4293
4293
|
if (u || m)
|
|
4294
4294
|
throw new Error("Invalid filter range");
|
|
4295
4295
|
return {
|
|
@@ -4338,7 +4338,7 @@ function Gg(s) {
|
|
|
4338
4338
|
const e = [], t = yield s.readVarInt();
|
|
4339
4339
|
for (let n = 0; n < t; n++)
|
|
4340
4340
|
e.push(yield fl(s));
|
|
4341
|
-
const i = yield
|
|
4341
|
+
const i = yield Zn(s);
|
|
4342
4342
|
if (!i.has(Do.Role))
|
|
4343
4343
|
throw new Error("Role parameter is required");
|
|
4344
4344
|
return {
|
|
@@ -4358,7 +4358,7 @@ function Wg(s) {
|
|
|
4358
4358
|
const e = yield fl(s);
|
|
4359
4359
|
if (e.type !== "known")
|
|
4360
4360
|
throw new Error("Expected known version");
|
|
4361
|
-
const t = yield
|
|
4361
|
+
const t = yield Zn(s);
|
|
4362
4362
|
if (!t.has(Do.Role))
|
|
4363
4363
|
throw new Error("Role parameter is required");
|
|
4364
4364
|
return {
|
|
@@ -4381,19 +4381,19 @@ function Hg(s, e) {
|
|
|
4381
4381
|
yield s.writeBigVarInt(e.id);
|
|
4382
4382
|
});
|
|
4383
4383
|
}
|
|
4384
|
-
var
|
|
4384
|
+
var Mt, on, ee, gl, Al, wl, bl, yl, vl, Sl, El, Tl, Il;
|
|
4385
4385
|
class pl {
|
|
4386
4386
|
constructor(e) {
|
|
4387
4387
|
d(this, ee);
|
|
4388
|
-
d(this,
|
|
4388
|
+
d(this, Mt);
|
|
4389
4389
|
// Temporary buffer that holds the message before it is written to the stream
|
|
4390
4390
|
// This way we can calculate the byte length of the message before writing it
|
|
4391
4391
|
d(this, on, new Uint8Array());
|
|
4392
|
-
l(this,
|
|
4392
|
+
l(this, Mt, e);
|
|
4393
4393
|
}
|
|
4394
4394
|
write(e) {
|
|
4395
4395
|
return f(this, null, function* () {
|
|
4396
|
-
yield a(this,
|
|
4396
|
+
yield a(this, Mt).writeVarInt(e.type);
|
|
4397
4397
|
const t = new xr({
|
|
4398
4398
|
close: () => {
|
|
4399
4399
|
},
|
|
@@ -4436,16 +4436,16 @@ class pl {
|
|
|
4436
4436
|
default:
|
|
4437
4437
|
throw new Error(`Unknown message type: ${e.type}`);
|
|
4438
4438
|
}
|
|
4439
|
-
yield t.flush(), yield a(this,
|
|
4439
|
+
yield t.flush(), yield a(this, Mt).writeVarInt(a(this, on).byteLength), yield a(this, Mt).write(a(this, on)), yield a(this, Mt).flush();
|
|
4440
4440
|
});
|
|
4441
4441
|
}
|
|
4442
4442
|
close() {
|
|
4443
4443
|
return f(this, null, function* () {
|
|
4444
|
-
return a(this,
|
|
4444
|
+
return a(this, Mt).close();
|
|
4445
4445
|
});
|
|
4446
4446
|
}
|
|
4447
4447
|
}
|
|
4448
|
-
|
|
4448
|
+
Mt = new WeakMap(), on = new WeakMap(), ee = new WeakSet(), gl = function(e, t) {
|
|
4449
4449
|
return f(this, null, function* () {
|
|
4450
4450
|
yield Vg(e, t);
|
|
4451
4451
|
});
|
|
@@ -4459,7 +4459,7 @@ Ot = new WeakMap(), on = new WeakMap(), ee = new WeakSet(), gl = function(e, t)
|
|
|
4459
4459
|
});
|
|
4460
4460
|
}, bl = function(e, t) {
|
|
4461
4461
|
return f(this, null, function* () {
|
|
4462
|
-
yield
|
|
4462
|
+
yield Mg(e, t);
|
|
4463
4463
|
});
|
|
4464
4464
|
}, yl = function(e, t) {
|
|
4465
4465
|
return f(this, null, function* () {
|
|
@@ -4487,7 +4487,7 @@ Ot = new WeakMap(), on = new WeakMap(), ee = new WeakSet(), gl = function(e, t)
|
|
|
4487
4487
|
});
|
|
4488
4488
|
};
|
|
4489
4489
|
var cn, ia, sa;
|
|
4490
|
-
class
|
|
4490
|
+
class Qg {
|
|
4491
4491
|
constructor(e, t) {
|
|
4492
4492
|
d(this, cn);
|
|
4493
4493
|
d(this, ia);
|
|
@@ -4504,7 +4504,7 @@ class Xg {
|
|
|
4504
4504
|
}
|
|
4505
4505
|
}
|
|
4506
4506
|
cn = new WeakMap(), ia = new WeakMap(), sa = new WeakMap();
|
|
4507
|
-
function
|
|
4507
|
+
function Xg(s) {
|
|
4508
4508
|
return f(this, null, function* () {
|
|
4509
4509
|
return {
|
|
4510
4510
|
type: C.AnnounceError,
|
|
@@ -4514,7 +4514,7 @@ function Qg(s) {
|
|
|
4514
4514
|
};
|
|
4515
4515
|
});
|
|
4516
4516
|
}
|
|
4517
|
-
function
|
|
4517
|
+
function qg(s, e, t) {
|
|
4518
4518
|
return f(this, null, function* () {
|
|
4519
4519
|
return {
|
|
4520
4520
|
type: C.Unknown,
|
|
@@ -4543,7 +4543,7 @@ class Gu {
|
|
|
4543
4543
|
case C.Subscribe:
|
|
4544
4544
|
return Rg(a(this, he));
|
|
4545
4545
|
case C.SubscribeOk:
|
|
4546
|
-
return
|
|
4546
|
+
return Og(a(this, he));
|
|
4547
4547
|
case C.SubscribeDone:
|
|
4548
4548
|
return Pg(a(this, he));
|
|
4549
4549
|
case C.SubscribeError:
|
|
@@ -4557,9 +4557,9 @@ class Gu {
|
|
|
4557
4557
|
case C.AnnounceOk:
|
|
4558
4558
|
return Tg(a(this, he));
|
|
4559
4559
|
case C.AnnounceError:
|
|
4560
|
-
return
|
|
4560
|
+
return Xg(a(this, he));
|
|
4561
4561
|
}
|
|
4562
|
-
return
|
|
4562
|
+
return qg(a(this, he), U(e), t);
|
|
4563
4563
|
});
|
|
4564
4564
|
}
|
|
4565
4565
|
}
|
|
@@ -4602,7 +4602,7 @@ const _s = class _s {
|
|
|
4602
4602
|
static wrapWebsocket(e) {
|
|
4603
4603
|
const t = new ReadableStream(
|
|
4604
4604
|
new wg(e, a(_s, ec))
|
|
4605
|
-
), i = new Gu(new xo(new Uint8Array([]), t)), n = new
|
|
4605
|
+
), i = new Gu(new xo(new Uint8Array([]), t)), n = new Qg(new xr(e), new Uint8Array([0]));
|
|
4606
4606
|
return new _s(n, i);
|
|
4607
4607
|
}
|
|
4608
4608
|
static wrapWebTransport(e) {
|
|
@@ -4617,7 +4617,7 @@ na = new WeakMap(), hn = new WeakMap(), un = new WeakMap(), ra = new WeakMap(),
|
|
|
4617
4617
|
const e = new z(), t = a(this, un).promise.then(() => e);
|
|
4618
4618
|
return l(this, un, e), t;
|
|
4619
4619
|
}, ec = new WeakMap(), d(_s, ec, 0);
|
|
4620
|
-
let
|
|
4620
|
+
let Oo = _s;
|
|
4621
4621
|
function kl(s, e) {
|
|
4622
4622
|
return f(this, null, function* () {
|
|
4623
4623
|
yield s.write({
|
|
@@ -4633,7 +4633,7 @@ function kl(s, e) {
|
|
|
4633
4633
|
});
|
|
4634
4634
|
}
|
|
4635
4635
|
var dn;
|
|
4636
|
-
class
|
|
4636
|
+
class Jg {
|
|
4637
4637
|
constructor(e) {
|
|
4638
4638
|
r(this, "announce");
|
|
4639
4639
|
d(this, dn, new z());
|
|
@@ -4651,8 +4651,8 @@ class Zg {
|
|
|
4651
4651
|
}
|
|
4652
4652
|
}
|
|
4653
4653
|
dn = new WeakMap();
|
|
4654
|
-
function
|
|
4655
|
-
const e = new
|
|
4654
|
+
function Zg(s) {
|
|
4655
|
+
const e = new Jg(s);
|
|
4656
4656
|
return new $g(e);
|
|
4657
4657
|
}
|
|
4658
4658
|
class $g {
|
|
@@ -4661,15 +4661,15 @@ class $g {
|
|
|
4661
4661
|
this.state = e;
|
|
4662
4662
|
}
|
|
4663
4663
|
}
|
|
4664
|
-
var ln, ai,
|
|
4664
|
+
var ln, ai, qi, tc, Ji, st;
|
|
4665
4665
|
const Ns = class Ns {
|
|
4666
4666
|
constructor(e) {
|
|
4667
4667
|
r(this, "subscribe");
|
|
4668
4668
|
d(this, ln, new z());
|
|
4669
4669
|
d(this, ai, new z());
|
|
4670
|
-
d(this,
|
|
4670
|
+
d(this, qi, new z());
|
|
4671
4671
|
d(this, tc, Date.now());
|
|
4672
|
-
d(this,
|
|
4672
|
+
d(this, Ji, new z());
|
|
4673
4673
|
d(this, st);
|
|
4674
4674
|
switch (this.subscribe = e, e.filterType.type) {
|
|
4675
4675
|
case "absolute-start":
|
|
@@ -4691,13 +4691,13 @@ const Ns = class Ns {
|
|
|
4691
4691
|
e.finalInfo && (a(this, st) || l(this, st, { startGroup: U(0) }), a(this, st).endGroup = e.finalInfo.group), a(this, ai).resolve(e);
|
|
4692
4692
|
}
|
|
4693
4693
|
onUnsubscribe(e) {
|
|
4694
|
-
a(this,
|
|
4694
|
+
a(this, qi).resolve(e);
|
|
4695
4695
|
}
|
|
4696
4696
|
onOk(e) {
|
|
4697
4697
|
const t = Math.max(0, Date.now() - a(this, tc)), i = Number(e.expires);
|
|
4698
4698
|
if (i > 0) {
|
|
4699
4699
|
const n = Math.max(Ns.minGraceTime, Math.min(i / 10, Ns.maxGraceTime));
|
|
4700
|
-
Promise.race([Ti(i - n - t), this.done().catch(
|
|
4700
|
+
Promise.race([Ti(i - n - t), this.done().catch(O)]).then(() => a(this, Ji).resolve(this.expiryState())).catch(O);
|
|
4701
4701
|
}
|
|
4702
4702
|
a(this, ln).resolve(e);
|
|
4703
4703
|
}
|
|
@@ -4711,28 +4711,28 @@ const Ns = class Ns {
|
|
|
4711
4711
|
return a(this, st);
|
|
4712
4712
|
}
|
|
4713
4713
|
close() {
|
|
4714
|
-
a(this,
|
|
4714
|
+
a(this, Ji).promise.catch(O), a(this, Ji).reject(new Error("Subscription closed"));
|
|
4715
4715
|
}
|
|
4716
4716
|
// Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
|
|
4717
4717
|
expiryState() {
|
|
4718
|
-
return a(this, ai).resolved && a(this, ai).resolved.errorCode !== yh.Expired ? "done" : a(this,
|
|
4718
|
+
return a(this, ai).resolved && a(this, ai).resolved.errorCode !== yh.Expired ? "done" : a(this, qi).pending ? "active" : "unsubscribed";
|
|
4719
4719
|
}
|
|
4720
4720
|
unsubscribed() {
|
|
4721
|
-
return a(this,
|
|
4721
|
+
return a(this, qi).promise;
|
|
4722
4722
|
}
|
|
4723
4723
|
isUnsubscribed() {
|
|
4724
|
-
return a(this,
|
|
4724
|
+
return a(this, qi).resolved;
|
|
4725
4725
|
}
|
|
4726
4726
|
/**
|
|
4727
4727
|
* Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
|
|
4728
4728
|
|
|
4729
4729
|
*/
|
|
4730
4730
|
expiryNotification() {
|
|
4731
|
-
return a(this,
|
|
4731
|
+
return a(this, Ji).promise;
|
|
4732
4732
|
}
|
|
4733
4733
|
};
|
|
4734
|
-
ln = new WeakMap(), ai = new WeakMap(),
|
|
4735
|
-
let
|
|
4734
|
+
ln = new WeakMap(), ai = new WeakMap(), qi = new WeakMap(), tc = new WeakMap(), Ji = new WeakMap(), st = new WeakMap(), r(Ns, "maxGraceTime", 15e3), r(Ns, "minGraceTime", 3e3);
|
|
4735
|
+
let Mo = Ns;
|
|
4736
4736
|
var we, aa;
|
|
4737
4737
|
class Yg {
|
|
4738
4738
|
constructor(e) {
|
|
@@ -4773,7 +4773,7 @@ class Kg {
|
|
|
4773
4773
|
A(this, ic, Bl).call(this).catch((e) => a(this, ua).error("error writing subscription", e)),
|
|
4774
4774
|
a(this, We).unsubscribed(),
|
|
4775
4775
|
a(this, We).done(),
|
|
4776
|
-
a(this, We).expiryNotification().catch(
|
|
4776
|
+
a(this, We).expiryNotification().catch(O)
|
|
4777
4777
|
]);
|
|
4778
4778
|
});
|
|
4779
4779
|
}
|
|
@@ -4832,15 +4832,15 @@ oa = new WeakMap(), We = new WeakMap(), ca = new WeakMap(), ha = new WeakMap(),
|
|
|
4832
4832
|
}
|
|
4833
4833
|
});
|
|
4834
4834
|
};
|
|
4835
|
-
var
|
|
4835
|
+
var Zi, da, fn, la, pn;
|
|
4836
4836
|
class eA {
|
|
4837
4837
|
constructor(e, t, i) {
|
|
4838
|
-
d(this,
|
|
4838
|
+
d(this, Zi);
|
|
4839
4839
|
d(this, da);
|
|
4840
4840
|
d(this, fn);
|
|
4841
4841
|
d(this, la);
|
|
4842
4842
|
d(this, pn);
|
|
4843
|
-
l(this,
|
|
4843
|
+
l(this, Zi, e), l(this, da, t), l(this, fn, i), l(this, pn, ge.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
|
|
4844
4844
|
}
|
|
4845
4845
|
finalGroup() {
|
|
4846
4846
|
return a(this, la);
|
|
@@ -4851,7 +4851,7 @@ class eA {
|
|
|
4851
4851
|
try {
|
|
4852
4852
|
for (var e = $(a(this, da)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
4853
4853
|
const o = i.value;
|
|
4854
|
-
yield a(this,
|
|
4854
|
+
yield a(this, Zi).write({
|
|
4855
4855
|
subscribeId: a(this, fn).subscribe.id,
|
|
4856
4856
|
trackAlias: a(this, fn).subscribe.trackAlias,
|
|
4857
4857
|
subGroupId: U(0),
|
|
@@ -4876,13 +4876,13 @@ class eA {
|
|
|
4876
4876
|
});
|
|
4877
4877
|
}
|
|
4878
4878
|
[kt()]() {
|
|
4879
|
-
return a(this,
|
|
4879
|
+
return a(this, Zi).close().catch(O);
|
|
4880
4880
|
}
|
|
4881
4881
|
[Symbol.asyncDispose]() {
|
|
4882
|
-
return a(this,
|
|
4882
|
+
return a(this, Zi).close().catch(O);
|
|
4883
4883
|
}
|
|
4884
4884
|
}
|
|
4885
|
-
|
|
4885
|
+
Zi = new WeakMap(), da = new WeakMap(), fn = new WeakMap(), la = new WeakMap(), pn = new WeakMap();
|
|
4886
4886
|
var ma, $i, oi, Ps;
|
|
4887
4887
|
class tA {
|
|
4888
4888
|
constructor(e, t, i) {
|
|
@@ -4954,7 +4954,7 @@ class vh {
|
|
|
4954
4954
|
d(this, Yi, ge.get().createContext("Publisher"));
|
|
4955
4955
|
d(this, ci, new Ie(/* @__PURE__ */ new Map()));
|
|
4956
4956
|
d(this, hi, new Ie(/* @__PURE__ */ new Map()));
|
|
4957
|
-
d(this, ui, new
|
|
4957
|
+
d(this, ui, new Mc(10));
|
|
4958
4958
|
l(this, gn, e), l(this, fa, t), l(this, An, i);
|
|
4959
4959
|
}
|
|
4960
4960
|
announce(e) {
|
|
@@ -4967,7 +4967,7 @@ class vh {
|
|
|
4967
4967
|
type: C.Announce,
|
|
4968
4968
|
namespace: e,
|
|
4969
4969
|
params: t
|
|
4970
|
-
}, o =
|
|
4970
|
+
}, o = Zg(n);
|
|
4971
4971
|
if (a(this, ci).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, An).push(n), !(yield Promise.race([o.state.ok(), a(this, gn).closed()])))
|
|
4972
4972
|
throw new Error("Session closed");
|
|
4973
4973
|
});
|
|
@@ -4983,7 +4983,7 @@ class vh {
|
|
|
4983
4983
|
switch (e.type) {
|
|
4984
4984
|
case C.Subscribe:
|
|
4985
4985
|
{
|
|
4986
|
-
const t = new
|
|
4986
|
+
const t = new Mo(e);
|
|
4987
4987
|
if (a(this, hi).update((i) => (i.set(e.id, t), i)), a(this, ui).isFull()) {
|
|
4988
4988
|
const i = yield a(this, ui).pop();
|
|
4989
4989
|
yield i == null ? void 0 : i.timeout();
|
|
@@ -5021,9 +5021,9 @@ class vh {
|
|
|
5021
5021
|
});
|
|
5022
5022
|
}
|
|
5023
5023
|
}
|
|
5024
|
-
nh = Ci(null), gn = new WeakMap(), fa = new WeakMap(), An = new WeakMap(), Yi = new WeakMap(), ci = new WeakMap(), hi = new WeakMap(), ui = new WeakMap(), ye(nh, 1, "announce", od, vh),
|
|
5024
|
+
nh = Ci(null), gn = new WeakMap(), fa = new WeakMap(), An = new WeakMap(), Yi = new WeakMap(), ci = new WeakMap(), hi = new WeakMap(), ui = new WeakMap(), ye(nh, 1, "announce", od, vh), Jt(nh, vh);
|
|
5025
5025
|
function iA(s, e) {
|
|
5026
|
-
const t = new
|
|
5026
|
+
const t = new Mo(e), [i, n] = tu(100), o = new sA(t, i), c = new Rl(s, t, n);
|
|
5027
5027
|
return [o, c];
|
|
5028
5028
|
}
|
|
5029
5029
|
var Ki;
|
|
@@ -5131,13 +5131,13 @@ class Rl {
|
|
|
5131
5131
|
return Rt(this, null, function* () {
|
|
5132
5132
|
var e, t;
|
|
5133
5133
|
try {
|
|
5134
|
-
for (var b = $(a(this, bn)), S, I,
|
|
5134
|
+
for (var b = $(a(this, bn)), S, I, k; S = !(I = yield new q(b.next())).done; S = !1) {
|
|
5135
5135
|
var h = I.value;
|
|
5136
5136
|
var u = [];
|
|
5137
5137
|
try {
|
|
5138
5138
|
const D = Ve(u, h, !0);
|
|
5139
5139
|
try {
|
|
5140
|
-
for (var i = $(D.groups()), n, o, c; n = !(o = yield new
|
|
5140
|
+
for (var i = $(D.groups()), n, o, c; n = !(o = yield new q(i.next())).done; n = !1) {
|
|
5141
5141
|
const T = o.value;
|
|
5142
5142
|
const P = (e = a(this, le).range()) == null ? void 0 : e.startGroup, R = (t = a(this, le).range()) == null ? void 0 : t.endGroup;
|
|
5143
5143
|
if (P && T.groupId() < P)
|
|
@@ -5150,7 +5150,7 @@ class Rl {
|
|
|
5150
5150
|
c = [o];
|
|
5151
5151
|
} finally {
|
|
5152
5152
|
try {
|
|
5153
|
-
n && (o = i.return) && (yield new
|
|
5153
|
+
n && (o = i.return) && (yield new q(o.call(i)));
|
|
5154
5154
|
} finally {
|
|
5155
5155
|
if (c)
|
|
5156
5156
|
throw c[0];
|
|
@@ -5160,17 +5160,17 @@ class Rl {
|
|
|
5160
5160
|
var p = m, g = !0;
|
|
5161
5161
|
} finally {
|
|
5162
5162
|
var w = Ge(u, p, g);
|
|
5163
|
-
w && (yield new
|
|
5163
|
+
w && (yield new q(w));
|
|
5164
5164
|
}
|
|
5165
5165
|
}
|
|
5166
5166
|
} catch (I) {
|
|
5167
|
-
|
|
5167
|
+
k = [I];
|
|
5168
5168
|
} finally {
|
|
5169
5169
|
try {
|
|
5170
|
-
S && (I = b.return) && (yield new
|
|
5170
|
+
S && (I = b.return) && (yield new q(I.call(b)));
|
|
5171
5171
|
} finally {
|
|
5172
|
-
if (
|
|
5173
|
-
throw
|
|
5172
|
+
if (k)
|
|
5173
|
+
throw k[0];
|
|
5174
5174
|
}
|
|
5175
5175
|
}
|
|
5176
5176
|
});
|
|
@@ -5184,10 +5184,10 @@ class Rl {
|
|
|
5184
5184
|
objects() {
|
|
5185
5185
|
return Rt(this, null, function* () {
|
|
5186
5186
|
try {
|
|
5187
|
-
for (var o = $(this.groups()), c, h, u; c = !(h = yield new
|
|
5187
|
+
for (var o = $(this.groups()), c, h, u; c = !(h = yield new q(o.next())).done; c = !1) {
|
|
5188
5188
|
const m = h.value;
|
|
5189
5189
|
try {
|
|
5190
|
-
for (var e = $(m), t, i, n; t = !(i = yield new
|
|
5190
|
+
for (var e = $(m), t, i, n; t = !(i = yield new q(e.next())).done; t = !1) {
|
|
5191
5191
|
const p = i.value;
|
|
5192
5192
|
yield p;
|
|
5193
5193
|
}
|
|
@@ -5195,7 +5195,7 @@ class Rl {
|
|
|
5195
5195
|
n = [i];
|
|
5196
5196
|
} finally {
|
|
5197
5197
|
try {
|
|
5198
|
-
t && (i = e.return) && (yield new
|
|
5198
|
+
t && (i = e.return) && (yield new q(i.call(e)));
|
|
5199
5199
|
} finally {
|
|
5200
5200
|
if (n)
|
|
5201
5201
|
throw n[0];
|
|
@@ -5206,7 +5206,7 @@ class Rl {
|
|
|
5206
5206
|
u = [h];
|
|
5207
5207
|
} finally {
|
|
5208
5208
|
try {
|
|
5209
|
-
c && (h = o.return) && (yield new
|
|
5209
|
+
c && (h = o.return) && (yield new q(h.call(o)));
|
|
5210
5210
|
} finally {
|
|
5211
5211
|
if (u)
|
|
5212
5212
|
throw u[0];
|
|
@@ -5225,7 +5225,7 @@ rh = Ci(null), wn = new WeakMap(), le = new WeakMap(), bn = new WeakMap(), yn =
|
|
|
5225
5225
|
return f(this, null, function* () {
|
|
5226
5226
|
return yield this.close(), this.unsubscribe();
|
|
5227
5227
|
});
|
|
5228
|
-
}, nr = ye(rh, 17, "#dispose", cd, vn, nr),
|
|
5228
|
+
}, nr = ye(rh, 17, "#dispose", cd, vn, nr), Jt(rh, Rl);
|
|
5229
5229
|
const nA = 2e3;
|
|
5230
5230
|
var hd, ud, dd, ld, Ft, De, es, ts, Rs, Ct, ro, xs;
|
|
5231
5231
|
ld = [Pe({ context: "Session", return: "debug" })], dd = [Pe({ context: "Session", enter: "info", error: "error" })], ud = [Pe({ context: "Session", enter: "debug" })], hd = [Pe({ context: "Session", enter: "debug" })];
|
|
@@ -5241,7 +5241,7 @@ class no {
|
|
|
5241
5241
|
d(this, De, new Ie(/* @__PURE__ */ new Map()));
|
|
5242
5242
|
d(this, es);
|
|
5243
5243
|
d(this, ts, ge.get().createContext("Subscriber"));
|
|
5244
|
-
l(this, Ft, e), l(this, es, t), A(this, Ct, ro).call(this).catch(
|
|
5244
|
+
l(this, Ft, e), l(this, es, t), A(this, Ct, ro).call(this).catch(O);
|
|
5245
5245
|
}
|
|
5246
5246
|
subscribe(n, o) {
|
|
5247
5247
|
return f(this, arguments, function* (e, t, i = /* @__PURE__ */ new Map()) {
|
|
@@ -5337,7 +5337,7 @@ Rs = Ci(null), Ft = new WeakMap(), De = new WeakMap(), es = new WeakMap(), ts =
|
|
|
5337
5337
|
});
|
|
5338
5338
|
}, xs = function(e) {
|
|
5339
5339
|
a(this, De).isClosed() || a(this, De).update((t) => (t.delete(e), t));
|
|
5340
|
-
}, ro = ye(Rs, 17, "#observeChanges", ld, Ct, ro), ye(Rs, 1, "subscribe", dd, no), ye(Rs, 1, "close", ud, no), xs = ye(Rs, 17, "#deleteSubscription", hd, Ct, xs),
|
|
5340
|
+
}, ro = ye(Rs, 17, "#observeChanges", ld, Ct, ro), ye(Rs, 1, "subscribe", dd, no), ye(Rs, 1, "close", ud, no), xs = ye(Rs, 17, "#deleteSubscription", hd, Ct, xs), Jt(Rs, no);
|
|
5341
5341
|
var md, fd, pd, gd, nt, pa, is, Sn, En, ue, Ul, Pl, Us, ao, oo, co, rr;
|
|
5342
5342
|
class ru {
|
|
5343
5343
|
constructor(e, t) {
|
|
@@ -5354,7 +5354,7 @@ class ru {
|
|
|
5354
5354
|
r(this, "publisher");
|
|
5355
5355
|
d(this, En);
|
|
5356
5356
|
const [i, n] = tu(100);
|
|
5357
|
-
l(this, nt, e), l(this, is, n), this.subscriber = new no(this, i), this.publisher = new vh(this, e, i), l(this, pa, A(this, ue, Pl).call(this)), l(this, En, new Ie(t)), this.closed().then(() => this.close()).catch(
|
|
5357
|
+
l(this, nt, e), l(this, is, n), this.subscriber = new no(this, i), this.publisher = new vh(this, e, i), l(this, pa, A(this, ue, Pl).call(this)), l(this, En, new Ie(t)), this.closed().then(() => this.close()).catch(O);
|
|
5358
5358
|
}
|
|
5359
5359
|
updateAuthToken(e) {
|
|
5360
5360
|
a(this, En).update(e);
|
|
@@ -5451,7 +5451,7 @@ Us = Ci(null), nt = new WeakMap(), pa = new WeakMap(), is = new WeakMap(), Sn =
|
|
|
5451
5451
|
});
|
|
5452
5452
|
}, rr = function() {
|
|
5453
5453
|
this.close();
|
|
5454
|
-
}, ao = ye(Us, 17, "#runOutgoingMessages", gd, ue, ao), oo = ye(Us, 17, "#runControl", pd, ue, oo), co = ye(Us, 17, "#runObjects", fd, ue, co), rr = ye(Us, 17, "#dispose", md, ue, rr),
|
|
5454
|
+
}, ao = ye(Us, 17, "#runOutgoingMessages", gd, ue, ao), oo = ye(Us, 17, "#runControl", pd, ue, oo), co = ye(Us, 17, "#runObjects", fd, ue, co), rr = ye(Us, 17, "#dispose", md, ue, rr), Jt(Us, ru);
|
|
5455
5455
|
const rA = 128;
|
|
5456
5456
|
var ze, ga, ss, Tn, Aa, be, xi, Li;
|
|
5457
5457
|
class aA {
|
|
@@ -5576,7 +5576,7 @@ class oA {
|
|
|
5576
5576
|
}
|
|
5577
5577
|
close() {
|
|
5578
5578
|
var e;
|
|
5579
|
-
return a(this, _t).cancel().catch(
|
|
5579
|
+
return a(this, _t).cancel().catch(O), a(this, In).cancel("closing").catch(O), (e = a(this, ns)) == null || e.cancel("closing").catch(O), a(this, di).close();
|
|
5580
5580
|
}
|
|
5581
5581
|
closed() {
|
|
5582
5582
|
return Promise.resolve();
|
|
@@ -5605,7 +5605,7 @@ class cA {
|
|
|
5605
5605
|
d(this, rc);
|
|
5606
5606
|
d(this, Vt);
|
|
5607
5607
|
d(this, Gt);
|
|
5608
|
-
d(this, li, new
|
|
5608
|
+
d(this, li, new Mc(100));
|
|
5609
5609
|
d(this, wa);
|
|
5610
5610
|
d(this, ba, 0);
|
|
5611
5611
|
d(this, nc, ge.get().createContext("WebTransportConnection"));
|
|
@@ -5664,7 +5664,7 @@ Vt = new WeakMap(), Gt = new WeakMap(), li = new WeakMap(), wa = new WeakMap(),
|
|
|
5664
5664
|
return;
|
|
5665
5665
|
}
|
|
5666
5666
|
const n = new xo(new Uint8Array(), t);
|
|
5667
|
-
yield a(this, li).push(Kd(n, a(this, ba))),
|
|
5667
|
+
yield a(this, li).push(Kd(n, a(this, ba))), Ze(this, ba)._++;
|
|
5668
5668
|
}
|
|
5669
5669
|
});
|
|
5670
5670
|
};
|
|
@@ -5674,7 +5674,7 @@ function Yc(s) {
|
|
|
5674
5674
|
e.binaryType = "arraybuffer", yield new Promise((o, c) => {
|
|
5675
5675
|
e.addEventListener("error", () => c(new Error("WebSocket error")), { once: !0 }), e.addEventListener("open", o, { once: !0 });
|
|
5676
5676
|
});
|
|
5677
|
-
const t =
|
|
5677
|
+
const t = Oo.wrapWebsocket(e);
|
|
5678
5678
|
kl(t, s.role).catch(() => {
|
|
5679
5679
|
e.close();
|
|
5680
5680
|
});
|
|
@@ -5692,7 +5692,7 @@ function hA(s) {
|
|
|
5692
5692
|
// serverCertificateHashes: [{ algorithm: "sha-256", value: hexBytes }],
|
|
5693
5693
|
});
|
|
5694
5694
|
yield Promise.race([i.ready, i.closed.then(() => Promise.reject(new Error("WebTransport closed")))]);
|
|
5695
|
-
const n = yield i.createBidirectionalStream(), o =
|
|
5695
|
+
const n = yield i.createBidirectionalStream(), o = Oo.wrapWebTransport(n);
|
|
5696
5696
|
kl(o, s.role).catch(() => {
|
|
5697
5697
|
i.close();
|
|
5698
5698
|
});
|
|
@@ -5710,7 +5710,7 @@ function uA(s) {
|
|
|
5710
5710
|
});
|
|
5711
5711
|
}
|
|
5712
5712
|
var jt;
|
|
5713
|
-
class
|
|
5713
|
+
class Xt {
|
|
5714
5714
|
constructor() {
|
|
5715
5715
|
d(this, jt, {
|
|
5716
5716
|
name: "",
|
|
@@ -5784,11 +5784,11 @@ function mA(s) {
|
|
|
5784
5784
|
const e = new TextDecoder().decode(s);
|
|
5785
5785
|
return JSON.parse(e);
|
|
5786
5786
|
}
|
|
5787
|
-
var
|
|
5787
|
+
var Oe, yt, rs, He, va, ac, Sa, Sh;
|
|
5788
5788
|
const uu = class uu {
|
|
5789
5789
|
constructor(e, t) {
|
|
5790
5790
|
d(this, Sa);
|
|
5791
|
-
d(this,
|
|
5791
|
+
d(this, Oe);
|
|
5792
5792
|
// The largest group id seen so far - used to switch seamlessly between tracks
|
|
5793
5793
|
d(this, yt);
|
|
5794
5794
|
// We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
|
|
@@ -5798,16 +5798,16 @@ const uu = class uu {
|
|
|
5798
5798
|
d(this, va);
|
|
5799
5799
|
d(this, ac, (e) => f(this, null, function* () {
|
|
5800
5800
|
if (!e)
|
|
5801
|
-
return a(this,
|
|
5801
|
+
return a(this, Oe).close();
|
|
5802
5802
|
if (a(this, He))
|
|
5803
5803
|
return;
|
|
5804
5804
|
const t = a(this, rs).items().reduce((i, n) => i < n ? i : n, e);
|
|
5805
|
-
l(this, He, A(this, Sa, Sh).call(this, t, e)), a(this, He).size === 0 && (yield a(this,
|
|
5805
|
+
l(this, He, A(this, Sa, Sh).call(this, t, e)), a(this, He).size === 0 && (yield a(this, Oe).close());
|
|
5806
5806
|
}));
|
|
5807
|
-
l(this,
|
|
5807
|
+
l(this, Oe, e), l(this, yt, t), e.done().then((i) => f(this, null, function* () {
|
|
5808
5808
|
var n;
|
|
5809
5809
|
return a(this, ac).call(this, (n = i.finalInfo) == null ? void 0 : n.group);
|
|
5810
|
-
})).catch(
|
|
5810
|
+
})).catch(O), l(this, va, e.groups());
|
|
5811
5811
|
}
|
|
5812
5812
|
static subscribe(e, t) {
|
|
5813
5813
|
return f(this, null, function* () {
|
|
@@ -5816,10 +5816,10 @@ const uu = class uu {
|
|
|
5816
5816
|
});
|
|
5817
5817
|
}
|
|
5818
5818
|
subscribeId() {
|
|
5819
|
-
return a(this,
|
|
5819
|
+
return a(this, Oe).id;
|
|
5820
5820
|
}
|
|
5821
5821
|
name() {
|
|
5822
|
-
return a(this,
|
|
5822
|
+
return a(this, Oe).name;
|
|
5823
5823
|
}
|
|
5824
5824
|
largestGroupId() {
|
|
5825
5825
|
return a(this, yt);
|
|
@@ -5827,7 +5827,7 @@ const uu = class uu {
|
|
|
5827
5827
|
// The subscription needs renewal if it is still active and aren't finishing up the unconsumed group IDs.
|
|
5828
5828
|
// If we are just finishing up the unconsumed group IDs we assume we'll finish up before the expiry.
|
|
5829
5829
|
needsRenewal() {
|
|
5830
|
-
return a(this,
|
|
5830
|
+
return a(this, Oe).expiryState() === "active" && a(this, He) === void 0;
|
|
5831
5831
|
}
|
|
5832
5832
|
/** Set the endGroup as the end of group.
|
|
5833
5833
|
* This lets the subscription end when the endGroup is reached.
|
|
@@ -5838,11 +5838,11 @@ const uu = class uu {
|
|
|
5838
5838
|
}
|
|
5839
5839
|
update(e, t) {
|
|
5840
5840
|
return f(this, null, function* () {
|
|
5841
|
-
return l(this, He, A(this, Sa, Sh).call(this, e, t)), a(this, He).size === 0 && (yield a(this,
|
|
5841
|
+
return l(this, He, A(this, Sa, Sh).call(this, e, t)), a(this, He).size === 0 && (yield a(this, Oe).close()), a(this, Oe).update(e, t);
|
|
5842
5842
|
});
|
|
5843
5843
|
}
|
|
5844
5844
|
unsubscribe() {
|
|
5845
|
-
return a(this,
|
|
5845
|
+
return a(this, Oe).unsubscribe();
|
|
5846
5846
|
}
|
|
5847
5847
|
next() {
|
|
5848
5848
|
return f(this, null, function* () {
|
|
@@ -5857,13 +5857,13 @@ const uu = class uu {
|
|
|
5857
5857
|
});
|
|
5858
5858
|
}
|
|
5859
5859
|
return() {
|
|
5860
|
-
return a(this,
|
|
5860
|
+
return a(this, Oe).return();
|
|
5861
5861
|
}
|
|
5862
5862
|
[Symbol.asyncIterator]() {
|
|
5863
5863
|
return this;
|
|
5864
5864
|
}
|
|
5865
5865
|
};
|
|
5866
|
-
|
|
5866
|
+
Oe = new WeakMap(), yt = new WeakMap(), rs = new WeakMap(), He = new WeakMap(), va = new WeakMap(), ac = new WeakMap(), Sa = new WeakSet(), Sh = function(e, t) {
|
|
5867
5867
|
const i = /* @__PURE__ */ new Set();
|
|
5868
5868
|
for (let n = e; n <= t; n++)
|
|
5869
5869
|
i == null || i.add(n);
|
|
@@ -5881,7 +5881,7 @@ const du = class du {
|
|
|
5881
5881
|
// The current group iterator - gets replaced by the next in #groups when it runs out
|
|
5882
5882
|
d(this, as);
|
|
5883
5883
|
// The next group iterators to switch to when the current one runs out
|
|
5884
|
-
d(this, Wt, new
|
|
5884
|
+
d(this, Wt, new Mc(10));
|
|
5885
5885
|
d(this, vt);
|
|
5886
5886
|
d(this, Ta, (e, t) => f(this, null, function* () {
|
|
5887
5887
|
var g = [];
|
|
@@ -5894,7 +5894,7 @@ const du = class du {
|
|
|
5894
5894
|
}
|
|
5895
5895
|
const o = i.value.largestGroupId();
|
|
5896
5896
|
const c = o !== void 0;
|
|
5897
|
-
const h = new
|
|
5897
|
+
const h = new Xt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
|
|
5898
5898
|
n.largestGroupId = o;
|
|
5899
5899
|
a(this, vt).debug("Renewing subscription", n);
|
|
5900
5900
|
switch (t.filterType.type) {
|
|
@@ -5913,8 +5913,8 @@ const du = class du {
|
|
|
5913
5913
|
e.subscribe(u),
|
|
5914
5914
|
c ? i.value.update(o, o) : i.value.unsubscribe()
|
|
5915
5915
|
]);
|
|
5916
|
-
m.done().then(() => A(this, Ea, Eh).call(this, m)).catch(
|
|
5917
|
-
m.expiryNotification().then(() => a(this, Ta).call(this, e, u)).catch(
|
|
5916
|
+
m.done().then(() => A(this, Ea, Eh).call(this, m)).catch(O);
|
|
5917
|
+
m.expiryNotification().then(() => a(this, Ta).call(this, e, u)).catch(O);
|
|
5918
5918
|
const p = new Fo(m, o);
|
|
5919
5919
|
i.value = p;
|
|
5920
5920
|
yield a(this, Wt).push(p);
|
|
@@ -5933,10 +5933,10 @@ const du = class du {
|
|
|
5933
5933
|
return c.done().then(() => {
|
|
5934
5934
|
var u;
|
|
5935
5935
|
return A(u = h, Ea, Eh).call(u, c);
|
|
5936
|
-
}).catch(
|
|
5936
|
+
}).catch(O), c.expiryNotification().then(() => {
|
|
5937
5937
|
var u;
|
|
5938
5938
|
return a(u = h, Ta).call(u, e, t);
|
|
5939
|
-
}).catch(
|
|
5939
|
+
}).catch(O), h;
|
|
5940
5940
|
});
|
|
5941
5941
|
}
|
|
5942
5942
|
largestGroupId() {
|
|
@@ -6017,7 +6017,7 @@ const du = class du {
|
|
|
6017
6017
|
objects() {
|
|
6018
6018
|
return Rt(this, null, function* () {
|
|
6019
6019
|
try {
|
|
6020
|
-
for (var h = $(this), u, m, p; u = !(m = yield new
|
|
6020
|
+
for (var h = $(this), u, m, p; u = !(m = yield new q(h.next())).done; u = !1) {
|
|
6021
6021
|
var e = m.value;
|
|
6022
6022
|
var t = [];
|
|
6023
6023
|
try {
|
|
@@ -6027,14 +6027,14 @@ const du = class du {
|
|
|
6027
6027
|
var n = i, o = !0;
|
|
6028
6028
|
} finally {
|
|
6029
6029
|
var c = Ge(t, n, o);
|
|
6030
|
-
c && (yield new
|
|
6030
|
+
c && (yield new q(c));
|
|
6031
6031
|
}
|
|
6032
6032
|
}
|
|
6033
6033
|
} catch (m) {
|
|
6034
6034
|
p = [m];
|
|
6035
6035
|
} finally {
|
|
6036
6036
|
try {
|
|
6037
|
-
u && (m = h.return) && (yield new
|
|
6037
|
+
u && (m = h.return) && (yield new q(m.call(h)));
|
|
6038
6038
|
} finally {
|
|
6039
6039
|
if (p)
|
|
6040
6040
|
throw p[0];
|
|
@@ -6065,7 +6065,7 @@ function ju(s) {
|
|
|
6065
6065
|
throw new Error("unexpected catalog type");
|
|
6066
6066
|
return e;
|
|
6067
6067
|
}
|
|
6068
|
-
var mi, Ia, Ca, ka, oc,
|
|
6068
|
+
var mi, Ia, Ca, ka, oc, Ol;
|
|
6069
6069
|
const cc = class cc {
|
|
6070
6070
|
constructor(e, t, i) {
|
|
6071
6071
|
d(this, oc);
|
|
@@ -6073,7 +6073,7 @@ const cc = class cc {
|
|
|
6073
6073
|
d(this, Ia);
|
|
6074
6074
|
d(this, Ca);
|
|
6075
6075
|
d(this, ka);
|
|
6076
|
-
l(this, Ia, e), l(this, mi, t), l(this, Ca, i), l(this, ka, A(this, oc,
|
|
6076
|
+
l(this, Ia, e), l(this, mi, t), l(this, Ca, i), l(this, ka, A(this, oc, Ol).call(this)), this.closed().finally(() => a(this, mi).close()).catch(O);
|
|
6077
6077
|
}
|
|
6078
6078
|
catalog() {
|
|
6079
6079
|
return a(this, mi);
|
|
@@ -6091,7 +6091,7 @@ const cc = class cc {
|
|
|
6091
6091
|
const i = z.fromPromise(
|
|
6092
6092
|
Ii.subscribe(
|
|
6093
6093
|
e,
|
|
6094
|
-
new
|
|
6094
|
+
new Xt().name(t.catalogName || fA).groupOrder("ascending").build()
|
|
6095
6095
|
)
|
|
6096
6096
|
), n = z.fromPromise(i.promise.then((u) => u.objects()));
|
|
6097
6097
|
if (t.catalog)
|
|
@@ -6104,7 +6104,7 @@ const cc = class cc {
|
|
|
6104
6104
|
});
|
|
6105
6105
|
}
|
|
6106
6106
|
};
|
|
6107
|
-
mi = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(), ka = new WeakMap(), oc = new WeakSet(),
|
|
6107
|
+
mi = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(), ka = new WeakMap(), oc = new WeakSet(), Ol = function() {
|
|
6108
6108
|
return f(this, null, function* () {
|
|
6109
6109
|
const e = yield a(this, Ca).promise;
|
|
6110
6110
|
try {
|
|
@@ -6144,16 +6144,16 @@ class pA {
|
|
|
6144
6144
|
const e = { name: this.track.trackObject.name, namespace: this.track.namespace };
|
|
6145
6145
|
a(this, Un).debug("start", v({}, e));
|
|
6146
6146
|
try {
|
|
6147
|
-
for (var t = $(a(this, Rn)), i, n, o; i = !(n = yield new
|
|
6147
|
+
for (var t = $(a(this, Rn)), i, n, o; i = !(n = yield new q(t.next())).done; i = !1) {
|
|
6148
6148
|
const c = n.value;
|
|
6149
|
-
if (c.objectStatus === Te.EndOfTrackAndGroup && (yield new
|
|
6149
|
+
if (c.objectStatus === Te.EndOfTrackAndGroup && (yield new q(this.track.endOfTrack(c.groupId))), c.objectStatus !== Te.Normal)
|
|
6150
6150
|
continue;
|
|
6151
6151
|
const h = a(this, Ra).createFragment(c.payload), u = h.timescale(), m = h.baseMediaDecodeTime() / u * 1e3, p = h.duration() / u * 1e3, g = m + p, w = a(this, Ba) / 1e3 * u;
|
|
6152
6152
|
h.updateBaseMediaDecodeTime(h.baseMediaDecodeTime() - w);
|
|
6153
6153
|
const b = this.track.timestampRange();
|
|
6154
6154
|
if (b && m >= b[1])
|
|
6155
6155
|
break;
|
|
6156
|
-
a(this, Un).debug("fragment",
|
|
6156
|
+
a(this, Un).debug("fragment", M(v({}, e), {
|
|
6157
6157
|
startTime: m,
|
|
6158
6158
|
endTime: g,
|
|
6159
6159
|
subscribeId: c.subscribeId,
|
|
@@ -6166,7 +6166,7 @@ class pA {
|
|
|
6166
6166
|
o = [n];
|
|
6167
6167
|
} finally {
|
|
6168
6168
|
try {
|
|
6169
|
-
i && (n = t.return) && (yield new
|
|
6169
|
+
i && (n = t.return) && (yield new q(n.call(t)));
|
|
6170
6170
|
} finally {
|
|
6171
6171
|
if (o)
|
|
6172
6172
|
throw o[0];
|
|
@@ -6188,7 +6188,7 @@ Ba = new WeakMap(), Rn = new WeakMap(), Ra = new WeakMap(), Un = new WeakMap(),
|
|
|
6188
6188
|
return yield (t = (e = a(this, Rn)).return) == null ? void 0 : t.call(e), Promise.resolve();
|
|
6189
6189
|
});
|
|
6190
6190
|
};
|
|
6191
|
-
var Pa, St, xa, La, hc,
|
|
6191
|
+
var Pa, St, xa, La, hc, Ml;
|
|
6192
6192
|
const Vs = class Vs {
|
|
6193
6193
|
constructor(e, t, i, n, o) {
|
|
6194
6194
|
d(this, Pa);
|
|
@@ -6210,18 +6210,18 @@ const Vs = class Vs {
|
|
|
6210
6210
|
var S;
|
|
6211
6211
|
if (t.format !== "cmaf")
|
|
6212
6212
|
throw new Error("format must be cmaf");
|
|
6213
|
-
const m = new
|
|
6213
|
+
const m = new Xt().name(t.name);
|
|
6214
6214
|
n && m.startGroup(n);
|
|
6215
6215
|
const p = m.build();
|
|
6216
6216
|
if (t.initTrack) {
|
|
6217
|
-
const I = new
|
|
6218
|
-
A(S = Vs, hc,
|
|
6217
|
+
const I = new Xt().name(t.initTrack).build(), [k, D] = yield Promise.all([
|
|
6218
|
+
A(S = Vs, hc, Ml).call(S, e, I),
|
|
6219
6219
|
Ii.subscribe(e, p, { params: o, largestGroupId: n ? n - U(1) : void 0 })
|
|
6220
|
-
]), T = new
|
|
6220
|
+
]), T = new Ou(k);
|
|
6221
6221
|
return new Vs(t, e.namespace(), D, T, i);
|
|
6222
6222
|
}
|
|
6223
|
-
|
|
6224
|
-
const g = Td(t.initData), w = new
|
|
6223
|
+
Xe(t.initData, "no init data found on track");
|
|
6224
|
+
const g = Td(t.initData), w = new Ou(new Uint8Array(g)), b = yield Ii.subscribe(e, p, {
|
|
6225
6225
|
params: o,
|
|
6226
6226
|
largestGroupId: n ? n - U(1) : void 0
|
|
6227
6227
|
});
|
|
@@ -6274,7 +6274,7 @@ const Vs = class Vs {
|
|
|
6274
6274
|
});
|
|
6275
6275
|
}
|
|
6276
6276
|
};
|
|
6277
|
-
Pa = new WeakMap(), St = new WeakMap(), xa = new WeakMap(), La = new WeakMap(), hc = new WeakSet(),
|
|
6277
|
+
Pa = new WeakMap(), St = new WeakMap(), xa = new WeakMap(), La = new WeakMap(), hc = new WeakSet(), Ml = function(e, t) {
|
|
6278
6278
|
return f(this, null, function* () {
|
|
6279
6279
|
var o = [];
|
|
6280
6280
|
try {
|
|
@@ -6294,7 +6294,7 @@ Pa = new WeakMap(), St = new WeakMap(), xa = new WeakMap(), La = new WeakMap(),
|
|
|
6294
6294
|
}, d(Vs, hc);
|
|
6295
6295
|
let Ch = Vs;
|
|
6296
6296
|
const Wu = 1e4, gA = 3e4;
|
|
6297
|
-
var uc, fi, os, Da,
|
|
6297
|
+
var uc, fi, os, Da, Oa, Ma, Ts, Bh, Fl;
|
|
6298
6298
|
const lu = class lu {
|
|
6299
6299
|
constructor(e, t, i) {
|
|
6300
6300
|
d(this, Ts);
|
|
@@ -6302,12 +6302,12 @@ const lu = class lu {
|
|
|
6302
6302
|
d(this, fi, new Ie([]));
|
|
6303
6303
|
d(this, os);
|
|
6304
6304
|
d(this, Da);
|
|
6305
|
-
d(this, Ma);
|
|
6306
6305
|
d(this, Oa);
|
|
6307
|
-
|
|
6306
|
+
d(this, Ma);
|
|
6307
|
+
l(this, Da, e), l(this, Oa, i), l(this, os, t), l(this, Ma, A(this, Ts, Bh).call(this, a(this, os))), this.closed().finally(() => a(this, fi).close()).catch(O);
|
|
6308
6308
|
}
|
|
6309
6309
|
closed() {
|
|
6310
|
-
return a(this,
|
|
6310
|
+
return a(this, Ma);
|
|
6311
6311
|
}
|
|
6312
6312
|
close() {
|
|
6313
6313
|
return f(this, null, function* () {
|
|
@@ -6323,11 +6323,11 @@ const lu = class lu {
|
|
|
6323
6323
|
* This is useful for time aligning two streams based on the common wallclock time
|
|
6324
6324
|
*/
|
|
6325
6325
|
timestampWallclockOffset() {
|
|
6326
|
-
return
|
|
6326
|
+
return Qt(this.timeline().map((e) => e.mediaPts - e.wallclock));
|
|
6327
6327
|
}
|
|
6328
6328
|
static start(e, t) {
|
|
6329
6329
|
const i = z.fromPromise(
|
|
6330
|
-
Ii.subscribe(e, new
|
|
6330
|
+
Ii.subscribe(e, new Xt().name(t).groupOrder("ascending").build())
|
|
6331
6331
|
);
|
|
6332
6332
|
return new lu(e, i, t);
|
|
6333
6333
|
}
|
|
@@ -6345,11 +6345,11 @@ const lu = class lu {
|
|
|
6345
6345
|
});
|
|
6346
6346
|
}
|
|
6347
6347
|
};
|
|
6348
|
-
uc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
|
|
6348
|
+
uc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(), Oa = new WeakMap(), Ma = new WeakMap(), Ts = new WeakSet(), Bh = function(e) {
|
|
6349
6349
|
return f(this, null, function* () {
|
|
6350
6350
|
const t = yield e.promise;
|
|
6351
6351
|
try {
|
|
6352
|
-
for (var b = $(t), S, I,
|
|
6352
|
+
for (var b = $(t), S, I, k; S = !(I = yield b.next()).done; S = !1) {
|
|
6353
6353
|
var h = I.value;
|
|
6354
6354
|
var u = [];
|
|
6355
6355
|
try {
|
|
@@ -6361,8 +6361,8 @@ uc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
|
|
|
6361
6361
|
continue;
|
|
6362
6362
|
const P = AA(T.payload);
|
|
6363
6363
|
a(this, fi).update((R) => {
|
|
6364
|
-
var
|
|
6365
|
-
for (R.push(...P), R.sort((Fe, te) => Fe.wallclock - te.wallclock); R[0] && ((
|
|
6364
|
+
var X, Q;
|
|
6365
|
+
for (R.push(...P), R.sort((Fe, te) => Fe.wallclock - te.wallclock); R[0] && ((Q = (X = R[R.length - 1]) == null ? void 0 : X.wallclock) != null ? Q : 0) - R[0].wallclock > gA; )
|
|
6366
6366
|
R.shift();
|
|
6367
6367
|
return R;
|
|
6368
6368
|
}), t === a(this, os).resolved && T.groupId > U(0) && T.objectId == U(0) && A(this, Ts, Fl).call(this, T.groupId).catch((R) => {
|
|
@@ -6387,13 +6387,13 @@ uc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
|
|
|
6387
6387
|
}
|
|
6388
6388
|
}
|
|
6389
6389
|
} catch (I) {
|
|
6390
|
-
|
|
6390
|
+
k = [I];
|
|
6391
6391
|
} finally {
|
|
6392
6392
|
try {
|
|
6393
6393
|
S && (I = b.return) && (yield I.call(b));
|
|
6394
6394
|
} finally {
|
|
6395
|
-
if (
|
|
6396
|
-
throw
|
|
6395
|
+
if (k)
|
|
6396
|
+
throw k[0];
|
|
6397
6397
|
}
|
|
6398
6398
|
}
|
|
6399
6399
|
});
|
|
@@ -6405,7 +6405,7 @@ uc = new WeakMap(), fi = new WeakMap(), os = new WeakMap(), Da = new WeakMap(),
|
|
|
6405
6405
|
const c = z.fromPromise(
|
|
6406
6406
|
Ii.subscribe(
|
|
6407
6407
|
a(this, Da),
|
|
6408
|
-
new
|
|
6408
|
+
new Xt().name(a(this, Oa)).groupOrder("ascending").range(t, t).build()
|
|
6409
6409
|
)
|
|
6410
6410
|
);
|
|
6411
6411
|
return A(this, Ts, Bh).call(this, c);
|
|
@@ -6435,7 +6435,7 @@ function wA(s) {
|
|
|
6435
6435
|
var dc, Fa, pi, Pn;
|
|
6436
6436
|
const mu = class mu {
|
|
6437
6437
|
constructor(e, t, i, n, o) {
|
|
6438
|
-
d(this, dc, new
|
|
6438
|
+
d(this, dc, new qd());
|
|
6439
6439
|
d(this, Fa);
|
|
6440
6440
|
d(this, pi);
|
|
6441
6441
|
d(this, Pn, 0);
|
|
@@ -6447,7 +6447,7 @@ const mu = class mu {
|
|
|
6447
6447
|
return f(this, null, function* () {
|
|
6448
6448
|
if (!wA(t))
|
|
6449
6449
|
throw new Error("track object language is required");
|
|
6450
|
-
const n = new
|
|
6450
|
+
const n = new Xt().name(t.name).build(), o = yield Ii.subscribe(e, n), c = o.objects();
|
|
6451
6451
|
return new mu(o, c, t, e.namespace(), i);
|
|
6452
6452
|
});
|
|
6453
6453
|
}
|
|
@@ -6564,7 +6564,7 @@ ah = Ci(null), cs = new WeakMap(), hs = new WeakMap(), us = new WeakMap(), gi =
|
|
|
6564
6564
|
throw n;
|
|
6565
6565
|
}
|
|
6566
6566
|
});
|
|
6567
|
-
}, ye(ah, 9, "start", Ad, Gs),
|
|
6567
|
+
}, ye(ah, 9, "start", Ad, Gs), Jt(ah, Gs), ki(ah, 3, Gs);
|
|
6568
6568
|
let _o = Gs;
|
|
6569
6569
|
const bA = U(8);
|
|
6570
6570
|
function yA(s) {
|
|
@@ -6642,7 +6642,7 @@ function EA(s) {
|
|
|
6642
6642
|
if (!vA(t))
|
|
6643
6643
|
throw new Error("Invalid drm object");
|
|
6644
6644
|
const o = t, { fairplayCertificate: i } = o, n = yu(o, ["fairplayCertificate"]);
|
|
6645
|
-
return
|
|
6645
|
+
return M(v({}, n), {
|
|
6646
6646
|
fairplayCertificate: i ? SA(i) : void 0
|
|
6647
6647
|
});
|
|
6648
6648
|
}
|
|
@@ -6655,13 +6655,13 @@ class au {
|
|
|
6655
6655
|
return f(this, null, function* () {
|
|
6656
6656
|
var u = [];
|
|
6657
6657
|
try {
|
|
6658
|
-
const n = Ve(u, yield e.subscribeTrack(new
|
|
6658
|
+
const n = Ve(u, yield e.subscribeTrack(new Xt().name("drm").build()), !0);
|
|
6659
6659
|
const o = n.objects();
|
|
6660
6660
|
const c = yield o.next();
|
|
6661
6661
|
if (c.done)
|
|
6662
6662
|
throw new Error("No drm object received");
|
|
6663
6663
|
const h = EA(c.value.payload);
|
|
6664
|
-
return new au(
|
|
6664
|
+
return new au(M(v({}, h), { videoCodec: t, audioCodec: i }));
|
|
6665
6665
|
} catch (m) {
|
|
6666
6666
|
var p = m, g = !0;
|
|
6667
6667
|
} finally {
|
|
@@ -6707,7 +6707,7 @@ const pu = class pu {
|
|
|
6707
6707
|
}
|
|
6708
6708
|
static start(e) {
|
|
6709
6709
|
return f(this, null, function* () {
|
|
6710
|
-
const i = (yield e.subscribe(new
|
|
6710
|
+
const i = (yield e.subscribe(new Xt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
|
|
6711
6711
|
if (n.done)
|
|
6712
6712
|
throw new Error("No stats object received");
|
|
6713
6713
|
const o = zu(n.value.payload);
|
|
@@ -6783,7 +6783,7 @@ class Kc {
|
|
|
6783
6783
|
return Rt(this, null, function* () {
|
|
6784
6784
|
const e = a(this, Ga);
|
|
6785
6785
|
try {
|
|
6786
|
-
for (var t = $(a(this, Va)), i, n, o; i = !(n = yield new
|
|
6786
|
+
for (var t = $(a(this, Va)), i, n, o; i = !(n = yield new q(t.next())).done; i = !1) {
|
|
6787
6787
|
const c = n.value;
|
|
6788
6788
|
if (!c)
|
|
6789
6789
|
continue;
|
|
@@ -6797,7 +6797,7 @@ class Kc {
|
|
|
6797
6797
|
o = [n];
|
|
6798
6798
|
} finally {
|
|
6799
6799
|
try {
|
|
6800
|
-
i && (n = t.return) && (yield new
|
|
6800
|
+
i && (n = t.return) && (yield new q(n.call(t)));
|
|
6801
6801
|
} finally {
|
|
6802
6802
|
if (o)
|
|
6803
6803
|
throw o[0];
|
|
@@ -6808,14 +6808,14 @@ class Kc {
|
|
|
6808
6808
|
}
|
|
6809
6809
|
}
|
|
6810
6810
|
Dn = new WeakMap(), Va = new WeakMap(), Ga = new WeakMap();
|
|
6811
|
-
var wd, bd, yd,
|
|
6811
|
+
var wd, bd, yd, On, Mn, ls, fe, at, ot, Ai, Fn, ja, tr, Ce, uo, ar, Vl, Lh;
|
|
6812
6812
|
yd = [Pe({ context: "Player", enter: "info" })], bd = [Pe({ context: "Player", enter: "info", return: "info" })], wd = [Pe({ context: "Player", enter: "info" })];
|
|
6813
6813
|
const js = class js {
|
|
6814
6814
|
constructor(e, t, i) {
|
|
6815
6815
|
ki(tr, 5, this);
|
|
6816
6816
|
d(this, Ce);
|
|
6817
|
-
d(this, Mn);
|
|
6818
6817
|
d(this, On);
|
|
6818
|
+
d(this, Mn);
|
|
6819
6819
|
d(this, ls);
|
|
6820
6820
|
d(this, fe);
|
|
6821
6821
|
d(this, at, new Ie(void 0));
|
|
@@ -6826,7 +6826,7 @@ const js = class js {
|
|
|
6826
6826
|
r(this, "subtitles", new Kc(a(this, Ai), "subtitles"));
|
|
6827
6827
|
r(this, "video", new Kc(a(this, ot), "video"));
|
|
6828
6828
|
r(this, "audio", new Kc(a(this, at), "audio"));
|
|
6829
|
-
l(this,
|
|
6829
|
+
l(this, On, e), l(this, Mn, Uh.start(i)), l(this, ls, i), l(this, fe, new Ie(t)), l(this, Fn, new CA(t)), l(this, ja, Promise.race([i.idleTimeout(), A(this, Ce, Vl).call(this), a(this, Fn).closed()])), a(this, On).closed().then(() => this.close()).catch(O);
|
|
6830
6830
|
}
|
|
6831
6831
|
closed() {
|
|
6832
6832
|
return a(this, ja);
|
|
@@ -6875,7 +6875,7 @@ const js = class js {
|
|
|
6875
6875
|
return (e = a(this, at).current()) == null ? void 0 : e.trackObject;
|
|
6876
6876
|
}
|
|
6877
6877
|
referenceClock() {
|
|
6878
|
-
return a(this,
|
|
6878
|
+
return a(this, Mn);
|
|
6879
6879
|
}
|
|
6880
6880
|
drm() {
|
|
6881
6881
|
return f(this, null, function* () {
|
|
@@ -6899,9 +6899,9 @@ const js = class js {
|
|
|
6899
6899
|
zap(e, t) {
|
|
6900
6900
|
return f(this, null, function* () {
|
|
6901
6901
|
var S, I;
|
|
6902
|
-
const i = yield _o.start(a(this,
|
|
6902
|
+
const i = yield _o.start(a(this, On), e), n = a(this, Mn).wallclock() - t, o = a(this, fe).current(), c = o.timestampWallclockOffset(), h = yield i.waitForWallclockTime(n);
|
|
6903
6903
|
a(this, Fn).update(i), yield a(this, fe).current().close();
|
|
6904
|
-
const u = h.toReversed().find((
|
|
6904
|
+
const u = h.toReversed().find((k) => k.wallclock <= n), m = u != null && u.mediaPts ? u.mediaPts - o.timestampOffsetMs() : void 0, w = i.timestampWallclockOffset() - c + o.timestampOffsetMs();
|
|
6905
6905
|
i.setTimestampOffsetMs(w);
|
|
6906
6906
|
const b = u != null && u.groupId ? U(u.groupId) : void 0;
|
|
6907
6907
|
m && ((S = a(this, ot).current()) == null || S.stopAfterTimestampReached(m), (I = a(this, at).current()) == null || I.stopAfterTimestampReached(m)), a(this, fe).update(i), yield Promise.all([
|
|
@@ -6937,7 +6937,7 @@ const js = class js {
|
|
|
6937
6937
|
});
|
|
6938
6938
|
}
|
|
6939
6939
|
};
|
|
6940
|
-
tr = Ci(null),
|
|
6940
|
+
tr = Ci(null), On = new WeakMap(), Mn = new WeakMap(), ls = new WeakMap(), fe = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), Ai = new WeakMap(), Fn = new WeakMap(), ja = new WeakMap(), Ce = new WeakSet(), uo = function(e) {
|
|
6941
6941
|
const t = e.current(), i = t == null ? void 0 : t.largestGroupId();
|
|
6942
6942
|
return e.isClosed() || e.update(void 0), e.close(), i ? t == null ? void 0 : t.update(i, i) : t == null ? void 0 : t.unsubscribe();
|
|
6943
6943
|
}, ar = function(e, t, i, n) {
|
|
@@ -6999,20 +6999,20 @@ tr = Ci(null), Mn = new WeakMap(), On = new WeakMap(), ls = new WeakMap(), fe =
|
|
|
6999
6999
|
t.update(yield a(this, fe).current().subscribeCmafTrack(h));
|
|
7000
7000
|
}
|
|
7001
7001
|
});
|
|
7002
|
-
}, ye(tr, 1, "close", yd, js), ye(tr, 1, "zap", bd, js), ar = ye(tr, 17, "#replaceTrack", wd, Ce, ar),
|
|
7002
|
+
}, ye(tr, 1, "close", yd, js), ye(tr, 1, "zap", bd, js), ar = ye(tr, 17, "#replaceTrack", wd, Ce, ar), Jt(tr, js);
|
|
7003
7003
|
let xh = js;
|
|
7004
7004
|
function eh(s, e, t) {
|
|
7005
7005
|
const i = new URL("/voq/subscribe", s);
|
|
7006
7006
|
return i.searchParams.set("sessionId", e.sessionId), i.searchParams.set("clientId", e.clientId), i.searchParams.set("channelId", e.channelId), t && i.searchParams.set("authToken", t), i;
|
|
7007
7007
|
}
|
|
7008
7008
|
const kA = 1e4;
|
|
7009
|
-
var me, Se,
|
|
7009
|
+
var me, Se, Qe, ms, K, wi, Wa, _n, za, Nn, ke, Gl, Vn, Ha, Gn, jl, Wl, zl, Hl, Oh;
|
|
7010
7010
|
const gu = class gu {
|
|
7011
7011
|
constructor(e, t, i, n, o, c, h) {
|
|
7012
7012
|
d(this, ke);
|
|
7013
7013
|
d(this, me);
|
|
7014
7014
|
d(this, Se);
|
|
7015
|
-
d(this,
|
|
7015
|
+
d(this, Qe);
|
|
7016
7016
|
d(this, ms, "disconnected");
|
|
7017
7017
|
d(this, K);
|
|
7018
7018
|
d(this, wi, /* @__PURE__ */ new Map());
|
|
@@ -7022,11 +7022,11 @@ const gu = class gu {
|
|
|
7022
7022
|
d(this, Nn, /* @__PURE__ */ new Map());
|
|
7023
7023
|
d(this, Vn, (e) => {
|
|
7024
7024
|
if (!e) {
|
|
7025
|
-
a(this, K).setSubtitleTrack(void 0).catch(
|
|
7025
|
+
a(this, K).setSubtitleTrack(void 0).catch(O);
|
|
7026
7026
|
return;
|
|
7027
7027
|
}
|
|
7028
7028
|
const t = a(this, wi).get(Bi(a(this, K).namespace())), i = t == null ? void 0 : t.getTextTrack(e);
|
|
7029
|
-
i && a(this, K).setSubtitleTrack(i).catch(
|
|
7029
|
+
i && a(this, K).setSubtitleTrack(i).catch(O);
|
|
7030
7030
|
});
|
|
7031
7031
|
d(this, Ha, (e) => {
|
|
7032
7032
|
switch (e.type) {
|
|
@@ -7046,21 +7046,21 @@ const gu = class gu {
|
|
|
7046
7046
|
}
|
|
7047
7047
|
break;
|
|
7048
7048
|
case "telemetry":
|
|
7049
|
-
vd(new URL("/api/telemetry", a(this,
|
|
7049
|
+
vd(new URL("/api/telemetry", a(this, Qe).url().replace("wss://", "https://")), {
|
|
7050
7050
|
body: e.body,
|
|
7051
7051
|
headers: { "Content-Type": "text/plain" }
|
|
7052
|
-
}).catch(
|
|
7052
|
+
}).catch(O);
|
|
7053
7053
|
break;
|
|
7054
7054
|
case "refresh auth":
|
|
7055
|
-
a(this,
|
|
7055
|
+
a(this, Qe).updateAuthToken(e.token);
|
|
7056
7056
|
break;
|
|
7057
7057
|
}
|
|
7058
7058
|
});
|
|
7059
7059
|
d(this, Gn, !1);
|
|
7060
7060
|
r(this, "disconnect", (e = "Disconnect Requested") => {
|
|
7061
|
-
a(this, Se).info("Disconnecting", e), a(this,
|
|
7061
|
+
a(this, Se).info("Disconnecting", e), a(this, Qe).close(), a(this, K).close().catch(O), l(this, Nn, /* @__PURE__ */ new Map()), l(this, ms, "disconnected");
|
|
7062
7062
|
});
|
|
7063
|
-
l(this, me, e), l(this, Se, t), l(this,
|
|
7063
|
+
l(this, me, e), l(this, Se, t), l(this, Qe, i), l(this, K, n), l(this, wi, o), l(this, Wa, c), l(this, _n, h), a(this, me).on("send signal", a(this, Ha)), a(this, me).on("disconnect", this.disconnect), a(this, me).on("text track", a(this, Vn)), A(this, ke, Gl).call(this).catch(O), A(this, ke, zl).call(this).catch(O);
|
|
7064
7064
|
}
|
|
7065
7065
|
get estimatedBandwidth() {
|
|
7066
7066
|
return a(this, za);
|
|
@@ -7074,17 +7074,17 @@ const gu = class gu {
|
|
|
7074
7074
|
}
|
|
7075
7075
|
getStatistics() {
|
|
7076
7076
|
return {
|
|
7077
|
-
edgeUrl: a(this,
|
|
7077
|
+
edgeUrl: a(this, Qe).url(),
|
|
7078
7078
|
connectionProtocol: "moq"
|
|
7079
7079
|
};
|
|
7080
7080
|
}
|
|
7081
7081
|
static start(e, t, i, n, o) {
|
|
7082
7082
|
return f(this, null, function* () {
|
|
7083
|
-
var T, P, R,
|
|
7083
|
+
var T, P, R, X;
|
|
7084
7084
|
const c = new Map(
|
|
7085
|
-
n.connectInfo.channels.map((
|
|
7086
|
-
Bi(
|
|
7087
|
-
new th(new Ie(
|
|
7085
|
+
n.connectInfo.channels.map((Q) => [
|
|
7086
|
+
Bi(Q.catalog.namespace),
|
|
7087
|
+
new th(new Ie(Q.catalog))
|
|
7088
7088
|
])
|
|
7089
7089
|
), h = yield n.onConnectInfo(n.connectInfo), u = n.options.get("authenticationToken");
|
|
7090
7090
|
let m, p;
|
|
@@ -7097,8 +7097,8 @@ const gu = class gu {
|
|
|
7097
7097
|
m = eh(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, h, u), p = eh(n.edgeUrl.moqWsUrl, h, u);
|
|
7098
7098
|
break;
|
|
7099
7099
|
}
|
|
7100
|
-
const g = (T = n.connectInfo.channels.find((
|
|
7101
|
-
t.debug("Resolved edge url", { edgeUrl: m, edgeWsUrl: p }),
|
|
7100
|
+
const g = (T = n.connectInfo.channels.find((Q) => Q.channelId === h.channelId)) == null ? void 0 : T.catalog;
|
|
7101
|
+
t.debug("Resolved edge url", { edgeUrl: m, edgeWsUrl: p }), Xe(g, "no catalog found");
|
|
7102
7102
|
const w = (P = c.get(Bi(g.namespace))) == null ? void 0 : P.getVideoTrack(h.video), b = (R = c.get(Bi(g.namespace))) == null ? void 0 : R.getAudioTrack(h.audio), S = yield uA({
|
|
7103
7103
|
url: m,
|
|
7104
7104
|
wsUrl: p,
|
|
@@ -7116,36 +7116,36 @@ const gu = class gu {
|
|
|
7116
7116
|
}),
|
|
7117
7117
|
su(kA, new Error("Timeout waiting for player to start")),
|
|
7118
7118
|
Lm(S.closed(), "Session closed before player started")
|
|
7119
|
-
]),
|
|
7120
|
-
c.set(Bi(g.namespace),
|
|
7119
|
+
]), k = new th(I.catalog());
|
|
7120
|
+
c.set(Bi(g.namespace), k), e.emit("received signal", {
|
|
7121
7121
|
type: "client ip",
|
|
7122
7122
|
ip: I.connectionInfo().ip
|
|
7123
|
-
}), I.drm().then((
|
|
7124
|
-
|
|
7125
|
-
}).catch((
|
|
7126
|
-
t.error("Error getting DRM data",
|
|
7123
|
+
}), I.drm().then((Q) => {
|
|
7124
|
+
Q && e.emit("received drm data", Q.value);
|
|
7125
|
+
}).catch((Q) => {
|
|
7126
|
+
t.error("Error getting DRM data", Q);
|
|
7127
7127
|
});
|
|
7128
7128
|
const D = new gu(e, t, S, I, c, i, o);
|
|
7129
|
-
return h.textTrack && a(
|
|
7129
|
+
return h.textTrack && a(X = D, Vn).call(X, h.textTrack), D;
|
|
7130
7130
|
});
|
|
7131
7131
|
}
|
|
7132
7132
|
getState() {
|
|
7133
7133
|
return a(this, ms);
|
|
7134
7134
|
}
|
|
7135
7135
|
close() {
|
|
7136
|
-
a(this,
|
|
7136
|
+
a(this, Qe).close();
|
|
7137
7137
|
}
|
|
7138
7138
|
closed() {
|
|
7139
|
-
return Promise.race([a(this,
|
|
7139
|
+
return Promise.race([a(this, Qe).closed(), a(this, K).closed()]);
|
|
7140
7140
|
}
|
|
7141
7141
|
};
|
|
7142
|
-
me = new WeakMap(), Se = new WeakMap(),
|
|
7142
|
+
me = new WeakMap(), Se = new WeakMap(), Qe = new WeakMap(), ms = new WeakMap(), K = new WeakMap(), wi = new WeakMap(), Wa = new WeakMap(), _n = new WeakMap(), za = new WeakMap(), Nn = new WeakMap(), ke = new WeakSet(), Gl = function() {
|
|
7143
7143
|
return f(this, null, function* () {
|
|
7144
|
-
a(this,
|
|
7144
|
+
a(this, Qe).transportType() === "websocket" && (yield Ti(5e3));
|
|
7145
7145
|
try {
|
|
7146
7146
|
for (var e = $(a(this, K).stats()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
7147
7147
|
const { rtt: o, estimatedBandwidth: c } = i.value;
|
|
7148
|
-
l(this, za, c), a(this, _n).push(o), a(this, me).emit("rtt",
|
|
7148
|
+
l(this, za, c), a(this, _n).push(o), a(this, me).emit("rtt", Qt(a(this, _n).items()));
|
|
7149
7149
|
}
|
|
7150
7150
|
} catch (i) {
|
|
7151
7151
|
n = [i];
|
|
@@ -7209,10 +7209,10 @@ me = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ms = new WeakMap(),
|
|
|
7209
7209
|
return f(this, null, function* () {
|
|
7210
7210
|
try {
|
|
7211
7211
|
l(this, ms, "connecting"), a(this, Se).info("Connecting..."), l(this, ms, "connected"), yield Promise.all([
|
|
7212
|
-
A(this, ke,
|
|
7213
|
-
A(this, ke,
|
|
7212
|
+
A(this, ke, Oh).call(this, a(this, K).referenceClock(), a(this, K).audio),
|
|
7213
|
+
A(this, ke, Oh).call(this, a(this, K).referenceClock(), a(this, K).video),
|
|
7214
7214
|
A(this, ke, Hl).call(this, a(this, K).subtitles)
|
|
7215
|
-
]), yield a(this, K).closed(), a(this,
|
|
7215
|
+
]), yield a(this, K).closed(), a(this, Qe).close(), a(this, Se).info("Session closed");
|
|
7216
7216
|
} catch (e) {
|
|
7217
7217
|
a(this, Se).warn("Session error", e);
|
|
7218
7218
|
}
|
|
@@ -7235,27 +7235,27 @@ me = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ms = new WeakMap(),
|
|
|
7235
7235
|
}
|
|
7236
7236
|
}
|
|
7237
7237
|
});
|
|
7238
|
-
},
|
|
7238
|
+
}, Oh = function(e, t) {
|
|
7239
7239
|
return f(this, null, function* () {
|
|
7240
7240
|
var h;
|
|
7241
7241
|
let i = "", n = "", o;
|
|
7242
7242
|
const c = a(this, K).videoTrack() === void 0;
|
|
7243
7243
|
try {
|
|
7244
7244
|
for (var w = $(t), b, S, I; b = !(S = yield w.next()).done; b = !1) {
|
|
7245
|
-
const
|
|
7246
|
-
const D = Bi(
|
|
7245
|
+
const k = S.value;
|
|
7246
|
+
const D = Bi(k.track.namespace), T = k.track.trackObject.language, P = dm((h = k.track.trackObject.codec) != null ? h : ""), R = k.track.trackObject.codec, X = P ? Oi({ codec: P, codecString: R }) : void 0, Q = !!k.track.trackObject["com.vindral.drm"];
|
|
7247
7247
|
try {
|
|
7248
|
-
for (var u = $(
|
|
7248
|
+
for (var u = $(k), m, p, g; m = !(p = yield u.next()).done; m = !1) {
|
|
7249
7249
|
const [Fe, te] = p.value;
|
|
7250
7250
|
const ht = {
|
|
7251
7251
|
channelId: i !== "" && (c || te.mediaType() === "video") && i !== D ? D : void 0,
|
|
7252
7252
|
language: te.mediaType() === "audio" && n !== T ? T : void 0,
|
|
7253
|
-
drmTransition: o !== void 0 && o !==
|
|
7253
|
+
drmTransition: o !== void 0 && o !== Q
|
|
7254
7254
|
};
|
|
7255
|
-
i = D, n = T, o =
|
|
7256
|
-
const Be = te.producerReferenceTime(), y = a(this, Nn).get(
|
|
7255
|
+
i = D, n = T, o = Q;
|
|
7256
|
+
const Be = te.producerReferenceTime(), y = a(this, Nn).get(k.track.namespace) || 0;
|
|
7257
7257
|
if (Be && Date.now() - y > 1e3) {
|
|
7258
|
-
a(this, Nn).set(
|
|
7258
|
+
a(this, Nn).set(k.track.namespace, Date.now());
|
|
7259
7259
|
const E = e.wallclock() - Be.getTime();
|
|
7260
7260
|
a(this, Se).debug("timing-info", {
|
|
7261
7261
|
mediaType: te.mediaType(),
|
|
@@ -7277,11 +7277,11 @@ me = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ms = new WeakMap(),
|
|
|
7277
7277
|
payload: te,
|
|
7278
7278
|
channelId: D,
|
|
7279
7279
|
groupId: Fe,
|
|
7280
|
-
mimeType:
|
|
7280
|
+
mimeType: X,
|
|
7281
7281
|
codec: P,
|
|
7282
7282
|
switchInfo: ht,
|
|
7283
7283
|
// FIXME: We should replace this with something better than hashing the track name
|
|
7284
|
-
renditionId: BA(
|
|
7284
|
+
renditionId: BA(k.track.trackObject.name)
|
|
7285
7285
|
});
|
|
7286
7286
|
}
|
|
7287
7287
|
} catch (p) {
|
|
@@ -7314,13 +7314,13 @@ function BA(s) {
|
|
|
7314
7314
|
0
|
|
7315
7315
|
);
|
|
7316
7316
|
}
|
|
7317
|
-
var zt, fs, pc,
|
|
7317
|
+
var zt, fs, pc, Ql;
|
|
7318
7318
|
class th {
|
|
7319
7319
|
constructor(e) {
|
|
7320
7320
|
d(this, pc);
|
|
7321
7321
|
d(this, zt);
|
|
7322
7322
|
d(this, fs);
|
|
7323
|
-
l(this, zt, e), l(this, fs, A(this, pc,
|
|
7323
|
+
l(this, zt, e), l(this, fs, A(this, pc, Ql).call(this));
|
|
7324
7324
|
}
|
|
7325
7325
|
catalog() {
|
|
7326
7326
|
return a(this, zt).current();
|
|
@@ -7350,7 +7350,7 @@ class th {
|
|
|
7350
7350
|
return a(this, fs);
|
|
7351
7351
|
}
|
|
7352
7352
|
}
|
|
7353
|
-
zt = new WeakMap(), fs = new WeakMap(), pc = new WeakSet(),
|
|
7353
|
+
zt = new WeakMap(), fs = new WeakMap(), pc = new WeakSet(), Ql = function() {
|
|
7354
7354
|
const [e, t] = a(this, zt).value();
|
|
7355
7355
|
return lm(e);
|
|
7356
7356
|
};
|
|
@@ -7398,7 +7398,7 @@ class UA extends Ei {
|
|
|
7398
7398
|
var n;
|
|
7399
7399
|
let i = !1;
|
|
7400
7400
|
return (n = this.websockets) == null || n.forEach((o) => {
|
|
7401
|
-
o.onmessage =
|
|
7401
|
+
o.onmessage = O, o.removeEventListener("error", this.onError), o.removeEventListener("close", this.onClose), o.removeEventListener("open", this.onOpen), o.close(1e3, t), i = !0;
|
|
7402
7402
|
}), this.websockets = [], this.shouldContinueConnecting = !1, this._isConnectInProgress = !1, this.logger.info("Closed websocket", { reason: t }), i;
|
|
7403
7403
|
});
|
|
7404
7404
|
r(this, "suspend", () => {
|
|
@@ -7414,7 +7414,7 @@ class UA extends Ei {
|
|
|
7414
7414
|
this.logger.info("On error", v({}, this.options)), this.close("one websocket had an error"), this.emit("error", new x("WebSocket error", { code: "websocket_error", isFatal: !1 }));
|
|
7415
7415
|
});
|
|
7416
7416
|
r(this, "onClose", (t) => {
|
|
7417
|
-
switch (this.logger.info("Closed",
|
|
7417
|
+
switch (this.logger.info("Closed", M(v({}, this.options), {
|
|
7418
7418
|
reason: t.reason,
|
|
7419
7419
|
code: t.code,
|
|
7420
7420
|
isSuspended: this.isSuspended
|
|
@@ -7462,7 +7462,7 @@ class UA extends Ei {
|
|
|
7462
7462
|
const { url: i, connectionCount: n } = yield this.options.connectHandler();
|
|
7463
7463
|
if (this.connectStartTime = Date.now(), !this.shouldContinueConnecting)
|
|
7464
7464
|
return this._isConnectInProgress = !1, this.logger.info("Connection aborted"), !1;
|
|
7465
|
-
this.logger.info("Connecting websockets",
|
|
7465
|
+
this.logger.info("Connecting websockets", M(v({}, this.options), { url: i }));
|
|
7466
7466
|
for (let o = 0; o < n; o++) {
|
|
7467
7467
|
const c = new WebSocket(i);
|
|
7468
7468
|
c.binaryType = "arraybuffer", c.onmessage = (h) => this.onMessage(o, h), c.addEventListener("error", this.onError), c.addEventListener("close", this.onClose), c.addEventListener("open", this.onOpen), this.websockets.push(c);
|
|
@@ -7592,7 +7592,7 @@ const PA = 65536 * 8, xA = 0.9, LA = (s) => PA * xA * 1e3 / s, lt = class lt {
|
|
|
7592
7592
|
return;
|
|
7593
7593
|
switch (i.type) {
|
|
7594
7594
|
case "pong":
|
|
7595
|
-
this.lastPingSentTime && (this.rtts.push(Date.now() - this.lastPingSentTime), this.isPingInFlight = !1, this.emitter.emit("rtt",
|
|
7595
|
+
this.lastPingSentTime && (this.rtts.push(Date.now() - this.lastPingSentTime), this.isPingInFlight = !1, this.emitter.emit("rtt", Qt(this.rtts.items())));
|
|
7596
7596
|
break;
|
|
7597
7597
|
case "context switch":
|
|
7598
7598
|
this.logger.info("Starting context switch", { socketId: e }), this.emitter.emit("context switch started"), this.contextSwitchesInProgress.add(e);
|
|
@@ -7625,7 +7625,7 @@ const PA = 65536 * 8, xA = 0.9, LA = (s) => PA * xA * 1e3 / s, lt = class lt {
|
|
|
7625
7625
|
case "connected":
|
|
7626
7626
|
(e = this.transport) != null && e.connectTime && (this.rtts.push(
|
|
7627
7627
|
this.transport.connectTime / lt.TLS_ROUNDTRIPS / this.transport.connectionCount
|
|
7628
|
-
), this.emitter.emit("rtt",
|
|
7628
|
+
), this.emitter.emit("rtt", Qt(this.rtts.items()))), this.connectCount++, this.resetPingState();
|
|
7629
7629
|
break;
|
|
7630
7630
|
default:
|
|
7631
7631
|
this.contextSwitchesCompleted.clear(), this.contextSwitchesInProgress.clear(), this.buffer = [], this.resetPingState(), this.disconnected.resolve();
|
|
@@ -7653,7 +7653,7 @@ const PA = 65536 * 8, xA = 0.9, LA = (s) => PA * xA * 1e3 / s, lt = class lt {
|
|
|
7653
7653
|
type: "ping"
|
|
7654
7654
|
});
|
|
7655
7655
|
});
|
|
7656
|
-
this.logger = t, this.emitter = e, this.config = i, this.rtts = n, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(
|
|
7656
|
+
this.logger = t, this.emitter = e, this.config = i, this.rtts = n, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(O), this.transport = this.connectWebSocketTransport();
|
|
7657
7657
|
}
|
|
7658
7658
|
closed() {
|
|
7659
7659
|
return this.disconnected.promise;
|
|
@@ -7663,7 +7663,7 @@ r(lt, "PING_INTERVAL", 5e3), r(lt, "MAX_MISSED_PINGS", 4), r(lt, "TLS_ROUNDTRIPS
|
|
|
7663
7663
|
const h = new lt(e, t, i, n);
|
|
7664
7664
|
h.transport.once("error", (u) => c(u)), h.transport.once("open", () => o(h));
|
|
7665
7665
|
}));
|
|
7666
|
-
let
|
|
7666
|
+
let Mh = lt;
|
|
7667
7667
|
var jn, bi, Wn;
|
|
7668
7668
|
class DA {
|
|
7669
7669
|
constructor(e) {
|
|
@@ -7705,7 +7705,7 @@ class DA {
|
|
|
7705
7705
|
}
|
|
7706
7706
|
}
|
|
7707
7707
|
jn = new WeakMap(), bi = new WeakMap(), Wn = new WeakMap();
|
|
7708
|
-
var Et, Tt, zn, Ht, Hn,
|
|
7708
|
+
var Et, Tt, zn, Ht, Hn, Qn, Xn, gc, Ac, wc, Xl;
|
|
7709
7709
|
const Ws = class Ws {
|
|
7710
7710
|
constructor(e, t, i) {
|
|
7711
7711
|
d(this, wc);
|
|
@@ -7719,8 +7719,8 @@ const Ws = class Ws {
|
|
|
7719
7719
|
d(this, zn);
|
|
7720
7720
|
d(this, Ht, 0);
|
|
7721
7721
|
d(this, Hn, 0);
|
|
7722
|
-
d(this, Xn);
|
|
7723
7722
|
d(this, Qn);
|
|
7723
|
+
d(this, Xn);
|
|
7724
7724
|
r(this, "unload", () => {
|
|
7725
7725
|
var e;
|
|
7726
7726
|
this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), this.logger.debug("Unloaded module");
|
|
@@ -7734,7 +7734,7 @@ const Ws = class Ws {
|
|
|
7734
7734
|
l(this, Tt, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
|
|
7735
7735
|
});
|
|
7736
7736
|
r(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
|
|
7737
|
-
r(this, "getStatistics", () => this.connectionImpl ?
|
|
7737
|
+
r(this, "getStatistics", () => this.connectionImpl ? M(v({}, this.connectionImpl.getStatistics()), {
|
|
7738
7738
|
rtt: ei(a(this, Et).items()),
|
|
7739
7739
|
estimatedBandwidth: this.estimatedBandwidth,
|
|
7740
7740
|
connectCount: a(this, Hn),
|
|
@@ -7747,7 +7747,7 @@ const Ws = class Ws {
|
|
|
7747
7747
|
connectionProtocol: void 0
|
|
7748
7748
|
});
|
|
7749
7749
|
r(this, "connect", () => {
|
|
7750
|
-
l(this, Tt, !0), !a(this, zn) && l(this, zn, A(this, wc,
|
|
7750
|
+
l(this, Tt, !0), !a(this, zn) && l(this, zn, A(this, wc, Xl).call(this));
|
|
7751
7751
|
});
|
|
7752
7752
|
r(this, "disconnect", (e = "Disconnect Requested") => {
|
|
7753
7753
|
var t;
|
|
@@ -7785,7 +7785,7 @@ const Ws = class Ws {
|
|
|
7785
7785
|
});
|
|
7786
7786
|
}
|
|
7787
7787
|
get rtt() {
|
|
7788
|
-
return a(this, Et).items().length > 0 ?
|
|
7788
|
+
return a(this, Et).items().length > 0 ? Qt(a(this, Et).items()) : 0;
|
|
7789
7789
|
}
|
|
7790
7790
|
get estimatedBandwidth() {
|
|
7791
7791
|
return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : LA(this.rtt);
|
|
@@ -7794,21 +7794,21 @@ const Ws = class Ws {
|
|
|
7794
7794
|
* The timestamp when the first connection was made
|
|
7795
7795
|
*/
|
|
7796
7796
|
get firstConnectionTime() {
|
|
7797
|
-
return a(this,
|
|
7797
|
+
return a(this, Qn);
|
|
7798
7798
|
}
|
|
7799
7799
|
/**
|
|
7800
7800
|
* The timestamp when the last connection was made
|
|
7801
7801
|
*/
|
|
7802
7802
|
get lastConnectionTime() {
|
|
7803
|
-
return a(this,
|
|
7803
|
+
return a(this, Xn);
|
|
7804
7804
|
}
|
|
7805
7805
|
};
|
|
7806
|
-
Et = new WeakMap(), Tt = new WeakMap(), zn = new WeakMap(), Ht = new WeakMap(), Hn = new WeakMap(),
|
|
7806
|
+
Et = new WeakMap(), Tt = new WeakMap(), zn = new WeakMap(), Ht = new WeakMap(), Hn = new WeakMap(), Qn = new WeakMap(), Xn = new WeakMap(), gc = new WeakMap(), Ac = new WeakMap(), wc = new WeakSet(), Xl = function() {
|
|
7807
7807
|
return f(this, null, function* () {
|
|
7808
7808
|
var t;
|
|
7809
7809
|
const e = new DA({ edgeUrl: this.config.options.get("edgeUrl") });
|
|
7810
7810
|
for (l(this, Ht, 0); ; ) {
|
|
7811
|
-
|
|
7811
|
+
Ze(this, Ht)._++;
|
|
7812
7812
|
try {
|
|
7813
7813
|
const [n, o] = yield Promise.all([a(this, gc).call(this), a(this, Ac).call(this)]), c = o / 2;
|
|
7814
7814
|
if (a(this, Et).clear(), a(this, Et).push(c), !a(this, Tt))
|
|
@@ -7820,20 +7820,20 @@ Et = new WeakMap(), Tt = new WeakMap(), zn = new WeakMap(), Ht = new WeakMap(),
|
|
|
7820
7820
|
this.emitter,
|
|
7821
7821
|
this.logger,
|
|
7822
7822
|
this.apiClient,
|
|
7823
|
-
|
|
7823
|
+
M(v({}, this.config), {
|
|
7824
7824
|
connectInfo: n,
|
|
7825
7825
|
edgeUrl: h
|
|
7826
7826
|
}),
|
|
7827
7827
|
a(this, Et)
|
|
7828
|
-
) : (
|
|
7828
|
+
) : (Xe(typeof h == "string", "Edge URL is expected to be a string"), this.connectionImpl = yield Mh.start(
|
|
7829
7829
|
this.emitter,
|
|
7830
7830
|
this.logger,
|
|
7831
|
-
|
|
7831
|
+
M(v({}, this.config), {
|
|
7832
7832
|
connectInfo: n,
|
|
7833
7833
|
edgeUrl: h
|
|
7834
7834
|
}),
|
|
7835
7835
|
a(this, Et)
|
|
7836
|
-
)), e.reset(),
|
|
7836
|
+
)), e.reset(), Ze(this, Hn)._++, l(this, Ht, 0), l(this, Xn, Date.now()), a(this, Qn) || l(this, Qn, a(this, Xn)), yield this.connectionImpl.closed();
|
|
7837
7837
|
} catch (n) {
|
|
7838
7838
|
this.logger.info("Failed to connect", n);
|
|
7839
7839
|
const o = e.shiftedEdge();
|
|
@@ -7858,13 +7858,13 @@ Et = new WeakMap(), Tt = new WeakMap(), zn = new WeakMap(), Ht = new WeakMap(),
|
|
|
7858
7858
|
}, r(Ws, "PING_TIMEOUT", 1e3), r(Ws, "create", (e, t, i) => new Ws(e, t, i));
|
|
7859
7859
|
let Fh = Ws;
|
|
7860
7860
|
const ih = () => ({
|
|
7861
|
-
video:
|
|
7861
|
+
video: M(v({}, lo()), {
|
|
7862
7862
|
bitRate: Si()
|
|
7863
7863
|
}),
|
|
7864
7864
|
audio: {
|
|
7865
7865
|
bitRate: Si()
|
|
7866
7866
|
}
|
|
7867
|
-
}),
|
|
7867
|
+
}), OA = () => ({
|
|
7868
7868
|
width: window.innerWidth,
|
|
7869
7869
|
height: window.innerHeight,
|
|
7870
7870
|
bitRate: Si()
|
|
@@ -7896,7 +7896,7 @@ const ih = () => ({
|
|
|
7896
7896
|
r(this, "setUserSpecifiedCap", (e) => {
|
|
7897
7897
|
var i;
|
|
7898
7898
|
const t = (i = this.getUserSpecifiedCap()) != null ? i : ih();
|
|
7899
|
-
this.userSpecifiedCap =
|
|
7899
|
+
this.userSpecifiedCap = M(v({}, t), {
|
|
7900
7900
|
video: v(v({}, t.video), e.video),
|
|
7901
7901
|
audio: v(v({}, t.audio), e.audio)
|
|
7902
7902
|
}), this.evaluateConstraintCap();
|
|
@@ -7922,7 +7922,7 @@ const ih = () => ({
|
|
|
7922
7922
|
});
|
|
7923
7923
|
r(this, "evaluateConstraintCap", () => {
|
|
7924
7924
|
var c, h, u, m, p;
|
|
7925
|
-
const e = this.sizeBasedResolutionCapEnabled ?
|
|
7925
|
+
const e = this.sizeBasedResolutionCapEnabled ? M(v({}, ih()), { video: OA() }) : ih();
|
|
7926
7926
|
if (!this.resizeObserver) {
|
|
7927
7927
|
const g = this.element.getBoundingClientRect();
|
|
7928
7928
|
this.elementSize = { width: g.width, height: g.height };
|
|
@@ -7960,7 +7960,7 @@ const ih = () => ({
|
|
|
7960
7960
|
};
|
|
7961
7961
|
r(zs, "CHECK_SIZE_INTERVAL", 1e3), r(zs, "create", (e, t, i, n) => new zs(e, t, i, n));
|
|
7962
7962
|
let _h = zs;
|
|
7963
|
-
const
|
|
7963
|
+
const MA = 5, FA = 100, _A = 1e3;
|
|
7964
7964
|
class ou {
|
|
7965
7965
|
constructor(e, t, i, n) {
|
|
7966
7966
|
r(this, "timers", Ae.create());
|
|
@@ -8021,7 +8021,7 @@ class ou {
|
|
|
8021
8021
|
return;
|
|
8022
8022
|
t.sampleDuration = e.duration / e.timescale * 1e3;
|
|
8023
8023
|
const i = e.compositionTimeOffset || 0, { decoderContext: n, buffer: o } = t, c = (e.timestamp + i) / e.timescale * 1e3, h = e.duration / e.timescale * 1e3, u = o[o.length - 1];
|
|
8024
|
-
!u || c -
|
|
8024
|
+
!u || c - MA > u.end ? o.push({ start: c, end: c + h }) : c + h * 5 < u.end ? t.buffer = [{ start: c, end: c + h }] : u.end = c + h, n.enqueue(e), this.emitDecodedFrames();
|
|
8025
8025
|
});
|
|
8026
8026
|
r(this, "emitDecodedFrames", () => {
|
|
8027
8027
|
let e;
|
|
@@ -8070,7 +8070,7 @@ class ou {
|
|
|
8070
8070
|
for (const h of i)
|
|
8071
8071
|
switch (h.type) {
|
|
8072
8072
|
case "audio": {
|
|
8073
|
-
const { OpusDecoderContext: u } = yield import("./
|
|
8073
|
+
const { OpusDecoderContext: u } = yield import("./MIEZaUMK.js");
|
|
8074
8074
|
c.set(h.type, {
|
|
8075
8075
|
buffer: [],
|
|
8076
8076
|
decoderContext: yield u.create(48e3, 2),
|
|
@@ -8081,7 +8081,7 @@ class ou {
|
|
|
8081
8081
|
break;
|
|
8082
8082
|
}
|
|
8083
8083
|
case "video": {
|
|
8084
|
-
const { H264DecoderWorkerContext: u } = yield import("./
|
|
8084
|
+
const { H264DecoderWorkerContext: u } = yield import("./khx9Y_Dv.js");
|
|
8085
8085
|
c.set(h.type, {
|
|
8086
8086
|
buffer: [],
|
|
8087
8087
|
decoderContext: yield u.create(o),
|
|
@@ -8163,7 +8163,7 @@ const NA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, Kt
|
|
|
8163
8163
|
this.timers.unload(), this.emitter.off("add event", this.addEvent);
|
|
8164
8164
|
});
|
|
8165
8165
|
r(this, "addEvent", (e) => {
|
|
8166
|
-
this.logger.debug("Adding event", { event: e }), !this.waitingEvents.some((t) => typeof t.id != "undefined" && t.id === e.id) && this.waitingEvents.push(
|
|
8166
|
+
this.logger.debug("Adding event", { event: e }), !this.waitingEvents.some((t) => typeof t.id != "undefined" && t.id === e.id) && this.waitingEvents.push(M(v({}, e), { timestampAdded: Date.now() }));
|
|
8167
8167
|
});
|
|
8168
8168
|
r(this, "extractEvent", (e, t) => {
|
|
8169
8169
|
t.type === "video" && e.channelId !== t.channelId && this.addEvent({
|
|
@@ -8268,7 +8268,7 @@ const VA = () => window.AudioContext || window.webkitAudioContext, yc = class yc
|
|
|
8268
8268
|
try {
|
|
8269
8269
|
return yield Promise.race([this.context.resume(), su(1e3, sf())]);
|
|
8270
8270
|
} catch (t) {
|
|
8271
|
-
throw this.suspend().catch(
|
|
8271
|
+
throw this.suspend().catch(O), t;
|
|
8272
8272
|
}
|
|
8273
8273
|
}));
|
|
8274
8274
|
r(this, "suspend", () => f(this, null, function* () {
|
|
@@ -8360,7 +8360,7 @@ const vc = class vc extends Ei {
|
|
|
8360
8360
|
r(this, "onDecodedFrame", (t) => {
|
|
8361
8361
|
if (!(this.gainNode && this.audio && this.audio.isRunning)) {
|
|
8362
8362
|
if (t.type === "audio") {
|
|
8363
|
-
this.preInitSampleQueue.push(
|
|
8363
|
+
this.preInitSampleQueue.push(M(v({}, t), { data: t.data.slice(0, t.data.length) }));
|
|
8364
8364
|
const i = this.clockSource.currentTime;
|
|
8365
8365
|
this.preInitSampleQueue.filterPop(({ timestamp: n, timescale: o }) => n / o * 1e3 > i);
|
|
8366
8366
|
}
|
|
@@ -8411,7 +8411,7 @@ const vc = class vc extends Ei {
|
|
|
8411
8411
|
return (t = this.audio) == null || t.unload(), this.audio = new jh(), this.audio.on("state", (o) => {
|
|
8412
8412
|
this.logger.info("AudioContext state change", { state: o }), o === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", o);
|
|
8413
8413
|
}), this.audio.on("stuck", () => {
|
|
8414
|
-
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(
|
|
8414
|
+
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(O), this.emit("stuck"));
|
|
8415
8415
|
}), (i = this.gainNode) == null || i.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
|
|
8416
8416
|
});
|
|
8417
8417
|
r(this, "setGain", (t) => {
|
|
@@ -8468,11 +8468,11 @@ const vc = class vc extends Ei {
|
|
|
8468
8468
|
};
|
|
8469
8469
|
r(vc, "create", (t, i, n) => new vc(t, i, n));
|
|
8470
8470
|
let No = vc;
|
|
8471
|
-
var
|
|
8471
|
+
var Qa, It, pe, ps, qe, ql, Ls, Jl;
|
|
8472
8472
|
class GA {
|
|
8473
8473
|
constructor() {
|
|
8474
|
-
d(this,
|
|
8475
|
-
d(this,
|
|
8474
|
+
d(this, qe);
|
|
8475
|
+
d(this, Qa, []);
|
|
8476
8476
|
d(this, It, document.createElement("canvas"));
|
|
8477
8477
|
d(this, pe);
|
|
8478
8478
|
d(this, ps, window.devicePixelRatio || 1);
|
|
@@ -8485,18 +8485,18 @@ class GA {
|
|
|
8485
8485
|
const e = a(this, It).getContext("2d", { alpha: !0 });
|
|
8486
8486
|
if (!e)
|
|
8487
8487
|
throw new Error("Failed to create 2d context");
|
|
8488
|
-
l(this, pe, e), A(this,
|
|
8488
|
+
l(this, pe, e), A(this, qe, Ls).call(this);
|
|
8489
8489
|
}
|
|
8490
8490
|
get canvas() {
|
|
8491
8491
|
return a(this, It);
|
|
8492
8492
|
}
|
|
8493
8493
|
setActiveCues(e) {
|
|
8494
|
-
l(this,
|
|
8494
|
+
l(this, Qa, e);
|
|
8495
8495
|
}
|
|
8496
8496
|
render(e, t = !1) {
|
|
8497
|
-
const i = a(this,
|
|
8498
|
-
`).flatMap((m) => A(this,
|
|
8499
|
-
A(this,
|
|
8497
|
+
const i = a(this, Qa).flatMap((h) => h.text.split(`
|
|
8498
|
+
`).flatMap((m) => A(this, qe, Jl).call(this, m, e.width)).map((m) => {
|
|
8499
|
+
A(this, qe, Ls).call(this);
|
|
8500
8500
|
const p = a(this, pe).measureText(m);
|
|
8501
8501
|
return {
|
|
8502
8502
|
text: m,
|
|
@@ -8508,21 +8508,21 @@ class GA {
|
|
|
8508
8508
|
};
|
|
8509
8509
|
})), n = Math.max(...i.map((h) => h.size.width)), o = i.reduce((h, { size: u }) => h + u.height, 0) + (i.length - 1) * this.config.lineGap;
|
|
8510
8510
|
let c = 0;
|
|
8511
|
-
A(this,
|
|
8511
|
+
A(this, qe, ql).call(this, n, o), a(this, pe).clearRect(0, 0, a(this, It).width, a(this, It).height);
|
|
8512
8512
|
for (const { size: h, text: u } of i)
|
|
8513
|
-
A(this,
|
|
8513
|
+
A(this, qe, Ls).call(this), a(this, pe).fillStyle = this.config.backgroundColor, a(this, pe).fillRect(0, c, h.width, h.height), A(this, qe, Ls).call(this), a(this, pe).fillText(u, this.config.textPadding, c + this.config.textPadding), c += h.height + this.config.lineGap;
|
|
8514
8514
|
t && (a(this, pe).strokeStyle = "red", a(this, pe).strokeRect(0, 0, e.width, a(this, It).height));
|
|
8515
8515
|
}
|
|
8516
8516
|
}
|
|
8517
|
-
|
|
8517
|
+
Qa = new WeakMap(), It = new WeakMap(), pe = new WeakMap(), ps = new WeakMap(), qe = new WeakSet(), ql = function(e, t) {
|
|
8518
8518
|
a(this, It).width = e * a(this, ps), a(this, It).height = t * a(this, ps), a(this, pe).scale(a(this, ps), a(this, ps)), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
|
|
8519
8519
|
}, Ls = function() {
|
|
8520
8520
|
a(this, pe).fillStyle = "white", a(this, pe).textAlign = "left", a(this, pe).textBaseline = "top", a(this, pe).font = `${this.config.fontSize} sans-serif`;
|
|
8521
|
-
},
|
|
8521
|
+
}, Jl = function(e, t) {
|
|
8522
8522
|
const i = [], n = e.split(" ");
|
|
8523
8523
|
let o = "";
|
|
8524
8524
|
for (; n.length > 0; ) {
|
|
8525
|
-
A(this,
|
|
8525
|
+
A(this, qe, Ls).call(this);
|
|
8526
8526
|
let c = 0;
|
|
8527
8527
|
for (; a(this, pe).measureText(o + (o.length > 0 ? " " : "") + n[0]).width + this.config.textPadding * 2 <= t && n.length > 0; )
|
|
8528
8528
|
c++, o += (o.length > 0 ? " " : "") + n.shift();
|
|
@@ -8583,7 +8583,7 @@ void main() {
|
|
|
8583
8583
|
code: "failed_to_create_texture"
|
|
8584
8584
|
});
|
|
8585
8585
|
return s.bindTexture(s.TEXTURE_2D, e), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), e;
|
|
8586
|
-
},
|
|
8586
|
+
}, Qu = (s, e) => {
|
|
8587
8587
|
const t = s.createBuffer();
|
|
8588
8588
|
if (!t)
|
|
8589
8589
|
throw new x("Failed to create buffer", {
|
|
@@ -8607,15 +8607,15 @@ void main() {
|
|
|
8607
8607
|
}
|
|
8608
8608
|
return i;
|
|
8609
8609
|
};
|
|
8610
|
-
var Sc, _,
|
|
8610
|
+
var Sc, _, Xa, qa, Ja, yi, Jn, Zl, $l, Ec;
|
|
8611
8611
|
class zA {
|
|
8612
8612
|
constructor(e) {
|
|
8613
|
-
d(this,
|
|
8613
|
+
d(this, Jn);
|
|
8614
8614
|
d(this, Sc, 96);
|
|
8615
8615
|
d(this, _);
|
|
8616
|
-
d(this,
|
|
8616
|
+
d(this, Xa);
|
|
8617
|
+
d(this, qa);
|
|
8617
8618
|
d(this, Ja);
|
|
8618
|
-
d(this, Za);
|
|
8619
8619
|
d(this, yi);
|
|
8620
8620
|
r(this, "subtitleRenderer", new GA());
|
|
8621
8621
|
// biome-ignore format: special formatting
|
|
@@ -8637,14 +8637,14 @@ class zA {
|
|
|
8637
8637
|
0,
|
|
8638
8638
|
1
|
|
8639
8639
|
]);
|
|
8640
|
-
l(this, _, e), l(this,
|
|
8640
|
+
l(this, _, e), l(this, Xa, Di(e)), l(this, qa, Ds(e, e.FRAGMENT_SHADER, jA)), l(this, Ja, Ds(e, e.VERTEX_SHADER, WA)), l(this, yi, Wh(e, a(this, Ja), a(this, qa))), this.subtitleRenderer.config.fontSize = "64px";
|
|
8641
8641
|
}
|
|
8642
8642
|
setActiveCues(e, t) {
|
|
8643
8643
|
this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
|
|
8644
8644
|
}
|
|
8645
8645
|
render(e) {
|
|
8646
8646
|
const t = this.subtitleRenderer.canvas, i = (e.padding + a(this, Sc)) * window.devicePixelRatio;
|
|
8647
|
-
t.width !== 0 && (a(this, _).useProgram(a(this, yi)), A(this,
|
|
8647
|
+
t.width !== 0 && (a(this, _).useProgram(a(this, yi)), A(this, Jn, Zl).call(this), A(this, Jn, $l).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + i) / e.height)), a(this, _).uniform1i(a(this, _).getUniformLocation(a(this, yi), "texture"), 4), a(this, _).activeTexture(a(this, _).TEXTURE4), a(this, _).bindTexture(a(this, _).TEXTURE_2D, a(this, Xa)), a(this, _).enable(a(this, _).BLEND), a(this, _).blendFunc(a(this, _).SRC_ALPHA, a(this, _).ONE_MINUS_SRC_ALPHA), a(this, _).texImage2D(
|
|
8648
8648
|
a(this, _).TEXTURE_2D,
|
|
8649
8649
|
0,
|
|
8650
8650
|
a(this, _).RGBA,
|
|
@@ -8654,14 +8654,14 @@ class zA {
|
|
|
8654
8654
|
), a(this, _).texParameteri(a(this, _).TEXTURE_2D, a(this, _).TEXTURE_MAG_FILTER, a(this, _).LINEAR), a(this, _).drawArrays(a(this, _).TRIANGLE_STRIP, 0, 4));
|
|
8655
8655
|
}
|
|
8656
8656
|
}
|
|
8657
|
-
Sc = new WeakMap(), _ = new WeakMap(),
|
|
8657
|
+
Sc = new WeakMap(), _ = new WeakMap(), Xa = new WeakMap(), qa = new WeakMap(), Ja = new WeakMap(), yi = new WeakMap(), Jn = new WeakSet(), Zl = function() {
|
|
8658
8658
|
const e = a(this, _).getAttribLocation(a(this, yi), "position");
|
|
8659
8659
|
a(this, _).enableVertexAttribArray(e), a(this, _).vertexAttribPointer(e, 2, a(this, _).FLOAT, !1, 0, 0);
|
|
8660
8660
|
}, $l = function(e, t, i, n) {
|
|
8661
8661
|
const o = a(this, _).getUniformLocation(a(this, yi), "model");
|
|
8662
8662
|
a(this, _).uniformMatrix4fv(o, !1, a(this, Ec).call(this, e, t, i, n));
|
|
8663
8663
|
}, Ec = new WeakMap();
|
|
8664
|
-
const
|
|
8664
|
+
const Xu = `
|
|
8665
8665
|
precision mediump float;
|
|
8666
8666
|
uniform sampler2D y_texture;
|
|
8667
8667
|
uniform sampler2D u_texture;
|
|
@@ -8677,7 +8677,7 @@ void main() {
|
|
|
8677
8677
|
|
|
8678
8678
|
gl_FragColor = vec4(y, u, v, 1) * conversion;
|
|
8679
8679
|
}
|
|
8680
|
-
`,
|
|
8680
|
+
`, qu = `
|
|
8681
8681
|
attribute vec2 position;
|
|
8682
8682
|
varying vec2 texture_coordinate;
|
|
8683
8683
|
uniform mat4 model;
|
|
@@ -8686,12 +8686,12 @@ void main() {
|
|
|
8686
8686
|
texture_coordinate = position;
|
|
8687
8687
|
gl_Position = model * vec4(position, 0.0, 1.0);
|
|
8688
8688
|
}
|
|
8689
|
-
`,
|
|
8689
|
+
`, Ju = {
|
|
8690
8690
|
width: 256,
|
|
8691
8691
|
codedWidth: 256,
|
|
8692
8692
|
height: 144,
|
|
8693
8693
|
codedHeight: 144
|
|
8694
|
-
},
|
|
8694
|
+
}, Zu = {
|
|
8695
8695
|
preserveDrawingBuffer: !1,
|
|
8696
8696
|
alpha: !1,
|
|
8697
8697
|
depth: !1,
|
|
@@ -8702,10 +8702,10 @@ void main() {
|
|
|
8702
8702
|
constructor() {
|
|
8703
8703
|
super();
|
|
8704
8704
|
r(this, "canvas", document.createElement("canvas"));
|
|
8705
|
-
r(this, "context", Hu(this.canvas,
|
|
8706
|
-
r(this, "pixelShader", Ds(this.context, this.context.FRAGMENT_SHADER,
|
|
8707
|
-
r(this, "vertexShader", Ds(this.context, this.context.VERTEX_SHADER,
|
|
8708
|
-
r(this, "buffer",
|
|
8705
|
+
r(this, "context", Hu(this.canvas, Zu));
|
|
8706
|
+
r(this, "pixelShader", Ds(this.context, this.context.FRAGMENT_SHADER, Xu));
|
|
8707
|
+
r(this, "vertexShader", Ds(this.context, this.context.VERTEX_SHADER, qu));
|
|
8708
|
+
r(this, "buffer", Qu(this.context, Br.SQUARE_VERTICES));
|
|
8709
8709
|
r(this, "program", Wh(this.context, this.vertexShader, this.pixelShader));
|
|
8710
8710
|
r(this, "textures", {
|
|
8711
8711
|
y: Di(this.context),
|
|
@@ -8714,21 +8714,21 @@ void main() {
|
|
|
8714
8714
|
});
|
|
8715
8715
|
// Lazy loaded when needed
|
|
8716
8716
|
r(this, "textRenderer");
|
|
8717
|
-
r(this, "size",
|
|
8717
|
+
r(this, "size", Ju);
|
|
8718
8718
|
r(this, "onContextLost", (t) => {
|
|
8719
8719
|
this.textRenderer = void 0;
|
|
8720
8720
|
const i = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
|
|
8721
8721
|
this.emit("context lost", cf(i)), t.preventDefault();
|
|
8722
8722
|
});
|
|
8723
8723
|
r(this, "onContextRestored", () => {
|
|
8724
|
-
this.emit("context restored"), this.context = Hu(this.canvas,
|
|
8724
|
+
this.emit("context restored"), this.context = Hu(this.canvas, Zu), this.pixelShader = Ds(this.context, this.context.FRAGMENT_SHADER, Xu), this.vertexShader = Ds(this.context, this.context.VERTEX_SHADER, qu), this.buffer = Qu(this.context, Br.SQUARE_VERTICES), this.program = Wh(this.context, this.vertexShader, this.pixelShader), this.textures = {
|
|
8725
8725
|
y: Di(this.context),
|
|
8726
8726
|
u: Di(this.context),
|
|
8727
8727
|
v: Di(this.context)
|
|
8728
8728
|
}, this.load();
|
|
8729
8729
|
});
|
|
8730
8730
|
r(this, "load", () => {
|
|
8731
|
-
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(
|
|
8731
|
+
this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(Ju), 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());
|
|
8732
8732
|
});
|
|
8733
8733
|
r(this, "unload", () => {
|
|
8734
8734
|
var i;
|
|
@@ -8953,7 +8953,7 @@ const Ri = (s, e) => {
|
|
|
8953
8953
|
class HA {
|
|
8954
8954
|
constructor() {
|
|
8955
8955
|
r(this, "audio");
|
|
8956
|
-
r(this, "unmute", () => this.audio.play().catch(
|
|
8956
|
+
r(this, "unmute", () => this.audio.play().catch(O));
|
|
8957
8957
|
const e = document.createElement("div");
|
|
8958
8958
|
e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
8959
8959
|
const t = e.children.item(0);
|
|
@@ -9035,7 +9035,7 @@ const Ic = class Ic {
|
|
|
9035
9035
|
}
|
|
9036
9036
|
set muted(e) {
|
|
9037
9037
|
const t = this.muted;
|
|
9038
|
-
this.audioPlayer.muted = e, !e && t && this.activateAudioPlayer().catch(
|
|
9038
|
+
this.audioPlayer.muted = e, !e && t && this.activateAudioPlayer().catch(O);
|
|
9039
9039
|
}
|
|
9040
9040
|
get currentTime() {
|
|
9041
9041
|
return this.audioPlayer.currentTime;
|
|
@@ -9153,7 +9153,7 @@ const Cc = class Cc {
|
|
|
9153
9153
|
autoplay: !1,
|
|
9154
9154
|
logger: this.logger.createContext("MediaElement")
|
|
9155
9155
|
}), this.mediaElement.on("volume state", (u) => {
|
|
9156
|
-
this.updateVolumeState(), !u.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(
|
|
9156
|
+
this.updateVolumeState(), !u.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(O), u.isMuted || (this._userProvidedMuted = !1);
|
|
9157
9157
|
}), this.mediaElement.on("media element state", (u) => {
|
|
9158
9158
|
u === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", u);
|
|
9159
9159
|
}), this.audioPlayer = No.create(this.logger.createContext("AudioPlayerModule"), n, {
|
|
@@ -9182,7 +9182,7 @@ const Cc = class Cc {
|
|
|
9182
9182
|
}
|
|
9183
9183
|
set muted(e) {
|
|
9184
9184
|
const t = this.muted;
|
|
9185
|
-
this._userProvidedMuted = e, this.mediaElement.muted = e, !e && t && this.activateAudioPlayer().catch(
|
|
9185
|
+
this._userProvidedMuted = e, this.mediaElement.muted = e, !e && t && this.activateAudioPlayer().catch(O);
|
|
9186
9186
|
}
|
|
9187
9187
|
get currentTime() {
|
|
9188
9188
|
return this.audioPlayer.currentTime;
|
|
@@ -9222,9 +9222,9 @@ const Cc = class Cc {
|
|
|
9222
9222
|
}
|
|
9223
9223
|
};
|
|
9224
9224
|
r(Cc, "create", (e, t, i, n, o) => new Cc(e, t, i, n, o));
|
|
9225
|
-
let
|
|
9226
|
-
const
|
|
9227
|
-
class
|
|
9225
|
+
let Qh = Cc;
|
|
9226
|
+
const QA = () => (s) => Kl(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), Kl = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), $u = (s) => (e) => e.appendBuffer(s), XA = (s) => (e) => e.changeType(s), qA = (s) => (e) => s(e);
|
|
9227
|
+
class JA {
|
|
9228
9228
|
constructor(e) {
|
|
9229
9229
|
r(this, "commandQueue", []);
|
|
9230
9230
|
r(this, "sourceBuffer");
|
|
@@ -9242,7 +9242,7 @@ class ZA {
|
|
|
9242
9242
|
this.commandQueue.push(o), this.handleQueue();
|
|
9243
9243
|
}));
|
|
9244
9244
|
r(this, "execute", (e) => new Promise((t, i) => {
|
|
9245
|
-
const n = new Cs(
|
|
9245
|
+
const n = new Cs(qA(e), t, i);
|
|
9246
9246
|
this.commandQueue.push(n), this.handleQueue();
|
|
9247
9247
|
}));
|
|
9248
9248
|
r(this, "buffered", () => this.sourceBuffer.buffered);
|
|
@@ -9250,7 +9250,7 @@ class ZA {
|
|
|
9250
9250
|
e.removeSourceBuffer(this.sourceBuffer);
|
|
9251
9251
|
});
|
|
9252
9252
|
r(this, "changeType", (e) => new Promise((t, i) => {
|
|
9253
|
-
const n = new Cs(
|
|
9253
|
+
const n = new Cs(XA(e), t, i);
|
|
9254
9254
|
this.commandQueue.push(n), this.handleQueue();
|
|
9255
9255
|
}));
|
|
9256
9256
|
r(this, "removeBuffer", (e, t) => new Promise((i, n) => {
|
|
@@ -9258,7 +9258,7 @@ class ZA {
|
|
|
9258
9258
|
this.commandQueue.push(o), this.handleQueue();
|
|
9259
9259
|
}));
|
|
9260
9260
|
r(this, "flush", () => new Promise((e, t) => {
|
|
9261
|
-
const i = new Cs(
|
|
9261
|
+
const i = new Cs(QA, e, t);
|
|
9262
9262
|
this.commandQueue.push(i), this.handleQueue();
|
|
9263
9263
|
}));
|
|
9264
9264
|
this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
|
|
@@ -9296,7 +9296,7 @@ class em extends Ei {
|
|
|
9296
9296
|
});
|
|
9297
9297
|
r(this, "addSourceBuffer", (t) => {
|
|
9298
9298
|
const i = this.mediaSource.addSourceBuffer(t);
|
|
9299
|
-
return new
|
|
9299
|
+
return new JA(i);
|
|
9300
9300
|
});
|
|
9301
9301
|
r(this, "removeSourceBuffer", (t) => {
|
|
9302
9302
|
t.removeFromMediaSource(this.mediaSource);
|
|
@@ -9340,8 +9340,8 @@ class tm {
|
|
|
9340
9340
|
});
|
|
9341
9341
|
}
|
|
9342
9342
|
}
|
|
9343
|
-
function
|
|
9344
|
-
return
|
|
9343
|
+
function ZA(s, { mediaSource: e, mimeType: t, codec: i }) {
|
|
9344
|
+
return M(v({}, s), {
|
|
9345
9345
|
state: "initialized",
|
|
9346
9346
|
mimeType: t,
|
|
9347
9347
|
codec: i,
|
|
@@ -9441,7 +9441,7 @@ const kc = class kc {
|
|
|
9441
9441
|
let n = this.trackContexts.get(i.type);
|
|
9442
9442
|
n || (n = Yu({ pendingSamples: [], initSegments: new tm() }), this.trackContexts.set(i.type, n)), n.state === "initialized" ? i.mimeType !== n.mimeType && (yield n.sourceBuffer.changeType(i.mimeType)) : this.trackContexts.set(
|
|
9443
9443
|
i.type,
|
|
9444
|
-
|
|
9444
|
+
ZA(n, {
|
|
9445
9445
|
mimeType: i.mimeType,
|
|
9446
9446
|
mediaSource: this.mediaSource,
|
|
9447
9447
|
codec: i.codec
|
|
@@ -9473,7 +9473,7 @@ const kc = class kc {
|
|
|
9473
9473
|
if (!i)
|
|
9474
9474
|
throw Ya(e.type, e.renditionId);
|
|
9475
9475
|
i.state === "initialized" && (i.mimeType = t);
|
|
9476
|
-
const n =
|
|
9476
|
+
const n = Qp({
|
|
9477
9477
|
codec: e.codec,
|
|
9478
9478
|
timescale: e.timescale,
|
|
9479
9479
|
initData: e.data
|
|
@@ -9598,7 +9598,7 @@ const kc = class kc {
|
|
|
9598
9598
|
const n = !this.mediaElement.paused, o = [];
|
|
9599
9599
|
this.trackContexts.forEach((c, h) => {
|
|
9600
9600
|
c.state === "initialized" && o.push({ type: h, mimeType: c.mimeType, codec: c.codec });
|
|
9601
|
-
}), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = o, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), n && this.mediaElement.play().catch(
|
|
9601
|
+
}), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = o, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), n && this.mediaElement.play().catch(O);
|
|
9602
9602
|
}
|
|
9603
9603
|
}
|
|
9604
9604
|
this.logger.debug("source ended");
|
|
@@ -9610,7 +9610,7 @@ r(kc, "create", (e, t, i) => {
|
|
|
9610
9610
|
const n = new kc(e, t, i);
|
|
9611
9611
|
return n.setTrackContexts(), n.mediaSource.on("source ended", n.onSourceEnded), n.mediaSource.on("source open", n.onSourceOpen), n.mediaSource.attach(i), n;
|
|
9612
9612
|
});
|
|
9613
|
-
let
|
|
9613
|
+
let Xh = kc;
|
|
9614
9614
|
const Ku = (s, e) => {
|
|
9615
9615
|
var h;
|
|
9616
9616
|
const t = s.renditionId !== e.renditionId, i = s.channelId !== e.channelId, n = ((h = s.timestamp) != null ? h : 0) > e.timestamp, o = s.type === "video" && e.type === "video" && "levelIdc" in s && "levelIdc" in e && s.levelIdc !== e.levelIdc;
|
|
@@ -9681,7 +9681,7 @@ const Ku = (s, e) => {
|
|
|
9681
9681
|
}
|
|
9682
9682
|
};
|
|
9683
9683
|
r(Bc, "create", (e, t) => new Bc(e, t));
|
|
9684
|
-
let
|
|
9684
|
+
let qh = Bc;
|
|
9685
9685
|
const Rc = class Rc {
|
|
9686
9686
|
constructor(e, t, i, n) {
|
|
9687
9687
|
r(this, "emitter");
|
|
@@ -9722,8 +9722,8 @@ const Rc = class Rc {
|
|
|
9722
9722
|
}
|
|
9723
9723
|
};
|
|
9724
9724
|
r(Rc, "create", (e, t, i, n) => new Rc(e, t, i, n));
|
|
9725
|
-
let
|
|
9726
|
-
const
|
|
9725
|
+
let Jh = Rc;
|
|
9726
|
+
const Zh = () => ({
|
|
9727
9727
|
upgradesFromLevel: [],
|
|
9728
9728
|
downgradesFromLevel: [],
|
|
9729
9729
|
bufferingRanges: [],
|
|
@@ -9734,9 +9734,9 @@ const qh = () => ({
|
|
|
9734
9734
|
levelDowngrades: [],
|
|
9735
9735
|
levelUpgrades: [],
|
|
9736
9736
|
bufferFullness: 0,
|
|
9737
|
-
general:
|
|
9737
|
+
general: Zh()
|
|
9738
9738
|
}), Uc = class Uc {
|
|
9739
|
-
constructor(e, t) {
|
|
9739
|
+
constructor(e, t, i) {
|
|
9740
9740
|
r(this, "minBufferFullnessLengthForRegression", 6);
|
|
9741
9741
|
r(this, "logger");
|
|
9742
9742
|
r(this, "emitter");
|
|
@@ -9748,6 +9748,8 @@ const qh = () => ({
|
|
|
9748
9748
|
r(this, "isSuspended", !1);
|
|
9749
9749
|
r(this, "_fatalQosCount", 0);
|
|
9750
9750
|
r(this, "targetBufferTime", 0);
|
|
9751
|
+
r(this, "renditionLevelSource");
|
|
9752
|
+
r(this, "qualityIndexOrder", []);
|
|
9751
9753
|
r(this, "hasAsserted", !1);
|
|
9752
9754
|
r(this, "load", () => {
|
|
9753
9755
|
this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
|
|
@@ -9776,7 +9778,9 @@ const qh = () => ({
|
|
|
9776
9778
|
r(this, "activeRatios", () => {
|
|
9777
9779
|
const e = /* @__PURE__ */ new Map(), t = Bs(this.metrics.general.activeRanges);
|
|
9778
9780
|
if (Object.entries(this.metrics.levels).forEach(([i, n]) => {
|
|
9779
|
-
|
|
9781
|
+
var u;
|
|
9782
|
+
const o = parseInt(i, 10), c = t ? Bs(n.activeRanges) / t : 0, h = this.getQualityIndex(o).toString();
|
|
9783
|
+
e.set(h, ((u = e.get(h)) != null ? u : 0) + c);
|
|
9780
9784
|
}), !this.hasAsserted) {
|
|
9781
9785
|
const i = e.size ? Math.abs(Array.from(e.values()).reduce((n, o) => n + o, 0) - 1) <= 0.02 : !0;
|
|
9782
9786
|
i || (this.hasAsserted = !0, console.assert(
|
|
@@ -9792,7 +9796,9 @@ const qh = () => ({
|
|
|
9792
9796
|
r(this, "bufferingRatios", () => {
|
|
9793
9797
|
const e = /* @__PURE__ */ new Map(), t = Bs(this.metrics.general.bufferingRanges);
|
|
9794
9798
|
if (Object.entries(this.metrics.levels).forEach(([i, n]) => {
|
|
9795
|
-
|
|
9799
|
+
var u;
|
|
9800
|
+
const o = parseInt(i, 10), c = t ? Bs(n.bufferingRanges) / t : 0, h = this.getQualityIndex(o).toString();
|
|
9801
|
+
e.set(h, ((u = e.get(h)) != null ? u : 0) + c);
|
|
9796
9802
|
}), !this.hasAsserted) {
|
|
9797
9803
|
const i = Array.from(e.values()).reduce((n, o) => n + o, 0) <= 1;
|
|
9798
9804
|
i || (this.hasAsserted = !0, console.assert(
|
|
@@ -9811,13 +9817,11 @@ const qh = () => ({
|
|
|
9811
9817
|
r(this, "timeSpentPlayingInAtLeastLevelRatio", (e) => {
|
|
9812
9818
|
var u, m, p, g;
|
|
9813
9819
|
const t = this.timeSpentBuffering(), i = this.timeActive(), n = this.bufferingRatios(), o = this.activeRatios(), c = ((m = (u = e.video) == null ? void 0 : u.bitRate) != null ? m : 0) + ((g = (p = e.audio) == null ? void 0 : p.bitRate) != null ? g : 0), h = t / i;
|
|
9814
|
-
return Object.keys(this.metrics.levels).map((w) => parseInt(w, 10)).filter((w) => w >= c).reduce(
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
0
|
|
9820
|
-
);
|
|
9820
|
+
return Object.keys(this.metrics.levels).map((w) => parseInt(w, 10)).filter((w) => w >= c).reduce((w, b) => {
|
|
9821
|
+
var I, k;
|
|
9822
|
+
const S = this.getQualityIndex(b).toString();
|
|
9823
|
+
return ((I = o.get(S)) != null ? I : 0) - ((k = n.get(S)) != null ? k : 0) * h + w;
|
|
9824
|
+
}, 0);
|
|
9821
9825
|
});
|
|
9822
9826
|
r(this, "timeSpentBuffering", () => Bs(this.metrics.general.bufferingRanges));
|
|
9823
9827
|
r(this, "timeActive", () => Bs(this.metrics.general.activeRanges));
|
|
@@ -9828,18 +9832,18 @@ const qh = () => ({
|
|
|
9828
9832
|
fatalQosCount: this.fatalQosCount
|
|
9829
9833
|
}));
|
|
9830
9834
|
r(this, "onRenditionLevelChanged", (e) => {
|
|
9831
|
-
var o, c, h, u, m, p, g, w, b, S, I,
|
|
9832
|
-
const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (m = (u = e.from) == null ? void 0 : u.audio) == null ? void 0 : m.bitRate) != null ? p : 0), i = ((b = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? b : 0) + ((
|
|
9835
|
+
var o, c, h, u, m, p, g, w, b, S, I, k, D, T;
|
|
9836
|
+
const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (m = (u = e.from) == null ? void 0 : u.audio) == null ? void 0 : m.bitRate) != null ? p : 0), i = ((b = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? b : 0) + ((k = (I = (S = e.to) == null ? void 0 : S.audio) == null ? void 0 : I.bitRate) != null ? k : 0);
|
|
9833
9837
|
this.logger.info("rendition level changed", { fromLevel: t, toLevel: i }), this.metrics.general.activeRanges.length === 0 && this.setActive(), e.from && e.to && (t < i ? this.metrics.general.upgradesFromLevel.push(Date.now()) : this.metrics.general.downgradesFromLevel.push(Date.now()));
|
|
9834
9838
|
let n = !1;
|
|
9835
9839
|
if (e.from) {
|
|
9836
|
-
const P = (D = this.metrics.levels[t]) != null ? D :
|
|
9840
|
+
const P = (D = this.metrics.levels[t]) != null ? D : Zh();
|
|
9837
9841
|
t < i ? P.upgradesFromLevel.push(Date.now()) : P.downgradesFromLevel.push(Date.now()), Ui(P.activeRanges);
|
|
9838
9842
|
const R = P.bufferingRanges[P.bufferingRanges.length - 1];
|
|
9839
9843
|
n = !!R && !R.end, Ui(P.bufferingRanges), this.metrics.levels[t] = P;
|
|
9840
9844
|
}
|
|
9841
9845
|
if (e.to) {
|
|
9842
|
-
const P = (T = this.metrics.levels[i]) != null ? T :
|
|
9846
|
+
const P = (T = this.metrics.levels[i]) != null ? T : Zh();
|
|
9843
9847
|
ks(P.activeRanges), n && ks(P.bufferingRanges), this.metrics.levels[i] = P, this.currentLevel = i;
|
|
9844
9848
|
}
|
|
9845
9849
|
});
|
|
@@ -9893,7 +9897,19 @@ const qh = () => ({
|
|
|
9893
9897
|
}
|
|
9894
9898
|
Ui(this.metrics.general.activeRanges);
|
|
9895
9899
|
});
|
|
9896
|
-
this
|
|
9900
|
+
r(this, "getQualityIndex", (e) => {
|
|
9901
|
+
var i, n;
|
|
9902
|
+
if (!this.qualityIndexOrder.length) {
|
|
9903
|
+
const c = ((n = (i = this.renditionLevelSource) == null ? void 0 : i.getRenditionLevels()) != null ? n : []).map((h) => {
|
|
9904
|
+
var u, m, p, g;
|
|
9905
|
+
return ((m = (u = h.video) == null ? void 0 : u.bitRate) != null ? m : 0) + ((g = (p = h.audio) == null ? void 0 : p.bitRate) != null ? g : 0);
|
|
9906
|
+
}).filter((h) => h > 0);
|
|
9907
|
+
this.qualityIndexOrder = [...new Set(c)].sort((h, u) => u - h);
|
|
9908
|
+
}
|
|
9909
|
+
let t = this.qualityIndexOrder.indexOf(e);
|
|
9910
|
+
return t === -1 && (this.qualityIndexOrder.push(e), this.qualityIndexOrder.sort((o, c) => c - o), t = this.qualityIndexOrder.indexOf(e)), t;
|
|
9911
|
+
});
|
|
9912
|
+
this.logger = t, this.emitter = e, this.renditionLevelSource = i;
|
|
9897
9913
|
}
|
|
9898
9914
|
get fatalQosCount() {
|
|
9899
9915
|
return this._fatalQosCount;
|
|
@@ -9906,7 +9922,7 @@ const qh = () => ({
|
|
|
9906
9922
|
ks(this.metrics.general.activeRanges);
|
|
9907
9923
|
}
|
|
9908
9924
|
};
|
|
9909
|
-
r(Uc, "create", (e, t) => new Uc(e, t));
|
|
9925
|
+
r(Uc, "create", (e, t, i) => new Uc(e, t, i));
|
|
9910
9926
|
let $h = Uc;
|
|
9911
9927
|
const Pc = class Pc {
|
|
9912
9928
|
constructor(e, t) {
|
|
@@ -10343,7 +10359,7 @@ const ed = 5e3, ew = () => Id() || Fc() || Sm(), td = () => ew() ? 100 : 0, id =
|
|
|
10343
10359
|
if (this.isSuspended)
|
|
10344
10360
|
return;
|
|
10345
10361
|
if (!n || !o) {
|
|
10346
|
-
this.logger.info("Initial timing info", { syncInfo: t }), this.channelSyncInfo.set(e,
|
|
10362
|
+
this.logger.info("Initial timing info", { syncInfo: t }), this.channelSyncInfo.set(e, M(v({}, t), { localTimestamp: i, timeDifferences: new oe(12) }));
|
|
10347
10363
|
return;
|
|
10348
10364
|
}
|
|
10349
10365
|
const c = t.wallclockTime - n.wallclockTime, h = t.timestamp - n.timestamp, u = i - n.localTimestamp, m = h - u;
|
|
@@ -10357,7 +10373,7 @@ const ed = 5e3, ew = () => Id() || Fc() || Sm(), td = () => ew() ? 100 : 0, id =
|
|
|
10357
10373
|
wallclockDelta: c,
|
|
10358
10374
|
localWallclockDelta: u
|
|
10359
10375
|
}), Math.abs(m) >= this.bufferSource.getTargetBufferTime() * 2) {
|
|
10360
|
-
this.logger.info("Resetting sync info", { diffFromEstimated: m }), this.channelSyncInfo.set(e,
|
|
10376
|
+
this.logger.info("Resetting sync info", { diffFromEstimated: m }), this.channelSyncInfo.set(e, M(v({}, t), {
|
|
10361
10377
|
localTimestamp: i,
|
|
10362
10378
|
timeDifferences: new oe(n.timeDifferences.maxSize + 1)
|
|
10363
10379
|
})), this.currentChannelId && this.currentChannelId === e && (this.reset(), this.emitter.emit("channel reset"));
|
|
@@ -10372,7 +10388,7 @@ const ed = 5e3, ew = () => Id() || Fc() || Sm(), td = () => ew() ? 100 : 0, id =
|
|
|
10372
10388
|
const i = this.channelSyncInfo.get(t);
|
|
10373
10389
|
if (!i)
|
|
10374
10390
|
return;
|
|
10375
|
-
const n =
|
|
10391
|
+
const n = Qt(i.timeDifferences.items());
|
|
10376
10392
|
Math.abs(n) > e && (this.logger.info("Adjusting sync info", { averageDifference: n }), i.timestamp += n, i.timeDifferences.clear());
|
|
10377
10393
|
}
|
|
10378
10394
|
/**
|
|
@@ -10516,7 +10532,7 @@ const tw = {
|
|
|
10516
10532
|
maxRetries: 10,
|
|
10517
10533
|
maxErrorReports: 50,
|
|
10518
10534
|
maxEvents: 50
|
|
10519
|
-
}, sh = (s, e) =>
|
|
10535
|
+
}, sh = (s, e) => M(v({}, e), { type: s, timestamp: (/* @__PURE__ */ new Date()).toISOString(), discriminator: "web" }), Dc = class Dc {
|
|
10520
10536
|
constructor(e, t, i, n) {
|
|
10521
10537
|
r(this, "logger");
|
|
10522
10538
|
r(this, "timers", new Ae());
|
|
@@ -10539,7 +10555,7 @@ const tw = {
|
|
|
10539
10555
|
r(this, "addStats", ({ isFinal: e, initiator: t } = { isFinal: !1, initiator: "interval" }, i = {}) => {
|
|
10540
10556
|
if (!this.options.includeStats)
|
|
10541
10557
|
return;
|
|
10542
|
-
const n = this.parentContext.getStatistics(), o = sh("stats",
|
|
10558
|
+
const n = this.parentContext.getStatistics(), o = sh("stats", M(v(v({}, i), n), { isFinal: e, initiator: t, count: this.statsCount++ }));
|
|
10543
10559
|
this.unsentLines.push(o);
|
|
10544
10560
|
});
|
|
10545
10561
|
r(this, "addEvent", (e) => {
|
|
@@ -10599,7 +10615,7 @@ const tw = {
|
|
|
10599
10615
|
};
|
|
10600
10616
|
r(Dc, "create", (e, t, i, n) => new Dc(e, t, i, n));
|
|
10601
10617
|
let Go = Dc;
|
|
10602
|
-
const
|
|
10618
|
+
const Oc = class Oc {
|
|
10603
10619
|
constructor(e, t, i) {
|
|
10604
10620
|
r(this, "logger");
|
|
10605
10621
|
r(this, "element");
|
|
@@ -10614,8 +10630,8 @@ const Mc = class Mc {
|
|
|
10614
10630
|
this.logger = e, this.element = t, this.documentState = i, this.timers.setInterval(this.unpause, 100);
|
|
10615
10631
|
}
|
|
10616
10632
|
};
|
|
10617
|
-
r(
|
|
10618
|
-
let jo =
|
|
10633
|
+
r(Oc, "create", (e, t, i) => new Oc(e, t, i));
|
|
10634
|
+
let jo = Oc;
|
|
10619
10635
|
const iw = [
|
|
10620
10636
|
"minBufferTime",
|
|
10621
10637
|
"maxBufferTime",
|
|
@@ -10686,10 +10702,10 @@ class nw {
|
|
|
10686
10702
|
const rw = 6, aw = (s) => {
|
|
10687
10703
|
let e = [s], t = 0, i = 0, n = !1;
|
|
10688
10704
|
const o = (h, u) => {
|
|
10689
|
-
var
|
|
10690
|
-
h.flags && cr(h.flags) && (t = (
|
|
10705
|
+
var k, D, T;
|
|
10706
|
+
h.flags && cr(h.flags) && (t = (k = h.compositionTimeOffset) != null ? k : 0), h.timestamp += t, h.compositionTimeOffset = ((D = h.compositionTimeOffset) != null ? D : 0) - t;
|
|
10691
10707
|
const m = h.timestamp / h.timescale, g = u.flags && cr(u.flags) ? (T = u.compositionTimeOffset) != null ? T : 0 : t, b = (u.timestamp + g) / u.timescale, S = Math.max(0, Math.round((b - m) * h.timescale));
|
|
10692
|
-
return S > 0 && (i = S),
|
|
10708
|
+
return S > 0 && (i = S), M(v({}, h), {
|
|
10693
10709
|
/*
|
|
10694
10710
|
During resync timeshifts we may end up with negative durations (normalized to 0 above) which is not allowed in mse (the MseModule
|
|
10695
10711
|
drops the frame) so we use the last known duration instead. This is not ideal but it's better than dropping the frame.
|
|
@@ -10716,7 +10732,7 @@ const rw = 6, aw = (s) => {
|
|
|
10716
10732
|
};
|
|
10717
10733
|
}, ow = (s, e, t) => {
|
|
10718
10734
|
if (ws(e))
|
|
10719
|
-
return v(
|
|
10735
|
+
return v(M(v({}, s), {
|
|
10720
10736
|
type: "video",
|
|
10721
10737
|
codec: e.codec,
|
|
10722
10738
|
isSync: cr(s.flags),
|
|
@@ -10727,7 +10743,7 @@ const rw = 6, aw = (s) => {
|
|
|
10727
10743
|
}), t);
|
|
10728
10744
|
if (e.codec === "webvtt")
|
|
10729
10745
|
throw new Error("WebVTT is not supported");
|
|
10730
|
-
return
|
|
10746
|
+
return M(v({}, s), {
|
|
10731
10747
|
type: "audio",
|
|
10732
10748
|
channels: e.channels,
|
|
10733
10749
|
sampleRate: e.sampleRate,
|
|
@@ -10760,14 +10776,14 @@ class cw {
|
|
|
10760
10776
|
w.sort((T, P) => T.brand.localeCompare(P.brand));
|
|
10761
10777
|
const b = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
|
|
10762
10778
|
b.sort((T, P) => T.brand.localeCompare(P.brand));
|
|
10763
|
-
const S = b.map((T) => T.version), I = w.map((T) => T.brand),
|
|
10779
|
+
const S = b.map((T) => T.version), I = w.map((T) => T.brand), k = w.map((T) => T.version), D = parseInt((m = (u = this.highEntropyValues.platformVersion) == null ? void 0 : u.split(".")[0]) != null ? m : "1");
|
|
10764
10780
|
return v({
|
|
10765
10781
|
userAgentLegacy: window.navigator.userAgent,
|
|
10766
10782
|
ua: {
|
|
10767
10783
|
browser: {
|
|
10768
10784
|
brands: I,
|
|
10769
10785
|
fullVersionBrands: S,
|
|
10770
|
-
majorVersions:
|
|
10786
|
+
majorVersions: k
|
|
10771
10787
|
},
|
|
10772
10788
|
device: this.highEntropyValues.model || "Other",
|
|
10773
10789
|
os: {
|
|
@@ -10802,7 +10818,7 @@ const rd = (s, e) => s && typeof s == "object" && e in s, hw = (s) => !(typeof s
|
|
|
10802
10818
|
throw new Error("missing channelId");
|
|
10803
10819
|
return !0;
|
|
10804
10820
|
};
|
|
10805
|
-
var gs,
|
|
10821
|
+
var gs, Me, As;
|
|
10806
10822
|
const Ut = class Ut extends Ei {
|
|
10807
10823
|
constructor(t) {
|
|
10808
10824
|
super();
|
|
@@ -10831,7 +10847,7 @@ const Ut = class Ut extends Ei {
|
|
|
10831
10847
|
r(this, "userAgentInformation", new cw());
|
|
10832
10848
|
r(this, "encryptedMediaExtensions");
|
|
10833
10849
|
d(this, gs, 0);
|
|
10834
|
-
d(this,
|
|
10850
|
+
d(this, Me, []);
|
|
10835
10851
|
r(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map());
|
|
10836
10852
|
r(this, "sizes", /* @__PURE__ */ new Map());
|
|
10837
10853
|
r(this, "isSuspended", !0);
|
|
@@ -10904,7 +10920,7 @@ const Ut = class Ut extends Ei {
|
|
|
10904
10920
|
var m;
|
|
10905
10921
|
this.sessionId = Cu();
|
|
10906
10922
|
const i = this.modules.subscription.getTargetSubscription(), n = t.channels.find((p) => p.channelId === i.channelId);
|
|
10907
|
-
if (this.emitter.emit("connect info", t), "timeshift" in t && t.timeshift ? (t.timeshift, this._channels = t.channels.map((p) =>
|
|
10923
|
+
if (this.emitter.emit("connect info", t), "timeshift" in t && t.timeshift ? (t.timeshift, this._channels = t.channels.map((p) => M(v({}, p), {
|
|
10908
10924
|
timeshift: t.timeshift
|
|
10909
10925
|
})), this.emit("timeshift info", t.timeshift)) : this._channels = t.channels, this.updateTextTracks((m = n == null ? void 0 : n.renditions) != null ? m : []), !this.textTrack && this.options.get("textTrack") && (this.textTrack = this.options.get("textTrack")), yield Promise.all(
|
|
10910
10926
|
t.channels.map((p) => f(this, null, function* () {
|
|
@@ -10944,30 +10960,30 @@ const Ut = class Ut extends Ei {
|
|
|
10944
10960
|
r(this, "updateTextTracks", (t) => {
|
|
10945
10961
|
const i = t.filter((n) => n.codec === "webvtt");
|
|
10946
10962
|
i.forEach((n) => {
|
|
10947
|
-
if (!a(this,
|
|
10963
|
+
if (!a(this, Me).find((c) => c.language === n.language)) {
|
|
10948
10964
|
if (this.modules.canvasModule) {
|
|
10949
10965
|
const c = this.modules.canvasModule.textTracks.addTextTrack(
|
|
10950
10966
|
n.kind,
|
|
10951
10967
|
n.label || n.language || "",
|
|
10952
10968
|
n.language || ""
|
|
10953
10969
|
);
|
|
10954
|
-
a(this,
|
|
10970
|
+
a(this, Me).push(c);
|
|
10955
10971
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
10956
10972
|
const c = this.mediaElement.addTextTrack(
|
|
10957
10973
|
n.kind,
|
|
10958
10974
|
n.label || n.language,
|
|
10959
10975
|
n.language
|
|
10960
10976
|
);
|
|
10961
|
-
a(this,
|
|
10977
|
+
a(this, Me).push(c);
|
|
10962
10978
|
}
|
|
10963
10979
|
}
|
|
10964
10980
|
});
|
|
10965
|
-
for (const n of a(this,
|
|
10981
|
+
for (const n of a(this, Me))
|
|
10966
10982
|
i.find((c) => c.language === n.language) ? n.mode === "disabled" && (n.mode = "hidden") : n.mode = "disabled";
|
|
10967
10983
|
this.emit("text tracks", this.textTracks);
|
|
10968
10984
|
});
|
|
10969
10985
|
r(this, "cleanupTextTracks", (t = this.currentTime - 2e4) => {
|
|
10970
|
-
a(this,
|
|
10986
|
+
a(this, Me).forEach((i) => {
|
|
10971
10987
|
if (i.cues)
|
|
10972
10988
|
for (const n of i.cues)
|
|
10973
10989
|
n.endTime * 1e3 < t - 2e3 && i.removeCue(n);
|
|
@@ -10982,8 +10998,8 @@ const Ut = class Ut extends Ei {
|
|
|
10982
10998
|
if (!ws(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
|
|
10983
10999
|
return !1;
|
|
10984
11000
|
if (!this.willUseMediaSource()) {
|
|
10985
|
-
const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, I = (g = b.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER,
|
|
10986
|
-
return h.bitRate <= S && h.width <= I && h.height <=
|
|
11001
|
+
const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, I = (g = b.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER, k = (w = b.wasmDecodingConstraint.height) != null ? w : Number.MAX_SAFE_INTEGER;
|
|
11002
|
+
return h.bitRate <= S && h.width <= I && h.height <= k;
|
|
10987
11003
|
}
|
|
10988
11004
|
const u = yield cg(h);
|
|
10989
11005
|
if (!u.supported || h.codec == "av1" && !u.smooth && !u.powerEfficient)
|
|
@@ -11011,7 +11027,7 @@ const Ut = class Ut extends Ei {
|
|
|
11011
11027
|
n,
|
|
11012
11028
|
i,
|
|
11013
11029
|
this.targetSubscription.audio.bitRate
|
|
11014
|
-
), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), m = t.renditions.filter(bs), p = t.renditions.filter(ws), g = u.find((I) => m.find((
|
|
11030
|
+
), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), m = t.renditions.filter(bs), p = t.renditions.filter(ws), g = u.find((I) => m.find((k) => k.codec === I) !== void 0), w = h.find((I) => p.find((k) => k.codec === I) !== void 0), b = m.map((I) => I.language);
|
|
11015
11031
|
if (this.logger.debug("supported and selected codecs", { audioCodecs: u, videoCodecs: h, audioCodec: g, videoCodec: w }), w) {
|
|
11016
11032
|
const I = this.options.get("maxSize");
|
|
11017
11033
|
this.modules.subscription.setVideoConstraint(v({
|
|
@@ -11033,7 +11049,7 @@ const Ut = class Ut extends Ei {
|
|
|
11033
11049
|
r(this, "isSupportedVideoCodecProfile", (t, i) => {
|
|
11034
11050
|
if (this.willUseMediaSource()) {
|
|
11035
11051
|
const n = Rr();
|
|
11036
|
-
return n ? n.isTypeSupported(
|
|
11052
|
+
return n ? n.isTypeSupported(Oi({ codec: t, codecString: i })) : !0;
|
|
11037
11053
|
}
|
|
11038
11054
|
if (t === "h264") {
|
|
11039
11055
|
const n = !!(i != null && i.startsWith("avc1.42")), o = !!(i != null && i.startsWith("avc1.66."));
|
|
@@ -11054,12 +11070,12 @@ const Ut = class Ut extends Ei {
|
|
|
11054
11070
|
throw new x("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
|
|
11055
11071
|
if (t != null && t.video && i.push({
|
|
11056
11072
|
type: "video",
|
|
11057
|
-
mimeType:
|
|
11073
|
+
mimeType: Oi(t.video),
|
|
11058
11074
|
codec: t.video.codec
|
|
11059
11075
|
}), t != null && t.audio && i.push({
|
|
11060
11076
|
type: "audio",
|
|
11061
11077
|
codec: t.audio.codec,
|
|
11062
|
-
mimeType:
|
|
11078
|
+
mimeType: Oi(t.audio)
|
|
11063
11079
|
}), i.length === 0)
|
|
11064
11080
|
throw new x("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
|
|
11065
11081
|
if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
|
|
@@ -11149,7 +11165,7 @@ const Ut = class Ut extends Ei {
|
|
|
11149
11165
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
11150
11166
|
return v({
|
|
11151
11167
|
uptime: Date.now() - this.createdAt,
|
|
11152
|
-
version: "4.1.4-
|
|
11168
|
+
version: "4.1.4-20-g9f477019",
|
|
11153
11169
|
clientId: this.clientId,
|
|
11154
11170
|
sessionId: this.sessionId,
|
|
11155
11171
|
channelId: this.channelId,
|
|
@@ -11197,7 +11213,7 @@ const Ut = class Ut extends Ei {
|
|
|
11197
11213
|
}
|
|
11198
11214
|
}, o = ge.get();
|
|
11199
11215
|
o.setLevel(this.options.get("logLevel")), o.setDebug(!1), this.logger = o;
|
|
11200
|
-
const c =
|
|
11216
|
+
const c = qh.create(
|
|
11201
11217
|
this.emitter,
|
|
11202
11218
|
this.logger.createContext("PictureInPictureModule")
|
|
11203
11219
|
), h = Ae.create(), u = Fh.create(this.emitter, this.logger.createContext("ConnectionModule"), {
|
|
@@ -11210,8 +11226,9 @@ const Ut = class Ut extends Ei {
|
|
|
11210
11226
|
n
|
|
11211
11227
|
), p = Yh.create(this.emitter, m), g = $h.create(
|
|
11212
11228
|
this.emitter,
|
|
11213
|
-
this.logger.createContext("QualityOfServiceModule")
|
|
11214
|
-
|
|
11229
|
+
this.logger.createContext("QualityOfServiceModule"),
|
|
11230
|
+
p
|
|
11231
|
+
), w = Jh.create(
|
|
11215
11232
|
this.emitter,
|
|
11216
11233
|
this.logger.createContext("PlaybackModule"),
|
|
11217
11234
|
this,
|
|
@@ -11230,7 +11247,7 @@ const Ut = class Ut extends Ei {
|
|
|
11230
11247
|
}
|
|
11231
11248
|
};
|
|
11232
11249
|
const b = Nh.create(this.emitter), S = this.options.get("poster"), I = S === !0 ? this.getThumbnailUrl() : S || void 0;
|
|
11233
|
-
let
|
|
11250
|
+
let k, D, T;
|
|
11234
11251
|
if (this.willUseMediaSource()) {
|
|
11235
11252
|
const y = new ph({
|
|
11236
11253
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
@@ -11239,9 +11256,9 @@ const Ut = class Ut extends Ei {
|
|
|
11239
11256
|
logger: this.logger.createContext("MediaElement"),
|
|
11240
11257
|
poster: I
|
|
11241
11258
|
});
|
|
11242
|
-
y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, Lu.isSupported() && this.encryptedMediaExtensions.attach(y.element),
|
|
11259
|
+
y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, Lu.isSupported() && this.encryptedMediaExtensions.attach(y.element), k = Xh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = jo.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
|
|
11243
11260
|
} else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
|
|
11244
|
-
const y =
|
|
11261
|
+
const y = Qh.create(
|
|
11245
11262
|
this.emitter,
|
|
11246
11263
|
this.logger.createContext("ModernCanvasModule"),
|
|
11247
11264
|
this.pool,
|
|
@@ -11280,7 +11297,7 @@ const Ut = class Ut extends Ei {
|
|
|
11280
11297
|
this.playbackSource,
|
|
11281
11298
|
w,
|
|
11282
11299
|
this.willUseMediaSource() && !P
|
|
11283
|
-
),
|
|
11300
|
+
), X = cu.create(this.logger.createContext("JitterModule")), Q = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), Fe = new URL("/telemetry", Q).toString(), te = Go.create(
|
|
11284
11301
|
this.logger.createContext("TelemetryModule"),
|
|
11285
11302
|
this.emitter,
|
|
11286
11303
|
{
|
|
@@ -11320,7 +11337,7 @@ const Ut = class Ut extends Ei {
|
|
|
11320
11337
|
),
|
|
11321
11338
|
event: Vh.create(this.emitter, this.logger.createContext("EventModule"), R),
|
|
11322
11339
|
sync: R,
|
|
11323
|
-
jitter:
|
|
11340
|
+
jitter: X,
|
|
11324
11341
|
documentState: b,
|
|
11325
11342
|
connection: u,
|
|
11326
11343
|
playback: w,
|
|
@@ -11329,7 +11346,7 @@ const Ut = class Ut extends Ei {
|
|
|
11329
11346
|
subscription: m,
|
|
11330
11347
|
renditions: p,
|
|
11331
11348
|
qualityOfService: g,
|
|
11332
|
-
mseModule:
|
|
11349
|
+
mseModule: k,
|
|
11333
11350
|
unpause: D,
|
|
11334
11351
|
canvasModule: T
|
|
11335
11352
|
}, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (y) => {
|
|
@@ -11339,10 +11356,10 @@ const Ut = class Ut extends Ei {
|
|
|
11339
11356
|
this.connectionState === "connected" && F && (this.emitter.emit("flush buffers"), this.modules.connection.disconnect("Page inactive timeout"));
|
|
11340
11357
|
}, Ut.DISCONNECT_TIMEOUT)));
|
|
11341
11358
|
});
|
|
11342
|
-
let
|
|
11359
|
+
let Je;
|
|
11343
11360
|
this.emitter.on("context switch complete", () => {
|
|
11344
|
-
|
|
11345
|
-
window.clearTimeout(
|
|
11361
|
+
Je || (Je = window.setTimeout(() => {
|
|
11362
|
+
window.clearTimeout(Je), Je = void 0, this.emit("context switch", "completed"), this.emitLanguagesIfChanged();
|
|
11346
11363
|
}, this.targetBufferTime));
|
|
11347
11364
|
}), this.emitter.on("context switch started", () => this.emit("context switch", "started")), this.emitter.on("needs user input", (y) => this.emit("needs user input", y)), this.emitter.on("event", (y) => {
|
|
11348
11365
|
switch (y.type) {
|
|
@@ -11368,20 +11385,20 @@ const Ut = class Ut extends Ei {
|
|
|
11368
11385
|
y.telemetry && ((N = this.modules.telemetry) == null || N.unload(), this.modules.telemetry = Go.create(
|
|
11369
11386
|
this.logger.createContext("TelemetryModule"),
|
|
11370
11387
|
this.emitter,
|
|
11371
|
-
|
|
11388
|
+
M(v({}, y.telemetry), {
|
|
11372
11389
|
enabled: this.options.get("telemetryEnabled") && F
|
|
11373
11390
|
}),
|
|
11374
11391
|
this
|
|
11375
11392
|
), this.modules.telemetry.load());
|
|
11376
11393
|
}), this.emitter.on("adapt level", (y) => {
|
|
11377
|
-
var xe,
|
|
11394
|
+
var xe, Z, ce, _e, Ne;
|
|
11378
11395
|
this.logger.debug("adapt level", { direction: y });
|
|
11379
11396
|
const E = this.modules.renditions.getRenditionLevels(), F = this.modules.renditions.getRenditionLevel(), G = E.findIndex((ie) => ie === F), L = E.length - 1;
|
|
11380
11397
|
let N = G;
|
|
11381
11398
|
switch (y) {
|
|
11382
11399
|
case "upgrade":
|
|
11383
11400
|
{
|
|
11384
|
-
const ie = Math.min(G + 1, L), ut = E[ie], im = (xe = this.modules.connection.estimatedBandwidth) != null ? xe : Si(), sm = ((ce = (
|
|
11401
|
+
const ie = Math.min(G + 1, L), ut = E[ie], im = (xe = this.modules.connection.estimatedBandwidth) != null ? xe : Si(), sm = ((ce = (Z = ut == null ? void 0 : ut.audio) == null ? void 0 : Z.bitRate) != null ? ce : 0) + ((Ne = (_e = ut == null ? void 0 : ut.video) == null ? void 0 : _e.bitRate) != null ? Ne : 0), nm = im * 2 > sm;
|
|
11385
11402
|
ut && nm && this.modules.adaptivity.isQoSOk(ut) && (N = ie);
|
|
11386
11403
|
}
|
|
11387
11404
|
break;
|
|
@@ -11402,20 +11419,20 @@ const Ut = class Ut extends Ei {
|
|
|
11402
11419
|
}
|
|
11403
11420
|
if (N === G)
|
|
11404
11421
|
return;
|
|
11405
|
-
const
|
|
11406
|
-
this.alignSizeAndBitRate(
|
|
11407
|
-
video: v(v({}, this.targetSubscription.video),
|
|
11408
|
-
audio: v(v({}, this.targetSubscription.audio),
|
|
11422
|
+
const J = E[N];
|
|
11423
|
+
this.alignSizeAndBitRate(M(v({}, this.targetSubscription), {
|
|
11424
|
+
video: v(v({}, this.targetSubscription.video), J == null ? void 0 : J.video),
|
|
11425
|
+
audio: v(v({}, this.targetSubscription.audio), J == null ? void 0 : J.audio)
|
|
11409
11426
|
})), this.emitter.emit("adapted level");
|
|
11410
11427
|
}), this.emitter.on("text track data", (y) => {
|
|
11411
|
-
const E = a(this,
|
|
11428
|
+
const E = a(this, Me).find((N) => N.language === y.language), G = this.modules.sync.getTimeshiftOffset() / 1e3, L = G - a(this, gs);
|
|
11412
11429
|
if (l(this, gs, G), E) {
|
|
11413
11430
|
if (E.cues)
|
|
11414
11431
|
for (const N of E.cues)
|
|
11415
11432
|
N.startTime -= L, N.endTime -= L;
|
|
11416
11433
|
for (const N of y.cues) {
|
|
11417
|
-
const
|
|
11418
|
-
E.addCue(
|
|
11434
|
+
const J = new VTTCue(N.startTime - G, N.endTime - G, N.text);
|
|
11435
|
+
E.addCue(J);
|
|
11419
11436
|
}
|
|
11420
11437
|
}
|
|
11421
11438
|
}), this.emitter.on("received signal", (y) => {
|
|
@@ -11466,9 +11483,9 @@ const Ut = class Ut extends Ei {
|
|
|
11466
11483
|
this.logger.warn("Received unwanted message", v({}, F));
|
|
11467
11484
|
return;
|
|
11468
11485
|
}
|
|
11469
|
-
Be(
|
|
11486
|
+
Be(M(v({}, F), { channelId: E.channelId }));
|
|
11470
11487
|
}), this.emitter.on("received moq data", (y) => {
|
|
11471
|
-
var N,
|
|
11488
|
+
var N, J, xe;
|
|
11472
11489
|
const E = y.payload.mediaType(), F = y.channelId, G = y.renditionId, L = this.modules.sync.processFragment(F, y.payload);
|
|
11473
11490
|
if (E !== "text" && this.modules.jitter.recordSample({
|
|
11474
11491
|
type: E,
|
|
@@ -11483,18 +11500,18 @@ const Ut = class Ut extends Ei {
|
|
|
11483
11500
|
type: "language switch",
|
|
11484
11501
|
language: y.switchInfo.language,
|
|
11485
11502
|
timestamp: L.baseMediaDecodeTime() / L.timescale() * 1e3
|
|
11486
|
-
}), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength), L.fragment().emsgs.forEach((
|
|
11487
|
-
if (!
|
|
11503
|
+
}), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength), L.fragment().emsgs.forEach((Z) => {
|
|
11504
|
+
if (!Z.presentationTime)
|
|
11488
11505
|
return;
|
|
11489
|
-
const ce = Uf(
|
|
11506
|
+
const ce = Uf(Z.data);
|
|
11490
11507
|
ce && this.modules.event.addEvent({
|
|
11491
|
-
id:
|
|
11492
|
-
timestamp:
|
|
11508
|
+
id: Z.id,
|
|
11509
|
+
timestamp: Z.presentationTime / Z.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
|
|
11493
11510
|
content: ce.txx.value,
|
|
11494
11511
|
type: "metadata"
|
|
11495
11512
|
});
|
|
11496
11513
|
}), this.modules.decoder) {
|
|
11497
|
-
const
|
|
11514
|
+
const Z = (N = L.header().init().moov.traks[0]) == null ? void 0 : N.mdia.minf.stbl.stsd, ce = (J = Z == null ? void 0 : Z.avc1) == null ? void 0 : J.avcC.bytes, _e = (xe = Z == null ? void 0 : Z.codec) != null ? xe : "h264";
|
|
11498
11515
|
if (ce) {
|
|
11499
11516
|
const Ne = ce.buffer.slice(ce.byteOffset, ce.byteOffset + ce.byteLength);
|
|
11500
11517
|
if (E === "text")
|
|
@@ -11514,7 +11531,7 @@ const Ut = class Ut extends Ei {
|
|
|
11514
11531
|
}
|
|
11515
11532
|
for (let Ne = 0; Ne < L.samplesCount(); Ne++) {
|
|
11516
11533
|
const ie = L.sample(Ne);
|
|
11517
|
-
ie && this.emitter.emit("coded sample",
|
|
11534
|
+
ie && this.emitter.emit("coded sample", M(v({}, ie), {
|
|
11518
11535
|
renditionId: G,
|
|
11519
11536
|
channelId: F,
|
|
11520
11537
|
data: ie.data.buffer.slice(ie.data.byteOffset, ie.data.byteOffset + ie.data.byteLength)
|
|
@@ -11533,14 +11550,14 @@ const Ut = class Ut extends Ei {
|
|
|
11533
11550
|
if (tg(y.flags)) {
|
|
11534
11551
|
const L = new TextDecoder().decode(y.payload), N = this.modules.sync.getTimeshiftOffset();
|
|
11535
11552
|
if (y.renditionId !== 0) {
|
|
11536
|
-
const
|
|
11537
|
-
if (
|
|
11538
|
-
const
|
|
11553
|
+
const J = pm(L);
|
|
11554
|
+
if (J && J.language !== void 0) {
|
|
11555
|
+
const Z = new qd().parse(J.content || ""), ce = N / 1e3, _e = a(this, Me).find((ie) => ie.language === J.language), Ne = ce - a(this, gs);
|
|
11539
11556
|
if (l(this, gs, ce), _e) {
|
|
11540
11557
|
if (_e.cues)
|
|
11541
11558
|
for (const ie of _e.cues)
|
|
11542
11559
|
ie.startTime -= Ne, ie.endTime -= Ne;
|
|
11543
|
-
for (const ie of
|
|
11560
|
+
for (const ie of Z) {
|
|
11544
11561
|
const ut = new VTTCue(ie.startTime - ce, ie.endTime - ce, ie.text);
|
|
11545
11562
|
_e.addCue(ut);
|
|
11546
11563
|
}
|
|
@@ -11557,16 +11574,16 @@ const Ut = class Ut extends Ei {
|
|
|
11557
11574
|
if (G === "text")
|
|
11558
11575
|
throw new Error("Subtitles are not supported");
|
|
11559
11576
|
if (this.modules.incomingData.add(G, y.payload.byteLength), Kp(y.flags)) {
|
|
11560
|
-
const L =
|
|
11577
|
+
const L = M(v({
|
|
11561
11578
|
type: G,
|
|
11562
11579
|
data: y.payload,
|
|
11563
11580
|
codec: F.codec
|
|
11564
11581
|
}, y), {
|
|
11565
11582
|
channelId: E
|
|
11566
|
-
}), N =
|
|
11583
|
+
}), N = Xp(L.codec, L.payload);
|
|
11567
11584
|
N && this.sizes.set(L.renditionId, N);
|
|
11568
|
-
const
|
|
11569
|
-
this.emitter.emit("init segment", { initSegment: L, mimeType:
|
|
11585
|
+
const J = Oi({ codec: F.codec, codecString: F.codecString });
|
|
11586
|
+
this.emitter.emit("init segment", { initSegment: L, mimeType: J }), this.emit("initialized media");
|
|
11570
11587
|
} else {
|
|
11571
11588
|
const L = ow(y, F, this.sizes.get(y.renditionId));
|
|
11572
11589
|
this.modules.jitter.recordSample(L);
|
|
@@ -11576,13 +11593,13 @@ const Ut = class Ut extends Ei {
|
|
|
11576
11593
|
this.modules.sync.processSample(L)
|
|
11577
11594
|
), this.sampleProcessingSesssions.set(G, N);
|
|
11578
11595
|
else {
|
|
11579
|
-
const
|
|
11596
|
+
const J = N(
|
|
11580
11597
|
this.modules.sync.processSample(L),
|
|
11581
11598
|
this.isSwitchingRenditionLevel && L.type === "video"
|
|
11582
11599
|
);
|
|
11583
11600
|
let xe = L;
|
|
11584
|
-
|
|
11585
|
-
this.modules.event.extractEvent(
|
|
11601
|
+
J.forEach((Z) => {
|
|
11602
|
+
this.modules.event.extractEvent(Z, xe), this.emitter.emit("coded sample", Z), xe = Z;
|
|
11586
11603
|
});
|
|
11587
11604
|
}
|
|
11588
11605
|
}
|
|
@@ -11788,7 +11805,7 @@ const Ut = class Ut extends Ei {
|
|
|
11788
11805
|
* Set the active text track
|
|
11789
11806
|
*/
|
|
11790
11807
|
set textTrack(t) {
|
|
11791
|
-
a(this,
|
|
11808
|
+
a(this, Me).forEach((i) => {
|
|
11792
11809
|
i.label === t ? i.mode = "showing" : i.mode = "hidden";
|
|
11793
11810
|
}), this.emitter.emit("text track", t);
|
|
11794
11811
|
}
|
|
@@ -11796,14 +11813,14 @@ const Ut = class Ut extends Ei {
|
|
|
11796
11813
|
* Get the available text tracks
|
|
11797
11814
|
*/
|
|
11798
11815
|
get textTracks() {
|
|
11799
|
-
return a(this,
|
|
11816
|
+
return a(this, Me).filter((t) => t.mode !== "disabled").map((t) => t.label);
|
|
11800
11817
|
}
|
|
11801
11818
|
/**
|
|
11802
11819
|
* Get the active text track
|
|
11803
11820
|
*/
|
|
11804
11821
|
get textTrack() {
|
|
11805
11822
|
var t;
|
|
11806
|
-
return (t = a(this,
|
|
11823
|
+
return (t = a(this, Me).find((i) => i.mode === "showing")) == null ? void 0 : t.label;
|
|
11807
11824
|
}
|
|
11808
11825
|
/**
|
|
11809
11826
|
* The current channelId
|
|
@@ -11977,7 +11994,7 @@ const Ut = class Ut extends Ei {
|
|
|
11977
11994
|
* Aligns size and bitrate to match a rendition level correctly
|
|
11978
11995
|
*/
|
|
11979
11996
|
alignSizeAndBitRate(t) {
|
|
11980
|
-
const i = this.modules.constraintCap.constrainSubscription(
|
|
11997
|
+
const i = this.modules.constraintCap.constrainSubscription(M(v({}, t), {
|
|
11981
11998
|
video: v({}, t.video),
|
|
11982
11999
|
audio: v({}, t.audio)
|
|
11983
12000
|
})), n = this.modules.constraintCap.getUserSpecifiedCap();
|
|
@@ -12004,10 +12021,10 @@ const Ut = class Ut extends Ei {
|
|
|
12004
12021
|
return this.browser.supportsMediaSource && this.options.get("mseEnabled");
|
|
12005
12022
|
}
|
|
12006
12023
|
};
|
|
12007
|
-
gs = new WeakMap(),
|
|
12024
|
+
gs = new WeakMap(), Me = new WeakMap(), As = new WeakMap(), r(Ut, "MAX_POOL_SIZE", 10), r(Ut, "DISCONNECT_TIMEOUT", 15 * 1e3), r(Ut, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
|
|
12008
12025
|
let ad = Ut;
|
|
12009
12026
|
export {
|
|
12010
|
-
|
|
12027
|
+
Jm as A,
|
|
12011
12028
|
Dm as C,
|
|
12012
12029
|
zm as D,
|
|
12013
12030
|
oe as F,
|
|
@@ -12015,13 +12032,13 @@ export {
|
|
|
12015
12032
|
ge as L,
|
|
12016
12033
|
Nm as N,
|
|
12017
12034
|
ad as V,
|
|
12018
|
-
|
|
12035
|
+
Om as a,
|
|
12019
12036
|
pw as b,
|
|
12020
12037
|
Fm as c,
|
|
12021
12038
|
Km as d,
|
|
12022
|
-
|
|
12039
|
+
Mm as e,
|
|
12023
12040
|
_m as f,
|
|
12024
12041
|
x as g,
|
|
12025
12042
|
Im as i,
|
|
12026
|
-
|
|
12043
|
+
O as n
|
|
12027
12044
|
};
|