@vindral/web-sdk 4.0.0-133-g17586385 → 4.0.0-135-gd6e2b91a
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/{DsmoeNN4.js → CreIUsCx.js} +236 -230
- package/{Bi0bT-H9.js → DaDCef1c.js} +1 -1
- package/{DOmtFuG8.js → DgrsXUJ2.js} +1 -1
- package/core.js +1 -1
- package/legacy.es.js +456 -450
- package/legacy.umd.js +7 -7
- package/{CkqhVXGR.js → n62CWM8M.js} +60 -60
- package/package.json +1 -1
- package/player.js +1 -1
|
@@ -22,10 +22,10 @@ var Ja = (i, t) => {
|
|
|
22
22
|
t.indexOf(r) < 0 && Ka.call(i, r) && (e[r] = i[r]);
|
|
23
23
|
return e;
|
|
24
24
|
};
|
|
25
|
-
var
|
|
25
|
+
var me = (i) => {
|
|
26
26
|
var t;
|
|
27
27
|
return [, , , vc((t = i == null ? void 0 : i[St("metadata")]) != null ? t : null)];
|
|
28
|
-
}, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], or = (i) => i !== void 0 && typeof i != "function" ? Rt("Function expected") : i, Tc = (i, t, e, r, n) => ({ kind: Qa[i], name: t, metadata: r, addInitializer: (a) => e._ ? Rt("Already initialized") : n.push(or(a || null)) }), Kt = (i, t) => Mi(t, St("metadata"), i[3]),
|
|
28
|
+
}, Qa = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], or = (i) => i !== void 0 && typeof i != "function" ? Rt("Function expected") : i, Tc = (i, t, e, r, n) => ({ kind: Qa[i], name: t, metadata: r, addInitializer: (a) => e._ ? Rt("Already initialized") : n.push(or(a || null)) }), Kt = (i, t) => Mi(t, St("metadata"), i[3]), ye = (i, t, e, r) => {
|
|
29
29
|
for (var n = 0, a = i[t >> 1], c = a && a.length; n < c; n++) t & 1 ? a[n].call(e) : r = a[n].call(e, r);
|
|
30
30
|
return r;
|
|
31
31
|
}, H = (i, t, e, r, n, a) => {
|
|
@@ -114,7 +114,7 @@ var at = (i, t, e) => {
|
|
|
114
114
|
};
|
|
115
115
|
return a();
|
|
116
116
|
};
|
|
117
|
-
import { D as O, F as Pa, n as T, B as Zn, L as nt, b as Dc, w as Kn, i as et, a as Oc, W as Vc, t as go, m as Cc, f as Bc, g as xc, c as Pc, e as Rc } from "./
|
|
117
|
+
import { D as O, F as Pa, n as T, B as Zn, L as nt, b as Dc, w as Kn, i as et, a as Oc, W as Vc, t as go, m as Cc, f as Bc, g as xc, c as Pc, e as Rc } from "./n62CWM8M.js";
|
|
118
118
|
import { a as ko, p as jc, i as Gc, c as Nc, b as Lc } from "./Bg1SqXxu.js";
|
|
119
119
|
function Ra(i) {
|
|
120
120
|
const t = new Jn(i);
|
|
@@ -224,31 +224,31 @@ class Fc {
|
|
|
224
224
|
Pr = new WeakSet(), da = function() {
|
|
225
225
|
this.unlocker.resolve(this.value);
|
|
226
226
|
};
|
|
227
|
-
var
|
|
227
|
+
var Se, Ue;
|
|
228
228
|
class Wc {
|
|
229
229
|
constructor(t) {
|
|
230
|
-
o(this,
|
|
231
|
-
o(this,
|
|
232
|
-
u(this,
|
|
230
|
+
o(this, Se);
|
|
231
|
+
o(this, Ue, new O());
|
|
232
|
+
u(this, Se, t), s(this, Ue).resolve(t);
|
|
233
233
|
}
|
|
234
234
|
unsafeValue() {
|
|
235
|
-
return s(this,
|
|
235
|
+
return s(this, Se);
|
|
236
236
|
}
|
|
237
237
|
isLocked() {
|
|
238
|
-
return s(this,
|
|
238
|
+
return s(this, Ue).pending;
|
|
239
239
|
}
|
|
240
240
|
lock() {
|
|
241
241
|
return h(this, null, function* () {
|
|
242
242
|
const t = new O();
|
|
243
243
|
t.promise.then((r) => {
|
|
244
|
-
u(this,
|
|
244
|
+
u(this, Se, r);
|
|
245
245
|
}).catch(T);
|
|
246
|
-
const e = s(this,
|
|
247
|
-
return u(this,
|
|
246
|
+
const e = s(this, Ue).promise.then(() => t);
|
|
247
|
+
return u(this, Ue, t), yield e, new Fc(s(this, Se), t);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
Se = new WeakMap(), Ue = new WeakMap();
|
|
252
252
|
var ct, wt;
|
|
253
253
|
class K {
|
|
254
254
|
constructor(t) {
|
|
@@ -332,7 +332,7 @@ function $c(i, t) {
|
|
|
332
332
|
const n = i.decodeData(r);
|
|
333
333
|
return r.readRemaining(), n;
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function we(i) {
|
|
336
336
|
const t = i.readUint8(), e = i.readUint24();
|
|
337
337
|
return {
|
|
338
338
|
version: t,
|
|
@@ -362,7 +362,7 @@ const ns = class ns {
|
|
|
362
362
|
this.timescale = t, this.presentationTime = e, this.presentationTimeDelta = r, this.schemeIdUri = n, this.value = a, this.eventDuration = c, this.id = d, this.data = w;
|
|
363
363
|
}
|
|
364
364
|
static decodeData(t) {
|
|
365
|
-
const { version: e } =
|
|
365
|
+
const { version: e } = we(t);
|
|
366
366
|
switch (e) {
|
|
367
367
|
case 1: {
|
|
368
368
|
const r = t.readUint32(), n = t.readUint64(), a = t.readUint32(), c = t.readUint32(), d = t.readUtf8String(), w = t.readUtf8String(), p = t.remaining(), m = t.readBytes(p);
|
|
@@ -412,7 +412,7 @@ const fr = class fr {
|
|
|
412
412
|
this.extra = t, this.byteOffset = e, this.baseMediaDecodeTime = r;
|
|
413
413
|
}
|
|
414
414
|
static decodeData(t) {
|
|
415
|
-
const e =
|
|
415
|
+
const e = we(t), r = t.byteOffset();
|
|
416
416
|
let n = 0;
|
|
417
417
|
return e.version === 1 ? n = t.readUint64() : n = t.readUint32(), new fr(e, r, n);
|
|
418
418
|
}
|
|
@@ -439,7 +439,7 @@ const C = class C {
|
|
|
439
439
|
return (this.firstSampleFlags & e) === 0;
|
|
440
440
|
}
|
|
441
441
|
static decodeData(t) {
|
|
442
|
-
const { flags: e } =
|
|
442
|
+
const { flags: e } = we(t), r = t.readUint32();
|
|
443
443
|
let n, a;
|
|
444
444
|
e & C.TRUN_DATA_OFFSET && (n = t.readUint32()), e & C.TRUN_FIRST_SAMPLE_FLAGS && (a = t.readUint32());
|
|
445
445
|
const c = new C(r, n, a);
|
|
@@ -516,7 +516,7 @@ const yr = class yr {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
static decodeData(t) {
|
|
519
|
-
|
|
519
|
+
we(t), t.readUint32();
|
|
520
520
|
const e = String.fromCharCode(...t.readBytes(4));
|
|
521
521
|
return new yr(e);
|
|
522
522
|
}
|
|
@@ -533,7 +533,7 @@ const as = class as {
|
|
|
533
533
|
this.creationTime = t, this.modificationTime = e, this.timescale = r, this.duration = n;
|
|
534
534
|
}
|
|
535
535
|
static decodeData(t) {
|
|
536
|
-
const { version: e } =
|
|
536
|
+
const { version: e } = we(t);
|
|
537
537
|
if (e === 1) {
|
|
538
538
|
const d = t.readUint64(), w = t.readUint64(), p = t.readUint32(), m = t.readUint64();
|
|
539
539
|
return new as(d, w, p, m);
|
|
@@ -565,7 +565,7 @@ const gr = class gr {
|
|
|
565
565
|
return (t = this.avc1) == null ? void 0 : t.height;
|
|
566
566
|
}
|
|
567
567
|
static decodeData(t) {
|
|
568
|
-
|
|
568
|
+
we(t);
|
|
569
569
|
const e = t.readUint32();
|
|
570
570
|
let r, n, a, c;
|
|
571
571
|
for (let d = 0; d < e; d++)
|
|
@@ -668,7 +668,7 @@ const Sr = class Sr {
|
|
|
668
668
|
this.modificationTime = t, this.creationTime = e, this.trackId = r, this.duration = n, this.alternateGroup = a, this.volume = c, this.width = d, this.height = w;
|
|
669
669
|
}
|
|
670
670
|
static decodeData(t) {
|
|
671
|
-
const e =
|
|
671
|
+
const e = we(t);
|
|
672
672
|
let r = 0, n = 0;
|
|
673
673
|
e.version === 1 ? (r = t.readUint64(), n = t.readUint64()) : (r = t.readUint32(), n = t.readUint32());
|
|
674
674
|
const a = t.readUint32();
|
|
@@ -836,7 +836,7 @@ const os = class os {
|
|
|
836
836
|
this.ntpTimestamp = t, this.mediaTime = e;
|
|
837
837
|
}
|
|
838
838
|
static decodeData(t) {
|
|
839
|
-
const { version: e } =
|
|
839
|
+
const { version: e } = we(t);
|
|
840
840
|
t.readUint32();
|
|
841
841
|
const r = t.readUint32(), n = t.readUint32();
|
|
842
842
|
if (e === 1) {
|
|
@@ -1029,17 +1029,17 @@ const La = class La {
|
|
|
1029
1029
|
return ((t = s(this, E).moof.traf.trun) == null ? void 0 : t.samplesCount) || 0;
|
|
1030
1030
|
}
|
|
1031
1031
|
sample(t) {
|
|
1032
|
-
var k, x, vt, R, F, S, N, v, P, Yt,
|
|
1032
|
+
var k, x, vt, R, F, S, N, v, P, Yt, fe, q, _n, Wi, pe;
|
|
1033
1033
|
const e = (k = s(this, _).init().moov.traks[0]) == null ? void 0 : k.mdia.minf.stbl.stsd.codec, r = ((x = s(this, E).moof.traf.trun) == null ? void 0 : x.samplesCount) || 0, n = (vt = s(this, E).moof.traf.tfdt) == null ? void 0 : vt.baseMediaDecodeTime;
|
|
1034
1034
|
if (t >= r || typeof n == "undefined" || !e)
|
|
1035
1035
|
return;
|
|
1036
|
-
const a = ((R = s(this, E).moof.traf.trun) == null ? void 0 : R.sampleDurations[t]) || 0, c = ((F = s(this, E).moof.traf.trun) == null ? void 0 : F.sampleDurations.slice(0, t).reduce((
|
|
1036
|
+
const a = ((R = s(this, E).moof.traf.trun) == null ? void 0 : R.sampleDurations[t]) || 0, c = ((F = s(this, E).moof.traf.trun) == null ? void 0 : F.sampleDurations.slice(0, t).reduce((be, Pt) => be + Pt, 0)) || 0, d = n + c, w = ((S = s(this, _).init().moov.traks[0]) == null ? void 0 : S.mdia.mdhd.timescale) || 1e3, p = ((N = s(this, E).moof.traf.trun) == null ? void 0 : N.sampleSizes[t]) || s(this, E).mdat.data.byteLength, m = ((v = s(this, E).moof.traf.trun) == null ? void 0 : v.sampleSizes.slice(0, t).reduce((be, Pt) => be + Pt, 0)) || 0, b = s(this, E).mdat.data.subarray(m, m + p), I = ((P = s(this, E).moof.traf.trun) == null ? void 0 : P.is_sync_sample(t)) || !1;
|
|
1037
1037
|
if (this.mediaType() === "video") {
|
|
1038
|
-
const
|
|
1038
|
+
const be = ((Yt = s(this, _).init().moov.traks[0]) == null ? void 0 : Yt.tkhd.width) || 0, Pt = ((fe = s(this, _).init().moov.traks[0]) == null ? void 0 : fe.tkhd.height) || 0;
|
|
1039
1039
|
return {
|
|
1040
1040
|
type: "video",
|
|
1041
1041
|
codec: e,
|
|
1042
|
-
width:
|
|
1042
|
+
width: be,
|
|
1043
1043
|
height: Pt,
|
|
1044
1044
|
duration: a,
|
|
1045
1045
|
isSync: I,
|
|
@@ -1052,7 +1052,7 @@ const La = class La {
|
|
|
1052
1052
|
type: "audio",
|
|
1053
1053
|
codec: e,
|
|
1054
1054
|
channels: ((_n = (q = s(this, _).init().moov.traks[0]) == null ? void 0 : q.mdia.minf.stbl.stsd.opus) == null ? void 0 : _n.channelCount) || 0,
|
|
1055
|
-
sampleRate: ((
|
|
1055
|
+
sampleRate: ((pe = (Wi = s(this, _).init().moov.traks[0]) == null ? void 0 : Wi.mdia.minf.stbl.stsd.opus) == null ? void 0 : pe.sampleRate) || 0,
|
|
1056
1056
|
duration: a,
|
|
1057
1057
|
isSync: I,
|
|
1058
1058
|
timestamp: d,
|
|
@@ -1340,17 +1340,17 @@ class Qc {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
1342
|
Qt = new WeakMap(), Kr = new WeakMap();
|
|
1343
|
-
var Tt,
|
|
1343
|
+
var Tt, Ee, Te, Ae;
|
|
1344
1344
|
class qc {
|
|
1345
1345
|
constructor(t) {
|
|
1346
1346
|
o(this, Tt);
|
|
1347
|
-
o(this, Ue, null);
|
|
1348
1347
|
o(this, Ee, null);
|
|
1349
1348
|
o(this, Te, null);
|
|
1349
|
+
o(this, Ae, null);
|
|
1350
1350
|
u(this, Tt, t);
|
|
1351
1351
|
}
|
|
1352
1352
|
start(t) {
|
|
1353
|
-
u(this,
|
|
1353
|
+
u(this, Ee, (e) => {
|
|
1354
1354
|
if (typeof e.data == "object" && e.data instanceof ArrayBuffer) {
|
|
1355
1355
|
const r = new Uint8Array(e.data), n = r[0] || 0, a = n & 127, c = (n >> 7 & 1) > 0;
|
|
1356
1356
|
if (a && a !== 0) {
|
|
@@ -1358,27 +1358,27 @@ class qc {
|
|
|
1358
1358
|
t.enqueue([c, a, d]);
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
|
-
}), u(this,
|
|
1361
|
+
}), u(this, Te, () => So(() => t.close())), u(this, Ae, () => t.error(new Error("WebSocket error"))), s(this, Tt).addEventListener("message", s(this, Ee)), s(this, Tt).addEventListener("error", s(this, Ae)), s(this, Tt).addEventListener("close", s(this, Te));
|
|
1362
1362
|
}
|
|
1363
1363
|
cancel(t) {
|
|
1364
|
-
s(this,
|
|
1364
|
+
s(this, Ee) && s(this, Tt).removeEventListener("message", s(this, Ee)), s(this, Ae) && s(this, Tt).removeEventListener("error", s(this, Ae)), s(this, Te) && s(this, Tt).removeEventListener("close", s(this, Te));
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
|
-
Tt = new WeakMap(),
|
|
1368
|
-
var At, Jr,
|
|
1367
|
+
Tt = new WeakMap(), Ee = new WeakMap(), Te = new WeakMap(), Ae = new WeakMap();
|
|
1368
|
+
var At, Jr, De, Dt, An, U, ur, Xi, ke, Yi, Jt;
|
|
1369
1369
|
class gn {
|
|
1370
1370
|
constructor(t, e) {
|
|
1371
1371
|
o(this, U);
|
|
1372
1372
|
o(this, At);
|
|
1373
1373
|
o(this, Jr);
|
|
1374
|
-
o(this,
|
|
1374
|
+
o(this, De);
|
|
1375
1375
|
o(this, Dt, 0);
|
|
1376
1376
|
o(this, An, new TextDecoder());
|
|
1377
|
-
u(this, At, t), u(this, Jr, e), u(this,
|
|
1377
|
+
u(this, At, t), u(this, Jr, e), u(this, De, e.getReader());
|
|
1378
1378
|
}
|
|
1379
1379
|
readUnsigned8() {
|
|
1380
1380
|
return h(this, null, function* () {
|
|
1381
|
-
return yield f(this, U,
|
|
1381
|
+
return yield f(this, U, ke).call(this, 1), f(this, U, Jt).call(this, 1)[0];
|
|
1382
1382
|
});
|
|
1383
1383
|
}
|
|
1384
1384
|
readString() {
|
|
@@ -1397,23 +1397,23 @@ class gn {
|
|
|
1397
1397
|
}
|
|
1398
1398
|
readBigVarInt() {
|
|
1399
1399
|
return h(this, null, function* () {
|
|
1400
|
-
yield f(this, U,
|
|
1400
|
+
yield f(this, U, ke).call(this, 1);
|
|
1401
1401
|
const t = (f(this, U, Yi).call(this, 1)[0] & 192) >> 6;
|
|
1402
1402
|
switch (s(this, At)[s(this, Dt)] = f(this, U, Yi).call(this, 1)[0] & 63, t) {
|
|
1403
1403
|
case 0:
|
|
1404
1404
|
return g(f(this, U, Jt).call(this, 1)[0]);
|
|
1405
1405
|
case 1: {
|
|
1406
|
-
yield f(this, U,
|
|
1406
|
+
yield f(this, U, ke).call(this, 2);
|
|
1407
1407
|
const e = f(this, U, Jt).call(this, 2), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1408
1408
|
return g(r.getUint16(0));
|
|
1409
1409
|
}
|
|
1410
1410
|
case 2: {
|
|
1411
|
-
yield f(this, U,
|
|
1411
|
+
yield f(this, U, ke).call(this, 4);
|
|
1412
1412
|
const e = f(this, U, Jt).call(this, 4), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1413
1413
|
return g(r.getUint32(0));
|
|
1414
1414
|
}
|
|
1415
1415
|
case 3: {
|
|
1416
|
-
yield f(this, U,
|
|
1416
|
+
yield f(this, U, ke).call(this, 8);
|
|
1417
1417
|
const e = f(this, U, Jt).call(this, 8), r = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
1418
1418
|
if (typeof r.getBigUint64 != "undefined")
|
|
1419
1419
|
return g(r.getBigUint64(0));
|
|
@@ -1427,7 +1427,7 @@ class gn {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
read(t) {
|
|
1429
1429
|
return h(this, null, function* () {
|
|
1430
|
-
return yield f(this, U,
|
|
1430
|
+
return yield f(this, U, ke).call(this, t), f(this, U, Jt).call(this, t);
|
|
1431
1431
|
});
|
|
1432
1432
|
}
|
|
1433
1433
|
readAll() {
|
|
@@ -1444,20 +1444,20 @@ class gn {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
closed() {
|
|
1446
1446
|
return h(this, null, function* () {
|
|
1447
|
-
return s(this,
|
|
1447
|
+
return s(this, De).closed;
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
1450
|
close() {
|
|
1451
1451
|
return h(this, null, function* () {
|
|
1452
|
-
return s(this,
|
|
1452
|
+
return s(this, De).releaseLock(), s(this, Jr).cancel();
|
|
1453
1453
|
});
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
At = new WeakMap(), Jr = new WeakMap(),
|
|
1456
|
+
At = new WeakMap(), Jr = new WeakMap(), De = new WeakMap(), Dt = new WeakMap(), An = new WeakMap(), U = new WeakSet(), ur = function() {
|
|
1457
1457
|
return s(this, At).length - s(this, Dt);
|
|
1458
1458
|
}, Xi = function() {
|
|
1459
1459
|
return h(this, null, function* () {
|
|
1460
|
-
const { value: t, done: e } = yield s(this,
|
|
1460
|
+
const { value: t, done: e } = yield s(this, De).read();
|
|
1461
1461
|
if (e)
|
|
1462
1462
|
return Promise.resolve(0);
|
|
1463
1463
|
if (f(this, U, ur).call(this) === 0)
|
|
@@ -1468,7 +1468,7 @@ At = new WeakMap(), Jr = new WeakMap(), Ae = new WeakMap(), Dt = new WeakMap(),
|
|
|
1468
1468
|
}
|
|
1469
1469
|
return u(this, Dt, 0), Promise.resolve(t.length);
|
|
1470
1470
|
});
|
|
1471
|
-
},
|
|
1471
|
+
}, ke = function(t) {
|
|
1472
1472
|
return h(this, null, function* () {
|
|
1473
1473
|
for (; f(this, U, ur).call(this) < t; )
|
|
1474
1474
|
if ((yield f(this, U, Xi).call(this)) === 0)
|
|
@@ -1521,14 +1521,14 @@ Ss = new WeakMap(), Us = new WeakMap(), Nt = new WeakMap(), Dn = new WeakMap();
|
|
|
1521
1521
|
const Vo = {
|
|
1522
1522
|
OPEN: 1
|
|
1523
1523
|
};
|
|
1524
|
-
var tt, st,
|
|
1524
|
+
var tt, st, Oe, On;
|
|
1525
1525
|
const Vr = class Vr {
|
|
1526
1526
|
constructor(t) {
|
|
1527
1527
|
o(this, tt, 0);
|
|
1528
1528
|
o(this, st, new Uint8Array(Vr.DEFAULT_BUFFER_SIZE));
|
|
1529
|
-
o(this,
|
|
1529
|
+
o(this, Oe);
|
|
1530
1530
|
o(this, On, new TextEncoder());
|
|
1531
|
-
u(this,
|
|
1531
|
+
u(this, Oe, t);
|
|
1532
1532
|
}
|
|
1533
1533
|
writeString(t) {
|
|
1534
1534
|
return h(this, null, function* () {
|
|
@@ -1559,15 +1559,15 @@ const Vr = class Vr {
|
|
|
1559
1559
|
return this.ensureBufferSpace(8), u(this, tt, s(this, tt) + Lo(t, s(this, st).subarray(s(this, tt))).byteLength), Promise.resolve();
|
|
1560
1560
|
}
|
|
1561
1561
|
flush() {
|
|
1562
|
-
if (s(this,
|
|
1562
|
+
if (s(this, Oe).readyState !== Vo.OPEN)
|
|
1563
1563
|
throw new Error("Writer is not open");
|
|
1564
|
-
return s(this,
|
|
1564
|
+
return s(this, Oe).send(s(this, st).subarray(0, s(this, tt))), u(this, tt, 0), u(this, st, new Uint8Array(Vr.DEFAULT_BUFFER_SIZE)), Promise.resolve();
|
|
1565
1565
|
}
|
|
1566
1566
|
close() {
|
|
1567
|
-
return s(this,
|
|
1567
|
+
return s(this, Oe).close(), Promise.resolve();
|
|
1568
1568
|
}
|
|
1569
1569
|
};
|
|
1570
|
-
tt = new WeakMap(), st = new WeakMap(),
|
|
1570
|
+
tt = new WeakMap(), st = new WeakMap(), Oe = new WeakMap(), On = new WeakMap(), l(Vr, "DEFAULT_BUFFER_SIZE", 1024);
|
|
1571
1571
|
let Br = Vr;
|
|
1572
1572
|
const Co = Math.pow(2, 6) - 1, Bo = Math.pow(2, 14) - 1, xo = Math.pow(2, 30) - 1, _c = Number.MAX_SAFE_INTEGER, tu = typeof BigInt == "function" ? g(2) ** g(62) - g(1) : g(Number.MAX_SAFE_INTEGER);
|
|
1573
1573
|
function Qn(i, t) {
|
|
@@ -2229,15 +2229,15 @@ class Vu {
|
|
|
2229
2229
|
this.state = t;
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
2232
|
-
var Vs, qt,
|
|
2232
|
+
var Vs, qt, Ve, Bn, Ce, pt;
|
|
2233
2233
|
const us = class us {
|
|
2234
2234
|
constructor(t) {
|
|
2235
2235
|
l(this, "subscribe");
|
|
2236
2236
|
o(this, Vs, new O());
|
|
2237
2237
|
o(this, qt, new O());
|
|
2238
|
-
o(this, Oe, new O());
|
|
2239
|
-
o(this, Bn, Date.now());
|
|
2240
2238
|
o(this, Ve, new O());
|
|
2239
|
+
o(this, Bn, Date.now());
|
|
2240
|
+
o(this, Ce, new O());
|
|
2241
2241
|
o(this, pt);
|
|
2242
2242
|
switch (this.subscribe = t, t.filterType.type) {
|
|
2243
2243
|
case "absolute-start":
|
|
@@ -2259,13 +2259,13 @@ const us = class us {
|
|
|
2259
2259
|
t.finalInfo && (s(this, pt) || u(this, pt, { startGroup: g(0) }), s(this, pt).endGroup = t.finalInfo.group), s(this, qt).resolve(t);
|
|
2260
2260
|
}
|
|
2261
2261
|
onUnsubscribe(t) {
|
|
2262
|
-
s(this,
|
|
2262
|
+
s(this, Ve).resolve(t);
|
|
2263
2263
|
}
|
|
2264
2264
|
onOk(t) {
|
|
2265
2265
|
const e = Math.max(0, Date.now() - s(this, Bn)), r = Number(t.expires);
|
|
2266
2266
|
if (r > 0) {
|
|
2267
2267
|
const n = Math.max(us.minGraceTime, Math.min(r / 10, us.maxGraceTime));
|
|
2268
|
-
Promise.race([Kn(r - n - e), this.done().catch(T)]).then(() => s(this,
|
|
2268
|
+
Promise.race([Kn(r - n - e), this.done().catch(T)]).then(() => s(this, Ce).resolve(this.expiryState())).catch(T);
|
|
2269
2269
|
}
|
|
2270
2270
|
s(this, Vs).resolve(t);
|
|
2271
2271
|
}
|
|
@@ -2279,27 +2279,27 @@ const us = class us {
|
|
|
2279
2279
|
return s(this, pt);
|
|
2280
2280
|
}
|
|
2281
2281
|
close() {
|
|
2282
|
-
s(this,
|
|
2282
|
+
s(this, Ce).promise.catch(T), s(this, Ce).reject(new Error("Subscription closed"));
|
|
2283
2283
|
}
|
|
2284
2284
|
// Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
|
|
2285
2285
|
expiryState() {
|
|
2286
|
-
return s(this, qt).resolved && s(this, qt).resolved.errorCode !== ga.Expired ? "done" : s(this,
|
|
2286
|
+
return s(this, qt).resolved && s(this, qt).resolved.errorCode !== ga.Expired ? "done" : s(this, Ve).pending ? "active" : "unsubscribed";
|
|
2287
2287
|
}
|
|
2288
2288
|
unsubscribed() {
|
|
2289
|
-
return s(this,
|
|
2289
|
+
return s(this, Ve).promise;
|
|
2290
2290
|
}
|
|
2291
2291
|
isUnsubscribed() {
|
|
2292
|
-
return s(this,
|
|
2292
|
+
return s(this, Ve).resolved;
|
|
2293
2293
|
}
|
|
2294
2294
|
/**
|
|
2295
2295
|
* Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
|
|
2296
2296
|
|
|
2297
2297
|
*/
|
|
2298
2298
|
expiryNotification() {
|
|
2299
|
-
return s(this,
|
|
2299
|
+
return s(this, Ce).promise;
|
|
2300
2300
|
}
|
|
2301
2301
|
};
|
|
2302
|
-
Vs = new WeakMap(), qt = new WeakMap(),
|
|
2302
|
+
Vs = new WeakMap(), qt = new WeakMap(), Ve = new WeakMap(), Bn = new WeakMap(), Ce = new WeakMap(), pt = new WeakMap(), l(us, "maxGraceTime", 15e3), l(us, "minGraceTime", 3e3);
|
|
2303
2303
|
let Sn = us;
|
|
2304
2304
|
var M, ei;
|
|
2305
2305
|
class Cu {
|
|
@@ -2400,15 +2400,15 @@ si = new WeakMap(), ut = new WeakMap(), ri = new WeakMap(), ii = new WeakMap(),
|
|
|
2400
2400
|
}
|
|
2401
2401
|
});
|
|
2402
2402
|
};
|
|
2403
|
-
var
|
|
2403
|
+
var Be, ai, Bs, oi, xs;
|
|
2404
2404
|
class xu {
|
|
2405
2405
|
constructor(t, e, r) {
|
|
2406
|
-
o(this,
|
|
2406
|
+
o(this, Be);
|
|
2407
2407
|
o(this, ai);
|
|
2408
2408
|
o(this, Bs);
|
|
2409
2409
|
o(this, oi);
|
|
2410
2410
|
o(this, xs);
|
|
2411
|
-
u(this,
|
|
2411
|
+
u(this, Be, t), u(this, ai, e), u(this, Bs, r), u(this, xs, nt.get().createContext(`GroupSubscriptionWriter:${r.subscribe.name}`));
|
|
2412
2412
|
}
|
|
2413
2413
|
finalGroup() {
|
|
2414
2414
|
return s(this, oi);
|
|
@@ -2419,7 +2419,7 @@ class xu {
|
|
|
2419
2419
|
try {
|
|
2420
2420
|
for (var t = V(s(this, ai)), e, r, n; e = !(r = yield t.next()).done; e = !1) {
|
|
2421
2421
|
const a = r.value;
|
|
2422
|
-
yield s(this,
|
|
2422
|
+
yield s(this, Be).write({
|
|
2423
2423
|
subscribeId: s(this, Bs).subscribe.id,
|
|
2424
2424
|
trackAlias: s(this, Bs).subscribe.trackAlias,
|
|
2425
2425
|
subGroupId: g(0),
|
|
@@ -2444,21 +2444,21 @@ class xu {
|
|
|
2444
2444
|
});
|
|
2445
2445
|
}
|
|
2446
2446
|
[xt()]() {
|
|
2447
|
-
return s(this,
|
|
2447
|
+
return s(this, Be).close().catch(T);
|
|
2448
2448
|
}
|
|
2449
2449
|
[Symbol.asyncDispose]() {
|
|
2450
|
-
return s(this,
|
|
2450
|
+
return s(this, Be).close().catch(T);
|
|
2451
2451
|
}
|
|
2452
2452
|
}
|
|
2453
|
-
|
|
2454
|
-
var ci,
|
|
2453
|
+
Be = new WeakMap(), ai = new WeakMap(), Bs = new WeakMap(), oi = new WeakMap(), xs = new WeakMap();
|
|
2454
|
+
var ci, xe, _t, rs;
|
|
2455
2455
|
class Pu {
|
|
2456
2456
|
constructor(t, e, r) {
|
|
2457
2457
|
o(this, _t);
|
|
2458
2458
|
l(this, "state");
|
|
2459
2459
|
o(this, ci);
|
|
2460
|
-
o(this,
|
|
2461
|
-
this.state = t, u(this, ci, e), u(this,
|
|
2460
|
+
o(this, xe);
|
|
2461
|
+
this.state = t, u(this, ci, e), u(this, xe, r);
|
|
2462
2462
|
}
|
|
2463
2463
|
/**
|
|
2464
2464
|
* Accept the subscription and provide a track cache for the subscription
|
|
@@ -2476,7 +2476,7 @@ class Pu {
|
|
|
2476
2476
|
params: /* @__PURE__ */ new Map(),
|
|
2477
2477
|
largestInfo: n ? { group: n, object: a } : void 0
|
|
2478
2478
|
};
|
|
2479
|
-
return yield s(this,
|
|
2479
|
+
return yield s(this, xe).push(d), new Bu(this.state, c, s(this, ci), s(this, xe));
|
|
2480
2480
|
});
|
|
2481
2481
|
}
|
|
2482
2482
|
invalidRange() {
|
|
@@ -2501,7 +2501,7 @@ class Pu {
|
|
|
2501
2501
|
return this.trackDoesNotExist();
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
|
-
ci = new WeakMap(),
|
|
2504
|
+
ci = new WeakMap(), xe = new WeakMap(), _t = new WeakSet(), rs = function(t, e) {
|
|
2505
2505
|
const r = {
|
|
2506
2506
|
type: y.SubscribeError,
|
|
2507
2507
|
id: this.state.subscribe.id,
|
|
@@ -2509,17 +2509,17 @@ ci = new WeakMap(), Be = new WeakMap(), _t = new WeakSet(), rs = function(t, e)
|
|
|
2509
2509
|
reason: e,
|
|
2510
2510
|
trackAlias: this.state.subscribe.trackAlias
|
|
2511
2511
|
};
|
|
2512
|
-
return s(this,
|
|
2512
|
+
return s(this, xe).push(r);
|
|
2513
2513
|
};
|
|
2514
|
-
var io, Ps, ui, Rs,
|
|
2514
|
+
var io, Ps, ui, Rs, Pe, te, ee, se, ca;
|
|
2515
2515
|
io = [et({ context: "Session", enter: "info", error: "error" })];
|
|
2516
2516
|
class ka {
|
|
2517
2517
|
constructor(t, e, r) {
|
|
2518
|
-
|
|
2518
|
+
ye(ca, 5, this);
|
|
2519
2519
|
o(this, Ps);
|
|
2520
2520
|
o(this, ui);
|
|
2521
2521
|
o(this, Rs);
|
|
2522
|
-
o(this,
|
|
2522
|
+
o(this, Pe, nt.get().createContext("Publisher"));
|
|
2523
2523
|
o(this, te, new K(/* @__PURE__ */ new Map()));
|
|
2524
2524
|
o(this, ee, new K(/* @__PURE__ */ new Map()));
|
|
2525
2525
|
o(this, se, new Jn(10));
|
|
@@ -2564,65 +2564,65 @@ class ka {
|
|
|
2564
2564
|
case y.SubscribeUpdate:
|
|
2565
2565
|
{
|
|
2566
2566
|
const e = s(this, ee).current().get(t.id);
|
|
2567
|
-
e || s(this,
|
|
2567
|
+
e || s(this, Pe).debug("No subscription found", t), e == null || e.onUpdate(t);
|
|
2568
2568
|
}
|
|
2569
2569
|
break;
|
|
2570
2570
|
case y.Unsubscribe:
|
|
2571
2571
|
{
|
|
2572
2572
|
const e = s(this, ee).current().get(t.id);
|
|
2573
|
-
e || s(this,
|
|
2573
|
+
e || s(this, Pe).debug("No subscription found", t), e == null || e.onUnsubscribe(t);
|
|
2574
2574
|
}
|
|
2575
2575
|
break;
|
|
2576
2576
|
case y.AnnounceOk:
|
|
2577
2577
|
{
|
|
2578
2578
|
const e = s(this, te).current().get(t.namespace.join("/"));
|
|
2579
|
-
e || s(this,
|
|
2579
|
+
e || s(this, Pe).debug("No announcement found", t), e == null || e.state.onOk(t);
|
|
2580
2580
|
}
|
|
2581
2581
|
break;
|
|
2582
2582
|
case y.AnnounceError:
|
|
2583
2583
|
{
|
|
2584
2584
|
const e = s(this, te).current().get(t.namespace.join("/"));
|
|
2585
|
-
e || s(this,
|
|
2585
|
+
e || s(this, Pe).debug("No announcement found", t), e == null || e.state.onError(t);
|
|
2586
2586
|
}
|
|
2587
2587
|
break;
|
|
2588
2588
|
}
|
|
2589
2589
|
});
|
|
2590
2590
|
}
|
|
2591
2591
|
}
|
|
2592
|
-
ca =
|
|
2592
|
+
ca = me(null), Ps = new WeakMap(), ui = new WeakMap(), Rs = new WeakMap(), Pe = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), H(ca, 1, "announce", io, ka), Kt(ca, ka);
|
|
2593
2593
|
function Ru(i, t) {
|
|
2594
2594
|
const e = new Sn(t), [r, n] = Ra(100), a = new ju(e, r), c = new ic(i, e, n);
|
|
2595
2595
|
return [a, c];
|
|
2596
2596
|
}
|
|
2597
|
-
var
|
|
2597
|
+
var Re;
|
|
2598
2598
|
class ju {
|
|
2599
2599
|
constructor(t, e) {
|
|
2600
2600
|
l(this, "state");
|
|
2601
|
-
o(this,
|
|
2602
|
-
this.state = t, u(this,
|
|
2601
|
+
o(this, Re);
|
|
2602
|
+
this.state = t, u(this, Re, e);
|
|
2603
2603
|
}
|
|
2604
2604
|
onDone(t) {
|
|
2605
2605
|
this.state.onDone(t);
|
|
2606
2606
|
}
|
|
2607
2607
|
onData(t) {
|
|
2608
|
-
return s(this,
|
|
2608
|
+
return s(this, Re).push(t);
|
|
2609
2609
|
}
|
|
2610
2610
|
onError(t) {
|
|
2611
2611
|
const e = this.state.onError(t);
|
|
2612
|
-
s(this,
|
|
2612
|
+
s(this, Re).abort(e);
|
|
2613
2613
|
}
|
|
2614
2614
|
/**
|
|
2615
2615
|
* Closes the subscription producer so that no more objects an be emitted
|
|
2616
2616
|
*/
|
|
2617
2617
|
close() {
|
|
2618
|
-
this.state.close(), s(this,
|
|
2618
|
+
this.state.close(), s(this, Re).close();
|
|
2619
2619
|
}
|
|
2620
2620
|
}
|
|
2621
|
-
|
|
2621
|
+
Re = new WeakMap();
|
|
2622
2622
|
var no, js, L, Gs, Ns, ua, Ls, hr;
|
|
2623
2623
|
class ic {
|
|
2624
2624
|
constructor(t, e, r) {
|
|
2625
|
-
|
|
2625
|
+
ye(ua, 5, this);
|
|
2626
2626
|
o(this, Ls);
|
|
2627
2627
|
o(this, js);
|
|
2628
2628
|
o(this, L);
|
|
@@ -2789,17 +2789,17 @@ class ic {
|
|
|
2789
2789
|
return f(this, Ls, hr).call(this);
|
|
2790
2790
|
}
|
|
2791
2791
|
}
|
|
2792
|
-
ua =
|
|
2792
|
+
ua = me(null), js = new WeakMap(), L = new WeakMap(), Gs = new WeakMap(), Ns = new WeakMap(), Ls = new WeakSet(), hr = function() {
|
|
2793
2793
|
return h(this, null, function* () {
|
|
2794
2794
|
return yield this.close(), this.unsubscribe();
|
|
2795
2795
|
});
|
|
2796
2796
|
}, hr = H(ua, 17, "#dispose", no, Ls, hr), Kt(ua, ic);
|
|
2797
2797
|
const Gu = 2e3;
|
|
2798
|
-
var ao, oo, co, uo, Ft, rt,
|
|
2798
|
+
var ao, oo, co, uo, Ft, rt, je, Ge, es, Bt, Ki, is;
|
|
2799
2799
|
uo = [et({ context: "Session", return: "debug" })], co = [et({ context: "Session", enter: "info", error: "error" })], oo = [et({ context: "Session", enter: "debug" })], ao = [et({ context: "Session", enter: "debug" })];
|
|
2800
2800
|
class Zi {
|
|
2801
2801
|
constructor(t, e) {
|
|
2802
|
-
|
|
2802
|
+
ye(es, 5, this);
|
|
2803
2803
|
o(this, Bt);
|
|
2804
2804
|
// The owner session of the subscriber
|
|
2805
2805
|
o(this, Ft);
|
|
@@ -2807,9 +2807,9 @@ class Zi {
|
|
|
2807
2807
|
l(this, "nextSubscribeId", g(0));
|
|
2808
2808
|
// The active subscriptions
|
|
2809
2809
|
o(this, rt, new K(/* @__PURE__ */ new Map()));
|
|
2810
|
-
o(this,
|
|
2811
|
-
o(this,
|
|
2812
|
-
u(this, Ft, t), u(this,
|
|
2810
|
+
o(this, je);
|
|
2811
|
+
o(this, Ge, nt.get().createContext("Subscriber"));
|
|
2812
|
+
u(this, Ft, t), u(this, je, e), f(this, Bt, Ki).call(this).catch(T);
|
|
2813
2813
|
}
|
|
2814
2814
|
subscribe(t, e) {
|
|
2815
2815
|
return h(this, null, function* () {
|
|
@@ -2825,8 +2825,8 @@ class Zi {
|
|
|
2825
2825
|
subscriberPriority: e.priority,
|
|
2826
2826
|
filterType: e.filterType,
|
|
2827
2827
|
params: n
|
|
2828
|
-
}, [d, w] = Ru(s(this,
|
|
2829
|
-
if (s(this, rt).update((m) => m.set(r, d)), yield s(this,
|
|
2828
|
+
}, [d, w] = Ru(s(this, je), c);
|
|
2829
|
+
if (s(this, rt).update((m) => m.set(r, d)), yield s(this, je).push(c), !(yield Promise.race([d.state.ok(), s(this, Ft).closed()])))
|
|
2830
2830
|
throw new Error("Session closed");
|
|
2831
2831
|
return w.closed().then(() => Promise.race([Kn(Gu), this.closed()])).then(() => f(this, Bt, is).call(this, w.id)).catch(() => f(this, Bt, is).call(this, w.id)), w;
|
|
2832
2832
|
});
|
|
@@ -2844,7 +2844,7 @@ class Zi {
|
|
|
2844
2844
|
return h(this, null, function* () {
|
|
2845
2845
|
switch (t.type) {
|
|
2846
2846
|
case y.Announce:
|
|
2847
|
-
yield s(this,
|
|
2847
|
+
yield s(this, je).push({
|
|
2848
2848
|
type: y.AnnounceOk,
|
|
2849
2849
|
namespace: t.namespace
|
|
2850
2850
|
});
|
|
@@ -2858,13 +2858,13 @@ class Zi {
|
|
|
2858
2858
|
case y.SubscribeError:
|
|
2859
2859
|
{
|
|
2860
2860
|
const e = s(this, rt).current().get(t.id);
|
|
2861
|
-
e || s(this,
|
|
2861
|
+
e || s(this, Ge).debug("No subscription found", t), e == null || e.onError(t), f(this, Bt, is).call(this, t.id);
|
|
2862
2862
|
}
|
|
2863
2863
|
break;
|
|
2864
2864
|
case y.SubscribeDone:
|
|
2865
2865
|
{
|
|
2866
2866
|
const e = s(this, rt).current().get(t.id);
|
|
2867
|
-
e || s(this,
|
|
2867
|
+
e || s(this, Ge).debug("No subscription found", t), e == null || e.onDone(t);
|
|
2868
2868
|
}
|
|
2869
2869
|
break;
|
|
2870
2870
|
}
|
|
@@ -2874,7 +2874,7 @@ class Zi {
|
|
|
2874
2874
|
return h(this, null, function* () {
|
|
2875
2875
|
const e = s(this, rt).current().get(t.subscribeId());
|
|
2876
2876
|
if (!e) {
|
|
2877
|
-
s(this,
|
|
2877
|
+
s(this, Ge).warn("No subscription found", t.subscribeId());
|
|
2878
2878
|
return;
|
|
2879
2879
|
}
|
|
2880
2880
|
yield e.onData(t);
|
|
@@ -2884,13 +2884,13 @@ class Zi {
|
|
|
2884
2884
|
s(this, rt).current().forEach((t) => t.close()), s(this, rt).close();
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
es =
|
|
2887
|
+
es = me(null), Ft = new WeakMap(), rt = new WeakMap(), je = new WeakMap(), Ge = new WeakMap(), Bt = new WeakSet(), Ki = function() {
|
|
2888
2888
|
return h(this, null, function* () {
|
|
2889
2889
|
try {
|
|
2890
2890
|
for (var t = V(s(this, rt)), e, r, n; e = !(r = yield t.next()).done; e = !1) {
|
|
2891
2891
|
const a = r.value;
|
|
2892
2892
|
const c = [...a.values()].map((d) => d.state.subscribe);
|
|
2893
|
-
s(this,
|
|
2893
|
+
s(this, Ge).debug("current subscriptions", c);
|
|
2894
2894
|
}
|
|
2895
2895
|
} catch (r) {
|
|
2896
2896
|
n = [r];
|
|
@@ -2906,23 +2906,23 @@ es = be(null), Ft = new WeakMap(), rt = new WeakMap(), Re = new WeakMap(), je =
|
|
|
2906
2906
|
}, is = function(t) {
|
|
2907
2907
|
s(this, rt).isClosed() || s(this, rt).update((e) => (e.delete(t), e));
|
|
2908
2908
|
}, Ki = H(es, 17, "#observeChanges", uo, Bt, Ki), H(es, 1, "subscribe", co, Zi), H(es, 1, "close", oo, Zi), is = H(es, 17, "#deleteSubscription", ao, Bt, is), Kt(es, Zi);
|
|
2909
|
-
var ho, lo, wo, fo, bt, hi,
|
|
2909
|
+
var ho, lo, wo, fo, bt, hi, Ne, Fs, Ws, G, nc, ac, ss, Ji, Qi, qi, dr;
|
|
2910
2910
|
class Ga {
|
|
2911
2911
|
constructor(t, e) {
|
|
2912
|
-
|
|
2912
|
+
ye(ss, 5, this);
|
|
2913
2913
|
o(this, G);
|
|
2914
2914
|
// The underlying transport implementation
|
|
2915
2915
|
o(this, bt);
|
|
2916
2916
|
// The background "thread" running the background tasks
|
|
2917
2917
|
o(this, hi);
|
|
2918
2918
|
// Outgoing messages
|
|
2919
|
-
o(this,
|
|
2919
|
+
o(this, Ne);
|
|
2920
2920
|
o(this, Fs, nt.get().createContext("Session"));
|
|
2921
2921
|
l(this, "subscriber");
|
|
2922
2922
|
l(this, "publisher");
|
|
2923
2923
|
o(this, Ws);
|
|
2924
2924
|
const [r, n] = Ra(100);
|
|
2925
|
-
u(this, bt, t), u(this,
|
|
2925
|
+
u(this, bt, t), u(this, Ne, n), this.subscriber = new Zi(this, r), this.publisher = new ka(this, t, r), u(this, hi, f(this, G, ac).call(this)), u(this, Ws, new K(e)), this.closed().then(() => this.close()).catch(T);
|
|
2926
2926
|
}
|
|
2927
2927
|
updateAuthToken(t) {
|
|
2928
2928
|
s(this, Ws).update(t);
|
|
@@ -2941,7 +2941,7 @@ class Ga {
|
|
|
2941
2941
|
}
|
|
2942
2942
|
close() {
|
|
2943
2943
|
try {
|
|
2944
|
-
this.subscriber.close(), this.publisher.close(), s(this,
|
|
2944
|
+
this.subscriber.close(), this.publisher.close(), s(this, Ne).cancel("closing"), s(this, bt).close();
|
|
2945
2945
|
} catch (t) {
|
|
2946
2946
|
s(this, Fs).warn("Error closing session", t);
|
|
2947
2947
|
}
|
|
@@ -2953,7 +2953,7 @@ class Ga {
|
|
|
2953
2953
|
f(this, G, dr).call(this);
|
|
2954
2954
|
}
|
|
2955
2955
|
}
|
|
2956
|
-
ss =
|
|
2956
|
+
ss = me(null), bt = new WeakMap(), hi = new WeakMap(), Ne = new WeakMap(), Fs = new WeakMap(), Ws = new WeakMap(), G = new WeakSet(), nc = function(t) {
|
|
2957
2957
|
return h(this, null, function* () {
|
|
2958
2958
|
var e, r;
|
|
2959
2959
|
switch (s(this, Fs).debug("received message", t), yield (e = this.subscriber) == null ? void 0 : e.onMessage(t), yield (r = this.publisher) == null ? void 0 : r.onMessage(t), t.type) {
|
|
@@ -2969,7 +2969,7 @@ ss = be(null), bt = new WeakMap(), hi = new WeakMap(), Ge = new WeakMap(), Fs =
|
|
|
2969
2969
|
return h(this, null, function* () {
|
|
2970
2970
|
try {
|
|
2971
2971
|
try {
|
|
2972
|
-
for (var t = V(s(this,
|
|
2972
|
+
for (var t = V(s(this, Ne)), e, r, n; e = !(r = yield t.next()).done; e = !1) {
|
|
2973
2973
|
const a = r.value;
|
|
2974
2974
|
s(this, Fs).debug("sending message", a), yield s(this, bt).writeMessage(a);
|
|
2975
2975
|
}
|
|
@@ -3000,7 +3000,7 @@ ss = be(null), bt = new WeakMap(), hi = new WeakMap(), Ge = new WeakMap(), Fs =
|
|
|
3000
3000
|
} catch (t) {
|
|
3001
3001
|
return t;
|
|
3002
3002
|
} finally {
|
|
3003
|
-
s(this,
|
|
3003
|
+
s(this, Ne).cancel("closing");
|
|
3004
3004
|
}
|
|
3005
3005
|
});
|
|
3006
3006
|
}, qi = function() {
|
|
@@ -3021,68 +3021,68 @@ ss = be(null), bt = new WeakMap(), hi = new WeakMap(), Ge = new WeakMap(), Fs =
|
|
|
3021
3021
|
this.close();
|
|
3022
3022
|
}, Ji = H(ss, 17, "#runOutgoingMessages", fo, G, Ji), Qi = H(ss, 17, "#runControl", wo, G, Qi), qi = H(ss, 17, "#runObjects", lo, G, qi), dr = H(ss, 17, "#dispose", ho, G, dr), Kt(ss, Ga);
|
|
3023
3023
|
const Nu = 128;
|
|
3024
|
-
var ht, di,
|
|
3024
|
+
var ht, di, Le, $s, li, z, Ie, ve;
|
|
3025
3025
|
class Lu {
|
|
3026
3026
|
constructor(t, e, r) {
|
|
3027
3027
|
o(this, z);
|
|
3028
3028
|
o(this, ht);
|
|
3029
3029
|
o(this, di);
|
|
3030
|
-
o(this,
|
|
3030
|
+
o(this, Le, !0);
|
|
3031
3031
|
o(this, $s, !1);
|
|
3032
3032
|
o(this, li);
|
|
3033
3033
|
u(this, ht, t), u(this, di, e), u(this, li, r);
|
|
3034
3034
|
}
|
|
3035
3035
|
writeUnsigned8(t) {
|
|
3036
3036
|
return h(this, null, function* () {
|
|
3037
|
-
return f(this, z,
|
|
3037
|
+
return f(this, z, Ie).call(this), yield f(this, z, ve).call(this), s(this, ht).writeUnsigned8(t);
|
|
3038
3038
|
});
|
|
3039
3039
|
}
|
|
3040
3040
|
writeVarInt(t) {
|
|
3041
3041
|
return h(this, null, function* () {
|
|
3042
|
-
return f(this, z,
|
|
3042
|
+
return f(this, z, Ie).call(this), yield f(this, z, ve).call(this), s(this, ht).writeVarInt(t);
|
|
3043
3043
|
});
|
|
3044
3044
|
}
|
|
3045
3045
|
writeBigVarInt(t) {
|
|
3046
3046
|
return h(this, null, function* () {
|
|
3047
|
-
return f(this, z,
|
|
3047
|
+
return f(this, z, Ie).call(this), yield f(this, z, ve).call(this), s(this, ht).writeBigVarInt(t);
|
|
3048
3048
|
});
|
|
3049
3049
|
}
|
|
3050
3050
|
write(t) {
|
|
3051
3051
|
return h(this, null, function* () {
|
|
3052
|
-
return f(this, z,
|
|
3052
|
+
return f(this, z, Ie).call(this), yield f(this, z, ve).call(this), s(this, ht).write(t);
|
|
3053
3053
|
});
|
|
3054
3054
|
}
|
|
3055
3055
|
writeString(t) {
|
|
3056
3056
|
return h(this, null, function* () {
|
|
3057
|
-
return f(this, z,
|
|
3057
|
+
return f(this, z, Ie).call(this), yield f(this, z, ve).call(this), s(this, ht).writeString(t);
|
|
3058
3058
|
});
|
|
3059
3059
|
}
|
|
3060
3060
|
flush() {
|
|
3061
3061
|
return h(this, null, function* () {
|
|
3062
|
-
f(this, z,
|
|
3062
|
+
f(this, z, Ie).call(this), u(this, Le, !0), yield s(this, ht).flush();
|
|
3063
3063
|
});
|
|
3064
3064
|
}
|
|
3065
3065
|
close() {
|
|
3066
3066
|
return h(this, null, function* () {
|
|
3067
|
-
s(this, $s) || (u(this,
|
|
3067
|
+
s(this, $s) || (u(this, Le, !0), yield f(this, z, ve).call(this, !1), yield s(this, ht).flush(), u(this, $s, !0), s(this, li).call(this));
|
|
3068
3068
|
});
|
|
3069
3069
|
}
|
|
3070
3070
|
}
|
|
3071
|
-
ht = new WeakMap(), di = new WeakMap(),
|
|
3071
|
+
ht = new WeakMap(), di = new WeakMap(), Le = new WeakMap(), $s = new WeakMap(), li = new WeakMap(), z = new WeakSet(), Ie = function() {
|
|
3072
3072
|
if (s(this, $s))
|
|
3073
3073
|
throw new Error("Stream is closed");
|
|
3074
|
-
},
|
|
3075
|
-
if (s(this,
|
|
3076
|
-
return u(this,
|
|
3074
|
+
}, ve = function(t = !0) {
|
|
3075
|
+
if (s(this, Le))
|
|
3076
|
+
return u(this, Le, !1), s(this, ht).writeUnsigned8(s(this, di) | (t ? Nu : 0));
|
|
3077
3077
|
};
|
|
3078
|
-
var re, Wt, Ms,
|
|
3078
|
+
var re, Wt, Ms, Fe, $t, zs, Hs, Pn, oc;
|
|
3079
3079
|
class Fu {
|
|
3080
3080
|
constructor(t, e) {
|
|
3081
3081
|
o(this, Pn);
|
|
3082
3082
|
o(this, re);
|
|
3083
3083
|
o(this, Wt);
|
|
3084
3084
|
o(this, Ms);
|
|
3085
|
-
o(this,
|
|
3085
|
+
o(this, Fe);
|
|
3086
3086
|
o(this, $t, /* @__PURE__ */ new Map());
|
|
3087
3087
|
o(this, zs, nt.get().createContext("WebSocketConnection"));
|
|
3088
3088
|
o(this, Hs, new Set(new Array(128).fill(0).map((t, e) => e + 1)));
|
|
@@ -3111,9 +3111,9 @@ class Fu {
|
|
|
3111
3111
|
return h(this, null, function* () {
|
|
3112
3112
|
var t;
|
|
3113
3113
|
for (; ; ) {
|
|
3114
|
-
u(this,
|
|
3114
|
+
u(this, Fe, s(this, Ms).getReader());
|
|
3115
3115
|
try {
|
|
3116
|
-
const { value: e, done: r } = yield s(this,
|
|
3116
|
+
const { value: e, done: r } = yield s(this, Fe).read();
|
|
3117
3117
|
if (r)
|
|
3118
3118
|
return;
|
|
3119
3119
|
const [n, a, c] = e;
|
|
@@ -3137,14 +3137,14 @@ class Fu {
|
|
|
3137
3137
|
return yield Do(new gn(c, p), a);
|
|
3138
3138
|
}
|
|
3139
3139
|
} finally {
|
|
3140
|
-
(t = s(this,
|
|
3140
|
+
(t = s(this, Fe)) == null || t.releaseLock();
|
|
3141
3141
|
}
|
|
3142
3142
|
}
|
|
3143
3143
|
});
|
|
3144
3144
|
}
|
|
3145
3145
|
close() {
|
|
3146
3146
|
var t;
|
|
3147
|
-
return s(this, Wt).cancel().catch(T), s(this, Ms).cancel("closing").catch(T), (t = s(this,
|
|
3147
|
+
return s(this, Wt).cancel().catch(T), s(this, Ms).cancel("closing").catch(T), (t = s(this, Fe)) == null || t.cancel("closing").catch(T), s(this, re).close();
|
|
3148
3148
|
}
|
|
3149
3149
|
closed() {
|
|
3150
3150
|
return Promise.resolve();
|
|
@@ -3160,25 +3160,25 @@ class Fu {
|
|
|
3160
3160
|
});
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
|
-
re = new WeakMap(), Wt = new WeakMap(), Ms = new WeakMap(),
|
|
3163
|
+
re = new WeakMap(), Wt = new WeakMap(), Ms = new WeakMap(), Fe = new WeakMap(), $t = new WeakMap(), zs = new WeakMap(), Hs = new WeakMap(), Pn = new WeakSet(), /**
|
|
3164
3164
|
* Return a stream ID to the pool of available stream IDs
|
|
3165
3165
|
* @param streamId - The stream ID to return
|
|
3166
3166
|
*/
|
|
3167
3167
|
oc = function(t) {
|
|
3168
3168
|
s(this, Hs).add(t);
|
|
3169
3169
|
};
|
|
3170
|
-
var ie, ne,
|
|
3170
|
+
var ie, ne, We, wi, fi, Rn, jn, cc;
|
|
3171
3171
|
class Wu {
|
|
3172
3172
|
constructor(t, e, r) {
|
|
3173
3173
|
o(this, jn);
|
|
3174
3174
|
o(this, ie);
|
|
3175
3175
|
o(this, ne);
|
|
3176
|
-
o(this,
|
|
3176
|
+
o(this, We, new Jn(100));
|
|
3177
3177
|
o(this, wi);
|
|
3178
3178
|
o(this, fi, 0);
|
|
3179
3179
|
o(this, Rn, nt.get().createContext("WebTransportConnection"));
|
|
3180
3180
|
u(this, wi, r), u(this, ie, t), u(this, ne, e), f(this, jn, cc).call(this).catch((n) => {
|
|
3181
|
-
s(this, Rn).debug("Incoming streams handling ended with error", n), s(this, ne).markPostHandshake(), s(this,
|
|
3181
|
+
s(this, Rn).debug("Incoming streams handling ended with error", n), s(this, ne).markPostHandshake(), s(this, We).close();
|
|
3182
3182
|
});
|
|
3183
3183
|
}
|
|
3184
3184
|
openSendStream() {
|
|
@@ -3216,21 +3216,21 @@ class Wu {
|
|
|
3216
3216
|
}
|
|
3217
3217
|
objectStream() {
|
|
3218
3218
|
return h(this, null, function* () {
|
|
3219
|
-
return s(this,
|
|
3219
|
+
return s(this, We).pop();
|
|
3220
3220
|
});
|
|
3221
3221
|
}
|
|
3222
3222
|
}
|
|
3223
|
-
ie = new WeakMap(), ne = new WeakMap(),
|
|
3223
|
+
ie = new WeakMap(), ne = new WeakMap(), We = new WeakMap(), wi = new WeakMap(), fi = new WeakMap(), Rn = new WeakMap(), jn = new WeakSet(), cc = function() {
|
|
3224
3224
|
return h(this, null, function* () {
|
|
3225
3225
|
const t = s(this, ie).incomingUnidirectionalStreams.getReader();
|
|
3226
3226
|
for (; ; ) {
|
|
3227
3227
|
const { value: e, done: r } = yield t.read();
|
|
3228
3228
|
if (r) {
|
|
3229
|
-
s(this,
|
|
3229
|
+
s(this, We).close();
|
|
3230
3230
|
return;
|
|
3231
3231
|
}
|
|
3232
3232
|
const n = new gn(new Uint8Array(), e);
|
|
3233
|
-
yield s(this,
|
|
3233
|
+
yield s(this, We).push(Do(n, s(this, fi))), sa(this, fi)._++;
|
|
3234
3234
|
}
|
|
3235
3235
|
});
|
|
3236
3236
|
};
|
|
@@ -3337,8 +3337,8 @@ Xs = new WeakMap(), pi = new WeakMap();
|
|
|
3337
3337
|
function zu(i, t) {
|
|
3338
3338
|
return ["com.vindral.moq", i];
|
|
3339
3339
|
}
|
|
3340
|
-
function
|
|
3341
|
-
const t = i
|
|
3340
|
+
function ge(i) {
|
|
3341
|
+
const t = i[1];
|
|
3342
3342
|
if (!t)
|
|
3343
3343
|
throw new Error("namespace must contain a channel ID");
|
|
3344
3344
|
return t;
|
|
@@ -3350,7 +3350,7 @@ function Xu(i) {
|
|
|
3350
3350
|
const t = new TextDecoder().decode(i);
|
|
3351
3351
|
return JSON.parse(t);
|
|
3352
3352
|
}
|
|
3353
|
-
var it, Ot,
|
|
3353
|
+
var it, Ot, $e, dt, bi, Gn, mi, Ia;
|
|
3354
3354
|
const Fa = class Fa {
|
|
3355
3355
|
constructor(t, e) {
|
|
3356
3356
|
o(this, mi);
|
|
@@ -3358,7 +3358,7 @@ const Fa = class Fa {
|
|
|
3358
3358
|
// The largest group id seen so far - used to switch seamlessly between tracks
|
|
3359
3359
|
o(this, Ot);
|
|
3360
3360
|
// We keep track of the most recent groups to ensure we haven't missed any due to re-ordering before we close subscriptions
|
|
3361
|
-
o(this,
|
|
3361
|
+
o(this, $e, new Pa(100));
|
|
3362
3362
|
// This contains the unconsumed groups if this track has an absolute range
|
|
3363
3363
|
o(this, dt);
|
|
3364
3364
|
o(this, bi);
|
|
@@ -3367,7 +3367,7 @@ const Fa = class Fa {
|
|
|
3367
3367
|
return s(this, it).close();
|
|
3368
3368
|
if (s(this, dt))
|
|
3369
3369
|
return;
|
|
3370
|
-
const e = s(this,
|
|
3370
|
+
const e = s(this, $e).items().reduce((r, n) => r < n ? r : n, t);
|
|
3371
3371
|
u(this, dt, f(this, mi, Ia).call(this, e, t)), s(this, dt).size === 0 && (yield s(this, it).close());
|
|
3372
3372
|
}));
|
|
3373
3373
|
u(this, it, t), u(this, Ot, e), t.done().then((r) => h(this, null, function* () {
|
|
@@ -3399,7 +3399,7 @@ const Fa = class Fa {
|
|
|
3399
3399
|
* This lets the subscription end when the endGroup is reached.
|
|
3400
3400
|
*/
|
|
3401
3401
|
endOfTrack(t) {
|
|
3402
|
-
const e = s(this,
|
|
3402
|
+
const e = s(this, $e).items().reduce((r, n) => r < n ? r : n, t);
|
|
3403
3403
|
return this.update(e, t);
|
|
3404
3404
|
}
|
|
3405
3405
|
update(t, e) {
|
|
@@ -3419,7 +3419,7 @@ const Fa = class Fa {
|
|
|
3419
3419
|
if (t.done)
|
|
3420
3420
|
return t;
|
|
3421
3421
|
const e = t.value.groupId();
|
|
3422
|
-
return (r = s(this, dt)) == null || r.delete(e), s(this,
|
|
3422
|
+
return (r = s(this, dt)) == null || r.delete(e), s(this, $e).push(e), s(this, Ot) || u(this, Ot, e), u(this, Ot, s(this, Ot) < e ? e : s(this, Ot)), t;
|
|
3423
3423
|
});
|
|
3424
3424
|
}
|
|
3425
3425
|
return() {
|
|
@@ -3429,23 +3429,23 @@ const Fa = class Fa {
|
|
|
3429
3429
|
return this;
|
|
3430
3430
|
}
|
|
3431
3431
|
};
|
|
3432
|
-
it = new WeakMap(), Ot = new WeakMap(),
|
|
3432
|
+
it = new WeakMap(), Ot = new WeakMap(), $e = new WeakMap(), dt = new WeakMap(), bi = new WeakMap(), Gn = new WeakMap(), mi = new WeakSet(), Ia = function(t, e) {
|
|
3433
3433
|
const r = /* @__PURE__ */ new Set();
|
|
3434
3434
|
for (let n = t; n <= e; n++)
|
|
3435
3435
|
r == null || r.add(n);
|
|
3436
|
-
return s(this,
|
|
3436
|
+
return s(this, $e).items().forEach((n) => {
|
|
3437
3437
|
r == null || r.delete(n);
|
|
3438
3438
|
}), r;
|
|
3439
3439
|
};
|
|
3440
3440
|
let Un = Fa;
|
|
3441
|
-
var mt,
|
|
3441
|
+
var mt, Me, zt, Vt, yi, va, gi;
|
|
3442
3442
|
const Wa = class Wa {
|
|
3443
3443
|
constructor(t) {
|
|
3444
3444
|
o(this, yi);
|
|
3445
3445
|
// The current active subscription
|
|
3446
3446
|
o(this, mt);
|
|
3447
3447
|
// The current group iterator - gets replaced by the next in #groups when it runs out
|
|
3448
|
-
o(this,
|
|
3448
|
+
o(this, Me);
|
|
3449
3449
|
// The next group iterators to switch to when the current one runs out
|
|
3450
3450
|
o(this, zt, new Jn(10));
|
|
3451
3451
|
o(this, Vt);
|
|
@@ -3491,7 +3491,7 @@ const Wa = class Wa {
|
|
|
3491
3491
|
ot(b, k, x);
|
|
3492
3492
|
}
|
|
3493
3493
|
}));
|
|
3494
|
-
u(this, mt, new Wc(t)), u(this,
|
|
3494
|
+
u(this, mt, new Wc(t)), u(this, Me, t), u(this, Vt, nt.get().createContext(`Renewable '${t.name()}'`));
|
|
3495
3495
|
}
|
|
3496
3496
|
static subscribe(t, e, r) {
|
|
3497
3497
|
return h(this, null, function* () {
|
|
@@ -3567,12 +3567,12 @@ const Wa = class Wa {
|
|
|
3567
3567
|
next() {
|
|
3568
3568
|
return h(this, null, function* () {
|
|
3569
3569
|
var e, r;
|
|
3570
|
-
const t = yield s(this,
|
|
3570
|
+
const t = yield s(this, Me).next();
|
|
3571
3571
|
if (t.done) {
|
|
3572
|
-
yield (r = (e = s(this,
|
|
3572
|
+
yield (r = (e = s(this, Me)).return) == null ? void 0 : r.call(e);
|
|
3573
3573
|
const n = yield s(this, zt).pop();
|
|
3574
3574
|
if (n)
|
|
3575
|
-
return u(this,
|
|
3575
|
+
return u(this, Me, n), this.next();
|
|
3576
3576
|
}
|
|
3577
3577
|
return t;
|
|
3578
3578
|
});
|
|
@@ -3609,7 +3609,7 @@ const Wa = class Wa {
|
|
|
3609
3609
|
});
|
|
3610
3610
|
}
|
|
3611
3611
|
};
|
|
3612
|
-
mt = new WeakMap(),
|
|
3612
|
+
mt = new WeakMap(), Me = new WeakMap(), zt = new WeakMap(), Vt = new WeakMap(), yi = new WeakSet(), va = function(t) {
|
|
3613
3613
|
return h(this, null, function* () {
|
|
3614
3614
|
var e;
|
|
3615
3615
|
if (t.unsubscribed() || (e = t.range()) != null && e.endGroup) {
|
|
@@ -3623,7 +3623,7 @@ mt = new WeakMap(), $e = new WeakMap(), zt = new WeakMap(), Vt = new WeakMap(),
|
|
|
3623
3623
|
return this.return();
|
|
3624
3624
|
});
|
|
3625
3625
|
}, gi = new WeakMap();
|
|
3626
|
-
let
|
|
3626
|
+
let le = Wa;
|
|
3627
3627
|
const Yu = "catalog";
|
|
3628
3628
|
function to(i) {
|
|
3629
3629
|
const t = Xu(i.payload);
|
|
@@ -3631,31 +3631,31 @@ function to(i) {
|
|
|
3631
3631
|
throw new Error("unexpected catalog type");
|
|
3632
3632
|
return t;
|
|
3633
3633
|
}
|
|
3634
|
-
var
|
|
3634
|
+
var ae, ki, Ii, vi, Nn, hc;
|
|
3635
3635
|
const Ln = class Ln {
|
|
3636
3636
|
constructor(t, e, r) {
|
|
3637
3637
|
o(this, Nn);
|
|
3638
|
-
o(this,
|
|
3638
|
+
o(this, ae);
|
|
3639
3639
|
o(this, ki);
|
|
3640
3640
|
o(this, Ii);
|
|
3641
3641
|
o(this, vi);
|
|
3642
|
-
u(this, ki, t), u(this,
|
|
3642
|
+
u(this, ki, t), u(this, ae, e), u(this, Ii, r), u(this, vi, f(this, Nn, hc).call(this)), this.closed().finally(() => s(this, ae).close()).catch(T);
|
|
3643
3643
|
}
|
|
3644
3644
|
catalog() {
|
|
3645
|
-
return s(this,
|
|
3645
|
+
return s(this, ae);
|
|
3646
3646
|
}
|
|
3647
3647
|
closed() {
|
|
3648
3648
|
return s(this, vi);
|
|
3649
3649
|
}
|
|
3650
3650
|
close() {
|
|
3651
3651
|
return h(this, null, function* () {
|
|
3652
|
-
return s(this,
|
|
3652
|
+
return s(this, ae).close(), (yield s(this, ki).promise).unsubscribe();
|
|
3653
3653
|
});
|
|
3654
3654
|
}
|
|
3655
3655
|
static start(t, e) {
|
|
3656
3656
|
return h(this, null, function* () {
|
|
3657
3657
|
const r = O.fromPromise(
|
|
3658
|
-
|
|
3658
|
+
le.subscribe(
|
|
3659
3659
|
t,
|
|
3660
3660
|
new Xt().name(e.catalogName || Yu).groupOrder("ascending").build()
|
|
3661
3661
|
)
|
|
@@ -3670,7 +3670,7 @@ const Ln = class Ln {
|
|
|
3670
3670
|
});
|
|
3671
3671
|
}
|
|
3672
3672
|
};
|
|
3673
|
-
|
|
3673
|
+
ae = new WeakMap(), ki = new WeakMap(), Ii = new WeakMap(), vi = new WeakMap(), Nn = new WeakSet(), hc = function() {
|
|
3674
3674
|
return h(this, null, function* () {
|
|
3675
3675
|
const t = yield s(this, Ii).promise;
|
|
3676
3676
|
try {
|
|
@@ -3679,7 +3679,7 @@ Me = new WeakMap(), ki = new WeakMap(), Ii = new WeakMap(), vi = new WeakMap(),
|
|
|
3679
3679
|
if (c.objectStatus !== Z.Normal)
|
|
3680
3680
|
continue;
|
|
3681
3681
|
const d = to(c);
|
|
3682
|
-
s(this,
|
|
3682
|
+
s(this, ae).update(d);
|
|
3683
3683
|
}
|
|
3684
3684
|
} catch (n) {
|
|
3685
3685
|
a = [n];
|
|
@@ -3778,12 +3778,12 @@ const hs = class hs {
|
|
|
3778
3778
|
if (e.initTrack) {
|
|
3779
3779
|
const b = new Xt().name(e.initTrack).build(), [I, k] = yield Promise.all([
|
|
3780
3780
|
f(m = hs, Fn, dc).call(m, t, b),
|
|
3781
|
-
|
|
3781
|
+
le.subscribe(t, c, n ? n - g(1) : void 0)
|
|
3782
3782
|
]), x = new qa(I);
|
|
3783
3783
|
return new hs(e, t.namespace(), k, x, r);
|
|
3784
3784
|
}
|
|
3785
3785
|
ko(e.initData, "no init data found on track");
|
|
3786
|
-
const d = Io(e.initData), w = new qa(new Uint8Array(d)), p = yield
|
|
3786
|
+
const d = Io(e.initData), w = new qa(new Uint8Array(d)), p = yield le.subscribe(t, c, n ? n - g(1) : void 0);
|
|
3787
3787
|
return new hs(e, t.namespace(), p, w, r);
|
|
3788
3788
|
});
|
|
3789
3789
|
}
|
|
@@ -3853,17 +3853,17 @@ Ti = new WeakMap(), Ct = new WeakMap(), Ai = new WeakMap(), Di = new WeakMap(),
|
|
|
3853
3853
|
}, o(hs, Fn);
|
|
3854
3854
|
let Ea = hs;
|
|
3855
3855
|
const eo = 1e4, Ku = 3e4;
|
|
3856
|
-
var Wn,
|
|
3856
|
+
var Wn, oe, ze, Oi, Vi, Ci, ts, Aa, lc;
|
|
3857
3857
|
const $a = class $a {
|
|
3858
3858
|
constructor(t, e, r) {
|
|
3859
3859
|
o(this, ts);
|
|
3860
3860
|
o(this, Wn, nt.get().createContext("Timeline"));
|
|
3861
|
-
o(this,
|
|
3861
|
+
o(this, oe, new K([]));
|
|
3862
3862
|
o(this, ze);
|
|
3863
3863
|
o(this, Oi);
|
|
3864
3864
|
o(this, Vi);
|
|
3865
3865
|
o(this, Ci);
|
|
3866
|
-
u(this, Oi, t), u(this, Vi, r), u(this, ze, e), u(this, Ci, f(this, ts, Aa).call(this, s(this, ze))), this.closed().finally(() => s(this,
|
|
3866
|
+
u(this, Oi, t), u(this, Vi, r), u(this, ze, e), u(this, Ci, f(this, ts, Aa).call(this, s(this, ze))), this.closed().finally(() => s(this, oe).close()).catch(T);
|
|
3867
3867
|
}
|
|
3868
3868
|
closed() {
|
|
3869
3869
|
return s(this, Ci);
|
|
@@ -3874,7 +3874,7 @@ const $a = class $a {
|
|
|
3874
3874
|
});
|
|
3875
3875
|
}
|
|
3876
3876
|
timeline() {
|
|
3877
|
-
const [t, e] = s(this,
|
|
3877
|
+
const [t, e] = s(this, oe).value();
|
|
3878
3878
|
return t;
|
|
3879
3879
|
}
|
|
3880
3880
|
/**
|
|
@@ -3886,25 +3886,25 @@ const $a = class $a {
|
|
|
3886
3886
|
}
|
|
3887
3887
|
static start(t, e) {
|
|
3888
3888
|
const r = O.fromPromise(
|
|
3889
|
-
|
|
3889
|
+
le.subscribe(t, new Xt().name(e).groupOrder("ascending").build())
|
|
3890
3890
|
);
|
|
3891
3891
|
return new $a(t, r, e);
|
|
3892
3892
|
}
|
|
3893
3893
|
waitForWallclockTime(t) {
|
|
3894
3894
|
return h(this, null, function* () {
|
|
3895
|
-
return yield s(this,
|
|
3895
|
+
return yield s(this, oe).waitFor((e) => !!e.find((r) => r.wallclock >= t)), this.timeline();
|
|
3896
3896
|
});
|
|
3897
3897
|
}
|
|
3898
3898
|
waitForTimelineToHaveMinDuration() {
|
|
3899
3899
|
return h(this, null, function* () {
|
|
3900
|
-
return yield s(this,
|
|
3900
|
+
return yield s(this, oe).waitFor((t) => {
|
|
3901
3901
|
const e = t[0], r = t[t.length - 1];
|
|
3902
3902
|
return !e || !r ? !1 : r.wallclock - e.wallclock > eo;
|
|
3903
3903
|
}), this.timeline();
|
|
3904
3904
|
});
|
|
3905
3905
|
}
|
|
3906
3906
|
};
|
|
3907
|
-
Wn = new WeakMap(),
|
|
3907
|
+
Wn = new WeakMap(), oe = new WeakMap(), ze = new WeakMap(), Oi = new WeakMap(), Vi = new WeakMap(), Ci = new WeakMap(), ts = new WeakSet(), Aa = function(t) {
|
|
3908
3908
|
return h(this, null, function* () {
|
|
3909
3909
|
const e = yield t.promise;
|
|
3910
3910
|
try {
|
|
@@ -3919,9 +3919,9 @@ Wn = new WeakMap(), ae = new WeakMap(), ze = new WeakMap(), Oi = new WeakMap(),
|
|
|
3919
3919
|
if (S.objectStatus !== Z.Normal)
|
|
3920
3920
|
continue;
|
|
3921
3921
|
const N = Ju(S.payload);
|
|
3922
|
-
s(this,
|
|
3922
|
+
s(this, oe).update((v) => {
|
|
3923
3923
|
var P, Yt;
|
|
3924
|
-
for (v.push(...N), v.sort((
|
|
3924
|
+
for (v.push(...N), v.sort((fe, q) => fe.wallclock - q.wallclock); v[0] && ((Yt = (P = v[v.length - 1]) == null ? void 0 : P.wallclock) != null ? Yt : 0) - v[0].wallclock > Ku; )
|
|
3925
3925
|
v.shift();
|
|
3926
3926
|
return v;
|
|
3927
3927
|
}), e === s(this, ze).resolved && S.groupId > g(0) && S.objectId == g(0) && f(this, ts, lc).call(this, S.groupId).catch((v) => {
|
|
@@ -3962,7 +3962,7 @@ Wn = new WeakMap(), ae = new WeakMap(), ze = new WeakMap(), Oi = new WeakMap(),
|
|
|
3962
3962
|
if (!n || !a || a.wallclock - n.wallclock > eo)
|
|
3963
3963
|
return;
|
|
3964
3964
|
const c = O.fromPromise(
|
|
3965
|
-
|
|
3965
|
+
le.subscribe(
|
|
3966
3966
|
s(this, Oi),
|
|
3967
3967
|
new Xt().name(s(this, Vi)).groupOrder("ascending").range(e, e).build()
|
|
3968
3968
|
)
|
|
@@ -3991,33 +3991,33 @@ function Ju(i) {
|
|
|
3991
3991
|
function Qu(i) {
|
|
3992
3992
|
return typeof i.language == "string";
|
|
3993
3993
|
}
|
|
3994
|
-
var $n, Bi,
|
|
3994
|
+
var $n, Bi, ce, Ks;
|
|
3995
3995
|
const Ma = class Ma {
|
|
3996
3996
|
constructor(t, e, r, n, a) {
|
|
3997
3997
|
o(this, $n, new Vc());
|
|
3998
3998
|
o(this, Bi);
|
|
3999
|
-
o(this,
|
|
3999
|
+
o(this, ce);
|
|
4000
4000
|
o(this, Ks, 0);
|
|
4001
4001
|
l(this, "trackObject");
|
|
4002
4002
|
l(this, "namespace");
|
|
4003
|
-
u(this,
|
|
4003
|
+
u(this, ce, t), u(this, Bi, e), this.trackObject = r, this.namespace = n, u(this, Ks, a);
|
|
4004
4004
|
}
|
|
4005
4005
|
static subscribe(t, e, r) {
|
|
4006
4006
|
return h(this, null, function* () {
|
|
4007
4007
|
if (!Qu(e))
|
|
4008
4008
|
throw new Error("track object language is required");
|
|
4009
|
-
const n = new Xt().name(e.name).build(), a = yield
|
|
4009
|
+
const n = new Xt().name(e.name).build(), a = yield le.subscribe(t, n), c = a.objects();
|
|
4010
4010
|
return new Ma(a, c, e, t.namespace(), r);
|
|
4011
4011
|
});
|
|
4012
4012
|
}
|
|
4013
4013
|
largestGroupId() {
|
|
4014
|
-
return s(this,
|
|
4014
|
+
return s(this, ce).largestGroupId();
|
|
4015
4015
|
}
|
|
4016
4016
|
update(t, e) {
|
|
4017
|
-
return s(this,
|
|
4017
|
+
return s(this, ce).update(t, e);
|
|
4018
4018
|
}
|
|
4019
4019
|
unsubscribe() {
|
|
4020
|
-
return s(this,
|
|
4020
|
+
return s(this, ce).unsubscribe();
|
|
4021
4021
|
}
|
|
4022
4022
|
next() {
|
|
4023
4023
|
return h(this, null, function* () {
|
|
@@ -4037,7 +4037,7 @@ const Ma = class Ma {
|
|
|
4037
4037
|
}
|
|
4038
4038
|
return() {
|
|
4039
4039
|
return h(this, null, function* () {
|
|
4040
|
-
return yield s(this,
|
|
4040
|
+
return yield s(this, ce).return(), { done: !0, value: void 0 };
|
|
4041
4041
|
});
|
|
4042
4042
|
}
|
|
4043
4043
|
[Symbol.asyncIterator]() {
|
|
@@ -4050,9 +4050,9 @@ const Ma = class Ma {
|
|
|
4050
4050
|
return this.unsubscribe();
|
|
4051
4051
|
}
|
|
4052
4052
|
};
|
|
4053
|
-
$n = new WeakMap(), Bi = new WeakMap(),
|
|
4053
|
+
$n = new WeakMap(), Bi = new WeakMap(), ce = new WeakMap(), Ks = new WeakMap();
|
|
4054
4054
|
let Da = Ma;
|
|
4055
|
-
var po, He, Xe, Ye,
|
|
4055
|
+
var po, He, Xe, Ye, ue, ha, Js, _i;
|
|
4056
4056
|
po = [et({ context: "Channel", enter: "info" })];
|
|
4057
4057
|
const ds = class ds {
|
|
4058
4058
|
constructor(t, e, r, n, a) {
|
|
@@ -4061,8 +4061,8 @@ const ds = class ds {
|
|
|
4061
4061
|
o(this, He);
|
|
4062
4062
|
o(this, Xe);
|
|
4063
4063
|
o(this, Ye);
|
|
4064
|
-
o(this,
|
|
4065
|
-
this.namespace = n, u(this, He, t), u(this, Xe, e), u(this, Ye, r), u(this,
|
|
4064
|
+
o(this, ue);
|
|
4065
|
+
this.namespace = n, u(this, He, t), u(this, Xe, e), u(this, Ye, r), u(this, ue, a);
|
|
4066
4066
|
}
|
|
4067
4067
|
static start(t, e) {
|
|
4068
4068
|
return h(this, null, function* () {
|
|
@@ -4083,20 +4083,20 @@ const ds = class ds {
|
|
|
4083
4083
|
return s(this, Xe).timestampWallclockOffset();
|
|
4084
4084
|
}
|
|
4085
4085
|
timestampOffsetMs() {
|
|
4086
|
-
return s(this,
|
|
4086
|
+
return s(this, ue);
|
|
4087
4087
|
}
|
|
4088
4088
|
setTimestampOffsetMs(t) {
|
|
4089
|
-
u(this,
|
|
4089
|
+
u(this, ue, t);
|
|
4090
4090
|
}
|
|
4091
4091
|
waitForWallclockTime(t) {
|
|
4092
4092
|
return s(this, Xe).waitForWallclockTime(t);
|
|
4093
4093
|
}
|
|
4094
4094
|
subscribeCmafTrack(t, e) {
|
|
4095
4095
|
const r = this.catalog().current().tracks, n = t["com.vindral.variant_uid"] !== void 0 ? r.find((a) => a["com.vindral.variant_uid"] === t["com.vindral.variant_uid"]) : void 0;
|
|
4096
|
-
return f(this, Js, _i).call(this, () => Ea.subscribe(s(this, He), n != null ? n : t, s(this,
|
|
4096
|
+
return f(this, Js, _i).call(this, () => Ea.subscribe(s(this, He), n != null ? n : t, s(this, ue), e));
|
|
4097
4097
|
}
|
|
4098
4098
|
subscribeWebVttTrack(t) {
|
|
4099
|
-
return f(this, Js, _i).call(this, () => Da.subscribe(s(this, He), t, s(this,
|
|
4099
|
+
return f(this, Js, _i).call(this, () => Da.subscribe(s(this, He), t, s(this, ue)));
|
|
4100
4100
|
}
|
|
4101
4101
|
subscribeTrack(t) {
|
|
4102
4102
|
return f(this, Js, _i).call(this, () => s(this, He).subscribe(t));
|
|
@@ -4108,7 +4108,7 @@ const ds = class ds {
|
|
|
4108
4108
|
return Promise.all([s(this, Ye).close(), s(this, Xe).close()]);
|
|
4109
4109
|
}
|
|
4110
4110
|
};
|
|
4111
|
-
ha =
|
|
4111
|
+
ha = me(null), He = new WeakMap(), Xe = new WeakMap(), Ye = new WeakMap(), ue = new WeakMap(), Js = new WeakSet(), _i = function(t) {
|
|
4112
4112
|
return h(this, null, function* () {
|
|
4113
4113
|
const [e, r] = this.catalog().value();
|
|
4114
4114
|
try {
|
|
@@ -4119,7 +4119,7 @@ ha = be(null), He = new WeakMap(), Xe = new WeakMap(), Ye = new WeakMap(), ce =
|
|
|
4119
4119
|
throw n;
|
|
4120
4120
|
}
|
|
4121
4121
|
});
|
|
4122
|
-
}, H(ha, 9, "start", po, ds), Kt(ha, ds),
|
|
4122
|
+
}, H(ha, 9, "start", po, ds), Kt(ha, ds), ye(ha, 3, ds);
|
|
4123
4123
|
let En = ds;
|
|
4124
4124
|
var Ze, xi, Mn, wc;
|
|
4125
4125
|
const za = class za {
|
|
@@ -4356,11 +4356,11 @@ class na {
|
|
|
4356
4356
|
}
|
|
4357
4357
|
}
|
|
4358
4358
|
qs = new WeakMap(), Ri = new WeakMap(), ji = new WeakMap();
|
|
4359
|
-
var bo, mo, yo, _s, tr, Ke, W, yt, gt,
|
|
4359
|
+
var bo, mo, yo, _s, tr, Ke, W, yt, gt, he, er, Gi, cr, J, tn, lr, pc, Ba;
|
|
4360
4360
|
yo = [et({ context: "Player", enter: "info" })], mo = [et({ context: "Player", enter: "info", return: "info" })], bo = [et({ context: "Player", enter: "info" })];
|
|
4361
4361
|
const ls = class ls {
|
|
4362
4362
|
constructor(t, e, r) {
|
|
4363
|
-
|
|
4363
|
+
ye(cr, 5, this);
|
|
4364
4364
|
o(this, J);
|
|
4365
4365
|
o(this, _s);
|
|
4366
4366
|
o(this, tr);
|
|
@@ -4368,10 +4368,10 @@ const ls = class ls {
|
|
|
4368
4368
|
o(this, W);
|
|
4369
4369
|
o(this, yt, new K(void 0));
|
|
4370
4370
|
o(this, gt, new K(void 0));
|
|
4371
|
-
o(this,
|
|
4371
|
+
o(this, he, new K(void 0));
|
|
4372
4372
|
o(this, er);
|
|
4373
4373
|
o(this, Gi);
|
|
4374
|
-
l(this, "subtitles", new na(s(this,
|
|
4374
|
+
l(this, "subtitles", new na(s(this, he), "subtitles"));
|
|
4375
4375
|
l(this, "video", new na(s(this, gt), "video"));
|
|
4376
4376
|
l(this, "audio", new na(s(this, yt), "audio"));
|
|
4377
4377
|
u(this, _s, t), u(this, tr, Oa.start(r)), u(this, Ke, r), u(this, W, new K(e)), u(this, er, new rh(e)), u(this, Gi, Promise.race([r.idleTimeout(), f(this, J, pc).call(this), s(this, er).closed()])), s(this, _s).closed().then(() => this.close()).catch(T);
|
|
@@ -4436,7 +4436,7 @@ const ls = class ls {
|
|
|
4436
4436
|
// Close the consumers so that the iterators will stop
|
|
4437
4437
|
f(this, J, tn).call(this, s(this, yt)),
|
|
4438
4438
|
f(this, J, tn).call(this, s(this, gt)),
|
|
4439
|
-
f(this, J, tn).call(this, s(this,
|
|
4439
|
+
f(this, J, tn).call(this, s(this, he))
|
|
4440
4440
|
]);
|
|
4441
4441
|
}
|
|
4442
4442
|
zap(t, e) {
|
|
@@ -4457,14 +4457,14 @@ const ls = class ls {
|
|
|
4457
4457
|
return h(this, null, function* () {
|
|
4458
4458
|
var r, n;
|
|
4459
4459
|
if (!t) {
|
|
4460
|
-
yield (r = s(this,
|
|
4460
|
+
yield (r = s(this, he).current()) == null ? void 0 : r.unsubscribe();
|
|
4461
4461
|
return;
|
|
4462
4462
|
}
|
|
4463
4463
|
const [e] = yield Promise.all([
|
|
4464
4464
|
s(this, W).current().subscribeWebVttTrack(t),
|
|
4465
|
-
(n = s(this,
|
|
4465
|
+
(n = s(this, he).current()) == null ? void 0 : n.unsubscribe()
|
|
4466
4466
|
]);
|
|
4467
|
-
s(this,
|
|
4467
|
+
s(this, he).update(e);
|
|
4468
4468
|
});
|
|
4469
4469
|
}
|
|
4470
4470
|
setVideoTrack(t, e) {
|
|
@@ -4480,7 +4480,7 @@ const ls = class ls {
|
|
|
4480
4480
|
});
|
|
4481
4481
|
}
|
|
4482
4482
|
};
|
|
4483
|
-
cr =
|
|
4483
|
+
cr = me(null), _s = new WeakMap(), tr = new WeakMap(), Ke = new WeakMap(), W = new WeakMap(), yt = new WeakMap(), gt = new WeakMap(), he = new WeakMap(), er = new WeakMap(), Gi = new WeakMap(), J = new WeakSet(), tn = function(t) {
|
|
4484
4484
|
const e = t.current(), r = e == null ? void 0 : e.largestGroupId();
|
|
4485
4485
|
return t.isClosed() || t.update(void 0), t.close(), r ? e == null ? void 0 : e.update(r, r) : e == null ? void 0 : e.unsubscribe();
|
|
4486
4486
|
}, lr = function(t, e, r, n) {
|
|
@@ -4550,7 +4550,7 @@ function aa(i, t, e) {
|
|
|
4550
4550
|
return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), e && r.searchParams.set("authToken", e), r;
|
|
4551
4551
|
}
|
|
4552
4552
|
const ih = 1e4;
|
|
4553
|
-
var $, Y, kt, Je, D,
|
|
4553
|
+
var $, Y, kt, Je, D, de, Ni, Li, Xn, sr, Q, bc, rr, Fi, ir, mc, yc, gc, kc, xa;
|
|
4554
4554
|
const Xa = class Xa {
|
|
4555
4555
|
constructor(t, e, r, n, a, c) {
|
|
4556
4556
|
o(this, Q);
|
|
@@ -4559,7 +4559,7 @@ const Xa = class Xa {
|
|
|
4559
4559
|
o(this, kt);
|
|
4560
4560
|
o(this, Je, "disconnected");
|
|
4561
4561
|
o(this, D);
|
|
4562
|
-
o(this,
|
|
4562
|
+
o(this, de, /* @__PURE__ */ new Map());
|
|
4563
4563
|
o(this, Ni);
|
|
4564
4564
|
o(this, Li, new Pa(10));
|
|
4565
4565
|
o(this, Xn, Number.MAX_SAFE_INTEGER);
|
|
@@ -4569,7 +4569,7 @@ const Xa = class Xa {
|
|
|
4569
4569
|
s(this, D).setSubtitleTrack(void 0).catch(T);
|
|
4570
4570
|
return;
|
|
4571
4571
|
}
|
|
4572
|
-
const e = s(this,
|
|
4572
|
+
const e = s(this, de).get(ge(s(this, D).namespace())), r = e == null ? void 0 : e.getTextTrack(t);
|
|
4573
4573
|
r && s(this, D).setSubtitleTrack(r).catch(T);
|
|
4574
4574
|
});
|
|
4575
4575
|
o(this, Fi, (t) => {
|
|
@@ -4604,7 +4604,7 @@ const Xa = class Xa {
|
|
|
4604
4604
|
l(this, "disconnect", (t = "Disconnect Requested") => {
|
|
4605
4605
|
s(this, Y).info("Disconnecting", t), s(this, kt).close(), s(this, D).close().catch(T), u(this, sr, /* @__PURE__ */ new Map()), u(this, Je, "disconnected");
|
|
4606
4606
|
});
|
|
4607
|
-
u(this, $, t), u(this, Y, e), u(this, kt, r), u(this, D, n), u(this,
|
|
4607
|
+
u(this, $, t), u(this, Y, e), u(this, kt, r), u(this, D, n), u(this, de, a), u(this, Ni, c), s(this, $).on("send signal", s(this, Fi)), s(this, $).on("disconnect", this.disconnect), s(this, $).on("text track", s(this, rr)), f(this, Q, bc).call(this).catch(T), f(this, Q, gc).call(this).catch(T);
|
|
4608
4608
|
}
|
|
4609
4609
|
get estimatedBandwidth() {
|
|
4610
4610
|
return s(this, Xn);
|
|
@@ -4632,7 +4632,7 @@ const Xa = class Xa {
|
|
|
4632
4632
|
var F, S, N, v;
|
|
4633
4633
|
const a = new Map(
|
|
4634
4634
|
n.connectInfo.channels.map((P) => [
|
|
4635
|
-
|
|
4635
|
+
ge(P.catalog.namespace),
|
|
4636
4636
|
new oa(new K(P.catalog))
|
|
4637
4637
|
])
|
|
4638
4638
|
), c = yield n.onConnectInfo(n.connectInfo), d = n.options.get("authenticationToken");
|
|
@@ -4648,7 +4648,7 @@ const Xa = class Xa {
|
|
|
4648
4648
|
}
|
|
4649
4649
|
const m = (F = n.connectInfo.channels.find((P) => P.channelId === c.channelId)) == null ? void 0 : F.catalog;
|
|
4650
4650
|
e.debug("Resolved edge url", { edgeUrl: w, edgeWsUrl: p }), ko(m, "no catalog found");
|
|
4651
|
-
const b = (S = a.get(
|
|
4651
|
+
const b = (S = a.get(ge(m.namespace))) == null ? void 0 : S.getVideoTrack(c.video), I = (N = a.get(ge(m.namespace))) == null ? void 0 : N.getAudioTrack(c.audio), k = yield Mu({
|
|
4652
4652
|
url: w,
|
|
4653
4653
|
wsUrl: p,
|
|
4654
4654
|
authToken: n.options.get("authenticationToken"),
|
|
@@ -4665,7 +4665,7 @@ const Xa = class Xa {
|
|
|
4665
4665
|
go(ih, new Error("Timeout waiting for player to start")),
|
|
4666
4666
|
Bc(k.closed(), "Session closed before player started")
|
|
4667
4667
|
]), vt = new oa(x.catalog());
|
|
4668
|
-
a.set(
|
|
4668
|
+
a.set(ge(m.namespace), vt), t.emit("received signal", {
|
|
4669
4669
|
type: "client ip",
|
|
4670
4670
|
ip: x.connectionInfo().ip
|
|
4671
4671
|
}), x.drm().then((P) => {
|
|
@@ -4690,7 +4690,7 @@ const Xa = class Xa {
|
|
|
4690
4690
|
return Promise.race([s(this, kt).closed(), s(this, D).closed()]);
|
|
4691
4691
|
}
|
|
4692
4692
|
};
|
|
4693
|
-
$ = new WeakMap(), Y = new WeakMap(), kt = new WeakMap(), Je = new WeakMap(), D = new WeakMap(),
|
|
4693
|
+
$ = new WeakMap(), Y = new WeakMap(), kt = new WeakMap(), Je = new WeakMap(), D = new WeakMap(), de = new WeakMap(), Ni = new WeakMap(), Li = new WeakMap(), Xn = new WeakMap(), sr = new WeakMap(), Q = new WeakSet(), bc = function() {
|
|
4694
4694
|
return h(this, null, function* () {
|
|
4695
4695
|
try {
|
|
4696
4696
|
for (var t = V(s(this, D).stats()), e, r, n; e = !(r = yield t.next()).done; e = !1) {
|
|
@@ -4724,8 +4724,8 @@ $ = new WeakMap(), Y = new WeakMap(), kt = new WeakMap(), Je = new WeakMap(), D
|
|
|
4724
4724
|
var c, d, w;
|
|
4725
4725
|
s(this, Y).info("handle subscription", t);
|
|
4726
4726
|
const e = s(this, D);
|
|
4727
|
-
let r = s(this,
|
|
4728
|
-
if (r || (r = new oa(new K(yield f(this, Q, mc).call(this, t.channelId))), s(this,
|
|
4727
|
+
let r = s(this, de).get(t.channelId);
|
|
4728
|
+
if (r || (r = new oa(new K(yield f(this, Q, mc).call(this, t.channelId))), s(this, de).set(t.channelId, r)), e.namespace().join("/") !== r.namespace().join("/")) {
|
|
4729
4729
|
s(this, Y).info("changing channel", t.channelId);
|
|
4730
4730
|
const p = r.getVideoTrack(t.video), m = r.getAudioTrack(t.audio);
|
|
4731
4731
|
yield e.zap(
|
|
@@ -4740,7 +4740,7 @@ $ = new WeakMap(), Y = new WeakMap(), kt = new WeakMap(), Je = new WeakMap(), D
|
|
|
4740
4740
|
b && s(this, $).emit("received drm data", b.value);
|
|
4741
4741
|
}).catch((b) => {
|
|
4742
4742
|
s(this, Y).error("Error getting DRM data", b);
|
|
4743
|
-
}), s(this, Y).info("switched channel", t.channelId), (c = s(this,
|
|
4743
|
+
}), s(this, Y).info("switched channel", t.channelId), (c = s(this, de).get(ge(e.namespace()))) == null || c.updateCatalog(e.catalog()), s(this, $).emit("received signal", {
|
|
4744
4744
|
type: "subscription changed",
|
|
4745
4745
|
subscription: t
|
|
4746
4746
|
});
|
|
@@ -4793,40 +4793,40 @@ $ = new WeakMap(), Y = new WeakMap(), kt = new WeakMap(), Je = new WeakMap(), D
|
|
|
4793
4793
|
try {
|
|
4794
4794
|
for (var I = V(e), k, x, vt; k = !(x = yield I.next()).done; k = !1) {
|
|
4795
4795
|
const R = x.value;
|
|
4796
|
-
const F =
|
|
4796
|
+
const F = ge(R.track.namespace), S = R.track.trackObject.language, N = Nc((d = R.track.trackObject.codec) != null ? d : ""), v = R.track.trackObject.codec, P = N ? xc({ codec: N, codecString: v }) : void 0, Yt = !!R.track.trackObject["com.vindral.drm"];
|
|
4797
4797
|
try {
|
|
4798
4798
|
for (var w = V(R), p, m, b; p = !(m = yield w.next()).done; p = !1) {
|
|
4799
|
-
const [
|
|
4799
|
+
const [fe, q] = m.value;
|
|
4800
4800
|
const Wi = {
|
|
4801
4801
|
channelId: (c || q.mediaType() === "video") && r !== F ? F : void 0,
|
|
4802
4802
|
language: q.mediaType() === "audio" && n !== S ? S : void 0,
|
|
4803
4803
|
drmTransition: a !== void 0 && a !== Yt
|
|
4804
4804
|
};
|
|
4805
4805
|
r = F, n = S, a = Yt;
|
|
4806
|
-
const
|
|
4807
|
-
if (
|
|
4806
|
+
const pe = q.producerReferenceTime(), be = s(this, sr).get(R.track.namespace) || 0;
|
|
4807
|
+
if (pe && Date.now() - be > 1e3) {
|
|
4808
4808
|
s(this, sr).set(R.track.namespace, Date.now());
|
|
4809
|
-
const Pt = t.wallclock() -
|
|
4809
|
+
const Pt = t.wallclock() - pe.getTime();
|
|
4810
4810
|
s(this, Y).debug("timing-info", {
|
|
4811
4811
|
mediaType: q.mediaType(),
|
|
4812
4812
|
referenceClock: t,
|
|
4813
4813
|
delta: Pt,
|
|
4814
|
-
groupId:
|
|
4814
|
+
groupId: fe,
|
|
4815
4815
|
timestamp: q.baseMediaDecodeTime() / q.timescale() * 1e3 + Pt,
|
|
4816
|
-
wallclockTime:
|
|
4816
|
+
wallclockTime: pe.getTime()
|
|
4817
4817
|
}), s(this, $).emit("received signal", {
|
|
4818
4818
|
type: "timing info",
|
|
4819
4819
|
timingInfo: {
|
|
4820
4820
|
channelId: F,
|
|
4821
4821
|
timestamp: q.baseMediaDecodeTime() / q.timescale() * 1e3 + Pt,
|
|
4822
|
-
wallclockTime:
|
|
4822
|
+
wallclockTime: pe.getTime()
|
|
4823
4823
|
}
|
|
4824
4824
|
});
|
|
4825
4825
|
}
|
|
4826
4826
|
s(this, $).emit("received moq data", {
|
|
4827
4827
|
payload: q,
|
|
4828
4828
|
channelId: F,
|
|
4829
|
-
groupId:
|
|
4829
|
+
groupId: fe,
|
|
4830
4830
|
mimeType: P,
|
|
4831
4831
|
codec: N,
|
|
4832
4832
|
switchInfo: Wi,
|
|
@@ -4885,10 +4885,16 @@ class oa {
|
|
|
4885
4885
|
return s(this, Ht).current().tracks.find((e) => e.label === t);
|
|
4886
4886
|
}
|
|
4887
4887
|
getAudioTrack(t) {
|
|
4888
|
-
|
|
4888
|
+
if (!t.codec)
|
|
4889
|
+
return;
|
|
4890
|
+
const e = s(this, Qe).filter((r) => !(!Pc(r) || r.bitRate > t.bitRate || t.codec && r.codec !== t.codec || t.language && r.language !== t.language));
|
|
4891
|
+
return e[e.length - 1];
|
|
4889
4892
|
}
|
|
4890
4893
|
getVideoTrack(t) {
|
|
4891
|
-
|
|
4894
|
+
if (!t.codec)
|
|
4895
|
+
return;
|
|
4896
|
+
const e = s(this, Qe).filter((r) => !(!Rc(r) || r.bitRate > t.bitRate || t.codec && r.codec !== t.codec));
|
|
4897
|
+
return e[e.length - 1];
|
|
4892
4898
|
}
|
|
4893
4899
|
renditions() {
|
|
4894
4900
|
return s(this, Qe);
|