@vindral/web-sdk 4.1.2-4-gb79bb2ad → 4.1.2-6-gc1642161
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/{TuOTFcqL.js → B-uE2TJ9.js} +437 -435
- package/{BL0CHhTL.js → BkM9Zev_.js} +1 -1
- package/{DP53RvxV.js → Bs3ZbgIy.js} +90 -69
- package/{CNigNwUf.js → Ci6s9XWs.js} +1 -1
- package/api-client.js +1 -1
- package/core.js +1 -1
- package/legacy.es.js +990 -967
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.js +2 -2
|
@@ -22,10 +22,10 @@ var wd = (s, e) => {
|
|
|
22
22
|
e.indexOf(i) < 0 && Ad.call(s, i) && (t[i] = s[i]);
|
|
23
23
|
return t;
|
|
24
24
|
};
|
|
25
|
-
var
|
|
25
|
+
var Si = (s) => {
|
|
26
26
|
var e;
|
|
27
27
|
return [, , , tm((e = s == null ? void 0 : s[ht("metadata")]) != null ? e : null)];
|
|
28
|
-
}, bd = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], qn = (s) => s !== void 0 && typeof s != "function" ? kt("Function expected") : s, rm = (s, e, t, i, n) => ({ kind: bd[s], name: e, metadata: i, addInitializer: (o) => t._ ? kt("Already initialized") : n.push(qn(o || null)) }),
|
|
28
|
+
}, bd = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], qn = (s) => s !== void 0 && typeof s != "function" ? kt("Function expected") : s, rm = (s, e, t, i, n) => ({ kind: bd[s], name: e, metadata: i, addInitializer: (o) => t._ ? kt("Already initialized") : n.push(qn(o || null)) }), Xt = (s, e) => Za(e, ht("metadata"), s[3]), Ei = (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) => {
|
|
@@ -37,7 +37,7 @@ var vi = (s) => {
|
|
|
37
37
|
g ? b && g < 4 && pd(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : pd(n, t);
|
|
38
38
|
for (var U = i.length - 1; U >= 0; U--)
|
|
39
39
|
m = rm(g, t, d = {}, s[3], M), g && (m.static = w, m.private = b, p = m.access = { has: b ? (k) => am(n, k) : (k) => t in k }, g ^ 3 && (p.get = b ? (k) => (g ^ 1 ? a : A)(k, n, g ^ 4 ? o : T.get) : (k) => k[t]), g > 2 && (p.set = b ? (k, _) => l(k, n, _, g ^ 4 ? o : T.set) : (k, _) => k[t] = _)), h = (0, i[U])(g ? g < 4 ? b ? o : T[x] : g > 4 ? void 0 : { get: T.get, set: T.set } : n, m), d._ = 1, g ^ 4 || h === void 0 ? qn(h) && (g > 4 ? R.unshift(h) : g ? b ? o = h : T[x] = h : n = h) : typeof h != "object" || h === null ? kt("Object expected") : (qn(c = h.get) && (T.get = c), qn(c = h.set) && (T.set = c), qn(c = h.init) && R.unshift(c));
|
|
40
|
-
return g ||
|
|
40
|
+
return g || Xt(s, n), T && Gc(n, t, T), b ? g ^ 4 ? o : T : n;
|
|
41
41
|
}, r = (s, e, t) => Za(s, typeof e != "symbol" ? e + "" : e, t), jc = (s, e, t) => e.has(s) || kt("Cannot " + t), am = (s, e) => Object(e) !== e ? kt('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => (jc(s, e, "read from private field"), t ? t.call(s) : e.get(s)), u = (s, e, t) => e.has(s) ? kt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), l = (s, e, t, i) => (jc(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), A = (s, e, t) => (jc(s, e, "access private method"), t);
|
|
42
42
|
var Ze = (s, e, t, i) => ({
|
|
43
43
|
set _(n) {
|
|
@@ -120,8 +120,8 @@ var Ne = (s, e, t) => {
|
|
|
120
120
|
};
|
|
121
121
|
return o();
|
|
122
122
|
};
|
|
123
|
-
import { E as
|
|
124
|
-
import { a as Xe, p as Au, i as wu, c as om, b as cm, A as hm, d as dm, t as um, e as lm } from "./
|
|
123
|
+
import { E as yi } from "./Bx7s5QdT.js";
|
|
124
|
+
import { a as Xe, p as Au, i as wu, c as om, b as cm, A as hm, d as dm, t as um, e as lm } from "./Bs3ZbgIy.js";
|
|
125
125
|
class yd {
|
|
126
126
|
constructor(e) {
|
|
127
127
|
r(this, "maxSize", 0);
|
|
@@ -413,13 +413,13 @@ const Su = () => {
|
|
|
413
413
|
i = i * 256 + s[n];
|
|
414
414
|
return i;
|
|
415
415
|
};
|
|
416
|
-
var ie, Ut,
|
|
416
|
+
var ie, Ut, Jt;
|
|
417
417
|
class zn {
|
|
418
418
|
constructor(e) {
|
|
419
419
|
u(this, ie);
|
|
420
420
|
u(this, Ut);
|
|
421
|
-
u(this,
|
|
422
|
-
l(this, Ut, e), l(this,
|
|
421
|
+
u(this, Jt);
|
|
422
|
+
l(this, Ut, e), l(this, Jt, new DataView(e.buffer, e.byteOffset, e.byteLength)), l(this, ie, 0);
|
|
423
423
|
}
|
|
424
424
|
position() {
|
|
425
425
|
return a(this, ie);
|
|
@@ -434,19 +434,19 @@ class zn {
|
|
|
434
434
|
return a(this, Ut).length - a(this, ie);
|
|
435
435
|
}
|
|
436
436
|
readUint8() {
|
|
437
|
-
const e = a(this,
|
|
437
|
+
const e = a(this, Jt).getUint8(a(this, ie));
|
|
438
438
|
return l(this, ie, a(this, ie) + 1), e;
|
|
439
439
|
}
|
|
440
440
|
readUint24() {
|
|
441
|
-
const e = a(this,
|
|
441
|
+
const e = a(this, Jt).getUint32(a(this, ie)) >> 8 & 16777215;
|
|
442
442
|
return l(this, ie, a(this, ie) + 3), e;
|
|
443
443
|
}
|
|
444
444
|
readUint16() {
|
|
445
|
-
const e = a(this,
|
|
445
|
+
const e = a(this, Jt).getUint16(a(this, ie));
|
|
446
446
|
return l(this, ie, a(this, ie) + 2), e;
|
|
447
447
|
}
|
|
448
448
|
readUint32() {
|
|
449
|
-
const e = a(this,
|
|
449
|
+
const e = a(this, Jt).getUint32(a(this, ie));
|
|
450
450
|
return l(this, ie, a(this, ie) + 4), e;
|
|
451
451
|
}
|
|
452
452
|
readUint64() {
|
|
@@ -468,7 +468,7 @@ class zn {
|
|
|
468
468
|
return new TextDecoder().decode(new Uint8Array(e));
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
ie = new WeakMap(), Ut = new WeakMap(),
|
|
471
|
+
ie = new WeakMap(), Ut = new WeakMap(), Jt = new WeakMap();
|
|
472
472
|
class Em {
|
|
473
473
|
constructor(e = 100, t = 100) {
|
|
474
474
|
r(this, "resizeSteps");
|
|
@@ -554,7 +554,7 @@ class Es {
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
|
-
const Xn = (s) => s.reduce((e, t) => e + t, 0) / s.length,
|
|
557
|
+
const Xn = (s) => s.reduce((e, t) => e + t, 0) / s.length, Yt = (s) => ({
|
|
558
558
|
last: s[s.length - 1] || 0,
|
|
559
559
|
average: s.length === 0 ? 0 : Xn(s),
|
|
560
560
|
max: s.length === 0 ? 0 : Math.max(...s),
|
|
@@ -593,7 +593,7 @@ class Im {
|
|
|
593
593
|
return this.rates.isEmpty() ? 0 : Xn(this.rates.items());
|
|
594
594
|
}
|
|
595
595
|
get minMaxAverage() {
|
|
596
|
-
return
|
|
596
|
+
return Yt(this.rates.items());
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
const Ss = (s, e) => {
|
|
@@ -607,12 +607,12 @@ const Ss = (s, e) => {
|
|
|
607
607
|
}, vd = ["off", "error", "warn", "info", "debug", "trace"], Cm = {
|
|
608
608
|
OFF: "off"
|
|
609
609
|
};
|
|
610
|
-
var
|
|
611
|
-
const
|
|
610
|
+
var xi, xr, Li, Ws, zs;
|
|
611
|
+
const Zt = class Zt {
|
|
612
612
|
constructor({ context: e, logLevel: t, debug: i }) {
|
|
613
|
-
u(this,
|
|
613
|
+
u(this, xi, /* @__PURE__ */ new Map());
|
|
614
614
|
u(this, xr, "");
|
|
615
|
-
u(this,
|
|
615
|
+
u(this, Li, !1);
|
|
616
616
|
u(this, Ws, "off");
|
|
617
617
|
r(this, "trace", (...e) => {
|
|
618
618
|
});
|
|
@@ -628,11 +628,11 @@ const Xt = class Xt {
|
|
|
628
628
|
});
|
|
629
629
|
r(this, "count", (...e) => {
|
|
630
630
|
});
|
|
631
|
-
l(this, xr, e), l(this, Ws, t), l(this,
|
|
631
|
+
l(this, xr, e), l(this, Ws, t), l(this, Li, i || !1), this.setLevel(t), this.setDebug(a(this, Li));
|
|
632
632
|
}
|
|
633
633
|
setDebug(e) {
|
|
634
|
-
l(this,
|
|
635
|
-
for (const [t, i] of a(this,
|
|
634
|
+
l(this, Li, e);
|
|
635
|
+
for (const [t, i] of a(this, xi))
|
|
636
636
|
i.setDebug(e);
|
|
637
637
|
e ? (this.table = console.table.bind(console), this.count = console.count.bind(console)) : (this.table = () => {
|
|
638
638
|
}, this.count = () => {
|
|
@@ -640,7 +640,7 @@ const Xt = class Xt {
|
|
|
640
640
|
}
|
|
641
641
|
setLevel(e) {
|
|
642
642
|
l(this, Ws, e);
|
|
643
|
-
for (const [i, n] of a(this,
|
|
643
|
+
for (const [i, n] of a(this, xi))
|
|
644
644
|
n.setLevel(e);
|
|
645
645
|
const t = vd.indexOf(e);
|
|
646
646
|
for (const [i, n] of vd.entries())
|
|
@@ -655,19 +655,19 @@ const Xt = class Xt {
|
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
createContext(e) {
|
|
658
|
-
const t = a(this,
|
|
658
|
+
const t = a(this, xi).get(e);
|
|
659
659
|
if (!t) {
|
|
660
|
-
const i = new
|
|
661
|
-
return a(this,
|
|
660
|
+
const i = new Zt({ context: `${e}`, logLevel: a(this, Ws), debug: a(this, Li) });
|
|
661
|
+
return a(this, xi).set(e, i), i;
|
|
662
662
|
}
|
|
663
663
|
return t;
|
|
664
664
|
}
|
|
665
665
|
static get() {
|
|
666
|
-
return a(
|
|
666
|
+
return a(Zt, zs) || l(Zt, zs, new Zt({ context: "Vindral", logLevel: "off" })), a(Zt, zs);
|
|
667
667
|
}
|
|
668
668
|
};
|
|
669
|
-
|
|
670
|
-
let ge =
|
|
669
|
+
xi = new WeakMap(), xr = new WeakMap(), Li = new WeakMap(), Ws = new WeakMap(), zs = new WeakMap(), u(Zt, zs);
|
|
670
|
+
let ge = Zt;
|
|
671
671
|
function Pe(s) {
|
|
672
672
|
const e = ge.get().createContext(s.context);
|
|
673
673
|
return function(i, n) {
|
|
@@ -716,31 +716,31 @@ class km {
|
|
|
716
716
|
Lr = new WeakSet(), ah = function() {
|
|
717
717
|
this.unlocker.resolve(this.value);
|
|
718
718
|
};
|
|
719
|
-
var
|
|
719
|
+
var Di, Oi;
|
|
720
720
|
class Bm {
|
|
721
721
|
constructor(e) {
|
|
722
|
-
u(this,
|
|
723
|
-
u(this,
|
|
724
|
-
l(this,
|
|
722
|
+
u(this, Di);
|
|
723
|
+
u(this, Oi, new H());
|
|
724
|
+
l(this, Di, e), a(this, Oi).resolve(e);
|
|
725
725
|
}
|
|
726
726
|
unsafeValue() {
|
|
727
|
-
return a(this,
|
|
727
|
+
return a(this, Di);
|
|
728
728
|
}
|
|
729
729
|
isLocked() {
|
|
730
|
-
return a(this,
|
|
730
|
+
return a(this, Oi).pending;
|
|
731
731
|
}
|
|
732
732
|
lock() {
|
|
733
733
|
return f(this, null, function* () {
|
|
734
734
|
const e = new H();
|
|
735
735
|
e.promise.then((i) => {
|
|
736
|
-
l(this,
|
|
736
|
+
l(this, Di, i);
|
|
737
737
|
}).catch(D);
|
|
738
|
-
const t = a(this,
|
|
739
|
-
return l(this,
|
|
738
|
+
const t = a(this, Oi).promise.then(() => e);
|
|
739
|
+
return l(this, Oi, e), yield t, new km(a(this, Di), e);
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
|
|
743
|
+
Di = new WeakMap(), Oi = new WeakMap();
|
|
744
744
|
var je, Je;
|
|
745
745
|
class Ie {
|
|
746
746
|
constructor(e) {
|
|
@@ -806,14 +806,14 @@ const Sd = (s, e) => {
|
|
|
806
806
|
return typeof t != "object" || e.forEach((i) => {
|
|
807
807
|
delete t[i];
|
|
808
808
|
}), t;
|
|
809
|
-
},
|
|
809
|
+
}, Ci = (s, e = Date.now()) => {
|
|
810
810
|
const t = s.length;
|
|
811
811
|
if (t > 0) {
|
|
812
812
|
const i = t - 1, n = s[i];
|
|
813
813
|
n.end || (n.end = e);
|
|
814
814
|
}
|
|
815
815
|
}, Ts = (s, e = Date.now()) => {
|
|
816
|
-
|
|
816
|
+
Ci(s), s.push({ start: e });
|
|
817
817
|
}, Is = (s) => s.reduce((e, t) => {
|
|
818
818
|
var i;
|
|
819
819
|
return e + (((i = t.end) != null ? i : Date.now()) - t.start);
|
|
@@ -866,7 +866,7 @@ const Td = () => {
|
|
|
866
866
|
return new Promise((n, o) => setTimeout(() => o(e), s));
|
|
867
867
|
}), Rm = (s, e) => f(null, null, function* () {
|
|
868
868
|
throw yield s, new Error(e);
|
|
869
|
-
}), fs = (s) => "width" in s && typeof s.width == "number", ps = (s) => "sampleRate" in s && typeof s.sampleRate == "number",
|
|
869
|
+
}), fs = (s) => "width" in s && typeof s.width == "number", ps = (s) => "sampleRate" in s && typeof s.sampleRate == "number", Pi = (s) => {
|
|
870
870
|
switch (s.codec) {
|
|
871
871
|
case "opus":
|
|
872
872
|
return 'audio/mp4; codecs="opus"';
|
|
@@ -881,7 +881,7 @@ const Td = () => {
|
|
|
881
881
|
case "av1":
|
|
882
882
|
return s.codecString ? `video/mp4; codecs="${s.codecString}"` : "video/mp4";
|
|
883
883
|
}
|
|
884
|
-
},
|
|
884
|
+
}, bi = () => Number.MAX_SAFE_INTEGER, co = () => ({
|
|
885
885
|
width: Number.MAX_SAFE_INTEGER,
|
|
886
886
|
height: Number.MAX_SAFE_INTEGER
|
|
887
887
|
}), Id = (s) => !(typeof s != "object" || s === null || !("type" in s)), Um = {
|
|
@@ -896,8 +896,8 @@ const Td = () => {
|
|
|
896
896
|
maxBufferTime: 1500,
|
|
897
897
|
logLevel: Cm.OFF,
|
|
898
898
|
maxSize: co(),
|
|
899
|
-
maxVideoBitRate:
|
|
900
|
-
maxAudioBitRate:
|
|
899
|
+
maxVideoBitRate: bi(),
|
|
900
|
+
maxAudioBitRate: bi(),
|
|
901
901
|
tags: [],
|
|
902
902
|
media: "audio+video",
|
|
903
903
|
poster: !0,
|
|
@@ -1094,7 +1094,7 @@ const qm = (s, e) => new P(
|
|
|
1094
1094
|
mediaKeySystemAccess: n
|
|
1095
1095
|
};
|
|
1096
1096
|
});
|
|
1097
|
-
var
|
|
1097
|
+
var Mi, Fi;
|
|
1098
1098
|
class Mc {
|
|
1099
1099
|
constructor(e, t, i, n) {
|
|
1100
1100
|
r(this, "keySystem");
|
|
@@ -1102,20 +1102,20 @@ class Mc {
|
|
|
1102
1102
|
r(this, "certificate");
|
|
1103
1103
|
r(this, "headers", {});
|
|
1104
1104
|
r(this, "queryParams", {});
|
|
1105
|
-
u(this, Oi);
|
|
1106
1105
|
u(this, Mi);
|
|
1107
|
-
|
|
1106
|
+
u(this, Fi);
|
|
1107
|
+
l(this, Mi, t), this.keySystem = e, this.licenseServerUrl = i, this.certificate = n;
|
|
1108
1108
|
}
|
|
1109
1109
|
get statistics() {
|
|
1110
1110
|
return {
|
|
1111
|
-
keySystem: a(this,
|
|
1111
|
+
keySystem: a(this, Mi).keySystem,
|
|
1112
1112
|
licenseServerUrl: this.licenseServerUrl,
|
|
1113
|
-
mediaKeySystemConfiguration: a(this,
|
|
1113
|
+
mediaKeySystemConfiguration: a(this, Mi).getConfiguration()
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
1116
|
getMediaKeys() {
|
|
1117
1117
|
return f(this, null, function* () {
|
|
1118
|
-
return a(this,
|
|
1118
|
+
return a(this, Fi) ? a(this, Fi) : (l(this, Fi, yield a(this, Mi).createMediaKeys()), a(this, Fi));
|
|
1119
1119
|
});
|
|
1120
1120
|
}
|
|
1121
1121
|
requestLicense(e) {
|
|
@@ -1136,7 +1136,7 @@ class Mc {
|
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
|
|
1139
|
+
Mi = new WeakMap(), Fi = new WeakMap();
|
|
1140
1140
|
function Uu(s) {
|
|
1141
1141
|
const e = window.atob(s.replace(/-/g, "+").replace(/_/g, "/"));
|
|
1142
1142
|
let t = "";
|
|
@@ -1239,18 +1239,18 @@ class Af extends Mc {
|
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
1241
|
const wf = 5e3;
|
|
1242
|
-
var G,
|
|
1242
|
+
var G, _i, Pt, Ke, lt, de, Kt, ei, Go, Hs, Or, Mr, ne, Pu, xu, Lu, Du, jo, Wo, Ou, Kn, zo, Mu, Fu;
|
|
1243
1243
|
class xd {
|
|
1244
1244
|
constructor(e, t, i = {}) {
|
|
1245
1245
|
u(this, ne);
|
|
1246
1246
|
u(this, G);
|
|
1247
|
-
u(this,
|
|
1247
|
+
u(this, _i);
|
|
1248
1248
|
u(this, Pt);
|
|
1249
1249
|
u(this, Ke, new H());
|
|
1250
1250
|
u(this, lt);
|
|
1251
1251
|
u(this, de);
|
|
1252
|
-
u(this,
|
|
1253
|
-
u(this,
|
|
1252
|
+
u(this, Kt, /* @__PURE__ */ new Map());
|
|
1253
|
+
u(this, ei);
|
|
1254
1254
|
u(this, Go, Su());
|
|
1255
1255
|
/**
|
|
1256
1256
|
* Timeout to wait for new drm data when channel switch happens
|
|
@@ -1270,7 +1270,7 @@ class xd {
|
|
|
1270
1270
|
var o, c;
|
|
1271
1271
|
a(this, G).debug("Session message received", { event: e });
|
|
1272
1272
|
const t = e.target, i = e.message;
|
|
1273
|
-
if (!a(this,
|
|
1273
|
+
if (!a(this, Kt).get(t)) {
|
|
1274
1274
|
a(this, G).error("No active session found for event", { event: e });
|
|
1275
1275
|
return;
|
|
1276
1276
|
}
|
|
@@ -1309,7 +1309,7 @@ class xd {
|
|
|
1309
1309
|
let c = null;
|
|
1310
1310
|
return n === "clearkey" ? (Xe(e.clearkeys, "No clearkeys found"), c = new mf(o, e.clearkeys)) : n === "playready" ? (Xe(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new gf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Xe(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new Af(o, e.widevineLicenseUrl)) : n === "fairplay" && (Xe(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Xe(e.fairplayCertificate, "No fairplayCertificate found"), c = new ff(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, lt).headers || {}, c.queryParams = a(this, lt).queryParams || {}), c;
|
|
1311
1311
|
}));
|
|
1312
|
-
l(this,
|
|
1312
|
+
l(this, _i, e), l(this, G, t), l(this, lt, i), a(this, _i).on("received drm data", a(this, Or));
|
|
1313
1313
|
}
|
|
1314
1314
|
static isSupported() {
|
|
1315
1315
|
return !!navigator.requestMediaKeySystemAccess;
|
|
@@ -1323,9 +1323,9 @@ class xd {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
unload() {
|
|
1325
1325
|
var e;
|
|
1326
|
-
a(this, G).info("Unloading EncryptedMediaExtensions"), a(this,
|
|
1326
|
+
a(this, G).info("Unloading EncryptedMediaExtensions"), a(this, _i).off("received drm data", a(this, Or)), (e = a(this, Pt)) == null || e.removeEventListener("encrypted", a(this, Mr)), a(this, Kt).forEach((t, i) => {
|
|
1327
1327
|
i.close();
|
|
1328
|
-
}), a(this,
|
|
1328
|
+
}), a(this, Kt).clear(), l(this, ei, void 0), l(this, de, void 0);
|
|
1329
1329
|
}
|
|
1330
1330
|
set headers(e) {
|
|
1331
1331
|
a(this, lt).headers = e, a(this, de) && (a(this, de).headers = e);
|
|
@@ -1348,7 +1348,7 @@ class xd {
|
|
|
1348
1348
|
}, wf));
|
|
1349
1349
|
}
|
|
1350
1350
|
}
|
|
1351
|
-
G = new WeakMap(),
|
|
1351
|
+
G = new WeakMap(), _i = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), lt = new WeakMap(), de = new WeakMap(), Kt = new WeakMap(), ei = new WeakMap(), Go = new WeakMap(), Hs = new WeakMap(), Or = new WeakMap(), Mr = new WeakMap(), ne = new WeakSet(), Pu = function(e) {
|
|
1352
1352
|
return f(this, null, function* () {
|
|
1353
1353
|
try {
|
|
1354
1354
|
yield A(this, ne, xu).call(this), a(this, G).debug("Media keys initialization completed"), yield A(this, ne, Lu).call(this, e.initData, e.initDataType);
|
|
@@ -1365,16 +1365,16 @@ G = new WeakMap(), Fi = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), l
|
|
|
1365
1365
|
a(this, G).debug("Media keys already set on media element");
|
|
1366
1366
|
return;
|
|
1367
1367
|
}
|
|
1368
|
-
if (a(this,
|
|
1369
|
-
a(this, G).debug("Media keys initialization already in progress, waiting for completion"), yield a(this,
|
|
1368
|
+
if (a(this, ei)) {
|
|
1369
|
+
a(this, G).debug("Media keys initialization already in progress, waiting for completion"), yield a(this, ei);
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
|
-
l(this,
|
|
1372
|
+
l(this, ei, f(this, null, function* () {
|
|
1373
1373
|
const i = yield a(this, zo).call(this, e);
|
|
1374
1374
|
a(this, G).debug("CDM obtained", { cdm: i }), Xe(a(this, Pt), "No media element found"), Xe(i, "No CDM found");
|
|
1375
1375
|
const n = yield i.getMediaKeys();
|
|
1376
1376
|
i.certificate && (yield A(this, ne, Ou).call(this, n, i.certificate)), a(this, G).debug("Setting media keys on media element"), yield a(this, Pt).setMediaKeys(n), l(this, de, i);
|
|
1377
|
-
})), yield a(this,
|
|
1377
|
+
})), yield a(this, ei);
|
|
1378
1378
|
});
|
|
1379
1379
|
}, Lu = function(e, t) {
|
|
1380
1380
|
return f(this, null, function* () {
|
|
@@ -1387,10 +1387,10 @@ G = new WeakMap(), Fi = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), l
|
|
|
1387
1387
|
const n = i.createSession();
|
|
1388
1388
|
a(this, G).debug("Creating new session", { session: n }), n.addEventListener("keystatuseschange", a(this, Wo)), n.closed.then((o) => {
|
|
1389
1389
|
a(this, G).info("Session is closed", { reason: o });
|
|
1390
|
-
}), n.addEventListener("message", a(this, jo)), a(this,
|
|
1390
|
+
}), n.addEventListener("message", a(this, jo)), a(this, Kt).set(n, e), a(this, G).debug("Generating request for session", { session: n, initDataType: t, initData: e }), yield n.generateRequest(t, e);
|
|
1391
1391
|
});
|
|
1392
1392
|
}, Du = function(e) {
|
|
1393
|
-
for (const [t, i] of a(this,
|
|
1393
|
+
for (const [t, i] of a(this, Kt))
|
|
1394
1394
|
if (lf(e, i)) return !1;
|
|
1395
1395
|
return !0;
|
|
1396
1396
|
}, jo = new WeakMap(), Wo = new WeakMap(), Ou = function(e, t) {
|
|
@@ -1403,7 +1403,7 @@ G = new WeakMap(), Fi = new WeakMap(), Pt = new WeakMap(), Ke = new WeakMap(), l
|
|
|
1403
1403
|
});
|
|
1404
1404
|
}, Kn = function(e) {
|
|
1405
1405
|
const { message: t, isFatal: i, error: n } = e;
|
|
1406
|
-
a(this, G).error(t, { error: n }), a(this,
|
|
1406
|
+
a(this, G).error(t, { error: n }), a(this, _i).emit("error", Bu(t, i, n));
|
|
1407
1407
|
}, zo = new WeakMap(), /**
|
|
1408
1408
|
* Get the prioritized key system list based on the DRM data provided.
|
|
1409
1409
|
* The order of the key systems in the list is the order in which they will be tried.
|
|
@@ -1604,7 +1604,7 @@ function Lf(s, e) {
|
|
|
1604
1604
|
const n = s.decodeData(i);
|
|
1605
1605
|
return i.readRemaining(), n;
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1607
|
+
function Ht(s) {
|
|
1608
1608
|
const e = s.readUint8(), t = s.readUint24();
|
|
1609
1609
|
return {
|
|
1610
1610
|
version: e,
|
|
@@ -1634,7 +1634,7 @@ const xs = class xs {
|
|
|
1634
1634
|
this.timescale = e, this.presentationTime = t, this.presentationTimeDelta = i, this.schemeIdUri = n, this.value = o, this.eventDuration = c, this.id = h, this.data = d;
|
|
1635
1635
|
}
|
|
1636
1636
|
static decodeData(e) {
|
|
1637
|
-
const { version: t } =
|
|
1637
|
+
const { version: t } = Ht(e);
|
|
1638
1638
|
switch (t) {
|
|
1639
1639
|
case 1: {
|
|
1640
1640
|
const i = e.readUint32(), n = e.readUint64(), o = e.readUint32(), c = e.readUint32(), h = e.readUtf8String(), d = e.readUtf8String(), m = e.remaining(), p = e.readBytes(m);
|
|
@@ -1684,7 +1684,7 @@ const or = class or {
|
|
|
1684
1684
|
this.extra = e, this.byteOffset = t, this.baseMediaDecodeTime = i;
|
|
1685
1685
|
}
|
|
1686
1686
|
static decodeData(e) {
|
|
1687
|
-
const t =
|
|
1687
|
+
const t = Ht(e), i = e.byteOffset();
|
|
1688
1688
|
let n = 0;
|
|
1689
1689
|
return t.version === 1 ? n = e.readUint64() : n = e.readUint32(), new or(t, i, n);
|
|
1690
1690
|
}
|
|
@@ -1711,7 +1711,7 @@ const K = class K {
|
|
|
1711
1711
|
return (this.firstSampleFlags & t) === 0;
|
|
1712
1712
|
}
|
|
1713
1713
|
static decodeData(e) {
|
|
1714
|
-
const { flags: t } =
|
|
1714
|
+
const { flags: t } = Ht(e), i = e.readUint32();
|
|
1715
1715
|
let n, o;
|
|
1716
1716
|
t & K.TRUN_DATA_OFFSET && (n = e.readUint32()), t & K.TRUN_FIRST_SAMPLE_FLAGS && (o = e.readUint32());
|
|
1717
1717
|
const c = new K(i, n, o);
|
|
@@ -1732,7 +1732,7 @@ const Df = 1, Of = 2, Mf = 8, Ff = 16, _f = 32, cr = class cr {
|
|
|
1732
1732
|
this.extra = e, this.defaultSampleDuration = t, this.defaultSampleSize = i, this.defaultSampleFlags = n;
|
|
1733
1733
|
}
|
|
1734
1734
|
static decodeData(e) {
|
|
1735
|
-
const t =
|
|
1735
|
+
const t = Ht(e);
|
|
1736
1736
|
let i, n, o;
|
|
1737
1737
|
return e.readUint32(), (t.flags & Df) > 0 && e.readUint64(), (t.flags & Of) > 0 && e.readUint32(), (t.flags & Mf) > 0 && (i = e.readUint32()), (t.flags & Ff) > 0 && (n = e.readUint32()), (t.flags & _f) > 0 && (o = e.readUint32()), new cr(t, i, n, o);
|
|
1738
1738
|
}
|
|
@@ -1806,7 +1806,7 @@ const lr = class lr {
|
|
|
1806
1806
|
}
|
|
1807
1807
|
}
|
|
1808
1808
|
static decodeData(e) {
|
|
1809
|
-
|
|
1809
|
+
Ht(e), e.readUint32();
|
|
1810
1810
|
const t = String.fromCharCode(...e.readBytes(4));
|
|
1811
1811
|
return new lr(t);
|
|
1812
1812
|
}
|
|
@@ -1823,7 +1823,7 @@ const Ls = class Ls {
|
|
|
1823
1823
|
this.creationTime = e, this.modificationTime = t, this.timescale = i, this.duration = n;
|
|
1824
1824
|
}
|
|
1825
1825
|
static decodeData(e) {
|
|
1826
|
-
const { version: t } =
|
|
1826
|
+
const { version: t } = Ht(e);
|
|
1827
1827
|
if (t === 1) {
|
|
1828
1828
|
const h = e.readUint64(), d = e.readUint64(), m = e.readUint32(), p = e.readUint64();
|
|
1829
1829
|
return new Ls(h, d, m, p);
|
|
@@ -1855,7 +1855,7 @@ const mr = class mr {
|
|
|
1855
1855
|
return (e = this.avc1) == null ? void 0 : e.height;
|
|
1856
1856
|
}
|
|
1857
1857
|
static decodeData(e) {
|
|
1858
|
-
|
|
1858
|
+
Ht(e);
|
|
1859
1859
|
const t = e.readUint32();
|
|
1860
1860
|
let i, n, o, c;
|
|
1861
1861
|
for (let h = 0; h < t; h++)
|
|
@@ -1958,7 +1958,7 @@ const Ar = class Ar {
|
|
|
1958
1958
|
this.modificationTime = e, this.creationTime = t, this.trackId = i, this.duration = n, this.alternateGroup = o, this.volume = c, this.width = h, this.height = d;
|
|
1959
1959
|
}
|
|
1960
1960
|
static decodeData(e) {
|
|
1961
|
-
const t =
|
|
1961
|
+
const t = Ht(e);
|
|
1962
1962
|
let i = 0, n = 0;
|
|
1963
1963
|
t.version === 1 ? (i = e.readUint64(), n = e.readUint64()) : (i = e.readUint32(), n = e.readUint32());
|
|
1964
1964
|
const o = e.readUint32();
|
|
@@ -2130,7 +2130,7 @@ const Ds = class Ds {
|
|
|
2130
2130
|
return new Date(n.getTime() + i);
|
|
2131
2131
|
}
|
|
2132
2132
|
static decodeData(e) {
|
|
2133
|
-
const { version: t } =
|
|
2133
|
+
const { version: t } = Ht(e);
|
|
2134
2134
|
e.readUint32();
|
|
2135
2135
|
const i = e.readUint32(), n = e.readUint32();
|
|
2136
2136
|
if (t === 1) {
|
|
@@ -3089,25 +3089,25 @@ class sg {
|
|
|
3089
3089
|
}
|
|
3090
3090
|
}
|
|
3091
3091
|
const ng = /\r\n|\r|\n/;
|
|
3092
|
-
var
|
|
3092
|
+
var ti, xt;
|
|
3093
3093
|
class _d {
|
|
3094
3094
|
constructor(e) {
|
|
3095
|
-
u(this,
|
|
3095
|
+
u(this, ti);
|
|
3096
3096
|
u(this, xt);
|
|
3097
|
-
l(this,
|
|
3097
|
+
l(this, ti, e), l(this, xt, 0);
|
|
3098
3098
|
}
|
|
3099
3099
|
skipEmptyLines() {
|
|
3100
3100
|
let e = 0;
|
|
3101
|
-
for (; a(this,
|
|
3101
|
+
for (; a(this, ti)[a(this, xt)] === ""; )
|
|
3102
3102
|
Ze(this, xt)._++, e++;
|
|
3103
3103
|
return e;
|
|
3104
3104
|
}
|
|
3105
3105
|
readLine() {
|
|
3106
|
-
return a(this,
|
|
3106
|
+
return a(this, ti)[Ze(this, xt)._++];
|
|
3107
3107
|
}
|
|
3108
3108
|
takeUntilEmptyLine() {
|
|
3109
3109
|
const e = [];
|
|
3110
|
-
for (; a(this,
|
|
3110
|
+
for (; a(this, ti)[a(this, xt)] !== ""; ) {
|
|
3111
3111
|
const t = this.readLine();
|
|
3112
3112
|
if (t === void 0)
|
|
3113
3113
|
break;
|
|
@@ -3116,10 +3116,10 @@ class _d {
|
|
|
3116
3116
|
return e;
|
|
3117
3117
|
}
|
|
3118
3118
|
linesLeft() {
|
|
3119
|
-
return a(this,
|
|
3119
|
+
return a(this, ti).length - a(this, xt);
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
|
-
|
|
3122
|
+
ti = new WeakMap(), xt = new WeakMap();
|
|
3123
3123
|
var ws, Hu, mh;
|
|
3124
3124
|
class zu {
|
|
3125
3125
|
constructor() {
|
|
@@ -3169,7 +3169,7 @@ ws = new WeakSet(), Hu = function(e) {
|
|
|
3169
3169
|
const [i = 0, n = 0, o = 0] = t.map((h) => parseFloat(h));
|
|
3170
3170
|
return i * 60 * 60 + n * 60 + o;
|
|
3171
3171
|
};
|
|
3172
|
-
class fh extends
|
|
3172
|
+
class fh extends yi {
|
|
3173
3173
|
constructor({ type: t, autoplay: i, muted: n, logger: o, poster: c }) {
|
|
3174
3174
|
super();
|
|
3175
3175
|
r(this, "element");
|
|
@@ -3404,7 +3404,7 @@ const cg = (s) => {
|
|
|
3404
3404
|
return ps(s) ? e = {
|
|
3405
3405
|
type: "media-source",
|
|
3406
3406
|
audio: {
|
|
3407
|
-
contentType:
|
|
3407
|
+
contentType: Pi(s),
|
|
3408
3408
|
bitrate: s.bitRate,
|
|
3409
3409
|
channels: s.channels.toString(),
|
|
3410
3410
|
samplerate: s.sampleRate
|
|
@@ -3412,7 +3412,7 @@ const cg = (s) => {
|
|
|
3412
3412
|
} : e = {
|
|
3413
3413
|
type: "media-source",
|
|
3414
3414
|
video: {
|
|
3415
|
-
contentType:
|
|
3415
|
+
contentType: Pi(s),
|
|
3416
3416
|
bitrate: s.bitRate,
|
|
3417
3417
|
width: s.width,
|
|
3418
3418
|
height: s.height,
|
|
@@ -3527,7 +3527,7 @@ const pg = {
|
|
|
3527
3527
|
maxBufferingRatio: {
|
|
3528
3528
|
last30Seconds: 0.15
|
|
3529
3529
|
}
|
|
3530
|
-
},
|
|
3530
|
+
}, qt = class qt {
|
|
3531
3531
|
constructor(e, t, i, n, o) {
|
|
3532
3532
|
r(this, "qualityOfServiceSource");
|
|
3533
3533
|
r(this, "targetBufferTimeTarget");
|
|
@@ -3561,8 +3561,8 @@ const pg = {
|
|
|
3561
3561
|
return;
|
|
3562
3562
|
const o = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), c = this.qualityOfServiceSource.bufferingEventsLast(30 * 1e3), h = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), d = o / h, m = Math.ceil(
|
|
3563
3563
|
Math.max(
|
|
3564
|
-
(i - t) / (
|
|
3565
|
-
|
|
3564
|
+
(i - t) / (qt.BUFFER_TIME_MAX_STEPS - 1),
|
|
3565
|
+
qt.BUFFER_TIME_STEP_SIZE
|
|
3566
3566
|
)
|
|
3567
3567
|
);
|
|
3568
3568
|
(d > this.config.maxBufferingRatio.last30Seconds || c > this.config.maxBufferingEvents.last30Seconds) && (this.targetBufferTimeTarget.targetBufferTime = Math.min(
|
|
@@ -3576,8 +3576,8 @@ const pg = {
|
|
|
3576
3576
|
this.config = v(v({}, this.config), e);
|
|
3577
3577
|
}
|
|
3578
3578
|
};
|
|
3579
|
-
r(
|
|
3580
|
-
let gh =
|
|
3579
|
+
r(qt, "BUFFER_TIME_STEP_SIZE", 500), r(qt, "BUFFER_TIME_MAX_STEPS", 3), r(qt, "create", (e, t, i, n, o = {}) => new qt(e, t, i, n, o));
|
|
3580
|
+
let gh = qt;
|
|
3581
3581
|
var Bo = /* @__PURE__ */ ((s) => (s[s.StreamHeaderGroup = 4] = "StreamHeaderGroup", s[s.FetchHeader = 5] = "FetchHeader", s[s.StreamHeaderTrack = 60] = "StreamHeaderTrack", s))(Bo || {});
|
|
3582
3582
|
const Te = {
|
|
3583
3583
|
Normal: 0,
|
|
@@ -3815,37 +3815,37 @@ function qu(s, e) {
|
|
|
3815
3815
|
}
|
|
3816
3816
|
});
|
|
3817
3817
|
}
|
|
3818
|
-
var
|
|
3818
|
+
var ii, Yr;
|
|
3819
3819
|
class bg {
|
|
3820
3820
|
constructor(e, t) {
|
|
3821
|
-
u(this,
|
|
3821
|
+
u(this, ii);
|
|
3822
3822
|
u(this, Yr);
|
|
3823
|
-
l(this,
|
|
3823
|
+
l(this, ii, e), l(this, Yr, t);
|
|
3824
3824
|
}
|
|
3825
3825
|
start(e) {
|
|
3826
|
-
a(this,
|
|
3826
|
+
a(this, ii).addEventListener("message", (t) => {
|
|
3827
3827
|
if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
|
|
3828
3828
|
const i = new Uint8Array(t.data);
|
|
3829
3829
|
i[0] == a(this, Yr) && e.enqueue(i.subarray(1));
|
|
3830
3830
|
}
|
|
3831
|
-
}), a(this,
|
|
3831
|
+
}), a(this, ii).addEventListener("error", () => e.error(new Error("WebSocket error"))), a(this, ii).addEventListener("close", () => Tu(() => e.close()));
|
|
3832
3832
|
}
|
|
3833
3833
|
cancel(e) {
|
|
3834
|
-
a(this,
|
|
3834
|
+
a(this, ii).close(void 0, e);
|
|
3835
3835
|
}
|
|
3836
3836
|
}
|
|
3837
|
-
|
|
3838
|
-
var pt,
|
|
3837
|
+
ii = new WeakMap(), Yr = new WeakMap();
|
|
3838
|
+
var pt, Ni, Vi, Gi;
|
|
3839
3839
|
class yg {
|
|
3840
3840
|
constructor(e) {
|
|
3841
3841
|
u(this, pt);
|
|
3842
|
-
u(this, _i, null);
|
|
3843
3842
|
u(this, Ni, null);
|
|
3844
3843
|
u(this, Vi, null);
|
|
3844
|
+
u(this, Gi, null);
|
|
3845
3845
|
l(this, pt, e);
|
|
3846
3846
|
}
|
|
3847
3847
|
start(e) {
|
|
3848
|
-
l(this,
|
|
3848
|
+
l(this, Ni, (t) => {
|
|
3849
3849
|
if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
|
|
3850
3850
|
const i = new Uint8Array(t.data), n = i[0] || 0, o = n & 127, c = (n >> 7 & 1) > 0;
|
|
3851
3851
|
if (o && o !== 0) {
|
|
@@ -3853,27 +3853,27 @@ class yg {
|
|
|
3853
3853
|
e.enqueue([c, o, h]);
|
|
3854
3854
|
}
|
|
3855
3855
|
}
|
|
3856
|
-
}), l(this,
|
|
3856
|
+
}), l(this, Vi, () => Tu(() => e.close())), l(this, Gi, () => e.error(new Error("WebSocket error"))), a(this, pt).addEventListener("message", a(this, Ni)), a(this, pt).addEventListener("error", a(this, Gi)), a(this, pt).addEventListener("close", a(this, Vi));
|
|
3857
3857
|
}
|
|
3858
3858
|
cancel(e) {
|
|
3859
|
-
a(this,
|
|
3859
|
+
a(this, Ni) && a(this, pt).removeEventListener("message", a(this, Ni)), a(this, Gi) && a(this, pt).removeEventListener("error", a(this, Gi)), a(this, Vi) && a(this, pt).removeEventListener("close", a(this, Vi));
|
|
3860
3860
|
}
|
|
3861
3861
|
}
|
|
3862
|
-
pt = new WeakMap(),
|
|
3863
|
-
var gt, Jr,
|
|
3862
|
+
pt = new WeakMap(), Ni = new WeakMap(), Vi = new WeakMap(), Gi = new WeakMap();
|
|
3863
|
+
var gt, Jr, ji, At, Qo, z, er, Ka, ki, eo, Qt;
|
|
3864
3864
|
class Ro {
|
|
3865
3865
|
constructor(e, t) {
|
|
3866
3866
|
u(this, z);
|
|
3867
3867
|
u(this, gt);
|
|
3868
3868
|
u(this, Jr);
|
|
3869
|
-
u(this,
|
|
3869
|
+
u(this, ji);
|
|
3870
3870
|
u(this, At, 0);
|
|
3871
3871
|
u(this, Qo, new TextDecoder());
|
|
3872
|
-
l(this, gt, e), l(this, Jr, t), l(this,
|
|
3872
|
+
l(this, gt, e), l(this, Jr, t), l(this, ji, t.getReader());
|
|
3873
3873
|
}
|
|
3874
3874
|
readUnsigned8() {
|
|
3875
3875
|
return f(this, null, function* () {
|
|
3876
|
-
return yield A(this, z,
|
|
3876
|
+
return yield A(this, z, ki).call(this, 1), A(this, z, Qt).call(this, 1)[0];
|
|
3877
3877
|
});
|
|
3878
3878
|
}
|
|
3879
3879
|
readString() {
|
|
@@ -3892,24 +3892,24 @@ class Ro {
|
|
|
3892
3892
|
}
|
|
3893
3893
|
readBigVarInt() {
|
|
3894
3894
|
return f(this, null, function* () {
|
|
3895
|
-
yield A(this, z,
|
|
3895
|
+
yield A(this, z, ki).call(this, 1);
|
|
3896
3896
|
const e = (A(this, z, eo).call(this, 1)[0] & 192) >> 6;
|
|
3897
3897
|
switch (a(this, gt)[a(this, At)] = A(this, z, eo).call(this, 1)[0] & 63, e) {
|
|
3898
3898
|
case 0:
|
|
3899
|
-
return B(A(this, z,
|
|
3899
|
+
return B(A(this, z, Qt).call(this, 1)[0]);
|
|
3900
3900
|
case 1: {
|
|
3901
|
-
yield A(this, z,
|
|
3902
|
-
const t = A(this, z,
|
|
3901
|
+
yield A(this, z, ki).call(this, 2);
|
|
3902
|
+
const t = A(this, z, Qt).call(this, 2), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3903
3903
|
return B(i.getUint16(0));
|
|
3904
3904
|
}
|
|
3905
3905
|
case 2: {
|
|
3906
|
-
yield A(this, z,
|
|
3907
|
-
const t = A(this, z,
|
|
3906
|
+
yield A(this, z, ki).call(this, 4);
|
|
3907
|
+
const t = A(this, z, Qt).call(this, 4), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3908
3908
|
return B(i.getUint32(0));
|
|
3909
3909
|
}
|
|
3910
3910
|
case 3: {
|
|
3911
|
-
yield A(this, z,
|
|
3912
|
-
const t = A(this, z,
|
|
3911
|
+
yield A(this, z, ki).call(this, 8);
|
|
3912
|
+
const t = A(this, z, Qt).call(this, 8), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3913
3913
|
if (typeof i.getBigUint64 != "undefined")
|
|
3914
3914
|
return B(i.getBigUint64(0));
|
|
3915
3915
|
const n = td(t, 0, 7);
|
|
@@ -3922,14 +3922,14 @@ class Ro {
|
|
|
3922
3922
|
}
|
|
3923
3923
|
read(e) {
|
|
3924
3924
|
return f(this, null, function* () {
|
|
3925
|
-
return yield A(this, z,
|
|
3925
|
+
return yield A(this, z, ki).call(this, e), A(this, z, Qt).call(this, e);
|
|
3926
3926
|
});
|
|
3927
3927
|
}
|
|
3928
3928
|
readAll() {
|
|
3929
3929
|
return f(this, null, function* () {
|
|
3930
3930
|
for (; yield A(this, z, Ka).call(this); )
|
|
3931
3931
|
;
|
|
3932
|
-
return A(this, z,
|
|
3932
|
+
return A(this, z, Qt).call(this, A(this, z, er).call(this));
|
|
3933
3933
|
});
|
|
3934
3934
|
}
|
|
3935
3935
|
isDone() {
|
|
@@ -3939,20 +3939,20 @@ class Ro {
|
|
|
3939
3939
|
}
|
|
3940
3940
|
closed() {
|
|
3941
3941
|
return f(this, null, function* () {
|
|
3942
|
-
return a(this,
|
|
3942
|
+
return a(this, ji).closed;
|
|
3943
3943
|
});
|
|
3944
3944
|
}
|
|
3945
3945
|
close() {
|
|
3946
3946
|
return f(this, null, function* () {
|
|
3947
|
-
return a(this,
|
|
3947
|
+
return a(this, ji).releaseLock(), a(this, Jr).cancel();
|
|
3948
3948
|
});
|
|
3949
3949
|
}
|
|
3950
3950
|
}
|
|
3951
|
-
gt = new WeakMap(), Jr = new WeakMap(),
|
|
3951
|
+
gt = new WeakMap(), Jr = new WeakMap(), ji = new WeakMap(), At = new WeakMap(), Qo = new WeakMap(), z = new WeakSet(), er = function() {
|
|
3952
3952
|
return a(this, gt).length - a(this, At);
|
|
3953
3953
|
}, Ka = function() {
|
|
3954
3954
|
return f(this, null, function* () {
|
|
3955
|
-
const { value: e, done: t } = yield a(this,
|
|
3955
|
+
const { value: e, done: t } = yield a(this, ji).read();
|
|
3956
3956
|
if (t)
|
|
3957
3957
|
return Promise.resolve(0);
|
|
3958
3958
|
if (A(this, z, er).call(this) === 0)
|
|
@@ -3963,7 +3963,7 @@ gt = new WeakMap(), Jr = new WeakMap(), Gi = new WeakMap(), At = new WeakMap(),
|
|
|
3963
3963
|
}
|
|
3964
3964
|
return l(this, At, 0), Promise.resolve(e.length);
|
|
3965
3965
|
});
|
|
3966
|
-
},
|
|
3966
|
+
}, ki = function(e) {
|
|
3967
3967
|
return f(this, null, function* () {
|
|
3968
3968
|
for (; A(this, z, er).call(this) < e; )
|
|
3969
3969
|
if ((yield A(this, z, Ka).call(this)) === 0)
|
|
@@ -3971,7 +3971,7 @@ gt = new WeakMap(), Jr = new WeakMap(), Gi = new WeakMap(), At = new WeakMap(),
|
|
|
3971
3971
|
});
|
|
3972
3972
|
}, eo = function(e) {
|
|
3973
3973
|
return a(this, gt).subarray(a(this, At), a(this, At) + e);
|
|
3974
|
-
},
|
|
3974
|
+
}, Qt = function(e) {
|
|
3975
3975
|
const t = A(this, z, eo).call(this, e);
|
|
3976
3976
|
return l(this, At, a(this, At) + t.length), t;
|
|
3977
3977
|
};
|
|
@@ -4016,14 +4016,14 @@ tn = new WeakMap(), sn = new WeakMap(), Lt = new WeakMap(), Zo = new WeakMap();
|
|
|
4016
4016
|
const Yu = {
|
|
4017
4017
|
OPEN: 1
|
|
4018
4018
|
};
|
|
4019
|
-
var Ue, xe,
|
|
4019
|
+
var Ue, xe, Wi, qo;
|
|
4020
4020
|
const Tr = class Tr {
|
|
4021
4021
|
constructor(e) {
|
|
4022
4022
|
u(this, Ue, 0);
|
|
4023
4023
|
u(this, xe, new Uint8Array(Tr.DEFAULT_BUFFER_SIZE));
|
|
4024
|
-
u(this,
|
|
4024
|
+
u(this, Wi);
|
|
4025
4025
|
u(this, qo, new TextEncoder());
|
|
4026
|
-
l(this,
|
|
4026
|
+
l(this, Wi, e);
|
|
4027
4027
|
}
|
|
4028
4028
|
writeString(e) {
|
|
4029
4029
|
return f(this, null, function* () {
|
|
@@ -4054,15 +4054,15 @@ const Tr = class Tr {
|
|
|
4054
4054
|
return this.ensureBufferSpace(8), l(this, Ue, a(this, Ue) + al(e, a(this, xe).subarray(a(this, Ue))).byteLength), Promise.resolve();
|
|
4055
4055
|
}
|
|
4056
4056
|
flush() {
|
|
4057
|
-
if (a(this,
|
|
4057
|
+
if (a(this, Wi).readyState !== Yu.OPEN)
|
|
4058
4058
|
throw new Error("Writer is not open");
|
|
4059
|
-
return a(this,
|
|
4059
|
+
return a(this, Wi).send(a(this, xe).subarray(0, a(this, Ue))), l(this, Ue, 0), l(this, xe, new Uint8Array(Tr.DEFAULT_BUFFER_SIZE)), Promise.resolve();
|
|
4060
4060
|
}
|
|
4061
4061
|
close() {
|
|
4062
|
-
return a(this,
|
|
4062
|
+
return a(this, Wi).close(), Promise.resolve();
|
|
4063
4063
|
}
|
|
4064
4064
|
};
|
|
4065
|
-
Ue = new WeakMap(), xe = new WeakMap(),
|
|
4065
|
+
Ue = new WeakMap(), xe = new WeakMap(), Wi = new WeakMap(), qo = new WeakMap(), r(Tr, "DEFAULT_BUFFER_SIZE", 1024);
|
|
4066
4066
|
let Rr = Tr;
|
|
4067
4067
|
const Ju = Math.pow(2, 6) - 1, Ku = Math.pow(2, 14) - 1, el = Math.pow(2, 30) - 1, vg = Number.MAX_SAFE_INTEGER, Sg = typeof BigInt == "function" ? B(2) ** B(62) - B(1) : B(Number.MAX_SAFE_INTEGER);
|
|
4068
4068
|
function Nc(s, e) {
|
|
@@ -4724,15 +4724,15 @@ class Jg {
|
|
|
4724
4724
|
this.state = e;
|
|
4725
4725
|
}
|
|
4726
4726
|
}
|
|
4727
|
-
var hn,
|
|
4727
|
+
var hn, si, zi, Jo, Hi, tt;
|
|
4728
4728
|
const Ms = class Ms {
|
|
4729
4729
|
constructor(e) {
|
|
4730
4730
|
r(this, "subscribe");
|
|
4731
4731
|
u(this, hn, new H());
|
|
4732
|
-
u(this,
|
|
4733
|
-
u(this, Wi, new H());
|
|
4734
|
-
u(this, Jo, Date.now());
|
|
4732
|
+
u(this, si, new H());
|
|
4735
4733
|
u(this, zi, new H());
|
|
4734
|
+
u(this, Jo, Date.now());
|
|
4735
|
+
u(this, Hi, new H());
|
|
4736
4736
|
u(this, tt);
|
|
4737
4737
|
switch (this.subscribe = e, e.filterType.type) {
|
|
4738
4738
|
case "absolute-start":
|
|
@@ -4748,24 +4748,24 @@ const Ms = class Ms {
|
|
|
4748
4748
|
}
|
|
4749
4749
|
onError(e) {
|
|
4750
4750
|
const t = new Error(e.reason);
|
|
4751
|
-
return a(this, hn).reject(t), a(this,
|
|
4751
|
+
return a(this, hn).reject(t), a(this, si).reject(t), t;
|
|
4752
4752
|
}
|
|
4753
4753
|
onDone(e) {
|
|
4754
|
-
e.finalInfo && (a(this, tt) || l(this, tt, { startGroup: B(0) }), a(this, tt).endGroup = e.finalInfo.group), a(this,
|
|
4754
|
+
e.finalInfo && (a(this, tt) || l(this, tt, { startGroup: B(0) }), a(this, tt).endGroup = e.finalInfo.group), a(this, si).resolve(e);
|
|
4755
4755
|
}
|
|
4756
4756
|
onUnsubscribe(e) {
|
|
4757
|
-
a(this,
|
|
4757
|
+
a(this, zi).resolve(e);
|
|
4758
4758
|
}
|
|
4759
4759
|
onOk(e) {
|
|
4760
4760
|
const t = Math.max(0, Date.now() - a(this, Jo)), i = Number(e.expires);
|
|
4761
4761
|
if (i > 0) {
|
|
4762
4762
|
const n = Math.max(Ms.minGraceTime, Math.min(i / 10, Ms.maxGraceTime));
|
|
4763
|
-
Promise.race([gs(i - n - t), this.done().catch(D)]).then(() => a(this,
|
|
4763
|
+
Promise.race([gs(i - n - t), this.done().catch(D)]).then(() => a(this, Hi).resolve(this.expiryState())).catch(D);
|
|
4764
4764
|
}
|
|
4765
4765
|
a(this, hn).resolve(e);
|
|
4766
4766
|
}
|
|
4767
4767
|
done() {
|
|
4768
|
-
return a(this,
|
|
4768
|
+
return a(this, si).promise;
|
|
4769
4769
|
}
|
|
4770
4770
|
ok() {
|
|
4771
4771
|
return a(this, hn).promise;
|
|
@@ -4774,27 +4774,27 @@ const Ms = class Ms {
|
|
|
4774
4774
|
return a(this, tt);
|
|
4775
4775
|
}
|
|
4776
4776
|
close() {
|
|
4777
|
-
a(this,
|
|
4777
|
+
a(this, Hi).promise.catch(D), a(this, Hi).reject(new Error("Subscription closed"));
|
|
4778
4778
|
}
|
|
4779
4779
|
// Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
|
|
4780
4780
|
expiryState() {
|
|
4781
|
-
return a(this,
|
|
4781
|
+
return a(this, si).resolved && a(this, si).resolved.errorCode !== bh.Expired ? "done" : a(this, zi).pending ? "active" : "unsubscribed";
|
|
4782
4782
|
}
|
|
4783
4783
|
unsubscribed() {
|
|
4784
|
-
return a(this,
|
|
4784
|
+
return a(this, zi).promise;
|
|
4785
4785
|
}
|
|
4786
4786
|
isUnsubscribed() {
|
|
4787
|
-
return a(this,
|
|
4787
|
+
return a(this, zi).resolved;
|
|
4788
4788
|
}
|
|
4789
4789
|
/**
|
|
4790
4790
|
* Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
|
|
4791
4791
|
|
|
4792
4792
|
*/
|
|
4793
4793
|
expiryNotification() {
|
|
4794
|
-
return a(this,
|
|
4794
|
+
return a(this, Hi).promise;
|
|
4795
4795
|
}
|
|
4796
4796
|
};
|
|
4797
|
-
hn = new WeakMap(),
|
|
4797
|
+
hn = new WeakMap(), si = new WeakMap(), zi = new WeakMap(), Jo = new WeakMap(), Hi = new WeakMap(), tt = new WeakMap(), r(Ms, "maxGraceTime", 15e3), r(Ms, "minGraceTime", 3e3);
|
|
4798
4798
|
let Lo = Ms;
|
|
4799
4799
|
var we, sa;
|
|
4800
4800
|
class Kg {
|
|
@@ -4895,15 +4895,15 @@ na = new WeakMap(), We = new WeakMap(), ra = new WeakMap(), aa = new WeakMap(),
|
|
|
4895
4895
|
}
|
|
4896
4896
|
});
|
|
4897
4897
|
};
|
|
4898
|
-
var
|
|
4898
|
+
var Xi, ca, un, ha, ln;
|
|
4899
4899
|
class tA {
|
|
4900
4900
|
constructor(e, t, i) {
|
|
4901
|
-
u(this,
|
|
4901
|
+
u(this, Xi);
|
|
4902
4902
|
u(this, ca);
|
|
4903
4903
|
u(this, un);
|
|
4904
4904
|
u(this, ha);
|
|
4905
4905
|
u(this, ln);
|
|
4906
|
-
l(this,
|
|
4906
|
+
l(this, Xi, e), l(this, ca, t), l(this, un, i), l(this, ln, ge.get().createContext(`GroupSubscriptionWriter:${i.subscribe.name}`));
|
|
4907
4907
|
}
|
|
4908
4908
|
finalGroup() {
|
|
4909
4909
|
return a(this, ha);
|
|
@@ -4914,7 +4914,7 @@ class tA {
|
|
|
4914
4914
|
try {
|
|
4915
4915
|
for (var e = Y(a(this, ca)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
4916
4916
|
const o = i.value;
|
|
4917
|
-
yield a(this,
|
|
4917
|
+
yield a(this, Xi).write({
|
|
4918
4918
|
subscribeId: a(this, un).subscribe.id,
|
|
4919
4919
|
trackAlias: a(this, un).subscribe.trackAlias,
|
|
4920
4920
|
subGroupId: B(0),
|
|
@@ -4939,21 +4939,21 @@ class tA {
|
|
|
4939
4939
|
});
|
|
4940
4940
|
}
|
|
4941
4941
|
[Tt()]() {
|
|
4942
|
-
return a(this,
|
|
4942
|
+
return a(this, Xi).close().catch(D);
|
|
4943
4943
|
}
|
|
4944
4944
|
[Symbol.asyncDispose]() {
|
|
4945
|
-
return a(this,
|
|
4945
|
+
return a(this, Xi).close().catch(D);
|
|
4946
4946
|
}
|
|
4947
4947
|
}
|
|
4948
|
-
|
|
4949
|
-
var da,
|
|
4948
|
+
Xi = new WeakMap(), ca = new WeakMap(), un = new WeakMap(), ha = new WeakMap(), ln = new WeakMap();
|
|
4949
|
+
var da, Qi, ni, Bs;
|
|
4950
4950
|
class iA {
|
|
4951
4951
|
constructor(e, t, i) {
|
|
4952
|
-
u(this,
|
|
4952
|
+
u(this, ni);
|
|
4953
4953
|
r(this, "state");
|
|
4954
4954
|
u(this, da);
|
|
4955
|
-
u(this,
|
|
4956
|
-
this.state = e, l(this, da, t), l(this,
|
|
4955
|
+
u(this, Qi);
|
|
4956
|
+
this.state = e, l(this, da, t), l(this, Qi, i);
|
|
4957
4957
|
}
|
|
4958
4958
|
/**
|
|
4959
4959
|
* Accept the subscription and provide a track cache for the subscription
|
|
@@ -4971,23 +4971,23 @@ class iA {
|
|
|
4971
4971
|
params: /* @__PURE__ */ new Map(),
|
|
4972
4972
|
largestInfo: n ? { group: n, object: o } : void 0
|
|
4973
4973
|
};
|
|
4974
|
-
return yield a(this,
|
|
4974
|
+
return yield a(this, Qi).push(h), new eA(this.state, c, a(this, da), a(this, Qi));
|
|
4975
4975
|
});
|
|
4976
4976
|
}
|
|
4977
4977
|
invalidRange() {
|
|
4978
|
-
return A(this,
|
|
4978
|
+
return A(this, ni, Bs).call(this, B(1), "Invalid range");
|
|
4979
4979
|
}
|
|
4980
4980
|
retryTrackAlias() {
|
|
4981
|
-
return A(this,
|
|
4981
|
+
return A(this, ni, Bs).call(this, B(2), "Retry track alias");
|
|
4982
4982
|
}
|
|
4983
4983
|
trackDoesNotExist() {
|
|
4984
|
-
return A(this,
|
|
4984
|
+
return A(this, ni, Bs).call(this, B(3), "Track does not exist");
|
|
4985
4985
|
}
|
|
4986
4986
|
unauthorized() {
|
|
4987
|
-
return A(this,
|
|
4987
|
+
return A(this, ni, Bs).call(this, B(4), "Unauthorized");
|
|
4988
4988
|
}
|
|
4989
4989
|
timeout() {
|
|
4990
|
-
return A(this,
|
|
4990
|
+
return A(this, ni, Bs).call(this, B(5), "Timeout");
|
|
4991
4991
|
}
|
|
4992
4992
|
[Tt()]() {
|
|
4993
4993
|
return this.trackDoesNotExist();
|
|
@@ -4996,7 +4996,7 @@ class iA {
|
|
|
4996
4996
|
return this.trackDoesNotExist();
|
|
4997
4997
|
}
|
|
4998
4998
|
}
|
|
4999
|
-
da = new WeakMap(),
|
|
4999
|
+
da = new WeakMap(), Qi = new WeakMap(), ni = new WeakSet(), Bs = function(e, t) {
|
|
5000
5000
|
const i = {
|
|
5001
5001
|
type: I.SubscribeError,
|
|
5002
5002
|
id: this.state.subscribe.id,
|
|
@@ -5004,25 +5004,25 @@ da = new WeakMap(), Xi = new WeakMap(), ii = new WeakSet(), Bs = function(e, t)
|
|
|
5004
5004
|
reason: t,
|
|
5005
5005
|
trackAlias: this.state.subscribe.trackAlias
|
|
5006
5006
|
};
|
|
5007
|
-
return a(this,
|
|
5007
|
+
return a(this, Qi).push(i);
|
|
5008
5008
|
};
|
|
5009
|
-
var su, mn, ua, fn,
|
|
5009
|
+
var su, mn, ua, fn, Zi, ri, ai, oi, sh;
|
|
5010
5010
|
su = [Pe({ context: "Session", enter: "info", error: "error" })];
|
|
5011
5011
|
class yh {
|
|
5012
5012
|
constructor(e, t, i) {
|
|
5013
|
-
|
|
5013
|
+
Ei(sh, 5, this);
|
|
5014
5014
|
u(this, mn);
|
|
5015
5015
|
u(this, ua);
|
|
5016
5016
|
u(this, fn);
|
|
5017
|
-
u(this,
|
|
5018
|
-
u(this,
|
|
5019
|
-
u(this,
|
|
5020
|
-
u(this,
|
|
5017
|
+
u(this, Zi, ge.get().createContext("Publisher"));
|
|
5018
|
+
u(this, ri, new Ie(/* @__PURE__ */ new Map()));
|
|
5019
|
+
u(this, ai, new Ie(/* @__PURE__ */ new Map()));
|
|
5020
|
+
u(this, oi, new Dc(10));
|
|
5021
5021
|
l(this, mn, e), l(this, ua, t), l(this, fn, i);
|
|
5022
5022
|
}
|
|
5023
5023
|
announce(e) {
|
|
5024
5024
|
return f(this, null, function* () {
|
|
5025
|
-
if (a(this,
|
|
5025
|
+
if (a(this, ri).current().has(e.join("/")))
|
|
5026
5026
|
throw new Error("Duplicate announcement");
|
|
5027
5027
|
const t = /* @__PURE__ */ new Map(), i = a(this, mn).authToken();
|
|
5028
5028
|
i && t.set(Uo, { type: Uo, payload: new TextEncoder().encode(i) });
|
|
@@ -5031,15 +5031,15 @@ class yh {
|
|
|
5031
5031
|
namespace: e,
|
|
5032
5032
|
params: t
|
|
5033
5033
|
}, o = Yg(n);
|
|
5034
|
-
if (a(this,
|
|
5034
|
+
if (a(this, ri).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, fn).push(n), !(yield Promise.race([o.state.ok(), a(this, mn).closed()])))
|
|
5035
5035
|
throw new Error("Session closed");
|
|
5036
5036
|
});
|
|
5037
5037
|
}
|
|
5038
5038
|
close() {
|
|
5039
|
-
a(this,
|
|
5039
|
+
a(this, ai).current().forEach((e) => e.close()), a(this, ai).close(), a(this, ri).close(), a(this, oi).close();
|
|
5040
5040
|
}
|
|
5041
5041
|
incomingSubscriptions() {
|
|
5042
|
-
return a(this,
|
|
5042
|
+
return a(this, oi);
|
|
5043
5043
|
}
|
|
5044
5044
|
onMessage(e) {
|
|
5045
5045
|
return f(this, null, function* () {
|
|
@@ -5047,77 +5047,77 @@ class yh {
|
|
|
5047
5047
|
case I.Subscribe:
|
|
5048
5048
|
{
|
|
5049
5049
|
const t = new Lo(e);
|
|
5050
|
-
if (a(this,
|
|
5051
|
-
const i = yield a(this,
|
|
5050
|
+
if (a(this, ai).update((i) => (i.set(e.id, t), i)), a(this, oi).isFull()) {
|
|
5051
|
+
const i = yield a(this, oi).pop();
|
|
5052
5052
|
yield i == null ? void 0 : i.timeout();
|
|
5053
5053
|
}
|
|
5054
|
-
yield a(this,
|
|
5054
|
+
yield a(this, oi).push(
|
|
5055
5055
|
new iA(t, a(this, ua), a(this, fn))
|
|
5056
5056
|
);
|
|
5057
5057
|
}
|
|
5058
5058
|
break;
|
|
5059
5059
|
case I.SubscribeUpdate:
|
|
5060
5060
|
{
|
|
5061
|
-
const t = a(this,
|
|
5062
|
-
t || a(this,
|
|
5061
|
+
const t = a(this, ai).current().get(e.id);
|
|
5062
|
+
t || a(this, Zi).debug("No subscription found", e), t == null || t.onUpdate(e);
|
|
5063
5063
|
}
|
|
5064
5064
|
break;
|
|
5065
5065
|
case I.Unsubscribe:
|
|
5066
5066
|
{
|
|
5067
|
-
const t = a(this,
|
|
5068
|
-
t || a(this,
|
|
5067
|
+
const t = a(this, ai).current().get(e.id);
|
|
5068
|
+
t || a(this, Zi).debug("No subscription found", e), t == null || t.onUnsubscribe(e);
|
|
5069
5069
|
}
|
|
5070
5070
|
break;
|
|
5071
5071
|
case I.AnnounceOk:
|
|
5072
5072
|
{
|
|
5073
|
-
const t = a(this,
|
|
5074
|
-
t || a(this,
|
|
5073
|
+
const t = a(this, ri).current().get(e.namespace.join("/"));
|
|
5074
|
+
t || a(this, Zi).debug("No announcement found", e), t == null || t.state.onOk(e);
|
|
5075
5075
|
}
|
|
5076
5076
|
break;
|
|
5077
5077
|
case I.AnnounceError:
|
|
5078
5078
|
{
|
|
5079
|
-
const t = a(this,
|
|
5080
|
-
t || a(this,
|
|
5079
|
+
const t = a(this, ri).current().get(e.namespace.join("/"));
|
|
5080
|
+
t || a(this, Zi).debug("No announcement found", e), t == null || t.state.onError(e);
|
|
5081
5081
|
}
|
|
5082
5082
|
break;
|
|
5083
5083
|
}
|
|
5084
5084
|
});
|
|
5085
5085
|
}
|
|
5086
5086
|
}
|
|
5087
|
-
sh =
|
|
5087
|
+
sh = Si(null), mn = new WeakMap(), ua = new WeakMap(), fn = new WeakMap(), Zi = new WeakMap(), ri = new WeakMap(), ai = new WeakMap(), oi = new WeakMap(), ye(sh, 1, "announce", su, yh), Xt(sh, yh);
|
|
5088
5088
|
function sA(s, e) {
|
|
5089
5089
|
const t = new Lo(e), [i, n] = ed(100), o = new nA(t, i), c = new Il(s, t, n);
|
|
5090
5090
|
return [o, c];
|
|
5091
5091
|
}
|
|
5092
|
-
var
|
|
5092
|
+
var qi;
|
|
5093
5093
|
class nA {
|
|
5094
5094
|
constructor(e, t) {
|
|
5095
5095
|
r(this, "state");
|
|
5096
|
-
u(this,
|
|
5097
|
-
this.state = e, l(this,
|
|
5096
|
+
u(this, qi);
|
|
5097
|
+
this.state = e, l(this, qi, t);
|
|
5098
5098
|
}
|
|
5099
5099
|
onDone(e) {
|
|
5100
5100
|
this.state.onDone(e);
|
|
5101
5101
|
}
|
|
5102
5102
|
onData(e) {
|
|
5103
|
-
return a(this,
|
|
5103
|
+
return a(this, qi).push(e);
|
|
5104
5104
|
}
|
|
5105
5105
|
onError(e) {
|
|
5106
5106
|
const t = this.state.onError(e);
|
|
5107
|
-
a(this,
|
|
5107
|
+
a(this, qi).abort(t);
|
|
5108
5108
|
}
|
|
5109
5109
|
/**
|
|
5110
5110
|
* Closes the subscription producer so that no more objects an be emitted
|
|
5111
5111
|
*/
|
|
5112
5112
|
close() {
|
|
5113
|
-
this.state.close(), a(this,
|
|
5113
|
+
this.state.close(), a(this, qi).close();
|
|
5114
5114
|
}
|
|
5115
5115
|
}
|
|
5116
|
-
|
|
5116
|
+
qi = new WeakMap();
|
|
5117
5117
|
var nu, pn, ue, gn, An, nh, wn, tr;
|
|
5118
5118
|
class Il {
|
|
5119
5119
|
constructor(e, t, i) {
|
|
5120
|
-
|
|
5120
|
+
Ei(nh, 5, this);
|
|
5121
5121
|
u(this, wn);
|
|
5122
5122
|
u(this, pn);
|
|
5123
5123
|
u(this, ue);
|
|
@@ -5284,17 +5284,17 @@ class Il {
|
|
|
5284
5284
|
return A(this, wn, tr).call(this);
|
|
5285
5285
|
}
|
|
5286
5286
|
}
|
|
5287
|
-
nh =
|
|
5287
|
+
nh = Si(null), pn = new WeakMap(), ue = new WeakMap(), gn = new WeakMap(), An = new WeakMap(), wn = new WeakSet(), tr = function() {
|
|
5288
5288
|
return f(this, null, function* () {
|
|
5289
5289
|
return yield this.close(), this.unsubscribe();
|
|
5290
5290
|
});
|
|
5291
|
-
}, tr = ye(nh, 17, "#dispose", nu, wn, tr),
|
|
5291
|
+
}, tr = ye(nh, 17, "#dispose", nu, wn, tr), Xt(nh, Il);
|
|
5292
5292
|
const rA = 2e3;
|
|
5293
|
-
var ru, au, ou, cu, Ot, Le,
|
|
5293
|
+
var ru, au, ou, cu, Ot, Le, $i, Yi, Cs, Et, io, Rs;
|
|
5294
5294
|
cu = [Pe({ context: "Session", return: "debug" })], ou = [Pe({ context: "Session", enter: "info", error: "error" })], au = [Pe({ context: "Session", enter: "debug" })], ru = [Pe({ context: "Session", enter: "debug" })];
|
|
5295
5295
|
class to {
|
|
5296
5296
|
constructor(e, t) {
|
|
5297
|
-
|
|
5297
|
+
Ei(Cs, 5, this);
|
|
5298
5298
|
u(this, Et);
|
|
5299
5299
|
// The owner session of the subscriber
|
|
5300
5300
|
u(this, Ot);
|
|
@@ -5302,9 +5302,9 @@ class to {
|
|
|
5302
5302
|
r(this, "nextSubscribeId", B(0));
|
|
5303
5303
|
// The active subscriptions
|
|
5304
5304
|
u(this, Le, new Ie(/* @__PURE__ */ new Map()));
|
|
5305
|
-
u(this,
|
|
5306
|
-
u(this,
|
|
5307
|
-
l(this, Ot, e), l(this,
|
|
5305
|
+
u(this, $i);
|
|
5306
|
+
u(this, Yi, ge.get().createContext("Subscriber"));
|
|
5307
|
+
l(this, Ot, e), l(this, $i, t), A(this, Et, io).call(this).catch(D);
|
|
5308
5308
|
}
|
|
5309
5309
|
subscribe(e, t) {
|
|
5310
5310
|
return f(this, null, function* () {
|
|
@@ -5320,8 +5320,8 @@ class to {
|
|
|
5320
5320
|
subscriberPriority: t.priority,
|
|
5321
5321
|
filterType: t.filterType,
|
|
5322
5322
|
params: n
|
|
5323
|
-
}, [h, d] = sA(a(this,
|
|
5324
|
-
if (a(this, Le).update((p) => p.set(i, h)), yield a(this,
|
|
5323
|
+
}, [h, d] = sA(a(this, $i), c);
|
|
5324
|
+
if (a(this, Le).update((p) => p.set(i, h)), yield a(this, $i).push(c), !(yield Promise.race([h.state.ok(), a(this, Ot).closed()])))
|
|
5325
5325
|
throw new Error("Session closed");
|
|
5326
5326
|
return d.closed().then(() => Promise.race([gs(rA), this.closed()])).then(() => A(this, Et, Rs).call(this, d.id)).catch(() => A(this, Et, Rs).call(this, d.id)), d;
|
|
5327
5327
|
});
|
|
@@ -5339,7 +5339,7 @@ class to {
|
|
|
5339
5339
|
return f(this, null, function* () {
|
|
5340
5340
|
switch (e.type) {
|
|
5341
5341
|
case I.Announce:
|
|
5342
|
-
yield a(this,
|
|
5342
|
+
yield a(this, $i).push({
|
|
5343
5343
|
type: I.AnnounceOk,
|
|
5344
5344
|
namespace: e.namespace
|
|
5345
5345
|
});
|
|
@@ -5353,13 +5353,13 @@ class to {
|
|
|
5353
5353
|
case I.SubscribeError:
|
|
5354
5354
|
{
|
|
5355
5355
|
const t = a(this, Le).current().get(e.id);
|
|
5356
|
-
t || a(this,
|
|
5356
|
+
t || a(this, Yi).debug("No subscription found", e), t == null || t.onError(e), A(this, Et, Rs).call(this, e.id);
|
|
5357
5357
|
}
|
|
5358
5358
|
break;
|
|
5359
5359
|
case I.SubscribeDone:
|
|
5360
5360
|
{
|
|
5361
5361
|
const t = a(this, Le).current().get(e.id);
|
|
5362
|
-
t || a(this,
|
|
5362
|
+
t || a(this, Yi).debug("No subscription found", e), t == null || t.onDone(e);
|
|
5363
5363
|
}
|
|
5364
5364
|
break;
|
|
5365
5365
|
}
|
|
@@ -5369,7 +5369,7 @@ class to {
|
|
|
5369
5369
|
return f(this, null, function* () {
|
|
5370
5370
|
const t = a(this, Le).current().get(e.subscribeId());
|
|
5371
5371
|
if (!t) {
|
|
5372
|
-
a(this,
|
|
5372
|
+
a(this, Yi).warn("No subscription found", e.subscribeId());
|
|
5373
5373
|
return;
|
|
5374
5374
|
}
|
|
5375
5375
|
yield t.onData(e);
|
|
@@ -5379,13 +5379,13 @@ class to {
|
|
|
5379
5379
|
a(this, Le).current().forEach((e) => e.close()), a(this, Le).close();
|
|
5380
5380
|
}
|
|
5381
5381
|
}
|
|
5382
|
-
Cs =
|
|
5382
|
+
Cs = Si(null), Ot = new WeakMap(), Le = new WeakMap(), $i = new WeakMap(), Yi = new WeakMap(), Et = new WeakSet(), io = function() {
|
|
5383
5383
|
return f(this, null, function* () {
|
|
5384
5384
|
try {
|
|
5385
5385
|
for (var e = Y(a(this, Le)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
5386
5386
|
const o = i.value;
|
|
5387
5387
|
const c = [...o.values()].map((h) => h.state.subscribe);
|
|
5388
|
-
a(this,
|
|
5388
|
+
a(this, Yi).debug("current subscriptions", c);
|
|
5389
5389
|
}
|
|
5390
5390
|
} catch (i) {
|
|
5391
5391
|
n = [i];
|
|
@@ -5400,24 +5400,24 @@ Cs = vi(null), Ot = new WeakMap(), Le = new WeakMap(), qi = new WeakMap(), $i =
|
|
|
5400
5400
|
});
|
|
5401
5401
|
}, Rs = function(e) {
|
|
5402
5402
|
a(this, Le).isClosed() || a(this, Le).update((t) => (t.delete(e), t));
|
|
5403
|
-
}, io = ye(Cs, 17, "#observeChanges", cu, Et, io), ye(Cs, 1, "subscribe", ou, to), ye(Cs, 1, "close", au, to), Rs = ye(Cs, 17, "#deleteSubscription", ru, Et, Rs),
|
|
5404
|
-
var hu, du, uu, lu, it, la,
|
|
5403
|
+
}, io = ye(Cs, 17, "#observeChanges", cu, Et, io), ye(Cs, 1, "subscribe", ou, to), ye(Cs, 1, "close", au, to), Rs = ye(Cs, 17, "#deleteSubscription", ru, Et, Rs), Xt(Cs, to);
|
|
5404
|
+
var hu, du, uu, lu, it, la, Ji, bn, yn, oe, Cl, kl, ks, so, no, ro, ir;
|
|
5405
5405
|
class nd {
|
|
5406
5406
|
constructor(e, t) {
|
|
5407
|
-
|
|
5407
|
+
Ei(ks, 5, this);
|
|
5408
5408
|
u(this, oe);
|
|
5409
5409
|
// The underlying transport implementation
|
|
5410
5410
|
u(this, it);
|
|
5411
5411
|
// The background "thread" running the background tasks
|
|
5412
5412
|
u(this, la);
|
|
5413
5413
|
// Outgoing messages
|
|
5414
|
-
u(this,
|
|
5414
|
+
u(this, Ji);
|
|
5415
5415
|
u(this, bn, ge.get().createContext("Session"));
|
|
5416
5416
|
r(this, "subscriber");
|
|
5417
5417
|
r(this, "publisher");
|
|
5418
5418
|
u(this, yn);
|
|
5419
5419
|
const [i, n] = ed(100);
|
|
5420
|
-
l(this, it, e), l(this,
|
|
5420
|
+
l(this, it, e), l(this, Ji, n), this.subscriber = new to(this, i), this.publisher = new yh(this, e, i), l(this, la, A(this, oe, kl).call(this)), l(this, yn, new Ie(t)), this.closed().then(() => this.close()).catch(D);
|
|
5421
5421
|
}
|
|
5422
5422
|
updateAuthToken(e) {
|
|
5423
5423
|
a(this, yn).update(e);
|
|
@@ -5436,7 +5436,7 @@ class nd {
|
|
|
5436
5436
|
}
|
|
5437
5437
|
close() {
|
|
5438
5438
|
try {
|
|
5439
|
-
this.subscriber.close(), this.publisher.close(), a(this,
|
|
5439
|
+
this.subscriber.close(), this.publisher.close(), a(this, Ji).cancel("closing"), a(this, it).close();
|
|
5440
5440
|
} catch (e) {
|
|
5441
5441
|
a(this, bn).warn("Error closing session", e);
|
|
5442
5442
|
}
|
|
@@ -5448,7 +5448,7 @@ class nd {
|
|
|
5448
5448
|
A(this, oe, ir).call(this);
|
|
5449
5449
|
}
|
|
5450
5450
|
}
|
|
5451
|
-
ks =
|
|
5451
|
+
ks = Si(null), it = new WeakMap(), la = new WeakMap(), Ji = new WeakMap(), bn = new WeakMap(), yn = new WeakMap(), oe = new WeakSet(), Cl = function(e) {
|
|
5452
5452
|
return f(this, null, function* () {
|
|
5453
5453
|
var t, i;
|
|
5454
5454
|
switch (a(this, bn).debug("received message", e), yield (t = this.subscriber) == null ? void 0 : t.onMessage(e), yield (i = this.publisher) == null ? void 0 : i.onMessage(e), e.type) {
|
|
@@ -5464,7 +5464,7 @@ ks = vi(null), it = new WeakMap(), la = new WeakMap(), Yi = new WeakMap(), bn =
|
|
|
5464
5464
|
return f(this, null, function* () {
|
|
5465
5465
|
try {
|
|
5466
5466
|
try {
|
|
5467
|
-
for (var e = Y(a(this,
|
|
5467
|
+
for (var e = Y(a(this, Ji)), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
5468
5468
|
const o = i.value;
|
|
5469
5469
|
a(this, bn).debug("sending message", o), yield a(this, it).writeMessage(o);
|
|
5470
5470
|
}
|
|
@@ -5495,7 +5495,7 @@ ks = vi(null), it = new WeakMap(), la = new WeakMap(), Yi = new WeakMap(), bn =
|
|
|
5495
5495
|
} catch (e) {
|
|
5496
5496
|
return e;
|
|
5497
5497
|
} finally {
|
|
5498
|
-
a(this,
|
|
5498
|
+
a(this, Ji).cancel("closing");
|
|
5499
5499
|
}
|
|
5500
5500
|
});
|
|
5501
5501
|
}, ro = function() {
|
|
@@ -5514,74 +5514,74 @@ ks = vi(null), it = new WeakMap(), la = new WeakMap(), Yi = new WeakMap(), bn =
|
|
|
5514
5514
|
});
|
|
5515
5515
|
}, ir = function() {
|
|
5516
5516
|
this.close();
|
|
5517
|
-
}, so = ye(ks, 17, "#runOutgoingMessages", lu, oe, so), no = ye(ks, 17, "#runControl", uu, oe, no), ro = ye(ks, 17, "#runObjects", du, oe, ro), ir = ye(ks, 17, "#dispose", hu, oe, ir),
|
|
5517
|
+
}, so = ye(ks, 17, "#runOutgoingMessages", lu, oe, so), no = ye(ks, 17, "#runControl", uu, oe, no), ro = ye(ks, 17, "#runObjects", du, oe, ro), ir = ye(ks, 17, "#dispose", hu, oe, ir), Xt(ks, nd);
|
|
5518
5518
|
const aA = 128;
|
|
5519
|
-
var ze, ma,
|
|
5519
|
+
var ze, ma, Ki, vn, fa, be, Bi, Ri;
|
|
5520
5520
|
class oA {
|
|
5521
5521
|
constructor(e, t, i) {
|
|
5522
5522
|
u(this, be);
|
|
5523
5523
|
u(this, ze);
|
|
5524
5524
|
u(this, ma);
|
|
5525
|
-
u(this,
|
|
5525
|
+
u(this, Ki, !0);
|
|
5526
5526
|
u(this, vn, !1);
|
|
5527
5527
|
u(this, fa);
|
|
5528
5528
|
l(this, ze, e), l(this, ma, t), l(this, fa, i);
|
|
5529
5529
|
}
|
|
5530
5530
|
writeUnsigned8(e) {
|
|
5531
5531
|
return f(this, null, function* () {
|
|
5532
|
-
return A(this, be,
|
|
5532
|
+
return A(this, be, Bi).call(this), yield A(this, be, Ri).call(this), a(this, ze).writeUnsigned8(e);
|
|
5533
5533
|
});
|
|
5534
5534
|
}
|
|
5535
5535
|
writeVarInt(e) {
|
|
5536
5536
|
return f(this, null, function* () {
|
|
5537
|
-
return A(this, be,
|
|
5537
|
+
return A(this, be, Bi).call(this), yield A(this, be, Ri).call(this), a(this, ze).writeVarInt(e);
|
|
5538
5538
|
});
|
|
5539
5539
|
}
|
|
5540
5540
|
writeBigVarInt(e) {
|
|
5541
5541
|
return f(this, null, function* () {
|
|
5542
|
-
return A(this, be,
|
|
5542
|
+
return A(this, be, Bi).call(this), yield A(this, be, Ri).call(this), a(this, ze).writeBigVarInt(e);
|
|
5543
5543
|
});
|
|
5544
5544
|
}
|
|
5545
5545
|
write(e) {
|
|
5546
5546
|
return f(this, null, function* () {
|
|
5547
|
-
return A(this, be,
|
|
5547
|
+
return A(this, be, Bi).call(this), yield A(this, be, Ri).call(this), a(this, ze).write(e);
|
|
5548
5548
|
});
|
|
5549
5549
|
}
|
|
5550
5550
|
writeString(e) {
|
|
5551
5551
|
return f(this, null, function* () {
|
|
5552
|
-
return A(this, be,
|
|
5552
|
+
return A(this, be, Bi).call(this), yield A(this, be, Ri).call(this), a(this, ze).writeString(e);
|
|
5553
5553
|
});
|
|
5554
5554
|
}
|
|
5555
5555
|
flush() {
|
|
5556
5556
|
return f(this, null, function* () {
|
|
5557
|
-
A(this, be,
|
|
5557
|
+
A(this, be, Bi).call(this), l(this, Ki, !0), yield a(this, ze).flush();
|
|
5558
5558
|
});
|
|
5559
5559
|
}
|
|
5560
5560
|
close() {
|
|
5561
5561
|
return f(this, null, function* () {
|
|
5562
|
-
a(this, vn) || (l(this,
|
|
5562
|
+
a(this, vn) || (l(this, Ki, !0), yield A(this, be, Ri).call(this, !1), yield a(this, ze).flush(), l(this, vn, !0), a(this, fa).call(this));
|
|
5563
5563
|
});
|
|
5564
5564
|
}
|
|
5565
5565
|
}
|
|
5566
|
-
ze = new WeakMap(), ma = new WeakMap(),
|
|
5566
|
+
ze = new WeakMap(), ma = new WeakMap(), Ki = new WeakMap(), vn = new WeakMap(), fa = new WeakMap(), be = new WeakSet(), Bi = function() {
|
|
5567
5567
|
if (a(this, vn))
|
|
5568
5568
|
throw new Error("Stream is closed");
|
|
5569
|
-
},
|
|
5570
|
-
if (a(this,
|
|
5571
|
-
return l(this,
|
|
5569
|
+
}, Ri = function(e = !0) {
|
|
5570
|
+
if (a(this, Ki))
|
|
5571
|
+
return l(this, Ki, !1), a(this, ze).writeUnsigned8(a(this, ma) | (e ? aA : 0));
|
|
5572
5572
|
};
|
|
5573
|
-
var
|
|
5573
|
+
var ci, Mt, Sn, es, Ft, En, Tn, ec, Bl;
|
|
5574
5574
|
class cA {
|
|
5575
5575
|
constructor(e, t) {
|
|
5576
5576
|
u(this, ec);
|
|
5577
|
-
u(this,
|
|
5577
|
+
u(this, ci);
|
|
5578
5578
|
u(this, Mt);
|
|
5579
5579
|
u(this, Sn);
|
|
5580
|
-
u(this,
|
|
5580
|
+
u(this, es);
|
|
5581
5581
|
u(this, Ft, /* @__PURE__ */ new Map());
|
|
5582
5582
|
u(this, En, ge.get().createContext("WebSocketConnection"));
|
|
5583
5583
|
u(this, Tn, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
|
|
5584
|
-
l(this,
|
|
5584
|
+
l(this, ci, e), l(this, Mt, t), l(this, Sn, new ReadableStream(new yg(e))), a(this, ci).addEventListener("close", () => {
|
|
5585
5585
|
a(this, Mt).markPostHandshake(), a(this, Ft).forEach((i) => i.close());
|
|
5586
5586
|
});
|
|
5587
5587
|
}
|
|
@@ -5590,14 +5590,14 @@ class cA {
|
|
|
5590
5590
|
if (!e)
|
|
5591
5591
|
throw new Error("No stream IDs available");
|
|
5592
5592
|
return a(this, Tn).delete(e), Promise.resolve(
|
|
5593
|
-
new oA(new Rr(a(this,
|
|
5593
|
+
new oA(new Rr(a(this, ci)), e, () => A(this, ec, Bl).call(this, e))
|
|
5594
5594
|
);
|
|
5595
5595
|
}
|
|
5596
5596
|
transportType() {
|
|
5597
5597
|
return "websocket";
|
|
5598
5598
|
}
|
|
5599
5599
|
url() {
|
|
5600
|
-
return a(this,
|
|
5600
|
+
return a(this, ci).url;
|
|
5601
5601
|
}
|
|
5602
5602
|
afterHandshake() {
|
|
5603
5603
|
return a(this, Mt).postHandshake();
|
|
@@ -5606,9 +5606,9 @@ class cA {
|
|
|
5606
5606
|
return f(this, null, function* () {
|
|
5607
5607
|
var e;
|
|
5608
5608
|
for (; ; ) {
|
|
5609
|
-
l(this,
|
|
5609
|
+
l(this, es, a(this, Sn).getReader());
|
|
5610
5610
|
try {
|
|
5611
|
-
const { value: t, done: i } = yield a(this,
|
|
5611
|
+
const { value: t, done: i } = yield a(this, es).read();
|
|
5612
5612
|
if (i)
|
|
5613
5613
|
return;
|
|
5614
5614
|
const [n, o, c] = t;
|
|
@@ -5632,14 +5632,14 @@ class cA {
|
|
|
5632
5632
|
return yield qu(new Ro(c, m), o);
|
|
5633
5633
|
}
|
|
5634
5634
|
} finally {
|
|
5635
|
-
(e = a(this,
|
|
5635
|
+
(e = a(this, es)) == null || e.releaseLock();
|
|
5636
5636
|
}
|
|
5637
5637
|
}
|
|
5638
5638
|
});
|
|
5639
5639
|
}
|
|
5640
5640
|
close() {
|
|
5641
5641
|
var e;
|
|
5642
|
-
return a(this, Mt).cancel().catch(D), a(this, Sn).cancel("closing").catch(D), (e = a(this,
|
|
5642
|
+
return a(this, Mt).cancel().catch(D), a(this, Sn).cancel("closing").catch(D), (e = a(this, es)) == null || e.cancel("closing").catch(D), a(this, ci).close();
|
|
5643
5643
|
}
|
|
5644
5644
|
closed() {
|
|
5645
5645
|
return Promise.resolve();
|
|
@@ -5655,30 +5655,32 @@ class cA {
|
|
|
5655
5655
|
});
|
|
5656
5656
|
}
|
|
5657
5657
|
}
|
|
5658
|
-
|
|
5658
|
+
ci = new WeakMap(), Mt = new WeakMap(), Sn = new WeakMap(), es = new WeakMap(), Ft = new WeakMap(), En = new WeakMap(), Tn = new WeakMap(), ec = new WeakSet(), /**
|
|
5659
5659
|
* Return a stream ID to the pool of available stream IDs
|
|
5660
5660
|
* @param streamId - The stream ID to return
|
|
5661
5661
|
*/
|
|
5662
5662
|
Bl = function(e) {
|
|
5663
5663
|
a(this, Tn).add(e);
|
|
5664
5664
|
};
|
|
5665
|
-
var
|
|
5665
|
+
var _t, Nt, hi, pa, ga, tc, ic, Rl;
|
|
5666
5666
|
class hA {
|
|
5667
5667
|
constructor(e, t, i) {
|
|
5668
5668
|
u(this, ic);
|
|
5669
|
-
u(this,
|
|
5670
|
-
u(this,
|
|
5671
|
-
u(this,
|
|
5669
|
+
u(this, _t);
|
|
5670
|
+
u(this, Nt);
|
|
5671
|
+
u(this, hi, new Dc(100));
|
|
5672
5672
|
u(this, pa);
|
|
5673
5673
|
u(this, ga, 0);
|
|
5674
5674
|
u(this, tc, ge.get().createContext("WebTransportConnection"));
|
|
5675
|
-
l(this, pa, i), l(this,
|
|
5676
|
-
a(this, tc).debug("Incoming streams handling ended with error", n), a(this,
|
|
5675
|
+
l(this, pa, i), l(this, _t, e), l(this, Nt, t), A(this, ic, Rl).call(this).catch((n) => {
|
|
5676
|
+
a(this, tc).debug("Incoming streams handling ended with error", n), a(this, Nt).markPostHandshake(), a(this, hi).close();
|
|
5677
|
+
}), a(this, _t).closed.then(() => {
|
|
5678
|
+
a(this, Nt).markPostHandshake(), a(this, hi).close();
|
|
5677
5679
|
});
|
|
5678
5680
|
}
|
|
5679
5681
|
openSendStream() {
|
|
5680
5682
|
return f(this, null, function* () {
|
|
5681
|
-
const e = yield a(this,
|
|
5683
|
+
const e = yield a(this, _t).createUnidirectionalStream();
|
|
5682
5684
|
return new $u(e);
|
|
5683
5685
|
});
|
|
5684
5686
|
}
|
|
@@ -5689,43 +5691,43 @@ class hA {
|
|
|
5689
5691
|
return a(this, pa);
|
|
5690
5692
|
}
|
|
5691
5693
|
afterHandshake() {
|
|
5692
|
-
return a(this,
|
|
5694
|
+
return a(this, Nt).postHandshake();
|
|
5693
5695
|
}
|
|
5694
5696
|
closed() {
|
|
5695
5697
|
return f(this, null, function* () {
|
|
5696
|
-
yield a(this,
|
|
5698
|
+
yield a(this, _t).closed;
|
|
5697
5699
|
});
|
|
5698
5700
|
}
|
|
5699
5701
|
close() {
|
|
5700
|
-
a(this,
|
|
5702
|
+
a(this, _t).close();
|
|
5701
5703
|
}
|
|
5702
5704
|
writeMessage(e) {
|
|
5703
5705
|
return f(this, null, function* () {
|
|
5704
|
-
yield a(this,
|
|
5706
|
+
yield a(this, Nt).write(e);
|
|
5705
5707
|
});
|
|
5706
5708
|
}
|
|
5707
5709
|
readMessage() {
|
|
5708
5710
|
return f(this, null, function* () {
|
|
5709
|
-
return a(this,
|
|
5711
|
+
return a(this, Nt).read();
|
|
5710
5712
|
});
|
|
5711
5713
|
}
|
|
5712
5714
|
objectStream() {
|
|
5713
5715
|
return f(this, null, function* () {
|
|
5714
|
-
return a(this,
|
|
5716
|
+
return a(this, hi).pop();
|
|
5715
5717
|
});
|
|
5716
5718
|
}
|
|
5717
5719
|
}
|
|
5718
|
-
|
|
5720
|
+
_t = new WeakMap(), Nt = new WeakMap(), hi = new WeakMap(), pa = new WeakMap(), ga = new WeakMap(), tc = new WeakMap(), ic = new WeakSet(), Rl = function() {
|
|
5719
5721
|
return f(this, null, function* () {
|
|
5720
|
-
const e = a(this,
|
|
5722
|
+
const e = a(this, _t).incomingUnidirectionalStreams.getReader();
|
|
5721
5723
|
for (; ; ) {
|
|
5722
5724
|
const { value: t, done: i } = yield e.read();
|
|
5723
5725
|
if (i) {
|
|
5724
|
-
a(this,
|
|
5726
|
+
a(this, hi).close();
|
|
5725
5727
|
return;
|
|
5726
5728
|
}
|
|
5727
5729
|
const n = new Ro(new Uint8Array(), t);
|
|
5728
|
-
yield a(this,
|
|
5730
|
+
yield a(this, hi).push(qu(n, a(this, ga))), Ze(this, ga)._++;
|
|
5729
5731
|
}
|
|
5730
5732
|
});
|
|
5731
5733
|
};
|
|
@@ -5770,10 +5772,10 @@ function uA(s) {
|
|
|
5770
5772
|
return $c(s);
|
|
5771
5773
|
});
|
|
5772
5774
|
}
|
|
5773
|
-
var
|
|
5774
|
-
class
|
|
5775
|
+
var Vt;
|
|
5776
|
+
class zt {
|
|
5775
5777
|
constructor() {
|
|
5776
|
-
u(this,
|
|
5778
|
+
u(this, Vt, {
|
|
5777
5779
|
name: "",
|
|
5778
5780
|
priority: 0,
|
|
5779
5781
|
groupOrder: "descending",
|
|
@@ -5781,36 +5783,36 @@ class jt {
|
|
|
5781
5783
|
});
|
|
5782
5784
|
}
|
|
5783
5785
|
name(e) {
|
|
5784
|
-
return a(this,
|
|
5786
|
+
return a(this, Vt).name = e, this;
|
|
5785
5787
|
}
|
|
5786
5788
|
priority(e) {
|
|
5787
|
-
return a(this,
|
|
5789
|
+
return a(this, Vt).priority = e, this;
|
|
5788
5790
|
}
|
|
5789
5791
|
groupOrder(e) {
|
|
5790
|
-
return a(this,
|
|
5792
|
+
return a(this, Vt).groupOrder = e, this;
|
|
5791
5793
|
}
|
|
5792
5794
|
/**
|
|
5793
5795
|
* @param startGroup the group to start the subscription at
|
|
5794
5796
|
* @returns the builder
|
|
5795
5797
|
*/
|
|
5796
5798
|
startGroup(e) {
|
|
5797
|
-
return a(this,
|
|
5799
|
+
return a(this, Vt).filterType = {
|
|
5798
5800
|
type: "absolute-start",
|
|
5799
5801
|
start: { group: e, object: B(0) }
|
|
5800
5802
|
}, this;
|
|
5801
5803
|
}
|
|
5802
5804
|
range(e, t) {
|
|
5803
|
-
return a(this,
|
|
5805
|
+
return a(this, Vt).filterType = {
|
|
5804
5806
|
type: "absolute-range",
|
|
5805
5807
|
start: { group: e, object: B(0) },
|
|
5806
5808
|
end: { group: t, object: B(0) }
|
|
5807
5809
|
}, this;
|
|
5808
5810
|
}
|
|
5809
5811
|
build() {
|
|
5810
|
-
return a(this,
|
|
5812
|
+
return a(this, Vt);
|
|
5811
5813
|
}
|
|
5812
5814
|
}
|
|
5813
|
-
|
|
5815
|
+
Vt = new WeakMap();
|
|
5814
5816
|
var In, Aa;
|
|
5815
5817
|
class Ul {
|
|
5816
5818
|
constructor(e, t) {
|
|
@@ -5832,7 +5834,7 @@ In = new WeakMap(), Aa = new WeakMap();
|
|
|
5832
5834
|
function lA(s, e) {
|
|
5833
5835
|
return ["com.vindral.moq", s];
|
|
5834
5836
|
}
|
|
5835
|
-
function
|
|
5837
|
+
function Ti(s) {
|
|
5836
5838
|
const e = s[1];
|
|
5837
5839
|
if (!e)
|
|
5838
5840
|
throw new Error("namespace must contain a channel ID");
|
|
@@ -5933,7 +5935,7 @@ De = new WeakMap(), wt = new WeakMap(), ts = new WeakMap(), He = new WeakMap(),
|
|
|
5933
5935
|
}), i;
|
|
5934
5936
|
};
|
|
5935
5937
|
let Do = cd;
|
|
5936
|
-
var st, is,
|
|
5938
|
+
var st, is, Gt, bt, ya, Sh, va;
|
|
5937
5939
|
const hd = class hd {
|
|
5938
5940
|
constructor(e) {
|
|
5939
5941
|
u(this, ya);
|
|
@@ -5942,7 +5944,7 @@ const hd = class hd {
|
|
|
5942
5944
|
// The current group iterator - gets replaced by the next in #groups when it runs out
|
|
5943
5945
|
u(this, is);
|
|
5944
5946
|
// The next group iterators to switch to when the current one runs out
|
|
5945
|
-
u(this,
|
|
5947
|
+
u(this, Gt, new Dc(10));
|
|
5946
5948
|
u(this, bt);
|
|
5947
5949
|
u(this, va, (e, t) => f(this, null, function* () {
|
|
5948
5950
|
var g = [];
|
|
@@ -5955,7 +5957,7 @@ const hd = class hd {
|
|
|
5955
5957
|
}
|
|
5956
5958
|
const o = i.value.largestGroupId();
|
|
5957
5959
|
const c = o !== void 0;
|
|
5958
|
-
const h = new
|
|
5960
|
+
const h = new zt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
|
|
5959
5961
|
n.largestGroupId = o;
|
|
5960
5962
|
a(this, bt).debug("Renewing subscription", n);
|
|
5961
5963
|
switch (t.filterType.type) {
|
|
@@ -5978,7 +5980,7 @@ const hd = class hd {
|
|
|
5978
5980
|
m.expiryNotification().then(() => a(this, va).call(this, e, d)).catch(D);
|
|
5979
5981
|
const p = new Do(m, o);
|
|
5980
5982
|
i.value = p;
|
|
5981
|
-
yield a(this,
|
|
5983
|
+
yield a(this, Gt).push(p);
|
|
5982
5984
|
a(this, bt).info("Subscription renewed", n);
|
|
5983
5985
|
} catch (w) {
|
|
5984
5986
|
var b = w, S = !0;
|
|
@@ -6008,7 +6010,7 @@ const hd = class hd {
|
|
|
6008
6010
|
var n = [];
|
|
6009
6011
|
try {
|
|
6010
6012
|
const i = Ne(n, yield a(this, st).lock());
|
|
6011
|
-
a(this,
|
|
6013
|
+
a(this, Gt).close();
|
|
6012
6014
|
return i.value.update(e, t);
|
|
6013
6015
|
} catch (o) {
|
|
6014
6016
|
var c = o, h = !0;
|
|
@@ -6022,7 +6024,7 @@ const hd = class hd {
|
|
|
6022
6024
|
var i = [];
|
|
6023
6025
|
try {
|
|
6024
6026
|
const t = Ne(i, yield a(this, st).lock());
|
|
6025
|
-
a(this,
|
|
6027
|
+
a(this, Gt).close();
|
|
6026
6028
|
return t.value.endOfTrack(e);
|
|
6027
6029
|
} catch (n) {
|
|
6028
6030
|
var o = n, c = !0;
|
|
@@ -6036,7 +6038,7 @@ const hd = class hd {
|
|
|
6036
6038
|
var t = [];
|
|
6037
6039
|
try {
|
|
6038
6040
|
const e = Ne(t, yield a(this, st).lock());
|
|
6039
|
-
a(this,
|
|
6041
|
+
a(this, Gt).close();
|
|
6040
6042
|
return e.value.unsubscribe();
|
|
6041
6043
|
} catch (i) {
|
|
6042
6044
|
var n = i, o = !0;
|
|
@@ -6050,7 +6052,7 @@ const hd = class hd {
|
|
|
6050
6052
|
var t = [];
|
|
6051
6053
|
try {
|
|
6052
6054
|
const e = Ne(t, yield a(this, st).lock());
|
|
6053
|
-
a(this,
|
|
6055
|
+
a(this, Gt).close();
|
|
6054
6056
|
return e.value.return();
|
|
6055
6057
|
} catch (i) {
|
|
6056
6058
|
var n = i, o = !0;
|
|
@@ -6065,7 +6067,7 @@ const hd = class hd {
|
|
|
6065
6067
|
const e = yield a(this, is).next();
|
|
6066
6068
|
if (e.done) {
|
|
6067
6069
|
yield (i = (t = a(this, is)).return) == null ? void 0 : i.call(t);
|
|
6068
|
-
const n = yield a(this,
|
|
6070
|
+
const n = yield a(this, Gt).pop();
|
|
6069
6071
|
if (n)
|
|
6070
6072
|
return l(this, is, n), this.next();
|
|
6071
6073
|
}
|
|
@@ -6104,7 +6106,7 @@ const hd = class hd {
|
|
|
6104
6106
|
});
|
|
6105
6107
|
}
|
|
6106
6108
|
};
|
|
6107
|
-
st = new WeakMap(), is = new WeakMap(),
|
|
6109
|
+
st = new WeakMap(), is = new WeakMap(), Gt = new WeakMap(), bt = new WeakMap(), ya = new WeakSet(), Sh = function(e) {
|
|
6108
6110
|
return f(this, null, function* () {
|
|
6109
6111
|
var t;
|
|
6110
6112
|
if (e.unsubscribed() || (t = e.range()) != null && t.endGroup) {
|
|
@@ -6118,7 +6120,7 @@ st = new WeakMap(), is = new WeakMap(), Nt = new WeakMap(), bt = new WeakMap(),
|
|
|
6118
6120
|
return this.return();
|
|
6119
6121
|
});
|
|
6120
6122
|
}, va = new WeakMap();
|
|
6121
|
-
let
|
|
6123
|
+
let vi = hd;
|
|
6122
6124
|
const pA = "catalog";
|
|
6123
6125
|
function Gd(s) {
|
|
6124
6126
|
const e = fA(s.payload);
|
|
@@ -6126,33 +6128,33 @@ function Gd(s) {
|
|
|
6126
6128
|
throw new Error("unexpected catalog type");
|
|
6127
6129
|
return e;
|
|
6128
6130
|
}
|
|
6129
|
-
var
|
|
6131
|
+
var di, Sa, Ea, Ta, nc, Pl;
|
|
6130
6132
|
const rc = class rc {
|
|
6131
6133
|
constructor(e, t, i) {
|
|
6132
6134
|
u(this, nc);
|
|
6133
|
-
u(this,
|
|
6135
|
+
u(this, di);
|
|
6134
6136
|
u(this, Sa);
|
|
6135
6137
|
u(this, Ea);
|
|
6136
6138
|
u(this, Ta);
|
|
6137
|
-
l(this, Sa, e), l(this,
|
|
6139
|
+
l(this, Sa, e), l(this, di, t), l(this, Ea, i), l(this, Ta, A(this, nc, Pl).call(this)), this.closed().finally(() => a(this, di).close()).catch(D);
|
|
6138
6140
|
}
|
|
6139
6141
|
catalog() {
|
|
6140
|
-
return a(this,
|
|
6142
|
+
return a(this, di);
|
|
6141
6143
|
}
|
|
6142
6144
|
closed() {
|
|
6143
6145
|
return a(this, Ta);
|
|
6144
6146
|
}
|
|
6145
6147
|
close() {
|
|
6146
6148
|
return f(this, null, function* () {
|
|
6147
|
-
return a(this,
|
|
6149
|
+
return a(this, di).close(), (yield a(this, Sa).promise).unsubscribe();
|
|
6148
6150
|
});
|
|
6149
6151
|
}
|
|
6150
6152
|
static start(e, t) {
|
|
6151
6153
|
return f(this, null, function* () {
|
|
6152
6154
|
const i = H.fromPromise(
|
|
6153
|
-
|
|
6155
|
+
vi.subscribe(
|
|
6154
6156
|
e,
|
|
6155
|
-
new
|
|
6157
|
+
new zt().name(t.catalogName || pA).groupOrder("ascending").build()
|
|
6156
6158
|
)
|
|
6157
6159
|
), n = H.fromPromise(i.promise.then((d) => d.objects()));
|
|
6158
6160
|
if (t.catalog)
|
|
@@ -6165,7 +6167,7 @@ const rc = class rc {
|
|
|
6165
6167
|
});
|
|
6166
6168
|
}
|
|
6167
6169
|
};
|
|
6168
|
-
|
|
6170
|
+
di = new WeakMap(), Sa = new WeakMap(), Ea = new WeakMap(), Ta = new WeakMap(), nc = new WeakSet(), Pl = function() {
|
|
6169
6171
|
return f(this, null, function* () {
|
|
6170
6172
|
const e = yield a(this, Ea).promise;
|
|
6171
6173
|
try {
|
|
@@ -6174,7 +6176,7 @@ hi = new WeakMap(), Sa = new WeakMap(), Ea = new WeakMap(), Ta = new WeakMap(),
|
|
|
6174
6176
|
if (c.objectStatus !== Te.Normal)
|
|
6175
6177
|
continue;
|
|
6176
6178
|
const h = Gd(c);
|
|
6177
|
-
a(this,
|
|
6179
|
+
a(this, di).update(h);
|
|
6178
6180
|
}
|
|
6179
6181
|
} catch (n) {
|
|
6180
6182
|
o = [n];
|
|
@@ -6267,18 +6269,18 @@ const Fs = class Fs {
|
|
|
6267
6269
|
var p;
|
|
6268
6270
|
if (t.format !== "cmaf")
|
|
6269
6271
|
throw new Error("format must be cmaf");
|
|
6270
|
-
const o = new
|
|
6272
|
+
const o = new zt().name(t.name);
|
|
6271
6273
|
n && o.startGroup(n);
|
|
6272
6274
|
const c = o.build();
|
|
6273
6275
|
if (t.initTrack) {
|
|
6274
|
-
const g = new
|
|
6276
|
+
const g = new zt().name(t.initTrack).build(), [w, b] = yield Promise.all([
|
|
6275
6277
|
A(p = Fs, ac, xl).call(p, e, g),
|
|
6276
|
-
|
|
6278
|
+
vi.subscribe(e, c, n ? n - B(1) : void 0)
|
|
6277
6279
|
]), S = new Dd(w);
|
|
6278
6280
|
return new Fs(t, e.namespace(), b, S, i);
|
|
6279
6281
|
}
|
|
6280
6282
|
Xe(t.initData, "no init data found on track");
|
|
6281
|
-
const h = bu(t.initData), d = new Dd(new Uint8Array(h)), m = yield
|
|
6283
|
+
const h = bu(t.initData), d = new Dd(new Uint8Array(h)), m = yield vi.subscribe(e, c, n ? n - B(1) : void 0);
|
|
6282
6284
|
return new Fs(t, e.namespace(), m, d, i);
|
|
6283
6285
|
});
|
|
6284
6286
|
}
|
|
@@ -6348,17 +6350,17 @@ Ba = new WeakMap(), yt = new WeakMap(), Ra = new WeakMap(), Ua = new WeakMap(),
|
|
|
6348
6350
|
}, u(Fs, ac);
|
|
6349
6351
|
let Ih = Fs;
|
|
6350
6352
|
const jd = 1e4, AA = 3e4;
|
|
6351
|
-
var oc,
|
|
6353
|
+
var oc, ui, ss, Pa, xa, La, vs, kh, Ll;
|
|
6352
6354
|
const dd = class dd {
|
|
6353
6355
|
constructor(e, t, i) {
|
|
6354
6356
|
u(this, vs);
|
|
6355
6357
|
u(this, oc, ge.get().createContext("Timeline"));
|
|
6356
|
-
u(this,
|
|
6358
|
+
u(this, ui, new Ie([]));
|
|
6357
6359
|
u(this, ss);
|
|
6358
6360
|
u(this, Pa);
|
|
6359
6361
|
u(this, xa);
|
|
6360
6362
|
u(this, La);
|
|
6361
|
-
l(this, Pa, e), l(this, xa, i), l(this, ss, t), l(this, La, A(this, vs, kh).call(this, a(this, ss))), this.closed().finally(() => a(this,
|
|
6363
|
+
l(this, Pa, e), l(this, xa, i), l(this, ss, t), l(this, La, A(this, vs, kh).call(this, a(this, ss))), this.closed().finally(() => a(this, ui).close()).catch(D);
|
|
6362
6364
|
}
|
|
6363
6365
|
closed() {
|
|
6364
6366
|
return a(this, La);
|
|
@@ -6369,7 +6371,7 @@ const dd = class dd {
|
|
|
6369
6371
|
});
|
|
6370
6372
|
}
|
|
6371
6373
|
timeline() {
|
|
6372
|
-
const [e, t] = a(this,
|
|
6374
|
+
const [e, t] = a(this, ui).value();
|
|
6373
6375
|
return e;
|
|
6374
6376
|
}
|
|
6375
6377
|
/**
|
|
@@ -6381,25 +6383,25 @@ const dd = class dd {
|
|
|
6381
6383
|
}
|
|
6382
6384
|
static start(e, t) {
|
|
6383
6385
|
const i = H.fromPromise(
|
|
6384
|
-
|
|
6386
|
+
vi.subscribe(e, new zt().name(t).groupOrder("ascending").build())
|
|
6385
6387
|
);
|
|
6386
6388
|
return new dd(e, i, t);
|
|
6387
6389
|
}
|
|
6388
6390
|
waitForWallclockTime(e) {
|
|
6389
6391
|
return f(this, null, function* () {
|
|
6390
|
-
return yield a(this,
|
|
6392
|
+
return yield a(this, ui).waitFor((t) => !!t.find((i) => i.wallclock >= e)), this.timeline();
|
|
6391
6393
|
});
|
|
6392
6394
|
}
|
|
6393
6395
|
waitForTimelineToHaveMinDuration() {
|
|
6394
6396
|
return f(this, null, function* () {
|
|
6395
|
-
return yield a(this,
|
|
6397
|
+
return yield a(this, ui).waitFor((e) => {
|
|
6396
6398
|
const t = e[0], i = e[e.length - 1];
|
|
6397
6399
|
return !t || !i ? !1 : i.wallclock - t.wallclock > jd;
|
|
6398
6400
|
}), this.timeline();
|
|
6399
6401
|
});
|
|
6400
6402
|
}
|
|
6401
6403
|
};
|
|
6402
|
-
oc = new WeakMap(),
|
|
6404
|
+
oc = new WeakMap(), ui = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(), xa = new WeakMap(), La = new WeakMap(), vs = new WeakSet(), kh = function(e) {
|
|
6403
6405
|
return f(this, null, function* () {
|
|
6404
6406
|
const t = yield e.promise;
|
|
6405
6407
|
try {
|
|
@@ -6414,7 +6416,7 @@ oc = new WeakMap(), di = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(),
|
|
|
6414
6416
|
if (T.objectStatus !== Te.Normal)
|
|
6415
6417
|
continue;
|
|
6416
6418
|
const U = wA(T.payload);
|
|
6417
|
-
a(this,
|
|
6419
|
+
a(this, ui).update((k) => {
|
|
6418
6420
|
var _, ce;
|
|
6419
6421
|
for (k.push(...U), k.sort((Me, Z) => Me.wallclock - Z.wallclock); k[0] && ((ce = (_ = k[k.length - 1]) == null ? void 0 : _.wallclock) != null ? ce : 0) - k[0].wallclock > AA; )
|
|
6420
6422
|
k.shift();
|
|
@@ -6457,9 +6459,9 @@ oc = new WeakMap(), di = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(),
|
|
|
6457
6459
|
if (!n || !o || o.wallclock - n.wallclock > jd)
|
|
6458
6460
|
return;
|
|
6459
6461
|
const c = H.fromPromise(
|
|
6460
|
-
|
|
6462
|
+
vi.subscribe(
|
|
6461
6463
|
a(this, Pa),
|
|
6462
|
-
new
|
|
6464
|
+
new zt().name(a(this, xa)).groupOrder("ascending").range(t, t).build()
|
|
6463
6465
|
)
|
|
6464
6466
|
);
|
|
6465
6467
|
return A(this, vs, kh).call(this, c);
|
|
@@ -6486,33 +6488,33 @@ function wA(s) {
|
|
|
6486
6488
|
function bA(s) {
|
|
6487
6489
|
return typeof s.language == "string";
|
|
6488
6490
|
}
|
|
6489
|
-
var cc, Da,
|
|
6491
|
+
var cc, Da, li, Bn;
|
|
6490
6492
|
const ud = class ud {
|
|
6491
6493
|
constructor(e, t, i, n, o) {
|
|
6492
6494
|
u(this, cc, new zu());
|
|
6493
6495
|
u(this, Da);
|
|
6494
|
-
u(this,
|
|
6496
|
+
u(this, li);
|
|
6495
6497
|
u(this, Bn, 0);
|
|
6496
6498
|
r(this, "trackObject");
|
|
6497
6499
|
r(this, "namespace");
|
|
6498
|
-
l(this,
|
|
6500
|
+
l(this, li, e), l(this, Da, t), this.trackObject = i, this.namespace = n, l(this, Bn, o);
|
|
6499
6501
|
}
|
|
6500
6502
|
static subscribe(e, t, i) {
|
|
6501
6503
|
return f(this, null, function* () {
|
|
6502
6504
|
if (!bA(t))
|
|
6503
6505
|
throw new Error("track object language is required");
|
|
6504
|
-
const n = new
|
|
6506
|
+
const n = new zt().name(t.name).build(), o = yield vi.subscribe(e, n), c = o.objects();
|
|
6505
6507
|
return new ud(o, c, t, e.namespace(), i);
|
|
6506
6508
|
});
|
|
6507
6509
|
}
|
|
6508
6510
|
largestGroupId() {
|
|
6509
|
-
return a(this,
|
|
6511
|
+
return a(this, li).largestGroupId();
|
|
6510
6512
|
}
|
|
6511
6513
|
update(e, t) {
|
|
6512
|
-
return a(this,
|
|
6514
|
+
return a(this, li).update(e, t);
|
|
6513
6515
|
}
|
|
6514
6516
|
unsubscribe() {
|
|
6515
|
-
return a(this,
|
|
6517
|
+
return a(this, li).unsubscribe();
|
|
6516
6518
|
}
|
|
6517
6519
|
next() {
|
|
6518
6520
|
return f(this, null, function* () {
|
|
@@ -6532,7 +6534,7 @@ const ud = class ud {
|
|
|
6532
6534
|
}
|
|
6533
6535
|
return() {
|
|
6534
6536
|
return f(this, null, function* () {
|
|
6535
|
-
return yield a(this,
|
|
6537
|
+
return yield a(this, li).return(), { done: !0, value: void 0 };
|
|
6536
6538
|
});
|
|
6537
6539
|
}
|
|
6538
6540
|
[Symbol.asyncIterator]() {
|
|
@@ -6545,9 +6547,9 @@ const ud = class ud {
|
|
|
6545
6547
|
return this.unsubscribe();
|
|
6546
6548
|
}
|
|
6547
6549
|
};
|
|
6548
|
-
cc = new WeakMap(), Da = new WeakMap(),
|
|
6550
|
+
cc = new WeakMap(), Da = new WeakMap(), li = new WeakMap(), Bn = new WeakMap();
|
|
6549
6551
|
let Bh = ud;
|
|
6550
|
-
var mu, ns, rs, as,
|
|
6552
|
+
var mu, ns, rs, as, mi, rh, Rn, ao;
|
|
6551
6553
|
mu = [Pe({ context: "Channel", enter: "info" })];
|
|
6552
6554
|
const _s = class _s {
|
|
6553
6555
|
constructor(e, t, i, n, o) {
|
|
@@ -6556,8 +6558,8 @@ const _s = class _s {
|
|
|
6556
6558
|
u(this, ns);
|
|
6557
6559
|
u(this, rs);
|
|
6558
6560
|
u(this, as);
|
|
6559
|
-
u(this,
|
|
6560
|
-
this.namespace = n, l(this, ns, e), l(this, rs, t), l(this, as, i), l(this,
|
|
6561
|
+
u(this, mi);
|
|
6562
|
+
this.namespace = n, l(this, ns, e), l(this, rs, t), l(this, as, i), l(this, mi, o);
|
|
6561
6563
|
}
|
|
6562
6564
|
static start(e, t) {
|
|
6563
6565
|
return f(this, null, function* () {
|
|
@@ -6578,20 +6580,20 @@ const _s = class _s {
|
|
|
6578
6580
|
return a(this, rs).timestampWallclockOffset();
|
|
6579
6581
|
}
|
|
6580
6582
|
timestampOffsetMs() {
|
|
6581
|
-
return a(this,
|
|
6583
|
+
return a(this, mi);
|
|
6582
6584
|
}
|
|
6583
6585
|
setTimestampOffsetMs(e) {
|
|
6584
|
-
l(this,
|
|
6586
|
+
l(this, mi, e);
|
|
6585
6587
|
}
|
|
6586
6588
|
waitForWallclockTime(e) {
|
|
6587
6589
|
return a(this, rs).waitForWallclockTime(e);
|
|
6588
6590
|
}
|
|
6589
6591
|
subscribeCmafTrack(e, t) {
|
|
6590
6592
|
const i = this.catalog().current().tracks, n = e["com.vindral.variant_uid"] !== void 0 ? i.find((o) => o["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]) : void 0;
|
|
6591
|
-
return A(this, Rn, ao).call(this, () => Ih.subscribe(a(this, ns), n != null ? n : e, a(this,
|
|
6593
|
+
return A(this, Rn, ao).call(this, () => Ih.subscribe(a(this, ns), n != null ? n : e, a(this, mi), t));
|
|
6592
6594
|
}
|
|
6593
6595
|
subscribeWebVttTrack(e) {
|
|
6594
|
-
return A(this, Rn, ao).call(this, () => Bh.subscribe(a(this, ns), e, a(this,
|
|
6596
|
+
return A(this, Rn, ao).call(this, () => Bh.subscribe(a(this, ns), e, a(this, mi)));
|
|
6595
6597
|
}
|
|
6596
6598
|
subscribeTrack(e) {
|
|
6597
6599
|
return A(this, Rn, ao).call(this, () => a(this, ns).subscribe(e));
|
|
@@ -6603,7 +6605,7 @@ const _s = class _s {
|
|
|
6603
6605
|
return Promise.all([a(this, as).close(), a(this, rs).close()]);
|
|
6604
6606
|
}
|
|
6605
6607
|
};
|
|
6606
|
-
rh =
|
|
6608
|
+
rh = Si(null), ns = new WeakMap(), rs = new WeakMap(), as = new WeakMap(), mi = new WeakMap(), Rn = new WeakSet(), ao = function(e) {
|
|
6607
6609
|
return f(this, null, function* () {
|
|
6608
6610
|
const [t, i] = this.catalog().value();
|
|
6609
6611
|
try {
|
|
@@ -6614,7 +6616,7 @@ rh = vi(null), ns = new WeakMap(), rs = new WeakMap(), as = new WeakMap(), li =
|
|
|
6614
6616
|
throw n;
|
|
6615
6617
|
}
|
|
6616
6618
|
});
|
|
6617
|
-
}, ye(rh, 9, "start", mu, _s),
|
|
6619
|
+
}, ye(rh, 9, "start", mu, _s), Xt(rh, _s), Ei(rh, 3, _s);
|
|
6618
6620
|
let Oo = _s;
|
|
6619
6621
|
var os, Oa, hc, Dl;
|
|
6620
6622
|
const ld = class ld {
|
|
@@ -6698,7 +6700,7 @@ class rd {
|
|
|
6698
6700
|
return f(this, null, function* () {
|
|
6699
6701
|
var d = [];
|
|
6700
6702
|
try {
|
|
6701
|
-
const n = Ne(d, yield e.subscribeTrack(new
|
|
6703
|
+
const n = Ne(d, yield e.subscribeTrack(new zt().name("drm").build()), !0);
|
|
6702
6704
|
const o = n.objects();
|
|
6703
6705
|
const c = yield o.next();
|
|
6704
6706
|
if (c.done)
|
|
@@ -6750,7 +6752,7 @@ const md = class md {
|
|
|
6750
6752
|
}
|
|
6751
6753
|
static start(e) {
|
|
6752
6754
|
return f(this, null, function* () {
|
|
6753
|
-
const i = (yield e.subscribe(new
|
|
6755
|
+
const i = (yield e.subscribe(new zt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
|
|
6754
6756
|
if (n.done)
|
|
6755
6757
|
throw new Error("No stats object received");
|
|
6756
6758
|
const o = Wd(n.value.payload);
|
|
@@ -6851,11 +6853,11 @@ class Yc {
|
|
|
6851
6853
|
}
|
|
6852
6854
|
}
|
|
6853
6855
|
Pn = new WeakMap(), Fa = new WeakMap(), _a = new WeakMap();
|
|
6854
|
-
var fu, pu, gu, xn, Ln, cs, le, nt, rt,
|
|
6856
|
+
var fu, pu, gu, xn, Ln, cs, le, nt, rt, fi, Dn, Na, Jn, Ce, oo, sr, Ml, xh;
|
|
6855
6857
|
gu = [Pe({ context: "Player", enter: "info" })], pu = [Pe({ context: "Player", enter: "info", return: "info" })], fu = [Pe({ context: "Player", enter: "info" })];
|
|
6856
6858
|
const Ns = class Ns {
|
|
6857
6859
|
constructor(e, t, i) {
|
|
6858
|
-
|
|
6860
|
+
Ei(Jn, 5, this);
|
|
6859
6861
|
u(this, Ce);
|
|
6860
6862
|
u(this, xn);
|
|
6861
6863
|
u(this, Ln);
|
|
@@ -6863,10 +6865,10 @@ const Ns = class Ns {
|
|
|
6863
6865
|
u(this, le);
|
|
6864
6866
|
u(this, nt, new Ie(void 0));
|
|
6865
6867
|
u(this, rt, new Ie(void 0));
|
|
6866
|
-
u(this,
|
|
6868
|
+
u(this, fi, new Ie(void 0));
|
|
6867
6869
|
u(this, Dn);
|
|
6868
6870
|
u(this, Na);
|
|
6869
|
-
r(this, "subtitles", new Yc(a(this,
|
|
6871
|
+
r(this, "subtitles", new Yc(a(this, fi), "subtitles"));
|
|
6870
6872
|
r(this, "video", new Yc(a(this, rt), "video"));
|
|
6871
6873
|
r(this, "audio", new Yc(a(this, nt), "audio"));
|
|
6872
6874
|
l(this, xn, e), l(this, Ln, Rh.start(i)), l(this, cs, i), l(this, le, new Ie(t)), l(this, Dn, new IA(t)), l(this, Na, Promise.race([i.idleTimeout(), A(this, Ce, Ml).call(this), a(this, Dn).closed()])), a(this, xn).closed().then(() => this.close()).catch(D);
|
|
@@ -6931,7 +6933,7 @@ const Ns = class Ns {
|
|
|
6931
6933
|
// Close the consumers so that the iterators will stop
|
|
6932
6934
|
A(this, Ce, oo).call(this, a(this, nt)),
|
|
6933
6935
|
A(this, Ce, oo).call(this, a(this, rt)),
|
|
6934
|
-
A(this, Ce, oo).call(this, a(this,
|
|
6936
|
+
A(this, Ce, oo).call(this, a(this, fi))
|
|
6935
6937
|
]);
|
|
6936
6938
|
}
|
|
6937
6939
|
zap(e, t) {
|
|
@@ -6952,14 +6954,14 @@ const Ns = class Ns {
|
|
|
6952
6954
|
return f(this, null, function* () {
|
|
6953
6955
|
var i, n;
|
|
6954
6956
|
if (!e) {
|
|
6955
|
-
yield (i = a(this,
|
|
6957
|
+
yield (i = a(this, fi).current()) == null ? void 0 : i.unsubscribe();
|
|
6956
6958
|
return;
|
|
6957
6959
|
}
|
|
6958
6960
|
const [t] = yield Promise.all([
|
|
6959
6961
|
a(this, le).current().subscribeWebVttTrack(e),
|
|
6960
|
-
(n = a(this,
|
|
6962
|
+
(n = a(this, fi).current()) == null ? void 0 : n.unsubscribe()
|
|
6961
6963
|
]);
|
|
6962
|
-
a(this,
|
|
6964
|
+
a(this, fi).update(t);
|
|
6963
6965
|
});
|
|
6964
6966
|
}
|
|
6965
6967
|
setVideoTrack(e, t) {
|
|
@@ -6975,7 +6977,7 @@ const Ns = class Ns {
|
|
|
6975
6977
|
});
|
|
6976
6978
|
}
|
|
6977
6979
|
};
|
|
6978
|
-
Jn =
|
|
6980
|
+
Jn = Si(null), xn = new WeakMap(), Ln = new WeakMap(), cs = new WeakMap(), le = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), fi = new WeakMap(), Dn = new WeakMap(), Na = new WeakMap(), Ce = new WeakSet(), oo = function(e) {
|
|
6979
6981
|
const t = e.current(), i = t == null ? void 0 : t.largestGroupId();
|
|
6980
6982
|
return e.isClosed() || e.update(void 0), e.close(), i ? t == null ? void 0 : t.update(i, i) : t == null ? void 0 : t.unsubscribe();
|
|
6981
6983
|
}, sr = function(e, t, i, n) {
|
|
@@ -7038,14 +7040,14 @@ Jn = vi(null), xn = new WeakMap(), Ln = new WeakMap(), cs = new WeakMap(), le =
|
|
|
7038
7040
|
t.update(yield a(this, le).current().subscribeCmafTrack(h));
|
|
7039
7041
|
}
|
|
7040
7042
|
});
|
|
7041
|
-
}, ye(Jn, 1, "close", gu, Ns), ye(Jn, 1, "zap", pu, Ns), sr = ye(Jn, 17, "#replaceTrack", fu, Ce, sr),
|
|
7043
|
+
}, ye(Jn, 1, "close", gu, Ns), ye(Jn, 1, "zap", pu, Ns), sr = ye(Jn, 17, "#replaceTrack", fu, Ce, sr), Xt(Jn, Ns);
|
|
7042
7044
|
let Ph = Ns;
|
|
7043
7045
|
function Jc(s, e, t) {
|
|
7044
7046
|
const i = new URL("/voq/subscribe", s);
|
|
7045
7047
|
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;
|
|
7046
7048
|
}
|
|
7047
7049
|
const CA = 1e4;
|
|
7048
|
-
var me, Se, at, hs, $,
|
|
7050
|
+
var me, Se, at, hs, $, pi, Va, Ga, lc, On, ke, Fl, Mn, ja, Fn, _l, Nl, Vl, Gl, Dh;
|
|
7049
7051
|
const fd = class fd {
|
|
7050
7052
|
constructor(e, t, i, n, o, c) {
|
|
7051
7053
|
u(this, ke);
|
|
@@ -7054,7 +7056,7 @@ const fd = class fd {
|
|
|
7054
7056
|
u(this, at);
|
|
7055
7057
|
u(this, hs, "disconnected");
|
|
7056
7058
|
u(this, $);
|
|
7057
|
-
u(this,
|
|
7059
|
+
u(this, pi, /* @__PURE__ */ new Map());
|
|
7058
7060
|
u(this, Va);
|
|
7059
7061
|
u(this, Ga, new pe(10));
|
|
7060
7062
|
u(this, lc, Number.MAX_SAFE_INTEGER);
|
|
@@ -7064,7 +7066,7 @@ const fd = class fd {
|
|
|
7064
7066
|
a(this, $).setSubtitleTrack(void 0).catch(D);
|
|
7065
7067
|
return;
|
|
7066
7068
|
}
|
|
7067
|
-
const t = a(this,
|
|
7069
|
+
const t = a(this, pi).get(Ti(a(this, $).namespace())), i = t == null ? void 0 : t.getTextTrack(e);
|
|
7068
7070
|
i && a(this, $).setSubtitleTrack(i).catch(D);
|
|
7069
7071
|
});
|
|
7070
7072
|
u(this, ja, (e) => {
|
|
@@ -7099,7 +7101,7 @@ const fd = class fd {
|
|
|
7099
7101
|
r(this, "disconnect", (e = "Disconnect Requested") => {
|
|
7100
7102
|
a(this, Se).info("Disconnecting", e), a(this, at).close(), a(this, $).close().catch(D), l(this, On, /* @__PURE__ */ new Map()), l(this, hs, "disconnected");
|
|
7101
7103
|
});
|
|
7102
|
-
l(this, me, e), l(this, Se, t), l(this, at, i), l(this, $, n), l(this,
|
|
7104
|
+
l(this, me, e), l(this, Se, t), l(this, at, i), l(this, $, n), l(this, pi, o), l(this, Va, c), a(this, me).on("send signal", a(this, ja)), a(this, me).on("disconnect", this.disconnect), a(this, me).on("text track", a(this, Mn)), A(this, ke, Fl).call(this).catch(D), A(this, ke, Vl).call(this).catch(D);
|
|
7103
7105
|
}
|
|
7104
7106
|
get estimatedBandwidth() {
|
|
7105
7107
|
return a(this, lc);
|
|
@@ -7114,7 +7116,7 @@ const fd = class fd {
|
|
|
7114
7116
|
getStatistics() {
|
|
7115
7117
|
const t = a(this, $).connectionInfo().estimatedBandwidth;
|
|
7116
7118
|
return {
|
|
7117
|
-
rtt:
|
|
7119
|
+
rtt: Yt(a(this, Ga).items()),
|
|
7118
7120
|
estimatedBandwidth: t,
|
|
7119
7121
|
connectCount: 0,
|
|
7120
7122
|
connectionAttemptCount: 0,
|
|
@@ -7127,7 +7129,7 @@ const fd = class fd {
|
|
|
7127
7129
|
var M, T, U, k;
|
|
7128
7130
|
const o = new Map(
|
|
7129
7131
|
n.connectInfo.channels.map((_) => [
|
|
7130
|
-
|
|
7132
|
+
Ti(_.catalog.namespace),
|
|
7131
7133
|
new Kc(new Ie(_.catalog))
|
|
7132
7134
|
])
|
|
7133
7135
|
), c = yield n.onConnectInfo(n.connectInfo), h = n.options.get("authenticationToken");
|
|
@@ -7143,7 +7145,7 @@ const fd = class fd {
|
|
|
7143
7145
|
}
|
|
7144
7146
|
const p = (M = n.connectInfo.channels.find((_) => _.channelId === c.channelId)) == null ? void 0 : M.catalog;
|
|
7145
7147
|
t.debug("Resolved edge url", { edgeUrl: d, edgeWsUrl: m }), Xe(p, "no catalog found");
|
|
7146
|
-
const g = (T = o.get(
|
|
7148
|
+
const g = (T = o.get(Ti(p.namespace))) == null ? void 0 : T.getVideoTrack(c.video), w = (U = o.get(Ti(p.namespace))) == null ? void 0 : U.getAudioTrack(c.audio), b = yield uA({
|
|
7147
7149
|
url: d,
|
|
7148
7150
|
wsUrl: m,
|
|
7149
7151
|
authToken: n.options.get("authenticationToken"),
|
|
@@ -7160,7 +7162,7 @@ const fd = class fd {
|
|
|
7160
7162
|
id(CA, new Error("Timeout waiting for player to start")),
|
|
7161
7163
|
Rm(b.closed(), "Session closed before player started")
|
|
7162
7164
|
]), x = new Kc(S.catalog());
|
|
7163
|
-
o.set(
|
|
7165
|
+
o.set(Ti(p.namespace), x), e.emit("received signal", {
|
|
7164
7166
|
type: "client ip",
|
|
7165
7167
|
ip: S.connectionInfo().ip
|
|
7166
7168
|
}), S.drm().then((_) => {
|
|
@@ -7185,7 +7187,7 @@ const fd = class fd {
|
|
|
7185
7187
|
return Promise.race([a(this, at).closed(), a(this, $).closed()]);
|
|
7186
7188
|
}
|
|
7187
7189
|
};
|
|
7188
|
-
me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(), $ = new WeakMap(),
|
|
7190
|
+
me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(), $ = new WeakMap(), pi = new WeakMap(), Va = new WeakMap(), Ga = new WeakMap(), lc = new WeakMap(), On = new WeakMap(), ke = new WeakSet(), Fl = function() {
|
|
7189
7191
|
return f(this, null, function* () {
|
|
7190
7192
|
try {
|
|
7191
7193
|
for (var e = Y(a(this, $).stats()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
|
|
@@ -7219,8 +7221,8 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7219
7221
|
var c, h, d;
|
|
7220
7222
|
a(this, Se).info("handle subscription", e);
|
|
7221
7223
|
const t = a(this, $);
|
|
7222
|
-
let i = a(this,
|
|
7223
|
-
if (i || (i = new Kc(new Ie(yield A(this, ke, _l).call(this, e.channelId))), a(this,
|
|
7224
|
+
let i = a(this, pi).get(e.channelId);
|
|
7225
|
+
if (i || (i = new Kc(new Ie(yield A(this, ke, _l).call(this, e.channelId))), a(this, pi).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
|
|
7224
7226
|
a(this, Se).info("changing channel", e.channelId);
|
|
7225
7227
|
const m = i.getVideoTrack(e.video), p = i.getAudioTrack(e.audio);
|
|
7226
7228
|
yield t.zap(
|
|
@@ -7235,7 +7237,7 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7235
7237
|
g && a(this, me).emit("received drm data", g.value);
|
|
7236
7238
|
}).catch((g) => {
|
|
7237
7239
|
a(this, Se).error("Error getting DRM data", g);
|
|
7238
|
-
}), a(this, Se).info("switched channel", e.channelId), (c = a(this,
|
|
7240
|
+
}), a(this, Se).info("switched channel", e.channelId), (c = a(this, pi).get(Ti(t.namespace()))) == null || c.updateCatalog(t.catalog()), a(this, me).emit("received signal", {
|
|
7239
7241
|
type: "subscription changed",
|
|
7240
7242
|
subscription: e
|
|
7241
7243
|
});
|
|
@@ -7288,7 +7290,7 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7288
7290
|
try {
|
|
7289
7291
|
for (var w = Y(t), b, S, x; b = !(S = yield w.next()).done; b = !1) {
|
|
7290
7292
|
const R = S.value;
|
|
7291
|
-
const M =
|
|
7293
|
+
const M = Ti(R.track.namespace), T = R.track.trackObject.language, U = om((h = R.track.trackObject.codec) != null ? h : ""), k = R.track.trackObject.codec, _ = U ? Pi({ codec: U, codecString: k }) : void 0, ce = !!R.track.trackObject["com.vindral.drm"];
|
|
7292
7294
|
try {
|
|
7293
7295
|
for (var d = Y(R), m, p, g; m = !(p = yield d.next()).done; m = !1) {
|
|
7294
7296
|
const [Me, Z] = p.value;
|
|
@@ -7359,25 +7361,25 @@ function kA(s) {
|
|
|
7359
7361
|
0
|
|
7360
7362
|
);
|
|
7361
7363
|
}
|
|
7362
|
-
var
|
|
7364
|
+
var jt, ds, mc, jl;
|
|
7363
7365
|
class Kc {
|
|
7364
7366
|
constructor(e) {
|
|
7365
7367
|
u(this, mc);
|
|
7366
|
-
u(this,
|
|
7368
|
+
u(this, jt);
|
|
7367
7369
|
u(this, ds);
|
|
7368
|
-
l(this,
|
|
7370
|
+
l(this, jt, e), l(this, ds, A(this, mc, jl).call(this));
|
|
7369
7371
|
}
|
|
7370
7372
|
catalog() {
|
|
7371
|
-
return a(this,
|
|
7373
|
+
return a(this, jt).current();
|
|
7372
7374
|
}
|
|
7373
7375
|
namespace() {
|
|
7374
|
-
return a(this,
|
|
7376
|
+
return a(this, jt).current().namespace;
|
|
7375
7377
|
}
|
|
7376
7378
|
updateCatalog(e) {
|
|
7377
|
-
l(this,
|
|
7379
|
+
l(this, jt, e);
|
|
7378
7380
|
}
|
|
7379
7381
|
getTextTrack(e) {
|
|
7380
|
-
return a(this,
|
|
7382
|
+
return a(this, jt).current().tracks.find((t) => t.label === e);
|
|
7381
7383
|
}
|
|
7382
7384
|
getAudioTrack(e) {
|
|
7383
7385
|
if (!e.codec)
|
|
@@ -7395,15 +7397,15 @@ class Kc {
|
|
|
7395
7397
|
return a(this, ds);
|
|
7396
7398
|
}
|
|
7397
7399
|
}
|
|
7398
|
-
|
|
7399
|
-
const [e, t] = a(this,
|
|
7400
|
+
jt = new WeakMap(), ds = new WeakMap(), mc = new WeakSet(), jl = function() {
|
|
7401
|
+
const [e, t] = a(this, jt).value();
|
|
7400
7402
|
return cm(e);
|
|
7401
7403
|
};
|
|
7402
7404
|
const BA = (s, e) => {
|
|
7403
7405
|
const t = new URL("/subscribe", s);
|
|
7404
7406
|
return t.searchParams.append("channelId", e.channelId), t.searchParams.append("sessionId", e.sessionId), t.searchParams.append("clientId", e.clientId), e.audio && e.audio.codec && (t.searchParams.append("audio.bitRate", Math.round(e.audio.bitRate).toString()), t.searchParams.append("audio.codec", e.audio.codec), e.audio.language && t.searchParams.append("audio.language", e.audio.language)), e.video && e.video.codec && (t.searchParams.append("video.width", e.video.width.toString()), t.searchParams.append("video.height", e.video.height.toString()), t.searchParams.append("video.bitRate", Math.round(e.video.bitRate).toString()), t.searchParams.append("video.codec", e.video.codec)), e.expectAdditionalConnection && t.searchParams.append("expectAdditionalConnection", e.expectAdditionalConnection.toString()), e.burstMs && t.searchParams.append("burstMs", e.burstMs.toString()), e.channelGroupId && t.searchParams.append("channelGroupId", e.channelGroupId), e.authToken && (t.searchParams.append("auth.token", e.authToken), t.searchParams.append("auth.type", "jwt")), t.toString();
|
|
7405
7407
|
};
|
|
7406
|
-
class RA extends
|
|
7408
|
+
class RA extends yi {
|
|
7407
7409
|
constructor(t, i) {
|
|
7408
7410
|
super();
|
|
7409
7411
|
r(this, "options");
|
|
@@ -7584,7 +7586,7 @@ const UA = 65536 * 8, PA = 0.9, eh = (s) => UA * PA * 1e3 / s, dt = class dt {
|
|
|
7584
7586
|
});
|
|
7585
7587
|
r(this, "getStatistics", () => {
|
|
7586
7588
|
var t;
|
|
7587
|
-
const e =
|
|
7589
|
+
const e = Yt(this.rtts.items());
|
|
7588
7590
|
return {
|
|
7589
7591
|
rtt: e,
|
|
7590
7592
|
estimatedBandwidth: eh(e.average),
|
|
@@ -7719,11 +7721,11 @@ r(dt, "PING_INTERVAL", 5e3), r(dt, "MAX_MISSED_PINGS", 4), r(dt, "TLS_ROUNDTRIPS
|
|
|
7719
7721
|
c.transport.once("error", (h) => o(h)), c.transport.once("open", () => n(c));
|
|
7720
7722
|
}));
|
|
7721
7723
|
let Oh = dt;
|
|
7722
|
-
var _n,
|
|
7724
|
+
var _n, gi, Nn;
|
|
7723
7725
|
class xA {
|
|
7724
7726
|
constructor(e) {
|
|
7725
7727
|
u(this, _n);
|
|
7726
|
-
u(this,
|
|
7728
|
+
u(this, gi, []);
|
|
7727
7729
|
u(this, Nn);
|
|
7728
7730
|
l(this, _n, e);
|
|
7729
7731
|
}
|
|
@@ -7740,8 +7742,8 @@ class xA {
|
|
|
7740
7742
|
select(e) {
|
|
7741
7743
|
if (a(this, _n).edgeUrl)
|
|
7742
7744
|
return a(this, _n).edgeUrl;
|
|
7743
|
-
a(this,
|
|
7744
|
-
const t = a(this,
|
|
7745
|
+
a(this, gi).length === 0 && l(this, gi, a(this, gi).concat(e));
|
|
7746
|
+
const t = a(this, gi).shift();
|
|
7745
7747
|
if (l(this, Nn, t), t)
|
|
7746
7748
|
return t;
|
|
7747
7749
|
}
|
|
@@ -7756,11 +7758,11 @@ class xA {
|
|
|
7756
7758
|
* Resets the cached list of edges
|
|
7757
7759
|
*/
|
|
7758
7760
|
reset() {
|
|
7759
|
-
l(this, Nn, void 0), l(this,
|
|
7761
|
+
l(this, Nn, void 0), l(this, gi, []);
|
|
7760
7762
|
}
|
|
7761
7763
|
}
|
|
7762
|
-
_n = new WeakMap(),
|
|
7763
|
-
var vt, Vn,
|
|
7764
|
+
_n = new WeakMap(), gi = new WeakMap(), Nn = new WeakMap();
|
|
7765
|
+
var vt, Vn, Wt, Gn, jn, Wn, fc, pc, gc, Wl;
|
|
7764
7766
|
const Vs = class Vs {
|
|
7765
7767
|
constructor(e, t, i) {
|
|
7766
7768
|
u(this, gc);
|
|
@@ -7771,7 +7773,7 @@ const Vs = class Vs {
|
|
|
7771
7773
|
r(this, "connectionImpl");
|
|
7772
7774
|
u(this, vt, !0);
|
|
7773
7775
|
u(this, Vn);
|
|
7774
|
-
u(this,
|
|
7776
|
+
u(this, Wt, 0);
|
|
7775
7777
|
u(this, Gn, 0);
|
|
7776
7778
|
u(this, jn);
|
|
7777
7779
|
u(this, Wn);
|
|
@@ -7790,12 +7792,12 @@ const Vs = class Vs {
|
|
|
7790
7792
|
r(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
|
|
7791
7793
|
r(this, "getStatistics", () => this.connectionImpl ? F(v({}, this.connectionImpl.getStatistics()), {
|
|
7792
7794
|
connectCount: a(this, Gn),
|
|
7793
|
-
connectionAttemptCount: a(this,
|
|
7795
|
+
connectionAttemptCount: a(this, Wt)
|
|
7794
7796
|
}) : {
|
|
7795
7797
|
rtt: { min: 0, max: 0, average: 0, last: 0 },
|
|
7796
7798
|
estimatedBandwidth: 0,
|
|
7797
7799
|
connectCount: a(this, Gn),
|
|
7798
|
-
connectionAttemptCount: a(this,
|
|
7800
|
+
connectionAttemptCount: a(this, Wt),
|
|
7799
7801
|
connectionProtocol: void 0
|
|
7800
7802
|
});
|
|
7801
7803
|
r(this, "connect", () => {
|
|
@@ -7857,12 +7859,12 @@ const Vs = class Vs {
|
|
|
7857
7859
|
return a(this, Wn);
|
|
7858
7860
|
}
|
|
7859
7861
|
};
|
|
7860
|
-
vt = new WeakMap(), Vn = new WeakMap(),
|
|
7862
|
+
vt = new WeakMap(), Vn = new WeakMap(), Wt = new WeakMap(), Gn = new WeakMap(), jn = new WeakMap(), Wn = new WeakMap(), fc = new WeakMap(), pc = new WeakMap(), gc = new WeakSet(), Wl = function() {
|
|
7861
7863
|
return f(this, null, function* () {
|
|
7862
7864
|
var t;
|
|
7863
7865
|
const e = new xA({ edgeUrl: this.config.options.get("edgeUrl") });
|
|
7864
|
-
for (l(this,
|
|
7865
|
-
Ze(this,
|
|
7866
|
+
for (l(this, Wt, 0); ; ) {
|
|
7867
|
+
Ze(this, Wt)._++;
|
|
7866
7868
|
try {
|
|
7867
7869
|
const [n, o] = yield Promise.all([a(this, fc).call(this), a(this, pc).call(this)]), c = o / 2;
|
|
7868
7870
|
if (!a(this, vt))
|
|
@@ -7878,7 +7880,7 @@ vt = new WeakMap(), Vn = new WeakMap(), Gt = new WeakMap(), Gn = new WeakMap(),
|
|
|
7878
7880
|
connectInfo: n,
|
|
7879
7881
|
estimatedRtt: c,
|
|
7880
7882
|
edgeUrl: h
|
|
7881
|
-
}))), e.reset(), Ze(this, Gn)._++, l(this,
|
|
7883
|
+
}))), e.reset(), Ze(this, Gn)._++, l(this, Wt, 0), l(this, Wn, Date.now()), a(this, jn) || l(this, jn, a(this, Wn)), yield this.connectionImpl.closed();
|
|
7882
7884
|
} catch (n) {
|
|
7883
7885
|
this.logger.info("Failed to connect", n);
|
|
7884
7886
|
const o = e.shiftedEdge();
|
|
@@ -7890,7 +7892,7 @@ vt = new WeakMap(), Vn = new WeakMap(), Gt = new WeakMap(), Gn = new WeakMap(),
|
|
|
7890
7892
|
if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !a(this, vt))
|
|
7891
7893
|
break;
|
|
7892
7894
|
if (!(yield this.config.reconnectHandler({
|
|
7893
|
-
reconnectRetries: a(this,
|
|
7895
|
+
reconnectRetries: a(this, Wt)
|
|
7894
7896
|
}))) {
|
|
7895
7897
|
this.emitter.emit("error", ku());
|
|
7896
7898
|
break;
|
|
@@ -7904,15 +7906,15 @@ vt = new WeakMap(), Vn = new WeakMap(), Gt = new WeakMap(), Gn = new WeakMap(),
|
|
|
7904
7906
|
let Mh = Vs;
|
|
7905
7907
|
const th = () => ({
|
|
7906
7908
|
video: F(v({}, co()), {
|
|
7907
|
-
bitRate:
|
|
7909
|
+
bitRate: bi()
|
|
7908
7910
|
}),
|
|
7909
7911
|
audio: {
|
|
7910
|
-
bitRate:
|
|
7912
|
+
bitRate: bi()
|
|
7911
7913
|
}
|
|
7912
7914
|
}), LA = () => ({
|
|
7913
7915
|
width: window.innerWidth,
|
|
7914
7916
|
height: window.innerHeight,
|
|
7915
|
-
bitRate:
|
|
7917
|
+
bitRate: bi()
|
|
7916
7918
|
}), Gs = class Gs {
|
|
7917
7919
|
constructor(e, t, i, n) {
|
|
7918
7920
|
r(this, "emitter");
|
|
@@ -8032,12 +8034,12 @@ class ad {
|
|
|
8032
8034
|
});
|
|
8033
8035
|
r(this, "videoDecodeRate", () => {
|
|
8034
8036
|
var o, c, h;
|
|
8035
|
-
const e = this.trackContexts.get("video"), t = (o = e == null ? void 0 : e.sampleDuration) != null ? o : 40, i =
|
|
8037
|
+
const e = this.trackContexts.get("video"), t = (o = e == null ? void 0 : e.sampleDuration) != null ? o : 40, i = Yt((c = e == null ? void 0 : e.decodeTime.items()) != null ? c : []), n = Yt((h = e == null ? void 0 : e.transportTime.items()) != null ? h : []);
|
|
8036
8038
|
return t / (i.average + n.average);
|
|
8037
8039
|
});
|
|
8038
8040
|
r(this, "getStatistics", () => {
|
|
8039
8041
|
var o, c, h, d;
|
|
8040
|
-
const e = this.trackContexts.get("video"), t =
|
|
8042
|
+
const e = this.trackContexts.get("video"), t = Yt((o = e == null ? void 0 : e.decodeTime.items()) != null ? o : []), i = Yt((c = e == null ? void 0 : e.transportTime.items()) != null ? c : []), n = Yt((d = (h = this.trackContexts.get("audio")) == null ? void 0 : h.decodeTime.items()) != null ? d : []);
|
|
8041
8043
|
return {
|
|
8042
8044
|
videoDecodeRate: this.videoDecodeRate(),
|
|
8043
8045
|
videoDecodeTime: t,
|
|
@@ -8115,7 +8117,7 @@ class ad {
|
|
|
8115
8117
|
for (const h of i)
|
|
8116
8118
|
switch (h.type) {
|
|
8117
8119
|
case "audio": {
|
|
8118
|
-
const { OpusDecoderContext: d } = yield import("./
|
|
8120
|
+
const { OpusDecoderContext: d } = yield import("./Ci6s9XWs.js");
|
|
8119
8121
|
c.set(h.type, {
|
|
8120
8122
|
buffer: [],
|
|
8121
8123
|
decoderContext: yield d.create(48e3, 2),
|
|
@@ -8126,7 +8128,7 @@ class ad {
|
|
|
8126
8128
|
break;
|
|
8127
8129
|
}
|
|
8128
8130
|
case "video": {
|
|
8129
|
-
const { H264DecoderWorkerContext: d } = yield import("./
|
|
8131
|
+
const { H264DecoderWorkerContext: d } = yield import("./BkM9Zev_.js");
|
|
8130
8132
|
c.set(h.type, {
|
|
8131
8133
|
buffer: [],
|
|
8132
8134
|
decoderContext: yield d.create(o),
|
|
@@ -8193,16 +8195,16 @@ const Ac = class Ac {
|
|
|
8193
8195
|
};
|
|
8194
8196
|
r(Ac, "create", (e) => new Ac(e));
|
|
8195
8197
|
let _h = Ac;
|
|
8196
|
-
const FA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s,
|
|
8198
|
+
const FA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, $t = class $t {
|
|
8197
8199
|
constructor(e, t, i) {
|
|
8198
8200
|
r(this, "logger");
|
|
8199
8201
|
r(this, "emitter");
|
|
8200
8202
|
r(this, "waitingEvents", []);
|
|
8201
|
-
r(this, "isTriggered", FA(
|
|
8203
|
+
r(this, "isTriggered", FA($t.EVENT_TIMEOUT));
|
|
8202
8204
|
r(this, "timeSource");
|
|
8203
8205
|
r(this, "timers", new Ae());
|
|
8204
8206
|
r(this, "load", () => {
|
|
8205
|
-
this.timers.setInterval(this.onBufferedStateChanged,
|
|
8207
|
+
this.timers.setInterval(this.onBufferedStateChanged, $t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
|
|
8206
8208
|
});
|
|
8207
8209
|
r(this, "unload", () => {
|
|
8208
8210
|
this.timers.unload(), this.emitter.off("add event", this.addEvent);
|
|
@@ -8234,8 +8236,8 @@ const FA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, Zt
|
|
|
8234
8236
|
this.logger = t, this.emitter = e, this.timeSource = i;
|
|
8235
8237
|
}
|
|
8236
8238
|
};
|
|
8237
|
-
r(
|
|
8238
|
-
let Nh =
|
|
8239
|
+
r($t, "EVENT_TIMEOUT", 5e3), r($t, "EVENT_CHECK_INTERVAL", 20), r($t, "create", (e, t, i) => new $t(e, t, i));
|
|
8240
|
+
let Nh = $t;
|
|
8239
8241
|
const qe = class qe {
|
|
8240
8242
|
constructor(e) {
|
|
8241
8243
|
r(this, "emitter");
|
|
@@ -8293,7 +8295,7 @@ const qe = class qe {
|
|
|
8293
8295
|
};
|
|
8294
8296
|
r(qe, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), r(qe, "NO_DATA_TIMEOUT", 5 * 1e3), r(qe, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), r(qe, "create", (e) => new qe(e));
|
|
8295
8297
|
let Vh = qe;
|
|
8296
|
-
const _A = () => window.AudioContext || window.webkitAudioContext, wc = class wc extends
|
|
8298
|
+
const _A = () => window.AudioContext || window.webkitAudioContext, wc = class wc extends yi {
|
|
8297
8299
|
constructor() {
|
|
8298
8300
|
super();
|
|
8299
8301
|
// TODO: Checkout what happens when limit is reached
|
|
@@ -8343,7 +8345,7 @@ const _A = () => window.AudioContext || window.webkitAudioContext, wc = class wc
|
|
|
8343
8345
|
};
|
|
8344
8346
|
r(wc, "CHECK_INTERVAL", 1e3);
|
|
8345
8347
|
let Gh = wc;
|
|
8346
|
-
const bc = class bc extends
|
|
8348
|
+
const bc = class bc extends yi {
|
|
8347
8349
|
constructor(t, i, { muted: n, reInitWhenStuck: o }) {
|
|
8348
8350
|
super();
|
|
8349
8351
|
r(this, "logger");
|
|
@@ -8513,11 +8515,11 @@ const bc = class bc extends bi {
|
|
|
8513
8515
|
};
|
|
8514
8516
|
r(bc, "create", (t, i, n) => new bc(t, i, n));
|
|
8515
8517
|
let Mo = bc;
|
|
8516
|
-
var
|
|
8518
|
+
var Ai;
|
|
8517
8519
|
class zl {
|
|
8518
8520
|
constructor() {
|
|
8519
|
-
u(this,
|
|
8520
|
-
l(this,
|
|
8521
|
+
u(this, Ai, []);
|
|
8522
|
+
l(this, Ai, []);
|
|
8521
8523
|
}
|
|
8522
8524
|
addTextTrack(e, t, i) {
|
|
8523
8525
|
const n = [], o = {
|
|
@@ -8534,24 +8536,24 @@ class zl {
|
|
|
8534
8536
|
h !== -1 && n.splice(h, 1);
|
|
8535
8537
|
}
|
|
8536
8538
|
};
|
|
8537
|
-
return a(this,
|
|
8539
|
+
return a(this, Ai).push(o), o;
|
|
8538
8540
|
}
|
|
8539
8541
|
set language(e) {
|
|
8540
|
-
a(this,
|
|
8542
|
+
a(this, Ai).forEach((t) => {
|
|
8541
8543
|
t.language === e ? t.mode = "showing" : t.mode = "hidden";
|
|
8542
8544
|
});
|
|
8543
8545
|
}
|
|
8544
8546
|
get language() {
|
|
8545
8547
|
var e;
|
|
8546
|
-
return (e = a(this,
|
|
8548
|
+
return (e = a(this, Ai).find((t) => t.mode === "showing")) == null ? void 0 : e.language;
|
|
8547
8549
|
}
|
|
8548
8550
|
getActiveCues(e) {
|
|
8549
|
-
const t = a(this,
|
|
8551
|
+
const t = a(this, Ai).find((i) => i.mode === "showing");
|
|
8550
8552
|
return t ? t.cues.filter(({ startTime: i, endTime: n }) => e >= i && e <= n) : [];
|
|
8551
8553
|
}
|
|
8552
8554
|
}
|
|
8553
|
-
|
|
8554
|
-
const
|
|
8555
|
+
Ai = new WeakMap();
|
|
8556
|
+
const Ii = (s, e) => {
|
|
8555
8557
|
let t;
|
|
8556
8558
|
for (t = e; s > 1; s--) t += e;
|
|
8557
8559
|
return t;
|
|
@@ -8564,7 +8566,7 @@ class NA {
|
|
|
8564
8566
|
e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
8565
8567
|
const t = e.children.item(0);
|
|
8566
8568
|
if (t instanceof HTMLAudioElement)
|
|
8567
|
-
this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
8569
|
+
this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Ii(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Ii(16, "gICA") + Ii(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Ii(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Ii(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Ii(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Ii(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
8568
8570
|
else
|
|
8569
8571
|
throw new Error("Failed to create audio tag");
|
|
8570
8572
|
}
|
|
@@ -8676,7 +8678,7 @@ void main() {
|
|
|
8676
8678
|
});
|
|
8677
8679
|
}
|
|
8678
8680
|
return i;
|
|
8679
|
-
},
|
|
8681
|
+
}, Ui = (s) => {
|
|
8680
8682
|
const e = s.createTexture();
|
|
8681
8683
|
if (!e)
|
|
8682
8684
|
throw new P("Failed to create texture", {
|
|
@@ -8708,7 +8710,7 @@ void main() {
|
|
|
8708
8710
|
}
|
|
8709
8711
|
return i;
|
|
8710
8712
|
};
|
|
8711
|
-
var yc, V, za, Ha, Xa,
|
|
8713
|
+
var yc, V, za, Ha, Xa, wi, Hn, Ql, Zl, vc;
|
|
8712
8714
|
class WA {
|
|
8713
8715
|
constructor(e) {
|
|
8714
8716
|
u(this, Hn);
|
|
@@ -8717,7 +8719,7 @@ class WA {
|
|
|
8717
8719
|
u(this, za);
|
|
8718
8720
|
u(this, Ha);
|
|
8719
8721
|
u(this, Xa);
|
|
8720
|
-
u(this,
|
|
8722
|
+
u(this, wi);
|
|
8721
8723
|
r(this, "subtitleRenderer", new VA());
|
|
8722
8724
|
// prettier-ignore
|
|
8723
8725
|
u(this, vc, (e, t, i, n) => [
|
|
@@ -8738,14 +8740,14 @@ class WA {
|
|
|
8738
8740
|
0,
|
|
8739
8741
|
1
|
|
8740
8742
|
]);
|
|
8741
|
-
l(this, V, e), l(this, za,
|
|
8743
|
+
l(this, V, e), l(this, za, Ui(e)), l(this, Ha, Ps(e, e.FRAGMENT_SHADER, GA)), l(this, Xa, Ps(e, e.VERTEX_SHADER, jA)), l(this, wi, jh(e, a(this, Xa), a(this, Ha))), this.subtitleRenderer.config.fontSize = "64px";
|
|
8742
8744
|
}
|
|
8743
8745
|
setActiveCues(e, t) {
|
|
8744
8746
|
this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
|
|
8745
8747
|
}
|
|
8746
8748
|
render(e) {
|
|
8747
8749
|
const t = this.subtitleRenderer.canvas, i = (e.padding + a(this, yc)) * window.devicePixelRatio;
|
|
8748
|
-
t.width !== 0 && (a(this, V).useProgram(a(this,
|
|
8750
|
+
t.width !== 0 && (a(this, V).useProgram(a(this, wi)), A(this, Hn, Ql).call(this), A(this, Hn, Zl).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, V).uniform1i(a(this, V).getUniformLocation(a(this, wi), "texture"), 4), a(this, V).activeTexture(a(this, V).TEXTURE4), a(this, V).bindTexture(a(this, V).TEXTURE_2D, a(this, za)), a(this, V).enable(a(this, V).BLEND), a(this, V).blendFunc(a(this, V).SRC_ALPHA, a(this, V).ONE_MINUS_SRC_ALPHA), a(this, V).texImage2D(
|
|
8749
8751
|
a(this, V).TEXTURE_2D,
|
|
8750
8752
|
0,
|
|
8751
8753
|
a(this, V).RGBA,
|
|
@@ -8755,11 +8757,11 @@ class WA {
|
|
|
8755
8757
|
), a(this, V).texParameteri(a(this, V).TEXTURE_2D, a(this, V).TEXTURE_MAG_FILTER, a(this, V).LINEAR), a(this, V).drawArrays(a(this, V).TRIANGLE_STRIP, 0, 4));
|
|
8756
8758
|
}
|
|
8757
8759
|
}
|
|
8758
|
-
yc = new WeakMap(), V = new WeakMap(), za = new WeakMap(), Ha = new WeakMap(), Xa = new WeakMap(),
|
|
8759
|
-
const e = a(this, V).getAttribLocation(a(this,
|
|
8760
|
+
yc = new WeakMap(), V = new WeakMap(), za = new WeakMap(), Ha = new WeakMap(), Xa = new WeakMap(), wi = new WeakMap(), Hn = new WeakSet(), Ql = function() {
|
|
8761
|
+
const e = a(this, V).getAttribLocation(a(this, wi), "position");
|
|
8760
8762
|
a(this, V).enableVertexAttribArray(e), a(this, V).vertexAttribPointer(e, 2, a(this, V).FLOAT, !1, 0, 0);
|
|
8761
8763
|
}, Zl = function(e, t, i, n) {
|
|
8762
|
-
const o = a(this, V).getUniformLocation(a(this,
|
|
8764
|
+
const o = a(this, V).getUniformLocation(a(this, wi), "model");
|
|
8763
8765
|
a(this, V).uniformMatrix4fv(o, !1, a(this, vc).call(this, e, t, i, n));
|
|
8764
8766
|
}, vc = new WeakMap();
|
|
8765
8767
|
const Xd = `
|
|
@@ -8799,7 +8801,7 @@ void main() {
|
|
|
8799
8801
|
stencil: !1,
|
|
8800
8802
|
antialias: !1,
|
|
8801
8803
|
premultipliedAlpha: !1
|
|
8802
|
-
}, Ir = class Ir extends
|
|
8804
|
+
}, Ir = class Ir extends yi {
|
|
8803
8805
|
constructor() {
|
|
8804
8806
|
super();
|
|
8805
8807
|
r(this, "canvas", document.createElement("canvas"));
|
|
@@ -8809,9 +8811,9 @@ void main() {
|
|
|
8809
8811
|
r(this, "buffer", Hd(this.context, Ir.SQUARE_VERTICES));
|
|
8810
8812
|
r(this, "program", jh(this.context, this.vertexShader, this.pixelShader));
|
|
8811
8813
|
r(this, "textures", {
|
|
8812
|
-
y:
|
|
8813
|
-
u:
|
|
8814
|
-
v:
|
|
8814
|
+
y: Ui(this.context),
|
|
8815
|
+
u: Ui(this.context),
|
|
8816
|
+
v: Ui(this.context)
|
|
8815
8817
|
});
|
|
8816
8818
|
// Lazy loaded when needed
|
|
8817
8819
|
r(this, "textRenderer");
|
|
@@ -8823,9 +8825,9 @@ void main() {
|
|
|
8823
8825
|
});
|
|
8824
8826
|
r(this, "onContextRestored", () => {
|
|
8825
8827
|
this.emit("context restored"), this.context = zd(this.canvas, qd), this.pixelShader = Ps(this.context, this.context.FRAGMENT_SHADER, Xd), this.vertexShader = Ps(this.context, this.context.VERTEX_SHADER, Qd), this.buffer = Hd(this.context, Ir.SQUARE_VERTICES), this.program = jh(this.context, this.vertexShader, this.pixelShader), this.textures = {
|
|
8826
|
-
y:
|
|
8827
|
-
u:
|
|
8828
|
-
v:
|
|
8828
|
+
y: Ui(this.context),
|
|
8829
|
+
u: Ui(this.context),
|
|
8830
|
+
v: Ui(this.context)
|
|
8829
8831
|
}, this.load();
|
|
8830
8832
|
});
|
|
8831
8833
|
r(this, "load", () => {
|
|
@@ -9309,7 +9311,7 @@ class QA {
|
|
|
9309
9311
|
this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
|
|
9310
9312
|
}
|
|
9311
9313
|
}
|
|
9312
|
-
class $l extends
|
|
9314
|
+
class $l extends yi {
|
|
9313
9315
|
constructor() {
|
|
9314
9316
|
super();
|
|
9315
9317
|
r(this, "MediaSource", Cr());
|
|
@@ -9873,9 +9875,9 @@ const qh = () => ({
|
|
|
9873
9875
|
let n = !1;
|
|
9874
9876
|
if (e.from) {
|
|
9875
9877
|
const U = (M = this.metrics.levels[t]) != null ? M : qh();
|
|
9876
|
-
t < i ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()),
|
|
9878
|
+
t < i ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), Ci(U.activeRanges);
|
|
9877
9879
|
const k = U.bufferingRanges[U.bufferingRanges.length - 1];
|
|
9878
|
-
n = !!k && !k.end,
|
|
9880
|
+
n = !!k && !k.end, Ci(U.bufferingRanges), this.metrics.levels[t] = U;
|
|
9879
9881
|
}
|
|
9880
9882
|
if (e.to) {
|
|
9881
9883
|
const U = (T = this.metrics.levels[i]) != null ? T : qh();
|
|
@@ -9911,9 +9913,9 @@ const qh = () => ({
|
|
|
9911
9913
|
r(this, "stopBuffering", () => {
|
|
9912
9914
|
if (this.currentLevel) {
|
|
9913
9915
|
const e = this.metrics.levels[this.currentLevel];
|
|
9914
|
-
e &&
|
|
9916
|
+
e && Ci(e.bufferingRanges);
|
|
9915
9917
|
}
|
|
9916
|
-
|
|
9918
|
+
Ci(this.metrics.general.bufferingRanges);
|
|
9917
9919
|
});
|
|
9918
9920
|
r(this, "startBuffering", () => {
|
|
9919
9921
|
if (this.currentLevel) {
|
|
@@ -9925,9 +9927,9 @@ const qh = () => ({
|
|
|
9925
9927
|
r(this, "unsetActive", () => {
|
|
9926
9928
|
if (this.currentLevel) {
|
|
9927
9929
|
const e = this.metrics.levels[this.currentLevel];
|
|
9928
|
-
e &&
|
|
9930
|
+
e && Ci(e.activeRanges);
|
|
9929
9931
|
}
|
|
9930
|
-
|
|
9932
|
+
Ci(this.metrics.general.activeRanges);
|
|
9931
9933
|
});
|
|
9932
9934
|
this.logger = t, this.emitter = e;
|
|
9933
9935
|
}
|
|
@@ -10651,7 +10653,7 @@ const nw = (s) => {
|
|
|
10651
10653
|
return !0;
|
|
10652
10654
|
};
|
|
10653
10655
|
var ls, Oe, ms;
|
|
10654
|
-
const Ge = class Ge extends
|
|
10656
|
+
const Ge = class Ge extends yi {
|
|
10655
10657
|
constructor(t) {
|
|
10656
10658
|
super();
|
|
10657
10659
|
// 10s
|
|
@@ -10664,7 +10666,7 @@ const Ge = class Ge extends bi {
|
|
|
10664
10666
|
r(this, "options");
|
|
10665
10667
|
r(this, "element");
|
|
10666
10668
|
r(this, "playbackSource");
|
|
10667
|
-
r(this, "emitter", new
|
|
10669
|
+
r(this, "emitter", new yi());
|
|
10668
10670
|
r(this, "logger");
|
|
10669
10671
|
r(this, "modules");
|
|
10670
10672
|
r(this, "clientIp");
|
|
@@ -10879,7 +10881,7 @@ const Ge = class Ge extends bi {
|
|
|
10879
10881
|
r(this, "isSupportedVideoCodecProfile", (t, i) => {
|
|
10880
10882
|
if (this.willUseMediaSource()) {
|
|
10881
10883
|
const n = Cr();
|
|
10882
|
-
return n ? n.isTypeSupported(
|
|
10884
|
+
return n ? n.isTypeSupported(Pi({ codec: t, codecString: i })) : !0;
|
|
10883
10885
|
}
|
|
10884
10886
|
if (t === "h264") {
|
|
10885
10887
|
const n = !!(i != null && i.startsWith("avc1.42")), o = !!(i != null && i.startsWith("avc1.66."));
|
|
@@ -10900,12 +10902,12 @@ const Ge = class Ge extends bi {
|
|
|
10900
10902
|
throw new P("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
|
|
10901
10903
|
if (t != null && t.video && i.push({
|
|
10902
10904
|
type: "video",
|
|
10903
|
-
mimeType:
|
|
10905
|
+
mimeType: Pi(t.video),
|
|
10904
10906
|
codec: t.video.codec
|
|
10905
10907
|
}), t != null && t.audio && i.push({
|
|
10906
10908
|
type: "audio",
|
|
10907
10909
|
codec: t.audio.codec,
|
|
10908
|
-
mimeType:
|
|
10910
|
+
mimeType: Pi(t.audio)
|
|
10909
10911
|
}), i.length === 0)
|
|
10910
10912
|
throw new P("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
|
|
10911
10913
|
if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
|
|
@@ -10995,7 +10997,7 @@ const Ge = class Ge extends bi {
|
|
|
10995
10997
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
10996
10998
|
return v({
|
|
10997
10999
|
uptime: Date.now() - this.createdAt,
|
|
10998
|
-
version: "4.1.2-
|
|
11000
|
+
version: "4.1.2-6-gc1642161",
|
|
10999
11001
|
clientId: this.clientId,
|
|
11000
11002
|
sessionId: this.sessionId,
|
|
11001
11003
|
channelId: this.channelId,
|
|
@@ -11226,7 +11228,7 @@ const Ge = class Ge extends bi {
|
|
|
11226
11228
|
switch (y) {
|
|
11227
11229
|
case "upgrade":
|
|
11228
11230
|
{
|
|
11229
|
-
const J = Math.min(W + 1, O), ct = E[J], Jl = (Fe = this.modules.connection.estimatedBandwidth) != null ? Fe :
|
|
11231
|
+
const J = Math.min(W + 1, O), ct = E[J], Jl = (Fe = this.modules.connection.estimatedBandwidth) != null ? Fe : bi(), Kl = ((he = (Q = ct == null ? void 0 : ct.audio) == null ? void 0 : Q.bitRate) != null ? he : 0) + ((Be = (_e = ct == null ? void 0 : ct.video) == null ? void 0 : _e.bitRate) != null ? Be : 0), em = Jl * 2 > Kl;
|
|
11230
11232
|
ct && em && this.modules.adaptivity.isQoSOk(ct) && (N = J);
|
|
11231
11233
|
}
|
|
11232
11234
|
break;
|
|
@@ -11405,7 +11407,7 @@ const Ge = class Ge extends bi {
|
|
|
11405
11407
|
channelId: E
|
|
11406
11408
|
}), N = Hp(O.codec, O.payload);
|
|
11407
11409
|
N && this.sizes.set(O.renditionId, N);
|
|
11408
|
-
const te =
|
|
11410
|
+
const te = Pi({ codec: L.codec, codecString: L.codecString });
|
|
11409
11411
|
this.emitter.emit("init segment", { initSegment: O, mimeType: te }), this.emit("initialized media");
|
|
11410
11412
|
} else {
|
|
11411
11413
|
const O = iw(y, L, this.sizes.get(y.renditionId));
|
|
@@ -11687,7 +11689,7 @@ const Ge = class Ge extends bi {
|
|
|
11687
11689
|
*/
|
|
11688
11690
|
get maxVideoBitRate() {
|
|
11689
11691
|
var t, i;
|
|
11690
|
-
return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? i :
|
|
11692
|
+
return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? i : bi();
|
|
11691
11693
|
}
|
|
11692
11694
|
/**
|
|
11693
11695
|
* Set max video bit rate that will be subscribed to
|
|
@@ -11704,7 +11706,7 @@ const Ge = class Ge extends bi {
|
|
|
11704
11706
|
*/
|
|
11705
11707
|
get maxAudioBitRate() {
|
|
11706
11708
|
var t, i;
|
|
11707
|
-
return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? i :
|
|
11709
|
+
return (i = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? i : bi();
|
|
11708
11710
|
}
|
|
11709
11711
|
/**
|
|
11710
11712
|
* Set max audio bit rate that will be subscribed to
|