@vindral/web-sdk 4.1.2-5-g17cd929a → 4.1.2-7-gc4e751c6
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/{DP53RvxV.js → Bs3ZbgIy.js} +90 -69
- package/{B6Mm5k0H.js → CvGvecAa.js} +1 -1
- package/{DrK4UhMJ.js → D7wWmFR2.js} +1 -1
- package/api-client.js +1 -1
- package/core.js +1 -1
- package/legacy.es.js +889 -845
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.js +2 -2
- package/{DwUCALiA.js → wJK4GezP.js} +347 -324
|
@@ -29,14 +29,14 @@ var Si = (s) => {
|
|
|
29
29
|
for (var n = 0, o = s[e >> 1], c = o && o.length; n < c; n++) e & 1 ? o[n].call(t) : i = o[n].call(t, i);
|
|
30
30
|
return i;
|
|
31
31
|
}, ye = (s, e, t, i, n, o) => {
|
|
32
|
-
var c, h, d, m, p, g = e & 7, w = !!(e & 8), b = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0,
|
|
32
|
+
var c, h, d, m, p, g = e & 7, w = !!(e & 8), b = !!(e & 16), S = g > 3 ? s.length + 1 : g ? w ? 1 : 2 : 0, P = bd[g + 5], B = g > 3 && (s[S - 1] = []), D = s[S] || (s[S] = []), T = g && (!b && !w && (n = n.prototype), g < 5 && (g > 3 || !b) && sm(g < 4 ? n : { get [t]() {
|
|
33
33
|
return a(this, o);
|
|
34
34
|
}, set [t](k) {
|
|
35
35
|
return l(this, o, k);
|
|
36
36
|
} }, t));
|
|
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
|
-
m = rm(g, t, d = {}, s[3],
|
|
39
|
+
m = rm(g, t, d = {}, s[3], D), 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[P] : g > 4 ? void 0 : { get: T.get, set: T.set } : n, m), d._ = 1, g ^ 4 || h === void 0 ? qn(h) && (g > 4 ? B.unshift(h) : g ? b ? o = h : T[P] = 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) && B.unshift(c));
|
|
40
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) => ({
|
|
@@ -121,7 +121,7 @@ var Ne = (s, e, t) => {
|
|
|
121
121
|
return o();
|
|
122
122
|
};
|
|
123
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 "./
|
|
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);
|
|
@@ -156,7 +156,7 @@ class yd {
|
|
|
156
156
|
return this._borrowedBuffers;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const
|
|
159
|
+
const O = () => {
|
|
160
160
|
};
|
|
161
161
|
class H {
|
|
162
162
|
constructor() {
|
|
@@ -186,7 +186,7 @@ class H {
|
|
|
186
186
|
}, this.reject = (i) => {
|
|
187
187
|
this.pending = !1, t(i);
|
|
188
188
|
};
|
|
189
|
-
}), this.promise.catch(
|
|
189
|
+
}), this.promise.catch(O);
|
|
190
190
|
}
|
|
191
191
|
static resolved(e) {
|
|
192
192
|
const t = new H();
|
|
@@ -251,7 +251,7 @@ class Dc {
|
|
|
251
251
|
}
|
|
252
252
|
abort(e) {
|
|
253
253
|
var t, i;
|
|
254
|
-
(t = a(this, $e)) == null || t.promise.catch(
|
|
254
|
+
(t = a(this, $e)) == null || t.promise.catch(O), (i = a(this, $e)) == null || i.reject(e);
|
|
255
255
|
}
|
|
256
256
|
push(e) {
|
|
257
257
|
return f(this, null, function* () {
|
|
@@ -302,7 +302,7 @@ function bu(s) {
|
|
|
302
302
|
t[i] = e.charCodeAt(i);
|
|
303
303
|
return t.buffer;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function R(s) {
|
|
306
306
|
return typeof BigInt == "function" ? BigInt(s) : s;
|
|
307
307
|
}
|
|
308
308
|
var Pr, ut, Ye;
|
|
@@ -374,7 +374,7 @@ const mm = new RegExp(
|
|
|
374
374
|
}, Am = () => Ee.indexOf("CrKey") !== -1, vu = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Oc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, wm = () => Ee.indexOf("iphone") >= 0 && Ee.indexOf("like iphone") < 0 || Ee.indexOf("ipad") >= 0 && Ee.indexOf("like ipad") < 0 || Ee.indexOf("ipod") >= 0 && Ee.indexOf("like ipod") < 0 || Oc(), bm = () => {
|
|
375
375
|
var s, e;
|
|
376
376
|
return Oc() ? !1 : (e = (s = Cr()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
|
|
377
|
-
},
|
|
377
|
+
}, dw = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, ym = () => /^(?!.*chrome).*safari/i.test(Ee);
|
|
378
378
|
function vm() {
|
|
379
379
|
var s, e;
|
|
380
380
|
if (/(iPhone|iPod|iPad)/i.test(Ee))
|
|
@@ -734,7 +734,7 @@ class Bm {
|
|
|
734
734
|
const e = new H();
|
|
735
735
|
e.promise.then((i) => {
|
|
736
736
|
l(this, Di, i);
|
|
737
|
-
}).catch(
|
|
737
|
+
}).catch(O);
|
|
738
738
|
const t = a(this, Oi).promise.then(() => e);
|
|
739
739
|
return l(this, Oi, e), yield t, new km(a(this, Di), e);
|
|
740
740
|
});
|
|
@@ -917,7 +917,7 @@ const Td = () => {
|
|
|
917
917
|
videoCodecs: ["av1", "h264"],
|
|
918
918
|
webtransportEnabled: !0
|
|
919
919
|
}, Pm = "connection_failed", xm = "connection_failed_will_not_attempt_again", Lm = "authentication_error", Dm = "authentication_expired", Om = "channel_not_found", Mm = "no_incoming_data_error", Fm = "connection_inactivity", _m = "missing_init_segment", Nm = "no_track_context", Vm = "invalid_track_context_state", Gm = "disconnected_by_edge", jm = "decoder_error", Wm = "audio_player_error", zm = "media_source_error", Hm = "webgl_context_lost_error", Xm = "access_forbidden", Qm = "channel_switch_failed", Zm = "drm_error";
|
|
920
|
-
class
|
|
920
|
+
class x extends Error {
|
|
921
921
|
constructor(t, i, n = {}) {
|
|
922
922
|
super(t);
|
|
923
923
|
r(this, "props");
|
|
@@ -959,44 +959,44 @@ class P extends Error {
|
|
|
959
959
|
this.props = i, this.extra = n, Object.setPrototypeOf(this, new.target.prototype);
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
|
-
const qm = (s, e) => new
|
|
962
|
+
const qm = (s, e) => new x(
|
|
963
963
|
"MediaElement Error",
|
|
964
964
|
{ isFatal: s, code: "media_element_error", source: e },
|
|
965
965
|
{ mediaErrorCode: e.code }
|
|
966
|
-
), $m = (s, e) => new
|
|
966
|
+
), $m = (s, e) => new x("Decoder Error", { isFatal: s, code: jm, source: e, type: "internal" }), Iu = (s, e) => new x("Audio Player Error", { isFatal: s, code: Wm, source: e, type: "internal" }), Ym = (s, e) => new x(`No init segment for rendition id ${s} for channel ${e}`, {
|
|
967
967
|
isFatal: !1,
|
|
968
968
|
code: _m,
|
|
969
969
|
type: "internal"
|
|
970
|
-
}), Cd = (s, e, t, i) => new
|
|
970
|
+
}), Cd = (s, e, t, i) => new x(
|
|
971
971
|
"MediaSource Error",
|
|
972
972
|
{ isFatal: s, code: zm, source: e, type: "internal" },
|
|
973
973
|
{ type: i, consecutiveErrorsCount: t }
|
|
974
|
-
), qa = (s, e) => new
|
|
974
|
+
), qa = (s, e) => new x(`No track context for ${s}${e ? `, rendition id ${e}` : ""}`, {
|
|
975
975
|
isFatal: !1,
|
|
976
976
|
code: Nm,
|
|
977
977
|
type: "internal"
|
|
978
|
-
}), Jm = (s, e) => new
|
|
978
|
+
}), Jm = (s, e) => new x(
|
|
979
979
|
`Track context is in an invalid state for ${s}${e ? `, rendition id ${e}` : ""}`,
|
|
980
980
|
{
|
|
981
981
|
isFatal: !1,
|
|
982
982
|
code: Vm,
|
|
983
983
|
type: "internal"
|
|
984
984
|
}
|
|
985
|
-
), Km = () => new
|
|
985
|
+
), Km = () => new x("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), $n = (s) => new x("Disconnected From Edge Server", {
|
|
986
986
|
type: "external",
|
|
987
987
|
source: s,
|
|
988
988
|
isFatal: !1,
|
|
989
989
|
code: Gm
|
|
990
|
-
}), ho = (s) => new
|
|
990
|
+
}), ho = (s) => new x("Authentication Failed", { isFatal: !0, code: Lm, source: s }), ef = (s) => new x("Authentication Expired", { isFatal: !0, code: Dm, source: s }), tf = (s, e) => new x("Connection closed due to inactivity", { isFatal: !1, code: Fm, source: e, type: s }), Cu = (s, e) => new x("Channel not found", { isFatal: !1, code: Om, source: e, type: s }), sf = (s) => new x("No Incoming Data", { isFatal: !1, code: Mm, source: s }), nf = (s) => new x("Connection attempt failed", {
|
|
991
991
|
isFatal: !1,
|
|
992
992
|
code: Pm,
|
|
993
993
|
source: s
|
|
994
|
-
}), ku = () => new
|
|
994
|
+
}), ku = () => new x("Connection failed - no more reconnect attempts", {
|
|
995
995
|
isFatal: !0,
|
|
996
996
|
code: xm
|
|
997
|
-
}), rf = (s) => new
|
|
997
|
+
}), rf = (s) => new x("WebGL Context Lost", { isFatal: !1, code: Hm, source: s, type: "internal" }), kd = (s) => new x(s, { isFatal: !0, code: Xm }), Bd = (s) => new x(`Channel switch to '${s}' failed`, { isFatal: !1, code: Qm }), Bu = (s, e = !1, t) => new x(s, { isFatal: e, code: Zm, source: t }), Rd = (s, e) => s && typeof s == "object" && e in s, af = (s) => !(typeof s != "object" || !Rd(s, "channelId") || typeof s.channelId != "string" || !Rd(s, "url") || typeof s.url != "string" || s.channelId.length === 0 || s.url.length === 0), of = (s) => {
|
|
998
998
|
if (!af(s))
|
|
999
|
-
throw new
|
|
999
|
+
throw new x("Invalid options", { isFatal: !0, code: "invalid_options" });
|
|
1000
1000
|
const e = v({}, s);
|
|
1001
1001
|
return Object.keys(e).forEach((t) => {
|
|
1002
1002
|
const i = e;
|
|
@@ -1198,8 +1198,8 @@ const pf = (s) => {
|
|
|
1198
1198
|
if (i) {
|
|
1199
1199
|
const g = i.getElementsByTagName("name"), w = i.getElementsByTagName("value");
|
|
1200
1200
|
for (let b = 0; b < g.length; b++) {
|
|
1201
|
-
const S = (h = g[b]) == null ? void 0 : h.childNodes[0],
|
|
1202
|
-
S != null && S.nodeValue &&
|
|
1201
|
+
const S = (h = g[b]) == null ? void 0 : h.childNodes[0], P = (d = w[b]) == null ? void 0 : d.childNodes[0];
|
|
1202
|
+
S != null && S.nodeValue && P && P.nodeValue && (n[S.nodeValue] = P.nodeValue);
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
1205
|
const o = t.getElementsByTagName("Challenge")[0];
|
|
@@ -1490,9 +1490,9 @@ const bf = 7, yf = 8, vf = (s) => {
|
|
|
1490
1490
|
case 138:
|
|
1491
1491
|
case 144: {
|
|
1492
1492
|
if (c = o.readUnsignedExpGolomb(), c === 3 && o.readBits(1), o.readUnsignedExpGolomb() + 8, o.readUnsignedExpGolomb() + 8, o.readBit(), o.readBit()) {
|
|
1493
|
-
for (let
|
|
1493
|
+
for (let B = 0; B < (c != 3 ? 8 : 12); B++)
|
|
1494
1494
|
if (o.readBit()) {
|
|
1495
|
-
const T =
|
|
1495
|
+
const T = B < 6 ? 16 : 64;
|
|
1496
1496
|
let U = 0, k = 8, _ = 8;
|
|
1497
1497
|
for (let ce = 0; ce < T; ce++)
|
|
1498
1498
|
_ != 0 && (U = o.readSignedExpGolomb(), _ = (k + U + 256) % 256), k = _ == 0 ? k : _;
|
|
@@ -1512,7 +1512,7 @@ const bf = 7, yf = 8, vf = (s) => {
|
|
|
1512
1512
|
p === 0 && o.readBit(), o.readBit();
|
|
1513
1513
|
let g = d + 1, w = m + 1;
|
|
1514
1514
|
if (w *= 2 - p, w *= 16, g *= 16, o.readBit()) {
|
|
1515
|
-
const
|
|
1515
|
+
const P = c == 1 ? 1 : 0, D = 1 << (c == 1 || c == 2 ? 1 : 0), T = 2 - p << P, U = o.readUnsignedExpGolomb() * D, k = o.readUnsignedExpGolomb() * D, _ = o.readUnsignedExpGolomb() * T, ce = o.readUnsignedExpGolomb() * T;
|
|
1516
1516
|
g -= U + k, w -= _ + ce;
|
|
1517
1517
|
}
|
|
1518
1518
|
let b = {
|
|
@@ -2328,11 +2328,11 @@ const od = class od {
|
|
|
2328
2328
|
return ((e = a(this, X).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
|
|
2329
2329
|
}
|
|
2330
2330
|
sample(e) {
|
|
2331
|
-
var b, S,
|
|
2332
|
-
const t = (b = a(this, Re).init().moov.traks[0]) == null ? void 0 : b.mdia.minf.stbl.stsd.codec, i = ((S = a(this, X).moof.traf.trun) == null ? void 0 : S.samplesCount) || 0, n = (
|
|
2331
|
+
var b, S, P, B, D, T, U, k, _, ce, Me, Z, It, Ct, y;
|
|
2332
|
+
const t = (b = a(this, Re).init().moov.traks[0]) == null ? void 0 : b.mdia.minf.stbl.stsd.codec, i = ((S = a(this, X).moof.traf.trun) == null ? void 0 : S.samplesCount) || 0, n = (P = a(this, X).moof.traf.tfdt) == null ? void 0 : P.baseMediaDecodeTime;
|
|
2333
2333
|
if (e >= i || typeof n == "undefined" || !t)
|
|
2334
2334
|
return;
|
|
2335
|
-
const o = ((
|
|
2335
|
+
const o = ((B = a(this, X).moof.traf.trun) == null ? void 0 : B.sampleDurations[e]) || 0, c = ((D = a(this, X).moof.traf.trun) == null ? void 0 : D.sampleDurations.slice(0, e).reduce((E, L) => E + L, 0)) || 0, h = n + c, d = ((T = a(this, Re).init().moov.traks[0]) == null ? void 0 : T.mdia.mdhd.timescale) || 1e3, m = ((U = a(this, X).moof.traf.trun) == null ? void 0 : U.sampleSizes[e]) || a(this, X).mdat.data.byteLength, p = ((k = a(this, X).moof.traf.trun) == null ? void 0 : k.sampleSizes.slice(0, e).reduce((E, L) => E + L, 0)) || 0, g = a(this, X).mdat.data.subarray(p, p + m), w = ((_ = a(this, X).moof.traf.trun) == null ? void 0 : _.is_sync_sample(e)) || !1;
|
|
2336
2336
|
if (this.mediaType() === "video") {
|
|
2337
2337
|
const E = ((ce = a(this, Re).init().moov.traks[0]) == null ? void 0 : ce.tkhd.width) || 0, L = ((Me = a(this, Re).init().moov.traks[0]) == null ? void 0 : Me.tkhd.height) || 0;
|
|
2338
2338
|
return {
|
|
@@ -2862,13 +2862,13 @@ const se = (s, e, t) => {
|
|
|
2862
2862
|
d && s.readBit() !== 0 && s.readBits(4), g.push({ tier: Be, operatingPointIdc: he, seqLevelIdx: _e });
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
|
-
const w = s.readBits(4) + 1, b = s.readBits(4) + 1, S = s.readBits(w) + 1,
|
|
2866
|
-
let
|
|
2867
|
-
n ?
|
|
2868
|
-
const
|
|
2865
|
+
const w = s.readBits(4) + 1, b = s.readBits(4) + 1, S = s.readBits(w) + 1, P = s.readBits(b) + 1;
|
|
2866
|
+
let B = !1;
|
|
2867
|
+
n ? B = !1 : B = s.readBit() !== 0, B && (m = s.readBits(4) + 2, p = s.readBits(3) + 1);
|
|
2868
|
+
const D = s.readBit() !== 0, T = s.readBit() !== 0, U = s.readBit() !== 0;
|
|
2869
2869
|
let k = !1, _ = !1, ce = !1, Me = !1, Z = !1, It = !1, Ct = !1, y = Md, E = Qc, L = 0;
|
|
2870
2870
|
n || (k = s.readBit() !== 0, _ = s.readBit() !== 0, ce = s.readBit() !== 0, Me = s.readBit() !== 0, Z = s.readBit() !== 0, Z && (It = s.readBit() !== 0, Ct = s.readBit() !== 0), s.readBit() !== 0 ? y = Md : y = s.readBit(), y > 0 ? s.readBit() > 0 ? E = Qc : E = s.readBit() : E = Qc, Z ? L = s.readBits(3) : L = 0);
|
|
2871
|
-
const W = s.readBit() !== 0,
|
|
2871
|
+
const W = s.readBit() !== 0, M = s.readBit() !== 0, N = s.readBit() !== 0;
|
|
2872
2872
|
return {
|
|
2873
2873
|
seqProfile: e,
|
|
2874
2874
|
stillPicture: i,
|
|
@@ -2886,11 +2886,11 @@ const se = (s, e, t) => {
|
|
|
2886
2886
|
frameWidthBits: w,
|
|
2887
2887
|
frameHeightBits: b,
|
|
2888
2888
|
maxFrameWidth: S,
|
|
2889
|
-
maxFrameHeight:
|
|
2890
|
-
frameIdNumbersPresentFlag:
|
|
2889
|
+
maxFrameHeight: P,
|
|
2890
|
+
frameIdNumbersPresentFlag: B,
|
|
2891
2891
|
deltaFrameIdLength: m,
|
|
2892
2892
|
additionalFrameIdLength: p,
|
|
2893
|
-
use_128x128Superblock:
|
|
2893
|
+
use_128x128Superblock: D,
|
|
2894
2894
|
enableFilterIntra: T,
|
|
2895
2895
|
enableIntraEdgeFilter: U,
|
|
2896
2896
|
enableInterintraCompound: k,
|
|
@@ -2904,7 +2904,7 @@ const se = (s, e, t) => {
|
|
|
2904
2904
|
seqForceIntegerMv: E,
|
|
2905
2905
|
orderHintBits: L,
|
|
2906
2906
|
enableSuperres: W,
|
|
2907
|
-
enableCdef:
|
|
2907
|
+
enableCdef: M,
|
|
2908
2908
|
enableRestoration: N,
|
|
2909
2909
|
colorConfig: Vp(s, e),
|
|
2910
2910
|
filmGrainParamsPresent: s.readBit() !== 0
|
|
@@ -3228,13 +3228,13 @@ class fh extends yi {
|
|
|
3228
3228
|
});
|
|
3229
3229
|
/// This method is used to try to play the media element without throwing an error if it fails.
|
|
3230
3230
|
r(this, "tryPlay", () => {
|
|
3231
|
-
this.element.muted = this._userProvidedMuted, this._play().catch(
|
|
3231
|
+
this.element.muted = this._userProvidedMuted, this._play().catch(O);
|
|
3232
3232
|
});
|
|
3233
3233
|
/// This method is used to play the media element and will throw an error if it fails.
|
|
3234
3234
|
r(this, "play", () => {
|
|
3235
3235
|
this.element.muted = this._userProvidedMuted, this._play().catch((t) => {
|
|
3236
3236
|
if (t instanceof Error) {
|
|
3237
|
-
const i = new
|
|
3237
|
+
const i = new x("Media Play Error", { source: t, isFatal: !1, code: "media_play_error" });
|
|
3238
3238
|
this.emit("error", i);
|
|
3239
3239
|
}
|
|
3240
3240
|
});
|
|
@@ -3633,7 +3633,7 @@ class gg {
|
|
|
3633
3633
|
subscribeId: a(this, Zs),
|
|
3634
3634
|
trackAlias: a(this, Gr),
|
|
3635
3635
|
groupId: e,
|
|
3636
|
-
subGroupId:
|
|
3636
|
+
subGroupId: R(0),
|
|
3637
3637
|
objectId: t,
|
|
3638
3638
|
subscriberPriority: a(this, jr),
|
|
3639
3639
|
streamId: a(this, zr),
|
|
@@ -3896,24 +3896,24 @@ class Ro {
|
|
|
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
|
|
3899
|
+
return R(A(this, z, Qt).call(this, 1)[0]);
|
|
3900
3900
|
case 1: {
|
|
3901
3901
|
yield A(this, z, ki).call(this, 2);
|
|
3902
3902
|
const t = A(this, z, Qt).call(this, 2), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3903
|
-
return
|
|
3903
|
+
return R(i.getUint16(0));
|
|
3904
3904
|
}
|
|
3905
3905
|
case 2: {
|
|
3906
3906
|
yield A(this, z, ki).call(this, 4);
|
|
3907
3907
|
const t = A(this, z, Qt).call(this, 4), i = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
3908
|
-
return
|
|
3908
|
+
return R(i.getUint32(0));
|
|
3909
3909
|
}
|
|
3910
3910
|
case 3: {
|
|
3911
3911
|
yield A(this, z, ki).call(this, 8);
|
|
3912
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
|
-
return
|
|
3914
|
+
return R(i.getBigUint64(0));
|
|
3915
3915
|
const n = td(t, 0, 7);
|
|
3916
|
-
return
|
|
3916
|
+
return R(n);
|
|
3917
3917
|
}
|
|
3918
3918
|
default:
|
|
3919
3919
|
throw new Error("Invalid VarInt size");
|
|
@@ -4064,7 +4064,7 @@ const Tr = class Tr {
|
|
|
4064
4064
|
};
|
|
4065
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
|
-
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" ?
|
|
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" ? R(2) ** R(62) - R(1) : R(Number.MAX_SAFE_INTEGER);
|
|
4068
4068
|
function Nc(s, e) {
|
|
4069
4069
|
return e[0] = s, e.subarray(0, 1);
|
|
4070
4070
|
}
|
|
@@ -4125,7 +4125,7 @@ function sd(s, e) {
|
|
|
4125
4125
|
yield s.writeString(t);
|
|
4126
4126
|
});
|
|
4127
4127
|
}
|
|
4128
|
-
const Uo =
|
|
4128
|
+
const Uo = R(2);
|
|
4129
4129
|
function Qn(s) {
|
|
4130
4130
|
return f(this, null, function* () {
|
|
4131
4131
|
const e = yield s.readVarInt(), t = /* @__PURE__ */ new Map();
|
|
@@ -4173,7 +4173,7 @@ function Cg(s, e) {
|
|
|
4173
4173
|
const kg = {
|
|
4174
4174
|
Subscriber: 2
|
|
4175
4175
|
}, Po = {
|
|
4176
|
-
Role:
|
|
4176
|
+
Role: R(0)
|
|
4177
4177
|
}, ol = {
|
|
4178
4178
|
Draft07: 4278190087
|
|
4179
4179
|
};
|
|
@@ -4622,7 +4622,7 @@ class Vd {
|
|
|
4622
4622
|
case I.AnnounceError:
|
|
4623
4623
|
return Zg(a(this, ae));
|
|
4624
4624
|
}
|
|
4625
|
-
return qg(a(this, ae),
|
|
4625
|
+
return qg(a(this, ae), R(e), t);
|
|
4626
4626
|
});
|
|
4627
4627
|
}
|
|
4628
4628
|
}
|
|
@@ -4744,14 +4744,14 @@ const Ms = class Ms {
|
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
4746
|
onUpdate(e) {
|
|
4747
|
-
l(this, tt, { startGroup: e.start.group }), e.end.group >
|
|
4747
|
+
l(this, tt, { startGroup: e.start.group }), e.end.group > R(0) && (a(this, tt).endGroup = e.end.group - R(1));
|
|
4748
4748
|
}
|
|
4749
4749
|
onError(e) {
|
|
4750
4750
|
const t = new Error(e.reason);
|
|
4751
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:
|
|
4754
|
+
e.finalInfo && (a(this, tt) || l(this, tt, { startGroup: R(0) }), a(this, tt).endGroup = e.finalInfo.group), a(this, si).resolve(e);
|
|
4755
4755
|
}
|
|
4756
4756
|
onUnsubscribe(e) {
|
|
4757
4757
|
a(this, zi).resolve(e);
|
|
@@ -4760,7 +4760,7 @@ const Ms = class Ms {
|
|
|
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(
|
|
4763
|
+
Promise.race([gs(i - n - t), this.done().catch(O)]).then(() => a(this, Hi).resolve(this.expiryState())).catch(O);
|
|
4764
4764
|
}
|
|
4765
4765
|
a(this, hn).resolve(e);
|
|
4766
4766
|
}
|
|
@@ -4774,7 +4774,7 @@ const Ms = class Ms {
|
|
|
4774
4774
|
return a(this, tt);
|
|
4775
4775
|
}
|
|
4776
4776
|
close() {
|
|
4777
|
-
a(this, Hi).promise.catch(
|
|
4777
|
+
a(this, Hi).promise.catch(O), 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() {
|
|
@@ -4836,7 +4836,7 @@ class eA {
|
|
|
4836
4836
|
A(this, Ko, Tl).call(this).catch((e) => a(this, oa).error("error writing subscription", e)),
|
|
4837
4837
|
a(this, We).unsubscribed(),
|
|
4838
4838
|
a(this, We).done(),
|
|
4839
|
-
a(this, We).expiryNotification().catch(
|
|
4839
|
+
a(this, We).expiryNotification().catch(O)
|
|
4840
4840
|
]);
|
|
4841
4841
|
});
|
|
4842
4842
|
}
|
|
@@ -4917,7 +4917,7 @@ class tA {
|
|
|
4917
4917
|
yield a(this, Xi).write({
|
|
4918
4918
|
subscribeId: a(this, un).subscribe.id,
|
|
4919
4919
|
trackAlias: a(this, un).subscribe.trackAlias,
|
|
4920
|
-
subGroupId:
|
|
4920
|
+
subGroupId: R(0),
|
|
4921
4921
|
subscriberPriority: 0,
|
|
4922
4922
|
groupId: o.groupId,
|
|
4923
4923
|
objectId: o.objectId,
|
|
@@ -4939,10 +4939,10 @@ class tA {
|
|
|
4939
4939
|
});
|
|
4940
4940
|
}
|
|
4941
4941
|
[Tt()]() {
|
|
4942
|
-
return a(this, Xi).close().catch(
|
|
4942
|
+
return a(this, Xi).close().catch(O);
|
|
4943
4943
|
}
|
|
4944
4944
|
[Symbol.asyncDispose]() {
|
|
4945
|
-
return a(this, Xi).close().catch(
|
|
4945
|
+
return a(this, Xi).close().catch(O);
|
|
4946
4946
|
}
|
|
4947
4947
|
}
|
|
4948
4948
|
Xi = new WeakMap(), ca = new WeakMap(), un = new WeakMap(), ha = new WeakMap(), ln = new WeakMap();
|
|
@@ -4963,10 +4963,10 @@ class iA {
|
|
|
4963
4963
|
ok(e) {
|
|
4964
4964
|
return f(this, null, function* () {
|
|
4965
4965
|
var d, m, p;
|
|
4966
|
-
const t = (d = this.state.range()) == null ? void 0 : d.startGroup, i = e.latest(), n = i == null ? void 0 : i.id, o = (p = (m = i == null ? void 0 : i.latest()) == null ? void 0 : m.objectId) != null ? p :
|
|
4966
|
+
const t = (d = this.state.range()) == null ? void 0 : d.startGroup, i = e.latest(), n = i == null ? void 0 : i.id, o = (p = (m = i == null ? void 0 : i.latest()) == null ? void 0 : m.objectId) != null ? p : R(0), c = e.consume(t != null ? t : n), h = {
|
|
4967
4967
|
type: I.SubscribeOk,
|
|
4968
4968
|
id: this.state.subscribe.id,
|
|
4969
|
-
expires:
|
|
4969
|
+
expires: R(0),
|
|
4970
4970
|
groupOrder: "ascending",
|
|
4971
4971
|
params: /* @__PURE__ */ new Map(),
|
|
4972
4972
|
largestInfo: n ? { group: n, object: o } : void 0
|
|
@@ -4975,19 +4975,19 @@ class iA {
|
|
|
4975
4975
|
});
|
|
4976
4976
|
}
|
|
4977
4977
|
invalidRange() {
|
|
4978
|
-
return A(this, ni, Bs).call(this,
|
|
4978
|
+
return A(this, ni, Bs).call(this, R(1), "Invalid range");
|
|
4979
4979
|
}
|
|
4980
4980
|
retryTrackAlias() {
|
|
4981
|
-
return A(this, ni, Bs).call(this,
|
|
4981
|
+
return A(this, ni, Bs).call(this, R(2), "Retry track alias");
|
|
4982
4982
|
}
|
|
4983
4983
|
trackDoesNotExist() {
|
|
4984
|
-
return A(this, ni, Bs).call(this,
|
|
4984
|
+
return A(this, ni, Bs).call(this, R(3), "Track does not exist");
|
|
4985
4985
|
}
|
|
4986
4986
|
unauthorized() {
|
|
4987
|
-
return A(this, ni, Bs).call(this,
|
|
4987
|
+
return A(this, ni, Bs).call(this, R(4), "Unauthorized");
|
|
4988
4988
|
}
|
|
4989
4989
|
timeout() {
|
|
4990
|
-
return A(this, ni, Bs).call(this,
|
|
4990
|
+
return A(this, ni, Bs).call(this, R(5), "Timeout");
|
|
4991
4991
|
}
|
|
4992
4992
|
[Tt()]() {
|
|
4993
4993
|
return this.trackDoesNotExist();
|
|
@@ -5150,8 +5150,8 @@ class Il {
|
|
|
5150
5150
|
const i = {
|
|
5151
5151
|
type: I.SubscribeUpdate,
|
|
5152
5152
|
id: a(this, ue).subscribe.id,
|
|
5153
|
-
start: { group: e, object:
|
|
5154
|
-
end: { group: t +
|
|
5153
|
+
start: { group: e, object: R(0) },
|
|
5154
|
+
end: { group: t + R(1), object: R(0) },
|
|
5155
5155
|
params: /* @__PURE__ */ new Map(),
|
|
5156
5156
|
subscriberPriority: 0
|
|
5157
5157
|
};
|
|
@@ -5194,13 +5194,13 @@ class Il {
|
|
|
5194
5194
|
return Bt(this, null, function* () {
|
|
5195
5195
|
var e, t;
|
|
5196
5196
|
try {
|
|
5197
|
-
for (var b = Y(a(this, gn)), S,
|
|
5198
|
-
var h =
|
|
5197
|
+
for (var b = Y(a(this, gn)), S, P, B; S = !(P = yield new q(b.next())).done; S = !1) {
|
|
5198
|
+
var h = P.value;
|
|
5199
5199
|
var d = [];
|
|
5200
5200
|
try {
|
|
5201
|
-
const
|
|
5201
|
+
const D = Ne(d, h, !0);
|
|
5202
5202
|
try {
|
|
5203
|
-
for (var i = Y(
|
|
5203
|
+
for (var i = Y(D.groups()), n, o, c; n = !(o = yield new q(i.next())).done; n = !1) {
|
|
5204
5204
|
const T = o.value;
|
|
5205
5205
|
const U = (e = a(this, ue).range()) == null ? void 0 : e.startGroup, k = (t = a(this, ue).range()) == null ? void 0 : t.endGroup;
|
|
5206
5206
|
if (U && T.groupId() < U)
|
|
@@ -5226,14 +5226,14 @@ class Il {
|
|
|
5226
5226
|
w && (yield new q(w));
|
|
5227
5227
|
}
|
|
5228
5228
|
}
|
|
5229
|
-
} catch (
|
|
5230
|
-
|
|
5229
|
+
} catch (P) {
|
|
5230
|
+
B = [P];
|
|
5231
5231
|
} finally {
|
|
5232
5232
|
try {
|
|
5233
|
-
S && (
|
|
5233
|
+
S && (P = b.return) && (yield new q(P.call(b)));
|
|
5234
5234
|
} finally {
|
|
5235
|
-
if (
|
|
5236
|
-
throw
|
|
5235
|
+
if (B)
|
|
5236
|
+
throw B[0];
|
|
5237
5237
|
}
|
|
5238
5238
|
}
|
|
5239
5239
|
});
|
|
@@ -5299,31 +5299,31 @@ class to {
|
|
|
5299
5299
|
// The owner session of the subscriber
|
|
5300
5300
|
u(this, Ot);
|
|
5301
5301
|
// The next subscribe id
|
|
5302
|
-
r(this, "nextSubscribeId",
|
|
5302
|
+
r(this, "nextSubscribeId", R(0));
|
|
5303
5303
|
// The active subscriptions
|
|
5304
5304
|
u(this, Le, new Ie(/* @__PURE__ */ new Map()));
|
|
5305
5305
|
u(this, $i);
|
|
5306
5306
|
u(this, Yi, ge.get().createContext("Subscriber"));
|
|
5307
|
-
l(this, Ot, e), l(this, $i, t), A(this, Et, io).call(this).catch(
|
|
5307
|
+
l(this, Ot, e), l(this, $i, t), A(this, Et, io).call(this).catch(O);
|
|
5308
5308
|
}
|
|
5309
|
-
subscribe(
|
|
5310
|
-
return f(this,
|
|
5311
|
-
const
|
|
5312
|
-
|
|
5313
|
-
const
|
|
5309
|
+
subscribe(n, o) {
|
|
5310
|
+
return f(this, arguments, function* (e, t, i = /* @__PURE__ */ new Map()) {
|
|
5311
|
+
const c = this.nextSubscribeId++, h = a(this, Ot).authToken();
|
|
5312
|
+
h && i.set(Uo, { type: Uo, payload: new TextEncoder().encode(h) });
|
|
5313
|
+
const d = {
|
|
5314
5314
|
type: I.Subscribe,
|
|
5315
5315
|
namespace: e,
|
|
5316
5316
|
name: t.name,
|
|
5317
|
-
id:
|
|
5318
|
-
trackAlias:
|
|
5317
|
+
id: c,
|
|
5318
|
+
trackAlias: c,
|
|
5319
5319
|
groupOrder: t.groupOrder,
|
|
5320
5320
|
subscriberPriority: t.priority,
|
|
5321
5321
|
filterType: t.filterType,
|
|
5322
|
-
params:
|
|
5323
|
-
}, [
|
|
5324
|
-
if (a(this, Le).update((
|
|
5322
|
+
params: i
|
|
5323
|
+
}, [m, p] = sA(a(this, $i), d);
|
|
5324
|
+
if (a(this, Le).update((w) => w.set(c, m)), yield a(this, $i).push(d), !(yield Promise.race([m.state.ok(), a(this, Ot).closed()])))
|
|
5325
5325
|
throw new Error("Session closed");
|
|
5326
|
-
return
|
|
5326
|
+
return p.closed().then(() => Promise.race([gs(rA), this.closed()])).then(() => A(this, Et, Rs).call(this, p.id)).catch(() => A(this, Et, Rs).call(this, p.id)), p;
|
|
5327
5327
|
});
|
|
5328
5328
|
}
|
|
5329
5329
|
closed() {
|
|
@@ -5417,7 +5417,7 @@ class nd {
|
|
|
5417
5417
|
r(this, "publisher");
|
|
5418
5418
|
u(this, yn);
|
|
5419
5419
|
const [i, n] = ed(100);
|
|
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(
|
|
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(O);
|
|
5421
5421
|
}
|
|
5422
5422
|
updateAuthToken(e) {
|
|
5423
5423
|
a(this, yn).update(e);
|
|
@@ -5612,11 +5612,11 @@ class cA {
|
|
|
5612
5612
|
if (i)
|
|
5613
5613
|
return;
|
|
5614
5614
|
const [n, o, c] = t;
|
|
5615
|
-
if (a(this, Ft).has(
|
|
5616
|
-
const h = a(this, Ft).get(
|
|
5615
|
+
if (a(this, Ft).has(R(o))) {
|
|
5616
|
+
const h = a(this, Ft).get(R(o));
|
|
5617
5617
|
if (!h)
|
|
5618
5618
|
throw new Error("Stream not found");
|
|
5619
|
-
c.length > 0 && (yield h.push(c)), n || (a(this, En).debug("Closing stream", { streamId: o }), h.close(), a(this, Ft).delete(
|
|
5619
|
+
c.length > 0 && (yield h.push(c)), n || (a(this, En).debug("Closing stream", { streamId: o }), h.close(), a(this, Ft).delete(R(o)));
|
|
5620
5620
|
} else {
|
|
5621
5621
|
let p;
|
|
5622
5622
|
a(this, En).debug("Creating new stream", { streamId: o });
|
|
@@ -5628,7 +5628,7 @@ class cA {
|
|
|
5628
5628
|
});
|
|
5629
5629
|
}
|
|
5630
5630
|
});
|
|
5631
|
-
if (a(this, Ft).set(
|
|
5631
|
+
if (a(this, Ft).set(R(o), h), n || (a(this, En).debug("Closing new stream", { streamId: o }), yield m.cancel(), a(this, Ft).delete(R(o))), c.length > 0)
|
|
5632
5632
|
return yield qu(new Ro(c, m), o);
|
|
5633
5633
|
}
|
|
5634
5634
|
} finally {
|
|
@@ -5639,7 +5639,7 @@ class cA {
|
|
|
5639
5639
|
}
|
|
5640
5640
|
close() {
|
|
5641
5641
|
var e;
|
|
5642
|
-
return a(this, Mt).cancel().catch(
|
|
5642
|
+
return a(this, Mt).cancel().catch(O), a(this, Sn).cancel("closing").catch(O), (e = a(this, es)) == null || e.cancel("closing").catch(O), a(this, ci).close();
|
|
5643
5643
|
}
|
|
5644
5644
|
closed() {
|
|
5645
5645
|
return Promise.resolve();
|
|
@@ -5778,7 +5778,7 @@ class zt {
|
|
|
5778
5778
|
u(this, Vt, {
|
|
5779
5779
|
name: "",
|
|
5780
5780
|
priority: 0,
|
|
5781
|
-
groupOrder: "
|
|
5781
|
+
groupOrder: "ascending",
|
|
5782
5782
|
filterType: { type: "latest-group" }
|
|
5783
5783
|
});
|
|
5784
5784
|
}
|
|
@@ -5798,14 +5798,14 @@ class zt {
|
|
|
5798
5798
|
startGroup(e) {
|
|
5799
5799
|
return a(this, Vt).filterType = {
|
|
5800
5800
|
type: "absolute-start",
|
|
5801
|
-
start: { group: e, object:
|
|
5801
|
+
start: { group: e, object: R(0) }
|
|
5802
5802
|
}, this;
|
|
5803
5803
|
}
|
|
5804
5804
|
range(e, t) {
|
|
5805
5805
|
return a(this, Vt).filterType = {
|
|
5806
5806
|
type: "absolute-range",
|
|
5807
|
-
start: { group: e, object:
|
|
5808
|
-
end: { group: t, object:
|
|
5807
|
+
start: { group: e, object: R(0) },
|
|
5808
|
+
end: { group: t, object: R(0) }
|
|
5809
5809
|
}, this;
|
|
5810
5810
|
}
|
|
5811
5811
|
build() {
|
|
@@ -5820,8 +5820,8 @@ class Ul {
|
|
|
5820
5820
|
u(this, Aa);
|
|
5821
5821
|
l(this, In, e), l(this, Aa, t);
|
|
5822
5822
|
}
|
|
5823
|
-
subscribe(e) {
|
|
5824
|
-
return a(this, In).subscribe(this.namespace(), e);
|
|
5823
|
+
subscribe(e, t = /* @__PURE__ */ new Map()) {
|
|
5824
|
+
return a(this, In).subscribe(this.namespace(), e, t);
|
|
5825
5825
|
}
|
|
5826
5826
|
closed() {
|
|
5827
5827
|
return a(this, In).closed();
|
|
@@ -5870,7 +5870,7 @@ const cd = class cd {
|
|
|
5870
5870
|
l(this, De, e), l(this, wt, t), e.done().then((i) => f(this, null, function* () {
|
|
5871
5871
|
var n;
|
|
5872
5872
|
return a(this, sc).call(this, (n = i.finalInfo) == null ? void 0 : n.group);
|
|
5873
|
-
})).catch(
|
|
5873
|
+
})).catch(O), l(this, wa, e.groups());
|
|
5874
5874
|
}
|
|
5875
5875
|
static subscribe(e, t) {
|
|
5876
5876
|
return f(this, null, function* () {
|
|
@@ -5967,7 +5967,7 @@ const hd = class hd {
|
|
|
5967
5967
|
case "absolute-start":
|
|
5968
5968
|
case "latest-group":
|
|
5969
5969
|
case "latest-object":
|
|
5970
|
-
c && h.startGroup(o +
|
|
5970
|
+
c && h.startGroup(o + R(1));
|
|
5971
5971
|
break;
|
|
5972
5972
|
}
|
|
5973
5973
|
const d = h.build();
|
|
@@ -5976,8 +5976,8 @@ const hd = class hd {
|
|
|
5976
5976
|
e.subscribe(d),
|
|
5977
5977
|
c ? i.value.update(o, o) : i.value.unsubscribe()
|
|
5978
5978
|
]);
|
|
5979
|
-
m.done().then(() => A(this, ya, Sh).call(this, m)).catch(
|
|
5980
|
-
m.expiryNotification().then(() => a(this, va).call(this, e, d)).catch(
|
|
5979
|
+
m.done().then(() => A(this, ya, Sh).call(this, m)).catch(O);
|
|
5980
|
+
m.expiryNotification().then(() => a(this, va).call(this, e, d)).catch(O);
|
|
5981
5981
|
const p = new Do(m, o);
|
|
5982
5982
|
i.value = p;
|
|
5983
5983
|
yield a(this, Gt).push(p);
|
|
@@ -5992,14 +5992,14 @@ const hd = class hd {
|
|
|
5992
5992
|
}
|
|
5993
5993
|
static subscribe(e, t, i) {
|
|
5994
5994
|
return f(this, null, function* () {
|
|
5995
|
-
const n = yield e.subscribe(t),
|
|
5996
|
-
return
|
|
5997
|
-
var
|
|
5998
|
-
return A(
|
|
5999
|
-
}).catch(
|
|
6000
|
-
var
|
|
6001
|
-
return a(
|
|
6002
|
-
}).catch(
|
|
5995
|
+
const n = i == null ? void 0 : i.params, o = i == null ? void 0 : i.largestGroupId, c = yield e.subscribe(t, n), h = new hd(new Do(c, o));
|
|
5996
|
+
return c.done().then(() => {
|
|
5997
|
+
var d;
|
|
5998
|
+
return A(d = h, ya, Sh).call(d, c);
|
|
5999
|
+
}).catch(O), c.expiryNotification().then(() => {
|
|
6000
|
+
var d;
|
|
6001
|
+
return a(d = h, va).call(d, e, t);
|
|
6002
|
+
}).catch(O), h;
|
|
6003
6003
|
});
|
|
6004
6004
|
}
|
|
6005
6005
|
largestGroupId() {
|
|
@@ -6136,7 +6136,7 @@ const rc = class rc {
|
|
|
6136
6136
|
u(this, Sa);
|
|
6137
6137
|
u(this, Ea);
|
|
6138
6138
|
u(this, Ta);
|
|
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(
|
|
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(O);
|
|
6140
6140
|
}
|
|
6141
6141
|
catalog() {
|
|
6142
6142
|
return a(this, di);
|
|
@@ -6264,24 +6264,31 @@ const Fs = class Fs {
|
|
|
6264
6264
|
r(this, "namespace");
|
|
6265
6265
|
this.trackObject = e, this.namespace = t, l(this, yt, i), l(this, Ba, n), l(this, Ra, o);
|
|
6266
6266
|
}
|
|
6267
|
-
static subscribe(
|
|
6268
|
-
return f(this,
|
|
6269
|
-
|
|
6267
|
+
static subscribe(c, h, d) {
|
|
6268
|
+
return f(this, arguments, function* (e, t, {
|
|
6269
|
+
timestampOffsetMs: i,
|
|
6270
|
+
startGroup: n,
|
|
6271
|
+
params: o
|
|
6272
|
+
}) {
|
|
6273
|
+
var S;
|
|
6270
6274
|
if (t.format !== "cmaf")
|
|
6271
6275
|
throw new Error("format must be cmaf");
|
|
6272
|
-
const
|
|
6273
|
-
n &&
|
|
6274
|
-
const
|
|
6276
|
+
const m = new zt().name(t.name);
|
|
6277
|
+
n && m.startGroup(n);
|
|
6278
|
+
const p = m.build();
|
|
6275
6279
|
if (t.initTrack) {
|
|
6276
|
-
const
|
|
6277
|
-
A(
|
|
6278
|
-
vi.subscribe(e,
|
|
6279
|
-
]),
|
|
6280
|
-
return new Fs(t, e.namespace(),
|
|
6280
|
+
const P = new zt().name(t.initTrack).build(), [B, D] = yield Promise.all([
|
|
6281
|
+
A(S = Fs, ac, xl).call(S, e, P),
|
|
6282
|
+
vi.subscribe(e, p, { params: o, largestGroupId: n ? n - R(1) : void 0 })
|
|
6283
|
+
]), T = new Dd(B);
|
|
6284
|
+
return new Fs(t, e.namespace(), D, T, i);
|
|
6281
6285
|
}
|
|
6282
6286
|
Xe(t.initData, "no init data found on track");
|
|
6283
|
-
const
|
|
6284
|
-
|
|
6287
|
+
const g = bu(t.initData), w = new Dd(new Uint8Array(g)), b = yield vi.subscribe(e, p, {
|
|
6288
|
+
params: o,
|
|
6289
|
+
largestGroupId: n ? n - R(1) : void 0
|
|
6290
|
+
});
|
|
6291
|
+
return new Fs(t, e.namespace(), b, w, i);
|
|
6285
6292
|
});
|
|
6286
6293
|
}
|
|
6287
6294
|
largestGroupId() {
|
|
@@ -6360,7 +6367,7 @@ const dd = class dd {
|
|
|
6360
6367
|
u(this, Pa);
|
|
6361
6368
|
u(this, xa);
|
|
6362
6369
|
u(this, La);
|
|
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(
|
|
6370
|
+
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(O);
|
|
6364
6371
|
}
|
|
6365
6372
|
closed() {
|
|
6366
6373
|
return a(this, La);
|
|
@@ -6405,13 +6412,13 @@ oc = new WeakMap(), ui = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(),
|
|
|
6405
6412
|
return f(this, null, function* () {
|
|
6406
6413
|
const t = yield e.promise;
|
|
6407
6414
|
try {
|
|
6408
|
-
for (var b = Y(t), S,
|
|
6409
|
-
var h =
|
|
6415
|
+
for (var b = Y(t), S, P, B; S = !(P = yield b.next()).done; S = !1) {
|
|
6416
|
+
var h = P.value;
|
|
6410
6417
|
var d = [];
|
|
6411
6418
|
try {
|
|
6412
|
-
const
|
|
6419
|
+
const D = Ne(d, h, !0);
|
|
6413
6420
|
try {
|
|
6414
|
-
for (var i = Y(
|
|
6421
|
+
for (var i = Y(D), n, o, c; n = !(o = yield i.next()).done; n = !1) {
|
|
6415
6422
|
const T = o.value;
|
|
6416
6423
|
if (T.objectStatus !== Te.Normal)
|
|
6417
6424
|
continue;
|
|
@@ -6421,7 +6428,7 @@ oc = new WeakMap(), ui = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(),
|
|
|
6421
6428
|
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; )
|
|
6422
6429
|
k.shift();
|
|
6423
6430
|
return k;
|
|
6424
|
-
}), t === a(this, ss).resolved && T.groupId >
|
|
6431
|
+
}), t === a(this, ss).resolved && T.groupId > R(0) && T.objectId == R(0) && A(this, vs, Ll).call(this, T.groupId).catch((k) => {
|
|
6425
6432
|
a(this, oc).warn("backfill failed", k);
|
|
6426
6433
|
});
|
|
6427
6434
|
}
|
|
@@ -6442,20 +6449,20 @@ oc = new WeakMap(), ui = new WeakMap(), ss = new WeakMap(), Pa = new WeakMap(),
|
|
|
6442
6449
|
w && (yield w);
|
|
6443
6450
|
}
|
|
6444
6451
|
}
|
|
6445
|
-
} catch (
|
|
6446
|
-
|
|
6452
|
+
} catch (P) {
|
|
6453
|
+
B = [P];
|
|
6447
6454
|
} finally {
|
|
6448
6455
|
try {
|
|
6449
|
-
S && (
|
|
6456
|
+
S && (P = b.return) && (yield P.call(b));
|
|
6450
6457
|
} finally {
|
|
6451
|
-
if (
|
|
6452
|
-
throw
|
|
6458
|
+
if (B)
|
|
6459
|
+
throw B[0];
|
|
6453
6460
|
}
|
|
6454
6461
|
}
|
|
6455
6462
|
});
|
|
6456
6463
|
}, Ll = function(e) {
|
|
6457
6464
|
return f(this, null, function* () {
|
|
6458
|
-
const t = e -
|
|
6465
|
+
const t = e - R(1), i = this.timeline(), n = i[0], o = i[i.length - 1];
|
|
6459
6466
|
if (!n || !o || o.wallclock - n.wallclock > jd)
|
|
6460
6467
|
return;
|
|
6461
6468
|
const c = H.fromPromise(
|
|
@@ -6589,8 +6596,12 @@ const _s = class _s {
|
|
|
6589
6596
|
return a(this, rs).waitForWallclockTime(e);
|
|
6590
6597
|
}
|
|
6591
6598
|
subscribeCmafTrack(e, t) {
|
|
6592
|
-
const i = this.catalog().current().tracks,
|
|
6593
|
-
return A(this, Rn, ao).call(this, () => Ih.subscribe(a(this, ns),
|
|
6599
|
+
const i = t == null ? void 0 : t.startGroup, n = t == null ? void 0 : t.params, o = this.catalog().current().tracks, c = e["com.vindral.variant_uid"] !== void 0 ? o.find((h) => h["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]) : void 0;
|
|
6600
|
+
return A(this, Rn, ao).call(this, () => Ih.subscribe(a(this, ns), c != null ? c : e, {
|
|
6601
|
+
timestampOffsetMs: a(this, mi),
|
|
6602
|
+
startGroup: i,
|
|
6603
|
+
params: n
|
|
6604
|
+
}));
|
|
6594
6605
|
}
|
|
6595
6606
|
subscribeWebVttTrack(e) {
|
|
6596
6607
|
return A(this, Rn, ao).call(this, () => Bh.subscribe(a(this, ns), e, a(this, mi)));
|
|
@@ -6816,6 +6827,13 @@ class IA {
|
|
|
6816
6827
|
}
|
|
6817
6828
|
}
|
|
6818
6829
|
uc = new WeakMap(), Un = new WeakMap();
|
|
6830
|
+
const CA = R(8);
|
|
6831
|
+
function kA(s) {
|
|
6832
|
+
if (s < 0 || s > 65535)
|
|
6833
|
+
throw new RangeError("burstMs must be between 0 and 65535 inclusive");
|
|
6834
|
+
const e = new Uint8Array([s >> 8 & 255, s & 255]);
|
|
6835
|
+
return { type: CA, payload: e };
|
|
6836
|
+
}
|
|
6819
6837
|
var Pn, Fa, _a;
|
|
6820
6838
|
class Yc {
|
|
6821
6839
|
constructor(e, t) {
|
|
@@ -6871,22 +6889,27 @@ const Ns = class Ns {
|
|
|
6871
6889
|
r(this, "subtitles", new Yc(a(this, fi), "subtitles"));
|
|
6872
6890
|
r(this, "video", new Yc(a(this, rt), "video"));
|
|
6873
6891
|
r(this, "audio", new Yc(a(this, nt), "audio"));
|
|
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(
|
|
6892
|
+
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(O);
|
|
6875
6893
|
}
|
|
6876
6894
|
closed() {
|
|
6877
6895
|
return a(this, Na);
|
|
6878
6896
|
}
|
|
6879
6897
|
static start(e, t) {
|
|
6880
6898
|
return f(this, null, function* () {
|
|
6881
|
-
const i =
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6899
|
+
const i = /* @__PURE__ */ new Map();
|
|
6900
|
+
if (t.burstMs !== void 0) {
|
|
6901
|
+
const p = kA(t.burstMs);
|
|
6902
|
+
i.set(p.type, p);
|
|
6903
|
+
}
|
|
6904
|
+
const n = new Ul(e, { namespace: lA("auxiliary") }), [[o, c, h], d] = yield Promise.all([
|
|
6905
|
+
Oo.start(e, t).then((p) => Promise.all([
|
|
6906
|
+
Promise.resolve(p),
|
|
6907
|
+
t.videoTrack ? p.subscribeCmafTrack(t.videoTrack, { params: i }) : void 0,
|
|
6908
|
+
t.audioTrack ? p.subscribeCmafTrack(t.audioTrack, { params: i }) : void 0
|
|
6886
6909
|
])),
|
|
6887
|
-
Uh.start(
|
|
6888
|
-
]),
|
|
6889
|
-
return
|
|
6910
|
+
Uh.start(n)
|
|
6911
|
+
]), m = new Ns(e, o, d);
|
|
6912
|
+
return h && a(m, nt).update(h), c && a(m, rt).update(c), m;
|
|
6890
6913
|
});
|
|
6891
6914
|
}
|
|
6892
6915
|
connectionInfo() {
|
|
@@ -6938,13 +6961,13 @@ const Ns = class Ns {
|
|
|
6938
6961
|
}
|
|
6939
6962
|
zap(e, t) {
|
|
6940
6963
|
return f(this, null, function* () {
|
|
6941
|
-
var S,
|
|
6964
|
+
var S, P;
|
|
6942
6965
|
const i = yield Oo.start(a(this, xn), e), n = a(this, Ln).wallclock() - t, o = a(this, le).current(), c = o.timestampWallclockOffset(), h = yield i.waitForWallclockTime(n);
|
|
6943
6966
|
a(this, Dn).update(i), yield a(this, le).current().close();
|
|
6944
|
-
const d = h.toReversed().find((
|
|
6967
|
+
const d = h.toReversed().find((B) => B.wallclock <= n), m = d != null && d.mediaPts ? d.mediaPts - o.timestampOffsetMs() : void 0, w = i.timestampWallclockOffset() - c + o.timestampOffsetMs();
|
|
6945
6968
|
i.setTimestampOffsetMs(w);
|
|
6946
|
-
const b = d != null && d.groupId ?
|
|
6947
|
-
m && ((S = a(this, rt).current()) == null || S.stopAfterTimestampReached(m), (
|
|
6969
|
+
const b = d != null && d.groupId ? R(d.groupId) : void 0;
|
|
6970
|
+
m && ((S = a(this, rt).current()) == null || S.stopAfterTimestampReached(m), (P = a(this, nt).current()) == null || P.stopAfterTimestampReached(m)), a(this, le).update(i), yield Promise.all([
|
|
6948
6971
|
e.videoTrack ? this.setVideoTrack(e.videoTrack, b) : void 0,
|
|
6949
6972
|
e.audioTrack ? this.setAudioTrack(e.audioTrack, b) : void 0
|
|
6950
6973
|
]);
|
|
@@ -6983,10 +7006,9 @@ Jn = Si(null), xn = new WeakMap(), Ln = new WeakMap(), cs = new WeakMap(), le =
|
|
|
6983
7006
|
}, sr = function(e, t, i, n) {
|
|
6984
7007
|
return f(this, null, function* () {
|
|
6985
7008
|
const o = i == null ? void 0 : i.largestGroupId(), [c, h] = yield Promise.all([
|
|
6986
|
-
e.subscribeCmafTrack(
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
),
|
|
7009
|
+
e.subscribeCmafTrack(t, {
|
|
7010
|
+
startGroup: n || (o ? o + R(1) : void 0)
|
|
7011
|
+
}),
|
|
6990
7012
|
o ? i == null ? void 0 : i.update(o, o) : i == null ? void 0 : i.unsubscribe()
|
|
6991
7013
|
]);
|
|
6992
7014
|
return c;
|
|
@@ -7046,7 +7068,7 @@ function Jc(s, e, t) {
|
|
|
7046
7068
|
const i = new URL("/voq/subscribe", s);
|
|
7047
7069
|
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;
|
|
7048
7070
|
}
|
|
7049
|
-
const
|
|
7071
|
+
const BA = 1e4;
|
|
7050
7072
|
var me, Se, at, hs, $, pi, Va, Ga, lc, On, ke, Fl, Mn, ja, Fn, _l, Nl, Vl, Gl, Dh;
|
|
7051
7073
|
const fd = class fd {
|
|
7052
7074
|
constructor(e, t, i, n, o, c) {
|
|
@@ -7063,11 +7085,11 @@ const fd = class fd {
|
|
|
7063
7085
|
u(this, On, /* @__PURE__ */ new Map());
|
|
7064
7086
|
u(this, Mn, (e) => {
|
|
7065
7087
|
if (!e) {
|
|
7066
|
-
a(this, $).setSubtitleTrack(void 0).catch(
|
|
7088
|
+
a(this, $).setSubtitleTrack(void 0).catch(O);
|
|
7067
7089
|
return;
|
|
7068
7090
|
}
|
|
7069
7091
|
const t = a(this, pi).get(Ti(a(this, $).namespace())), i = t == null ? void 0 : t.getTextTrack(e);
|
|
7070
|
-
i && a(this, $).setSubtitleTrack(i).catch(
|
|
7092
|
+
i && a(this, $).setSubtitleTrack(i).catch(O);
|
|
7071
7093
|
});
|
|
7072
7094
|
u(this, ja, (e) => {
|
|
7073
7095
|
switch (e.type) {
|
|
@@ -7090,7 +7112,7 @@ const fd = class fd {
|
|
|
7090
7112
|
Au(new URL("/api/telemetry", a(this, at).url().replace("wss://", "https://")), {
|
|
7091
7113
|
body: e.body,
|
|
7092
7114
|
headers: { "Content-Type": "text/plain" }
|
|
7093
|
-
}).catch(
|
|
7115
|
+
}).catch(O);
|
|
7094
7116
|
break;
|
|
7095
7117
|
case "refresh auth":
|
|
7096
7118
|
a(this, at).updateAuthToken(e.token);
|
|
@@ -7099,9 +7121,9 @@ const fd = class fd {
|
|
|
7099
7121
|
});
|
|
7100
7122
|
u(this, Fn, !1);
|
|
7101
7123
|
r(this, "disconnect", (e = "Disconnect Requested") => {
|
|
7102
|
-
a(this, Se).info("Disconnecting", e), a(this, at).close(), a(this, $).close().catch(
|
|
7124
|
+
a(this, Se).info("Disconnecting", e), a(this, at).close(), a(this, $).close().catch(O), l(this, On, /* @__PURE__ */ new Map()), l(this, hs, "disconnected");
|
|
7103
7125
|
});
|
|
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(
|
|
7126
|
+
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(O), A(this, ke, Vl).call(this).catch(O);
|
|
7105
7127
|
}
|
|
7106
7128
|
get estimatedBandwidth() {
|
|
7107
7129
|
return a(this, lc);
|
|
@@ -7126,7 +7148,7 @@ const fd = class fd {
|
|
|
7126
7148
|
}
|
|
7127
7149
|
static start(e, t, i, n) {
|
|
7128
7150
|
return f(this, null, function* () {
|
|
7129
|
-
var
|
|
7151
|
+
var D, T, U, k;
|
|
7130
7152
|
const o = new Map(
|
|
7131
7153
|
n.connectInfo.channels.map((_) => [
|
|
7132
7154
|
Ti(_.catalog.namespace),
|
|
@@ -7143,7 +7165,7 @@ const fd = class fd {
|
|
|
7143
7165
|
d = Jc(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, c, h), m = Jc(n.edgeUrl.moqWsUrl, c, h);
|
|
7144
7166
|
break;
|
|
7145
7167
|
}
|
|
7146
|
-
const p = (
|
|
7168
|
+
const p = (D = n.connectInfo.channels.find((_) => _.channelId === c.channelId)) == null ? void 0 : D.catalog;
|
|
7147
7169
|
t.debug("Resolved edge url", { edgeUrl: d, edgeWsUrl: m }), Xe(p, "no catalog found");
|
|
7148
7170
|
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({
|
|
7149
7171
|
url: d,
|
|
@@ -7157,12 +7179,13 @@ const fd = class fd {
|
|
|
7157
7179
|
namespace: p.namespace,
|
|
7158
7180
|
catalog: p,
|
|
7159
7181
|
videoTrack: g == null ? void 0 : g.track,
|
|
7160
|
-
audioTrack: w == null ? void 0 : w.track
|
|
7182
|
+
audioTrack: w == null ? void 0 : w.track,
|
|
7183
|
+
burstMs: c.burstMs || 0
|
|
7161
7184
|
}),
|
|
7162
|
-
id(
|
|
7185
|
+
id(BA, new Error("Timeout waiting for player to start")),
|
|
7163
7186
|
Rm(b.closed(), "Session closed before player started")
|
|
7164
|
-
]),
|
|
7165
|
-
o.set(Ti(p.namespace),
|
|
7187
|
+
]), P = new Kc(S.catalog());
|
|
7188
|
+
o.set(Ti(p.namespace), P), e.emit("received signal", {
|
|
7166
7189
|
type: "client ip",
|
|
7167
7190
|
ip: S.connectionInfo().ip
|
|
7168
7191
|
}), S.drm().then((_) => {
|
|
@@ -7170,8 +7193,8 @@ const fd = class fd {
|
|
|
7170
7193
|
}).catch((_) => {
|
|
7171
7194
|
t.error("Error getting DRM data", _);
|
|
7172
7195
|
});
|
|
7173
|
-
const
|
|
7174
|
-
return c.textTrack && a(k =
|
|
7196
|
+
const B = new fd(e, t, b, S, o, i);
|
|
7197
|
+
return c.textTrack && a(k = B, Mn).call(k, c.textTrack), B;
|
|
7175
7198
|
});
|
|
7176
7199
|
}
|
|
7177
7200
|
getState() {
|
|
@@ -7288,21 +7311,21 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7288
7311
|
let i = "", n = "", o;
|
|
7289
7312
|
const c = a(this, $).videoTrack() === void 0;
|
|
7290
7313
|
try {
|
|
7291
|
-
for (var w = Y(t), b, S,
|
|
7292
|
-
const
|
|
7293
|
-
const
|
|
7314
|
+
for (var w = Y(t), b, S, P; b = !(S = yield w.next()).done; b = !1) {
|
|
7315
|
+
const B = S.value;
|
|
7316
|
+
const D = Ti(B.track.namespace), T = B.track.trackObject.language, U = om((h = B.track.trackObject.codec) != null ? h : ""), k = B.track.trackObject.codec, _ = U ? Pi({ codec: U, codecString: k }) : void 0, ce = !!B.track.trackObject["com.vindral.drm"];
|
|
7294
7317
|
try {
|
|
7295
|
-
for (var d = Y(
|
|
7318
|
+
for (var d = Y(B), m, p, g; m = !(p = yield d.next()).done; m = !1) {
|
|
7296
7319
|
const [Me, Z] = p.value;
|
|
7297
7320
|
const Ct = {
|
|
7298
|
-
channelId: i !== "" && (c || Z.mediaType() === "video") && i !==
|
|
7321
|
+
channelId: i !== "" && (c || Z.mediaType() === "video") && i !== D ? D : void 0,
|
|
7299
7322
|
language: Z.mediaType() === "audio" && n !== T ? T : void 0,
|
|
7300
7323
|
drmTransition: o !== void 0 && o !== ce
|
|
7301
7324
|
};
|
|
7302
|
-
i =
|
|
7303
|
-
const y = Z.producerReferenceTime(), E = a(this, On).get(
|
|
7325
|
+
i = D, n = T, o = ce;
|
|
7326
|
+
const y = Z.producerReferenceTime(), E = a(this, On).get(B.track.namespace) || 0;
|
|
7304
7327
|
if (y && Date.now() - E > 1e3) {
|
|
7305
|
-
a(this, On).set(
|
|
7328
|
+
a(this, On).set(B.track.namespace, Date.now());
|
|
7306
7329
|
const L = e.wallclock() - y.getTime();
|
|
7307
7330
|
a(this, Se).debug("timing-info", {
|
|
7308
7331
|
mediaType: Z.mediaType(),
|
|
@@ -7314,7 +7337,7 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7314
7337
|
}), a(this, me).emit("received signal", {
|
|
7315
7338
|
type: "timing info",
|
|
7316
7339
|
timingInfo: {
|
|
7317
|
-
channelId:
|
|
7340
|
+
channelId: D,
|
|
7318
7341
|
timestamp: Z.baseMediaDecodeTime() / Z.timescale() * 1e3 + L,
|
|
7319
7342
|
wallclockTime: y.getTime()
|
|
7320
7343
|
}
|
|
@@ -7322,13 +7345,13 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7322
7345
|
}
|
|
7323
7346
|
a(this, me).emit("received moq data", {
|
|
7324
7347
|
payload: Z,
|
|
7325
|
-
channelId:
|
|
7348
|
+
channelId: D,
|
|
7326
7349
|
groupId: Me,
|
|
7327
7350
|
mimeType: _,
|
|
7328
7351
|
codec: U,
|
|
7329
7352
|
switchInfo: Ct,
|
|
7330
7353
|
// FIXME: We should replace this with something better than hashing the track name
|
|
7331
|
-
renditionId:
|
|
7354
|
+
renditionId: RA(B.track.trackObject.name)
|
|
7332
7355
|
});
|
|
7333
7356
|
}
|
|
7334
7357
|
} catch (p) {
|
|
@@ -7343,19 +7366,19 @@ me = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), hs = new WeakMap(),
|
|
|
7343
7366
|
}
|
|
7344
7367
|
}
|
|
7345
7368
|
} catch (S) {
|
|
7346
|
-
|
|
7369
|
+
P = [S];
|
|
7347
7370
|
} finally {
|
|
7348
7371
|
try {
|
|
7349
7372
|
b && (S = w.return) && (yield S.call(w));
|
|
7350
7373
|
} finally {
|
|
7351
|
-
if (
|
|
7352
|
-
throw
|
|
7374
|
+
if (P)
|
|
7375
|
+
throw P[0];
|
|
7353
7376
|
}
|
|
7354
7377
|
}
|
|
7355
7378
|
});
|
|
7356
7379
|
};
|
|
7357
7380
|
let Lh = fd;
|
|
7358
|
-
function
|
|
7381
|
+
function RA(s) {
|
|
7359
7382
|
return s.split("").reduce(
|
|
7360
7383
|
(t, i) => t = i.charCodeAt(0) + (t << 6) + (t << 16) - t,
|
|
7361
7384
|
0
|
|
@@ -7401,11 +7424,11 @@ jt = new WeakMap(), ds = new WeakMap(), mc = new WeakSet(), jl = function() {
|
|
|
7401
7424
|
const [e, t] = a(this, jt).value();
|
|
7402
7425
|
return cm(e);
|
|
7403
7426
|
};
|
|
7404
|
-
const
|
|
7427
|
+
const UA = (s, e) => {
|
|
7405
7428
|
const t = new URL("/subscribe", s);
|
|
7406
7429
|
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();
|
|
7407
7430
|
};
|
|
7408
|
-
class
|
|
7431
|
+
class PA extends yi {
|
|
7409
7432
|
constructor(t, i) {
|
|
7410
7433
|
super();
|
|
7411
7434
|
r(this, "options");
|
|
@@ -7445,7 +7468,7 @@ class RA extends yi {
|
|
|
7445
7468
|
var n;
|
|
7446
7469
|
let i = !1;
|
|
7447
7470
|
return (n = this.websockets) == null || n.forEach((o) => {
|
|
7448
|
-
o.onmessage =
|
|
7471
|
+
o.onmessage = O, o.removeEventListener("error", this.onError), o.removeEventListener("close", this.onClose), o.removeEventListener("open", this.onOpen), o.close(1e3, t), i = !0;
|
|
7449
7472
|
}), this.websockets = [], this.shouldContinueConnecting = !1, this._isConnectInProgress = !1, this.logger.info("Closed websocket", { reason: t }), i;
|
|
7450
7473
|
});
|
|
7451
7474
|
r(this, "suspend", () => {
|
|
@@ -7458,7 +7481,7 @@ class RA extends yi {
|
|
|
7458
7481
|
this.websockets.length !== 0 && this.options.onMessage(t, i.data);
|
|
7459
7482
|
});
|
|
7460
7483
|
r(this, "onError", () => {
|
|
7461
|
-
this.logger.info("On error", v({}, this.options)), this.close("one websocket had an error"), this.emit("error", new
|
|
7484
|
+
this.logger.info("On error", v({}, this.options)), this.close("one websocket had an error"), this.emit("error", new x("WebSocket error", { code: "websocket_error", isFatal: !1 }));
|
|
7462
7485
|
});
|
|
7463
7486
|
r(this, "onClose", (t) => {
|
|
7464
7487
|
switch (this.logger.info("Closed", F(v({}, this.options), {
|
|
@@ -7516,9 +7539,9 @@ class RA extends yi {
|
|
|
7516
7539
|
}
|
|
7517
7540
|
return !0;
|
|
7518
7541
|
} catch (i) {
|
|
7519
|
-
return this._isConnectInProgress = !1, i instanceof
|
|
7542
|
+
return this._isConnectInProgress = !1, i instanceof x && (this.logger.error("Failed to connect", i.toStringifiable()), i.isFatal()) || this.shouldContinueConnecting && (this.logger.info("Connection aborted", { error: i }), this.emit(
|
|
7520
7543
|
"error",
|
|
7521
|
-
new
|
|
7544
|
+
new x("Failed to connect", {
|
|
7522
7545
|
code: "failed_to_connect",
|
|
7523
7546
|
isFatal: !1,
|
|
7524
7547
|
source: i,
|
|
@@ -7542,7 +7565,7 @@ class RA extends yi {
|
|
|
7542
7565
|
return this._connectTime;
|
|
7543
7566
|
}
|
|
7544
7567
|
}
|
|
7545
|
-
const
|
|
7568
|
+
const xA = 65536 * 8, LA = 0.9, eh = (s) => xA * LA * 1e3 / s, dt = class dt {
|
|
7546
7569
|
constructor(e, t, i) {
|
|
7547
7570
|
r(this, "emitter");
|
|
7548
7571
|
r(this, "transport");
|
|
@@ -7621,7 +7644,7 @@ const UA = 65536 * 8, PA = 0.9, eh = (s) => UA * PA * 1e3 / s, dt = class dt {
|
|
|
7621
7644
|
), n = this.config.options.get("media") === "audio+video";
|
|
7622
7645
|
let o = 1;
|
|
7623
7646
|
n && (o = i !== !1 ? 2 : 1);
|
|
7624
|
-
const c =
|
|
7647
|
+
const c = UA(this.config.edgeUrl, {
|
|
7625
7648
|
video: t.video,
|
|
7626
7649
|
audio: t.audio,
|
|
7627
7650
|
burstMs: t.burstMs,
|
|
@@ -7655,7 +7678,7 @@ const UA = 65536 * 8, PA = 0.9, eh = (s) => UA * PA * 1e3 / s, dt = class dt {
|
|
|
7655
7678
|
}
|
|
7656
7679
|
});
|
|
7657
7680
|
r(this, "connectWebSocketTransport", () => {
|
|
7658
|
-
const e = new
|
|
7681
|
+
const e = new PA(
|
|
7659
7682
|
{
|
|
7660
7683
|
reconnectDelay: 1e3,
|
|
7661
7684
|
onMessage: this.onMessage,
|
|
@@ -7704,7 +7727,7 @@ const UA = 65536 * 8, PA = 0.9, eh = (s) => UA * PA * 1e3 / s, dt = class dt {
|
|
|
7704
7727
|
type: "ping"
|
|
7705
7728
|
});
|
|
7706
7729
|
});
|
|
7707
|
-
this._estimatedPingBandwidth = eh(i.estimatedRtt), this.logger = t, this.emitter = e, this.config = i, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(
|
|
7730
|
+
this._estimatedPingBandwidth = eh(i.estimatedRtt), this.logger = t, this.emitter = e, this.config = i, this.emitter.on("send signal", this.sendSignal), this.emitter.on("disconnect", this.close), this.emitter.on("reconnect", this.reconnect), this.disconnected.promise.catch(O), this.transport = this.connectWebSocketTransport();
|
|
7708
7731
|
}
|
|
7709
7732
|
get rtt() {
|
|
7710
7733
|
return this.rtts.items().length > 0 ? Xn(this.rtts.items()) : 0;
|
|
@@ -7722,7 +7745,7 @@ r(dt, "PING_INTERVAL", 5e3), r(dt, "MAX_MISSED_PINGS", 4), r(dt, "TLS_ROUNDTRIPS
|
|
|
7722
7745
|
}));
|
|
7723
7746
|
let Oh = dt;
|
|
7724
7747
|
var _n, gi, Nn;
|
|
7725
|
-
class
|
|
7748
|
+
class DA {
|
|
7726
7749
|
constructor(e) {
|
|
7727
7750
|
u(this, _n);
|
|
7728
7751
|
u(this, gi, []);
|
|
@@ -7862,7 +7885,7 @@ const Vs = class Vs {
|
|
|
7862
7885
|
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() {
|
|
7863
7886
|
return f(this, null, function* () {
|
|
7864
7887
|
var t;
|
|
7865
|
-
const e = new
|
|
7888
|
+
const e = new DA({ edgeUrl: this.config.options.get("edgeUrl") });
|
|
7866
7889
|
for (l(this, Wt, 0); ; ) {
|
|
7867
7890
|
Ze(this, Wt)._++;
|
|
7868
7891
|
try {
|
|
@@ -7871,7 +7894,7 @@ vt = new WeakMap(), Vn = new WeakMap(), Wt = new WeakMap(), Gn = new WeakMap(),
|
|
|
7871
7894
|
break;
|
|
7872
7895
|
const h = e.select(n.edges);
|
|
7873
7896
|
if (!h)
|
|
7874
|
-
throw new
|
|
7897
|
+
throw new x("Failed to resolve edge url", { isFatal: !0, code: "failed_to_resolve_edge_url" });
|
|
7875
7898
|
wu(n) ? this.connectionImpl = yield Lh.start(this.emitter, this.logger, this.apiClient, F(v({}, this.config), {
|
|
7876
7899
|
connectInfo: n,
|
|
7877
7900
|
estimatedRtt: c,
|
|
@@ -7887,7 +7910,7 @@ vt = new WeakMap(), Vn = new WeakMap(), Wt = new WeakMap(), Gn = new WeakMap(),
|
|
|
7887
7910
|
o && this.emitter.emit("telemetry event", {
|
|
7888
7911
|
code: "shifted_edge",
|
|
7889
7912
|
edgeUrl: typeof o == "string" ? o : o.moqUrl || o.moqWsUrl
|
|
7890
|
-
}), n instanceof
|
|
7913
|
+
}), n instanceof x ? this.emitter.emit("error", n) : n instanceof Error && this.emitter.emit("error", new x(n.message, { code: "start_failed", isFatal: !1 }));
|
|
7891
7914
|
}
|
|
7892
7915
|
if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !a(this, vt))
|
|
7893
7916
|
break;
|
|
@@ -7911,7 +7934,7 @@ const th = () => ({
|
|
|
7911
7934
|
audio: {
|
|
7912
7935
|
bitRate: bi()
|
|
7913
7936
|
}
|
|
7914
|
-
}),
|
|
7937
|
+
}), OA = () => ({
|
|
7915
7938
|
width: window.innerWidth,
|
|
7916
7939
|
height: window.innerHeight,
|
|
7917
7940
|
bitRate: bi()
|
|
@@ -7969,7 +7992,7 @@ const th = () => ({
|
|
|
7969
7992
|
});
|
|
7970
7993
|
r(this, "evaluateConstraintCap", () => {
|
|
7971
7994
|
var c, h, d, m, p;
|
|
7972
|
-
const e = this.sizeBasedResolutionCapEnabled ? F(v({}, th()), { video:
|
|
7995
|
+
const e = this.sizeBasedResolutionCapEnabled ? F(v({}, th()), { video: OA() }) : th();
|
|
7973
7996
|
if (!this.resizeObserver) {
|
|
7974
7997
|
const g = this.element.getBoundingClientRect();
|
|
7975
7998
|
this.elementSize = { width: g.width, height: g.height };
|
|
@@ -8007,7 +8030,7 @@ const th = () => ({
|
|
|
8007
8030
|
};
|
|
8008
8031
|
r(Gs, "CHECK_SIZE_INTERVAL", 1e3), r(Gs, "create", (e, t, i, n) => new Gs(e, t, i, n));
|
|
8009
8032
|
let Fh = Gs;
|
|
8010
|
-
const
|
|
8033
|
+
const MA = 5, FA = 100, _A = 1e3;
|
|
8011
8034
|
class ad {
|
|
8012
8035
|
constructor(e, t, i, n) {
|
|
8013
8036
|
r(this, "timers", Ae.create());
|
|
@@ -8017,7 +8040,7 @@ class ad {
|
|
|
8017
8040
|
r(this, "playbackSource");
|
|
8018
8041
|
r(this, "isSuspended", !1);
|
|
8019
8042
|
r(this, "load", () => {
|
|
8020
|
-
this.timers.setInterval(this.emitDecodedFrames,
|
|
8043
|
+
this.timers.setInterval(this.emitDecodedFrames, FA), this.timers.setInterval(this.emitDecodeRate, _A), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
|
|
8021
8044
|
});
|
|
8022
8045
|
r(this, "unload", () => {
|
|
8023
8046
|
this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
|
|
@@ -8051,7 +8074,7 @@ class ad {
|
|
|
8051
8074
|
var i;
|
|
8052
8075
|
const t = (i = this.trackContexts.get(e.type)) == null ? void 0 : i.decoderContext;
|
|
8053
8076
|
if (!t)
|
|
8054
|
-
throw new
|
|
8077
|
+
throw new x("No known decoder context", {
|
|
8055
8078
|
code: "no_known_decoder_context",
|
|
8056
8079
|
isFatal: !1
|
|
8057
8080
|
});
|
|
@@ -8060,7 +8083,7 @@ class ad {
|
|
|
8060
8083
|
r(this, "decode", (e) => {
|
|
8061
8084
|
const t = this.trackContexts.get(e.type);
|
|
8062
8085
|
if (!t)
|
|
8063
|
-
throw new
|
|
8086
|
+
throw new x("No known decoder context", {
|
|
8064
8087
|
code: "no_known_decoder_context",
|
|
8065
8088
|
isFatal: !1
|
|
8066
8089
|
});
|
|
@@ -8068,7 +8091,7 @@ class ad {
|
|
|
8068
8091
|
return;
|
|
8069
8092
|
t.sampleDuration = e.duration / e.timescale * 1e3;
|
|
8070
8093
|
const { decoderContext: i, buffer: n } = t, o = e.timestamp / e.timescale * 1e3, c = e.duration / e.timescale * 1e3, h = n[n.length - 1];
|
|
8071
|
-
!h || o -
|
|
8094
|
+
!h || o - MA > h.end ? n.push({ start: o, end: o + c }) : o + c * 5 < h.end ? t.buffer = [{ start: o, end: o + c }] : h.end = o + c, i.enqueue(e), this.emitDecodedFrames();
|
|
8072
8095
|
});
|
|
8073
8096
|
r(this, "emitDecodedFrames", () => {
|
|
8074
8097
|
let e;
|
|
@@ -8117,7 +8140,7 @@ class ad {
|
|
|
8117
8140
|
for (const h of i)
|
|
8118
8141
|
switch (h.type) {
|
|
8119
8142
|
case "audio": {
|
|
8120
|
-
const { OpusDecoderContext: d } = yield import("./
|
|
8143
|
+
const { OpusDecoderContext: d } = yield import("./CvGvecAa.js");
|
|
8121
8144
|
c.set(h.type, {
|
|
8122
8145
|
buffer: [],
|
|
8123
8146
|
decoderContext: yield d.create(48e3, 2),
|
|
@@ -8128,7 +8151,7 @@ class ad {
|
|
|
8128
8151
|
break;
|
|
8129
8152
|
}
|
|
8130
8153
|
case "video": {
|
|
8131
|
-
const { H264DecoderWorkerContext: d } = yield import("./
|
|
8154
|
+
const { H264DecoderWorkerContext: d } = yield import("./D7wWmFR2.js");
|
|
8132
8155
|
c.set(h.type, {
|
|
8133
8156
|
buffer: [],
|
|
8134
8157
|
decoderContext: yield d.create(o),
|
|
@@ -8195,12 +8218,12 @@ const Ac = class Ac {
|
|
|
8195
8218
|
};
|
|
8196
8219
|
r(Ac, "create", (e) => new Ac(e));
|
|
8197
8220
|
let _h = Ac;
|
|
8198
|
-
const
|
|
8221
|
+
const NA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, $t = class $t {
|
|
8199
8222
|
constructor(e, t, i) {
|
|
8200
8223
|
r(this, "logger");
|
|
8201
8224
|
r(this, "emitter");
|
|
8202
8225
|
r(this, "waitingEvents", []);
|
|
8203
|
-
r(this, "isTriggered",
|
|
8226
|
+
r(this, "isTriggered", NA($t.EVENT_TIMEOUT));
|
|
8204
8227
|
r(this, "timeSource");
|
|
8205
8228
|
r(this, "timers", new Ae());
|
|
8206
8229
|
r(this, "load", () => {
|
|
@@ -8295,11 +8318,11 @@ const qe = class qe {
|
|
|
8295
8318
|
};
|
|
8296
8319
|
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));
|
|
8297
8320
|
let Vh = qe;
|
|
8298
|
-
const
|
|
8321
|
+
const VA = () => window.AudioContext || window.webkitAudioContext, wc = class wc extends yi {
|
|
8299
8322
|
constructor() {
|
|
8300
8323
|
super();
|
|
8301
8324
|
// TODO: Checkout what happens when limit is reached
|
|
8302
|
-
r(this, "context", new (
|
|
8325
|
+
r(this, "context", new (VA())());
|
|
8303
8326
|
r(this, "timers", Ae.create());
|
|
8304
8327
|
r(this, "previousCurrentTime", 0);
|
|
8305
8328
|
r(this, "_isStuck", !1);
|
|
@@ -8315,7 +8338,7 @@ const _A = () => window.AudioContext || window.webkitAudioContext, wc = class wc
|
|
|
8315
8338
|
try {
|
|
8316
8339
|
return yield Promise.race([this.context.resume(), id(1e3, Km())]);
|
|
8317
8340
|
} catch (t) {
|
|
8318
|
-
throw this.suspend().catch(
|
|
8341
|
+
throw this.suspend().catch(O), t;
|
|
8319
8342
|
}
|
|
8320
8343
|
}));
|
|
8321
8344
|
r(this, "suspend", () => f(this, null, function* () {
|
|
@@ -8389,7 +8412,7 @@ const bc = class bc extends yi {
|
|
|
8389
8412
|
});
|
|
8390
8413
|
r(this, "flush", () => {
|
|
8391
8414
|
if (!this.audio || !this.gainNode)
|
|
8392
|
-
throw new
|
|
8415
|
+
throw new x("AudioContext must be initialized to flush", {
|
|
8393
8416
|
isFatal: !1,
|
|
8394
8417
|
code: "audiocontext_must_be_initialized"
|
|
8395
8418
|
});
|
|
@@ -8458,7 +8481,7 @@ const bc = class bc extends yi {
|
|
|
8458
8481
|
return (t = this.audio) == null || t.unload(), this.audio = new Gh(), this.audio.on("state", (o) => {
|
|
8459
8482
|
this.logger.info("AudioContext state change", { state: o }), o === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", o);
|
|
8460
8483
|
}), this.audio.on("stuck", () => {
|
|
8461
|
-
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(
|
|
8484
|
+
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(O), this.emit("stuck"));
|
|
8462
8485
|
}), (i = this.gainNode) == null || i.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
|
|
8463
8486
|
});
|
|
8464
8487
|
r(this, "setGain", (t) => {
|
|
@@ -8558,10 +8581,10 @@ const Ii = (s, e) => {
|
|
|
8558
8581
|
for (t = e; s > 1; s--) t += e;
|
|
8559
8582
|
return t;
|
|
8560
8583
|
};
|
|
8561
|
-
class
|
|
8584
|
+
class GA {
|
|
8562
8585
|
constructor() {
|
|
8563
8586
|
r(this, "audio");
|
|
8564
|
-
r(this, "unmute", () => this.audio.play().catch(
|
|
8587
|
+
r(this, "unmute", () => this.audio.play().catch(O));
|
|
8565
8588
|
const e = document.createElement("div");
|
|
8566
8589
|
e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
8567
8590
|
const t = e.children.item(0);
|
|
@@ -8572,7 +8595,7 @@ class NA {
|
|
|
8572
8595
|
}
|
|
8573
8596
|
}
|
|
8574
8597
|
var Wa, St, fe, us, Qe, Hl, Us, Xl;
|
|
8575
|
-
class
|
|
8598
|
+
class jA {
|
|
8576
8599
|
constructor() {
|
|
8577
8600
|
u(this, Qe);
|
|
8578
8601
|
u(this, Wa, []);
|
|
@@ -8637,7 +8660,7 @@ Wa = new WeakMap(), St = new WeakMap(), fe = new WeakMap(), us = new WeakMap(),
|
|
|
8637
8660
|
}
|
|
8638
8661
|
return i;
|
|
8639
8662
|
};
|
|
8640
|
-
const
|
|
8663
|
+
const WA = `
|
|
8641
8664
|
precision mediump float;
|
|
8642
8665
|
uniform sampler2D texture;
|
|
8643
8666
|
|
|
@@ -8649,7 +8672,7 @@ void main() {
|
|
|
8649
8672
|
|
|
8650
8673
|
gl_FragColor = vec4(y, y, y, a);
|
|
8651
8674
|
}
|
|
8652
|
-
`,
|
|
8675
|
+
`, zA = `
|
|
8653
8676
|
attribute vec2 position;
|
|
8654
8677
|
varying vec2 texture_coordinate;
|
|
8655
8678
|
uniform mat4 model;
|
|
@@ -8661,7 +8684,7 @@ void main() {
|
|
|
8661
8684
|
`, zd = (s, e) => {
|
|
8662
8685
|
let t = s.getContext("webgl", e);
|
|
8663
8686
|
if (t || (t = s.getContext("experimental-webgl", e)), !t)
|
|
8664
|
-
throw new
|
|
8687
|
+
throw new x("Failed to create webgl context", {
|
|
8665
8688
|
isFatal: !0,
|
|
8666
8689
|
code: "failed_to_create_web_gl_context"
|
|
8667
8690
|
});
|
|
@@ -8669,10 +8692,10 @@ void main() {
|
|
|
8669
8692
|
}, Ps = (s, e, t) => {
|
|
8670
8693
|
const i = s.createShader(e);
|
|
8671
8694
|
if (!i)
|
|
8672
|
-
throw new
|
|
8695
|
+
throw new x("Failed to create shader", { isFatal: !0, code: "failed_to_create_shader" });
|
|
8673
8696
|
if (s.shaderSource(i, t), s.compileShader(i), !s.getShaderParameter(i, s.COMPILE_STATUS)) {
|
|
8674
8697
|
const n = s.getShaderInfoLog(i);
|
|
8675
|
-
throw new
|
|
8698
|
+
throw new x(`Failed to compile shader: ${n != null ? n : ""}`, {
|
|
8676
8699
|
isFatal: !0,
|
|
8677
8700
|
code: "failed_to_compile_shader"
|
|
8678
8701
|
});
|
|
@@ -8681,7 +8704,7 @@ void main() {
|
|
|
8681
8704
|
}, Ui = (s) => {
|
|
8682
8705
|
const e = s.createTexture();
|
|
8683
8706
|
if (!e)
|
|
8684
|
-
throw new
|
|
8707
|
+
throw new x("Failed to create texture", {
|
|
8685
8708
|
isFatal: !0,
|
|
8686
8709
|
code: "failed_to_create_texture"
|
|
8687
8710
|
});
|
|
@@ -8689,7 +8712,7 @@ void main() {
|
|
|
8689
8712
|
}, Hd = (s, e) => {
|
|
8690
8713
|
const t = s.createBuffer();
|
|
8691
8714
|
if (!t)
|
|
8692
|
-
throw new
|
|
8715
|
+
throw new x("Failed to create buffer", {
|
|
8693
8716
|
isFatal: !0,
|
|
8694
8717
|
code: "failed_to_create_buffer"
|
|
8695
8718
|
});
|
|
@@ -8697,13 +8720,13 @@ void main() {
|
|
|
8697
8720
|
}, jh = (s, e, t) => {
|
|
8698
8721
|
const i = s.createProgram();
|
|
8699
8722
|
if (!i)
|
|
8700
|
-
throw new
|
|
8723
|
+
throw new x("Failed to create program", {
|
|
8701
8724
|
isFatal: !0,
|
|
8702
8725
|
code: "failed_to_create_program"
|
|
8703
8726
|
});
|
|
8704
8727
|
if (s.attachShader(i, t), s.attachShader(i, e), s.linkProgram(i), !s.getProgramParameter(i, s.LINK_STATUS)) {
|
|
8705
8728
|
const n = s.getShaderInfoLog(i);
|
|
8706
|
-
throw new
|
|
8729
|
+
throw new x(`Failed to link program: ${n != null ? n : ""}`, {
|
|
8707
8730
|
isFatal: !0,
|
|
8708
8731
|
code: "failed_to_link_program"
|
|
8709
8732
|
});
|
|
@@ -8711,7 +8734,7 @@ void main() {
|
|
|
8711
8734
|
return i;
|
|
8712
8735
|
};
|
|
8713
8736
|
var yc, V, za, Ha, Xa, wi, Hn, Ql, Zl, vc;
|
|
8714
|
-
class
|
|
8737
|
+
class HA {
|
|
8715
8738
|
constructor(e) {
|
|
8716
8739
|
u(this, Hn);
|
|
8717
8740
|
u(this, yc, 96);
|
|
@@ -8720,7 +8743,7 @@ class WA {
|
|
|
8720
8743
|
u(this, Ha);
|
|
8721
8744
|
u(this, Xa);
|
|
8722
8745
|
u(this, wi);
|
|
8723
|
-
r(this, "subtitleRenderer", new
|
|
8746
|
+
r(this, "subtitleRenderer", new jA());
|
|
8724
8747
|
// prettier-ignore
|
|
8725
8748
|
u(this, vc, (e, t, i, n) => [
|
|
8726
8749
|
e,
|
|
@@ -8740,7 +8763,7 @@ class WA {
|
|
|
8740
8763
|
0,
|
|
8741
8764
|
1
|
|
8742
8765
|
]);
|
|
8743
|
-
l(this, V, e), l(this, za, Ui(e)), l(this, Ha, Ps(e, e.FRAGMENT_SHADER,
|
|
8766
|
+
l(this, V, e), l(this, za, Ui(e)), l(this, Ha, Ps(e, e.FRAGMENT_SHADER, WA)), l(this, Xa, Ps(e, e.VERTEX_SHADER, zA)), l(this, wi, jh(e, a(this, Xa), a(this, Ha))), this.subtitleRenderer.config.fontSize = "64px";
|
|
8744
8767
|
}
|
|
8745
8768
|
setActiveCues(e, t) {
|
|
8746
8769
|
this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
|
|
@@ -8937,7 +8960,7 @@ void main() {
|
|
|
8937
8960
|
this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.canvas.style.width = "100%", this.canvas.style.position = "relative";
|
|
8938
8961
|
}
|
|
8939
8962
|
getTextRenderer() {
|
|
8940
|
-
return this.textRenderer || (this.textRenderer = new
|
|
8963
|
+
return this.textRenderer || (this.textRenderer = new HA(this.context)), this.textRenderer;
|
|
8941
8964
|
}
|
|
8942
8965
|
};
|
|
8943
8966
|
r(Ir, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
|
|
@@ -9017,7 +9040,7 @@ const Ec = class Ec {
|
|
|
9017
9040
|
r(this, "audioPlayer");
|
|
9018
9041
|
r(this, "videoPlayer");
|
|
9019
9042
|
r(this, "pool");
|
|
9020
|
-
r(this, "unmuter", new
|
|
9043
|
+
r(this, "unmuter", new GA());
|
|
9021
9044
|
r(this, "_isPaused", !1);
|
|
9022
9045
|
r(this, "isDisconnected", !1);
|
|
9023
9046
|
r(this, "timers", new Ae());
|
|
@@ -9082,7 +9105,7 @@ const Ec = class Ec {
|
|
|
9082
9105
|
}
|
|
9083
9106
|
set muted(e) {
|
|
9084
9107
|
const t = this.muted;
|
|
9085
|
-
this.audioPlayer.muted = e, !e && t && this.activateAudioPlayer().catch(
|
|
9108
|
+
this.audioPlayer.muted = e, !e && t && this.activateAudioPlayer().catch(O);
|
|
9086
9109
|
}
|
|
9087
9110
|
get currentTime() {
|
|
9088
9111
|
return this.audioPlayer.currentTime;
|
|
@@ -9200,7 +9223,7 @@ const Tc = class Tc {
|
|
|
9200
9223
|
autoplay: !1,
|
|
9201
9224
|
logger: this.logger.createContext("MediaElement")
|
|
9202
9225
|
}), this.mediaElement.on("volume state", (d) => {
|
|
9203
|
-
this.updateVolumeState(), !d.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(
|
|
9226
|
+
this.updateVolumeState(), !d.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(O), d.isMuted || (this._userProvidedMuted = !1);
|
|
9204
9227
|
}), this.mediaElement.on("media element state", (d) => {
|
|
9205
9228
|
d === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", d);
|
|
9206
9229
|
}), this.audioPlayer = Mo.create(this.logger.createContext("AudioPlayerModule"), n, {
|
|
@@ -9229,7 +9252,7 @@ const Tc = class Tc {
|
|
|
9229
9252
|
}
|
|
9230
9253
|
set muted(e) {
|
|
9231
9254
|
const t = this.muted;
|
|
9232
|
-
this._userProvidedMuted = e, this.mediaElement.muted = e, !e && t && this.activateAudioPlayer().catch(
|
|
9255
|
+
this._userProvidedMuted = e, this.mediaElement.muted = e, !e && t && this.activateAudioPlayer().catch(O);
|
|
9233
9256
|
}
|
|
9234
9257
|
get currentTime() {
|
|
9235
9258
|
return this.audioPlayer.currentTime;
|
|
@@ -9270,8 +9293,8 @@ const Tc = class Tc {
|
|
|
9270
9293
|
};
|
|
9271
9294
|
r(Tc, "create", (e, t, i, n, o) => new Tc(e, t, i, n, o));
|
|
9272
9295
|
let Hh = Tc;
|
|
9273
|
-
const
|
|
9274
|
-
class
|
|
9296
|
+
const XA = () => (s) => ql(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), ql = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), $d = (s) => (e) => e.appendBuffer(s), QA = (s) => (e) => e.changeType(s), ZA = (s) => (e) => s(e);
|
|
9297
|
+
class qA {
|
|
9275
9298
|
constructor(e) {
|
|
9276
9299
|
r(this, "commandQueue", []);
|
|
9277
9300
|
r(this, "sourceBuffer");
|
|
@@ -9289,7 +9312,7 @@ class QA {
|
|
|
9289
9312
|
this.commandQueue.push(o), this.handleQueue();
|
|
9290
9313
|
}));
|
|
9291
9314
|
r(this, "execute", (e) => new Promise((t, i) => {
|
|
9292
|
-
const n = new Es(
|
|
9315
|
+
const n = new Es(ZA(e), t, i);
|
|
9293
9316
|
this.commandQueue.push(n), this.handleQueue();
|
|
9294
9317
|
}));
|
|
9295
9318
|
r(this, "buffered", () => this.sourceBuffer.buffered);
|
|
@@ -9297,7 +9320,7 @@ class QA {
|
|
|
9297
9320
|
e.removeSourceBuffer(this.sourceBuffer);
|
|
9298
9321
|
});
|
|
9299
9322
|
r(this, "changeType", (e) => new Promise((t, i) => {
|
|
9300
|
-
const n = new Es(
|
|
9323
|
+
const n = new Es(QA(e), t, i);
|
|
9301
9324
|
this.commandQueue.push(n), this.handleQueue();
|
|
9302
9325
|
}));
|
|
9303
9326
|
r(this, "removeBuffer", (e, t) => new Promise((i, n) => {
|
|
@@ -9305,7 +9328,7 @@ class QA {
|
|
|
9305
9328
|
this.commandQueue.push(o), this.handleQueue();
|
|
9306
9329
|
}));
|
|
9307
9330
|
r(this, "flush", () => new Promise((e, t) => {
|
|
9308
|
-
const i = new Es(
|
|
9331
|
+
const i = new Es(XA, e, t);
|
|
9309
9332
|
this.commandQueue.push(i), this.handleQueue();
|
|
9310
9333
|
}));
|
|
9311
9334
|
this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
|
|
@@ -9343,7 +9366,7 @@ class $l extends yi {
|
|
|
9343
9366
|
});
|
|
9344
9367
|
r(this, "addSourceBuffer", (t) => {
|
|
9345
9368
|
const i = this.mediaSource.addSourceBuffer(t);
|
|
9346
|
-
return new
|
|
9369
|
+
return new qA(i);
|
|
9347
9370
|
});
|
|
9348
9371
|
r(this, "removeSourceBuffer", (t) => {
|
|
9349
9372
|
t.removeFromMediaSource(this.mediaSource);
|
|
@@ -9387,7 +9410,7 @@ class Yl {
|
|
|
9387
9410
|
});
|
|
9388
9411
|
}
|
|
9389
9412
|
}
|
|
9390
|
-
function
|
|
9413
|
+
function $A(s, { mediaSource: e, mimeType: t, codec: i }) {
|
|
9391
9414
|
return F(v({}, s), {
|
|
9392
9415
|
state: "initialized",
|
|
9393
9416
|
mimeType: t,
|
|
@@ -9488,7 +9511,7 @@ const Ic = class Ic {
|
|
|
9488
9511
|
let n = this.trackContexts.get(i.type);
|
|
9489
9512
|
n || (n = Yd({ pendingSamples: [], initSegments: new Yl() }), this.trackContexts.set(i.type, n)), n.state === "initialized" ? i.mimeType !== n.mimeType && (yield n.sourceBuffer.changeType(i.mimeType)) : this.trackContexts.set(
|
|
9490
9513
|
i.type,
|
|
9491
|
-
|
|
9514
|
+
$A(n, {
|
|
9492
9515
|
mimeType: i.mimeType,
|
|
9493
9516
|
mediaSource: this.mediaSource,
|
|
9494
9517
|
codec: i.codec
|
|
@@ -9584,7 +9607,7 @@ const Ic = class Ic {
|
|
|
9584
9607
|
if (!S)
|
|
9585
9608
|
throw qa(c);
|
|
9586
9609
|
S.state === "initialized" && t && (S.mimeType = t, S.initSegments.set(n, o, d));
|
|
9587
|
-
const
|
|
9610
|
+
const P = {
|
|
9588
9611
|
fragmented: !0,
|
|
9589
9612
|
type: c,
|
|
9590
9613
|
data: h,
|
|
@@ -9599,7 +9622,7 @@ const Ic = class Ic {
|
|
|
9599
9622
|
fragment: e,
|
|
9600
9623
|
compositionTimeOffset: b
|
|
9601
9624
|
};
|
|
9602
|
-
this.onCodedSample(
|
|
9625
|
+
this.onCodedSample(P);
|
|
9603
9626
|
});
|
|
9604
9627
|
r(this, "onCodedSample", (e) => {
|
|
9605
9628
|
if (e.duration === 0)
|
|
@@ -9613,7 +9636,7 @@ const Ic = class Ic {
|
|
|
9613
9636
|
const i = v({}, e);
|
|
9614
9637
|
"fragment" in i ? (i.fragment = i.fragment.clone(), i.fragment.updateBaseMediaDecodeTime(0), i.data = i.fragment.rawBytes()) : i.timestamp = 0, t.pendingSamples.push(i);
|
|
9615
9638
|
}
|
|
9616
|
-
t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples ||
|
|
9639
|
+
t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || YA(t, this.append, this.maxChunkSize).catch((i) => {
|
|
9617
9640
|
if (t.isWorkingOnPendingSamples = !1, i instanceof Error) {
|
|
9618
9641
|
if (this.logger.error("append failed", { message: i.message, name: i.name }), i instanceof DOMException && i.code === DOMException.QUOTA_EXCEEDED_ERR) {
|
|
9619
9642
|
if (t.consecutiveQuotaExceededErrorCount >= this.minConsecutiveErrorsBeforeEmit) {
|
|
@@ -9641,7 +9664,7 @@ const Ic = class Ic {
|
|
|
9641
9664
|
const n = !this.mediaElement.paused, o = [];
|
|
9642
9665
|
this.trackContexts.forEach((c, h) => {
|
|
9643
9666
|
c.state === "initialized" && o.push({ type: h, mimeType: c.mimeType, codec: c.codec });
|
|
9644
|
-
}), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = o, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), n && this.mediaElement.play().catch(
|
|
9667
|
+
}), this.sourceOpenStartTime = Date.now(), this.pendingTracksToAddSourceBuffers = o, this.mediaElement.src = "", this.setTrackContexts(this.trackContexts), this.mediaSource.attach(this.mediaElement), n && this.mediaElement.play().catch(O);
|
|
9645
9668
|
}
|
|
9646
9669
|
}
|
|
9647
9670
|
this.logger.debug("source ended");
|
|
@@ -9659,7 +9682,7 @@ const Jd = (s, e) => {
|
|
|
9659
9682
|
const t = s.renditionId !== e.renditionId, i = s.channelId !== e.channelId, n = ((h = s.timestamp) != null ? h : 0) > e.timestamp, o = s.type === "video" && e.type === "video" && "levelIdc" in s && "levelIdc" in e && s.levelIdc !== e.levelIdc;
|
|
9660
9683
|
let c = !1;
|
|
9661
9684
|
return s.type === "video" && e.type === "video" && "width" in s && "width" in e && (c = e.width !== s.width || e.height !== s.height), i || t || n || c || o;
|
|
9662
|
-
},
|
|
9685
|
+
}, YA = (s, e, t) => f(null, null, function* () {
|
|
9663
9686
|
for (s.isWorkingOnPendingSamples = !0; s.pendingSamples.length > 0; ) {
|
|
9664
9687
|
const i = [];
|
|
9665
9688
|
let n = 0;
|
|
@@ -9772,7 +9795,7 @@ const qh = () => ({
|
|
|
9772
9795
|
bufferingRanges: [],
|
|
9773
9796
|
activeRanges: [],
|
|
9774
9797
|
decodeRate: Number.MAX_SAFE_INTEGER
|
|
9775
|
-
}),
|
|
9798
|
+
}), JA = () => ({
|
|
9776
9799
|
levels: {},
|
|
9777
9800
|
levelDowngrades: [],
|
|
9778
9801
|
levelUpgrades: [],
|
|
@@ -9784,7 +9807,7 @@ const qh = () => ({
|
|
|
9784
9807
|
r(this, "logger");
|
|
9785
9808
|
r(this, "emitter");
|
|
9786
9809
|
r(this, "timers", Ae.create());
|
|
9787
|
-
r(this, "metrics",
|
|
9810
|
+
r(this, "metrics", JA());
|
|
9788
9811
|
r(this, "bufferFullness", new pe(30));
|
|
9789
9812
|
r(this, "bufferFullnessRegression");
|
|
9790
9813
|
r(this, "currentLevel");
|
|
@@ -9854,8 +9877,8 @@ const qh = () => ({
|
|
|
9854
9877
|
const t = this.timeSpentBuffering(), i = this.timeActive(), n = this.bufferingRatios(), o = this.activeRatios(), c = ((m = (d = e.video) == null ? void 0 : d.bitRate) != null ? m : 0) + ((g = (p = e.audio) == null ? void 0 : p.bitRate) != null ? g : 0), h = t / i;
|
|
9855
9878
|
return Object.keys(this.metrics.levels).map((w) => parseInt(w, 10)).filter((w) => w >= c).reduce(
|
|
9856
9879
|
(w, b) => {
|
|
9857
|
-
var S,
|
|
9858
|
-
return ((S = o.get(b.toString())) != null ? S : 0) - ((
|
|
9880
|
+
var S, P;
|
|
9881
|
+
return ((S = o.get(b.toString())) != null ? S : 0) - ((P = n.get(b.toString())) != null ? P : 0) * h + w;
|
|
9859
9882
|
},
|
|
9860
9883
|
0
|
|
9861
9884
|
);
|
|
@@ -9869,12 +9892,12 @@ const qh = () => ({
|
|
|
9869
9892
|
fatalQosCount: this.fatalQosCount
|
|
9870
9893
|
}));
|
|
9871
9894
|
r(this, "onRenditionLevelChanged", (e) => {
|
|
9872
|
-
var o, c, h, d, m, p, g, w, b, S,
|
|
9873
|
-
const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (m = (d = e.from) == null ? void 0 : d.audio) == null ? void 0 : m.bitRate) != null ? p : 0), i = ((b = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? b : 0) + ((
|
|
9895
|
+
var o, c, h, d, m, p, g, w, b, S, P, B, D, T;
|
|
9896
|
+
const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (m = (d = e.from) == null ? void 0 : d.audio) == null ? void 0 : m.bitRate) != null ? p : 0), i = ((b = (w = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : w.bitRate) != null ? b : 0) + ((B = (P = (S = e.to) == null ? void 0 : S.audio) == null ? void 0 : P.bitRate) != null ? B : 0);
|
|
9874
9897
|
this.logger.info("rendition level changed", { fromLevel: t, toLevel: i }), this.metrics.general.activeRanges.length === 0 && this.setActive(), e.from && e.to && (t < i ? this.metrics.general.upgradesFromLevel.push(Date.now()) : this.metrics.general.downgradesFromLevel.push(Date.now()));
|
|
9875
9898
|
let n = !1;
|
|
9876
9899
|
if (e.from) {
|
|
9877
|
-
const U = (
|
|
9900
|
+
const U = (D = this.metrics.levels[t]) != null ? D : qh();
|
|
9878
9901
|
t < i ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), Ci(U.activeRanges);
|
|
9879
9902
|
const k = U.bufferingRanges[U.bufferingRanges.length - 1];
|
|
9880
9903
|
n = !!k && !k.end, Ci(U.bufferingRanges), this.metrics.levels[t] = U;
|
|
@@ -10047,7 +10070,7 @@ const Rc = class Rc {
|
|
|
10047
10070
|
};
|
|
10048
10071
|
r(Rc, "create", (e, t) => new Rc(e, t));
|
|
10049
10072
|
let Yh = Rc;
|
|
10050
|
-
const Yn = (s) => JSON.parse(JSON.stringify(s)),
|
|
10073
|
+
const Yn = (s) => JSON.parse(JSON.stringify(s)), KA = 1e4, Uc = class Uc {
|
|
10051
10074
|
constructor(e, t, i) {
|
|
10052
10075
|
r(this, "logger");
|
|
10053
10076
|
r(this, "timers", new Ae());
|
|
@@ -10108,7 +10131,7 @@ const Yn = (s) => JSON.parse(JSON.stringify(s)), YA = 1e4, Uc = class Uc {
|
|
|
10108
10131
|
const e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, i = e !== t;
|
|
10109
10132
|
this._isSwitchingSubscription && (i && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), i && this.timers.setTimeout(() => {
|
|
10110
10133
|
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = Yn(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
|
|
10111
|
-
},
|
|
10134
|
+
}, KA), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
|
|
10112
10135
|
() => this.emitter.emit("send signal", {
|
|
10113
10136
|
type: "subscribe",
|
|
10114
10137
|
subscription: this.getTargetSubscription()
|
|
@@ -10121,7 +10144,7 @@ const Yn = (s) => JSON.parse(JSON.stringify(s)), YA = 1e4, Uc = class Uc {
|
|
|
10121
10144
|
};
|
|
10122
10145
|
r(Uc, "create", (e, t, i) => new Uc(e, i, t));
|
|
10123
10146
|
let Jh = Uc;
|
|
10124
|
-
const Kd = 5e3,
|
|
10147
|
+
const Kd = 5e3, ew = () => vu() || Oc() || Am(), eu = () => ew() ? 100 : 0, tu = (s) => (e) => e > s, Pc = class Pc {
|
|
10125
10148
|
constructor(e, t, i, n, o) {
|
|
10126
10149
|
r(this, "emitter");
|
|
10127
10150
|
r(this, "logger");
|
|
@@ -10432,7 +10455,7 @@ const Kd = 5e3, JA = () => vu() || Oc() || Am(), eu = () => JA() ? 100 : 0, tu =
|
|
|
10432
10455
|
};
|
|
10433
10456
|
r(Pc, "create", (e, t, i, n, o) => new Pc(e, t, i, n, o));
|
|
10434
10457
|
let Kh = Pc;
|
|
10435
|
-
const
|
|
10458
|
+
const tw = {
|
|
10436
10459
|
enabled: !0,
|
|
10437
10460
|
interval: 3e4,
|
|
10438
10461
|
includeErrors: !0,
|
|
@@ -10510,7 +10533,7 @@ const KA = {
|
|
|
10510
10533
|
r(this, "onError", (e) => this.addError(e.error));
|
|
10511
10534
|
r(this, "addError", (e) => {
|
|
10512
10535
|
const { includeErrors: t, maxErrorReports: i } = this.options;
|
|
10513
|
-
if (t && e instanceof
|
|
10536
|
+
if (t && e instanceof x) {
|
|
10514
10537
|
if (this.errorCount++, this.errorCount > i)
|
|
10515
10538
|
return;
|
|
10516
10539
|
const n = this.parentContext.getStatistics();
|
|
@@ -10519,7 +10542,7 @@ const KA = {
|
|
|
10519
10542
|
);
|
|
10520
10543
|
}
|
|
10521
10544
|
});
|
|
10522
|
-
this.logger = e, this.emitter = t, this.options = v(v({},
|
|
10545
|
+
this.logger = e, this.emitter = t, this.options = v(v({}, tw), i), this.parentContext = n;
|
|
10523
10546
|
}
|
|
10524
10547
|
};
|
|
10525
10548
|
r(xc, "create", (e, t, i, n) => new xc(e, t, i, n));
|
|
@@ -10541,11 +10564,11 @@ const Lc = class Lc {
|
|
|
10541
10564
|
};
|
|
10542
10565
|
r(Lc, "create", (e, t, i) => new Lc(e, t, i));
|
|
10543
10566
|
let No = Lc;
|
|
10544
|
-
const
|
|
10567
|
+
const iw = 6, sw = (s) => {
|
|
10545
10568
|
let e = [s], t = 0, i = 0, n = !1;
|
|
10546
10569
|
const o = (h, d) => {
|
|
10547
|
-
var
|
|
10548
|
-
h.flags && rr(h.flags) && (t = (
|
|
10570
|
+
var B, D, T;
|
|
10571
|
+
h.flags && rr(h.flags) && (t = (B = h.compositionTimeOffset) != null ? B : 0), h.timestamp += t, h.compositionTimeOffset = ((D = h.compositionTimeOffset) != null ? D : 0) - t;
|
|
10549
10572
|
const m = h.timestamp / h.timescale, g = d.flags && rr(d.flags) ? (T = d.compositionTimeOffset) != null ? T : 0 : t, b = (d.timestamp + g) / d.timescale, S = Math.max(0, Math.round((b - m) * h.timescale));
|
|
10550
10573
|
return S > 0 && (i = S), F(v({}, h), {
|
|
10551
10574
|
/*
|
|
@@ -10556,7 +10579,7 @@ const ew = 6, tw = (s) => {
|
|
|
10556
10579
|
});
|
|
10557
10580
|
};
|
|
10558
10581
|
return (h, d = !1) => {
|
|
10559
|
-
if (h.flags && rr(h.flags) && d && (n = !n), !(d && e.length <
|
|
10582
|
+
if (h.flags && rr(h.flags) && d && (n = !n), !(d && e.length < iw && n) && e.length > 0) {
|
|
10560
10583
|
n = !1;
|
|
10561
10584
|
let p = h;
|
|
10562
10585
|
for (let w = e.length - 1; w > 0; w--) {
|
|
@@ -10572,7 +10595,7 @@ const ew = 6, tw = (s) => {
|
|
|
10572
10595
|
}
|
|
10573
10596
|
return e.push(h), [];
|
|
10574
10597
|
};
|
|
10575
|
-
},
|
|
10598
|
+
}, nw = (s, e, t) => {
|
|
10576
10599
|
if (fs(e))
|
|
10577
10600
|
return v(F(v({}, s), {
|
|
10578
10601
|
type: "video",
|
|
@@ -10596,7 +10619,7 @@ const ew = 6, tw = (s) => {
|
|
|
10596
10619
|
duration: 0
|
|
10597
10620
|
});
|
|
10598
10621
|
};
|
|
10599
|
-
class
|
|
10622
|
+
class rw {
|
|
10600
10623
|
constructor() {
|
|
10601
10624
|
r(this, "highEntropyValues");
|
|
10602
10625
|
var e;
|
|
@@ -10618,20 +10641,20 @@ class sw {
|
|
|
10618
10641
|
w.sort((T, U) => T.brand.localeCompare(U.brand));
|
|
10619
10642
|
const b = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
|
|
10620
10643
|
b.sort((T, U) => T.brand.localeCompare(U.brand));
|
|
10621
|
-
const S = b.map((T) => T.version),
|
|
10644
|
+
const S = b.map((T) => T.version), P = w.map((T) => T.brand), B = w.map((T) => T.version), D = parseInt((m = (d = this.highEntropyValues.platformVersion) == null ? void 0 : d.split(".")[0]) != null ? m : "1");
|
|
10622
10645
|
return v({
|
|
10623
10646
|
userAgentLegacy: window.navigator.userAgent,
|
|
10624
10647
|
ua: {
|
|
10625
10648
|
browser: {
|
|
10626
|
-
brands:
|
|
10649
|
+
brands: P,
|
|
10627
10650
|
fullVersionBrands: S,
|
|
10628
|
-
majorVersions:
|
|
10651
|
+
majorVersions: B
|
|
10629
10652
|
},
|
|
10630
10653
|
device: this.highEntropyValues.model || "Other",
|
|
10631
10654
|
os: {
|
|
10632
10655
|
family: this.highEntropyValues.platform || "Other",
|
|
10633
10656
|
version: (p = this.highEntropyValues.platformVersion) != null ? p : "1",
|
|
10634
|
-
major_version: Number.isFinite(
|
|
10657
|
+
major_version: Number.isFinite(D) ? D : 0
|
|
10635
10658
|
}
|
|
10636
10659
|
}
|
|
10637
10660
|
}, n);
|
|
@@ -10641,7 +10664,7 @@ class sw {
|
|
|
10641
10664
|
}, n);
|
|
10642
10665
|
}
|
|
10643
10666
|
}
|
|
10644
|
-
const
|
|
10667
|
+
const aw = (s) => {
|
|
10645
10668
|
if (typeof s != "object" || s === null)
|
|
10646
10669
|
throw new Error("not an object");
|
|
10647
10670
|
if (!("video" in s))
|
|
@@ -10678,7 +10701,7 @@ const Ge = class Ge extends yi {
|
|
|
10678
10701
|
r(this, "latestEmittedLanguages", []);
|
|
10679
10702
|
r(this, "wakeLock");
|
|
10680
10703
|
r(this, "pool", new yd(Ge.MAX_POOL_SIZE));
|
|
10681
|
-
r(this, "userAgentInformation", new
|
|
10704
|
+
r(this, "userAgentInformation", new rw());
|
|
10682
10705
|
r(this, "encryptedMediaExtensions");
|
|
10683
10706
|
u(this, ls, 0);
|
|
10684
10707
|
u(this, Oe, []);
|
|
@@ -10830,8 +10853,8 @@ const Ge = class Ge extends yi {
|
|
|
10830
10853
|
if (!fs(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
|
|
10831
10854
|
return !1;
|
|
10832
10855
|
if (!this.willUseMediaSource()) {
|
|
10833
|
-
const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER,
|
|
10834
|
-
return h.bitRate <= S && h.width <=
|
|
10856
|
+
const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, P = (g = b.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER, B = (w = b.wasmDecodingConstraint.height) != null ? w : Number.MAX_SAFE_INTEGER;
|
|
10857
|
+
return h.bitRate <= S && h.width <= P && h.height <= B;
|
|
10835
10858
|
}
|
|
10836
10859
|
const d = yield hg(h);
|
|
10837
10860
|
if (!d.supported || h.codec == "av1" && !d.smooth && !d.powerEfficient)
|
|
@@ -10859,7 +10882,7 @@ const Ge = class Ge extends yi {
|
|
|
10859
10882
|
Ge.INITIAL_MAX_BIT_RATE,
|
|
10860
10883
|
i,
|
|
10861
10884
|
this.targetSubscription.audio.bitRate
|
|
10862
|
-
), c = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), h = this.supportedAudioCodecs(), d = t.renditions.filter(ps), m = t.renditions.filter(fs), p = h.find((S) => d.find((
|
|
10885
|
+
), c = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), h = this.supportedAudioCodecs(), d = t.renditions.filter(ps), m = t.renditions.filter(fs), p = h.find((S) => d.find((P) => P.codec === S) !== void 0), g = c.find((S) => m.find((P) => P.codec === S) !== void 0), w = d.map((S) => S.language);
|
|
10863
10886
|
if (this.logger.debug("supported and selected codecs", { audioCodecs: h, videoCodecs: c, audioCodec: p, videoCodec: g }), g) {
|
|
10864
10887
|
const S = this.options.get("maxSize");
|
|
10865
10888
|
this.modules.subscription.setVideoConstraint(v({
|
|
@@ -10899,7 +10922,7 @@ const Ge = class Ge extends yi {
|
|
|
10899
10922
|
var n, o;
|
|
10900
10923
|
const t = this.currentRenditionLevel, i = [];
|
|
10901
10924
|
if (!t)
|
|
10902
|
-
throw new
|
|
10925
|
+
throw new x("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
|
|
10903
10926
|
if (t != null && t.video && i.push({
|
|
10904
10927
|
type: "video",
|
|
10905
10928
|
mimeType: Pi(t.video),
|
|
@@ -10909,7 +10932,7 @@ const Ge = class Ge extends yi {
|
|
|
10909
10932
|
codec: t.audio.codec,
|
|
10910
10933
|
mimeType: Pi(t.audio)
|
|
10911
10934
|
}), i.length === 0)
|
|
10912
|
-
throw new
|
|
10935
|
+
throw new x("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
|
|
10913
10936
|
if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
|
|
10914
10937
|
this.emitter.emit("flush buffers"), yield (n = this.modules.mseModule) == null ? void 0 : n.setSourceBuffers(i);
|
|
10915
10938
|
else {
|
|
@@ -10997,7 +11020,7 @@ const Ge = class Ge extends yi {
|
|
|
10997
11020
|
const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
|
|
10998
11021
|
return v({
|
|
10999
11022
|
uptime: Date.now() - this.createdAt,
|
|
11000
|
-
version: "4.1.2-
|
|
11023
|
+
version: "4.1.2-7-gc4e751c6",
|
|
11001
11024
|
clientId: this.clientId,
|
|
11002
11025
|
sessionId: this.sessionId,
|
|
11003
11026
|
channelId: this.channelId,
|
|
@@ -11077,17 +11100,17 @@ const Ge = class Ge extends yi {
|
|
|
11077
11100
|
this.encryptedMediaExtensions.queryParams = y;
|
|
11078
11101
|
}
|
|
11079
11102
|
};
|
|
11080
|
-
const b = _h.create(this.emitter), S = this.options.get("poster"),
|
|
11081
|
-
let
|
|
11103
|
+
const b = _h.create(this.emitter), S = this.options.get("poster"), P = S === !0 ? this.getThumbnailUrl() : S || void 0;
|
|
11104
|
+
let B, D, T;
|
|
11082
11105
|
if (this.willUseMediaSource()) {
|
|
11083
11106
|
const y = new fh({
|
|
11084
11107
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11085
11108
|
autoplay: !1,
|
|
11086
11109
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11087
11110
|
logger: this.logger.createContext("MediaElement"),
|
|
11088
|
-
poster:
|
|
11111
|
+
poster: P
|
|
11089
11112
|
});
|
|
11090
|
-
y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, xd.isSupported() && this.encryptedMediaExtensions.attach(y.element),
|
|
11113
|
+
y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, xd.isSupported() && this.encryptedMediaExtensions.attach(y.element), B = Xh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = No.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
|
|
11091
11114
|
} else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
|
|
11092
11115
|
const y = Hh.create(
|
|
11093
11116
|
this.emitter,
|
|
@@ -11097,10 +11120,10 @@ const Ge = class Ge extends yi {
|
|
|
11097
11120
|
{
|
|
11098
11121
|
type: this.options.get("media") == "audio" ? "audio" : "video",
|
|
11099
11122
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11100
|
-
poster:
|
|
11123
|
+
poster: P
|
|
11101
11124
|
}
|
|
11102
11125
|
), E = y.element();
|
|
11103
|
-
this.element = E.element, this.playbackSource = y, T = y, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (
|
|
11126
|
+
this.element = E.element, this.playbackSource = y, T = y, this.options.get("pictureInPictureEnabled") && this.browser.platform.iosVersion > 15 && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (D = No.create(this.logger.createContext("UnpauseModule"), E, b));
|
|
11104
11127
|
} else {
|
|
11105
11128
|
const y = zh.create(
|
|
11106
11129
|
this.emitter,
|
|
@@ -11176,8 +11199,8 @@ const Ge = class Ge extends yi {
|
|
|
11176
11199
|
subscription: m,
|
|
11177
11200
|
renditions: p,
|
|
11178
11201
|
qualityOfService: g,
|
|
11179
|
-
mseModule:
|
|
11180
|
-
unpause:
|
|
11202
|
+
mseModule: B,
|
|
11203
|
+
unpause: D,
|
|
11181
11204
|
canvasModule: T
|
|
11182
11205
|
}, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (y) => {
|
|
11183
11206
|
var E;
|
|
@@ -11210,8 +11233,8 @@ const Ge = class Ge extends yi {
|
|
|
11210
11233
|
}), this.emitter.on("recovered from media error", () => {
|
|
11211
11234
|
this.modules.adaptivity.reset(this.targetBufferTime * 2);
|
|
11212
11235
|
}), this.emitter.once("connect info", (y) => {
|
|
11213
|
-
var W,
|
|
11214
|
-
const L = ((
|
|
11236
|
+
var W, M, N;
|
|
11237
|
+
const L = ((M = (W = y.telemetry) == null ? void 0 : W.probability) != null ? M : 1) >= Math.random();
|
|
11215
11238
|
y.telemetry && ((N = this.modules.telemetry) == null || N.unload(), this.modules.telemetry = _o.create(
|
|
11216
11239
|
this.logger.createContext("TelemetryModule"),
|
|
11217
11240
|
this.emitter,
|
|
@@ -11223,12 +11246,12 @@ const Ge = class Ge extends yi {
|
|
|
11223
11246
|
}), this.emitter.on("adapt level", (y) => {
|
|
11224
11247
|
var Fe, Q, he, _e, Be;
|
|
11225
11248
|
this.logger.debug("adapt level", { direction: y });
|
|
11226
|
-
const E = this.modules.renditions.getRenditionLevels(), L = this.modules.renditions.getRenditionLevel(), W = E.findIndex((J) => J === L),
|
|
11249
|
+
const E = this.modules.renditions.getRenditionLevels(), L = this.modules.renditions.getRenditionLevel(), W = E.findIndex((J) => J === L), M = E.length - 1;
|
|
11227
11250
|
let N = W;
|
|
11228
11251
|
switch (y) {
|
|
11229
11252
|
case "upgrade":
|
|
11230
11253
|
{
|
|
11231
|
-
const J = Math.min(W + 1,
|
|
11254
|
+
const J = Math.min(W + 1, M), 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;
|
|
11232
11255
|
ct && em && this.modules.adaptivity.isQoSOk(ct) && (N = J);
|
|
11233
11256
|
}
|
|
11234
11257
|
break;
|
|
@@ -11255,11 +11278,11 @@ const Ge = class Ge extends yi {
|
|
|
11255
11278
|
audio: v(v({}, this.targetSubscription.audio), te == null ? void 0 : te.audio)
|
|
11256
11279
|
})), this.emitter.emit("adapted level");
|
|
11257
11280
|
}), this.emitter.on("text track data", (y) => {
|
|
11258
|
-
const E = a(this, Oe).find((N) => N.language === y.language), W = this.modules.sync.getTimeshiftOffset() / 1e3,
|
|
11281
|
+
const E = a(this, Oe).find((N) => N.language === y.language), W = this.modules.sync.getTimeshiftOffset() / 1e3, M = W - a(this, ls);
|
|
11259
11282
|
if (l(this, ls, W), E) {
|
|
11260
11283
|
if (E.cues)
|
|
11261
11284
|
for (const N of E.cues)
|
|
11262
|
-
N.startTime -=
|
|
11285
|
+
N.startTime -= M, N.endTime -= M;
|
|
11263
11286
|
for (const N of y.cues) {
|
|
11264
11287
|
const te = new VTTCue(N.startTime - W, N.endTime - W, N.text);
|
|
11265
11288
|
E.addCue(te);
|
|
@@ -11273,9 +11296,9 @@ const Ge = class Ge extends yi {
|
|
|
11273
11296
|
this.clientIp = E.ip;
|
|
11274
11297
|
break;
|
|
11275
11298
|
case "renditions":
|
|
11276
|
-
this.updateTextTracks(E.renditions), l(this, ms, this.filterRenditions(E.renditions).then((
|
|
11299
|
+
this.updateTextTracks(E.renditions), l(this, ms, this.filterRenditions(E.renditions).then((M) => {
|
|
11277
11300
|
this.emitter.emit("renditions", {
|
|
11278
|
-
renditions:
|
|
11301
|
+
renditions: M,
|
|
11279
11302
|
channelId: this.currentSubscription.channelId
|
|
11280
11303
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
|
|
11281
11304
|
}).finally(() => {
|
|
@@ -11284,12 +11307,12 @@ const Ge = class Ge extends yi {
|
|
|
11284
11307
|
break;
|
|
11285
11308
|
case "subscription changed":
|
|
11286
11309
|
try {
|
|
11287
|
-
|
|
11288
|
-
} catch (
|
|
11310
|
+
aw(E.subscription);
|
|
11311
|
+
} catch (M) {
|
|
11289
11312
|
this.emitter.emit(
|
|
11290
11313
|
"error",
|
|
11291
|
-
new
|
|
11292
|
-
source:
|
|
11314
|
+
new x("Subscription failed validation", {
|
|
11315
|
+
source: M instanceof Error ? M : void 0,
|
|
11293
11316
|
isFatal: !1,
|
|
11294
11317
|
code: "subscription_failed_validation"
|
|
11295
11318
|
})
|
|
@@ -11316,16 +11339,16 @@ const Ge = class Ge extends yi {
|
|
|
11316
11339
|
Ct(F(v({}, L), { channelId: E.channelId }));
|
|
11317
11340
|
}), this.emitter.on("received moq data", (y) => {
|
|
11318
11341
|
var N, te, Fe;
|
|
11319
|
-
const E = y.payload.mediaType(), L = y.channelId, W = y.renditionId,
|
|
11342
|
+
const E = y.payload.mediaType(), L = y.channelId, W = y.renditionId, M = this.modules.sync.processFragment(L, y.payload);
|
|
11320
11343
|
if (y.switchInfo.channelId && (y.switchInfo.drmTransition && this.emitter.emit("error", Bu("Switching between DRM and non-DRM channels is not supported", !0)), this.encryptedMediaExtensions.onChannelSwitch(), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.modules.event.addEvent({
|
|
11321
11344
|
type: "channel switch",
|
|
11322
11345
|
channelId: y.switchInfo.channelId,
|
|
11323
|
-
timestamp:
|
|
11346
|
+
timestamp: M.baseMediaDecodeTime() / M.timescale() * 1e3
|
|
11324
11347
|
})), y.switchInfo.language && this.modules.event.addEvent({
|
|
11325
11348
|
type: "language switch",
|
|
11326
11349
|
language: y.switchInfo.language,
|
|
11327
|
-
timestamp:
|
|
11328
|
-
}), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength),
|
|
11350
|
+
timestamp: M.baseMediaDecodeTime() / M.timescale() * 1e3
|
|
11351
|
+
}), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength), M.fragment().emsgs.forEach((Q) => {
|
|
11329
11352
|
if (!Q.presentationTime)
|
|
11330
11353
|
return;
|
|
11331
11354
|
const he = Bf(Q.data);
|
|
@@ -11336,7 +11359,7 @@ const Ge = class Ge extends yi {
|
|
|
11336
11359
|
type: "metadata"
|
|
11337
11360
|
});
|
|
11338
11361
|
}), this.modules.decoder) {
|
|
11339
|
-
const Q = (N =
|
|
11362
|
+
const Q = (N = M.header().init().moov.traks[0]) == null ? void 0 : N.mdia.minf.stbl.stsd, he = (te = Q == null ? void 0 : Q.avc1) == null ? void 0 : te.avcC.bytes, _e = (Fe = Q == null ? void 0 : Q.codec) != null ? Fe : "h264";
|
|
11340
11363
|
if (he) {
|
|
11341
11364
|
const Be = he.buffer.slice(he.byteOffset, he.byteOffset + he.byteLength);
|
|
11342
11365
|
if (E === "text")
|
|
@@ -11354,8 +11377,8 @@ const Ge = class Ge extends yi {
|
|
|
11354
11377
|
// mediaType !== mimeType - but the sw decoder doesn't care
|
|
11355
11378
|
});
|
|
11356
11379
|
}
|
|
11357
|
-
for (let Be = 0; Be <
|
|
11358
|
-
const J =
|
|
11380
|
+
for (let Be = 0; Be < M.samplesCount(); Be++) {
|
|
11381
|
+
const J = M.sample(Be);
|
|
11359
11382
|
J && this.emitter.emit("coded sample", F(v({}, J), {
|
|
11360
11383
|
renditionId: W,
|
|
11361
11384
|
channelId: L,
|
|
@@ -11363,7 +11386,7 @@ const Ge = class Ge extends yi {
|
|
|
11363
11386
|
}));
|
|
11364
11387
|
}
|
|
11365
11388
|
} else
|
|
11366
|
-
this.emitter.emit("fragment", { mimeType: y.mimeType, codec: y.codec, fragment:
|
|
11389
|
+
this.emitter.emit("fragment", { mimeType: y.mimeType, codec: y.codec, fragment: M, channelId: L, renditionId: W });
|
|
11367
11390
|
});
|
|
11368
11391
|
const It = this.options.get("container");
|
|
11369
11392
|
It && this.attach(It), this.logger.info("Created Vindral instance", { options: this.options });
|
|
@@ -11373,9 +11396,9 @@ const Ge = class Ge extends yi {
|
|
|
11373
11396
|
const L = this.modules.renditions.getRendition(y.renditionId, E);
|
|
11374
11397
|
if (!Jp(y.flags)) {
|
|
11375
11398
|
if (Kp(y.flags)) {
|
|
11376
|
-
const
|
|
11399
|
+
const M = new TextDecoder().decode(y.payload), N = this.modules.sync.getTimeshiftOffset();
|
|
11377
11400
|
if (y.renditionId !== 0) {
|
|
11378
|
-
const te = um(
|
|
11401
|
+
const te = um(M);
|
|
11379
11402
|
if (te && te.language !== void 0) {
|
|
11380
11403
|
const Q = new zu().parse(te.content || ""), he = N / 1e3, _e = a(this, Oe).find((J) => J.language === te.language), Be = he - a(this, ls);
|
|
11381
11404
|
if (l(this, ls, he), _e) {
|
|
@@ -11391,7 +11414,7 @@ const Ge = class Ge extends yi {
|
|
|
11391
11414
|
} else
|
|
11392
11415
|
this.modules.event.addEvent({
|
|
11393
11416
|
timestamp: y.timestamp / y.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
|
|
11394
|
-
content:
|
|
11417
|
+
content: M,
|
|
11395
11418
|
type: "metadata"
|
|
11396
11419
|
});
|
|
11397
11420
|
} else if (L != null && L.codec) {
|
|
@@ -11399,29 +11422,29 @@ const Ge = class Ge extends yi {
|
|
|
11399
11422
|
if (W === "text")
|
|
11400
11423
|
throw new Error("Subtitles are not supported");
|
|
11401
11424
|
if (this.modules.incomingData.add(W, y.payload.byteLength), Yp(y.flags)) {
|
|
11402
|
-
const
|
|
11425
|
+
const M = F(v({
|
|
11403
11426
|
type: W,
|
|
11404
11427
|
data: y.payload,
|
|
11405
11428
|
codec: L.codec
|
|
11406
11429
|
}, y), {
|
|
11407
11430
|
channelId: E
|
|
11408
|
-
}), N = Hp(
|
|
11409
|
-
N && this.sizes.set(
|
|
11431
|
+
}), N = Hp(M.codec, M.payload);
|
|
11432
|
+
N && this.sizes.set(M.renditionId, N);
|
|
11410
11433
|
const te = Pi({ codec: L.codec, codecString: L.codecString });
|
|
11411
|
-
this.emitter.emit("init segment", { initSegment:
|
|
11434
|
+
this.emitter.emit("init segment", { initSegment: M, mimeType: te }), this.emit("initialized media");
|
|
11412
11435
|
} else {
|
|
11413
|
-
const
|
|
11436
|
+
const M = nw(y, L, this.sizes.get(y.renditionId));
|
|
11414
11437
|
let N = this.sampleProcessingSesssions.get(W);
|
|
11415
11438
|
if (!N)
|
|
11416
|
-
N =
|
|
11417
|
-
this.modules.sync.processSample(
|
|
11439
|
+
N = sw(
|
|
11440
|
+
this.modules.sync.processSample(M)
|
|
11418
11441
|
), this.sampleProcessingSesssions.set(W, N);
|
|
11419
11442
|
else {
|
|
11420
11443
|
const te = N(
|
|
11421
|
-
this.modules.sync.processSample(
|
|
11422
|
-
this.isSwitchingRenditionLevel &&
|
|
11444
|
+
this.modules.sync.processSample(M),
|
|
11445
|
+
this.isSwitchingRenditionLevel && M.type === "video"
|
|
11423
11446
|
);
|
|
11424
|
-
let Fe =
|
|
11447
|
+
let Fe = M;
|
|
11425
11448
|
te.forEach((Q) => {
|
|
11426
11449
|
this.modules.event.extractEvent(Q, Fe), this.emitter.emit("coded sample", Q), Fe = Q;
|
|
11427
11450
|
});
|
|
@@ -11847,13 +11870,13 @@ export {
|
|
|
11847
11870
|
ge as L,
|
|
11848
11871
|
Mm as N,
|
|
11849
11872
|
iu as V,
|
|
11850
|
-
|
|
11873
|
+
dw as a,
|
|
11851
11874
|
Dm as b,
|
|
11852
11875
|
Lm as c,
|
|
11853
11876
|
$m as d,
|
|
11854
11877
|
Om as e,
|
|
11855
11878
|
xm as f,
|
|
11856
|
-
|
|
11879
|
+
x as g,
|
|
11857
11880
|
ym as i,
|
|
11858
|
-
|
|
11881
|
+
O as n
|
|
11859
11882
|
};
|