@vindral/web-sdk 4.8.2-27-ge01b9d3a → 4.8.2-29-g2c54a2bf
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/{CPosj8wE.js → B8UCFx9l.js} +2 -2
- package/{ooDqeHgz.js → BMEhrui6.js} +1 -1
- package/{DGp5pXQS.js → Bxzdpweg.js} +2 -2
- package/{C6THE7g1.js → DPHIlOdT.js} +962 -972
- package/core.js +1 -1
- package/{DeDKEcFp.js → de9FRek3.js} +1 -1
- package/legacy.es.js +1130 -1140
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.js +2 -2
- package/{OwGxSXha.js → t_21OUKh.js} +1 -1
- package/vindral-player-component.js +1 -1
|
@@ -6581,22 +6581,22 @@ function Km(e = !0) {
|
|
|
6581
6581
|
if (i(Bm, this)) return n(Bm, this, !1), i(Rm, this).writeUnsigned8(i(zm, this) | (e ? Lm : 0));
|
|
6582
6582
|
}
|
|
6583
6583
|
// ../../libs/moq/src/transport/WebSocketConnection.ts
|
|
6584
|
-
var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakMap(), Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new
|
|
6584
|
+
var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakMap(), Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new WeakSet(), nh = class {
|
|
6585
6585
|
constructor(e, t) {
|
|
6586
|
-
k(this,
|
|
6587
|
-
n(
|
|
6586
|
+
k(this, th), c(this, qm, void 0), c(this, Jm, void 0), c(this, Ym, void 0), c(this, Xm, /* @__PURE__ */ new Map()), c(this, Zm, /* @__PURE__ */ new Set()), c(this, Qm, a.get().createContext("WebSocketConnection")), c(this, $m, performance.now()), c(this, eh, new Set(Array(127).fill(0).map((e, t) => t + 1))), n(qm, this, e), n(Jm, this, t), n(Ym, this, new ReadableStream(new eu(e)).getReader()), i(qm, this).addEventListener("message", () => {
|
|
6587
|
+
n($m, this, performance.now());
|
|
6588
6588
|
}), i(qm, this).addEventListener("close", (e) => {
|
|
6589
|
-
i(
|
|
6589
|
+
i(Qm, this).info("WebSocket closed", {
|
|
6590
6590
|
code: e.code,
|
|
6591
6591
|
reason: e.reason,
|
|
6592
6592
|
wasClean: e.wasClean
|
|
6593
|
-
}), i(Jm, this).markPostHandshake(), i(
|
|
6593
|
+
}), i(Jm, this).markPostHandshake(), i(Xm, this).forEach((e) => e.close());
|
|
6594
6594
|
});
|
|
6595
6595
|
}
|
|
6596
6596
|
openSendStream() {
|
|
6597
|
-
let e = i(
|
|
6597
|
+
let e = i(eh, this).values().next().value;
|
|
6598
6598
|
if (!e) throw Error("No stream IDs available");
|
|
6599
|
-
return i(
|
|
6599
|
+
return i(eh, this).delete(e), Promise.resolve(new Wm(new Ou(i(qm, this)), e, () => o(th, this, rh).call(this, e)));
|
|
6600
6600
|
}
|
|
6601
6601
|
transportType() {
|
|
6602
6602
|
return "websocket";
|
|
@@ -6605,7 +6605,7 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
|
|
|
6605
6605
|
return i(qm, this).url;
|
|
6606
6606
|
}
|
|
6607
6607
|
lastReceived() {
|
|
6608
|
-
return i(
|
|
6608
|
+
return i($m, this);
|
|
6609
6609
|
}
|
|
6610
6610
|
afterHandshake() {
|
|
6611
6611
|
return i(Jm, this).postHandshake();
|
|
@@ -6614,42 +6614,32 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
|
|
|
6614
6614
|
var e = this;
|
|
6615
6615
|
return t(function* () {
|
|
6616
6616
|
for (;;) {
|
|
6617
|
-
n
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
})();
|
|
6638
|
-
},
|
|
6639
|
-
cancel: () => o(nh, e, ah).call(e, l, n, r)
|
|
6640
|
-
});
|
|
6641
|
-
if (i(Zm, e).set(l, n), a || (i($m, e).debug("Closing new stream", { streamId: s }), i(Zm, e).delete(l), yield u.cancel()), c.length > 0) return yield Wl(new su(c, u), s);
|
|
6642
|
-
}
|
|
6643
|
-
} finally {
|
|
6644
|
-
var r;
|
|
6645
|
-
(r = i(Xm, e)) == null || r.releaseLock();
|
|
6617
|
+
let { value: n, done: r } = yield i(Ym, e).read();
|
|
6618
|
+
if (r) return;
|
|
6619
|
+
let [a, s, c] = n, l = D(s);
|
|
6620
|
+
if (i(Zm, e).has(l)) a || i(Zm, e).delete(l);
|
|
6621
|
+
else if (i(Xm, e).has(l)) {
|
|
6622
|
+
let t = i(Xm, e).get(l);
|
|
6623
|
+
if (!t) throw Error("Stream not found");
|
|
6624
|
+
c.length > 0 && (yield t.push(c)), a || (i(Qm, e).debug("Closing stream", { streamId: s }), t.close(), i(Xm, e).delete(l), i(Zm, e).delete(l));
|
|
6625
|
+
} else {
|
|
6626
|
+
i(Qm, e).debug("Creating new stream", { streamId: s });
|
|
6627
|
+
let [n, r] = te(1e3), u = new ReadableStream({
|
|
6628
|
+
pull(e) {
|
|
6629
|
+
return t(function* () {
|
|
6630
|
+
let t = yield r.pop();
|
|
6631
|
+
t ? e.enqueue(t) : e.close();
|
|
6632
|
+
})();
|
|
6633
|
+
},
|
|
6634
|
+
cancel: () => o(th, e, ih).call(e, l, n, r)
|
|
6635
|
+
});
|
|
6636
|
+
if (i(Xm, e).set(l, n), a || (i(Qm, e).debug("Closing new stream", { streamId: s }), i(Xm, e).delete(l), yield u.cancel()), c.length > 0) return yield Wl(new su(c, u), s);
|
|
6646
6637
|
}
|
|
6647
6638
|
}
|
|
6648
6639
|
})();
|
|
6649
6640
|
}
|
|
6650
6641
|
close() {
|
|
6651
|
-
|
|
6652
|
-
return i(Jm, this).cancel().catch(b), i(Ym, this).cancel("closing").catch(b), (e = i(Xm, this)) == null || e.cancel("closing").catch(b), i(qm, this).close();
|
|
6642
|
+
return i(Jm, this).cancel().catch(b), i(Ym, this).cancel("closing").catch(b), i(qm, this).close();
|
|
6653
6643
|
}
|
|
6654
6644
|
closed() {
|
|
6655
6645
|
return Promise.resolve();
|
|
@@ -6667,87 +6657,87 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
|
|
|
6667
6657
|
})();
|
|
6668
6658
|
}
|
|
6669
6659
|
};
|
|
6670
|
-
function
|
|
6671
|
-
i(
|
|
6660
|
+
function rh(e) {
|
|
6661
|
+
i(eh, this).add(e);
|
|
6672
6662
|
}
|
|
6673
|
-
function
|
|
6674
|
-
i(
|
|
6663
|
+
function ih(e, n, r) {
|
|
6664
|
+
i(Xm, this).get(e) === n && (i(Qm, this).debug("Discarding cancelled stream", { streamId: e }), i(Xm, this).delete(e), i(Zm, this).add(e), n.close(), t(function* () {
|
|
6675
6665
|
for (; yield r.pop(););
|
|
6676
6666
|
})().catch(b));
|
|
6677
6667
|
}
|
|
6678
6668
|
// ../../libs/moq/src/transport/WebTransportConnection.ts
|
|
6679
|
-
var
|
|
6669
|
+
var ah = 3, oh = 32, sh = 250, ch = (e, t = performance.now()) => e.acceptedAt + sh - t, lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakMap(), fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakSet(), xh = class {
|
|
6680
6670
|
constructor(e, t, r) {
|
|
6681
|
-
k(this,
|
|
6682
|
-
n(
|
|
6683
|
-
}), n(
|
|
6684
|
-
i(
|
|
6685
|
-
}), i(
|
|
6686
|
-
n(
|
|
6671
|
+
k(this, bh), c(this, lh, void 0), c(this, uh, void 0), c(this, dh, []), c(this, fh, void 0), c(this, ph, !1), c(this, mh, void 0), c(this, hh, 0), c(this, gh, !1), c(this, _h, performance.now()), c(this, vh, a.get().createContext("WebTransportConnection")), c(this, yh, () => {
|
|
6672
|
+
n(_h, this, performance.now());
|
|
6673
|
+
}), n(mh, this, r), n(lh, this, e), n(uh, this, t), o(bh, this, Sh).call(this).catch((e) => {
|
|
6674
|
+
i(vh, this).warn("Incoming streams handling ended with error", e), i(uh, this).markPostHandshake();
|
|
6675
|
+
}), i(lh, this).closed.finally(() => {
|
|
6676
|
+
n(gh, this, !0), i(uh, this).markPostHandshake(), o(bh, this, Eh).call(this);
|
|
6687
6677
|
}).catch(b);
|
|
6688
6678
|
}
|
|
6689
6679
|
openSendStream() {
|
|
6690
6680
|
var e = this;
|
|
6691
6681
|
return t(function* () {
|
|
6692
|
-
return new Su(yield i(
|
|
6682
|
+
return new Su(yield i(lh, e).createUnidirectionalStream());
|
|
6693
6683
|
})();
|
|
6694
6684
|
}
|
|
6695
6685
|
transportType() {
|
|
6696
6686
|
return "webtransport";
|
|
6697
6687
|
}
|
|
6698
6688
|
url() {
|
|
6699
|
-
return i(
|
|
6689
|
+
return i(mh, this);
|
|
6700
6690
|
}
|
|
6701
6691
|
lastReceived() {
|
|
6702
|
-
return i(
|
|
6692
|
+
return i(_h, this);
|
|
6703
6693
|
}
|
|
6704
6694
|
afterHandshake() {
|
|
6705
|
-
return i(
|
|
6695
|
+
return i(uh, this).postHandshake();
|
|
6706
6696
|
}
|
|
6707
6697
|
closed() {
|
|
6708
6698
|
var e = this;
|
|
6709
6699
|
return t(function* () {
|
|
6710
|
-
yield i(
|
|
6700
|
+
yield i(lh, e).closed.catch(b);
|
|
6711
6701
|
})();
|
|
6712
6702
|
}
|
|
6713
6703
|
close(e) {
|
|
6714
|
-
i(
|
|
6704
|
+
i(gh, this) || (n(gh, this, !0), o(bh, this, Eh).call(this), i(lh, this).close(e));
|
|
6715
6705
|
}
|
|
6716
6706
|
writeMessage(e) {
|
|
6717
6707
|
var n = this;
|
|
6718
6708
|
return t(function* () {
|
|
6719
|
-
yield i(
|
|
6709
|
+
yield i(uh, n).write(e);
|
|
6720
6710
|
})();
|
|
6721
6711
|
}
|
|
6722
6712
|
readMessage() {
|
|
6723
6713
|
var e = this;
|
|
6724
6714
|
return t(function* () {
|
|
6725
|
-
return i(
|
|
6715
|
+
return i(uh, e).read();
|
|
6726
6716
|
})();
|
|
6727
6717
|
}
|
|
6728
6718
|
objectStream() {
|
|
6729
6719
|
var e = this;
|
|
6730
6720
|
return t(function* () {
|
|
6731
6721
|
for (;;) {
|
|
6732
|
-
if (i(
|
|
6722
|
+
if (i(gh, e)) return;
|
|
6733
6723
|
let t = performance.now(), n;
|
|
6734
|
-
for (let r = 0; r < i(
|
|
6735
|
-
let a = i(
|
|
6736
|
-
if (a.groups) return i(
|
|
6737
|
-
if (
|
|
6738
|
-
i(
|
|
6724
|
+
for (let r = 0; r < i(dh, e).length; r++) {
|
|
6725
|
+
let a = i(dh, e)[r];
|
|
6726
|
+
if (a.groups) return i(dh, e).splice(r, 1), o(bh, e, wh).call(e), a.groups;
|
|
6727
|
+
if (ch(a, t) > 0) {
|
|
6728
|
+
i(dh, e).some((e) => e.groups) && (n = ch(a, t));
|
|
6739
6729
|
break;
|
|
6740
6730
|
}
|
|
6741
6731
|
}
|
|
6742
|
-
if (i(
|
|
6743
|
-
yield o(
|
|
6732
|
+
if (i(ph, e) && i(dh, e).length === 0) return;
|
|
6733
|
+
yield o(bh, e, Ch).call(e, n);
|
|
6744
6734
|
}
|
|
6745
6735
|
})();
|
|
6746
6736
|
}
|
|
6747
6737
|
getStats() {
|
|
6748
6738
|
var e = this;
|
|
6749
6739
|
return t(function* () {
|
|
6750
|
-
let t = i(
|
|
6740
|
+
let t = i(lh, e);
|
|
6751
6741
|
if (typeof t.getStats != "function") return;
|
|
6752
6742
|
let n = yield t.getStats();
|
|
6753
6743
|
if (n != null) return {
|
|
@@ -6757,85 +6747,85 @@ var oh = 3, sh = 32, ch = 250, lh = (e, t = performance.now()) => e.acceptedAt +
|
|
|
6757
6747
|
})();
|
|
6758
6748
|
}
|
|
6759
6749
|
};
|
|
6760
|
-
function
|
|
6750
|
+
function Sh() {
|
|
6761
6751
|
var e = this;
|
|
6762
6752
|
return t(function* () {
|
|
6763
|
-
let t = i(
|
|
6753
|
+
let t = i(lh, e).incomingUnidirectionalStreams.getReader();
|
|
6764
6754
|
try {
|
|
6765
6755
|
for (;;) {
|
|
6766
6756
|
var r, a;
|
|
6767
6757
|
let { value: s, done: c } = yield t.read();
|
|
6768
6758
|
if (c) return;
|
|
6769
|
-
for (; i(
|
|
6770
|
-
let t = i(
|
|
6759
|
+
for (; i(dh, e).length >= oh && !i(gh, e);) {
|
|
6760
|
+
let t = i(dh, e).find((e) => !e.groups);
|
|
6771
6761
|
if (!t) {
|
|
6772
|
-
yield o(
|
|
6762
|
+
yield o(bh, e, Ch).call(e);
|
|
6773
6763
|
continue;
|
|
6774
6764
|
}
|
|
6775
|
-
let n =
|
|
6776
|
-
n > 0 ? yield o(
|
|
6765
|
+
let n = ch(t);
|
|
6766
|
+
n > 0 ? yield o(bh, e, Ch).call(e, n) : o(bh, e, Th).call(e, t);
|
|
6777
6767
|
}
|
|
6778
|
-
if (i(
|
|
6768
|
+
if (i(gh, e)) {
|
|
6779
6769
|
s.cancel().catch(b);
|
|
6780
6770
|
return;
|
|
6781
6771
|
}
|
|
6782
|
-
let l = new su(/* @__PURE__ */ new Uint8Array(), s, i(
|
|
6772
|
+
let l = new su(/* @__PURE__ */ new Uint8Array(), s, i(yh, e)), u = (n(hh, e, (r = i(hh, e), a = r++, r)), a), d = {
|
|
6783
6773
|
reader: l,
|
|
6784
6774
|
streamId: u,
|
|
6785
6775
|
acceptedAt: performance.now()
|
|
6786
6776
|
};
|
|
6787
|
-
i(
|
|
6788
|
-
d.groups = t, o(
|
|
6777
|
+
i(dh, e).push(d), Wl(l, u).then((t) => {
|
|
6778
|
+
d.groups = t, o(bh, e, wh).call(e);
|
|
6789
6779
|
}, (t) => {
|
|
6790
|
-
let n = i(
|
|
6791
|
-
n < 0 || (i(
|
|
6780
|
+
let n = i(dh, e).indexOf(d);
|
|
6781
|
+
n < 0 || (i(dh, e).splice(n, 1), o(bh, e, Dh).call(e, t, u, l), o(bh, e, wh).call(e));
|
|
6792
6782
|
});
|
|
6793
6783
|
}
|
|
6794
6784
|
} finally {
|
|
6795
|
-
n(
|
|
6785
|
+
n(ph, e, !0), o(bh, e, wh).call(e);
|
|
6796
6786
|
}
|
|
6797
6787
|
})();
|
|
6798
6788
|
}
|
|
6799
|
-
function
|
|
6789
|
+
function Ch(e) {
|
|
6800
6790
|
var r = this;
|
|
6801
6791
|
return t(function* () {
|
|
6802
|
-
if (i(
|
|
6792
|
+
if (i(fh, r) != null || n(fh, r, new x()), e === void 0) return i(fh, r).promise;
|
|
6803
6793
|
let t = new AbortController();
|
|
6804
|
-
yield Promise.race([i(
|
|
6794
|
+
yield Promise.race([i(fh, r).promise, on(e, t.signal).catch(b)]), t.abort();
|
|
6805
6795
|
})();
|
|
6806
6796
|
}
|
|
6807
|
-
function
|
|
6797
|
+
function wh() {
|
|
6808
6798
|
var e;
|
|
6809
|
-
(e = i(
|
|
6799
|
+
(e = i(fh, this)) == null || e.resolve(), n(fh, this, void 0);
|
|
6810
6800
|
}
|
|
6811
|
-
function
|
|
6812
|
-
i(
|
|
6801
|
+
function Th(e) {
|
|
6802
|
+
i(dh, this).splice(i(dh, this).indexOf(e), 1), e.reader.close().catch(b), i(vh, this).warn("Cancelling object stream whose header stalled past its hold", { streamId: e.streamId }), o(bh, this, wh).call(this);
|
|
6813
6803
|
}
|
|
6814
|
-
function
|
|
6815
|
-
for (let { reader: e } of i(
|
|
6816
|
-
o(
|
|
6804
|
+
function Eh() {
|
|
6805
|
+
for (let { reader: e } of i(dh, this).splice(0)) e.close().catch(b);
|
|
6806
|
+
o(bh, this, wh).call(this);
|
|
6817
6807
|
}
|
|
6818
|
-
function
|
|
6808
|
+
function Dh(e, t, n) {
|
|
6819
6809
|
var r;
|
|
6820
|
-
if (n.close().catch(b), i(
|
|
6810
|
+
if (n.close().catch(b), i(gh, this)) return;
|
|
6821
6811
|
let a = qc(e), o = {
|
|
6822
6812
|
streamId: t,
|
|
6823
6813
|
error: e,
|
|
6824
6814
|
source: a == null ? void 0 : a.source,
|
|
6825
6815
|
streamErrorCode: (r = a == null ? void 0 : a.streamErrorCode) == null ? void 0 : r
|
|
6826
6816
|
};
|
|
6827
|
-
(a == null ? void 0 : a.source) === "stream" ? (Jc(e) ? i(
|
|
6828
|
-
closeCode:
|
|
6817
|
+
(a == null ? void 0 : a.source) === "stream" ? (Jc(e) ? i(vh, this).debug : i(vh, this).warn)("Discarding object stream whose header could not be read", o) : (i(vh, this).warn("Closing session after object stream header failure", o), this.close(a ? void 0 : {
|
|
6818
|
+
closeCode: ah,
|
|
6829
6819
|
reason: "Invalid object stream header"
|
|
6830
6820
|
}));
|
|
6831
6821
|
}
|
|
6832
6822
|
// ../../libs/moq/src/client.ts
|
|
6833
|
-
var
|
|
6834
|
-
function
|
|
6835
|
-
return
|
|
6823
|
+
var Oh = a.get().createContext("MoqClient");
|
|
6824
|
+
function kh(e) {
|
|
6825
|
+
return Ah.apply(this, arguments);
|
|
6836
6826
|
}
|
|
6837
|
-
function
|
|
6838
|
-
return
|
|
6827
|
+
function Ah() {
|
|
6828
|
+
return Ah = t(function* (e) {
|
|
6839
6829
|
var t;
|
|
6840
6830
|
ae(e.signal);
|
|
6841
6831
|
let n = new WebSocket(e.wsUrl || e.url);
|
|
@@ -6854,30 +6844,30 @@ function jh() {
|
|
|
6854
6844
|
i(), t(/* @__PURE__ */ Error("WebSocket closed before open"));
|
|
6855
6845
|
};
|
|
6856
6846
|
r = setTimeout(() => {
|
|
6857
|
-
i(), n.close(),
|
|
6847
|
+
i(), n.close(), Oh.warn("WebSocket connect timed out", { timeoutMs: yt }), t(/* @__PURE__ */ Error("WebSocket connect timed out"));
|
|
6858
6848
|
}, yt), n.addEventListener("error", a), n.addEventListener("open", o), n.addEventListener("close", s);
|
|
6859
6849
|
}), e.signal).catch(r), (t = e.signal) != null && t.aborted && r(E(e.signal));
|
|
6860
6850
|
let i = wf.wrapWebsocket(n), a = Df(i, e.role).catch((e) => {
|
|
6861
|
-
throw
|
|
6851
|
+
throw Oh.warn("MoQ handshake failed, closing WebSocket", { error: e }), n.close(), e;
|
|
6862
6852
|
});
|
|
6863
6853
|
if (!e.handshakePipelining) {
|
|
6864
6854
|
var o;
|
|
6865
6855
|
yield se(a, e.signal).catch(r), (o = e.signal) != null && o.aborted && r(E(e.signal));
|
|
6866
6856
|
}
|
|
6867
|
-
let s = new Am(new
|
|
6868
|
-
return
|
|
6857
|
+
let s = new Am(new nh(n, i), e.authToken);
|
|
6858
|
+
return Oh.info("connected", {
|
|
6869
6859
|
url: e.wsUrl || e.url,
|
|
6870
6860
|
transport: "websocket"
|
|
6871
6861
|
}), e.handshakePipelining && a.catch((e) => {
|
|
6872
6862
|
s.fail(e);
|
|
6873
6863
|
}), s;
|
|
6874
|
-
}),
|
|
6864
|
+
}), Ah.apply(this, arguments);
|
|
6875
6865
|
}
|
|
6876
|
-
function
|
|
6877
|
-
return
|
|
6866
|
+
function jh(e) {
|
|
6867
|
+
return Mh.apply(this, arguments);
|
|
6878
6868
|
}
|
|
6879
|
-
function
|
|
6880
|
-
return
|
|
6869
|
+
function Mh() {
|
|
6870
|
+
return Mh = t(function* (e, t = e.signal) {
|
|
6881
6871
|
ae(t);
|
|
6882
6872
|
let n = new WebTransport(e.url, {
|
|
6883
6873
|
congestionControl: "low-latency",
|
|
@@ -6891,29 +6881,29 @@ function Nh() {
|
|
|
6891
6881
|
window.removeEventListener("beforeunload", i);
|
|
6892
6882
|
}).catch(() => {})), yield se(Promise.race([n.ready, n.closed.then(() => Promise.reject(/* @__PURE__ */ Error("WebTransport closed")))]), t).catch(r);
|
|
6893
6883
|
let a = yield se(n.createBidirectionalStream(), t).catch(r), o = wf.wrapWebTransport(a), s = Df(o, e.role).catch((e) => {
|
|
6894
|
-
throw
|
|
6884
|
+
throw Oh.warn("MoQ handshake failed, closing WebTransport", { error: e }), n.close(), e;
|
|
6895
6885
|
});
|
|
6896
6886
|
e.handshakePipelining || (yield se(s, t).catch(r)), t != null && t.aborted && r(E(t));
|
|
6897
|
-
let c = new Am(new
|
|
6898
|
-
return
|
|
6887
|
+
let c = new Am(new xh(n, o, e.url.toString()), e.authToken);
|
|
6888
|
+
return Oh.info("connected", {
|
|
6899
6889
|
url: e.url,
|
|
6900
6890
|
transport: "webtransport"
|
|
6901
6891
|
}), e.handshakePipelining && s.catch((e) => {
|
|
6902
6892
|
c.fail(e);
|
|
6903
6893
|
}), c;
|
|
6904
|
-
}),
|
|
6894
|
+
}), Mh.apply(this, arguments);
|
|
6905
6895
|
}
|
|
6906
|
-
function
|
|
6907
|
-
return
|
|
6896
|
+
function Nh(e) {
|
|
6897
|
+
return Ph.apply(this, arguments);
|
|
6908
6898
|
}
|
|
6909
|
-
function
|
|
6910
|
-
return
|
|
6899
|
+
function Ph() {
|
|
6900
|
+
return Ph = t(function* (e) {
|
|
6911
6901
|
if (self.WebTransport && (e == null ? void 0 : e.preferredTransport) !== "websocket" && e.url.protocol.startsWith("https")) {
|
|
6912
6902
|
if (!e.websocketFallbackTimeoutMs) return {
|
|
6913
|
-
session: yield
|
|
6903
|
+
session: yield jh(e),
|
|
6914
6904
|
transportSelectionReason: void 0
|
|
6915
6905
|
};
|
|
6916
|
-
let t = new AbortController(), n = oe(e.signal, (e) => t.abort(e.reason)), r =
|
|
6906
|
+
let t = new AbortController(), n = oe(e.signal, (e) => t.abort(e.reason)), r = jh(e, t.signal).catch(() => void 0), i, a = new Promise((t) => {
|
|
6917
6907
|
i = setTimeout(() => t(void 0), e.websocketFallbackTimeoutMs);
|
|
6918
6908
|
}), o = yield Promise.race([r, a]).finally(() => {
|
|
6919
6909
|
clearTimeout(i), n();
|
|
@@ -6922,21 +6912,21 @@ function Fh() {
|
|
|
6922
6912
|
session: o,
|
|
6923
6913
|
transportSelectionReason: void 0
|
|
6924
6914
|
} : (t.abort(), r.then((e) => e == null ? void 0 : e.close()), {
|
|
6925
|
-
session: yield
|
|
6915
|
+
session: yield kh(e),
|
|
6926
6916
|
transportSelectionReason: "fallback"
|
|
6927
6917
|
});
|
|
6928
6918
|
}
|
|
6929
6919
|
let t;
|
|
6930
6920
|
return t = (e == null ? void 0 : e.preferredTransport) === "websocket" ? "disabled" : self.WebTransport ? "unavailable" : "unsupported", {
|
|
6931
|
-
session: yield
|
|
6921
|
+
session: yield kh(e),
|
|
6932
6922
|
transportSelectionReason: t
|
|
6933
6923
|
};
|
|
6934
|
-
}),
|
|
6924
|
+
}), Ph.apply(this, arguments);
|
|
6935
6925
|
}
|
|
6936
6926
|
// ../../libs/moq/src/session/Track.ts
|
|
6937
|
-
var
|
|
6927
|
+
var Fh = /* @__PURE__ */ new WeakMap(), Ih = class {
|
|
6938
6928
|
constructor() {
|
|
6939
|
-
c(this,
|
|
6929
|
+
c(this, Fh, {
|
|
6940
6930
|
name: "",
|
|
6941
6931
|
priority: 0,
|
|
6942
6932
|
groupOrder: "ascending",
|
|
@@ -6944,16 +6934,16 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
|
|
|
6944
6934
|
});
|
|
6945
6935
|
}
|
|
6946
6936
|
name(e) {
|
|
6947
|
-
return i(
|
|
6937
|
+
return i(Fh, this).name = e, this;
|
|
6948
6938
|
}
|
|
6949
6939
|
priority(e) {
|
|
6950
|
-
return i(
|
|
6940
|
+
return i(Fh, this).priority = e, this;
|
|
6951
6941
|
}
|
|
6952
6942
|
groupOrder(e) {
|
|
6953
|
-
return i(
|
|
6943
|
+
return i(Fh, this).groupOrder = e, this;
|
|
6954
6944
|
}
|
|
6955
6945
|
startGroup(e) {
|
|
6956
|
-
return i(
|
|
6946
|
+
return i(Fh, this).filterType = {
|
|
6957
6947
|
type: "absolute-start",
|
|
6958
6948
|
start: {
|
|
6959
6949
|
group: e,
|
|
@@ -6962,7 +6952,7 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
|
|
|
6962
6952
|
}, this;
|
|
6963
6953
|
}
|
|
6964
6954
|
range(e, t) {
|
|
6965
|
-
return i(
|
|
6955
|
+
return i(Fh, this).filterType = {
|
|
6966
6956
|
type: "absolute-range",
|
|
6967
6957
|
start: {
|
|
6968
6958
|
group: e,
|
|
@@ -6975,70 +6965,70 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
|
|
|
6975
6965
|
}, this;
|
|
6976
6966
|
}
|
|
6977
6967
|
build() {
|
|
6978
|
-
return i(
|
|
6968
|
+
return i(Fh, this);
|
|
6979
6969
|
}
|
|
6980
|
-
},
|
|
6970
|
+
}, Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = class {
|
|
6981
6971
|
constructor(e, t) {
|
|
6982
|
-
c(this,
|
|
6972
|
+
c(this, Lh, void 0), c(this, Rh, void 0), n(Lh, this, e), n(Rh, this, t);
|
|
6983
6973
|
}
|
|
6984
6974
|
subscribe(e, t = /* @__PURE__ */ new Map()) {
|
|
6985
|
-
return i(
|
|
6975
|
+
return i(Lh, this).subscribe(this.namespace(), e, t);
|
|
6986
6976
|
}
|
|
6987
6977
|
closed() {
|
|
6988
|
-
return i(
|
|
6978
|
+
return i(Lh, this).closed();
|
|
6989
6979
|
}
|
|
6990
6980
|
namespace() {
|
|
6991
|
-
return i(
|
|
6981
|
+
return i(Rh, this).namespace;
|
|
6992
6982
|
}
|
|
6993
6983
|
};
|
|
6994
6984
|
// ../../libs/voq-catalog/src/catalog/Catalog.ts
|
|
6995
|
-
function
|
|
6985
|
+
function Bh(e, t) {
|
|
6996
6986
|
return t ? [
|
|
6997
6987
|
"com.vindral.moq",
|
|
6998
6988
|
e,
|
|
6999
6989
|
t
|
|
7000
6990
|
] : ["com.vindral.moq", e];
|
|
7001
6991
|
}
|
|
7002
|
-
function
|
|
6992
|
+
function Vh(e) {
|
|
7003
6993
|
let t = e[1];
|
|
7004
6994
|
if (!t) throw Error("namespace must contain a channel ID");
|
|
7005
6995
|
return t;
|
|
7006
6996
|
}
|
|
7007
|
-
function
|
|
6997
|
+
function Hh(e) {
|
|
7008
6998
|
return "tracks" in e;
|
|
7009
6999
|
}
|
|
7010
|
-
function
|
|
7000
|
+
function Uh(e) {
|
|
7011
7001
|
let t = new TextDecoder().decode(e);
|
|
7012
7002
|
return JSON.parse(t);
|
|
7013
7003
|
}
|
|
7014
7004
|
// ../../libs/voq/src/tracks/Track.ts
|
|
7015
|
-
var
|
|
7016
|
-
|
|
7017
|
-
var
|
|
7005
|
+
var Wh, Gh = 2e3, Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet();
|
|
7006
|
+
Wh = Symbol.asyncIterator;
|
|
7007
|
+
var og = class e {
|
|
7018
7008
|
constructor(e, r) {
|
|
7019
7009
|
var a = this;
|
|
7020
|
-
k(this, Y), c(this,
|
|
7010
|
+
k(this, Y), c(this, Kh, void 0), c(this, qh, void 0), c(this, Jh, new S(100)), c(this, Yh, void 0), c(this, Xh, !1), c(this, Zh, void 0), c(this, Qh, void 0), c(this, $h, !1), c(this, eg, /* @__PURE__ */ new Set()), c(this, tg, !1), c(this, ng, !1), c(this, rg, !1), c(this, ig, void 0), c(this, ag, function() {
|
|
7021
7011
|
var e = t(function* (e) {
|
|
7022
|
-
if (e === void 0) return i(
|
|
7023
|
-
if (n(
|
|
7012
|
+
if (e === void 0) return i(Kh, a).close();
|
|
7013
|
+
if (n(Xh, a, !0), i(Yh, a)) for (let t of i(Yh, a)) t > e && i(Yh, a).delete(t);
|
|
7024
7014
|
else {
|
|
7025
|
-
let t = i(
|
|
7026
|
-
n(
|
|
7015
|
+
let t = i(Jh, a).items().reduce((e, t) => e < t ? e : t, e);
|
|
7016
|
+
n(Yh, a, o(Y, a, yg).call(a, t, e));
|
|
7027
7017
|
}
|
|
7028
|
-
o(Y, a,
|
|
7018
|
+
o(Y, a, sg).call(a, !0);
|
|
7029
7019
|
});
|
|
7030
7020
|
return function(t) {
|
|
7031
7021
|
return e.apply(this, arguments);
|
|
7032
7022
|
};
|
|
7033
|
-
}()), n(
|
|
7023
|
+
}()), n(Kh, this, e), n(qh, this, r), e.done().then(function() {
|
|
7034
7024
|
var e = t(function* (e) {
|
|
7035
7025
|
var t;
|
|
7036
|
-
return i(
|
|
7026
|
+
return i(ag, a).call(a, (t = e.finalInfo) == null ? void 0 : t.group);
|
|
7037
7027
|
});
|
|
7038
7028
|
return function(t) {
|
|
7039
7029
|
return e.apply(this, arguments);
|
|
7040
7030
|
};
|
|
7041
|
-
}()).catch(b), n(
|
|
7031
|
+
}()).catch(b), n(ig, this, e.groups());
|
|
7042
7032
|
}
|
|
7043
7033
|
static subscribe(n, r) {
|
|
7044
7034
|
return t(function* () {
|
|
@@ -7047,161 +7037,161 @@ var sg = class e {
|
|
|
7047
7037
|
})();
|
|
7048
7038
|
}
|
|
7049
7039
|
subscribeId() {
|
|
7050
|
-
return i(
|
|
7040
|
+
return i(Kh, this).id;
|
|
7051
7041
|
}
|
|
7052
7042
|
name() {
|
|
7053
|
-
return i(
|
|
7043
|
+
return i(Kh, this).name;
|
|
7054
7044
|
}
|
|
7055
7045
|
largestGroupId() {
|
|
7056
|
-
return i(
|
|
7046
|
+
return i(qh, this);
|
|
7057
7047
|
}
|
|
7058
7048
|
needsRenewal() {
|
|
7059
|
-
return i(
|
|
7049
|
+
return i(Kh, this).expiryState() === "active" && i(Yh, this) === void 0;
|
|
7060
7050
|
}
|
|
7061
7051
|
endOfTrack(e) {
|
|
7062
7052
|
var n = this;
|
|
7063
7053
|
return t(function* () {
|
|
7064
|
-
if (i(
|
|
7065
|
-
let t = i(
|
|
7054
|
+
if (i(Xh, n)) return o(Y, n, dg).call(n, void 0, e);
|
|
7055
|
+
let t = i(Jh, n).items().reduce((e, t) => e < t ? e : t, e);
|
|
7066
7056
|
return n.update(t, e);
|
|
7067
7057
|
})();
|
|
7068
7058
|
}
|
|
7069
7059
|
update(e, r) {
|
|
7070
7060
|
var a = this;
|
|
7071
7061
|
return t(function* () {
|
|
7072
|
-
return i(
|
|
7062
|
+
return i(Xh, a) ? o(Y, a, dg).call(a, e, r) : (n(Yh, a, o(Y, a, yg).call(a, e, r)), i(Yh, a).size === 0 && (yield i(Kh, a).close()), i(Kh, a).update(e, r));
|
|
7073
7063
|
})();
|
|
7074
7064
|
}
|
|
7075
7065
|
unsubscribe() {
|
|
7076
|
-
return i(
|
|
7066
|
+
return i(Kh, this).unsubscribe();
|
|
7077
7067
|
}
|
|
7078
7068
|
next() {
|
|
7079
7069
|
var e = this;
|
|
7080
7070
|
return t(function* () {
|
|
7081
|
-
n(
|
|
7071
|
+
n(rg, e, !0), o(Y, e, cg).call(e);
|
|
7082
7072
|
try {
|
|
7083
|
-
return yield o(Y, e,
|
|
7073
|
+
return yield o(Y, e, pg).call(e);
|
|
7084
7074
|
} finally {
|
|
7085
|
-
n(
|
|
7075
|
+
n(rg, e, !1), clearTimeout(i(Qh, e));
|
|
7086
7076
|
}
|
|
7087
7077
|
})();
|
|
7088
7078
|
}
|
|
7089
7079
|
return() {
|
|
7090
7080
|
var e;
|
|
7091
|
-
return (e = i(
|
|
7081
|
+
return (e = i(Kh, this).close()) == null || e.catch(b), n(tg, this, !0), o(Y, this, ug).call(this), o(Y, this, _g).call(this), i(Kh, this).return();
|
|
7092
7082
|
}
|
|
7093
|
-
[
|
|
7083
|
+
[Wh]() {
|
|
7094
7084
|
return this;
|
|
7095
7085
|
}
|
|
7096
7086
|
};
|
|
7097
|
-
function
|
|
7087
|
+
function sg(e) {
|
|
7098
7088
|
var t;
|
|
7099
|
-
i(
|
|
7089
|
+
i(ng, this) || (((t = i(Yh, this)) == null ? void 0 : t.size) === 0 ? o(Y, this, lg).call(this) : e && o(Y, this, cg).call(this));
|
|
7100
7090
|
}
|
|
7101
|
-
function
|
|
7102
|
-
!i(
|
|
7091
|
+
function cg() {
|
|
7092
|
+
!i(ng, this) && i(Xh, this) && i(rg, this) && (clearTimeout(i(Qh, this)), n(Qh, this, setTimeout(() => o(Y, this, lg).call(this), Gh)));
|
|
7103
7093
|
}
|
|
7104
|
-
function
|
|
7105
|
-
if (o(Y, this,
|
|
7094
|
+
function lg() {
|
|
7095
|
+
if (o(Y, this, ug).call(this), o(Y, this, _g).call(this), !i(tg, this)) {
|
|
7106
7096
|
var e;
|
|
7107
|
-
(e = i(
|
|
7097
|
+
(e = i(Kh, this).close()) == null || e.catch(b);
|
|
7108
7098
|
}
|
|
7109
7099
|
}
|
|
7110
|
-
function
|
|
7111
|
-
n(
|
|
7100
|
+
function ug() {
|
|
7101
|
+
n(ng, this, !0), clearTimeout(i(Qh, this));
|
|
7112
7102
|
}
|
|
7113
|
-
function
|
|
7103
|
+
function dg(e, t) {
|
|
7114
7104
|
var r;
|
|
7115
|
-
let a = i(
|
|
7105
|
+
let a = i(Zh, this), s = e == null ? D(0) : e, c = {
|
|
7116
7106
|
startGroup: a && a.startGroup > s ? a.startGroup : s,
|
|
7117
7107
|
endGroup: a && a.endGroup < t ? a.endGroup : t
|
|
7118
7108
|
};
|
|
7119
|
-
n(
|
|
7120
|
-
for (let e of (r = i(
|
|
7109
|
+
n(Zh, this, c);
|
|
7110
|
+
for (let e of (r = i(Yh, this)) == null ? [] : r) if (!o(Y, this, fg).call(this, e)) {
|
|
7121
7111
|
var l;
|
|
7122
|
-
(l = i(
|
|
7112
|
+
(l = i(Yh, this)) == null || l.delete(e);
|
|
7123
7113
|
}
|
|
7124
|
-
o(Y, this,
|
|
7114
|
+
o(Y, this, sg).call(this, !1);
|
|
7125
7115
|
}
|
|
7126
|
-
function
|
|
7127
|
-
let t = i(
|
|
7116
|
+
function fg(e) {
|
|
7117
|
+
let t = i(Zh, this);
|
|
7128
7118
|
return !t || e >= t.startGroup && e <= t.endGroup;
|
|
7129
7119
|
}
|
|
7130
|
-
function
|
|
7120
|
+
function pg() {
|
|
7131
7121
|
var e = this;
|
|
7132
7122
|
return t(function* () {
|
|
7133
7123
|
let t = !1;
|
|
7134
7124
|
for (;;) {
|
|
7135
|
-
if (i(
|
|
7125
|
+
if (i(Yh, e) && i(Yh, e).size === 0) return t ? o(Y, e, mg).call(e) : {
|
|
7136
7126
|
done: !0,
|
|
7137
7127
|
value: void 0
|
|
7138
7128
|
};
|
|
7139
7129
|
let n;
|
|
7140
7130
|
try {
|
|
7141
|
-
n = yield o(Y, e,
|
|
7131
|
+
n = yield o(Y, e, gg).call(e, () => i(ig, e).next());
|
|
7142
7132
|
} catch (n) {
|
|
7143
|
-
if (t) return o(Y, e,
|
|
7133
|
+
if (t) return o(Y, e, mg).call(e);
|
|
7144
7134
|
throw n;
|
|
7145
7135
|
}
|
|
7146
|
-
if (n === void 0) return o(Y, e,
|
|
7136
|
+
if (n === void 0) return o(Y, e, mg).call(e);
|
|
7147
7137
|
if (n.done) return n;
|
|
7148
|
-
if (o(Y, e,
|
|
7149
|
-
if (!(yield o(Y, e,
|
|
7138
|
+
if (o(Y, e, fg).call(e, n.value.groupId())) return o(Y, e, vg).call(e, n);
|
|
7139
|
+
if (!(yield o(Y, e, hg).call(e, n.value))) return o(Y, e, mg).call(e);
|
|
7150
7140
|
t = !0;
|
|
7151
7141
|
}
|
|
7152
7142
|
})();
|
|
7153
7143
|
}
|
|
7154
|
-
function
|
|
7144
|
+
function mg() {
|
|
7155
7145
|
var e, t, n;
|
|
7156
|
-
return (e = i(
|
|
7146
|
+
return (e = i(Yh, this)) == null || e.clear(), o(Y, this, lg).call(this), (t = (n = i(ig, this)).return) == null || (t = t.call(n)) == null || t.catch(b), {
|
|
7157
7147
|
done: !0,
|
|
7158
7148
|
value: void 0
|
|
7159
7149
|
};
|
|
7160
7150
|
}
|
|
7161
|
-
function
|
|
7151
|
+
function hg(e) {
|
|
7162
7152
|
var n = this;
|
|
7163
7153
|
return t(function* () {
|
|
7164
7154
|
var t;
|
|
7165
|
-
return !i(
|
|
7155
|
+
return !i(tg, n) && (t = yield o(Y, n, gg).call(n, () => {
|
|
7166
7156
|
var t, n;
|
|
7167
7157
|
return ((t = (n = e.return) == null ? void 0 : n.call(e)) == null ? Promise.resolve() : t).then(() => !0, () => !1);
|
|
7168
7158
|
})) != null && t;
|
|
7169
7159
|
})();
|
|
7170
7160
|
}
|
|
7171
|
-
function
|
|
7161
|
+
function gg(e) {
|
|
7172
7162
|
var n = this;
|
|
7173
7163
|
return t(function* () {
|
|
7174
|
-
if (i(
|
|
7164
|
+
if (i($h, n)) return;
|
|
7175
7165
|
let t = e(), r, a = new Promise((e) => {
|
|
7176
7166
|
r = () => e(void 0);
|
|
7177
7167
|
});
|
|
7178
|
-
i(
|
|
7168
|
+
i(eg, n).add(r);
|
|
7179
7169
|
try {
|
|
7180
7170
|
return yield Promise.race([t, a]);
|
|
7181
7171
|
} finally {
|
|
7182
|
-
i(
|
|
7172
|
+
i(eg, n).delete(r);
|
|
7183
7173
|
}
|
|
7184
7174
|
})();
|
|
7185
7175
|
}
|
|
7186
|
-
function
|
|
7187
|
-
n(
|
|
7188
|
-
for (let e of i(
|
|
7189
|
-
i(
|
|
7176
|
+
function _g() {
|
|
7177
|
+
n($h, this, !0);
|
|
7178
|
+
for (let e of i(eg, this)) e();
|
|
7179
|
+
i(eg, this).clear();
|
|
7190
7180
|
}
|
|
7191
|
-
function
|
|
7181
|
+
function vg(e) {
|
|
7192
7182
|
var t;
|
|
7193
7183
|
let r = e.value.groupId();
|
|
7194
|
-
return (t = i(
|
|
7184
|
+
return (t = i(Yh, this)) != null && t.delete(r) && i(Xh, this) && o(Y, this, sg).call(this, !0), i(Jh, this).push(r), i(qh, this) || n(qh, this, r), n(qh, this, i(qh, this) < r ? r : i(qh, this)), e;
|
|
7195
7185
|
}
|
|
7196
|
-
function
|
|
7186
|
+
function yg(e, t) {
|
|
7197
7187
|
let n = /* @__PURE__ */ new Set();
|
|
7198
7188
|
for (let r = e; r <= t; r++) n == null || n.add(r);
|
|
7199
|
-
return i(
|
|
7189
|
+
return i(Jh, this).items().forEach((e) => {
|
|
7200
7190
|
n == null || n.delete(e);
|
|
7201
7191
|
}), n;
|
|
7202
7192
|
}
|
|
7203
7193
|
// \0@oxc-project+runtime@0.156.0/helpers/esm/asyncGeneratorDelegate.js
|
|
7204
|
-
function
|
|
7194
|
+
function bg(e) {
|
|
7205
7195
|
var t = {}, n = !1;
|
|
7206
7196
|
function r(t, r) {
|
|
7207
7197
|
return n = !0, r = new Promise(function(n) {
|
|
@@ -7223,24 +7213,24 @@ function xg(e) {
|
|
|
7223
7213
|
}), t;
|
|
7224
7214
|
}
|
|
7225
7215
|
// ../../libs/voq/src/tracks/Renewable.ts
|
|
7226
|
-
var
|
|
7227
|
-
|
|
7228
|
-
var
|
|
7216
|
+
var xg, Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakSet(), Dg = /* @__PURE__ */ new WeakMap();
|
|
7217
|
+
xg = Symbol.asyncIterator;
|
|
7218
|
+
var Og = class e {
|
|
7229
7219
|
constructor(e) {
|
|
7230
7220
|
var r = this;
|
|
7231
|
-
k(this,
|
|
7221
|
+
k(this, Eg), c(this, Sg, void 0), c(this, Cg, void 0), c(this, wg, new ie(10)), c(this, Tg, void 0), c(this, Dg, function() {
|
|
7232
7222
|
var e = t(function* (e, t) {
|
|
7233
7223
|
try {
|
|
7234
7224
|
var n = Ap();
|
|
7235
|
-
let a = n.u(yield i(
|
|
7225
|
+
let a = n.u(yield i(Sg, r).lock()), s = { subscribeId: a.value.subscribeId() };
|
|
7236
7226
|
if (!a.value.needsRenewal()) {
|
|
7237
|
-
i(
|
|
7227
|
+
i(Tg, r).debug("Subscription does not need renewal", s);
|
|
7238
7228
|
return;
|
|
7239
7229
|
}
|
|
7240
|
-
let c = a.value.largestGroupId(), l = c !== void 0, u = new
|
|
7241
|
-
switch (s.largestGroupId = c, i(
|
|
7230
|
+
let c = a.value.largestGroupId(), l = c !== void 0, u = new Ih().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
|
|
7231
|
+
switch (s.largestGroupId = c, i(Tg, r).debug("Renewing subscription", s), t.filterType.type) {
|
|
7242
7232
|
case "absolute-range":
|
|
7243
|
-
i(
|
|
7233
|
+
i(Tg, r).debug("Absolute range is not renewed", s);
|
|
7244
7234
|
return;
|
|
7245
7235
|
case "absolute-start":
|
|
7246
7236
|
case "latest-group":
|
|
@@ -7249,9 +7239,9 @@ var kg = class e {
|
|
|
7249
7239
|
let d = u.build();
|
|
7250
7240
|
s.newTrack = d;
|
|
7251
7241
|
let [f] = yield Promise.all([e.subscribe(d), l ? a.value.update(c, c) : a.value.unsubscribe()]);
|
|
7252
|
-
f.done().then((e) => o(
|
|
7253
|
-
let p = new
|
|
7254
|
-
a.value = p, yield i(
|
|
7242
|
+
f.done().then((e) => o(Eg, r, kg).call(r, f, e.finalInfo !== void 0)).catch(b), f.expiryNotification().then(() => i(Dg, r).call(r, e, d)).catch(b);
|
|
7243
|
+
let p = new og(f, c);
|
|
7244
|
+
a.value = p, yield i(wg, r).push(p), i(Tg, r).info("Subscription renewed", s);
|
|
7255
7245
|
} catch (e) {
|
|
7256
7246
|
n.e = e;
|
|
7257
7247
|
} finally {
|
|
@@ -7261,24 +7251,24 @@ var kg = class e {
|
|
|
7261
7251
|
return function(t, n) {
|
|
7262
7252
|
return e.apply(this, arguments);
|
|
7263
7253
|
};
|
|
7264
|
-
}()), n(
|
|
7254
|
+
}()), n(Sg, this, new Mt(e)), n(Cg, this, e), n(Tg, this, a.get().createContext(`Renewable '${e.name()}'`));
|
|
7265
7255
|
}
|
|
7266
7256
|
static subscribe(n, r, a) {
|
|
7267
7257
|
return t(function* () {
|
|
7268
|
-
let t = a == null ? void 0 : a.params, s = a == null ? void 0 : a.largestGroupId, c = yield n.subscribe(r, t), l = new e(new
|
|
7269
|
-
return c.done().then((e) => o(
|
|
7258
|
+
let t = a == null ? void 0 : a.params, s = a == null ? void 0 : a.largestGroupId, c = yield n.subscribe(r, t), l = new e(new og(c, s));
|
|
7259
|
+
return c.done().then((e) => o(Eg, l, kg).call(l, c, e.finalInfo !== void 0)).catch(b), c.expiryNotification().then(() => i(Dg, l).call(l, n, r)).catch(b), l;
|
|
7270
7260
|
})();
|
|
7271
7261
|
}
|
|
7272
7262
|
largestGroupId() {
|
|
7273
|
-
return i(
|
|
7263
|
+
return i(Sg, this).unsafeValue().largestGroupId();
|
|
7274
7264
|
}
|
|
7275
7265
|
update(e, n) {
|
|
7276
7266
|
var r = this;
|
|
7277
7267
|
return t(function* () {
|
|
7278
7268
|
try {
|
|
7279
7269
|
var t = Ap();
|
|
7280
|
-
let a = t.u(yield i(
|
|
7281
|
-
return i(
|
|
7270
|
+
let a = t.u(yield i(Sg, r).lock());
|
|
7271
|
+
return i(wg, r).close(), a.value.update(e, n);
|
|
7282
7272
|
} catch (e) {
|
|
7283
7273
|
t.e = e;
|
|
7284
7274
|
} finally {
|
|
@@ -7291,8 +7281,8 @@ var kg = class e {
|
|
|
7291
7281
|
return t(function* () {
|
|
7292
7282
|
try {
|
|
7293
7283
|
var t = Ap();
|
|
7294
|
-
let r = t.u(yield i(
|
|
7295
|
-
return i(
|
|
7284
|
+
let r = t.u(yield i(Sg, n).lock());
|
|
7285
|
+
return i(wg, n).close(), r.value.endOfTrack(e);
|
|
7296
7286
|
} catch (e) {
|
|
7297
7287
|
t.e = e;
|
|
7298
7288
|
} finally {
|
|
@@ -7305,8 +7295,8 @@ var kg = class e {
|
|
|
7305
7295
|
return t(function* () {
|
|
7306
7296
|
try {
|
|
7307
7297
|
var t = Ap();
|
|
7308
|
-
let n = t.u(yield i(
|
|
7309
|
-
return i(
|
|
7298
|
+
let n = t.u(yield i(Sg, e).lock());
|
|
7299
|
+
return i(wg, e).close(), n.value.unsubscribe();
|
|
7310
7300
|
} catch (e) {
|
|
7311
7301
|
t.e = e;
|
|
7312
7302
|
} finally {
|
|
@@ -7319,8 +7309,8 @@ var kg = class e {
|
|
|
7319
7309
|
return t(function* () {
|
|
7320
7310
|
try {
|
|
7321
7311
|
var t = Ap();
|
|
7322
|
-
let n = t.u(yield i(
|
|
7323
|
-
return i(
|
|
7312
|
+
let n = t.u(yield i(Sg, e).lock());
|
|
7313
|
+
return i(wg, e).close(), n.value.return();
|
|
7324
7314
|
} catch (e) {
|
|
7325
7315
|
t.e = e;
|
|
7326
7316
|
} finally {
|
|
@@ -7331,17 +7321,17 @@ var kg = class e {
|
|
|
7331
7321
|
next() {
|
|
7332
7322
|
var e = this;
|
|
7333
7323
|
return t(function* () {
|
|
7334
|
-
let t = yield i(
|
|
7324
|
+
let t = yield i(Cg, e).next();
|
|
7335
7325
|
if (t.done) {
|
|
7336
7326
|
var r, a;
|
|
7337
|
-
yield (r = (a = i(
|
|
7338
|
-
let t = yield i(
|
|
7339
|
-
if (t) return n(
|
|
7327
|
+
yield (r = (a = i(Cg, e)).return) == null ? void 0 : r.call(a);
|
|
7328
|
+
let t = yield i(wg, e).pop();
|
|
7329
|
+
if (t) return n(Cg, e, t), e.next();
|
|
7340
7330
|
}
|
|
7341
7331
|
return t;
|
|
7342
7332
|
})();
|
|
7343
7333
|
}
|
|
7344
|
-
[
|
|
7334
|
+
[xg]() {
|
|
7345
7335
|
return this;
|
|
7346
7336
|
}
|
|
7347
7337
|
objects() {
|
|
@@ -7351,7 +7341,7 @@ var kg = class e {
|
|
|
7351
7341
|
try {
|
|
7352
7342
|
for (var i = H(e), a; t = !(a = yield A(i.next())).done; t = !1) try {
|
|
7353
7343
|
var o = Ap();
|
|
7354
|
-
yield*
|
|
7344
|
+
yield* bg(H(o.a(a.value)));
|
|
7355
7345
|
} catch (e) {
|
|
7356
7346
|
o.e = e;
|
|
7357
7347
|
} finally {
|
|
@@ -7369,61 +7359,61 @@ var kg = class e {
|
|
|
7369
7359
|
})();
|
|
7370
7360
|
}
|
|
7371
7361
|
};
|
|
7372
|
-
function
|
|
7362
|
+
function kg(e, n) {
|
|
7373
7363
|
var r = this;
|
|
7374
7364
|
return t(function* () {
|
|
7375
|
-
if (e.unsubscribed() || e.endRequested()) i(
|
|
7376
|
-
else if (i(
|
|
7377
|
-
else if (n) i(
|
|
7365
|
+
if (e.unsubscribed() || e.endRequested()) i(Tg, r).info("Server initiated subscribe done but the subscription is already closing");
|
|
7366
|
+
else if (i(Sg, r).unsafeValue().subscribeId() !== e.id) i(Tg, r).info("subscribeId mismatch - the subscription already has been renewed");
|
|
7367
|
+
else if (n) i(wg, r).close();
|
|
7378
7368
|
else return r.return();
|
|
7379
7369
|
})();
|
|
7380
7370
|
}
|
|
7381
7371
|
// ../../libs/voq/src/tracks/Catalog.ts
|
|
7382
|
-
var
|
|
7383
|
-
function
|
|
7384
|
-
let t =
|
|
7385
|
-
if (!
|
|
7372
|
+
var Ag = "catalog";
|
|
7373
|
+
function jg(e) {
|
|
7374
|
+
let t = Uh(e.payload);
|
|
7375
|
+
if (!Hh(t)) throw Error("unexpected catalog type");
|
|
7386
7376
|
return t;
|
|
7387
7377
|
}
|
|
7388
|
-
var
|
|
7378
|
+
var Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakSet(), Lg = class e {
|
|
7389
7379
|
constructor(e, t, r) {
|
|
7390
|
-
k(this,
|
|
7380
|
+
k(this, Ig), c(this, Mg, void 0), c(this, Ng, void 0), c(this, Pg, void 0), c(this, Fg, void 0), n(Ng, this, e), n(Mg, this, t), n(Pg, this, r), n(Fg, this, o(Ig, this, Rg).call(this)), this.closed().finally(() => i(Mg, this).close()).catch(b);
|
|
7391
7381
|
}
|
|
7392
7382
|
catalog() {
|
|
7393
|
-
return i(
|
|
7383
|
+
return i(Mg, this);
|
|
7394
7384
|
}
|
|
7395
7385
|
closed() {
|
|
7396
|
-
return i(
|
|
7386
|
+
return i(Fg, this);
|
|
7397
7387
|
}
|
|
7398
7388
|
close() {
|
|
7399
7389
|
var e = this;
|
|
7400
7390
|
return t(function* () {
|
|
7401
|
-
return i(
|
|
7391
|
+
return i(Mg, e).close(), (yield i(Ng, e).promise).unsubscribe();
|
|
7402
7392
|
})();
|
|
7403
7393
|
}
|
|
7404
7394
|
static start(n, r) {
|
|
7405
7395
|
return t(function* () {
|
|
7406
|
-
let t = x.fromPromise(
|
|
7396
|
+
let t = x.fromPromise(Og.subscribe(n, new Ih().name(r.catalogName || Ag).groupOrder("ascending").build())), i = x.fromPromise(t.promise.then((e) => e.objects()));
|
|
7407
7397
|
if (r.catalog) return new e(t, new Vt(r.catalog), i);
|
|
7408
7398
|
let a = yield (yield i.promise).next();
|
|
7409
7399
|
if (!a.value) throw Error("No catalog found");
|
|
7410
|
-
let o =
|
|
7400
|
+
let o = jg(a.value);
|
|
7411
7401
|
return new e(t, new Vt(o), i);
|
|
7412
7402
|
})();
|
|
7413
7403
|
}
|
|
7414
7404
|
};
|
|
7415
|
-
function
|
|
7405
|
+
function Rg() {
|
|
7416
7406
|
var e = this;
|
|
7417
7407
|
return t(function* () {
|
|
7418
|
-
let t = yield i(
|
|
7408
|
+
let t = yield i(Pg, e).promise;
|
|
7419
7409
|
var n = !1, r = !1, a;
|
|
7420
7410
|
try {
|
|
7421
7411
|
for (var o = H(t), s; n = !(s = yield o.next()).done; n = !1) {
|
|
7422
7412
|
let t = s.value;
|
|
7423
7413
|
{
|
|
7424
7414
|
if (t.objectStatus !== al.Normal) continue;
|
|
7425
|
-
let n =
|
|
7426
|
-
i(
|
|
7415
|
+
let n = jg(t);
|
|
7416
|
+
i(Mg, e).update(n);
|
|
7427
7417
|
}
|
|
7428
7418
|
}
|
|
7429
7419
|
} catch (e) {
|
|
@@ -7438,51 +7428,51 @@ function zg() {
|
|
|
7438
7428
|
})();
|
|
7439
7429
|
}
|
|
7440
7430
|
// ../../libs/voq/src/tracks/Cmaf.ts
|
|
7441
|
-
var Bg, Vg, Hg, Ug, Wg, Gg, Kg, qg
|
|
7442
|
-
|
|
7443
|
-
var
|
|
7431
|
+
var zg, Bg, Vg, Hg, Ug, Wg, Gg, Kg, qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakSet();
|
|
7432
|
+
zg = wt(), Bg = Symbol.dispose;
|
|
7433
|
+
var n_ = class {
|
|
7444
7434
|
constructor(e, t) {
|
|
7445
|
-
k(this,
|
|
7435
|
+
k(this, t_), c(this, qg, void 0), c(this, Jg, void 0), c(this, Yg, void 0), c(this, Xg, void 0), c(this, Zg, void 0), c(this, Qg, void 0), c(this, $g, void 0), c(this, e_, 0), n(qg, this, e), n(Jg, this, t);
|
|
7446
7436
|
}
|
|
7447
7437
|
onFragment(e, t, r, a, o) {
|
|
7448
7438
|
var s;
|
|
7449
|
-
i(
|
|
7450
|
-
name: i(
|
|
7439
|
+
i(Yg, this) === void 0 && (n(Yg, this, e), n(Xg, this, t), n(Zg, this, r), n(Qg, this, a), i(qg, this).debug("group start", {
|
|
7440
|
+
name: i(Jg, this).name,
|
|
7451
7441
|
groupId: e,
|
|
7452
7442
|
startTimeMs: a,
|
|
7453
7443
|
endTimeMs: o,
|
|
7454
7444
|
subscribeId: t,
|
|
7455
7445
|
mediaType: r,
|
|
7456
|
-
namespace: i(
|
|
7457
|
-
})), n(
|
|
7446
|
+
namespace: i(Jg, this).namespace
|
|
7447
|
+
})), n(e_, this, (s = i(e_, this), s++, s)), n($g, this, o);
|
|
7458
7448
|
}
|
|
7459
|
-
[
|
|
7460
|
-
o(
|
|
7449
|
+
[zg]() {
|
|
7450
|
+
o(t_, this, r_).call(this);
|
|
7461
7451
|
}
|
|
7462
|
-
[
|
|
7463
|
-
o(
|
|
7452
|
+
[Bg]() {
|
|
7453
|
+
o(t_, this, r_).call(this);
|
|
7464
7454
|
}
|
|
7465
7455
|
};
|
|
7466
|
-
function
|
|
7467
|
-
i(
|
|
7468
|
-
name: i(
|
|
7469
|
-
groupId: i(
|
|
7470
|
-
startTimeMs: i(
|
|
7471
|
-
endTimeMs: i(
|
|
7472
|
-
durationMs: i(
|
|
7473
|
-
fragmentCount: i(
|
|
7474
|
-
subscribeId: i(
|
|
7475
|
-
mediaType: i(
|
|
7476
|
-
namespace: i(
|
|
7456
|
+
function r_() {
|
|
7457
|
+
i(Yg, this) !== void 0 && i(Qg, this) !== void 0 && i($g, this) !== void 0 && i(qg, this).debug("group end", {
|
|
7458
|
+
name: i(Jg, this).name,
|
|
7459
|
+
groupId: i(Yg, this),
|
|
7460
|
+
startTimeMs: i(Qg, this),
|
|
7461
|
+
endTimeMs: i($g, this),
|
|
7462
|
+
durationMs: i($g, this) - i(Qg, this),
|
|
7463
|
+
fragmentCount: i(e_, this),
|
|
7464
|
+
subscribeId: i(Xg, this),
|
|
7465
|
+
mediaType: i(Zg, this),
|
|
7466
|
+
namespace: i(Jg, this).namespace
|
|
7477
7467
|
});
|
|
7478
7468
|
}
|
|
7479
|
-
var
|
|
7480
|
-
|
|
7481
|
-
var
|
|
7469
|
+
var i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap(), s_ = /* @__PURE__ */ new WeakMap(), c_ = /* @__PURE__ */ new WeakSet();
|
|
7470
|
+
Vg = Symbol.asyncIterator, Hg = Ct(), Ug = Symbol.asyncDispose;
|
|
7471
|
+
var l_ = class {
|
|
7482
7472
|
constructor(t, r, i, o) {
|
|
7483
|
-
k(this,
|
|
7473
|
+
k(this, c_), c(this, i_, void 0), c(this, a_, void 0), c(this, o_, void 0), e(this, "track", void 0), c(this, s_, a.get().createContext("CmafGroup")), this.track = o, n(i_, this, i), n(a_, this, t), n(o_, this, r);
|
|
7484
7474
|
}
|
|
7485
|
-
[
|
|
7475
|
+
[Vg]() {
|
|
7486
7476
|
var e = this;
|
|
7487
7477
|
return Pt(function* () {
|
|
7488
7478
|
try {
|
|
@@ -7490,18 +7480,18 @@ var u_ = class {
|
|
|
7490
7480
|
let c = {
|
|
7491
7481
|
name: e.track.trackObject.name,
|
|
7492
7482
|
namespace: e.track.namespace
|
|
7493
|
-
}, l = t.u(new
|
|
7483
|
+
}, l = t.u(new n_(i(s_, e), c));
|
|
7494
7484
|
var n = !1, r = !1, a;
|
|
7495
7485
|
try {
|
|
7496
|
-
for (var o = H(i(
|
|
7486
|
+
for (var o = H(i(a_, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
|
|
7497
7487
|
let t = s.value;
|
|
7498
7488
|
{
|
|
7499
7489
|
if (t.objectStatus === al.EndOfTrackAndGroup && (yield A(e.track.endOfTrack(t.groupId))), t.objectStatus !== al.Normal) continue;
|
|
7500
|
-
let n = i(
|
|
7490
|
+
let n = i(o_, e).createFragment(t.payload), r = n.timescale(), a = n.baseMediaDecodeTime() / r * 1e3, o = a + n.duration() / r * 1e3, s = i(i_, e) / 1e3 * r;
|
|
7501
7491
|
n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - s);
|
|
7502
7492
|
let u = e.track.timestampRange();
|
|
7503
7493
|
if (u && a >= u[1]) break;
|
|
7504
|
-
i(
|
|
7494
|
+
i(s_, e).trace("fragment", p(p({}, c), {}, {
|
|
7505
7495
|
startTime: a,
|
|
7506
7496
|
endTime: o,
|
|
7507
7497
|
subscribeId: t.subscribeId,
|
|
@@ -7527,41 +7517,41 @@ var u_ = class {
|
|
|
7527
7517
|
}
|
|
7528
7518
|
})();
|
|
7529
7519
|
}
|
|
7530
|
-
[
|
|
7531
|
-
return o(
|
|
7520
|
+
[Hg]() {
|
|
7521
|
+
return o(c_, this, u_).call(this);
|
|
7532
7522
|
}
|
|
7533
|
-
[
|
|
7534
|
-
return o(
|
|
7523
|
+
[Ug]() {
|
|
7524
|
+
return o(c_, this, u_).call(this);
|
|
7535
7525
|
}
|
|
7536
7526
|
};
|
|
7537
|
-
function
|
|
7527
|
+
function u_() {
|
|
7538
7528
|
var e = this;
|
|
7539
7529
|
return t(function* () {
|
|
7540
7530
|
var t, n;
|
|
7541
|
-
return yield (t = (n = i(
|
|
7531
|
+
return yield (t = (n = i(a_, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
|
|
7542
7532
|
})();
|
|
7543
7533
|
}
|
|
7544
|
-
var
|
|
7545
|
-
|
|
7546
|
-
var
|
|
7534
|
+
var d_ = /* @__PURE__ */ new WeakMap(), f_ = /* @__PURE__ */ new WeakMap(), p_ = /* @__PURE__ */ new WeakMap(), m_ = /* @__PURE__ */ new WeakMap();
|
|
7535
|
+
Wg = Symbol.asyncIterator, Gg = Ct(), Kg = Symbol.asyncDispose;
|
|
7536
|
+
var h_ = class r {
|
|
7547
7537
|
constructor(t, r, i, a, o) {
|
|
7548
|
-
c(this,
|
|
7538
|
+
c(this, d_, void 0), c(this, f_, void 0), c(this, p_, void 0), c(this, m_, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = r, n(f_, this, i), n(d_, this, a), n(p_, this, o);
|
|
7549
7539
|
}
|
|
7550
7540
|
static subscribe(e, n, { timestampOffsetMs: i, startGroup: a, params: o }) {
|
|
7551
7541
|
return t(function* () {
|
|
7552
7542
|
if (n.format !== "cmaf") throw Error("format must be cmaf");
|
|
7553
|
-
let t = new
|
|
7543
|
+
let t = new Ih().name(n.name);
|
|
7554
7544
|
a !== void 0 && t.startGroup(a);
|
|
7555
7545
|
let s = t.build();
|
|
7556
7546
|
if (n.initTrack) {
|
|
7557
|
-
let t = new
|
|
7547
|
+
let t = new Ih().name(n.initTrack).build(), [c, l] = yield Promise.all([g_.call(r, e, t), Og.subscribe(e, s, {
|
|
7558
7548
|
params: o,
|
|
7559
7549
|
largestGroupId: a ? a - D(1) : void 0
|
|
7560
7550
|
})]), u = new ao(c);
|
|
7561
7551
|
return new r(n, e.namespace(), l, u, i);
|
|
7562
7552
|
}
|
|
7563
7553
|
v(n.initData, "no init data found on track");
|
|
7564
|
-
let c = be(n.initData), l = new ao(new Uint8Array(c)), u = yield
|
|
7554
|
+
let c = be(n.initData), l = new ao(new Uint8Array(c)), u = yield Og.subscribe(e, s, {
|
|
7565
7555
|
params: o,
|
|
7566
7556
|
largestGroupId: a ? a - D(1) : void 0
|
|
7567
7557
|
});
|
|
@@ -7569,59 +7559,59 @@ var g_ = class r {
|
|
|
7569
7559
|
})();
|
|
7570
7560
|
}
|
|
7571
7561
|
largestGroupId() {
|
|
7572
|
-
return i(
|
|
7562
|
+
return i(f_, this).largestGroupId();
|
|
7573
7563
|
}
|
|
7574
7564
|
stopAfterTimestampReached(e) {
|
|
7575
|
-
n(
|
|
7565
|
+
n(m_, this, [0, e]);
|
|
7576
7566
|
}
|
|
7577
7567
|
timestampRange() {
|
|
7578
|
-
return i(
|
|
7568
|
+
return i(m_, this);
|
|
7579
7569
|
}
|
|
7580
7570
|
endOfTrack(e) {
|
|
7581
|
-
return i(
|
|
7571
|
+
return i(f_, this).endOfTrack(e);
|
|
7582
7572
|
}
|
|
7583
7573
|
update(e, t) {
|
|
7584
|
-
return i(
|
|
7574
|
+
return i(f_, this).update(e, t);
|
|
7585
7575
|
}
|
|
7586
7576
|
unsubscribe() {
|
|
7587
7577
|
var e = this;
|
|
7588
7578
|
return t(function* () {
|
|
7589
|
-
return i(
|
|
7579
|
+
return i(f_, e).unsubscribe();
|
|
7590
7580
|
})();
|
|
7591
7581
|
}
|
|
7592
7582
|
next() {
|
|
7593
7583
|
var e = this;
|
|
7594
7584
|
return t(function* () {
|
|
7595
|
-
let t = yield i(
|
|
7585
|
+
let t = yield i(f_, e).next();
|
|
7596
7586
|
return t.done ? t : {
|
|
7597
7587
|
done: !1,
|
|
7598
|
-
value: new
|
|
7588
|
+
value: new l_(t.value, i(d_, e), i(p_, e), e)
|
|
7599
7589
|
};
|
|
7600
7590
|
})();
|
|
7601
7591
|
}
|
|
7602
7592
|
return() {
|
|
7603
7593
|
var e = this;
|
|
7604
7594
|
return t(function* () {
|
|
7605
|
-
return yield i(
|
|
7595
|
+
return yield i(f_, e).return(), {
|
|
7606
7596
|
done: !0,
|
|
7607
7597
|
value: void 0
|
|
7608
7598
|
};
|
|
7609
7599
|
})();
|
|
7610
7600
|
}
|
|
7611
|
-
[
|
|
7601
|
+
[Wg]() {
|
|
7612
7602
|
return this;
|
|
7613
7603
|
}
|
|
7614
|
-
[
|
|
7604
|
+
[Gg]() {
|
|
7615
7605
|
return this.unsubscribe();
|
|
7616
7606
|
}
|
|
7617
|
-
[
|
|
7607
|
+
[Kg]() {
|
|
7618
7608
|
var e = this;
|
|
7619
7609
|
return t(function* () {
|
|
7620
7610
|
return e.unsubscribe();
|
|
7621
7611
|
})();
|
|
7622
7612
|
}
|
|
7623
7613
|
};
|
|
7624
|
-
function
|
|
7614
|
+
function g_(e, n) {
|
|
7625
7615
|
return t(function* () {
|
|
7626
7616
|
try {
|
|
7627
7617
|
var t = Ap();
|
|
@@ -7636,47 +7626,47 @@ function __(e, n) {
|
|
|
7636
7626
|
})();
|
|
7637
7627
|
}
|
|
7638
7628
|
// ../../libs/voq/src/tracks/Timeline.ts
|
|
7639
|
-
var
|
|
7629
|
+
var __ = 1e4, v_ = 3e4, y_ = /* @__PURE__ */ new WeakMap(), b_ = /* @__PURE__ */ new WeakMap(), x_ = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap(), C_ = /* @__PURE__ */ new WeakMap(), w_ = /* @__PURE__ */ new WeakMap(), T_ = /* @__PURE__ */ new WeakSet(), E_ = class e {
|
|
7640
7630
|
constructor(e, t, r) {
|
|
7641
|
-
k(this,
|
|
7631
|
+
k(this, T_), c(this, y_, a.get().createContext("Timeline")), c(this, b_, new Vt([])), c(this, x_, void 0), c(this, S_, void 0), c(this, C_, void 0), c(this, w_, void 0), n(S_, this, e), n(C_, this, r), n(x_, this, t), n(w_, this, o(T_, this, D_).call(this, i(x_, this))), this.closed().finally(() => i(b_, this).close()).catch(b);
|
|
7642
7632
|
}
|
|
7643
7633
|
closed() {
|
|
7644
|
-
return i(
|
|
7634
|
+
return i(w_, this);
|
|
7645
7635
|
}
|
|
7646
7636
|
close() {
|
|
7647
7637
|
var e = this;
|
|
7648
7638
|
return t(function* () {
|
|
7649
|
-
return (yield i(
|
|
7639
|
+
return (yield i(x_, e).promise).unsubscribe();
|
|
7650
7640
|
})();
|
|
7651
7641
|
}
|
|
7652
7642
|
timeline() {
|
|
7653
|
-
let [e, t] = i(
|
|
7643
|
+
let [e, t] = i(b_, this).value();
|
|
7654
7644
|
return e;
|
|
7655
7645
|
}
|
|
7656
7646
|
timestampWallclockOffset() {
|
|
7657
7647
|
return pt(this.timeline().map((e) => e.mediaPts - e.wallclock));
|
|
7658
7648
|
}
|
|
7659
7649
|
static start(t, n) {
|
|
7660
|
-
let r = x.fromPromise(
|
|
7650
|
+
let r = x.fromPromise(Og.subscribe(t, new Ih().name(n).groupOrder("ascending").build()));
|
|
7661
7651
|
return new e(t, r, n);
|
|
7662
7652
|
}
|
|
7663
7653
|
waitForWallclockTime(e) {
|
|
7664
7654
|
var n = this;
|
|
7665
7655
|
return t(function* () {
|
|
7666
|
-
return yield i(
|
|
7656
|
+
return yield i(b_, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
|
|
7667
7657
|
})();
|
|
7668
7658
|
}
|
|
7669
7659
|
waitForTimelineToHaveMinDuration() {
|
|
7670
7660
|
var e = this;
|
|
7671
7661
|
return t(function* () {
|
|
7672
|
-
return yield i(
|
|
7662
|
+
return yield i(b_, e).waitFor((e) => {
|
|
7673
7663
|
let t = e[0], n = e[e.length - 1];
|
|
7674
|
-
return !t || !n ? !1 : n.wallclock - t.wallclock >
|
|
7664
|
+
return !t || !n ? !1 : n.wallclock - t.wallclock > __;
|
|
7675
7665
|
}), e.timeline();
|
|
7676
7666
|
})();
|
|
7677
7667
|
}
|
|
7678
7668
|
};
|
|
7679
|
-
function
|
|
7669
|
+
function D_(e) {
|
|
7680
7670
|
var n = this;
|
|
7681
7671
|
return t(function* () {
|
|
7682
7672
|
let t = yield e.promise;
|
|
@@ -7691,13 +7681,13 @@ function O_(e) {
|
|
|
7691
7681
|
let e = h.value;
|
|
7692
7682
|
{
|
|
7693
7683
|
if (e.objectStatus !== al.Normal) continue;
|
|
7694
|
-
let r =
|
|
7695
|
-
i(
|
|
7684
|
+
let r = k_(e.payload);
|
|
7685
|
+
i(b_, n).update((e) => {
|
|
7696
7686
|
var t, n;
|
|
7697
|
-
for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock >
|
|
7687
|
+
for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > v_;) e.shift();
|
|
7698
7688
|
return e;
|
|
7699
|
-
}), t === i(
|
|
7700
|
-
i(
|
|
7689
|
+
}), t === i(x_, n).resolved && e.groupId > D(0) && e.objectId === D(0) && o(T_, n, O_).call(n, e.groupId).catch((e) => {
|
|
7690
|
+
i(y_, n).warn("backfill failed", e);
|
|
7701
7691
|
});
|
|
7702
7692
|
}
|
|
7703
7693
|
}
|
|
@@ -7726,20 +7716,20 @@ function O_(e) {
|
|
|
7726
7716
|
}
|
|
7727
7717
|
})();
|
|
7728
7718
|
}
|
|
7729
|
-
function
|
|
7719
|
+
function O_(e) {
|
|
7730
7720
|
var n = this;
|
|
7731
7721
|
return t(function* () {
|
|
7732
7722
|
let t = e - D(1), r = n.timeline(), a = r[0], s = r[r.length - 1];
|
|
7733
|
-
if (!a || !s || s.wallclock - a.wallclock >
|
|
7734
|
-
i(
|
|
7723
|
+
if (!a || !s || s.wallclock - a.wallclock > __) return;
|
|
7724
|
+
i(y_, n).debug("backfilling timeline", {
|
|
7735
7725
|
currentGroupId: e,
|
|
7736
7726
|
backfillGroupId: t
|
|
7737
7727
|
});
|
|
7738
|
-
let c = x.fromPromise(
|
|
7739
|
-
return o(
|
|
7728
|
+
let c = x.fromPromise(Og.subscribe(i(S_, n), new Ih().name(i(C_, n)).groupOrder("ascending").range(t, t).build()));
|
|
7729
|
+
return o(T_, n, D_).call(n, c);
|
|
7740
7730
|
})();
|
|
7741
7731
|
}
|
|
7742
|
-
function
|
|
7732
|
+
function k_(e) {
|
|
7743
7733
|
var t;
|
|
7744
7734
|
let n = new TextDecoder("utf-8").decode(e).split("\n");
|
|
7745
7735
|
return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
|
|
@@ -7755,46 +7745,46 @@ function A_(e) {
|
|
|
7755
7745
|
});
|
|
7756
7746
|
}
|
|
7757
7747
|
// ../../libs/voq/src/tracks/WebVTT.ts
|
|
7758
|
-
var j_, M_
|
|
7759
|
-
function
|
|
7748
|
+
var A_, j_, M_;
|
|
7749
|
+
function N_(e) {
|
|
7760
7750
|
return typeof e.language == "string";
|
|
7761
7751
|
}
|
|
7762
|
-
var
|
|
7763
|
-
|
|
7764
|
-
var
|
|
7752
|
+
var P_ = /* @__PURE__ */ new WeakMap(), F_ = /* @__PURE__ */ new WeakMap(), I_ = /* @__PURE__ */ new WeakMap(), L_ = /* @__PURE__ */ new WeakMap();
|
|
7753
|
+
A_ = Symbol.asyncIterator, j_ = Ct(), M_ = Symbol.asyncDispose;
|
|
7754
|
+
var R_ = class r {
|
|
7765
7755
|
constructor(t, r, i, a, o) {
|
|
7766
|
-
c(this,
|
|
7756
|
+
c(this, P_, new fc()), c(this, F_, void 0), c(this, I_, void 0), c(this, L_, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), n(I_, this, t), n(F_, this, r), this.trackObject = i, this.namespace = a, n(L_, this, o);
|
|
7767
7757
|
}
|
|
7768
7758
|
static subscribe(e, n, i) {
|
|
7769
7759
|
return t(function* () {
|
|
7770
|
-
if (!
|
|
7771
|
-
let t = new
|
|
7760
|
+
if (!N_(n)) throw Error("track object language is required");
|
|
7761
|
+
let t = new Ih().name(n.name).build(), a = yield Og.subscribe(e, t), o = a.objects();
|
|
7772
7762
|
return new r(a, o, n, e.namespace(), i);
|
|
7773
7763
|
})();
|
|
7774
7764
|
}
|
|
7775
7765
|
largestGroupId() {
|
|
7776
|
-
return i(
|
|
7766
|
+
return i(I_, this).largestGroupId();
|
|
7777
7767
|
}
|
|
7778
7768
|
update(e, t) {
|
|
7779
|
-
return i(
|
|
7769
|
+
return i(I_, this).update(e, t);
|
|
7780
7770
|
}
|
|
7781
7771
|
unsubscribe() {
|
|
7782
|
-
return i(
|
|
7772
|
+
return i(I_, this).unsubscribe();
|
|
7783
7773
|
}
|
|
7784
7774
|
next() {
|
|
7785
7775
|
var e = this;
|
|
7786
7776
|
return t(function* () {
|
|
7787
7777
|
for (;;) {
|
|
7788
|
-
let t = yield i(
|
|
7778
|
+
let t = yield i(F_, e).next();
|
|
7789
7779
|
if (t.done) return t;
|
|
7790
7780
|
if (t.value.objectStatus !== al.Normal) continue;
|
|
7791
7781
|
let n = new TextDecoder().decode(t.value.payload), r;
|
|
7792
7782
|
try {
|
|
7793
|
-
r = i(
|
|
7783
|
+
r = i(P_, e).parse(n);
|
|
7794
7784
|
} catch (e) {
|
|
7795
7785
|
continue;
|
|
7796
7786
|
}
|
|
7797
|
-
let a = r.map((t) => (t.startTime -= i(
|
|
7787
|
+
let a = r.map((t) => (t.startTime -= i(L_, e) / 1e3, t.endTime -= i(L_, e) / 1e3, t));
|
|
7798
7788
|
return {
|
|
7799
7789
|
done: !1,
|
|
7800
7790
|
value: {
|
|
@@ -7808,29 +7798,29 @@ var z_ = class r {
|
|
|
7808
7798
|
return() {
|
|
7809
7799
|
var e = this;
|
|
7810
7800
|
return t(function* () {
|
|
7811
|
-
return yield i(
|
|
7801
|
+
return yield i(I_, e).return(), {
|
|
7812
7802
|
done: !0,
|
|
7813
7803
|
value: void 0
|
|
7814
7804
|
};
|
|
7815
7805
|
})();
|
|
7816
7806
|
}
|
|
7817
|
-
[
|
|
7807
|
+
[A_]() {
|
|
7818
7808
|
return this;
|
|
7819
7809
|
}
|
|
7820
|
-
[
|
|
7810
|
+
[j_]() {
|
|
7821
7811
|
return this.unsubscribe();
|
|
7822
7812
|
}
|
|
7823
|
-
[
|
|
7813
|
+
[M_]() {
|
|
7824
7814
|
return this.unsubscribe();
|
|
7825
7815
|
}
|
|
7826
|
-
},
|
|
7816
|
+
}, z_ = /* @__PURE__ */ new WeakMap(), B_ = /* @__PURE__ */ new WeakMap(), V_ = /* @__PURE__ */ new WeakMap(), H_ = /* @__PURE__ */ new WeakMap(), U_ = /* @__PURE__ */ new WeakSet(), W_ = class r {
|
|
7827
7817
|
constructor(t, r, i, a, o) {
|
|
7828
|
-
k(this,
|
|
7818
|
+
k(this, U_), e(this, "namespace", void 0), c(this, z_, void 0), c(this, B_, void 0), c(this, V_, void 0), c(this, H_, void 0), this.namespace = a, n(z_, this, t), n(B_, this, r), n(V_, this, i), n(H_, this, o);
|
|
7829
7819
|
}
|
|
7830
7820
|
static start(e, n) {
|
|
7831
7821
|
return t(function* () {
|
|
7832
|
-
|
|
7833
|
-
let t = new
|
|
7822
|
+
K_._.info("Enter 'start'", { config: n });
|
|
7823
|
+
let t = new zh(e, { namespace: n.namespace }), [i, a] = yield Promise.all([E_.start(t, "timeline"), Lg.start(t, {
|
|
7834
7824
|
catalog: n.catalog,
|
|
7835
7825
|
namespace: n.namespace
|
|
7836
7826
|
})]);
|
|
@@ -7838,42 +7828,42 @@ var z_ = class r {
|
|
|
7838
7828
|
})();
|
|
7839
7829
|
}
|
|
7840
7830
|
closed() {
|
|
7841
|
-
return Promise.race([i(
|
|
7831
|
+
return Promise.race([i(V_, this).closed(), i(B_, this).closed()]);
|
|
7842
7832
|
}
|
|
7843
7833
|
catalog() {
|
|
7844
|
-
return i(
|
|
7834
|
+
return i(V_, this).catalog();
|
|
7845
7835
|
}
|
|
7846
7836
|
timestampWallclockOffset() {
|
|
7847
|
-
return i(
|
|
7837
|
+
return i(B_, this).timestampWallclockOffset();
|
|
7848
7838
|
}
|
|
7849
7839
|
timestampOffsetMs() {
|
|
7850
|
-
return i(
|
|
7840
|
+
return i(H_, this);
|
|
7851
7841
|
}
|
|
7852
7842
|
setTimestampOffsetMs(e) {
|
|
7853
|
-
n(
|
|
7843
|
+
n(H_, this, e);
|
|
7854
7844
|
}
|
|
7855
7845
|
waitForWallclockTime(e) {
|
|
7856
|
-
return i(
|
|
7846
|
+
return i(B_, this).waitForWallclockTime(e);
|
|
7857
7847
|
}
|
|
7858
7848
|
subscribeCmafTrack(e, t) {
|
|
7859
7849
|
let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, a = this.catalog().current().tracks, s = e["com.vindral.variant_uid"] === void 0 ? void 0 : a.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
|
|
7860
|
-
return o(
|
|
7861
|
-
timestampOffsetMs: i(
|
|
7850
|
+
return o(U_, this, G_).call(this, () => h_.subscribe(i(z_, this), s == null ? e : s, {
|
|
7851
|
+
timestampOffsetMs: i(H_, this),
|
|
7862
7852
|
startGroup: n,
|
|
7863
7853
|
params: r
|
|
7864
7854
|
}));
|
|
7865
7855
|
}
|
|
7866
7856
|
subscribeWebVttTrack(e) {
|
|
7867
|
-
return o(
|
|
7857
|
+
return o(U_, this, G_).call(this, () => R_.subscribe(i(z_, this), e, i(H_, this)));
|
|
7868
7858
|
}
|
|
7869
7859
|
subscribeTrack(e) {
|
|
7870
|
-
return o(
|
|
7860
|
+
return o(U_, this, G_).call(this, () => i(z_, this).subscribe(e));
|
|
7871
7861
|
}
|
|
7872
7862
|
close() {
|
|
7873
|
-
return Promise.all([i(
|
|
7863
|
+
return Promise.all([i(V_, this).close(), i(B_, this).close()]);
|
|
7874
7864
|
}
|
|
7875
7865
|
};
|
|
7876
|
-
function
|
|
7866
|
+
function G_(e) {
|
|
7877
7867
|
var n = this;
|
|
7878
7868
|
return t(function* () {
|
|
7879
7869
|
let [t, r] = n.catalog().value();
|
|
@@ -7885,44 +7875,44 @@ function K_(e) {
|
|
|
7885
7875
|
}
|
|
7886
7876
|
})();
|
|
7887
7877
|
}
|
|
7888
|
-
var
|
|
7889
|
-
function
|
|
7878
|
+
var K_ = { _: a.get().createContext("Channel") }, q_ = D(8);
|
|
7879
|
+
function J_(e) {
|
|
7890
7880
|
if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
|
|
7891
7881
|
return {
|
|
7892
|
-
type:
|
|
7882
|
+
type: q_,
|
|
7893
7883
|
payload: new Uint8Array([e >> 8 & 255, e & 255])
|
|
7894
7884
|
};
|
|
7895
7885
|
}
|
|
7896
7886
|
// ../../libs/voq/src/ProducerReferenceClock.ts
|
|
7897
|
-
var
|
|
7887
|
+
var Y_ = /* @__PURE__ */ new WeakMap(), X_ = /* @__PURE__ */ new WeakMap(), Z_ = /* @__PURE__ */ new WeakSet(), Q_ = class e {
|
|
7898
7888
|
constructor(e) {
|
|
7899
|
-
k(this,
|
|
7889
|
+
k(this, Z_), c(this, Y_, void 0), c(this, X_, void 0);
|
|
7900
7890
|
let [t, r] = e.value.value();
|
|
7901
|
-
n(
|
|
7891
|
+
n(Y_, this, {
|
|
7902
7892
|
createdAt: /* @__PURE__ */ new Date(),
|
|
7903
7893
|
wallclock: new Date(t.ntpTimestamp),
|
|
7904
7894
|
rtt: t.rtt
|
|
7905
|
-
}), n(
|
|
7895
|
+
}), n(X_, this, o(Z_, this, $_).call(this, e));
|
|
7906
7896
|
}
|
|
7907
7897
|
wallclock() {
|
|
7908
|
-
let e = Date.now() - i(
|
|
7909
|
-
return i(
|
|
7898
|
+
let e = Date.now() - i(Y_, this).createdAt.getTime();
|
|
7899
|
+
return i(Y_, this).wallclock.getTime() + e;
|
|
7910
7900
|
}
|
|
7911
7901
|
closed() {
|
|
7912
|
-
return i(
|
|
7902
|
+
return i(X_, this);
|
|
7913
7903
|
}
|
|
7914
7904
|
static start(t) {
|
|
7915
7905
|
return new e(t);
|
|
7916
7906
|
}
|
|
7917
7907
|
};
|
|
7918
|
-
function
|
|
7908
|
+
function $_(e) {
|
|
7919
7909
|
var r = this;
|
|
7920
7910
|
return t(function* () {
|
|
7921
7911
|
var t = !1, i = !1, a;
|
|
7922
7912
|
try {
|
|
7923
7913
|
for (var o = H(e.value), s; t = !(s = yield o.next()).done; t = !1) {
|
|
7924
7914
|
let e = s.value;
|
|
7925
|
-
n(
|
|
7915
|
+
n(Y_, r, {
|
|
7926
7916
|
createdAt: /* @__PURE__ */ new Date(),
|
|
7927
7917
|
wallclock: new Date(e.ntpTimestamp),
|
|
7928
7918
|
rtt: e.rtt
|
|
@@ -7940,7 +7930,7 @@ function ev(e) {
|
|
|
7940
7930
|
})();
|
|
7941
7931
|
}
|
|
7942
7932
|
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js
|
|
7943
|
-
function
|
|
7933
|
+
function ev(e, t) {
|
|
7944
7934
|
if (e == null) return {};
|
|
7945
7935
|
var n = {};
|
|
7946
7936
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -7950,9 +7940,9 @@ function tv(e, t) {
|
|
|
7950
7940
|
return n;
|
|
7951
7941
|
}
|
|
7952
7942
|
// \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutProperties.js
|
|
7953
|
-
function
|
|
7943
|
+
function tv(e, t) {
|
|
7954
7944
|
if (e == null) return {};
|
|
7955
|
-
var n, r, i =
|
|
7945
|
+
var n, r, i = ev(e, t);
|
|
7956
7946
|
if (Object.getOwnPropertySymbols) {
|
|
7957
7947
|
var a = Object.getOwnPropertySymbols(e);
|
|
7958
7948
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -7960,27 +7950,27 @@ function nv(e, t) {
|
|
|
7960
7950
|
return i;
|
|
7961
7951
|
}
|
|
7962
7952
|
// ../../libs/voq/src/tracks/Drm.ts
|
|
7963
|
-
var
|
|
7964
|
-
function
|
|
7953
|
+
var nv = ["fairplayCertificate"];
|
|
7954
|
+
function rv(e) {
|
|
7965
7955
|
return typeof e == "string" || e == null;
|
|
7966
7956
|
}
|
|
7967
|
-
function
|
|
7968
|
-
return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) ||
|
|
7957
|
+
function iv(e) {
|
|
7958
|
+
return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || rv(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || rv(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || rv(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || rv(e.fairplayCertificate));
|
|
7969
7959
|
}
|
|
7970
|
-
function
|
|
7960
|
+
function av(e) {
|
|
7971
7961
|
try {
|
|
7972
7962
|
return be(e);
|
|
7973
7963
|
} catch (e) {
|
|
7974
7964
|
throw Error("Failed to convert fairplayCertificate");
|
|
7975
7965
|
}
|
|
7976
7966
|
}
|
|
7977
|
-
function
|
|
7967
|
+
function ov(e) {
|
|
7978
7968
|
let t = new TextDecoder().decode(e), n = JSON.parse(t);
|
|
7979
|
-
if (!
|
|
7980
|
-
let { fairplayCertificate: r } = n, i =
|
|
7981
|
-
return p(p({}, i), {}, { fairplayCertificate: r ?
|
|
7969
|
+
if (!iv(n)) throw Error("Invalid drm object");
|
|
7970
|
+
let { fairplayCertificate: r } = n, i = tv(n, nv);
|
|
7971
|
+
return p(p({}, i), {}, { fairplayCertificate: r ? av(r) : void 0 });
|
|
7982
7972
|
}
|
|
7983
|
-
var
|
|
7973
|
+
var sv = class n {
|
|
7984
7974
|
constructor(t) {
|
|
7985
7975
|
e(this, "value", void 0), this.value = t;
|
|
7986
7976
|
}
|
|
@@ -7988,9 +7978,9 @@ var cv = class n {
|
|
|
7988
7978
|
return t(function* () {
|
|
7989
7979
|
try {
|
|
7990
7980
|
var t = Ap();
|
|
7991
|
-
let a = yield t.a(yield e.subscribeTrack(new
|
|
7981
|
+
let a = yield t.a(yield e.subscribeTrack(new Ih().name("drm").build())).objects().next();
|
|
7992
7982
|
if (a.done) throw Error("No drm object received");
|
|
7993
|
-
let o =
|
|
7983
|
+
let o = ov(a.value.payload);
|
|
7994
7984
|
return new n(p(p({}, o), {}, {
|
|
7995
7985
|
videoCodec: r,
|
|
7996
7986
|
audioCodec: i
|
|
@@ -8004,32 +7994,32 @@ var cv = class n {
|
|
|
8004
7994
|
}
|
|
8005
7995
|
};
|
|
8006
7996
|
// ../../libs/voq/src/tracks/Stats.ts
|
|
8007
|
-
function
|
|
7997
|
+
function cv(e) {
|
|
8008
7998
|
return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
|
|
8009
7999
|
}
|
|
8010
|
-
function
|
|
8000
|
+
function lv(e) {
|
|
8011
8001
|
let t = new TextDecoder().decode(e), n = JSON.parse(t);
|
|
8012
|
-
if (!
|
|
8002
|
+
if (!cv(n)) throw Error("Invalid stats object");
|
|
8013
8003
|
return n;
|
|
8014
8004
|
}
|
|
8015
|
-
var
|
|
8005
|
+
var uv = /* @__PURE__ */ new WeakMap(), dv = /* @__PURE__ */ new WeakSet(), fv = class r {
|
|
8016
8006
|
constructor(t, r, i, a) {
|
|
8017
|
-
k(this,
|
|
8007
|
+
k(this, dv), e(this, "ip", void 0), e(this, "value", void 0), c(this, uv, void 0), this.ip = i, this.value = new Vt(r), n(uv, this, o(dv, this, pv).call(this, t, a)), this.closed().catch(b);
|
|
8018
8008
|
}
|
|
8019
8009
|
closed() {
|
|
8020
|
-
return i(
|
|
8010
|
+
return i(uv, this);
|
|
8021
8011
|
}
|
|
8022
8012
|
static start(e, n) {
|
|
8023
8013
|
return t(function* () {
|
|
8024
|
-
let t = (yield e.subscribe(new
|
|
8014
|
+
let t = (yield e.subscribe(new Ih().name("stats").groupOrder("ascending").build())).objects(), i = yield t.next(), a = performance.now();
|
|
8025
8015
|
if (i.done) throw Error("No stats object received");
|
|
8026
|
-
let o =
|
|
8016
|
+
let o = lv(i.value.payload);
|
|
8027
8017
|
if (!o.ip) throw Error("Expected IP in initial stats object");
|
|
8028
8018
|
return n == null || n(o, a), new r(t, o, o.ip, n);
|
|
8029
8019
|
})();
|
|
8030
8020
|
}
|
|
8031
8021
|
};
|
|
8032
|
-
function
|
|
8022
|
+
function pv(e, n) {
|
|
8033
8023
|
var r = this;
|
|
8034
8024
|
return t(function* () {
|
|
8035
8025
|
var t = !1, i = !1, a;
|
|
@@ -8038,7 +8028,7 @@ function mv(e, n) {
|
|
|
8038
8028
|
let e = s.value;
|
|
8039
8029
|
{
|
|
8040
8030
|
if (e.objectStatus !== al.Normal) continue;
|
|
8041
|
-
let t = performance.now(), i =
|
|
8031
|
+
let t = performance.now(), i = lv(e.payload);
|
|
8042
8032
|
n == null || n(i, t), r.value.update(i);
|
|
8043
8033
|
}
|
|
8044
8034
|
}
|
|
@@ -8054,21 +8044,21 @@ function mv(e, n) {
|
|
|
8054
8044
|
})();
|
|
8055
8045
|
}
|
|
8056
8046
|
// ../../libs/voq/src/UpstreamWatcher.ts
|
|
8057
|
-
var
|
|
8047
|
+
var mv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = class {
|
|
8058
8048
|
constructor(e) {
|
|
8059
|
-
c(this,
|
|
8049
|
+
c(this, mv, a.get().createContext("UpstreamWatcher")), c(this, hv, void 0), n(hv, this, new Vt(x.fromPromise(e.closed())));
|
|
8060
8050
|
}
|
|
8061
8051
|
update(e) {
|
|
8062
|
-
i(
|
|
8052
|
+
i(hv, this).update(x.fromPromise(e.closed()));
|
|
8063
8053
|
}
|
|
8064
8054
|
closed() {
|
|
8065
8055
|
var e = this;
|
|
8066
8056
|
return t(function* () {
|
|
8067
8057
|
try {
|
|
8068
8058
|
for (;;) {
|
|
8069
|
-
let [t, n] = i(
|
|
8059
|
+
let [t, n] = i(hv, e).value(), r = !1;
|
|
8070
8060
|
yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
|
|
8071
|
-
if (!r) throw i(
|
|
8061
|
+
if (!r) throw i(mv, e).warn("Upstream closed"), Error("Upstream closed");
|
|
8072
8062
|
})]);
|
|
8073
8063
|
}
|
|
8074
8064
|
} catch (e) {
|
|
@@ -8076,19 +8066,19 @@ var hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v =
|
|
|
8076
8066
|
}
|
|
8077
8067
|
})();
|
|
8078
8068
|
}
|
|
8079
|
-
},
|
|
8080
|
-
|
|
8081
|
-
var
|
|
8069
|
+
}, _v, vv = 5e3, yv = /* @__PURE__ */ new WeakMap(), bv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap();
|
|
8070
|
+
_v = Symbol.asyncIterator;
|
|
8071
|
+
var Sv = class {
|
|
8082
8072
|
constructor(e, t) {
|
|
8083
|
-
c(this,
|
|
8073
|
+
c(this, yv, a.get().createContext("TracksIterator")), c(this, bv, void 0), c(this, xv, void 0), n(bv, this, e), n(xv, this, t);
|
|
8084
8074
|
}
|
|
8085
|
-
[
|
|
8075
|
+
[_v]() {
|
|
8086
8076
|
var e = this;
|
|
8087
8077
|
return Pt(function* () {
|
|
8088
|
-
let t = i(
|
|
8078
|
+
let t = i(xv, e);
|
|
8089
8079
|
var n = !1, r = !1, a;
|
|
8090
8080
|
try {
|
|
8091
|
-
for (var o = H(i(
|
|
8081
|
+
for (var o = H(i(bv, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
|
|
8092
8082
|
let n = s.value;
|
|
8093
8083
|
{
|
|
8094
8084
|
if (!n) continue;
|
|
@@ -8096,7 +8086,7 @@ var Cv = class {
|
|
|
8096
8086
|
name: n.trackObject.name,
|
|
8097
8087
|
namespace: n.namespace
|
|
8098
8088
|
};
|
|
8099
|
-
i(
|
|
8089
|
+
i(yv, e).debug("track start", p({ mediaType: t }, r)), yield* bg(H(n)), i(yv, e).debug("track end", p({ mediaType: t }, r));
|
|
8100
8090
|
}
|
|
8101
8091
|
}
|
|
8102
8092
|
} catch (e) {
|
|
@@ -8108,97 +8098,97 @@ var Cv = class {
|
|
|
8108
8098
|
if (r) throw a;
|
|
8109
8099
|
}
|
|
8110
8100
|
}
|
|
8111
|
-
i(
|
|
8101
|
+
i(yv, e).debug("tracks ended", { mediaType: t });
|
|
8112
8102
|
})();
|
|
8113
8103
|
}
|
|
8114
|
-
},
|
|
8104
|
+
}, Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMap(), Mv = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakSet(), Pv = class r {
|
|
8115
8105
|
constructor(t, r, s) {
|
|
8116
|
-
k(this,
|
|
8117
|
-
o(
|
|
8118
|
-
o(
|
|
8119
|
-
o(
|
|
8120
|
-
i(
|
|
8121
|
-
])), i(
|
|
8106
|
+
k(this, Nv), c(this, Cv, void 0), c(this, wv, void 0), c(this, Tv, void 0), c(this, Ev, a.get().createContext("Player")), c(this, Dv, void 0), c(this, Ov, new Vt(void 0)), c(this, kv, new Vt(void 0)), c(this, Av, new Vt(void 0)), c(this, jv, void 0), c(this, Mv, void 0), e(this, "subtitles", new Sv(i(Av, this), "subtitles")), e(this, "video", new Sv(i(kv, this), "video")), e(this, "audio", new Sv(i(Ov, this), "audio")), n(Cv, this, t), n(wv, this, Q_.start(s)), n(Tv, this, s), n(Dv, this, new Vt(r)), n(jv, this, new gv(r)), n(Mv, this, Promise.race([
|
|
8107
|
+
o(Nv, this, zv).call(this),
|
|
8108
|
+
o(Nv, this, Fv).call(this),
|
|
8109
|
+
o(Nv, this, Rv).call(this),
|
|
8110
|
+
i(jv, this).closed()
|
|
8111
|
+
])), i(Cv, this).closed().then(() => this.close()).catch(b);
|
|
8122
8112
|
}
|
|
8123
8113
|
closed() {
|
|
8124
|
-
return i(
|
|
8114
|
+
return i(Mv, this);
|
|
8125
8115
|
}
|
|
8126
8116
|
static start(e, n) {
|
|
8127
8117
|
return t(function* () {
|
|
8128
8118
|
let t = /* @__PURE__ */ new Map();
|
|
8129
8119
|
if (n.burstMs !== void 0) {
|
|
8130
|
-
let e =
|
|
8120
|
+
let e = J_(n.burstMs);
|
|
8131
8121
|
t.set(e.type, e);
|
|
8132
8122
|
}
|
|
8133
|
-
let a = new
|
|
8123
|
+
let a = new zh(e, { namespace: Bh("auxiliary") }), [[o, s, c], l] = yield Promise.all([W_.start(e, n).then((e) => Promise.all([
|
|
8134
8124
|
Promise.resolve(e),
|
|
8135
8125
|
n.videoTrack ? e.subscribeCmafTrack(n.videoTrack, { params: t }) : void 0,
|
|
8136
8126
|
n.audioTrack ? e.subscribeCmafTrack(n.audioTrack, { params: t }) : void 0
|
|
8137
|
-
])),
|
|
8138
|
-
return c && i(
|
|
8127
|
+
])), fv.start(a, n.onStats)]), u = new r(e, o, l);
|
|
8128
|
+
return c && i(Ov, u).update(c), s && i(kv, u).update(s), u;
|
|
8139
8129
|
})();
|
|
8140
8130
|
}
|
|
8141
8131
|
connectionInfo() {
|
|
8142
|
-
let e = i(
|
|
8132
|
+
let e = i(Tv, this).value.current();
|
|
8143
8133
|
return {
|
|
8144
|
-
ip: i(
|
|
8134
|
+
ip: i(Tv, this).ip,
|
|
8145
8135
|
rtt: e.rtt,
|
|
8146
8136
|
estimatedBandwidth: e.estimatedBandwidth
|
|
8147
8137
|
};
|
|
8148
8138
|
}
|
|
8149
8139
|
stats() {
|
|
8150
|
-
return i(
|
|
8140
|
+
return i(Tv, this).value;
|
|
8151
8141
|
}
|
|
8152
8142
|
catalog() {
|
|
8153
|
-
return i(
|
|
8143
|
+
return i(Dv, this).current().catalog();
|
|
8154
8144
|
}
|
|
8155
8145
|
namespace() {
|
|
8156
|
-
return i(
|
|
8146
|
+
return i(Dv, this).current().namespace;
|
|
8157
8147
|
}
|
|
8158
8148
|
videoTrack() {
|
|
8159
8149
|
var e;
|
|
8160
|
-
return (e = i(
|
|
8150
|
+
return (e = i(kv, this).current()) == null ? void 0 : e.trackObject;
|
|
8161
8151
|
}
|
|
8162
8152
|
audioTrack() {
|
|
8163
8153
|
var e;
|
|
8164
|
-
return (e = i(
|
|
8154
|
+
return (e = i(Ov, this).current()) == null ? void 0 : e.trackObject;
|
|
8165
8155
|
}
|
|
8166
8156
|
referenceClock() {
|
|
8167
|
-
return i(
|
|
8157
|
+
return i(wv, this);
|
|
8168
8158
|
}
|
|
8169
8159
|
drm() {
|
|
8170
8160
|
var e = this;
|
|
8171
8161
|
return t(function* () {
|
|
8172
8162
|
var t, n;
|
|
8173
|
-
if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return
|
|
8163
|
+
if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return sv.create(i(Dv, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
|
|
8174
8164
|
})();
|
|
8175
8165
|
}
|
|
8176
8166
|
close() {
|
|
8177
|
-
return i(
|
|
8178
|
-
i(
|
|
8179
|
-
i(
|
|
8180
|
-
o(
|
|
8181
|
-
o(
|
|
8182
|
-
o(
|
|
8167
|
+
return i(Ev, this).info("Enter 'close'"), Promise.all([
|
|
8168
|
+
i(Dv, this).current().close(),
|
|
8169
|
+
i(Dv, this).close(),
|
|
8170
|
+
o(Nv, this, Iv).call(this, i(Ov, this)),
|
|
8171
|
+
o(Nv, this, Iv).call(this, i(kv, this)),
|
|
8172
|
+
o(Nv, this, Iv).call(this, i(Av, this))
|
|
8183
8173
|
]);
|
|
8184
8174
|
}
|
|
8185
8175
|
zap(e, n) {
|
|
8186
8176
|
var r = this;
|
|
8187
8177
|
return t(function* () {
|
|
8188
|
-
i(
|
|
8178
|
+
i(Ev, r).info("Enter 'zap'", {
|
|
8189
8179
|
config: e,
|
|
8190
8180
|
zapOffsetMs: n
|
|
8191
8181
|
});
|
|
8192
|
-
let t = yield
|
|
8193
|
-
i(
|
|
8182
|
+
let t = yield W_.start(i(Cv, r), e), a = i(wv, r).wallclock() - n, o = i(Dv, r).current(), s = o.timestampWallclockOffset(), c = yield t.waitForWallclockTime(a);
|
|
8183
|
+
i(jv, r).update(t), yield i(Dv, r).current().close();
|
|
8194
8184
|
let l = [...c].reverse().find((e) => e.wallclock <= a), u = l != null && l.mediaPts ? l.mediaPts - o.timestampOffsetMs() : void 0, d = t.timestampWallclockOffset() - s + o.timestampOffsetMs();
|
|
8195
8185
|
t.setTimestampOffsetMs(d);
|
|
8196
8186
|
let f = (l == null ? void 0 : l.groupId) !== void 0 && !Number.isNaN(l.groupId) ? D(l.groupId) : void 0;
|
|
8197
8187
|
if (u) {
|
|
8198
8188
|
var p, m;
|
|
8199
|
-
(p = i(
|
|
8189
|
+
(p = i(kv, r).current()) == null || p.stopAfterTimestampReached(u), (m = i(Ov, r).current()) == null || m.stopAfterTimestampReached(u);
|
|
8200
8190
|
}
|
|
8201
|
-
i(
|
|
8191
|
+
i(Dv, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), i(Ev, r).info("Return 'zap'");
|
|
8202
8192
|
})();
|
|
8203
8193
|
}
|
|
8204
8194
|
setSubtitleTrack(e) {
|
|
@@ -8207,49 +8197,49 @@ var Cv = class {
|
|
|
8207
8197
|
var t;
|
|
8208
8198
|
if (!e) {
|
|
8209
8199
|
var r;
|
|
8210
|
-
yield (r = i(
|
|
8200
|
+
yield (r = i(Av, n).current()) == null ? void 0 : r.unsubscribe();
|
|
8211
8201
|
return;
|
|
8212
8202
|
}
|
|
8213
|
-
let [a] = yield Promise.all([i(
|
|
8214
|
-
i(
|
|
8203
|
+
let [a] = yield Promise.all([i(Dv, n).current().subscribeWebVttTrack(e), (t = i(Av, n).current()) == null ? void 0 : t.unsubscribe()]);
|
|
8204
|
+
i(Av, n).update(a);
|
|
8215
8205
|
})();
|
|
8216
8206
|
}
|
|
8217
8207
|
setVideoTrack(e, n) {
|
|
8218
8208
|
var r = this;
|
|
8219
8209
|
return t(function* () {
|
|
8220
|
-
let t = yield o(
|
|
8221
|
-
i(
|
|
8210
|
+
let t = yield o(Nv, r, Lv).call(r, i(Dv, r).current(), e, i(kv, r).current(), n);
|
|
8211
|
+
i(kv, r).update(t);
|
|
8222
8212
|
})();
|
|
8223
8213
|
}
|
|
8224
8214
|
setAudioTrack(e, n) {
|
|
8225
8215
|
var r = this;
|
|
8226
8216
|
return t(function* () {
|
|
8227
|
-
let t = yield o(
|
|
8228
|
-
i(
|
|
8217
|
+
let t = yield o(Nv, r, Lv).call(r, i(Dv, r).current(), e, i(Ov, r).current(), n);
|
|
8218
|
+
i(Ov, r).update(t);
|
|
8229
8219
|
})();
|
|
8230
8220
|
}
|
|
8231
8221
|
};
|
|
8232
|
-
function
|
|
8222
|
+
function Fv() {
|
|
8233
8223
|
var e = this;
|
|
8234
8224
|
return t(function* () {
|
|
8235
8225
|
let t = !1;
|
|
8236
|
-
for (i(
|
|
8226
|
+
for (i(Cv, e).closed().then(() => {
|
|
8237
8227
|
t = !0;
|
|
8238
8228
|
}).catch(b);;) {
|
|
8239
|
-
let n = performance.now() - i(
|
|
8240
|
-
if (n >=
|
|
8241
|
-
if (yield on(
|
|
8229
|
+
let n = performance.now() - i(Cv, e).lastReceived();
|
|
8230
|
+
if (n >= vv) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
|
|
8231
|
+
if (yield on(vv - n), t) return;
|
|
8242
8232
|
}
|
|
8243
8233
|
})();
|
|
8244
8234
|
}
|
|
8245
|
-
function
|
|
8235
|
+
function Iv(e) {
|
|
8246
8236
|
let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
|
|
8247
8237
|
return e.isClosed() || e.update(void 0), e.close(), n === void 0 ? t == null ? void 0 : t.unsubscribe() : t == null ? void 0 : t.update(n, n);
|
|
8248
8238
|
}
|
|
8249
|
-
function
|
|
8239
|
+
function Lv(e, n, r, a) {
|
|
8250
8240
|
var o = this;
|
|
8251
8241
|
return t(function* () {
|
|
8252
|
-
i(
|
|
8242
|
+
i(Ev, o).info("Enter '#replaceTrack'", {
|
|
8253
8243
|
trackObject: n,
|
|
8254
8244
|
startGroupId: a
|
|
8255
8245
|
});
|
|
@@ -8257,18 +8247,18 @@ function Rv(e, n, r, a) {
|
|
|
8257
8247
|
return s;
|
|
8258
8248
|
})();
|
|
8259
8249
|
}
|
|
8260
|
-
function
|
|
8250
|
+
function Rv() {
|
|
8261
8251
|
var e = this;
|
|
8262
8252
|
return t(function* () {
|
|
8263
8253
|
var t = !1, n = !1, r;
|
|
8264
8254
|
try {
|
|
8265
|
-
for (var a = H(i(
|
|
8255
|
+
for (var a = H(i(Dv, e)), s; t = !(s = yield a.next()).done; t = !1) {
|
|
8266
8256
|
let t = s.value;
|
|
8267
8257
|
var c = !1, l = !1, u;
|
|
8268
8258
|
try {
|
|
8269
8259
|
for (var d = H(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
|
|
8270
8260
|
let t = f.value;
|
|
8271
|
-
yield Promise.all([o(
|
|
8261
|
+
yield Promise.all([o(Nv, e, Bv).call(e, t, i(kv, e)), o(Nv, e, Bv).call(e, t, i(Ov, e))]);
|
|
8272
8262
|
}
|
|
8273
8263
|
} catch (e) {
|
|
8274
8264
|
l = !0, u = e;
|
|
@@ -8291,17 +8281,17 @@ function zv() {
|
|
|
8291
8281
|
}
|
|
8292
8282
|
})();
|
|
8293
8283
|
}
|
|
8294
|
-
function
|
|
8284
|
+
function zv() {
|
|
8295
8285
|
var e = this;
|
|
8296
8286
|
return t(function* () {
|
|
8297
8287
|
try {
|
|
8298
|
-
return yield i(
|
|
8288
|
+
return yield i(Tv, e).closed(), /* @__PURE__ */ Error("Stats closed");
|
|
8299
8289
|
} catch (e) {
|
|
8300
8290
|
return e;
|
|
8301
8291
|
}
|
|
8302
8292
|
})();
|
|
8303
8293
|
}
|
|
8304
|
-
function
|
|
8294
|
+
function Bv(e, n) {
|
|
8305
8295
|
var r = this;
|
|
8306
8296
|
return t(function* () {
|
|
8307
8297
|
let t = n.current();
|
|
@@ -8312,17 +8302,17 @@ function Vv(e, n) {
|
|
|
8312
8302
|
n.update(void 0);
|
|
8313
8303
|
return;
|
|
8314
8304
|
}
|
|
8315
|
-
n.update(yield i(
|
|
8305
|
+
n.update(yield i(Dv, r).current().subscribeCmafTrack(c));
|
|
8316
8306
|
}
|
|
8317
8307
|
})();
|
|
8318
8308
|
}
|
|
8319
8309
|
// ../../libs/web-sdk/src/modules/SubscriptionModule.ts
|
|
8320
|
-
var
|
|
8310
|
+
var Vv, Hv = (e) => JSON.parse(JSON.stringify(e)), Uv = [
|
|
8321
8311
|
"burstMs",
|
|
8322
8312
|
"meta",
|
|
8323
8313
|
"initiator",
|
|
8324
8314
|
"channelGroupId"
|
|
8325
|
-
],
|
|
8315
|
+
], Wv = (e, t) => xt(Ut(e, Uv), Ut(t, Uv)), Gv = 1e4, Kv = class {
|
|
8326
8316
|
constructor(t, n, r) {
|
|
8327
8317
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "channelSwitchTimeout", void 0), e(this, "requestedSubscription", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
|
|
8328
8318
|
this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
|
|
@@ -8348,20 +8338,20 @@ var Hv, Uv = (e) => JSON.parse(JSON.stringify(e)), Wv = [
|
|
|
8348
8338
|
this.targetSubscription.audio.codec = e, this.scheduleSubscriptionChange();
|
|
8349
8339
|
}), e(this, "setBurst", (e) => {
|
|
8350
8340
|
e ? this.targetSubscription.burstMs = e : delete this.targetSubscription.burstMs;
|
|
8351
|
-
}), e(this, "isNewSubscription", () => !
|
|
8341
|
+
}), e(this, "isNewSubscription", () => !Wv(this.currentSubscription, this.targetSubscription)), e(this, "isRequestOutdated", () => this.requestedSubscription !== void 0 && !Wv(this.requestedSubscription, this.targetSubscription)), e(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
|
|
8352
8342
|
var n;
|
|
8353
8343
|
this.logger.debug("onSubscriptionChanged", {
|
|
8354
8344
|
to: e,
|
|
8355
8345
|
reset: t
|
|
8356
|
-
}), t ? (this.targetSubscription =
|
|
8346
|
+
}), t ? (this.targetSubscription = Hv(this.currentSubscription), this.requestedSubscription = void 0) : (this.currentSubscription = Hv(e), this.requestedSubscription && (Wv(this.requestedSubscription, e) || Wv(this.targetSubscription, e)) && (this.requestedSubscription = void 0)), (t || ((n = this.channelSwitchTimeout) == null ? void 0 : n.channelId) === this.currentSubscription.channelId) && this.clearChannelSwitchTimeout(), this.requestedSubscription && e.initiator !== "edge" && this.armChannelSwitchDeadline(), this._isSwitchingSubscription = this.isSwitching();
|
|
8357
8347
|
}), e(this, "armChannelSwitchDeadline", () => {
|
|
8358
8348
|
let e = this.targetSubscription.channelId;
|
|
8359
8349
|
if (this.channelSwitchTimeout || this.currentSubscription.channelId === e) return;
|
|
8360
8350
|
let t = this.timers.setTimeout(() => {
|
|
8361
8351
|
this.channelSwitchTimeout = void 0, this.logger.warn("Channel switch timeout", e);
|
|
8362
8352
|
let { video: t, audio: n } = this.targetSubscription;
|
|
8363
|
-
this.targetSubscription =
|
|
8364
|
-
},
|
|
8353
|
+
this.targetSubscription = Hv(this.currentSubscription), this.targetSubscription.video.bitRate = Math.min(this.targetSubscription.video.bitRate, t.bitRate), this.targetSubscription.video.width = Math.min(this.targetSubscription.video.width, t.width), this.targetSubscription.video.height = Math.min(this.targetSubscription.video.height, t.height), this.targetSubscription.audio.bitRate = Math.min(this.targetSubscription.audio.bitRate, n.bitRate), this.setBurst(0), this.emitter.emit("channel switch timeout", e), this._isSwitchingSubscription = this.isSwitching(), this.isRequestOutdated() && this.sendTargetSubscription();
|
|
8354
|
+
}, Gv);
|
|
8365
8355
|
this.channelSwitchTimeout = {
|
|
8366
8356
|
id: t,
|
|
8367
8357
|
channelId: e
|
|
@@ -8369,137 +8359,137 @@ var Hv, Uv = (e) => JSON.parse(JSON.stringify(e)), Wv = [
|
|
|
8369
8359
|
}), e(this, "clearChannelSwitchTimeout", () => {
|
|
8370
8360
|
this.channelSwitchTimeout && (this.timers.clearTimeout(this.channelSwitchTimeout.id), this.channelSwitchTimeout = void 0);
|
|
8371
8361
|
}), e(this, "isSwitching", () => this.isNewSubscription() || this.isRequestOutdated()), e(this, "scheduleSubscriptionChange", () => {
|
|
8372
|
-
this.targetSubscription =
|
|
8362
|
+
this.targetSubscription = Hv(this.targetSubscription);
|
|
8373
8363
|
let e = this.isSwitching();
|
|
8374
8364
|
this._isSwitchingSubscription = e || this._isSwitchingSubscription && this.requestedSubscription !== void 0;
|
|
8375
8365
|
let t = this.targetSubscription.channelId, n = this.currentSubscription.channelId !== t;
|
|
8376
8366
|
this.channelSwitchTimeout && this.channelSwitchTimeout.channelId !== t && this.clearChannelSwitchTimeout(), e && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), this.armChannelSwitchDeadline(), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(this.sendTargetSubscription, 0));
|
|
8377
8367
|
}), e(this, "sendTargetSubscription", () => {
|
|
8378
8368
|
this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0);
|
|
8379
|
-
let e =
|
|
8369
|
+
let e = Hv(this.targetSubscription);
|
|
8380
8370
|
this.requestedSubscription = e, this.armChannelSwitchDeadline(), this.emitter.emit("send signal", {
|
|
8381
8371
|
type: "subscribe",
|
|
8382
8372
|
subscription: e
|
|
8383
8373
|
});
|
|
8384
|
-
}), this.logger = t, this.targetSubscription = n, this.currentSubscription =
|
|
8374
|
+
}), this.logger = t, this.targetSubscription = n, this.currentSubscription = Hv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
8385
8375
|
}
|
|
8386
8376
|
};
|
|
8387
|
-
|
|
8377
|
+
Vv = Kv, e(Kv, "create", (e, t, n) => new Vv(e, n, t));
|
|
8388
8378
|
// ../../libs/web-sdk/src/resolveEdgeUrl.ts
|
|
8389
|
-
var
|
|
8379
|
+
var qv = (e, t) => {
|
|
8390
8380
|
var n, r;
|
|
8391
8381
|
let i = new URL("/subscribe", e);
|
|
8392
8382
|
return i.searchParams.append("channelId", t.channelId), i.searchParams.append("sessionId", t.sessionId), i.searchParams.append("clientId", t.clientId), (n = t.audio) != null && n.codec && (i.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), i.searchParams.append("audio.codec", t.audio.codec), t.audio.language && i.searchParams.append("audio.language", t.audio.language)), (r = t.video) != null && r.codec && (i.searchParams.append("video.width", t.video.width.toString()), i.searchParams.append("video.height", t.video.height.toString()), i.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), i.searchParams.append("video.codec", t.video.codec)), t.burstMs !== void 0 && i.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && i.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (i.searchParams.append("auth.token", t.authToken), i.searchParams.append("auth.type", "jwt")), i.toString();
|
|
8393
|
-
},
|
|
8383
|
+
}, Jv = (e) => {
|
|
8394
8384
|
try {
|
|
8395
8385
|
return e ? new URL(e).origin : void 0;
|
|
8396
8386
|
} catch (e) {
|
|
8397
8387
|
return;
|
|
8398
8388
|
}
|
|
8399
|
-
},
|
|
8389
|
+
}, Yv = 5e3, Xv = 500, Zv = 2e3, Qv = Yv, $v = /* @__PURE__ */ new WeakMap(), ey = /* @__PURE__ */ new WeakMap(), ty = /* @__PURE__ */ new WeakMap(), ny = /* @__PURE__ */ new WeakMap(), ry = /* @__PURE__ */ new WeakMap(), iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakSet(), cy = class {
|
|
8400
8390
|
constructor(t, r, a, s = () => performance.timeOrigin + performance.now()) {
|
|
8401
|
-
k(this,
|
|
8402
|
-
o(
|
|
8391
|
+
k(this, sy), c(this, $v, void 0), c(this, ey, void 0), c(this, ty, void 0), c(this, ny, void 0), c(this, ry, void 0), c(this, iy, void 0), c(this, ay, void 0), c(this, oy, void 0), e(this, "alive", () => {
|
|
8392
|
+
o(sy, this, ly).call(this, i(ny, this).call(this));
|
|
8403
8393
|
}), e(this, "check", () => {
|
|
8404
|
-
let e = i(
|
|
8405
|
-
if (o(
|
|
8406
|
-
if (i(
|
|
8407
|
-
if (!i(
|
|
8408
|
-
n(
|
|
8394
|
+
let e = i(ny, this).call(this);
|
|
8395
|
+
if (o(sy, this, ly).call(this, e), i(ry, this) === void 0 || !i(ey, this).call(this)) return;
|
|
8396
|
+
if (i(ay, this) !== void 0 && i(oy, this) !== void 0) {
|
|
8397
|
+
if (!i($v, this).sentSince(i(oy, this)) && e - i(ay, this) < Qv) return;
|
|
8398
|
+
n(ay, this, void 0), n(oy, this, void 0);
|
|
8409
8399
|
}
|
|
8410
|
-
let t = i(
|
|
8411
|
-
t === void 0 || t <=
|
|
8412
|
-
}), n(
|
|
8400
|
+
let t = i($v, this).level();
|
|
8401
|
+
t === void 0 || t <= Yv || (this.stop(), i(ty, this).call(this, t));
|
|
8402
|
+
}), n($v, this, t), n(ey, this, r), n(ty, this, a), n(ny, this, s);
|
|
8413
8403
|
}
|
|
8414
8404
|
start() {
|
|
8415
|
-
this.stop(), n(
|
|
8405
|
+
this.stop(), n(iy, this, i(ny, this).call(this)), n(ay, this, void 0), n(oy, this, void 0), n(ry, this, setInterval(this.check, Xv));
|
|
8416
8406
|
}
|
|
8417
8407
|
stop() {
|
|
8418
|
-
clearInterval(i(
|
|
8408
|
+
clearInterval(i(ry, this)), n(ry, this, void 0);
|
|
8419
8409
|
}
|
|
8420
8410
|
};
|
|
8421
|
-
function
|
|
8422
|
-
i(
|
|
8411
|
+
function ly(e) {
|
|
8412
|
+
i(iy, this) !== void 0 && e - i(iy, this) > Zv && (i(ay, this) != null || n(ay, this, e), n(oy, this, e)), n(iy, this, e);
|
|
8423
8413
|
}
|
|
8424
8414
|
// ../../libs/web-sdk/src/adapters/EdgeClock.ts
|
|
8425
|
-
var
|
|
8415
|
+
var uy = /* @__PURE__ */ new WeakMap(), dy = /* @__PURE__ */ new WeakMap(), fy = /* @__PURE__ */ new WeakMap(), py = /* @__PURE__ */ new WeakMap(), my = class {
|
|
8426
8416
|
constructor(e, t = () => performance.timeOrigin + performance.now()) {
|
|
8427
|
-
c(this,
|
|
8417
|
+
c(this, uy, void 0), c(this, dy, void 0), c(this, fy, void 0), c(this, py, 0), n(uy, this, e), n(dy, this, t);
|
|
8428
8418
|
}
|
|
8429
8419
|
sample(e, t) {
|
|
8430
8420
|
var r;
|
|
8431
|
-
Number.isFinite(e) && Number.isFinite(t) && (n(
|
|
8432
|
-
edgeTime: e + i(
|
|
8421
|
+
Number.isFinite(e) && Number.isFinite(t) && (n(py, this, (r = i(uy, this).delayOf(e, t)) == null ? i(py, this) : r), n(fy, this, {
|
|
8422
|
+
edgeTime: e + i(py, this),
|
|
8433
8423
|
localTime: t
|
|
8434
8424
|
}));
|
|
8435
8425
|
}
|
|
8436
8426
|
wallclock() {
|
|
8437
|
-
if (i(
|
|
8427
|
+
if (i(fy, this)) return i(fy, this).edgeTime + (i(dy, this).call(this) - i(fy, this).localTime);
|
|
8438
8428
|
}
|
|
8439
|
-
},
|
|
8429
|
+
}, hy = 3e5, gy = 3, _y = 1e4, vy = 1e3, yy = 250, by = 200, xy = /* @__PURE__ */ new WeakMap(), Sy = /* @__PURE__ */ new WeakMap(), Cy = /* @__PURE__ */ new WeakMap(), wy = /* @__PURE__ */ new WeakMap(), Ty = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = /* @__PURE__ */ new WeakMap(), ky = /* @__PURE__ */ new WeakSet(), Ay = class {
|
|
8440
8430
|
constructor(e = () => performance.timeOrigin + performance.now()) {
|
|
8441
|
-
k(this,
|
|
8431
|
+
k(this, ky), c(this, xy, void 0), c(this, Sy, []), c(this, Cy, 0), c(this, wy, void 0), c(this, Ty, void 0), c(this, Ey, void 0), c(this, Dy, 0), c(this, Oy, []), n(xy, this, e);
|
|
8442
8432
|
}
|
|
8443
8433
|
sample(e, t) {
|
|
8444
8434
|
var r;
|
|
8445
8435
|
if (!Number.isFinite(e) || !Number.isFinite(t)) return;
|
|
8446
8436
|
let a = t - e;
|
|
8447
|
-
if (i(
|
|
8437
|
+
if (i(wy, this) !== void 0) {
|
|
8448
8438
|
var s, c;
|
|
8449
|
-
let t = e - i(
|
|
8450
|
-
t < -1e3 || u >
|
|
8439
|
+
let t = e - i(wy, this), r = i(Oy, this).length >= 2 && a < o(ky, this, jy).call(this) - vy && t > ((s = Fy(i(Oy, this))) == null ? 0 : s) + vy, l = Fy(i(Oy, this)), u = l === void 0 ? 0 : l - t;
|
|
8440
|
+
t < -1e3 || u > vy && a - ((c = i(Ey, this)) == null ? a : c) > u - yy || r ? (n(Sy, this, []), n(Cy, this, 0), n(Oy, this, [])) : t >= by && n(Oy, this, [...i(Oy, this).slice(-4), t]);
|
|
8451
8441
|
}
|
|
8452
|
-
n(
|
|
8442
|
+
n(wy, this, e), n(Ty, this, t), n(Ey, this, a), n(Cy, this, (r = i(Cy, this), r++, r)), n(Sy, this, i(Sy, this).filter((e) => e.arrivedAt > t - hy)), i(Sy, this).push({
|
|
8453
8443
|
arrivedAt: t,
|
|
8454
8444
|
delay: a
|
|
8455
|
-
}), n(
|
|
8445
|
+
}), n(Dy, this, a - o(ky, this, jy).call(this));
|
|
8456
8446
|
}
|
|
8457
8447
|
sentSince(e) {
|
|
8458
|
-
return i(
|
|
8448
|
+
return i(wy, this) === void 0 || i(Sy, this).length === 0 ? !1 : i(wy, this) + o(ky, this, jy).call(this) >= e;
|
|
8459
8449
|
}
|
|
8460
|
-
level(e = i(
|
|
8461
|
-
if (i(
|
|
8462
|
-
let t = o(
|
|
8463
|
-
if (!(t <= 0 && e - i(
|
|
8450
|
+
level(e = i(xy, this).call(this)) {
|
|
8451
|
+
if (i(Cy, this) < gy || i(Ty, this) === void 0) return;
|
|
8452
|
+
let t = o(ky, this, My).call(this, e);
|
|
8453
|
+
if (!(t <= 0 && e - i(Ty, this) > _y)) return Math.max(i(Dy, this), t);
|
|
8464
8454
|
}
|
|
8465
8455
|
delayOf(e, t) {
|
|
8466
|
-
if (this.level(t) !== void 0 && Number.isFinite(e)) return Math.max(0, t - e - o(
|
|
8456
|
+
if (this.level(t) !== void 0 && Number.isFinite(e)) return Math.max(0, t - e - o(ky, this, jy).call(this));
|
|
8467
8457
|
}
|
|
8468
|
-
peak(e, t = i(
|
|
8458
|
+
peak(e, t = i(xy, this).call(this)) {
|
|
8469
8459
|
var n;
|
|
8470
8460
|
return (n = this.summary(e, t)) == null ? void 0 : n.max;
|
|
8471
8461
|
}
|
|
8472
|
-
summary(e, t = i(
|
|
8462
|
+
summary(e, t = i(xy, this).call(this)) {
|
|
8473
8463
|
let n = this.level(t);
|
|
8474
8464
|
if (n === void 0) return;
|
|
8475
|
-
let r = o(
|
|
8476
|
-
return gt([...i(
|
|
8465
|
+
let r = o(ky, this, jy).call(this);
|
|
8466
|
+
return gt([...i(Sy, this).filter((n) => n.arrivedAt >= t - e).map((e) => e.delay - r), n]);
|
|
8477
8467
|
}
|
|
8478
8468
|
};
|
|
8479
|
-
function
|
|
8480
|
-
return i(
|
|
8469
|
+
function jy() {
|
|
8470
|
+
return i(Sy, this).reduce((e, t) => Math.min(e, t.delay), Infinity);
|
|
8481
8471
|
}
|
|
8482
|
-
function
|
|
8483
|
-
let t =
|
|
8484
|
-
return t === void 0 || i(
|
|
8472
|
+
function My(e) {
|
|
8473
|
+
let t = Fy(i(Oy, this));
|
|
8474
|
+
return t === void 0 || i(Ty, this) === void 0 ? 0 : e - (i(Ty, this) - i(Dy, this) + t);
|
|
8485
8475
|
}
|
|
8486
|
-
var
|
|
8487
|
-
let n = t.summary(
|
|
8476
|
+
var Ny = 3e3, Py = (e, t) => {
|
|
8477
|
+
let n = t.summary(Ny);
|
|
8488
8478
|
n !== void 0 && e.debug("Link queue", {
|
|
8489
8479
|
levelMs: Math.round(n.last),
|
|
8490
8480
|
peak3sMs: Math.round(n.max)
|
|
8491
8481
|
});
|
|
8492
|
-
},
|
|
8482
|
+
}, Fy = (e) => {
|
|
8493
8483
|
if (e.length === 0) return;
|
|
8494
8484
|
let t = [...e].sort((e, t) => e - t);
|
|
8495
8485
|
return t[Math.floor(t.length / 2)];
|
|
8496
8486
|
};
|
|
8497
8487
|
// ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
|
|
8498
|
-
function
|
|
8488
|
+
function Iy(e, t, n) {
|
|
8499
8489
|
let r = new URL("/voq/subscribe", e);
|
|
8500
8490
|
return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), n && r.searchParams.set("authToken", n), r;
|
|
8501
8491
|
}
|
|
8502
|
-
function
|
|
8492
|
+
function Ly(e, t) {
|
|
8503
8493
|
let n = [];
|
|
8504
8494
|
for (let r of e == null ? [] : e) try {
|
|
8505
8495
|
n.push({
|
|
@@ -8514,84 +8504,84 @@ function Ry(e, t) {
|
|
|
8514
8504
|
}
|
|
8515
8505
|
return n.length > 0 ? n : void 0;
|
|
8516
8506
|
}
|
|
8517
|
-
function
|
|
8507
|
+
function Ry(e, t, n) {
|
|
8518
8508
|
return n !== void 0 && e.get("webtransportEnabled") && !e.get("unstableWebtransportEnabled") && !!self.WebTransport && t.protocol.startsWith("https") && Me();
|
|
8519
8509
|
}
|
|
8520
|
-
var
|
|
8510
|
+
var zy = 1e4, X = /* @__PURE__ */ new WeakMap(), By = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMap(), Hy = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Uy = /* @__PURE__ */ new WeakMap(), Wy = /* @__PURE__ */ new WeakMap(), Gy = /* @__PURE__ */ new WeakMap(), Ky = /* @__PURE__ */ new WeakMap(), qy = /* @__PURE__ */ new WeakMap(), Jy = /* @__PURE__ */ new WeakMap(), Yy = /* @__PURE__ */ new WeakMap(), Xy = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), Zy = /* @__PURE__ */ new WeakMap(), Qy = /* @__PURE__ */ new WeakMap(), $y = /* @__PURE__ */ new WeakMap(), eb = /* @__PURE__ */ new WeakMap(), tb = /* @__PURE__ */ new WeakMap(), nb = /* @__PURE__ */ new WeakMap(), rb = class r {
|
|
8521
8511
|
get estimatedBandwidth() {
|
|
8522
|
-
return i(
|
|
8512
|
+
return i(Ky, this);
|
|
8523
8513
|
}
|
|
8524
8514
|
unload() {
|
|
8525
|
-
i(X, this).off("send signal", i(
|
|
8515
|
+
i(X, this).off("send signal", i(Qy, this)), i(X, this).off("disconnect", this.disconnect), i(X, this).off("text track", i(Zy, this)), this.disconnect();
|
|
8526
8516
|
}
|
|
8527
8517
|
suspend() {}
|
|
8528
8518
|
unsuspend() {}
|
|
8529
8519
|
getStatistics() {
|
|
8530
|
-
let e = i(
|
|
8520
|
+
let e = i(Vy, this).transportType() === "webtransport" ? "moq" : "moq_ws";
|
|
8531
8521
|
return {
|
|
8532
|
-
edgeUrl:
|
|
8522
|
+
edgeUrl: Jv(i(Vy, this).url()),
|
|
8533
8523
|
connectionProtocol: e,
|
|
8534
|
-
transportSelectionReason: i(
|
|
8524
|
+
transportSelectionReason: i(qy, this)
|
|
8535
8525
|
};
|
|
8536
8526
|
}
|
|
8537
8527
|
constructor(t, r, a, s, l, u, d, f, p, m) {
|
|
8538
|
-
k(this, Q), c(this, X, void 0), c(this,
|
|
8528
|
+
k(this, Q), c(this, X, void 0), c(this, By, void 0), c(this, Vy, void 0), c(this, Hy, "disconnected"), c(this, Z, void 0), c(this, Uy, /* @__PURE__ */ new Map()), c(this, Wy, void 0), c(this, Gy, void 0), c(this, Ky, void 0), c(this, qy, void 0), c(this, Jy, /* @__PURE__ */ new Map()), e(this, "linkQueue", void 0), c(this, Yy, void 0), c(this, Xy, void 0), e(this, "closedForBacklog", !1), c(this, Zy, (e) => {
|
|
8539
8529
|
if (!e) {
|
|
8540
8530
|
i(Z, this).setSubtitleTrack(void 0).catch(b);
|
|
8541
8531
|
return;
|
|
8542
8532
|
}
|
|
8543
|
-
let t = i(
|
|
8533
|
+
let t = i(Uy, this).get(Vh(i(Z, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
|
|
8544
8534
|
n && i(Z, this).setSubtitleTrack(n).catch(b);
|
|
8545
|
-
}), c(this,
|
|
8535
|
+
}), c(this, Qy, (e) => {
|
|
8546
8536
|
switch (e.type) {
|
|
8547
8537
|
case "subscribe":
|
|
8548
8538
|
{
|
|
8549
|
-
if (i(
|
|
8550
|
-
let t = i(
|
|
8539
|
+
if (i($y, this)) return;
|
|
8540
|
+
let t = i(tb, this);
|
|
8551
8541
|
if (t) {
|
|
8552
|
-
if (
|
|
8553
|
-
n(
|
|
8542
|
+
if (Wv(t, e.subscription)) {
|
|
8543
|
+
n(eb, this, void 0);
|
|
8554
8544
|
return;
|
|
8555
8545
|
}
|
|
8556
|
-
i(
|
|
8546
|
+
i(By, this).info("Queueing - we are already switching"), n(eb, this, e.subscription);
|
|
8557
8547
|
return;
|
|
8558
8548
|
}
|
|
8559
|
-
o(Q, this,
|
|
8549
|
+
o(Q, this, ob).call(this, e.subscription);
|
|
8560
8550
|
}
|
|
8561
8551
|
break;
|
|
8562
8552
|
case "telemetry":
|
|
8563
|
-
g(new URL("/api/telemetry", i(
|
|
8553
|
+
g(new URL("/api/telemetry", i(Vy, this).url().replace("wss://", "https://")), {
|
|
8564
8554
|
body: e.body,
|
|
8565
8555
|
headers: { "Content-Type": "text/plain" }
|
|
8566
8556
|
}).catch(b);
|
|
8567
8557
|
break;
|
|
8568
|
-
case "refresh auth": i(
|
|
8558
|
+
case "refresh auth": i(Vy, this).updateAuthToken(e.token);
|
|
8569
8559
|
}
|
|
8570
|
-
}), c(this,
|
|
8560
|
+
}), c(this, $y, !1), c(this, eb, void 0), c(this, tb, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
|
|
8571
8561
|
var t;
|
|
8572
|
-
i(
|
|
8573
|
-
}), c(this,
|
|
8574
|
-
o(Q, this,
|
|
8575
|
-
}), n(X, this, t), n(
|
|
8562
|
+
i(By, this).info("Disconnecting", e), (t = i(Xy, this)) == null || t.stop(), o(Q, this, ab).call(this), i(Vy, this).close(), i(Z, this).close().catch(b), n(Jy, this, /* @__PURE__ */ new Map()), o(Q, this, lb).call(this, "disconnected");
|
|
8563
|
+
}), c(this, nb, (e) => {
|
|
8564
|
+
o(Q, this, ab).call(this), this.closedForBacklog = !0, i(By, this).info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), i(Vy, this).close(), i(X, this).emit("ping timeout");
|
|
8565
|
+
}), n(X, this, t), n(By, this, r), n(Vy, this, a), n(Z, this, s), n(Uy, this, l), n(Wy, this, u), n(Gy, this, d), n(qy, this, f), this.linkQueue = p, n(Yy, this, m), i(X, this).on("send signal", i(Qy, this)), i(X, this).on("disconnect", this.disconnect), i(X, this).on("text track", i(Zy, this)), o(Q, this, ib).call(this).catch(b), o(Q, this, ub).call(this).catch(b), p && (n(Xy, this, new cy(p, () => i(Hy, this) === "connected", i(nb, this))), i(Xy, this).start());
|
|
8576
8566
|
}
|
|
8577
8567
|
static start(e, n, a, o, s) {
|
|
8578
8568
|
return t(function* () {
|
|
8579
8569
|
var t, c, l, u, d;
|
|
8580
|
-
let f = new Map(o.connectInfo.channels.map((e) => [
|
|
8570
|
+
let f = new Map(o.connectInfo.channels.map((e) => [Vh(e.catalog.namespace), new _b(new Vt(e.catalog))])), p = yield o.onConnectInfo(o.connectInfo), m = o.options.get("authenticationToken"), h, g, ee;
|
|
8581
8571
|
switch (typeof o.edgeUrl) {
|
|
8582
8572
|
case "string":
|
|
8583
|
-
h =
|
|
8573
|
+
h = Iy(o.edgeUrl, p, m);
|
|
8584
8574
|
break;
|
|
8585
|
-
default: h =
|
|
8575
|
+
default: h = Iy(o.edgeUrl.moqUrl || o.edgeUrl.moqWsUrl, p, m), g = Iy(o.edgeUrl.moqWsUrl, p, m), ee = Ly(o.edgeUrl.serverCertificateHashes, n);
|
|
8586
8576
|
}
|
|
8587
8577
|
let _ = (t = o.connectInfo.channels.find((e) => e.channelId === p.channelId)) == null ? void 0 : t.catalog;
|
|
8588
8578
|
n.debug("Resolved edge url", {
|
|
8589
8579
|
edgeUrl: h,
|
|
8590
8580
|
edgeWsUrl: g
|
|
8591
8581
|
}), v(_, "no catalog found");
|
|
8592
|
-
let y = (c = f.get(
|
|
8582
|
+
let y = (c = f.get(Vh(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), b = (l = f.get(Vh(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), x = Ry(o.options, h, g), S;
|
|
8593
8583
|
try {
|
|
8594
|
-
S = yield
|
|
8584
|
+
S = yield Nh({
|
|
8595
8585
|
url: h,
|
|
8596
8586
|
wsUrl: g,
|
|
8597
8587
|
serverCertificateHashes: ee,
|
|
@@ -8608,10 +8598,10 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
|
|
|
8608
8598
|
(u = o.onTransportConnected) == null || u.call(o);
|
|
8609
8599
|
let ne = C.closed().then((e) => {
|
|
8610
8600
|
throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
|
|
8611
|
-
}), w = C.transportType() === "websocket" ? new
|
|
8601
|
+
}), w = C.transportType() === "websocket" ? new Ay() : void 0, T = w == null ? new Ay() : w, re = new my(T), ie, E;
|
|
8612
8602
|
try {
|
|
8613
8603
|
E = yield Promise.race([
|
|
8614
|
-
|
|
8604
|
+
Pv.start(C.subscriber, {
|
|
8615
8605
|
namespace: _.namespace,
|
|
8616
8606
|
catalog: _,
|
|
8617
8607
|
videoTrack: y == null ? void 0 : y.track,
|
|
@@ -8619,17 +8609,17 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
|
|
|
8619
8609
|
burstMs: p.burstMs || 0,
|
|
8620
8610
|
onStats: (e, t) => {
|
|
8621
8611
|
let r = performance.timeOrigin + t;
|
|
8622
|
-
T.sample(e.ntpTimestamp, r), re.sample(e.ntpTimestamp, r), w && (
|
|
8612
|
+
T.sample(e.ntpTimestamp, r), re.sample(e.ntpTimestamp, r), w && (Py(n, w), ie == null || ie());
|
|
8623
8613
|
}
|
|
8624
8614
|
}),
|
|
8625
|
-
sn(
|
|
8615
|
+
sn(zy, /* @__PURE__ */ Error("Timeout waiting for player to start")),
|
|
8626
8616
|
ne
|
|
8627
8617
|
]);
|
|
8628
8618
|
} catch (e) {
|
|
8629
8619
|
throw C.close(), e;
|
|
8630
8620
|
}
|
|
8631
|
-
let ae = new
|
|
8632
|
-
f.set(
|
|
8621
|
+
let ae = new _b(E.catalog());
|
|
8622
|
+
f.set(Vh(_.namespace), ae), e.emit("received signal", {
|
|
8633
8623
|
type: "client ip",
|
|
8634
8624
|
ip: E.connectionInfo().ip
|
|
8635
8625
|
}), E.drm().then((t) => {
|
|
@@ -8638,29 +8628,29 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
|
|
|
8638
8628
|
n.error("Error getting DRM data", e);
|
|
8639
8629
|
});
|
|
8640
8630
|
let oe = new r(e, n, C, E, f, a, s, te, w, re);
|
|
8641
|
-
return ie = (d = i(
|
|
8631
|
+
return ie = (d = i(Xy, oe)) == null ? void 0 : d.check, p.textTrack && i(Zy, oe).call(oe, p.textTrack), oe;
|
|
8642
8632
|
})();
|
|
8643
8633
|
}
|
|
8644
8634
|
getState() {
|
|
8645
|
-
return i(
|
|
8635
|
+
return i(Hy, this);
|
|
8646
8636
|
}
|
|
8647
8637
|
close() {
|
|
8648
8638
|
var e;
|
|
8649
|
-
(e = i(
|
|
8639
|
+
(e = i(Xy, this)) == null || e.stop(), o(Q, this, ab).call(this), i(Vy, this).close();
|
|
8650
8640
|
}
|
|
8651
8641
|
closed() {
|
|
8652
|
-
return Promise.race([i(
|
|
8642
|
+
return Promise.race([i(Vy, this).closed(), i(Z, this).closed()]);
|
|
8653
8643
|
}
|
|
8654
8644
|
};
|
|
8655
|
-
function
|
|
8645
|
+
function ib() {
|
|
8656
8646
|
var e = this;
|
|
8657
8647
|
return t(function* () {
|
|
8658
|
-
i(
|
|
8648
|
+
i(Vy, e).transportType() === "websocket" && (yield on(5e3));
|
|
8659
8649
|
var t = !1, r = !1, a;
|
|
8660
8650
|
try {
|
|
8661
8651
|
for (var o = H(i(Z, e).stats()), s; t = !(s = yield o.next()).done; t = !1) {
|
|
8662
8652
|
let { rtt: t, estimatedBandwidth: r } = s.value;
|
|
8663
|
-
n(
|
|
8653
|
+
n(Ky, e, r), i(Gy, e).push(t), i(X, e).emit("rtt", pt(i(Gy, e).items()));
|
|
8664
8654
|
}
|
|
8665
8655
|
} catch (e) {
|
|
8666
8656
|
r = !0, a = e;
|
|
@@ -8673,45 +8663,45 @@ function ab() {
|
|
|
8673
8663
|
}
|
|
8674
8664
|
})();
|
|
8675
8665
|
}
|
|
8676
|
-
function
|
|
8677
|
-
n(
|
|
8678
|
-
}
|
|
8679
|
-
function
|
|
8680
|
-
n(
|
|
8681
|
-
if (i(
|
|
8682
|
-
i(
|
|
8683
|
-
let r = i(
|
|
8684
|
-
n(
|
|
8666
|
+
function ab() {
|
|
8667
|
+
n($y, this, !0), n(eb, this, void 0);
|
|
8668
|
+
}
|
|
8669
|
+
function ob(e) {
|
|
8670
|
+
n(tb, this, e), o(Q, this, cb).call(this, e).catch((t) => {
|
|
8671
|
+
if (i($y, this)) return;
|
|
8672
|
+
i(By, this).error("error handling subscription", t);
|
|
8673
|
+
let r = i(eb, this);
|
|
8674
|
+
n(eb, this, void 0), i(X, this).emit("received signal", {
|
|
8685
8675
|
type: "subscription changed",
|
|
8686
8676
|
subscription: r == null ? e : r,
|
|
8687
8677
|
reset: !0
|
|
8688
8678
|
});
|
|
8689
8679
|
}).finally(() => {
|
|
8690
|
-
n(
|
|
8691
|
-
let e = i(
|
|
8692
|
-
n(
|
|
8680
|
+
n(tb, this, void 0);
|
|
8681
|
+
let e = i(eb, this);
|
|
8682
|
+
n(eb, this, void 0), e && !i($y, this) && o(Q, this, ob).call(this, e);
|
|
8693
8683
|
});
|
|
8694
8684
|
}
|
|
8695
|
-
function
|
|
8685
|
+
function sb(e) {
|
|
8696
8686
|
var n = this;
|
|
8697
8687
|
return t(function* () {
|
|
8698
8688
|
var t;
|
|
8699
|
-
let r = yield i(
|
|
8689
|
+
let r = yield i(Wy, n).connect({ channelId: e });
|
|
8700
8690
|
if (!u(r)) throw Error("no moq connect info found");
|
|
8701
8691
|
let a = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
|
|
8702
8692
|
if (!a) throw Error("no catalog found");
|
|
8703
8693
|
return a;
|
|
8704
8694
|
})();
|
|
8705
8695
|
}
|
|
8706
|
-
function
|
|
8696
|
+
function cb(e) {
|
|
8707
8697
|
var n = this;
|
|
8708
8698
|
return t(function* () {
|
|
8709
8699
|
var t, r;
|
|
8710
|
-
i(
|
|
8711
|
-
let a = i(Z, n), s = i(
|
|
8712
|
-
if (s || (s = new
|
|
8700
|
+
i(By, n).info("handle subscription", e);
|
|
8701
|
+
let a = i(Z, n), s = i(Uy, n).get(e.channelId);
|
|
8702
|
+
if (s || (s = new _b(new Vt(yield o(Q, n, sb).call(n, e.channelId))), i(Uy, n).set(e.channelId, s)), a.namespace().join("/") !== s.namespace().join("/")) {
|
|
8713
8703
|
var c;
|
|
8714
|
-
i(
|
|
8704
|
+
i(By, n).info("changing channel", e.channelId);
|
|
8715
8705
|
let t = s.getVideoTrack(e.video), r = s.getAudioTrack(e.audio);
|
|
8716
8706
|
if (yield a.zap({
|
|
8717
8707
|
namespace: s.namespace(),
|
|
@@ -8721,8 +8711,8 @@ function lb(e) {
|
|
|
8721
8711
|
}, 500), a.drm().then((e) => {
|
|
8722
8712
|
e && i(X, n).emit("received drm data", e.value);
|
|
8723
8713
|
}).catch((e) => {
|
|
8724
|
-
i(
|
|
8725
|
-
}), i(
|
|
8714
|
+
i(By, n).error("Error getting DRM data", e);
|
|
8715
|
+
}), i(By, n).info("switched channel", e.channelId), (c = i(Uy, n).get(Vh(a.namespace()))) == null || c.updateCatalog(a.catalog()), i($y, n)) return;
|
|
8726
8716
|
i(X, n).emit("received signal", {
|
|
8727
8717
|
type: "subscription changed",
|
|
8728
8718
|
subscription: e
|
|
@@ -8730,32 +8720,32 @@ function lb(e) {
|
|
|
8730
8720
|
return;
|
|
8731
8721
|
}
|
|
8732
8722
|
let l = s.getVideoTrack(e.video), u = s.getAudioTrack(e.audio);
|
|
8733
|
-
yield Promise.all([l && l.track.name !== ((t = i(Z, n).videoTrack()) == null ? void 0 : t.name) ? i(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = i(Z, n).audioTrack()) == null ? void 0 : r.name) ? i(Z, n).setAudioTrack(u.track) : void 0]), i(
|
|
8723
|
+
yield Promise.all([l && l.track.name !== ((t = i(Z, n).videoTrack()) == null ? void 0 : t.name) ? i(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = i(Z, n).audioTrack()) == null ? void 0 : r.name) ? i(Z, n).setAudioTrack(u.track) : void 0]), i($y, n) || i(X, n).emit("received signal", {
|
|
8734
8724
|
type: "subscription changed",
|
|
8735
8725
|
subscription: e
|
|
8736
8726
|
});
|
|
8737
8727
|
})();
|
|
8738
8728
|
}
|
|
8739
|
-
function
|
|
8740
|
-
n(
|
|
8729
|
+
function lb(e) {
|
|
8730
|
+
n(Hy, this, e), i(X, this).emit("connection state", e);
|
|
8741
8731
|
}
|
|
8742
|
-
function
|
|
8732
|
+
function ub() {
|
|
8743
8733
|
var e = this;
|
|
8744
8734
|
return t(function* () {
|
|
8745
8735
|
try {
|
|
8746
|
-
o(Q, e,
|
|
8747
|
-
o(Q, e,
|
|
8748
|
-
o(Q, e,
|
|
8749
|
-
o(Q, e,
|
|
8750
|
-
]), yield i(Z, e).closed(), i(
|
|
8736
|
+
o(Q, e, lb).call(e, "connecting"), i(By, e).info("Connecting..."), o(Q, e, lb).call(e, "connected"), yield Promise.all([
|
|
8737
|
+
o(Q, e, fb).call(e, i(Z, e).referenceClock(), i(Z, e).audio),
|
|
8738
|
+
o(Q, e, fb).call(e, i(Z, e).referenceClock(), i(Z, e).video),
|
|
8739
|
+
o(Q, e, db).call(e, i(Z, e).subtitles)
|
|
8740
|
+
]), yield i(Z, e).closed(), i(Vy, e).close(), i(By, e).info("Session closed");
|
|
8751
8741
|
} catch (t) {
|
|
8752
|
-
i(
|
|
8742
|
+
i(By, e).warn("Session error", t), i(Vy, e).close();
|
|
8753
8743
|
} finally {
|
|
8754
|
-
o(Q, e,
|
|
8744
|
+
o(Q, e, lb).call(e, "disconnected");
|
|
8755
8745
|
}
|
|
8756
8746
|
})();
|
|
8757
8747
|
}
|
|
8758
|
-
function
|
|
8748
|
+
function db(e) {
|
|
8759
8749
|
var n = this;
|
|
8760
8750
|
return t(function* () {
|
|
8761
8751
|
var t = !1, r = !1, a;
|
|
@@ -8775,7 +8765,7 @@ function fb(e) {
|
|
|
8775
8765
|
}
|
|
8776
8766
|
})();
|
|
8777
8767
|
}
|
|
8778
|
-
function
|
|
8768
|
+
function fb(e, n) {
|
|
8779
8769
|
var r = this;
|
|
8780
8770
|
return t(function* () {
|
|
8781
8771
|
let t = "", a = "", o, s = i(Z, r).videoTrack() === void 0;
|
|
@@ -8785,7 +8775,7 @@ function pb(e, n) {
|
|
|
8785
8775
|
let n = f.value;
|
|
8786
8776
|
{
|
|
8787
8777
|
var p;
|
|
8788
|
-
let c =
|
|
8778
|
+
let c = Vh(n.track.namespace), l = n.track.trackObject.language, u = h((p = n.track.trackObject.codec) == null ? "" : p), d = n.track.trackObject.codec, f = u ? un({
|
|
8789
8779
|
codec: u,
|
|
8790
8780
|
codecString: d
|
|
8791
8781
|
}) : void 0, x = !!n.track.trackObject["com.vindral.drm"];
|
|
@@ -8795,19 +8785,19 @@ function pb(e, n) {
|
|
|
8795
8785
|
let [p, m] = v.value;
|
|
8796
8786
|
{
|
|
8797
8787
|
var y;
|
|
8798
|
-
(y = i(
|
|
8788
|
+
(y = i(Xy, r)) == null || y.alive();
|
|
8799
8789
|
let h = {
|
|
8800
8790
|
channelId: t !== "" && (s || m.mediaType() === "video") && t !== c ? c : void 0,
|
|
8801
8791
|
language: m.mediaType() === "audio" && a !== l ? l : void 0,
|
|
8802
8792
|
drmTransition: o !== void 0 && o !== x
|
|
8803
8793
|
};
|
|
8804
8794
|
t = c, a = l, o = x;
|
|
8805
|
-
let g = m.producerReferenceTime(), ee = i(
|
|
8795
|
+
let g = m.producerReferenceTime(), ee = i(Jy, r).get(n.track.namespace), _ = performance.now();
|
|
8806
8796
|
if (g && (ee === void 0 || _ - ee > 1e3)) {
|
|
8807
8797
|
var b;
|
|
8808
|
-
i(
|
|
8809
|
-
let t = ((b = i(
|
|
8810
|
-
i(
|
|
8798
|
+
i(Jy, r).set(n.track.namespace, _);
|
|
8799
|
+
let t = ((b = i(Yy, r).wallclock()) == null ? e.wallclock() : b) - g.getTime();
|
|
8800
|
+
i(By, r).debug("timing-info", {
|
|
8811
8801
|
mediaType: m.mediaType(),
|
|
8812
8802
|
referenceClock: e,
|
|
8813
8803
|
delta: t,
|
|
@@ -8831,7 +8821,7 @@ function pb(e, n) {
|
|
|
8831
8821
|
codec: u,
|
|
8832
8822
|
codecString: d,
|
|
8833
8823
|
switchInfo: h,
|
|
8834
|
-
renditionId:
|
|
8824
|
+
renditionId: pb(n.track.trackObject.name)
|
|
8835
8825
|
});
|
|
8836
8826
|
}
|
|
8837
8827
|
}
|
|
@@ -8857,45 +8847,45 @@ function pb(e, n) {
|
|
|
8857
8847
|
}
|
|
8858
8848
|
})();
|
|
8859
8849
|
}
|
|
8860
|
-
function
|
|
8850
|
+
function pb(e) {
|
|
8861
8851
|
return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
|
|
8862
8852
|
}
|
|
8863
|
-
var
|
|
8853
|
+
var mb = /* @__PURE__ */ new WeakMap(), hb = /* @__PURE__ */ new WeakMap(), gb = /* @__PURE__ */ new WeakSet(), _b = class {
|
|
8864
8854
|
constructor(e) {
|
|
8865
|
-
k(this,
|
|
8855
|
+
k(this, gb), c(this, mb, void 0), c(this, hb, void 0), n(mb, this, e), n(hb, this, o(gb, this, vb).call(this));
|
|
8866
8856
|
}
|
|
8867
8857
|
catalog() {
|
|
8868
|
-
return i(
|
|
8858
|
+
return i(mb, this).current();
|
|
8869
8859
|
}
|
|
8870
8860
|
namespace() {
|
|
8871
|
-
return i(
|
|
8861
|
+
return i(mb, this).current().namespace;
|
|
8872
8862
|
}
|
|
8873
8863
|
updateCatalog(e) {
|
|
8874
|
-
n(
|
|
8864
|
+
n(mb, this, e);
|
|
8875
8865
|
}
|
|
8876
8866
|
getTextTrack(e) {
|
|
8877
|
-
return i(
|
|
8867
|
+
return i(mb, this).current().tracks.find((t) => t.label === e);
|
|
8878
8868
|
}
|
|
8879
8869
|
getAudioTrack(e) {
|
|
8880
8870
|
if (!e.codec) return;
|
|
8881
|
-
let t = i(
|
|
8871
|
+
let t = i(hb, this).filter((t) => !(!ln(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
|
|
8882
8872
|
return t[t.length - 1];
|
|
8883
8873
|
}
|
|
8884
8874
|
getVideoTrack(e) {
|
|
8885
8875
|
if (!e.codec) return;
|
|
8886
|
-
let t = i(
|
|
8876
|
+
let t = i(hb, this).filter((t) => !(!cn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
|
|
8887
8877
|
return t[t.length - 1];
|
|
8888
8878
|
}
|
|
8889
8879
|
renditions() {
|
|
8890
|
-
return i(
|
|
8880
|
+
return i(hb, this);
|
|
8891
8881
|
}
|
|
8892
8882
|
};
|
|
8893
|
-
function
|
|
8894
|
-
let [e, t] = i(
|
|
8883
|
+
function vb() {
|
|
8884
|
+
let [e, t] = i(mb, this).value();
|
|
8895
8885
|
return f(e);
|
|
8896
8886
|
}
|
|
8897
8887
|
// ../../libs/web-sdk/src/transports/WebSocket.ts
|
|
8898
|
-
var
|
|
8888
|
+
var yb = 1e3, bb = class extends s {
|
|
8899
8889
|
constructor(n, r) {
|
|
8900
8890
|
var i;
|
|
8901
8891
|
super(), i = this, e(this, "options", void 0), e(this, "websocket", void 0), e(this, "logger", void 0), e(this, "reconnectState", { reconnectRetries: 0 }), e(this, "isSuspended", !1), e(this, "_connectionAttemptCount", 0), e(this, "connectStartTime", 0), e(this, "_connectTime", void 0), e(this, "connectTimeout", void 0), e(this, "openedAt", void 0), e(this, "erroredAt", void 0), e(this, "closeAfterErrorTimeout", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
|
|
@@ -8925,7 +8915,7 @@ var bb = 1e3, xb = class extends s {
|
|
|
8925
8915
|
this.logger.warn("On error", p({}, this.options)), this.openedAt === void 0 ? (this.close("websocket had an error"), this.emit("error", new M("WebSocket error", {
|
|
8926
8916
|
code: "websocket_error",
|
|
8927
8917
|
isFatal: !1
|
|
8928
|
-
}))) : (this.erroredAt != null || (this.erroredAt = performance.now()), this.closeAfterErrorTimeout != null || (this.closeAfterErrorTimeout = setTimeout(() => this.handleClose(),
|
|
8918
|
+
}))) : (this.erroredAt != null || (this.erroredAt = performance.now()), this.closeAfterErrorTimeout != null || (this.closeAfterErrorTimeout = setTimeout(() => this.handleClose(), yb)));
|
|
8929
8919
|
}), e(this, "onClose", (e) => {
|
|
8930
8920
|
this.handleClose(e);
|
|
8931
8921
|
}), e(this, "handleClose", (e) => {
|
|
@@ -9007,10 +8997,10 @@ var bb = 1e3, xb = class extends s {
|
|
|
9007
8997
|
get connectTime() {
|
|
9008
8998
|
return this._connectTime;
|
|
9009
8999
|
}
|
|
9010
|
-
},
|
|
9000
|
+
}, xb, Sb = 524288, Cb = .9, wb = 40, Tb = (e) => Sb * Cb * 1e3 / (e || wb), Eb = class n {
|
|
9011
9001
|
constructor(r, i, a, o) {
|
|
9012
9002
|
var s = this;
|
|
9013
|
-
e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", performance.now()), e(this, "isPingInFlight", !1), e(this, "lastSignalSentTime", performance.now()), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new x()), e(this, "linkQueue", new
|
|
9003
|
+
e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", performance.now()), e(this, "isPingInFlight", !1), e(this, "lastSignalSentTime", performance.now()), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new x()), e(this, "linkQueue", new Ay()), e(this, "clockCorrection", 0), e(this, "backlogBreaker", new cy(this.linkQueue, () => this.getState() === "connected", (e) => {
|
|
9014
9004
|
this.logger.info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), this.closeForBacklog("link queue over the breaker");
|
|
9015
9005
|
})), e(this, "unload", () => {
|
|
9016
9006
|
this.logger.debug("Unloading module..."), this.close("Unloading"), this.emitter.off("send signal", this.sendSignal), this.emitter.off("disconnect", this.close), this.emitter.off("reconnect", this.reconnect), this.logger.debug("Unloaded module");
|
|
@@ -9027,7 +9017,7 @@ var bb = 1e3, xb = class extends s {
|
|
|
9027
9017
|
}), e(this, "sendSignal", (e) => {
|
|
9028
9018
|
this.logger.debug("sending signal", { signal: e }), this.transport.readyState() === WebSocket.OPEN ? (this.transport.send(JSON.stringify(e)), this.lastSignalSentTime = performance.now()) : this.logger.debug("transport is closed");
|
|
9029
9019
|
}), e(this, "getStatistics", () => ({
|
|
9030
|
-
edgeUrl:
|
|
9020
|
+
edgeUrl: Jv(this.config.edgeUrl),
|
|
9031
9021
|
connectionProtocol: "vindral_ws",
|
|
9032
9022
|
transportSelectionReason: void 0
|
|
9033
9023
|
})), e(this, "onMessage", (e) => {
|
|
@@ -9054,7 +9044,7 @@ var bb = 1e3, xb = class extends s {
|
|
|
9054
9044
|
this.signalBuffer.push(e);
|
|
9055
9045
|
} else this.handleMessage(e);
|
|
9056
9046
|
}), e(this, "resolveEdgeUrl", t(function* () {
|
|
9057
|
-
let e = s.config.connectInfo, t = yield s.config.onConnectInfo(e), n =
|
|
9047
|
+
let e = s.config.connectInfo, t = yield s.config.onConnectInfo(e), n = qv(s.config.edgeUrl, {
|
|
9058
9048
|
video: t.video,
|
|
9059
9049
|
audio: t.audio,
|
|
9060
9050
|
burstMs: t.burstMs,
|
|
@@ -9092,7 +9082,7 @@ var bb = 1e3, xb = class extends s {
|
|
|
9092
9082
|
}
|
|
9093
9083
|
}
|
|
9094
9084
|
}), e(this, "connectWebSocketTransport", () => {
|
|
9095
|
-
let e = new
|
|
9085
|
+
let e = new bb({
|
|
9096
9086
|
reconnectDelay: 1e3,
|
|
9097
9087
|
onMessage: this.onMessage,
|
|
9098
9088
|
reconnectHandler: this.config.reconnectHandler,
|
|
@@ -9118,7 +9108,7 @@ var bb = 1e3, xb = class extends s {
|
|
|
9118
9108
|
}), e(this, "closeUnlessConnecting", (e) => this.transport.isConnectInProgress ? (this.logger.debug("Stopping reconnect, already mid-connection"), !1) : (this.close(e), !0)), e(this, "sampleLinkQueue", (e) => {
|
|
9119
9109
|
if (this.isContextSwitchInProgress || !e.includes("\"timing info\"")) return !1;
|
|
9120
9110
|
let t = JSON.parse(e);
|
|
9121
|
-
return !pn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()),
|
|
9111
|
+
return !pn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()), Py(this.logger, this.linkQueue), !0);
|
|
9122
9112
|
}), e(this, "correctTimingInfo", (e) => {
|
|
9123
9113
|
var t;
|
|
9124
9114
|
if (!e.includes("\"timing info\"")) return e;
|
|
@@ -9149,68 +9139,68 @@ var bb = 1e3, xb = class extends s {
|
|
|
9149
9139
|
return this.disconnected.promise;
|
|
9150
9140
|
}
|
|
9151
9141
|
};
|
|
9152
|
-
|
|
9153
|
-
let o = new
|
|
9142
|
+
xb = Eb, e(Eb, "PING_INTERVAL", 5e3), e(Eb, "PING_TIMEOUT", 15e3), e(Eb, "MAX_MISSED_PINGS", 4), e(Eb, "TLS_ROUNDTRIPS", 3), e(Eb, "start", (e, t, n, r) => new Promise((i, a) => {
|
|
9143
|
+
let o = new xb(e, t, n, r);
|
|
9154
9144
|
o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
|
|
9155
9145
|
var e;
|
|
9156
9146
|
(e = n.onTransportConnected) == null || e.call(n), i(o);
|
|
9157
9147
|
});
|
|
9158
9148
|
}));
|
|
9159
9149
|
// ../../libs/web-sdk/src/EdgeSelector.ts
|
|
9160
|
-
var
|
|
9150
|
+
var Db = (e) => {
|
|
9161
9151
|
var t;
|
|
9162
9152
|
return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
|
|
9163
|
-
},
|
|
9153
|
+
}, Ob = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, kb = /* @__PURE__ */ new WeakMap(), Ab = /* @__PURE__ */ new WeakMap(), jb = /* @__PURE__ */ new WeakMap(), Mb = /* @__PURE__ */ new WeakMap(), Nb = class {
|
|
9164
9154
|
constructor(e) {
|
|
9165
|
-
c(this,
|
|
9155
|
+
c(this, kb, void 0), c(this, Ab, []), c(this, jb, /* @__PURE__ */ new Set()), c(this, Mb, void 0), n(kb, this, e);
|
|
9166
9156
|
}
|
|
9167
9157
|
select(e) {
|
|
9168
|
-
if (i(
|
|
9158
|
+
if (i(kb, this).edgeUrl) return i(kb, this).edgeUrl;
|
|
9169
9159
|
if (e.length > 0) {
|
|
9170
|
-
n(
|
|
9171
|
-
let t = new Set(i(
|
|
9172
|
-
for (let e of i(
|
|
9160
|
+
n(Ab, this, [...e]);
|
|
9161
|
+
let t = new Set(i(Ab, this).map((e) => Db(e)));
|
|
9162
|
+
for (let e of i(jb, this)) t.has(e) || i(jb, this).delete(e);
|
|
9173
9163
|
}
|
|
9174
|
-
if (i(
|
|
9175
|
-
let t = i(
|
|
9176
|
-
t.length === 0 && (i(
|
|
9164
|
+
if (i(Ab, this).length === 0) return;
|
|
9165
|
+
let t = i(Ab, this).filter((e) => !i(jb, this).has(Db(e)));
|
|
9166
|
+
t.length === 0 && (i(jb, this).clear(), t = i(Ab, this));
|
|
9177
9167
|
let r = t[0];
|
|
9178
|
-
if (r) return i(
|
|
9168
|
+
if (r) return i(jb, this).add(Db(r)), n(Mb, this, r), r;
|
|
9179
9169
|
}
|
|
9180
9170
|
shiftedEdge() {
|
|
9181
|
-
return i(
|
|
9171
|
+
return i(Mb, this);
|
|
9182
9172
|
}
|
|
9183
9173
|
hasRemainingEdges() {
|
|
9184
|
-
return i(
|
|
9174
|
+
return i(Ab, this).some((e) => !i(jb, this).has(Db(e)));
|
|
9185
9175
|
}
|
|
9186
9176
|
reset() {
|
|
9187
|
-
n(
|
|
9177
|
+
n(Mb, this, void 0), n(Ab, this, []), i(jb, this).clear();
|
|
9188
9178
|
}
|
|
9189
|
-
},
|
|
9179
|
+
}, Pb, Fb = (e) => {
|
|
9190
9180
|
if (e instanceof M && (e.code() === "channel_not_live" || e.code() === "channel_not_found")) return !0;
|
|
9191
9181
|
let t = e instanceof M ? e.source() : e;
|
|
9192
9182
|
if (!(t instanceof Error) || !m(t)) return !1;
|
|
9193
9183
|
let { status: n } = t;
|
|
9194
9184
|
return n >= 400 && n < 500 && n !== 408 && n !== 429;
|
|
9195
|
-
},
|
|
9185
|
+
}, Ib = 3e4, Lb = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Rb = /* @__PURE__ */ new WeakMap(), zb = /* @__PURE__ */ new WeakMap(), Bb = /* @__PURE__ */ new WeakMap(), Vb = /* @__PURE__ */ new WeakMap(), Hb = /* @__PURE__ */ new WeakMap(), Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakMap(), Gb = /* @__PURE__ */ new WeakMap(), Kb = /* @__PURE__ */ new WeakMap(), qb = /* @__PURE__ */ new WeakMap(), Jb = /* @__PURE__ */ new WeakMap(), Yb = /* @__PURE__ */ new WeakMap(), Xb = /* @__PURE__ */ new WeakMap(), Zb = /* @__PURE__ */ new WeakMap(), Qb = /* @__PURE__ */ new WeakMap(), $b = /* @__PURE__ */ new WeakMap(), ex = /* @__PURE__ */ new WeakMap(), tx = /* @__PURE__ */ new WeakMap(), nx = /* @__PURE__ */ new WeakMap(), rx = /* @__PURE__ */ new WeakMap(), ix = /* @__PURE__ */ new WeakMap(), ax = /* @__PURE__ */ new WeakSet(), ox = /* @__PURE__ */ new WeakMap(), sx = /* @__PURE__ */ new WeakMap(), cx = /* @__PURE__ */ new WeakMap(), lx = /* @__PURE__ */ new WeakMap(), ux = /* @__PURE__ */ new WeakMap(), dx = /* @__PURE__ */ new WeakMap(), fx = /* @__PURE__ */ new WeakMap(), px = /* @__PURE__ */ new WeakMap(), mx = /* @__PURE__ */ new WeakMap(), hx = class r {
|
|
9196
9186
|
constructor(a, s, l) {
|
|
9197
9187
|
var u = this;
|
|
9198
|
-
k(this,
|
|
9188
|
+
k(this, ax), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), c(this, Lb, new S(10)), c(this, $, !0), c(this, Rb, void 0), c(this, zb, 0), c(this, Bb, 0), c(this, Vb, void 0), c(this, Hb, !1), c(this, Ub, 0), c(this, Wb, 0), c(this, Gb, 0), c(this, Kb, void 0), c(this, qb, void 0), c(this, Jb, void 0), c(this, Yb, void 0), c(this, Xb, void 0), c(this, Zb, void 0), c(this, Qb, void 0), c(this, $b, []), c(this, ex, void 0), e(this, "unload", () => {
|
|
9199
9189
|
var e;
|
|
9200
|
-
this.logger.debug("Unloading module..."), this.emitter.off("page active", i(
|
|
9190
|
+
this.logger.debug("Unloading module..."), this.emitter.off("page active", i(ux, this)), this.emitter.off("network online", i(dx, this)), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), n(Qb, this, void 0), this.logger.debug("Unloaded module");
|
|
9201
9191
|
}), e(this, "finishPendingDrop", () => {
|
|
9202
|
-
this.connectionImpl instanceof
|
|
9192
|
+
this.connectionImpl instanceof Eb && this.connectionImpl.finishPendingDrop();
|
|
9203
9193
|
}), e(this, "suspend", () => {
|
|
9204
9194
|
var e;
|
|
9205
|
-
n($, this, !1), i(
|
|
9195
|
+
n($, this, !1), i(lx, this).call(this), (e = this.connectionImpl) == null || e.suspend();
|
|
9206
9196
|
}), e(this, "unsuspend", () => {
|
|
9207
9197
|
var e;
|
|
9208
9198
|
n($, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
|
|
9209
9199
|
}), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
|
|
9210
9200
|
var e;
|
|
9211
|
-
let t = i(
|
|
9201
|
+
let t = i(Ub, this) > 0 ? i(Wb, this) / i(Ub, this) : 0;
|
|
9212
9202
|
if (!this.connectionImpl) {
|
|
9213
|
-
let e = i(
|
|
9203
|
+
let e = i(tx, this).call(this);
|
|
9214
9204
|
return {
|
|
9215
9205
|
rtt: {
|
|
9216
9206
|
min: 0,
|
|
@@ -9219,17 +9209,17 @@ var Ob = (e) => {
|
|
|
9219
9209
|
last: 0
|
|
9220
9210
|
},
|
|
9221
9211
|
estimatedBandwidth: 0,
|
|
9222
|
-
connectCount: i(
|
|
9223
|
-
backlogReconnectCount: i(
|
|
9224
|
-
connectionAttemptCount: i(
|
|
9212
|
+
connectCount: i(Wb, this),
|
|
9213
|
+
backlogReconnectCount: i(Gb, this),
|
|
9214
|
+
connectionAttemptCount: i(Ub, this),
|
|
9225
9215
|
connectionSuccessRatio: t,
|
|
9226
|
-
timeToConnected: i(
|
|
9216
|
+
timeToConnected: i(Yb, this),
|
|
9227
9217
|
edgeUrl: e == null ? void 0 : e.edgeUrl,
|
|
9228
9218
|
connectionProtocol: e == null ? void 0 : e.connectionProtocol,
|
|
9229
9219
|
transportSelectionReason: e == null ? void 0 : e.transportSelectionReason
|
|
9230
9220
|
};
|
|
9231
9221
|
}
|
|
9232
|
-
let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(
|
|
9222
|
+
let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(Ib);
|
|
9233
9223
|
return p(p({}, n), {}, {
|
|
9234
9224
|
linkQueue: r && {
|
|
9235
9225
|
last: Math.round(r.last),
|
|
@@ -9237,29 +9227,29 @@ var Ob = (e) => {
|
|
|
9237
9227
|
max: Math.round(r.max),
|
|
9238
9228
|
min: Math.round(r.min)
|
|
9239
9229
|
},
|
|
9240
|
-
rtt: gt(i(
|
|
9230
|
+
rtt: gt(i(Lb, this).items()),
|
|
9241
9231
|
estimatedBandwidth: this.estimatedBandwidth,
|
|
9242
|
-
connectCount: i(
|
|
9243
|
-
backlogReconnectCount: i(
|
|
9244
|
-
connectionAttemptCount: i(
|
|
9232
|
+
connectCount: i(Wb, this),
|
|
9233
|
+
backlogReconnectCount: i(Gb, this),
|
|
9234
|
+
connectionAttemptCount: i(Ub, this),
|
|
9245
9235
|
connectionSuccessRatio: t,
|
|
9246
|
-
timeToConnected: i(
|
|
9236
|
+
timeToConnected: i(Yb, this)
|
|
9247
9237
|
});
|
|
9248
|
-
}), c(this,
|
|
9249
|
-
if (n($, this, !0), i(
|
|
9250
|
-
i(
|
|
9238
|
+
}), c(this, tx, () => i($, this) && i(Zb, this) ? i(Zb, this) : i(Xb, this)), e(this, "connect", () => {
|
|
9239
|
+
if (n($, this, !0), i(Rb, this)) {
|
|
9240
|
+
i(lx, this).call(this);
|
|
9251
9241
|
return;
|
|
9252
9242
|
}
|
|
9253
9243
|
let e = performance.now();
|
|
9254
|
-
i(
|
|
9255
|
-
}), c(this,
|
|
9256
|
-
i(
|
|
9244
|
+
i(Yb, this) === void 0 && n(Kb, this, e), i(qb, this) === void 0 && n(qb, this, e), n(Rb, this, o(ax, this, gx).call(this));
|
|
9245
|
+
}), c(this, nx, () => {
|
|
9246
|
+
i(Yb, this) === void 0 && i(Kb, this) !== void 0 && i($, this) && (n(Yb, this, performance.now() - i(Kb, this)), n(Kb, this, void 0));
|
|
9257
9247
|
}), e(this, "disconnect", (e = "Disconnect Requested") => {
|
|
9258
9248
|
var t;
|
|
9259
|
-
n($, this, !1), i(
|
|
9249
|
+
n($, this, !1), i(lx, this).call(this), i(sx, this).call(this), (t = this.connectionImpl) == null || t.close(e);
|
|
9260
9250
|
}), e(this, "reconnect", (e) => {
|
|
9261
9251
|
this.disconnect(e), this.connect();
|
|
9262
|
-
}), c(this,
|
|
9252
|
+
}), c(this, rx, t(function* () {
|
|
9263
9253
|
try {
|
|
9264
9254
|
return yield u.apiClient.connect(u.config.options.getOptions());
|
|
9265
9255
|
} catch (e) {
|
|
@@ -9269,7 +9259,7 @@ var Ob = (e) => {
|
|
|
9269
9259
|
}
|
|
9270
9260
|
throw Xn(e instanceof Error ? e : void 0);
|
|
9271
9261
|
}
|
|
9272
|
-
})), c(this,
|
|
9262
|
+
})), c(this, ix, () => new Promise((e) => {
|
|
9273
9263
|
let t = performance.now(), n = () => e(performance.now() - t), i = () => e(void 0);
|
|
9274
9264
|
try {
|
|
9275
9265
|
let e = new XMLHttpRequest();
|
|
@@ -9277,161 +9267,161 @@ var Ob = (e) => {
|
|
|
9277
9267
|
} catch (e) {
|
|
9278
9268
|
i();
|
|
9279
9269
|
}
|
|
9280
|
-
})), c(this,
|
|
9281
|
-
i(
|
|
9270
|
+
})), c(this, ox, () => {
|
|
9271
|
+
i(sx, this).call(this), n(ex, this, setTimeout(() => {
|
|
9282
9272
|
var e;
|
|
9283
|
-
i(
|
|
9273
|
+
i(Qb, this) && ((e = this.connectionImpl) == null ? void 0 : e.getState()) === "connected" && (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), i(Qb, this).reset(), n(ex, this, void 0));
|
|
9284
9274
|
}, r.EDGE_SELECTOR_RESET_TIMEOUT));
|
|
9285
|
-
}), c(this,
|
|
9286
|
-
i(
|
|
9287
|
-
}), c(this,
|
|
9275
|
+
}), c(this, sx, () => {
|
|
9276
|
+
i(ex, this) !== void 0 && (clearTimeout(i(ex, this)), n(ex, this, void 0));
|
|
9277
|
+
}), c(this, cx, function() {
|
|
9288
9278
|
var e = t(function* (e) {
|
|
9289
|
-
n(
|
|
9279
|
+
n(Hb, u, !1);
|
|
9290
9280
|
try {
|
|
9291
|
-
let o = yield u.config.reconnectHandler({ reconnectRetries: i(
|
|
9281
|
+
let o = yield u.config.reconnectHandler({ reconnectRetries: i(zb, u) });
|
|
9292
9282
|
if (!i($, u)) return !1;
|
|
9293
9283
|
if (!o) return n($, u, !1), u.emitter.emit("error", Zn()), !1;
|
|
9294
9284
|
let { isVisible: s, isOnline: c } = u.config.documentState;
|
|
9295
9285
|
if (!s || !c) {
|
|
9296
|
-
if (i(
|
|
9286
|
+
if (i(Hb, u)) return i($, u);
|
|
9297
9287
|
let e = r.OFFLINE_RETRY_MS;
|
|
9298
9288
|
if (!c) u.logger.info("Browser offline, waiting for the network before retrying", { delay: e });
|
|
9299
9289
|
else {
|
|
9300
9290
|
var t, a;
|
|
9301
|
-
let o = r.HIDDEN_BACKOFF_BASE_MS * 2 ** (n(
|
|
9291
|
+
let o = r.HIDDEN_BACKOFF_BASE_MS * 2 ** (n(Bb, u, (t = i(Bb, u), a = t++, t)), a);
|
|
9302
9292
|
e = Math.min(r.HIDDEN_BACKOFF_MAX_MS, o), u.logger.info("Page hidden, backing off before retrying", { delay: e });
|
|
9303
9293
|
}
|
|
9304
9294
|
return yield new Promise((t) => {
|
|
9305
9295
|
let r = setTimeout(t, e);
|
|
9306
|
-
n(
|
|
9296
|
+
n(Vb, u, () => {
|
|
9307
9297
|
clearTimeout(r), t();
|
|
9308
9298
|
});
|
|
9309
9299
|
}), i($, u);
|
|
9310
9300
|
}
|
|
9311
|
-
return n(
|
|
9301
|
+
return n(Bb, u, 0), i(px, u).call(u) ? (u.logger.info("Reconnect burst detected, applying backoff before retrying"), yield on(r.RECONNECT_BACKOFF_MS)) : u.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), i($, u);
|
|
9312
9302
|
} finally {
|
|
9313
|
-
n(
|
|
9303
|
+
n(Vb, u, void 0);
|
|
9314
9304
|
}
|
|
9315
9305
|
});
|
|
9316
9306
|
return function(t) {
|
|
9317
9307
|
return e.apply(this, arguments);
|
|
9318
9308
|
};
|
|
9319
|
-
}()), c(this,
|
|
9309
|
+
}()), c(this, lx, () => {
|
|
9320
9310
|
var e;
|
|
9321
|
-
n(
|
|
9322
|
-
}), c(this,
|
|
9323
|
-
e && i(
|
|
9324
|
-
}), c(this,
|
|
9325
|
-
i(
|
|
9326
|
-
}), c(this,
|
|
9327
|
-
i(
|
|
9328
|
-
}), c(this,
|
|
9329
|
-
for (; i(
|
|
9330
|
-
let t = i(
|
|
9311
|
+
n(Hb, this, !0), (e = i(Vb, this)) == null || e.call(this);
|
|
9312
|
+
}), c(this, ux, (e) => {
|
|
9313
|
+
e && i(lx, this).call(this);
|
|
9314
|
+
}), c(this, dx, () => {
|
|
9315
|
+
i(lx, this).call(this);
|
|
9316
|
+
}), c(this, fx, (e = performance.now()) => {
|
|
9317
|
+
i(mx, this).call(this, e), i($b, this).push(e);
|
|
9318
|
+
}), c(this, px, (e = performance.now()) => (i(mx, this).call(this, e), i($b, this).length >= r.RECONNECT_BACKOFF_BURST_THRESHOLD)), c(this, mx, (e) => {
|
|
9319
|
+
for (; i($b, this).length > 0;) {
|
|
9320
|
+
let t = i($b, this)[0];
|
|
9331
9321
|
if (t === void 0 || t > e - r.RECONNECT_BACKOFF_BURST_WINDOW_MS) return;
|
|
9332
|
-
i(
|
|
9322
|
+
i($b, this).shift();
|
|
9333
9323
|
}
|
|
9334
9324
|
}), this.logger = s, this.emitter = a, this.config = l, this.apiClient = new _({
|
|
9335
9325
|
publicEndpoint: this.config.options.get("url").toString(),
|
|
9336
9326
|
tokenFactory: () => this.config.options.get("authenticationToken")
|
|
9337
|
-
}), this.emitter.on("page active", i(
|
|
9327
|
+
}), this.emitter.on("page active", i(ux, this)), this.emitter.on("network online", i(dx, this));
|
|
9338
9328
|
}
|
|
9339
9329
|
get rtt() {
|
|
9340
|
-
return i(
|
|
9330
|
+
return i(Lb, this).items().length > 0 ? pt(i(Lb, this).items()) : 0;
|
|
9341
9331
|
}
|
|
9342
9332
|
get isMoq() {
|
|
9343
|
-
return this.connectionImpl instanceof
|
|
9333
|
+
return this.connectionImpl instanceof rb;
|
|
9344
9334
|
}
|
|
9345
9335
|
get estimatedBandwidth() {
|
|
9346
9336
|
if (this.connectionImpl && "estimatedBandwidth" in this.connectionImpl) {
|
|
9347
9337
|
let e = this.connectionImpl.estimatedBandwidth;
|
|
9348
9338
|
if (e && Number.isFinite(e)) return e;
|
|
9349
9339
|
}
|
|
9350
|
-
return
|
|
9340
|
+
return Tb(this.rtt);
|
|
9351
9341
|
}
|
|
9352
9342
|
get linkQueue() {
|
|
9353
9343
|
var e;
|
|
9354
9344
|
return (e = this.connectionImpl) == null ? void 0 : e.linkQueue;
|
|
9355
9345
|
}
|
|
9356
9346
|
get firstConnectStartTime() {
|
|
9357
|
-
return i(
|
|
9347
|
+
return i(qb, this);
|
|
9358
9348
|
}
|
|
9359
9349
|
get lastConnectionTime() {
|
|
9360
|
-
return i(
|
|
9350
|
+
return i(Jb, this);
|
|
9361
9351
|
}
|
|
9362
9352
|
};
|
|
9363
|
-
|
|
9364
|
-
function
|
|
9353
|
+
Pb = hx;
|
|
9354
|
+
function gx() {
|
|
9365
9355
|
var e = this;
|
|
9366
9356
|
return t(function* () {
|
|
9367
|
-
let t = new
|
|
9368
|
-
for (n(
|
|
9357
|
+
let t = new Nb({ edgeUrl: e.config.options.get("edgeUrl") });
|
|
9358
|
+
for (n(Qb, e, t), i(sx, e).call(e), n(zb, e, 0), n(Bb, e, 0), n($b, e, []);;) {
|
|
9369
9359
|
var r, a;
|
|
9370
9360
|
let l = "standard";
|
|
9371
|
-
n(
|
|
9361
|
+
n(Ub, e, (r = i(Ub, e), r++, r)), i(fx, e).call(e);
|
|
9372
9362
|
let d = !1;
|
|
9373
|
-
n(
|
|
9363
|
+
n(Zb, e, {});
|
|
9374
9364
|
try {
|
|
9375
9365
|
var o, s;
|
|
9376
|
-
let [r, a] = yield Promise.all([i(
|
|
9377
|
-
if (i(
|
|
9366
|
+
let [r, a] = yield Promise.all([i(rx, e).call(e), i(ix, e).call(e)]);
|
|
9367
|
+
if (i(Lb, e).clear(), a !== void 0 && i(Lb, e).push(a / 2), !i($, e)) break;
|
|
9378
9368
|
let c = t.select(r.edges);
|
|
9379
9369
|
if (!c) throw new M("Failed to resolve edge url", {
|
|
9380
9370
|
isFatal: !0,
|
|
9381
9371
|
code: "failed_to_resolve_edge_url"
|
|
9382
9372
|
});
|
|
9383
|
-
n(
|
|
9373
|
+
n(Zb, e, { edgeUrl: Jv(Ob(c)) });
|
|
9384
9374
|
try {
|
|
9385
|
-
u(r) ? e.connectionImpl = yield
|
|
9375
|
+
u(r) ? e.connectionImpl = yield rb.start(e.emitter, e.logger, e.apiClient, p(p({}, e.config), {}, {
|
|
9386
9376
|
connectInfo: r,
|
|
9387
9377
|
edgeUrl: c,
|
|
9388
|
-
onTransportConnected: i(
|
|
9389
|
-
}), i(
|
|
9378
|
+
onTransportConnected: i(nx, e)
|
|
9379
|
+
}), i(Lb, e)) : (v(typeof c == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Eb.start(e.emitter, e.logger, p(p({}, e.config), {}, {
|
|
9390
9380
|
connectInfo: r,
|
|
9391
9381
|
edgeUrl: c,
|
|
9392
|
-
onTransportConnected: i(
|
|
9393
|
-
}), i(
|
|
9382
|
+
onTransportConnected: i(nx, e)
|
|
9383
|
+
}), i(Lb, e)));
|
|
9394
9384
|
} catch (e) {
|
|
9395
9385
|
throw l = "cached_edge", e;
|
|
9396
9386
|
}
|
|
9397
|
-
n(
|
|
9387
|
+
n(Xb, e, e.connectionImpl.getStatistics()), n(Zb, e, void 0), i($, e) || e.connectionImpl.close("Disconnected during connect"), i(ox, e).call(e), n(Wb, e, (o = i(Wb, e), o++, o)), n(zb, e, 0), n(Bb, e, 0), n(Jb, e, performance.now()), i(nx, e).call(e);
|
|
9398
9388
|
let d = yield e.connectionImpl.closed();
|
|
9399
|
-
e.connectionImpl.closedForBacklog && n(
|
|
9389
|
+
e.connectionImpl.closedForBacklog && n(Gb, e, (s = i(Gb, e), s++, s)), e.logger.info("Connection closed", { reason: d instanceof Error ? d.message : d }), l = "cached_edge";
|
|
9400
9390
|
} catch (r) {
|
|
9401
9391
|
e.logger.warn("Failed to connect", r);
|
|
9402
9392
|
let { isVisible: a, isOnline: o } = e.config.documentState;
|
|
9403
|
-
if (!e.connectionImpl && (a && o ||
|
|
9393
|
+
if (!e.connectionImpl && (a && o || Fb(r))) {
|
|
9404
9394
|
var c;
|
|
9405
|
-
n(
|
|
9395
|
+
n(zb, e, (c = i(zb, e), c++, c));
|
|
9406
9396
|
}
|
|
9407
9397
|
let s = t.shiftedEdge();
|
|
9408
9398
|
s && e.emitter.emit("telemetry event", {
|
|
9409
9399
|
code: "shifted_edge",
|
|
9410
|
-
edgeUrl:
|
|
9400
|
+
edgeUrl: Ob(s)
|
|
9411
9401
|
}), r instanceof M ? (e.emitter.emit("error", r), d = r.isFatal()) : r instanceof Error && e.emitter.emit("error", new M(r.message, {
|
|
9412
9402
|
code: "start_failed",
|
|
9413
9403
|
isFatal: !1
|
|
9414
9404
|
}));
|
|
9415
9405
|
}
|
|
9416
|
-
if ((a = e.connectionImpl) == null || a.unload(), e.connectionImpl = void 0, i(
|
|
9406
|
+
if ((a = e.connectionImpl) == null || a.unload(), e.connectionImpl = void 0, i(sx, e).call(e), d) {
|
|
9417
9407
|
n($, e, !1);
|
|
9418
9408
|
break;
|
|
9419
9409
|
}
|
|
9420
|
-
if (!i($, e) || !(yield i(
|
|
9410
|
+
if (!i($, e) || !(yield i(cx, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
|
|
9421
9411
|
}
|
|
9422
|
-
n(
|
|
9412
|
+
n(Zb, e, void 0), n(Qb, e, void 0), i(sx, e).call(e), n(Rb, e, void 0), i($, e) && e.connect();
|
|
9423
9413
|
})();
|
|
9424
9414
|
}
|
|
9425
|
-
e(
|
|
9415
|
+
e(hx, "PING_TIMEOUT", 1e3), e(hx, "RECONNECT_BACKOFF_MS", 1e3), e(hx, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(hx, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(hx, "EDGE_SELECTOR_RESET_TIMEOUT", 6e4), e(hx, "HIDDEN_BACKOFF_BASE_MS", 1e3), e(hx, "HIDDEN_BACKOFF_MAX_MS", 3e4), e(hx, "OFFLINE_RETRY_MS", 3e4), e(hx, "create", (e, t, n) => new Pb(e, t, n));
|
|
9426
9416
|
// ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
|
|
9427
|
-
var
|
|
9417
|
+
var _x, vx = () => ({
|
|
9428
9418
|
video: p(p({}, fn()), {}, { bitRate: dn() }),
|
|
9429
9419
|
audio: { bitRate: dn() }
|
|
9430
|
-
}),
|
|
9420
|
+
}), yx = () => ({
|
|
9431
9421
|
width: window.innerWidth,
|
|
9432
9422
|
height: window.innerHeight,
|
|
9433
9423
|
bitRate: dn()
|
|
9434
|
-
}),
|
|
9424
|
+
}), bx = class t {
|
|
9435
9425
|
constructor(n, r, i, a) {
|
|
9436
9426
|
e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
|
|
9437
9427
|
var e;
|
|
@@ -9453,7 +9443,7 @@ var vx, yx = () => ({
|
|
|
9453
9443
|
this.timers.unload();
|
|
9454
9444
|
}), e(this, "setUserSpecifiedCap", (e) => {
|
|
9455
9445
|
var t;
|
|
9456
|
-
let n = (t = this.getUserSpecifiedCap()) == null ?
|
|
9446
|
+
let n = (t = this.getUserSpecifiedCap()) == null ? vx() : t;
|
|
9457
9447
|
this.userSpecifiedCap = p(p({}, n), {}, {
|
|
9458
9448
|
video: p(p({}, n.video), e.video),
|
|
9459
9449
|
audio: p(p({}, n.audio), e.audio)
|
|
@@ -9477,7 +9467,7 @@ var vx, yx = () => ({
|
|
|
9477
9467
|
});
|
|
9478
9468
|
}), e(this, "evaluateConstraintCap", () => {
|
|
9479
9469
|
var e, t, n, r;
|
|
9480
|
-
let i = this.sizeBasedResolutionCapEnabled ? p(p({},
|
|
9470
|
+
let i = this.sizeBasedResolutionCapEnabled ? p(p({}, vx()), {}, { video: yx() }) : vx();
|
|
9481
9471
|
if (!this.resizeObserver) {
|
|
9482
9472
|
let e = this.element.getBoundingClientRect();
|
|
9483
9473
|
this.elementSize = {
|
|
@@ -9514,19 +9504,19 @@ var vx, yx = () => ({
|
|
|
9514
9504
|
this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
|
|
9515
9505
|
}
|
|
9516
9506
|
};
|
|
9517
|
-
|
|
9507
|
+
_x = bx, e(bx, "CHECK_SIZE_INTERVAL", 1e3), e(bx, "create", (e, t, n, r) => new _x(e, t, n, r));
|
|
9518
9508
|
// ../../libs/web-sdk/src/renditionKey.ts
|
|
9519
|
-
var
|
|
9509
|
+
var xx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Sx = (e, t, n, r) => e === n && t === r, Cx = class {
|
|
9520
9510
|
constructor() {
|
|
9521
9511
|
e(this, "lastKey", void 0), e(this, "shouldNotify", (e, t) => {
|
|
9522
|
-
let n =
|
|
9512
|
+
let n = xx(e, t);
|
|
9523
9513
|
return this.lastKey !== n && (this.lastKey = n, !0);
|
|
9524
9514
|
});
|
|
9525
9515
|
}
|
|
9526
|
-
},
|
|
9516
|
+
}, wx = 5, Tx = 40, Ex = 1, Dx = 3e4, Ox = 5, kx = (e) => {
|
|
9527
9517
|
var t, n;
|
|
9528
9518
|
return ((t = e.maxCompositionOffsetMs) == null ? 0 : t) - ((n = e.minCompositionOffsetMs) == null ? 0 : n);
|
|
9529
|
-
},
|
|
9519
|
+
}, Ax = (e, t, n) => {
|
|
9530
9520
|
let r = [];
|
|
9531
9521
|
for (let i of e) {
|
|
9532
9522
|
let e = r[r.length - 1];
|
|
@@ -9536,10 +9526,10 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9536
9526
|
});
|
|
9537
9527
|
}
|
|
9538
9528
|
return r;
|
|
9539
|
-
},
|
|
9529
|
+
}, jx = (e, t) => {
|
|
9540
9530
|
let n = e[e.length - 1];
|
|
9541
9531
|
n && n.end > t && n.start < t && (n.end = t);
|
|
9542
|
-
},
|
|
9532
|
+
}, Mx = 100, Nx = 1e3, Px = class n {
|
|
9543
9533
|
constructor(t, n, r, i, a = !1, o = !1, s = !1) {
|
|
9544
9534
|
e(this, "backgroundTimersEnabled", !1), e(this, "timers", this.createTimers()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isLoaded", !1), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "currentVideoDecodeRate", 2), e(this, "decodeRateGraceIntervals", 3), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
|
|
9545
9535
|
this.isLoaded = !0, this.armTimers(), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode), this.emitter.on("flush buffers", this.resetContexts);
|
|
@@ -9557,8 +9547,8 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9557
9547
|
}), e(this, "unsuspend", () => {
|
|
9558
9548
|
this.isSuspended = !1, this.emitDecodedFrames(), this._audioWebCodecsInUse && this.scheduleAudioEmitRetry();
|
|
9559
9549
|
}), e(this, "armTimers", () => {
|
|
9560
|
-
let e = this._audioWebCodecsInUse ? 20 :
|
|
9561
|
-
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate,
|
|
9550
|
+
let e = this._audioWebCodecsInUse ? 20 : Mx;
|
|
9551
|
+
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Nx);
|
|
9562
9552
|
}), e(this, "replaceTimers", () => {
|
|
9563
9553
|
let e = this.isAudioEmitRetryScheduled;
|
|
9564
9554
|
this.isAudioEmitRetryScheduled = !1, this.timers.unload(), this.timers = this.createTimers(), this.timers.isWorkerBackendUnavailable() && this.logger.warn("Background timer worker is unavailable (likely blocked by CSP or unsupported in this environment). Falling back to main-thread timers; hidden-tab playback may be throttled."), this.isLoaded && (this.armTimers(), e && this.scheduleAudioEmitRetry());
|
|
@@ -9627,27 +9617,27 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9627
9617
|
i.stream = `${e.channelId}/${e.renditionId}`;
|
|
9628
9618
|
let c = (e.timestamp + a) / e.timescale * 1e3, l = e.duration / e.timescale * 1e3;
|
|
9629
9619
|
l > 0 && (i.sampleDuration = l);
|
|
9630
|
-
let u = i.sampleDuration ||
|
|
9620
|
+
let u = i.sampleDuration || Tx, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = kx(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * Ox, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
|
|
9631
9621
|
i.lastDecodeTimestampMs = g ? d : Math.max((r = i.lastDecodeTimestampMs) == null ? d : r, d);
|
|
9632
|
-
let ee = i.channelId !== void 0 && !
|
|
9622
|
+
let ee = i.channelId !== void 0 && !Sx(i.channelId, i.renditionId, e.channelId, e.renditionId);
|
|
9633
9623
|
i.channelId = e.channelId, i.renditionId = e.renditionId, (g || ee) && (i.minCompositionOffsetMs = void 0, i.maxCompositionOffsetMs = void 0, i.hasAnchoredGop = !1, i.isReorderStructureStale = !0);
|
|
9634
9624
|
let _ = i.hasAnchoredGop === !0;
|
|
9635
9625
|
if (e.isSync && (i.hasAnchoredGop = !0), !g && i.hasAnchoredGop) {
|
|
9636
9626
|
var v, y;
|
|
9637
9627
|
i.minCompositionOffsetMs = Math.min((v = i.minCompositionOffsetMs) == null ? f : v, f), i.maxCompositionOffsetMs = Math.max((y = i.maxCompositionOffsetMs) == null ? f : y, f), _ && (i.isReorderStructureStale = !1);
|
|
9638
9628
|
}
|
|
9639
|
-
let b =
|
|
9629
|
+
let b = kx(i) > 0;
|
|
9640
9630
|
if (g) i.buffer = [{
|
|
9641
9631
|
start: c,
|
|
9642
9632
|
end: c + u
|
|
9643
9633
|
}], i.frontierSampleDurationMs = u, e.type === "video" && (this.videoKeyframeTimestamps = []);
|
|
9644
9634
|
else {
|
|
9645
9635
|
var x;
|
|
9646
|
-
!b && !i.isReorderStructureStale &&
|
|
9636
|
+
!b && !i.isReorderStructureStale && jx(s, c + u);
|
|
9647
9637
|
let e = (x = s[s.length - 1]) == null ? void 0 : x.end;
|
|
9648
|
-
(e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), $t(s, c, c + u,
|
|
9638
|
+
(e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), $t(s, c, c + u, wx);
|
|
9649
9639
|
}
|
|
9650
|
-
if (tn(i.buffer, this.playbackSource.currentTime -
|
|
9640
|
+
if (tn(i.buffer, this.playbackSource.currentTime - Dx), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
|
|
9651
9641
|
let e = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
9652
9642
|
e !== void 0 && c < e && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(c), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
9653
9643
|
}
|
|
@@ -9680,11 +9670,11 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9680
9670
|
}), e(this, "emitDecodeRate", () => {
|
|
9681
9671
|
this.decodeRateGraceIntervals > 0 ? this.decodeRateGraceIntervals-- : (this.currentVideoDecodeRate = this.calculateVideoDecodeRate(), this.emitter.emit("video decode rate", this.currentVideoDecodeRate));
|
|
9682
9672
|
}), e(this, "playableRanges", (e) => {
|
|
9683
|
-
let t =
|
|
9673
|
+
let t = kx(e);
|
|
9684
9674
|
if (t <= 0) return e.buffer;
|
|
9685
9675
|
if (e.playableRangesCache === void 0) {
|
|
9686
9676
|
var n, r;
|
|
9687
|
-
e.playableRangesCache =
|
|
9677
|
+
e.playableRangesCache = Ax(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - Ex, t + (e.sampleDuration || Tx) + Ex);
|
|
9688
9678
|
}
|
|
9689
9679
|
return e.playableRangesCache;
|
|
9690
9680
|
}), e(this, "updateBufferState", () => {
|
|
@@ -9719,7 +9709,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9719
9709
|
case "audio": {
|
|
9720
9710
|
let n, i, a = !1;
|
|
9721
9711
|
if (c) {
|
|
9722
|
-
let { WebCodecsAudioDecoderContext: t } = yield import("./
|
|
9712
|
+
let { WebCodecsAudioDecoderContext: t } = yield import("./de9FRek3.js");
|
|
9723
9713
|
if (a = t.isSupported(), a) try {
|
|
9724
9714
|
n = yield t.create(r.createContext("WebCodecsAudio")), h = !0;
|
|
9725
9715
|
} catch (t) {
|
|
@@ -9731,7 +9721,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9731
9721
|
}
|
|
9732
9722
|
if (!n) {
|
|
9733
9723
|
if (e.codec === "opus") {
|
|
9734
|
-
let { OpusDecoderContext: t } = yield import("./
|
|
9724
|
+
let { OpusDecoderContext: t } = yield import("./t_21OUKh.js");
|
|
9735
9725
|
n = yield t.create(e.sampleRate || 48e3, e.channels || 2);
|
|
9736
9726
|
} else {
|
|
9737
9727
|
let t = c ? i ? `WebCodecs audio decoder initialization failed: ${i.message}` : a ? "WebCodecs audio decoder could not be initialized." : "WebCodecs AudioDecoder API is not supported in this environment." : "WebCodecs audio decoding is disabled.";
|
|
@@ -9748,7 +9738,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9748
9738
|
break;
|
|
9749
9739
|
}
|
|
9750
9740
|
case "video": {
|
|
9751
|
-
let { VideoDecoderWorkerContext: n } = yield import("./
|
|
9741
|
+
let { VideoDecoderWorkerContext: n } = yield import("./BMEhrui6.js"), a = yield n.create(r.createContext("VideoDecoderWorker"), i, s, c, l, u, () => o.currentTime, d, f);
|
|
9752
9742
|
m = a.isWebCodecs, g = a.usingOffscreenCanvas, t.set(e.type, {
|
|
9753
9743
|
buffer: [],
|
|
9754
9744
|
decoderContext: a,
|
|
@@ -9767,7 +9757,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9767
9757
|
var e;
|
|
9768
9758
|
if (this._offscreenCanvasInUse) return (e = this.trackContexts.get("video")) == null ? void 0 : e.decoderContext.videoTrack;
|
|
9769
9759
|
}
|
|
9770
|
-
},
|
|
9760
|
+
}, Fx, Ix = class {
|
|
9771
9761
|
constructor(t) {
|
|
9772
9762
|
e(this, "emitter", void 0), e(this, "isVisibleCount", 0), e(this, "isHiddenCount", 0), e(this, "isOnlineCount", 0), e(this, "isOfflineCount", 0), e(this, "isActive", document.visibilityState === "visible"), e(this, "isBehindAnotherApp", !1), e(this, "unload", () => {
|
|
9773
9763
|
this.emitter.off("fullscreen app switch", this.onFullscreenAppSwitch), window.removeEventListener("focus", this.onVisibilityChanged), document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pageshow", this.onPageShow), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
|
|
@@ -9799,11 +9789,11 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
|
|
|
9799
9789
|
return document.visibilityState === "visible" && !this.isBehindAnotherApp;
|
|
9800
9790
|
}
|
|
9801
9791
|
};
|
|
9802
|
-
|
|
9792
|
+
Fx = Ix, e(Ix, "create", (e) => new Fx(e));
|
|
9803
9793
|
// ../../libs/web-sdk/src/modules/EventModule.ts
|
|
9804
|
-
var
|
|
9794
|
+
var Lx, Rx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, zx = class t {
|
|
9805
9795
|
constructor(n, r, i) {
|
|
9806
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered",
|
|
9796
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Rx(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
|
|
9807
9797
|
this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
|
|
9808
9798
|
}), e(this, "unload", () => {
|
|
9809
9799
|
this.timers.unload(), this.emitter.off("add event", this.addEvent);
|
|
@@ -9830,9 +9820,9 @@ var Rx, zx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
|
|
|
9830
9820
|
}), this.logger = r, this.emitter = n, this.timeSource = i;
|
|
9831
9821
|
}
|
|
9832
9822
|
};
|
|
9833
|
-
|
|
9823
|
+
Lx = zx, e(zx, "EVENT_TIMEOUT", 5e3), e(zx, "EVENT_CHECK_INTERVAL", 20), e(zx, "create", (e, t, n) => new Lx(e, t, n));
|
|
9834
9824
|
// ../../libs/web-sdk/src/modules/JitterModule.ts
|
|
9835
|
-
var
|
|
9825
|
+
var Bx = 1e3, Vx = 50, Hx = class t {
|
|
9836
9826
|
constructor(t) {
|
|
9837
9827
|
e(this, "logger", void 0), e(this, "trackingState", /* @__PURE__ */ new Map()), e(this, "runningJitter", /* @__PURE__ */ new Map()), e(this, "recentJitterSamples", /* @__PURE__ */ new Map()), e(this, "load", () => {
|
|
9838
9828
|
this.logger.debug("JitterModule loaded");
|
|
@@ -9853,9 +9843,9 @@ var Vx = 1e3, Hx = 50, Ux = class t {
|
|
|
9853
9843
|
this.trackingState.set(n, {
|
|
9854
9844
|
lastArrivalTime: r,
|
|
9855
9845
|
lastTimestampMs: i,
|
|
9856
|
-
jitterSamples: new S(
|
|
9857
|
-
interArrivalTimes: new S(
|
|
9858
|
-
}), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new S(
|
|
9846
|
+
jitterSamples: new S(Bx),
|
|
9847
|
+
interArrivalTimes: new S(Bx)
|
|
9848
|
+
}), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new S(Vx));
|
|
9859
9849
|
return;
|
|
9860
9850
|
}
|
|
9861
9851
|
let o = i - a.lastTimestampMs;
|
|
@@ -9868,7 +9858,7 @@ var Vx = 1e3, Hx = 50, Ux = class t {
|
|
|
9868
9858
|
let l = (t = this.runningJitter.get(n)) == null ? 0 : t, u = l + (c - l) / 16;
|
|
9869
9859
|
this.runningJitter.set(n, u);
|
|
9870
9860
|
let d = this.recentJitterSamples.get(n);
|
|
9871
|
-
d || (d = new S(
|
|
9861
|
+
d || (d = new S(Vx), this.recentJitterSamples.set(n, d)), d.push(c), a.lastArrivalTime = r, a.lastTimestampMs = i;
|
|
9872
9862
|
}
|
|
9873
9863
|
getJitterForType(e) {
|
|
9874
9864
|
for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
|
|
@@ -9899,10 +9889,10 @@ var Vx = 1e3, Hx = 50, Ux = class t {
|
|
|
9899
9889
|
videoJitter: this.getJitterForType("video")
|
|
9900
9890
|
};
|
|
9901
9891
|
}
|
|
9902
|
-
},
|
|
9892
|
+
}, Ux = () => window.AudioContext || window.webkitAudioContext, Wx = class n extends s {
|
|
9903
9893
|
constructor() {
|
|
9904
9894
|
var r;
|
|
9905
|
-
super(), r = this, e(this, "context", new (
|
|
9895
|
+
super(), r = this, e(this, "context", new (Ux())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
|
|
9906
9896
|
let e = !0, t = r.context.resume();
|
|
9907
9897
|
t.then(() => {
|
|
9908
9898
|
e = !1;
|
|
@@ -9937,9 +9927,9 @@ var Vx = 1e3, Hx = 50, Ux = class t {
|
|
|
9937
9927
|
return this.context.state;
|
|
9938
9928
|
}
|
|
9939
9929
|
};
|
|
9940
|
-
e(
|
|
9930
|
+
e(Wx, "CHECK_INTERVAL", 1e3);
|
|
9941
9931
|
// ../../libs/web-audio-player/src/AudioPlayer.ts
|
|
9942
|
-
var
|
|
9932
|
+
var Gx, Kx = 150, qx = 400, Jx = (e) => e === void 0 ? 5 : e <= Kx ? 1 : e <= qx ? 2 : 5, Yx = class extends s {
|
|
9943
9933
|
get isContextRunning() {
|
|
9944
9934
|
var e;
|
|
9945
9935
|
return ((e = this.audio) == null ? void 0 : e.state) === "running";
|
|
@@ -9986,7 +9976,7 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
|
|
|
9986
9976
|
return this._bufferTime;
|
|
9987
9977
|
}
|
|
9988
9978
|
set bufferTime(e) {
|
|
9989
|
-
this._bufferTime = e, this.audioBufferMultiplier =
|
|
9979
|
+
this._bufferTime = e, this.audioBufferMultiplier = Jx(e);
|
|
9990
9980
|
}
|
|
9991
9981
|
get sinkPaused() {
|
|
9992
9982
|
return this._sinkPaused;
|
|
@@ -10088,14 +10078,14 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
|
|
|
10088
10078
|
this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
|
|
10089
10079
|
}), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
|
|
10090
10080
|
var e, t, n;
|
|
10091
|
-
return (e = this.audio) == null || e.unload(), this.audio = new
|
|
10081
|
+
return (e = this.audio) == null || e.unload(), this.audio = new Wx(), this.audio.on("state", (e) => {
|
|
10092
10082
|
this.logger.info("AudioContext state change", { state: e }), e === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), this.ignoreSuspendCalls || this.emit("state change", e);
|
|
10093
10083
|
}), this.audio.on("stuck", () => {
|
|
10094
10084
|
this.reInitWhenStuck ? (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(b), this.emit("stuck")) : this.restartContext();
|
|
10095
10085
|
}), (t = this.gainNode) == null || t.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;
|
|
10096
10086
|
}), e(this, "setGain", (e) => {
|
|
10097
10087
|
this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
|
|
10098
|
-
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = o, this.audioBufferMultiplier =
|
|
10088
|
+
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = o, this.audioBufferMultiplier = Jx(o);
|
|
10099
10089
|
}
|
|
10100
10090
|
useMediaStreamDestination() {
|
|
10101
10091
|
var e;
|
|
@@ -10108,9 +10098,9 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
|
|
|
10108
10098
|
return (e = this.gainNode) == null || e.connect(t), t;
|
|
10109
10099
|
}
|
|
10110
10100
|
};
|
|
10111
|
-
|
|
10101
|
+
Gx = Yx, e(Yx, "create", (e, t, n) => new Gx(e, t, n));
|
|
10112
10102
|
// ../../libs/web-sdk/src/players/VideoPlayer.ts
|
|
10113
|
-
var
|
|
10103
|
+
var Xx, Zx = class {
|
|
10114
10104
|
constructor(t, n, r, i, a, o) {
|
|
10115
10105
|
e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new zr()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
|
|
10116
10106
|
this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
|
|
@@ -10202,11 +10192,11 @@ var Zx, Qx = class {
|
|
|
10202
10192
|
}), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
|
|
10203
10193
|
}
|
|
10204
10194
|
};
|
|
10205
|
-
|
|
10195
|
+
Xx = Zx, e(Zx, "create", (e, t, n, r, i, a) => new Xx(e, t, n, r, i, a));
|
|
10206
10196
|
// ../../libs/web-sdk/src/TextTracks.ts
|
|
10207
|
-
var
|
|
10197
|
+
var Qx = /* @__PURE__ */ new WeakMap(), $x = class {
|
|
10208
10198
|
constructor() {
|
|
10209
|
-
c(this,
|
|
10199
|
+
c(this, Qx, []), n(Qx, this, []);
|
|
10210
10200
|
}
|
|
10211
10201
|
addTextTrack(e, t, n) {
|
|
10212
10202
|
let r = [], a = {
|
|
@@ -10223,43 +10213,43 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
|
|
|
10223
10213
|
t !== -1 && r.splice(t, 1);
|
|
10224
10214
|
}
|
|
10225
10215
|
};
|
|
10226
|
-
return i(
|
|
10216
|
+
return i(Qx, this).push(a), a;
|
|
10227
10217
|
}
|
|
10228
10218
|
set language(e) {
|
|
10229
|
-
i(
|
|
10219
|
+
i(Qx, this).forEach((t) => {
|
|
10230
10220
|
t.mode = t.language === e ? "showing" : "hidden";
|
|
10231
10221
|
});
|
|
10232
10222
|
}
|
|
10233
10223
|
get language() {
|
|
10234
10224
|
var e;
|
|
10235
|
-
return (e = i(
|
|
10225
|
+
return (e = i(Qx, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
|
|
10236
10226
|
}
|
|
10237
10227
|
get tracks() {
|
|
10238
|
-
return i(
|
|
10228
|
+
return i(Qx, this);
|
|
10239
10229
|
}
|
|
10240
10230
|
get activeTrack() {
|
|
10241
|
-
return i(
|
|
10231
|
+
return i(Qx, this).find((e) => e.mode === "showing");
|
|
10242
10232
|
}
|
|
10243
10233
|
getActiveCues(e) {
|
|
10244
|
-
let t = i(
|
|
10234
|
+
let t = i(Qx, this).find((e) => e.mode === "showing");
|
|
10245
10235
|
return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e < n) : [];
|
|
10246
10236
|
}
|
|
10247
|
-
},
|
|
10237
|
+
}, eS = (e, t) => {
|
|
10248
10238
|
let n;
|
|
10249
10239
|
for (n = t; e > 1; e--) n += t;
|
|
10250
10240
|
return n;
|
|
10251
|
-
},
|
|
10241
|
+
}, tS = class {
|
|
10252
10242
|
constructor() {
|
|
10253
10243
|
e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(b));
|
|
10254
10244
|
let t = document.createElement("div");
|
|
10255
10245
|
t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
10256
10246
|
let n = t.children.item(0);
|
|
10257
|
-
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
10247
|
+
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + eS(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + eS(16, "gICA") + eS(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + eS(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + eS(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + eS(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + eS(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
10258
10248
|
else throw Error("Failed to create audio tag");
|
|
10259
10249
|
}
|
|
10260
|
-
},
|
|
10250
|
+
}, nS, rS = class {
|
|
10261
10251
|
constructor(t, n, r, i, a, o, s, c) {
|
|
10262
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new
|
|
10252
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new tS()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "volumeState", void 0), e(this, "textTracks", new $x()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
|
|
10263
10253
|
let e = {
|
|
10264
10254
|
volume: this.volume,
|
|
10265
10255
|
isMuted: this.userMuted
|
|
@@ -10295,13 +10285,13 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
|
|
|
10295
10285
|
e instanceof Error && this.emitter.emit("error", Ln(!1, e));
|
|
10296
10286
|
}
|
|
10297
10287
|
this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
|
|
10298
|
-
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer =
|
|
10288
|
+
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Yx.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
10299
10289
|
muted: a,
|
|
10300
10290
|
reInitWhenStuck: !0,
|
|
10301
10291
|
bufferTime: c
|
|
10302
10292
|
}), o !== void 0 && (this.audioPlayer.volume = o), this.audioPlayer.on("stuck", () => {
|
|
10303
10293
|
this.isDisconnected = !0;
|
|
10304
|
-
}), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer =
|
|
10294
|
+
}), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Zx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
|
|
10305
10295
|
}
|
|
10306
10296
|
get volume() {
|
|
10307
10297
|
return this.audioPlayer.volume;
|
|
@@ -10360,28 +10350,28 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
|
|
|
10360
10350
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
10361
10351
|
}
|
|
10362
10352
|
};
|
|
10363
|
-
|
|
10353
|
+
nS = rS, e(rS, "create", (e, t, n, r, i, a, o, s) => new nS(e, t, n, r, i, a, o, s));
|
|
10364
10354
|
// ../../libs/web-sdk/src/modules/MediaSessionModule.ts
|
|
10365
|
-
var
|
|
10355
|
+
var iS, aS = [
|
|
10366
10356
|
"play",
|
|
10367
10357
|
"pause",
|
|
10368
10358
|
"stop"
|
|
10369
|
-
],
|
|
10359
|
+
], oS, sS = /* @__PURE__ */ new Set(), cS = class t {
|
|
10370
10360
|
constructor(n, r, i) {
|
|
10371
10361
|
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "options", void 0), e(this, "isLoaded", !1), e(this, "playbackState", void 0), e(this, "pageMetadata", null), e(this, "load", () => {
|
|
10372
|
-
!this.isLoaded && t.isSupported() && (this.isLoaded = !0,
|
|
10362
|
+
!this.isLoaded && t.isSupported() && (this.isLoaded = !0, sS.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
|
|
10373
10363
|
}), e(this, "unload", () => {
|
|
10374
10364
|
var e;
|
|
10375
|
-
this.isLoaded && (this.isLoaded = !1,
|
|
10365
|
+
this.isLoaded && (this.isLoaded = !1, sS.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
|
|
10376
10366
|
}), e(this, "stop", () => {
|
|
10377
10367
|
var e;
|
|
10378
|
-
this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(),
|
|
10368
|
+
this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), oS === this && this.handOverOwnership("on stop");
|
|
10379
10369
|
}), e(this, "getStatistics", () => {
|
|
10380
10370
|
var e;
|
|
10381
10371
|
return {
|
|
10382
10372
|
mediaSessionSupported: t.isSupported(),
|
|
10383
|
-
mediaSessionOwner:
|
|
10384
|
-
mediaSessionPlaybackState:
|
|
10373
|
+
mediaSessionOwner: oS === this,
|
|
10374
|
+
mediaSessionPlaybackState: oS === this ? this.isPaused ? "paused" : "playing" : "none",
|
|
10385
10375
|
decoyState: (e = this.options.decoy) == null ? void 0 : e.getStatistics().decoyState
|
|
10386
10376
|
};
|
|
10387
10377
|
}), e(this, "onPlaybackState", (e) => {
|
|
@@ -10389,18 +10379,18 @@ var aS, oS = [
|
|
|
10389
10379
|
}), e(this, "refresh", () => {
|
|
10390
10380
|
this.update();
|
|
10391
10381
|
}), e(this, "update", () => {
|
|
10392
|
-
this.isLoaded && (this.isEligibleToOwn &&
|
|
10382
|
+
this.isLoaded && (this.isEligibleToOwn && oS !== this ? this.claimOwnership() : this.sync());
|
|
10393
10383
|
}), e(this, "handOverOwnership", (e) => {
|
|
10394
|
-
if (
|
|
10384
|
+
if (oS === this) {
|
|
10395
10385
|
this.logger.debug(`Handing over the media session ${e}`), this.releaseOwnership();
|
|
10396
|
-
for (let e of
|
|
10386
|
+
for (let e of sS) if (e !== this && e.isEligibleToOwn) {
|
|
10397
10387
|
e.claimOwnership();
|
|
10398
10388
|
return;
|
|
10399
10389
|
}
|
|
10400
10390
|
}
|
|
10401
10391
|
}), e(this, "sync", () => {
|
|
10402
10392
|
var e, t, n, r, i, a;
|
|
10403
|
-
if (
|
|
10393
|
+
if (oS !== this) return;
|
|
10404
10394
|
if ((e = (t = this.options).isSuppressed) != null && e.call(t)) {
|
|
10405
10395
|
var o;
|
|
10406
10396
|
(o = this.options.decoy) == null || o.unload(), this.handOverOwnership("as suppressed");
|
|
@@ -10433,8 +10423,8 @@ var aS, oS = [
|
|
|
10433
10423
|
(f = this.options.decoy) == null || f.play();
|
|
10434
10424
|
}
|
|
10435
10425
|
}), e(this, "claimOwnership", () => {
|
|
10436
|
-
|
|
10437
|
-
for (let e of
|
|
10426
|
+
oS == null || oS.releaseOwnership(), oS = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
|
|
10427
|
+
for (let e of aS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
|
|
10438
10428
|
this.safely("position state", () => {
|
|
10439
10429
|
var e, t;
|
|
10440
10430
|
return (e = (t = navigator.mediaSession).setPositionState) == null ? void 0 : e.call(t, {
|
|
@@ -10450,9 +10440,9 @@ var aS, oS = [
|
|
|
10450
10440
|
});
|
|
10451
10441
|
}), e(this, "releaseOwnership", () => {
|
|
10452
10442
|
var e;
|
|
10453
|
-
if (
|
|
10454
|
-
|
|
10455
|
-
for (let e of
|
|
10443
|
+
if (oS === this) {
|
|
10444
|
+
oS = void 0, (e = this.options.decoy) == null || e.pause();
|
|
10445
|
+
for (let e of aS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
|
|
10456
10446
|
this.options.metadata && this.safely("metadata restore", () => {
|
|
10457
10447
|
navigator.mediaSession.metadata = this.pageMetadata;
|
|
10458
10448
|
}), this.safely("release", () => {
|
|
@@ -10486,14 +10476,14 @@ var aS, oS = [
|
|
|
10486
10476
|
return this.playbackState !== void 0 && !this.isPaused && !this.options.isMuted() && ((e = (t = this.options).isSuppressed) == null ? void 0 : e.call(t)) !== !0;
|
|
10487
10477
|
}
|
|
10488
10478
|
};
|
|
10489
|
-
|
|
10479
|
+
iS = cS, e(cS, "create", (e, t, n) => new iS(e, t, n)), e(cS, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
|
|
10490
10480
|
// ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
|
|
10491
|
-
var
|
|
10481
|
+
var lS, uS = class {
|
|
10492
10482
|
constructor(t, n, r, i, { muted: a, volume: o, type: s, poster: c, offscreenCanvas: l, bufferTime: u, backgroundPlaybackEnabled: d, splitAudio: f }) {
|
|
10493
10483
|
if (e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "sound", void 0), e(this, "wantsPlay", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "videoTrack", void 0), e(this, "canvasCaptureTracks", []), e(this, "backgroundPlaybackEnabled", void 0), e(this, "nativeTracksByLanguage", /* @__PURE__ */ new Map()), e(this, "nativeCuesByLanguage", /* @__PURE__ */ new Map()), e(this, "lastCanvasCueTexts", []), e(this, "isIOSNativeFullscreen", !1), e(this, "knownNativeLanguage", void 0), e(this, "renderCanvasSubtitlesInNativeFullscreen", (() => {
|
|
10494
10484
|
let e = He().platform;
|
|
10495
10485
|
return e.isIOS && e.iosVersion <= 16;
|
|
10496
|
-
})()), e(this, "volumeState", void 0), e(this, "textTracks", new
|
|
10486
|
+
})()), e(this, "volumeState", void 0), e(this, "textTracks", new $x()), e(this, "reset", () => {}), e(this, "load", () => {
|
|
10497
10487
|
this.mediaElement.load(), this.sound && (this.sound.load(), document.body.appendChild(this.sound.element), this.mediaElement.element.addEventListener("pause", this.onVideoPause), this.mediaElement.element.addEventListener("play", this.onVideoPlay), window.addEventListener("focus", this.onWindowFocus)), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.addEventListener("change", this.onNativeTextTrackChange), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.timers.setInterval(this.syncNativeTextTracks, 100);
|
|
10498
10488
|
}), e(this, "unload", () => {
|
|
10499
10489
|
this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.removeEventListener("change", this.onNativeTextTrackChange), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack);
|
|
@@ -10636,13 +10626,13 @@ var uS, dS = class {
|
|
|
10636
10626
|
}), this.soundElement.on("media element state", (e) => {
|
|
10637
10627
|
e === "paused" && this.audioPlayer.flushBuffer(), this.audioPlayer.sinkPaused = e === "paused", this.emitPlaybackState();
|
|
10638
10628
|
}), this.sound) for (let e of this.elements()) e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("error", (e) => this.emitter.emit("error", e));
|
|
10639
|
-
this.audioPlayer =
|
|
10629
|
+
this.audioPlayer = Yx.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
10640
10630
|
muted: !1,
|
|
10641
10631
|
reInitWhenStuck: !1,
|
|
10642
10632
|
bufferTime: u
|
|
10643
10633
|
}), this.audioPlayer.on("state change", (e) => {
|
|
10644
10634
|
e === "suspended" || e === "interrupted" ? this.soundElement.muted = !0 : e === "running" && this.applyVisibilityMutePolicy(), this.updateVolumeState();
|
|
10645
|
-
}), this.videoPlayer =
|
|
10635
|
+
}), this.videoPlayer = Zx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
|
|
10646
10636
|
}
|
|
10647
10637
|
get volume() {
|
|
10648
10638
|
return this.soundElement.volume;
|
|
@@ -10714,9 +10704,9 @@ var uS, dS = class {
|
|
|
10714
10704
|
return this.renderCanvasSubtitlesInNativeFullscreen && !this.offscreenCanvas;
|
|
10715
10705
|
}
|
|
10716
10706
|
};
|
|
10717
|
-
|
|
10707
|
+
lS = uS, e(uS, "create", (e, t, n, r, i) => new lS(e, t, n, r, i));
|
|
10718
10708
|
// ../../libs/web-sdk/src/modules/MseModule.ts
|
|
10719
|
-
var
|
|
10709
|
+
var dS, fS = class {
|
|
10720
10710
|
constructor() {
|
|
10721
10711
|
e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
|
|
10722
10712
|
var r;
|
|
@@ -10728,7 +10718,7 @@ var fS, pS = class {
|
|
|
10728
10718
|
});
|
|
10729
10719
|
}
|
|
10730
10720
|
};
|
|
10731
|
-
function
|
|
10721
|
+
function pS(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
10732
10722
|
return p(p({}, e), {}, {
|
|
10733
10723
|
state: "initialized",
|
|
10734
10724
|
mimeType: n,
|
|
@@ -10740,10 +10730,10 @@ function mS(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
|
10740
10730
|
lastBufferCleanupTime: performance.now()
|
|
10741
10731
|
});
|
|
10742
10732
|
}
|
|
10743
|
-
function
|
|
10733
|
+
function mS({ initSegments: e, pendingSamples: t }) {
|
|
10744
10734
|
return {
|
|
10745
10735
|
state: "uninitialized",
|
|
10746
|
-
initSegments: e == null ? new
|
|
10736
|
+
initSegments: e == null ? new fS() : e,
|
|
10747
10737
|
sequenceNumber: 0,
|
|
10748
10738
|
isWorkingOnPendingSamples: !1,
|
|
10749
10739
|
hasFirstSync: t.some((e) => e.isSync),
|
|
@@ -10753,7 +10743,7 @@ function hS({ initSegments: e, pendingSamples: t }) {
|
|
|
10753
10743
|
successfulAppendCalls: 0
|
|
10754
10744
|
};
|
|
10755
10745
|
}
|
|
10756
|
-
var
|
|
10746
|
+
var hS = class {
|
|
10757
10747
|
constructor(n, r, i) {
|
|
10758
10748
|
var a = this;
|
|
10759
10749
|
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "recoveryBeforeHideWindowMs", 1e3), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new rc()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", performance.now()), e(this, "sourceOpenEndTime", performance.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "pendingMediaError", void 0), e(this, "isFlushDeferred", !1), e(this, "hasRecoveredSinceShown", !1), e(this, "lastRecoveredAt", -Infinity), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
|
|
@@ -10799,7 +10789,7 @@ var gS = class {
|
|
|
10799
10789
|
var n, r, i;
|
|
10800
10790
|
let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
|
|
10801
10791
|
for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
|
|
10802
|
-
let l =
|
|
10792
|
+
let l = mS({
|
|
10803
10793
|
pendingSamples: o,
|
|
10804
10794
|
initSegments: s
|
|
10805
10795
|
});
|
|
@@ -10810,14 +10800,14 @@ var gS = class {
|
|
|
10810
10800
|
this.trackContexts.forEach((e, n) => {
|
|
10811
10801
|
if (t.has(n)) return;
|
|
10812
10802
|
e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
|
|
10813
|
-
let r =
|
|
10803
|
+
let r = mS({
|
|
10814
10804
|
pendingSamples: [],
|
|
10815
10805
|
initSegments: e.initSegments
|
|
10816
10806
|
});
|
|
10817
10807
|
this.trackContexts.set(n, r);
|
|
10818
10808
|
});
|
|
10819
10809
|
}), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
|
|
10820
|
-
let n =
|
|
10810
|
+
let n = pS(e, {
|
|
10821
10811
|
mimeType: t.mimeType,
|
|
10822
10812
|
mediaSource: this.mediaSource,
|
|
10823
10813
|
codec: t.codec
|
|
@@ -10841,9 +10831,9 @@ var gS = class {
|
|
|
10841
10831
|
if (t) a.logger.debug("Already setup with the correct mime types");
|
|
10842
10832
|
else for (let t of e) {
|
|
10843
10833
|
let n = a.trackContexts.get(t.type);
|
|
10844
|
-
if (n || (n =
|
|
10834
|
+
if (n || (n = mS({
|
|
10845
10835
|
pendingSamples: [],
|
|
10846
|
-
initSegments: new
|
|
10836
|
+
initSegments: new fS()
|
|
10847
10837
|
}), a.trackContexts.set(t.type, n)), n.state === "initialized") {
|
|
10848
10838
|
if (t.mimeType !== n.sourceBufferMimeType) try {
|
|
10849
10839
|
yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
|
|
@@ -10860,7 +10850,7 @@ var gS = class {
|
|
|
10860
10850
|
a.logger.warn("removeSourceBuffer failed", { removeError: t }), a.reopenMediaSource("changeType recovery failed"), a.pendingTracksToAddSourceBuffers = e;
|
|
10861
10851
|
return;
|
|
10862
10852
|
}
|
|
10863
|
-
let i =
|
|
10853
|
+
let i = mS({
|
|
10864
10854
|
pendingSamples: n.pendingSamples,
|
|
10865
10855
|
initSegments: n.initSegments
|
|
10866
10856
|
});
|
|
@@ -10884,7 +10874,7 @@ var gS = class {
|
|
|
10884
10874
|
};
|
|
10885
10875
|
}), e(this, "getNextBufferedRangeStart", (e) => {
|
|
10886
10876
|
let t = this.getCommonBufferedRangesForCurrentTracks();
|
|
10887
|
-
if (t) return
|
|
10877
|
+
if (t) return gS(e, t);
|
|
10888
10878
|
}), e(this, "getBufferedEndAt", (e) => {
|
|
10889
10879
|
var t;
|
|
10890
10880
|
let n = this.getCommonBufferedRangesForCurrentTracks();
|
|
@@ -10934,9 +10924,9 @@ var gS = class {
|
|
|
10934
10924
|
s > 0 && performance.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = performance.now(), yield r.sourceBuffer.removeBuffer(0, s + 10));
|
|
10935
10925
|
try {
|
|
10936
10926
|
let t = r.sequenceNumber;
|
|
10937
|
-
if ("fragmented" in n) for (let t of
|
|
10927
|
+
if ("fragmented" in n) for (let t of xS(e)) {
|
|
10938
10928
|
var c;
|
|
10939
|
-
yield r.sourceBuffer.appendBuffer(
|
|
10929
|
+
yield r.sourceBuffer.appendBuffer(SS(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
|
|
10940
10930
|
}
|
|
10941
10931
|
else {
|
|
10942
10932
|
let n = Hs(e, t++);
|
|
@@ -10984,7 +10974,7 @@ var gS = class {
|
|
|
10984
10974
|
let t = this.trackContexts.get(e.type);
|
|
10985
10975
|
if (!t) throw Bn(e.type, e.renditionId);
|
|
10986
10976
|
let n = t.pendingSamples.length - t.pendingSamplesOffset;
|
|
10987
|
-
if (t.state === "uninitialized" && n >=
|
|
10977
|
+
if (t.state === "uninitialized" && n >= vS && (e.isSync || n >= 2 * vS) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), t.hasFirstSync || e.isSync) {
|
|
10988
10978
|
if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
|
|
10989
10979
|
this.hasAddedInitialPosterFrame = !1;
|
|
10990
10980
|
let n = p({}, e);
|
|
@@ -10995,7 +10985,7 @@ var gS = class {
|
|
|
10995
10985
|
let t = (e.timestamp + ((r = e.compositionTimeOffset) == null ? 0 : r)) / e.timescale * 1e3, n = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
10996
10986
|
n !== void 0 && t < n && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
10997
10987
|
}
|
|
10998
|
-
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples ||
|
|
10988
|
+
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || wS(t, this.append, this.maxChunkSize).catch((n) => {
|
|
10999
10989
|
if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
|
|
11000
10990
|
if (!this.isCurrentTrackContext(e.type, t)) this.logger.debug("Suppressing append error from stale track context", { type: e.type });
|
|
11001
10991
|
else if (n instanceof tc) this.logger.debug("Suppressing append error from a disposed source buffer", { type: e.type });
|
|
@@ -11109,14 +11099,14 @@ var gS = class {
|
|
|
11109
11099
|
if (this.mediaSource.isClosed()) return;
|
|
11110
11100
|
let e = this.getInitializedTrackBuffers();
|
|
11111
11101
|
if (e.length !== 0) return this.getCommonBufferedRanges(e);
|
|
11112
|
-
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) =>
|
|
11102
|
+
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => bS(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => en(t, e) ? "playing" : "buffering"), this.logger = n, this.mediaElement = i, this.emitter = r;
|
|
11113
11103
|
}
|
|
11114
11104
|
};
|
|
11115
|
-
|
|
11116
|
-
let r = new
|
|
11105
|
+
dS = hS, e(hS, "create", (e, t, n) => {
|
|
11106
|
+
let r = new dS(e, t, n);
|
|
11117
11107
|
return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), n.addEventListener("waiting", r.onPlaybackStall), n.addEventListener("stalled", r.onPlaybackStall), n.addEventListener("playing", r.onPlaybackProgress), n.addEventListener("pause", r.onPlaybackPauseOrSeek), n.addEventListener("play", r.onPlay), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
|
|
11118
11108
|
});
|
|
11119
|
-
var
|
|
11109
|
+
var gS = (e, t) => {
|
|
11120
11110
|
for (let r = 0; r < t.length; r++) {
|
|
11121
11111
|
let i = t[r];
|
|
11122
11112
|
if (i) {
|
|
@@ -11127,11 +11117,11 @@ var _S = (e, t) => {
|
|
|
11127
11117
|
}
|
|
11128
11118
|
}
|
|
11129
11119
|
}
|
|
11130
|
-
},
|
|
11120
|
+
}, _S = (e, t) => {
|
|
11131
11121
|
var n;
|
|
11132
11122
|
let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
|
|
11133
11123
|
return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
|
|
11134
|
-
},
|
|
11124
|
+
}, vS = 1e3, yS = 32, bS = (e, t) => {
|
|
11135
11125
|
let n = [], r = 0, i = 0;
|
|
11136
11126
|
for (; r < e.length && i < t.length;) {
|
|
11137
11127
|
let a = e[r], o = t[i];
|
|
@@ -11143,7 +11133,7 @@ var _S = (e, t) => {
|
|
|
11143
11133
|
}), a.end <= o.end ? r++ : i++;
|
|
11144
11134
|
}
|
|
11145
11135
|
return n;
|
|
11146
|
-
},
|
|
11136
|
+
}, xS = (e) => {
|
|
11147
11137
|
let t = [];
|
|
11148
11138
|
for (let r of e) {
|
|
11149
11139
|
var n;
|
|
@@ -11152,15 +11142,15 @@ var _S = (e, t) => {
|
|
|
11152
11142
|
(e == null || (n = e[0]) == null ? void 0 : n.initData) === r.initData ? e.push(r) : t.push([r]);
|
|
11153
11143
|
}
|
|
11154
11144
|
return t;
|
|
11155
|
-
},
|
|
11145
|
+
}, SS = (e) => {
|
|
11156
11146
|
if (e.length === 1 && e[0]) return e[0];
|
|
11157
11147
|
let t = new Uint8Array(e.reduce((e, t) => e + t.byteLength, 0)), n = 0;
|
|
11158
11148
|
for (let r of e) t.set(r, n), n += r.byteLength;
|
|
11159
11149
|
return t;
|
|
11160
|
-
},
|
|
11150
|
+
}, CS = (e) => {
|
|
11161
11151
|
let t = e.pendingSamplesOffset;
|
|
11162
|
-
t !== 0 && (t >= e.pendingSamples.length ? (e.pendingSamples = [], e.pendingSamplesOffset = 0) : t <
|
|
11163
|
-
},
|
|
11152
|
+
t !== 0 && (t >= e.pendingSamples.length ? (e.pendingSamples = [], e.pendingSamplesOffset = 0) : t < yS || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0));
|
|
11153
|
+
}, wS = function() {
|
|
11164
11154
|
var e = t(function* (e, t, n) {
|
|
11165
11155
|
for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
|
|
11166
11156
|
let r = [], i = e.pendingSamplesOffset;
|
|
@@ -11168,7 +11158,7 @@ var _S = (e, t) => {
|
|
|
11168
11158
|
i = t;
|
|
11169
11159
|
let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
|
|
11170
11160
|
if (a && (r.push(a), o)) {
|
|
11171
|
-
if (
|
|
11161
|
+
if (_S(a, o)) break;
|
|
11172
11162
|
let e = (a.timestamp + a.duration) / a.timescale;
|
|
11173
11163
|
if (o.timestamp / o.timescale - e > .1) break;
|
|
11174
11164
|
}
|
|
@@ -11176,14 +11166,14 @@ var _S = (e, t) => {
|
|
|
11176
11166
|
}
|
|
11177
11167
|
let a = r[0];
|
|
11178
11168
|
if (!a) break;
|
|
11179
|
-
yield t(r, !e.previousSample ||
|
|
11169
|
+
yield t(r, !e.previousSample || _S(e.previousSample, a)), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], CS(e);
|
|
11180
11170
|
}
|
|
11181
11171
|
e.isWorkingOnPendingSamples = !1;
|
|
11182
11172
|
});
|
|
11183
11173
|
return function(t, n, r) {
|
|
11184
11174
|
return e.apply(this, arguments);
|
|
11185
11175
|
};
|
|
11186
|
-
}(),
|
|
11176
|
+
}(), TS, ES = class {
|
|
11187
11177
|
constructor(n, r) {
|
|
11188
11178
|
var i = this;
|
|
11189
11179
|
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
|
|
@@ -11215,9 +11205,9 @@ var _S = (e, t) => {
|
|
|
11215
11205
|
}()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && ot(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
|
|
11216
11206
|
}
|
|
11217
11207
|
};
|
|
11218
|
-
|
|
11208
|
+
TS = ES, e(ES, "create", (e, t) => new TS(e, t));
|
|
11219
11209
|
// ../../libs/web-sdk/src/modules/PlaybackModule.ts
|
|
11220
|
-
var
|
|
11210
|
+
var DS, OS = class {
|
|
11221
11211
|
constructor(t, n, r, i) {
|
|
11222
11212
|
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
|
|
11223
11213
|
this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
|
|
@@ -11235,23 +11225,23 @@ var OS, kS = class {
|
|
|
11235
11225
|
}), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
|
|
11236
11226
|
}
|
|
11237
11227
|
};
|
|
11238
|
-
|
|
11228
|
+
DS = OS, e(OS, "create", (e, t, n, r) => new DS(e, t, n, r));
|
|
11239
11229
|
// ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
|
|
11240
|
-
var
|
|
11230
|
+
var kS, AS = 6e4, jS = () => ({
|
|
11241
11231
|
upgradesFromLevel: [],
|
|
11242
11232
|
downgradesFromLevel: [],
|
|
11243
11233
|
bufferingRanges: [],
|
|
11244
11234
|
activeRanges: [],
|
|
11245
11235
|
decodeRate: 2 ** 53 - 1
|
|
11246
|
-
}),
|
|
11236
|
+
}), MS = () => ({
|
|
11247
11237
|
levels: {},
|
|
11248
11238
|
levelDowngrades: [],
|
|
11249
11239
|
levelUpgrades: [],
|
|
11250
11240
|
bufferFullness: 0,
|
|
11251
|
-
general:
|
|
11252
|
-
}),
|
|
11241
|
+
general: jS()
|
|
11242
|
+
}), NS = 100, PS = 3600, FS = 1e3, IS = class {
|
|
11253
11243
|
constructor(t, n, r, i) {
|
|
11254
|
-
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics",
|
|
11244
|
+
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", MS()), e(this, "bufferFullness", new S(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "recentFatalQosCount", 0), e(this, "healthyPlaybackMs", 0), e(this, "healthyPlaybackStartedAt", void 0), e(this, "playbackIsPlaying", !1), e(this, "stallClockStart", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
|
|
11255
11245
|
this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("connection state", this.onConnectionState), this.emitter.on("subscription changed", this.onSubscriptionChanged), this.emitter.on("pagehide", this.onPageHide);
|
|
11256
11246
|
}), e(this, "unload", () => {
|
|
11257
11247
|
this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.emitter.off("pagehide", this.onPageHide), this.suspend();
|
|
@@ -11269,7 +11259,7 @@ var AS, jS = 6e4, MS = () => ({
|
|
|
11269
11259
|
return this.metrics.levels[a];
|
|
11270
11260
|
}), e(this, "getBufferFullnessRegression", (e = !1) => {
|
|
11271
11261
|
if (!e) return this.bufferFullnessRegression;
|
|
11272
|
-
if (performance.now() - this.lastDeliveryResumeTime <
|
|
11262
|
+
if (performance.now() - this.lastDeliveryResumeTime < FS) return;
|
|
11273
11263
|
let t = this.bufferFullness.items().filter(({ time: e }) => e >= this.lastDeliveryResumeTime);
|
|
11274
11264
|
return t.length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression(t) : void 0;
|
|
11275
11265
|
}), e(this, "getTargetBufferTime", () => {
|
|
@@ -11334,21 +11324,21 @@ var AS, jS = 6e4, MS = () => ({
|
|
|
11334
11324
|
let d = !1;
|
|
11335
11325
|
if (e.from) {
|
|
11336
11326
|
var f;
|
|
11337
|
-
let e = (f = this.metrics.levels[l]) == null ?
|
|
11327
|
+
let e = (f = this.metrics.levels[l]) == null ? jS() : f;
|
|
11338
11328
|
l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Jt(e.activeRanges);
|
|
11339
11329
|
let t = e.bufferingRanges[e.bufferingRanges.length - 1];
|
|
11340
11330
|
d = !!t && !t.end, Jt(e.bufferingRanges), this.metrics.levels[l] = e;
|
|
11341
11331
|
}
|
|
11342
11332
|
if (e.to) {
|
|
11343
11333
|
var p;
|
|
11344
|
-
let e = (p = this.metrics.levels[u]) == null ?
|
|
11334
|
+
let e = (p = this.metrics.levels[u]) == null ? jS() : p;
|
|
11345
11335
|
Yt(e.activeRanges), d && Yt(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
|
|
11346
11336
|
}
|
|
11347
11337
|
}), e(this, "onMediaDeliveryResumed", () => {
|
|
11348
11338
|
this.lastDeliveryResumeTime = performance.now();
|
|
11349
11339
|
}), e(this, "onBufferFullness", (e) => {
|
|
11350
11340
|
if (this.metrics.bufferFullness = e, this.isSuspended) return;
|
|
11351
|
-
let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e /
|
|
11341
|
+
let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / NS);
|
|
11352
11342
|
if (n && r(n.time) === r(t)) n.time = t, n.value = e;
|
|
11353
11343
|
else {
|
|
11354
11344
|
var i, a;
|
|
@@ -11356,7 +11346,7 @@ var AS, jS = 6e4, MS = () => ({
|
|
|
11356
11346
|
time: t,
|
|
11357
11347
|
value: e
|
|
11358
11348
|
});
|
|
11359
|
-
let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t -
|
|
11349
|
+
let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - PS, r);
|
|
11360
11350
|
this.bufferFullness.filterPop(({ time: e }) => e >= o);
|
|
11361
11351
|
}
|
|
11362
11352
|
this.bufferFullnessRegression = this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression() : void 0;
|
|
@@ -11371,7 +11361,7 @@ var AS, jS = 6e4, MS = () => ({
|
|
|
11371
11361
|
case "paused":
|
|
11372
11362
|
this.playbackIsPlaying = !1, this.hasPlayedInSession || this.stopHealthyPlayback();
|
|
11373
11363
|
break;
|
|
11374
|
-
case "buffering": this.stopHealthyPlayback(), this.playbackIsPlaying = !1, this.healthyPlaybackMs >=
|
|
11364
|
+
case "buffering": this.stopHealthyPlayback(), this.playbackIsPlaying = !1, this.healthyPlaybackMs >= AS && (this.recentFatalQosCount = 0), !this.isSuspended && this.hasPlayedInSession ? (this.healthyPlaybackMs = 0, this.startBuffering()) : this.isSuspended && (this.healthyPlaybackMs = 0);
|
|
11375
11365
|
}
|
|
11376
11366
|
}), e(this, "onPageHide", ({ persisted: e }) => {
|
|
11377
11367
|
e && (this.suspend(), this.playbackIsPlaying = !1);
|
|
@@ -11436,9 +11426,9 @@ var AS, jS = 6e4, MS = () => ({
|
|
|
11436
11426
|
Yt(this.metrics.general.activeRanges);
|
|
11437
11427
|
}
|
|
11438
11428
|
};
|
|
11439
|
-
|
|
11429
|
+
kS = IS, e(IS, "create", (e, t, n, r) => new kS(e, t, n, r));
|
|
11440
11430
|
// ../../libs/web-sdk/src/modules/RenditionsModule.ts
|
|
11441
|
-
var
|
|
11431
|
+
var LS, RS = class {
|
|
11442
11432
|
constructor(t, n) {
|
|
11443
11433
|
e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
|
|
11444
11434
|
this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
|
|
@@ -11513,9 +11503,9 @@ var RS, zS = class {
|
|
|
11513
11503
|
}), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
11514
11504
|
}
|
|
11515
11505
|
};
|
|
11516
|
-
|
|
11506
|
+
LS = RS, e(RS, "create", (e, t) => new LS(e, t));
|
|
11517
11507
|
// ../../libs/web-sdk/src/BFrameTracker.ts
|
|
11518
|
-
var
|
|
11508
|
+
var zS = class t {
|
|
11519
11509
|
constructor() {
|
|
11520
11510
|
e(this, "channelId", void 0), e(this, "renditionId", void 0), e(this, "anchorCts", void 0), e(this, "hasBFramesValue", !1), e(this, "isAwaitingAssessment", !1), e(this, "zeroOffsetSamples", 0), e(this, "omittedBoundaryCrossings", 0), e(this, "hasSeenKeyframe", !1), e(this, "hasObservedReordering", !1), e(this, "rememberedRenditions", new St(t.MAX_REMEMBERED_RENDITIONS));
|
|
11521
11511
|
}
|
|
@@ -11551,7 +11541,7 @@ var BS = class t {
|
|
|
11551
11541
|
this.channelId = void 0, this.renditionId = void 0, this.anchorCts = void 0, this.hasBFramesValue = !1, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1, this.isAwaitingAssessment = !0;
|
|
11552
11542
|
}
|
|
11553
11543
|
remember(e) {
|
|
11554
|
-
this.channelId !== void 0 && this.rememberedRenditions.set(
|
|
11544
|
+
this.channelId !== void 0 && this.rememberedRenditions.set(xx(this.channelId, this.renditionId), e);
|
|
11555
11545
|
}
|
|
11556
11546
|
latchBFrames() {
|
|
11557
11547
|
this.hasBFramesValue = !0, this.hasObservedReordering = !0, this.isAwaitingAssessment = !1, this.remember(!0);
|
|
@@ -11563,17 +11553,17 @@ var BS = class t {
|
|
|
11563
11553
|
this.hasSeenKeyframe && !this.hasObservedReordering && (this.remember(!1), this.hasBFramesValue = !1), this.hasSeenKeyframe = !0, this.omittedBoundaryCrossings = 0;
|
|
11564
11554
|
}
|
|
11565
11555
|
resetOnSwitch(e, t) {
|
|
11566
|
-
if (!
|
|
11556
|
+
if (!Sx(e, t, this.channelId, this.renditionId)) {
|
|
11567
11557
|
let n = this.channelId !== void 0;
|
|
11568
11558
|
this.channelId = e, this.renditionId = t, this.anchorCts = void 0, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1;
|
|
11569
|
-
let r = this.rememberedRenditions.get(
|
|
11559
|
+
let r = this.rememberedRenditions.get(xx(e, t));
|
|
11570
11560
|
this.hasBFramesValue = r != null && r, n && (this.isAwaitingAssessment = r === void 0);
|
|
11571
11561
|
}
|
|
11572
11562
|
}
|
|
11573
11563
|
};
|
|
11574
|
-
e(
|
|
11564
|
+
e(zS, "MAX_REMEMBERED_RENDITIONS", 32);
|
|
11575
11565
|
// ../../libs/web-sdk/src/modules/SyncModule.ts
|
|
11576
|
-
var
|
|
11566
|
+
var BS, VS = 5e3, HS = .5, US = 3e3, WS = () => Ae() || De(), GS = (e) => e && WS() ? 100 : 0, KS = (e) => (t) => t > e, qS = 100, JS = 1e3, YS = 1e3, XS = 1e3, ZS = 100, QS = 50, $S = {
|
|
11577
11567
|
seek: {
|
|
11578
11568
|
toleranceMs: 200,
|
|
11579
11569
|
toleranceMaxMs: 2500,
|
|
@@ -11605,7 +11595,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11605
11595
|
decayCooldownMultiplier: 3,
|
|
11606
11596
|
decayCheckInterval: 15e3
|
|
11607
11597
|
}
|
|
11608
|
-
},
|
|
11598
|
+
}, eC = class {
|
|
11609
11599
|
get driftSamplesToCollect() {
|
|
11610
11600
|
return this._driftSamplesToCollect;
|
|
11611
11601
|
}
|
|
@@ -11613,8 +11603,8 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11613
11603
|
this._driftSamplesToCollect = e, this.driftSamples = new S(e);
|
|
11614
11604
|
}
|
|
11615
11605
|
constructor(t, n, r, i, a, o = !0) {
|
|
11616
|
-
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new S(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs",
|
|
11617
|
-
this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ?
|
|
11606
|
+
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new S(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", qS), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", void 0), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToCollect", 5), e(this, "driftSamples", new S(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new zS()), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
|
|
11607
|
+
this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? JS : qS);
|
|
11618
11608
|
}), e(this, "unload", () => {
|
|
11619
11609
|
this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("page active", this.onPageActive), this.emitter.off("pageshow", this.onPageShow), this.emitter.off("buffers flushed", this.clearBFrameLatch), this.emitter.off("recovered from media error", this.onMediaSourceRecovered), this.clearSyncInterval(), this.timers.unload(), this.logger.debug("Unloaded module");
|
|
11620
11610
|
}), e(this, "suspend", () => {
|
|
@@ -11656,7 +11646,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11656
11646
|
}), e(this, "processSample", (e) => {
|
|
11657
11647
|
var t;
|
|
11658
11648
|
if (!e.channelId) throw Error("Sample must be assigned to a channel");
|
|
11659
|
-
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 -
|
|
11649
|
+
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - VS);
|
|
11660
11650
|
let n = e.type === "video" && e.isSync;
|
|
11661
11651
|
if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
|
|
11662
11652
|
let t = 2 ** 53 - 1;
|
|
@@ -11673,7 +11663,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11673
11663
|
this.currentChannelId || (this.currentChannelId = e);
|
|
11674
11664
|
let i = t.mediaType();
|
|
11675
11665
|
if (!i) throw Error("Fragment must have a media type");
|
|
11676
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
11666
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - VS);
|
|
11677
11667
|
let a = i === "video" && t.startsWithKeyframe();
|
|
11678
11668
|
if (i === "video" && (this.bFrameDetector.updateFromFragment({
|
|
11679
11669
|
type: i,
|
|
@@ -11798,7 +11788,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11798
11788
|
this.timeshiftDeferralStartedAt = void 0;
|
|
11799
11789
|
return;
|
|
11800
11790
|
}
|
|
11801
|
-
let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(
|
|
11791
|
+
let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(KS(i)).length;
|
|
11802
11792
|
if (a && this.state.timeshiftToleranceMultiplier > 2) this.logger.debug("Too many timeshifts within sliding window", {
|
|
11803
11793
|
timeshiftCooldownThreshold: i,
|
|
11804
11794
|
recentTimeshiftCount: a
|
|
@@ -11807,12 +11797,12 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11807
11797
|
if (e) {
|
|
11808
11798
|
var o, s;
|
|
11809
11799
|
let e = this.playbackSource.currentTime, t = (o = (s = this.bufferSource).getBufferedEndAt) == null ? void 0 : o.call(s, e), n = Math.max(0, (t == null ? e : t) - e);
|
|
11810
|
-
if (n - r < this.bufferSource.getTargetBufferTime() *
|
|
11800
|
+
if (n - r < this.bufferSource.getTargetBufferTime() * HS) {
|
|
11811
11801
|
let e = performance.now();
|
|
11812
11802
|
if (this.timeshiftDeferralStartedAt === void 0 && (this.timeshiftDeferralStartedAt = e, this.logger.debug("Deferring timeshift while buffered ahead is thin", {
|
|
11813
11803
|
drift: r,
|
|
11814
11804
|
bufferedAhead: n
|
|
11815
|
-
})), e - this.timeshiftDeferralStartedAt <
|
|
11805
|
+
})), e - this.timeshiftDeferralStartedAt < US) return;
|
|
11816
11806
|
}
|
|
11817
11807
|
this.timeshiftDeferralStartedAt !== void 0 && this.logger.debug("Releasing timeshift deferral", { deferredMs: performance.now() - this.timeshiftDeferralStartedAt });
|
|
11818
11808
|
}
|
|
@@ -11833,20 +11823,20 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11833
11823
|
let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
|
|
11834
11824
|
return this.shouldSeekAfterBuffering = n !== void 0, n;
|
|
11835
11825
|
}), e(this, "observePlayheadProgress", () => {
|
|
11836
|
-
let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek >
|
|
11826
|
+
let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > QS);
|
|
11837
11827
|
this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
|
|
11838
11828
|
}), e(this, "isPlayheadStuckInBuffer", () => {
|
|
11839
11829
|
var e, t;
|
|
11840
|
-
if (performance.now() - this.lastPlayheadProgressAt <
|
|
11830
|
+
if (performance.now() - this.lastPlayheadProgressAt < YS) return !1;
|
|
11841
11831
|
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
|
|
11842
|
-
return r !== void 0 && r - n >=
|
|
11832
|
+
return r !== void 0 && r - n >= XS;
|
|
11843
11833
|
}), e(this, "getRecoverySeekReason", () => {
|
|
11844
11834
|
if (this.needsMediaSourceRecovery) return "media source reopen";
|
|
11845
11835
|
if (this.shouldSeekWhileStuck) return "stuck in buffer";
|
|
11846
11836
|
if (this.shouldSeekAfterBuffering) return "buffering";
|
|
11847
11837
|
}), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 || !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildStuckInBufferSeekPlan", () => {
|
|
11848
11838
|
var e, t;
|
|
11849
|
-
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot,
|
|
11839
|
+
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, ZS);
|
|
11850
11840
|
if (r === void 0 || i >= r) return;
|
|
11851
11841
|
let a = this.findKeyframeCloseToTimestamp(i);
|
|
11852
11842
|
return {
|
|
@@ -11927,7 +11917,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11927
11917
|
if (r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), ht(this.driftSamples.items()) < this.currentTimeshiftToleranceMs() && (this.timeshiftDeferralStartedAt = void 0), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
|
|
11928
11918
|
let i = r ? t : ht(this.driftSamples.items());
|
|
11929
11919
|
if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
|
|
11930
|
-
let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(
|
|
11920
|
+
let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(KS(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
|
|
11931
11921
|
o && this.state.seekToleranceMultiplier > 2 && !r && !c ? this.logger.debug("Too many seek adjustments within sliding window", {
|
|
11932
11922
|
seekCooldownThreshold: a,
|
|
11933
11923
|
recentSeekCount: o
|
|
@@ -11945,9 +11935,9 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11945
11935
|
let t = this.playbackState === "buffering";
|
|
11946
11936
|
this.playbackState = e, e === "buffering" ? (t || (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1), (this.refreshRecoverySeekState() !== void 0 || this.shouldSeekWhileStuck) && this.onSync()) : (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags());
|
|
11947
11937
|
}), e(this, "onPageActive", (e) => {
|
|
11948
|
-
this.setSyncInterval(e ?
|
|
11938
|
+
this.setSyncInterval(e ? qS : JS), e && this.onSync();
|
|
11949
11939
|
}), e(this, "onPageShow", (e) => {
|
|
11950
|
-
e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ?
|
|
11940
|
+
e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? JS : qS), this.onSync());
|
|
11951
11941
|
}), e(this, "setSyncInterval", (e) => {
|
|
11952
11942
|
(this.syncInterval === void 0 || this.currentSyncIntervalMs !== e) && (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
|
|
11953
11943
|
}), e(this, "clearSyncInterval", () => {
|
|
@@ -11958,11 +11948,11 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
11958
11948
|
let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
|
|
11959
11949
|
if (t && r) return n;
|
|
11960
11950
|
}
|
|
11961
|
-
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot =
|
|
11962
|
-
seek: p({},
|
|
11963
|
-
timeshift: p({},
|
|
11964
|
-
playbackRate: p({},
|
|
11965
|
-
backoff: p({},
|
|
11951
|
+
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = GS(o), this.config = {
|
|
11952
|
+
seek: p({}, $S.seek),
|
|
11953
|
+
timeshift: p({}, $S.timeshift),
|
|
11954
|
+
playbackRate: p({}, $S.playbackRate),
|
|
11955
|
+
backoff: p({}, $S.backoff)
|
|
11966
11956
|
}, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
|
|
11967
11957
|
seekToleranceMultiplier: 1,
|
|
11968
11958
|
timeshiftToleranceMultiplier: 1
|
|
@@ -12020,9 +12010,9 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
|
|
|
12020
12010
|
return this.serverCurrentTime - this.playbackSource.currentTime;
|
|
12021
12011
|
}
|
|
12022
12012
|
};
|
|
12023
|
-
|
|
12013
|
+
BS = eC, e(eC, "create", (e, t, n, r, i, a = !0) => new BS(e, t, n, r, i, a));
|
|
12024
12014
|
// ../../libs/web-sdk/src/modules/TelemetryModule.ts
|
|
12025
|
-
var
|
|
12015
|
+
var tC, nC = {
|
|
12026
12016
|
enabled: !0,
|
|
12027
12017
|
interval: 3e4,
|
|
12028
12018
|
includeErrors: !0,
|
|
@@ -12031,11 +12021,11 @@ var nC, rC = {
|
|
|
12031
12021
|
maxRetries: 10,
|
|
12032
12022
|
maxErrorReports: 50,
|
|
12033
12023
|
maxEvents: 50
|
|
12034
|
-
},
|
|
12024
|
+
}, rC = (e, t) => p(p({}, t), {}, {
|
|
12035
12025
|
type: e,
|
|
12036
12026
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12037
12027
|
discriminator: "web"
|
|
12038
|
-
}),
|
|
12028
|
+
}), iC = class {
|
|
12039
12029
|
constructor(n, r, i, a) {
|
|
12040
12030
|
var o = this;
|
|
12041
12031
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new S(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
|
|
@@ -12052,7 +12042,7 @@ var nC, rC = {
|
|
|
12052
12042
|
initiator: "interval"
|
|
12053
12043
|
}, n = {}) => {
|
|
12054
12044
|
if (!this.options.includeStats) return;
|
|
12055
|
-
let r = this.parentContext.getStatistics(), i =
|
|
12045
|
+
let r = this.parentContext.getStatistics(), i = rC("stats", p(p(p({}, n), r), {}, {
|
|
12056
12046
|
isFinal: e,
|
|
12057
12047
|
initiator: t,
|
|
12058
12048
|
count: this.statsCount++
|
|
@@ -12060,7 +12050,7 @@ var nC, rC = {
|
|
|
12060
12050
|
this.unsentLines.push(i);
|
|
12061
12051
|
}), e(this, "addEvent", (e) => {
|
|
12062
12052
|
if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
|
|
12063
|
-
let t = this.parentContext.getStatistics(), n =
|
|
12053
|
+
let t = this.parentContext.getStatistics(), n = rC("event", p(p({}, t), e));
|
|
12064
12054
|
this.eventCount++, this.unsentLines.push(n);
|
|
12065
12055
|
}), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
|
|
12066
12056
|
var e = t(function* (e) {
|
|
@@ -12103,13 +12093,13 @@ var nC, rC = {
|
|
|
12103
12093
|
let { includeErrors: t, maxErrorReports: n } = this.options;
|
|
12104
12094
|
if (!(e instanceof M) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
|
|
12105
12095
|
let r = this.parentContext.getStatistics();
|
|
12106
|
-
this.unsentLines.push(
|
|
12107
|
-
}), this.logger = n, this.emitter = r, this.options = p(p({},
|
|
12096
|
+
this.unsentLines.push(rC("error", p(p({}, r), e.toStringifiable())));
|
|
12097
|
+
}), this.logger = n, this.emitter = r, this.options = p(p({}, nC), i), this.parentContext = a;
|
|
12108
12098
|
}
|
|
12109
12099
|
};
|
|
12110
|
-
|
|
12100
|
+
tC = iC, e(iC, "create", (e, t, n, r) => new tC(e, t, n, r));
|
|
12111
12101
|
// ../../libs/web-sdk/src/modules/UnpauseModule.ts
|
|
12112
|
-
var
|
|
12102
|
+
var aC, oC = class {
|
|
12113
12103
|
constructor(t, n, r) {
|
|
12114
12104
|
e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
|
|
12115
12105
|
this.timers.unload();
|
|
@@ -12118,9 +12108,9 @@ var oC, sC = class {
|
|
|
12118
12108
|
}), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
|
|
12119
12109
|
}
|
|
12120
12110
|
};
|
|
12121
|
-
|
|
12111
|
+
aC = oC, e(oC, "create", (e, t, n) => new aC(e, t, n));
|
|
12122
12112
|
// ../../libs/web-sdk/src/OptionsProvider.ts
|
|
12123
|
-
var
|
|
12113
|
+
var sC = [
|
|
12124
12114
|
"minBufferTime",
|
|
12125
12115
|
"maxBufferTime",
|
|
12126
12116
|
"burstEnabled",
|
|
@@ -12129,10 +12119,10 @@ var cC = [
|
|
|
12129
12119
|
"offscreenCanvasEnabled",
|
|
12130
12120
|
"videoCodecs"
|
|
12131
12121
|
];
|
|
12132
|
-
function
|
|
12133
|
-
return
|
|
12122
|
+
function cC(e) {
|
|
12123
|
+
return sC.includes(e);
|
|
12134
12124
|
}
|
|
12135
|
-
var
|
|
12125
|
+
var lC = class {
|
|
12136
12126
|
constructor(t) {
|
|
12137
12127
|
e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
|
|
12138
12128
|
}
|
|
@@ -12146,7 +12136,7 @@ var uC = class {
|
|
|
12146
12136
|
this.options[e] = t;
|
|
12147
12137
|
}
|
|
12148
12138
|
get(e, t) {
|
|
12149
|
-
if (t &&
|
|
12139
|
+
if (t && cC(e)) {
|
|
12150
12140
|
var n;
|
|
12151
12141
|
let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
12152
12142
|
if (r !== void 0) return r;
|
|
@@ -12157,7 +12147,7 @@ var uC = class {
|
|
|
12157
12147
|
var n;
|
|
12158
12148
|
return (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
12159
12149
|
}
|
|
12160
|
-
},
|
|
12150
|
+
}, uC = 6, dC = (e) => {
|
|
12161
12151
|
let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
|
|
12162
12152
|
var i, a;
|
|
12163
12153
|
if (e.flags && Gs(e.flags)) {
|
|
@@ -12169,7 +12159,7 @@ var uC = class {
|
|
|
12169
12159
|
return u > 0 && (r = u), p(p({}, e), {}, { duration: u > 0 ? u : r });
|
|
12170
12160
|
};
|
|
12171
12161
|
return (e, n = !1) => {
|
|
12172
|
-
if (e.flags && Gs(e.flags) && n && (i = !i), !(n && t.length <
|
|
12162
|
+
if (e.flags && Gs(e.flags) && n && (i = !i), !(n && t.length < uC && i) && t.length > 0) {
|
|
12173
12163
|
i = !1;
|
|
12174
12164
|
let n = e;
|
|
12175
12165
|
for (let e = t.length - 1; e > 0; e--) {
|
|
@@ -12182,13 +12172,13 @@ var uC = class {
|
|
|
12182
12172
|
}
|
|
12183
12173
|
return t.push(e), [];
|
|
12184
12174
|
};
|
|
12185
|
-
},
|
|
12175
|
+
}, fC = ["mse", "wasm"], pC = (e) => e == null ? fC : e, mC = (e) => {
|
|
12186
12176
|
if (!e) return !1;
|
|
12187
12177
|
let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
|
|
12188
12178
|
return !!(t || n);
|
|
12189
|
-
},
|
|
12190
|
-
if (
|
|
12191
|
-
let r =
|
|
12179
|
+
}, hC = (e, t, n) => {
|
|
12180
|
+
if (mC(n)) return "mse";
|
|
12181
|
+
let r = pC(e);
|
|
12192
12182
|
for (let e of r) switch (e) {
|
|
12193
12183
|
case "mse":
|
|
12194
12184
|
if (t) return "mse";
|
|
@@ -12199,7 +12189,7 @@ var uC = class {
|
|
|
12199
12189
|
case "wasm": return "wasm";
|
|
12200
12190
|
}
|
|
12201
12191
|
return "wasm";
|
|
12202
|
-
},
|
|
12192
|
+
}, gC = (e, t, n) => {
|
|
12203
12193
|
if (cn(t)) return p(p({}, e), {}, {
|
|
12204
12194
|
type: "video",
|
|
12205
12195
|
codec: t.codec,
|
|
@@ -12220,12 +12210,12 @@ var uC = class {
|
|
|
12220
12210
|
data: e.payload,
|
|
12221
12211
|
duration: 0
|
|
12222
12212
|
});
|
|
12223
|
-
},
|
|
12213
|
+
}, _C = ({ average: e, last: t, max: n, min: r }) => ({
|
|
12224
12214
|
average: Math.round(e),
|
|
12225
12215
|
last: Math.round(t),
|
|
12226
12216
|
max: Math.round(n),
|
|
12227
12217
|
min: Math.round(r)
|
|
12228
|
-
}),
|
|
12218
|
+
}), vC = [
|
|
12229
12219
|
"timeSpentBuffering",
|
|
12230
12220
|
"timePerBufferingEvent",
|
|
12231
12221
|
"drift",
|
|
@@ -12237,24 +12227,24 @@ var uC = class {
|
|
|
12237
12227
|
"videoKeyframeIntervalMs",
|
|
12238
12228
|
"timeToConnected",
|
|
12239
12229
|
"mediaSourceOpenTime"
|
|
12240
|
-
],
|
|
12230
|
+
], yC = [
|
|
12241
12231
|
"videoDecodeTime",
|
|
12242
12232
|
"audioDecodeTime",
|
|
12243
12233
|
"videoTransportTime",
|
|
12244
12234
|
"rtt"
|
|
12245
|
-
],
|
|
12235
|
+
], bC = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, xC = (e) => {
|
|
12246
12236
|
let t = p({}, e);
|
|
12247
|
-
for (let e of
|
|
12237
|
+
for (let e of vC) {
|
|
12248
12238
|
let n = t[e];
|
|
12249
12239
|
typeof n == "number" && (t[e] = Math.round(n));
|
|
12250
12240
|
}
|
|
12251
|
-
for (let e of
|
|
12241
|
+
for (let e of yC) {
|
|
12252
12242
|
let n = t[e];
|
|
12253
|
-
|
|
12243
|
+
bC(n) && (t[e] = _C(n));
|
|
12254
12244
|
}
|
|
12255
12245
|
return t;
|
|
12256
|
-
},
|
|
12257
|
-
if (!
|
|
12246
|
+
}, SC = (e, t) => e && typeof e == "object" && t in e, CC = (e) => !(typeof e != "object" || !SC(e, "channelId") || typeof e.channelId != "string" || !SC(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), wC = (e) => {
|
|
12247
|
+
if (!CC(e)) throw new M("Invalid options", {
|
|
12258
12248
|
isFatal: !0,
|
|
12259
12249
|
code: "invalid_options"
|
|
12260
12250
|
});
|
|
@@ -12263,20 +12253,20 @@ var uC = class {
|
|
|
12263
12253
|
let n = t;
|
|
12264
12254
|
n[e] === void 0 && delete n[e];
|
|
12265
12255
|
}), t;
|
|
12266
|
-
},
|
|
12256
|
+
}, TC = (e) => {
|
|
12267
12257
|
if (typeof e != "object" || !e) throw Error("not an object");
|
|
12268
12258
|
if (!("video" in e)) throw Error("missing video in subscription");
|
|
12269
12259
|
if (!("audio" in e)) throw Error("missing audio in subscription");
|
|
12270
12260
|
if (!("channelId" in e)) throw Error("missing channelId");
|
|
12271
12261
|
return !0;
|
|
12272
|
-
},
|
|
12262
|
+
}, EC = (e) => {
|
|
12273
12263
|
switch (e) {
|
|
12274
12264
|
case "opus": return "opus";
|
|
12275
12265
|
case "aac": return "mp4a.40.2";
|
|
12276
12266
|
case "mp3": return "mp3";
|
|
12277
12267
|
default: throw Error(`Unsupported audio codec: ${e}`);
|
|
12278
12268
|
}
|
|
12279
|
-
},
|
|
12269
|
+
}, DC = class {
|
|
12280
12270
|
constructor(n) {
|
|
12281
12271
|
var r = this;
|
|
12282
12272
|
e(this, "logger", void 0), e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
|
|
@@ -12307,7 +12297,7 @@ var uC = class {
|
|
|
12307
12297
|
if (typeof AudioDecoder > "u") return !1;
|
|
12308
12298
|
let n = AudioDecoder.isConfigSupported;
|
|
12309
12299
|
if (typeof n != "function") return !0;
|
|
12310
|
-
let i = (t = e.codecString) == null ?
|
|
12300
|
+
let i = (t = e.codecString) == null ? EC(e.codec) : t, a = `audio|${i}|${e.sampleRate}|${e.channels}`, o = e.codec === "aac" ? Ai(e.channels, e.sampleRate) : e.codec === "opus" ? Ws(e.channels, e.sampleRate) : void 0;
|
|
12311
12301
|
return r.check(a, () => n({
|
|
12312
12302
|
codec: i,
|
|
12313
12303
|
sampleRate: e.sampleRate,
|
|
@@ -12337,7 +12327,7 @@ var uC = class {
|
|
|
12337
12327
|
return this.inFlight.set(e, o), o;
|
|
12338
12328
|
}), this.logger = n;
|
|
12339
12329
|
}
|
|
12340
|
-
},
|
|
12330
|
+
}, OC = 1e4, kC = 300, AC = 3e3, jC = 1e4, MC = 250, NC = 921600, PC = /* @__PURE__ */ new WeakMap(), FC = /* @__PURE__ */ new WeakMap(), IC = /* @__PURE__ */ new WeakMap(), LC = /* @__PURE__ */ new WeakMap(), RC = class r extends s {
|
|
12341
12331
|
handleListenerError(e, t) {
|
|
12342
12332
|
let n = Object.assign(/* @__PURE__ */ Error(`Listener for "${String(t)}" threw`), { cause: e });
|
|
12343
12333
|
setTimeout(() => {
|
|
@@ -12346,7 +12336,7 @@ var uC = class {
|
|
|
12346
12336
|
}
|
|
12347
12337
|
constructor(o) {
|
|
12348
12338
|
var l, u, f;
|
|
12349
|
-
super(), l = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", He()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new s()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", an()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "shortBurstRejoin", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new y(r.MAX_POOL_SIZE)), e(this, "userAgentInformation", new rn()), e(this, "encryptedMediaExtensions", void 0), c(this,
|
|
12339
|
+
super(), l = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", He()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new s()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", an()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "shortBurstRejoin", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new y(r.MAX_POOL_SIZE)), e(this, "userAgentInformation", new rn()), e(this, "encryptedMediaExtensions", void 0), c(this, PC, 0), c(this, FC, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new Cx()), e(this, "unextractableSamplesWarned", new Cx()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), c(this, IC, void 0), c(this, LC, void 0), e(this, "attach", (e) => {
|
|
12350
12340
|
var t;
|
|
12351
12341
|
(t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
|
|
12352
12342
|
}), e(this, "setElement", (e) => {
|
|
@@ -12438,7 +12428,7 @@ var uC = class {
|
|
|
12438
12428
|
video: p(p({}, t.video), n.video),
|
|
12439
12429
|
audio: p(p({}, t.audio), n.audio)
|
|
12440
12430
|
})), n.audio && this.modules.subscription.setAudioBitRate(n.audio.bitRate), !0);
|
|
12441
|
-
}), e(this, "joinBurstMs", (e) => this.options.get("burstEnabled", this.channelId) ? !this.shortBurstRejoin && this.burstFits(e) ? this.targetBufferTime : Math.min(
|
|
12431
|
+
}), e(this, "joinBurstMs", (e) => this.options.get("burstEnabled", this.channelId) ? !this.shortBurstRejoin && this.burstFits(e) ? this.targetBufferTime : Math.min(MC, this.targetBufferTime) : 0), e(this, "onPingTimeout", () => {
|
|
12442
12432
|
this.shortBurstRejoin = !0, this.lowerTargetForRejoin() && this.emitter.emit("adapted level");
|
|
12443
12433
|
}), e(this, "emitLanguagesIfChanged", () => {
|
|
12444
12434
|
let e = this.modules.renditions.getLanguages(), t = this.latestEmittedLanguages;
|
|
@@ -12446,20 +12436,20 @@ var uC = class {
|
|
|
12446
12436
|
}), e(this, "updateTextTracks", (e) => {
|
|
12447
12437
|
let t = e.filter((e) => e.codec === "webvtt");
|
|
12448
12438
|
t.forEach((e) => {
|
|
12449
|
-
if (!i(
|
|
12439
|
+
if (!i(FC, this).find((t) => t.language === e.language)) {
|
|
12450
12440
|
if (this.modules.canvasModule) {
|
|
12451
12441
|
let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
|
|
12452
|
-
i(
|
|
12442
|
+
i(FC, this).push(t);
|
|
12453
12443
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
12454
12444
|
let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
|
|
12455
|
-
i(
|
|
12445
|
+
i(FC, this).push(t);
|
|
12456
12446
|
}
|
|
12457
12447
|
}
|
|
12458
12448
|
});
|
|
12459
|
-
for (let e of i(
|
|
12449
|
+
for (let e of i(FC, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
|
|
12460
12450
|
this.emit("text tracks", this.textTracks);
|
|
12461
12451
|
}), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
|
|
12462
|
-
i(
|
|
12452
|
+
i(FC, this).forEach((t) => {
|
|
12463
12453
|
if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
|
|
12464
12454
|
});
|
|
12465
12455
|
}), e(this, "filterRenditions", function() {
|
|
@@ -12528,7 +12518,7 @@ var uC = class {
|
|
|
12528
12518
|
var e;
|
|
12529
12519
|
let t = this.modules.connection.linkQueue;
|
|
12530
12520
|
if (!t) return !1;
|
|
12531
|
-
let n = Math.max(this.targetBufferTime,
|
|
12521
|
+
let n = Math.max(this.targetBufferTime, AC), r = t.peak(n), i = performance.now() - ((e = this.modules.connection.lastConnectionTime) == null ? performance.now() : e), a = r === void 0 ? i < jC : !(r < kC);
|
|
12532
12522
|
return a && !this.upgradeHeld && this.logger.debug("Holding the upgrade while the link queues", {
|
|
12533
12523
|
linkQueuePeakMs: r === void 0 ? void 0 : Math.round(r),
|
|
12534
12524
|
windowMs: n
|
|
@@ -12633,8 +12623,8 @@ var uC = class {
|
|
|
12633
12623
|
u = void 0, d = void 0, l.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
|
|
12634
12624
|
}
|
|
12635
12625
|
else o && l.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
|
|
12636
|
-
let f = l.capturesCanvasOnWebKit(u), p = yield
|
|
12637
|
-
if (h instanceof
|
|
12626
|
+
let f = l.capturesCanvasOnWebKit(u), p = yield Px.create(l.emitter, l.logger.createContext("DecoderModule"), l.options.get("logLevel"), n, l.playbackSource, l.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = l.modules.canvasModule;
|
|
12627
|
+
if (h instanceof rS) {
|
|
12638
12628
|
if (m === "OffscreenCanvas" && d) {
|
|
12639
12629
|
h.setVideoRenderingEnabled(!1);
|
|
12640
12630
|
let e = l.element;
|
|
@@ -12647,11 +12637,11 @@ var uC = class {
|
|
|
12647
12637
|
t.parentElement && t.parentElement.replaceChild(e, t), l.setElement(e);
|
|
12648
12638
|
}
|
|
12649
12639
|
}
|
|
12650
|
-
} else h instanceof
|
|
12640
|
+
} else h instanceof uS && (h.setBackgroundPlaybackEnabled(l.isBackgroundPlayEnabled(l.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), l.offscreenCanvasElement = d, f && l.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), l.offscreenCanvasElement = void 0));
|
|
12651
12641
|
(e = l.modules.decoder) == null || e.unload(), l.modules.decoder = p, l.isHiddenWithBackgroundPlayback() && l.modules.decoder.enableBackgroundTimers(), l.modules.decoder.setVideoRenderingEnabled(l.isVideoOnScreen()), l.modules.decoder.load(), l.setupOffscreenSubtitleRouting();
|
|
12652
|
-
})), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof
|
|
12642
|
+
})), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof uS), e(this, "connectWebKitVideoOutput", (e, t) => {
|
|
12653
12643
|
let n = () => {
|
|
12654
|
-
t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(
|
|
12644
|
+
t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(NC);
|
|
12655
12645
|
};
|
|
12656
12646
|
e.onVideoTrackLost((e) => {
|
|
12657
12647
|
this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
|
|
@@ -12659,7 +12649,7 @@ var uC = class {
|
|
|
12659
12649
|
let r = e.videoTrack;
|
|
12660
12650
|
r ? t.setVideoTrack(r) : n();
|
|
12661
12651
|
}), e(this, "setupOffscreenSubtitleRouting", () => {
|
|
12662
|
-
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof
|
|
12652
|
+
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof uS) return;
|
|
12663
12653
|
let e = this.modules.decoder, t = this.modules.canvasModule;
|
|
12664
12654
|
if (!t) return;
|
|
12665
12655
|
let n = !1;
|
|
@@ -12697,7 +12687,7 @@ var uC = class {
|
|
|
12697
12687
|
this.clearVisiblePauseDisconnect(), this.isUserPaused = !1, this.requestAudioSessionOnce(), this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), r.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && this.playbackSource.isActivated && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play(), this.isHiddenWithBackgroundPlayback() && this.scheduleInactivityDisconnect();
|
|
12698
12688
|
}), e(this, "getStatistics", () => {
|
|
12699
12689
|
let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? p(p({}, e), t.getStatistics()) : e, this.getRuntimeInfo()), t = Math.round(this.timeActive > 0 ? (e.bytesReceived || 0) * 8 / (this.timeActive / 1e3) : 0), n = this.uptime / 36e5, r = Math.max(0, (e.connectCount || 0) - 1), i = n > 0 ? r / n : 0, a = this.timeActive / 6e4, o = Math.max(a, 1), s = a > 0 ? (e.seekAdjustmentCount || 0) / o : 0, c = a > 0 ? (e.timeshiftAdjustmentCount || 0) / o : 0;
|
|
12700
|
-
return
|
|
12690
|
+
return xC(p(p({}, e), {}, {
|
|
12701
12691
|
averageBitRate: t,
|
|
12702
12692
|
reconnectsPerHour: i,
|
|
12703
12693
|
seekAdjustmentsPerMinute: s,
|
|
@@ -12706,7 +12696,7 @@ var uC = class {
|
|
|
12706
12696
|
}), e(this, "resetModules", () => {
|
|
12707
12697
|
Object.values(this.modules).forEach((e) => {
|
|
12708
12698
|
e && "reset" in e && e.reset();
|
|
12709
|
-
}), this.playbackSource instanceof yc && this.modules.adaptivity.holdReconnect(
|
|
12699
|
+
}), this.playbackSource instanceof yc && this.modules.adaptivity.holdReconnect(OC), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
12710
12700
|
}), e(this, "disconnectForInactivePage", (e) => {
|
|
12711
12701
|
if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
|
|
12712
12702
|
var t;
|
|
@@ -12733,10 +12723,10 @@ var uC = class {
|
|
|
12733
12723
|
e && "unsuspend" in e && e.unsuspend();
|
|
12734
12724
|
});
|
|
12735
12725
|
}), e(this, "getRuntimeInfo", () => {
|
|
12736
|
-
let e = this.modules.canvasModule instanceof
|
|
12726
|
+
let e = this.modules.canvasModule instanceof uS || void 0;
|
|
12737
12727
|
return p({
|
|
12738
12728
|
uptime: this.uptime,
|
|
12739
|
-
version: "4.8.2-
|
|
12729
|
+
version: "4.8.2-29-g2c54a2bf",
|
|
12740
12730
|
clientId: this.clientId,
|
|
12741
12731
|
sessionId: this.sessionId,
|
|
12742
12732
|
channelId: this.channelId,
|
|
@@ -12783,7 +12773,7 @@ var uC = class {
|
|
|
12783
12773
|
if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
|
|
12784
12774
|
let t = (e = this.modules) == null ? void 0 : e.decoder;
|
|
12785
12775
|
return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
|
|
12786
|
-
}), this.options = new
|
|
12776
|
+
}), this.options = new lC(p(p({}, nr), wC(o))), o.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
12787
12777
|
let m = {
|
|
12788
12778
|
channelId: this.options.get("channelId"),
|
|
12789
12779
|
audio: {
|
|
@@ -12796,14 +12786,14 @@ var uC = class {
|
|
|
12796
12786
|
height: this.options.get("maxSize").height
|
|
12797
12787
|
}
|
|
12798
12788
|
}, h = a.get();
|
|
12799
|
-
h.setLevel(this.options.get("logLevel")), h.setDebug(!1), this.logger = h, this.webCodecsRenditionSupport = new
|
|
12789
|
+
h.setLevel(this.options.get("logLevel")), h.setDebug(!1), this.logger = h, this.webCodecsRenditionSupport = new DC(h), o.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
|
|
12800
12790
|
let g = (u = o.streamToMediaElementEnabled) == null ? o.iosMediaElementEnabled : u;
|
|
12801
12791
|
g !== void 0 && (this.options.set("streamToMediaElementEnabled", g), this.options.set("iosMediaElementEnabled", g)), o.iosBackgroundPlayEnabled !== void 0 && this.logger.warn("Option iosBackgroundPlayEnabled is deprecated and will be removed in a future release. Use backgroundPlayEnabled instead.");
|
|
12802
12792
|
let _ = (f = o.backgroundPlayEnabled) == null ? o.iosBackgroundPlayEnabled : f;
|
|
12803
12793
|
_ !== void 0 && (this.options.set("backgroundPlayEnabled", _), this.options.set("iosBackgroundPlayEnabled", _));
|
|
12804
12794
|
let v = o.mseEnabled !== void 0, b = o.decoders !== void 0;
|
|
12805
12795
|
v && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), v && !b && o.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
|
|
12806
|
-
let x =
|
|
12796
|
+
let x = ES.create(this.emitter, this.logger.createContext("PictureInPictureModule")), S = this.options.get("mediaSessionEnabled") ? cS.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
|
|
12807
12797
|
metadata: this.options.get("mediaSessionMetadata"),
|
|
12808
12798
|
decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : Hc.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
|
|
12809
12799
|
isMuted: () => this.playbackSource.userMuted,
|
|
@@ -12814,12 +12804,12 @@ var uC = class {
|
|
|
12814
12804
|
holdDecoyWhilePaused: this.holdsDecoyWhilePaused(),
|
|
12815
12805
|
keepDecoyWhenMuted: this.isWebKitCanvasPath(),
|
|
12816
12806
|
pauseMeansMute: !this.options.get("pauseSupportEnabled")
|
|
12817
|
-
}) : void 0, C = j.create(), te =
|
|
12807
|
+
}) : void 0, C = j.create(), te = Ix.create(this.emitter), ne = hx.create(this.emitter, this.logger.createContext("ConnectionModule"), {
|
|
12818
12808
|
reconnectHandler: this.options.get("reconnectHandler"),
|
|
12819
12809
|
options: this.options,
|
|
12820
12810
|
onConnectInfo: this.onConnectInfo,
|
|
12821
12811
|
documentState: te
|
|
12822
|
-
}), w =
|
|
12812
|
+
}), w = Kv.create(this.logger.createContext("SubscriptionModule"), this.emitter, m), T = RS.create(this.emitter, w), re = OS.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), ie = IS.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), T, re);
|
|
12823
12813
|
this.encryptedMediaExtensions = new bi(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), o.drm), this.drm = {
|
|
12824
12814
|
setHeaders: (e) => {
|
|
12825
12815
|
this.encryptedMediaExtensions.headers = e;
|
|
@@ -12838,9 +12828,9 @@ var uC = class {
|
|
|
12838
12828
|
logger: this.logger.createContext("MediaElement"),
|
|
12839
12829
|
poster: ae
|
|
12840
12830
|
});
|
|
12841
|
-
e.on("buffer state", (e) => this.onMediaElementBufferState(e, oe)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, bi.isSupported() && this.encryptedMediaExtensions.attach(e.element), oe =
|
|
12831
|
+
e.on("buffer state", (e) => this.onMediaElementBufferState(e, oe)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, bi.isSupported() && this.encryptedMediaExtensions.attach(e.element), oe = hS.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (se = oC.create(this.logger.createContext("UnpauseModule"), [e], te)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
|
|
12842
12832
|
} else if (this.streamsToMediaElement()) {
|
|
12843
|
-
let e =
|
|
12833
|
+
let e = uS.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
|
|
12844
12834
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
12845
12835
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
12846
12836
|
volume: this.options.get("volume"),
|
|
@@ -12852,10 +12842,10 @@ var uC = class {
|
|
|
12852
12842
|
}), t = e.element();
|
|
12853
12843
|
this.element = t.element, this.playbackSource = e, ce = e;
|
|
12854
12844
|
let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
|
|
12855
|
-
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (se =
|
|
12845
|
+
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (se = oC.create(this.logger.createContext("UnpauseModule"), e.elements(), te));
|
|
12856
12846
|
} else {
|
|
12857
12847
|
let e;
|
|
12858
|
-
e =
|
|
12848
|
+
e = rS.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
|
|
12859
12849
|
this.setElement(e.element());
|
|
12860
12850
|
}, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, ce = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new oc());
|
|
12861
12851
|
}
|
|
@@ -12873,7 +12863,7 @@ var uC = class {
|
|
|
12873
12863
|
getTargetBufferTime: () => re.getTargetBufferTime(),
|
|
12874
12864
|
getNextBufferedRangeStart: oe ? (e) => oe.getNextBufferedRangeStart(e) : void 0,
|
|
12875
12865
|
getBufferedEndAt: oe ? (e) => oe.getBufferedEndAt(e) : void 0
|
|
12876
|
-
}, de =
|
|
12866
|
+
}, de = eC.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, D, ue, le), fe = Hx.create(this.logger.createContext("JitterModule")), pe = Tc.create(this.emitter), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), he = new URL("/telemetry", me).toString(), O = iC.create(this.logger.createContext("TelemetryModule"), this.emitter, {
|
|
12877
12867
|
url: he,
|
|
12878
12868
|
enabled: this.options.get("telemetryEnabled"),
|
|
12879
12869
|
includeStats: !1,
|
|
@@ -12887,8 +12877,8 @@ var uC = class {
|
|
|
12887
12877
|
}),
|
|
12888
12878
|
incomingData: pe,
|
|
12889
12879
|
adaptivity: Ic.create(this.emitter, this.logger.createContext("AdaptivityModule"), ie, pe, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
|
|
12890
|
-
constraintCap:
|
|
12891
|
-
event:
|
|
12880
|
+
constraintCap: bx.create(this.emitter, this.element, T, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
|
|
12881
|
+
event: zx.create(this.emitter, this.logger.createContext("EventModule"), de),
|
|
12892
12882
|
sync: de,
|
|
12893
12883
|
jitter: fe,
|
|
12894
12884
|
documentState: te,
|
|
@@ -12957,7 +12947,7 @@ var uC = class {
|
|
|
12957
12947
|
let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
|
|
12958
12948
|
if (e.telemetry) {
|
|
12959
12949
|
var i;
|
|
12960
|
-
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry =
|
|
12950
|
+
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = iC.create(this.logger.createContext("TelemetryModule"), this.emitter, p(p({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
|
|
12961
12951
|
}
|
|
12962
12952
|
}), this.emitter.on("adapt level", (e) => {
|
|
12963
12953
|
let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
|
|
@@ -13000,8 +12990,8 @@ var uC = class {
|
|
|
13000
12990
|
audio: p(p({}, this.targetSubscription.audio), f == null ? void 0 : f.audio)
|
|
13001
12991
|
})), this.emitter.emit("adapted level");
|
|
13002
12992
|
}), this.emitter.on("ping timeout", this.onPingTimeout), this.emitter.on("text track data", (e) => {
|
|
13003
|
-
let t = i(
|
|
13004
|
-
if (n(
|
|
12993
|
+
let t = i(FC, this).find((t) => t.language === e.language), r = this.modules.sync.getTimeshiftOffset() / 1e3, a = r - i(PC, this);
|
|
12994
|
+
if (n(PC, this, r), t) {
|
|
13005
12995
|
if (t.cues) for (let e of t.cues) e.startTime -= a, e.endTime -= a;
|
|
13006
12996
|
for (let n of e.cues) {
|
|
13007
12997
|
let e = new VTTCue(n.startTime - r, n.endTime - r, n.text);
|
|
@@ -13019,7 +13009,7 @@ var uC = class {
|
|
|
13019
13009
|
case "renditions": {
|
|
13020
13010
|
var o;
|
|
13021
13011
|
this.updateTextTracks(t.renditions);
|
|
13022
|
-
let e = r.channelId, s = JSON.stringify(t.renditions), c = ((o = i(
|
|
13012
|
+
let e = r.channelId, s = JSON.stringify(t.renditions), c = ((o = i(IC, this)) == null ? void 0 : o.sessionId) === a ? i(IC, this) : void 0, l = i(LC, this);
|
|
13023
13013
|
if (!c && l && l.sessionId === a && l.channelId === e && l.table === s) {
|
|
13024
13014
|
this.emit("rendition levels", this.modules.renditions.getRenditionLevels());
|
|
13025
13015
|
break;
|
|
@@ -13028,16 +13018,16 @@ var uC = class {
|
|
|
13028
13018
|
a === this.sessionId && ("error" in t ? this.logger.warn("Failed to filter renditions, keeping the current ones", { error: t.error }) : (this.emitter.emit("renditions", {
|
|
13029
13019
|
renditions: t.renditions,
|
|
13030
13020
|
channelId: e
|
|
13031
|
-
}), n(
|
|
13021
|
+
}), n(LC, this, t.allProbesAnswered ? {
|
|
13032
13022
|
sessionId: a,
|
|
13033
13023
|
channelId: e,
|
|
13034
13024
|
table: s
|
|
13035
13025
|
} : void 0), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged()));
|
|
13036
13026
|
}).finally(() => {
|
|
13037
13027
|
var e;
|
|
13038
|
-
((e = i(
|
|
13028
|
+
((e = i(IC, this)) == null ? void 0 : e.promise) === u && n(IC, this, void 0);
|
|
13039
13029
|
});
|
|
13040
|
-
n(
|
|
13030
|
+
n(IC, this, {
|
|
13041
13031
|
sessionId: a,
|
|
13042
13032
|
promise: u
|
|
13043
13033
|
});
|
|
@@ -13046,7 +13036,7 @@ var uC = class {
|
|
|
13046
13036
|
case "subscription changed":
|
|
13047
13037
|
var s;
|
|
13048
13038
|
try {
|
|
13049
|
-
|
|
13039
|
+
TC(t.subscription);
|
|
13050
13040
|
} catch (e) {
|
|
13051
13041
|
this.emitter.emit("error", new M("Subscription failed validation", {
|
|
13052
13042
|
source: e instanceof Error ? e : void 0,
|
|
@@ -13166,7 +13156,7 @@ var uC = class {
|
|
|
13166
13156
|
_e && this.attach(_e), this.logger.info("Created Vindral instance", { options: this.options });
|
|
13167
13157
|
let ve = function() {
|
|
13168
13158
|
var e = t(function* (e) {
|
|
13169
|
-
let t = e.channelId, r = l.sessionId, a = i(
|
|
13159
|
+
let t = e.channelId, r = l.sessionId, a = i(IC, l);
|
|
13170
13160
|
if (a && a.sessionId === r && (yield a.promise, r !== l.sessionId)) return;
|
|
13171
13161
|
let o = l.modules.renditions.getRendition(e.renditionId, t);
|
|
13172
13162
|
if (!qs(e.flags)) {
|
|
@@ -13181,8 +13171,8 @@ var uC = class {
|
|
|
13181
13171
|
} catch (e) {
|
|
13182
13172
|
l.logger.warn("failed to parse WebVTT segment, dropping it", e);
|
|
13183
13173
|
}
|
|
13184
|
-
let o = r / 1e3, s = i(
|
|
13185
|
-
if (n(
|
|
13174
|
+
let o = r / 1e3, s = i(FC, l).find((t) => t.language === e.language), c = o - i(PC, l);
|
|
13175
|
+
if (n(PC, l, o), s) {
|
|
13186
13176
|
if (s.cues) for (let e of s.cues) e.startTime -= c, e.endTime -= c;
|
|
13187
13177
|
for (let e of a) {
|
|
13188
13178
|
let t = new VTTCue(e.startTime - o, e.endTime - o, e.text);
|
|
@@ -13218,10 +13208,10 @@ var uC = class {
|
|
|
13218
13208
|
mimeType: a
|
|
13219
13209
|
}), l.emit("initialized media");
|
|
13220
13210
|
} else {
|
|
13221
|
-
let t =
|
|
13211
|
+
let t = gC(e, o, l.sizes.get(e.renditionId));
|
|
13222
13212
|
l.modules.jitter.recordSample(t);
|
|
13223
13213
|
let r = l.sampleProcessingSesssions.get(n);
|
|
13224
|
-
if (!r) r =
|
|
13214
|
+
if (!r) r = dC(l.modules.sync.processSample(t)), l.sampleProcessingSesssions.set(n, r);
|
|
13225
13215
|
else {
|
|
13226
13216
|
let e = l.willUseMediaSource() && l.isSwitchingRenditionLevel && t.type === "video", n = r(l.modules.sync.processSample(t), e), i = t;
|
|
13227
13217
|
n.forEach((e) => {
|
|
@@ -13324,7 +13314,7 @@ var uC = class {
|
|
|
13324
13314
|
e !== void 0 && t.length > 0 && !t.includes(e) ? this.logger.warn(`Language "${e}" is not available. Available languages: ${t.join(", ")}`) : (this.modules.subscription.setLanguage(e), this.modules.qualityOfService.restartStallClock(), this.alignSizeAndBitRate(this.targetSubscription));
|
|
13325
13315
|
}
|
|
13326
13316
|
set textTrack(e) {
|
|
13327
|
-
e !== this.textTrack && (i(
|
|
13317
|
+
e !== this.textTrack && (i(FC, this).forEach((t) => {
|
|
13328
13318
|
if (t.label === e) t.mode = "showing";
|
|
13329
13319
|
else {
|
|
13330
13320
|
if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
|
|
@@ -13333,11 +13323,11 @@ var uC = class {
|
|
|
13333
13323
|
}), this.emitter.emit("text track", e));
|
|
13334
13324
|
}
|
|
13335
13325
|
get textTracks() {
|
|
13336
|
-
return i(
|
|
13326
|
+
return i(FC, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
|
|
13337
13327
|
}
|
|
13338
13328
|
get textTrack() {
|
|
13339
13329
|
var e;
|
|
13340
|
-
return (e = i(
|
|
13330
|
+
return (e = i(FC, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
|
|
13341
13331
|
}
|
|
13342
13332
|
get channelId() {
|
|
13343
13333
|
var e, t;
|
|
@@ -13469,7 +13459,7 @@ var uC = class {
|
|
|
13469
13459
|
return this.modules.subscription.getTargetSubscription();
|
|
13470
13460
|
}
|
|
13471
13461
|
resolvedDecoder(e) {
|
|
13472
|
-
return
|
|
13462
|
+
return hC(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
|
|
13473
13463
|
}
|
|
13474
13464
|
usesSplitCanvasAudio() {
|
|
13475
13465
|
return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && dt(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
|
|
@@ -13509,5 +13499,5 @@ var uC = class {
|
|
|
13509
13499
|
return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
|
|
13510
13500
|
}
|
|
13511
13501
|
};
|
|
13512
|
-
e(
|
|
13513
|
-
export { ot as A, Je as C, st as D, lt as E, b as F, Ie as M, Fe as N, at as O, S as P, it as S, tt as T, k as _, jn as a, Ye as b, vn as c, mn as d, Tn as f, Wt as g, M as h, Ai as i, ut as j, nt as k, yn as l, bn as m,
|
|
13502
|
+
e(RC, "MAX_POOL_SIZE", 10), e(RC, "REMOVE_CUE_THRESHOLD", 1e4), e(RC, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 15e3), e(RC, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
|
|
13503
|
+
export { ot as A, Je as C, st as D, lt as E, b as F, Ie as M, Fe as N, at as O, S as P, it as S, tt as T, k as _, jn as a, Ye as b, vn as c, mn as d, Tn as f, Wt as g, M as h, Ai as i, ut as j, nt as k, yn as l, bn as m, EC as n, _n as o, xn as p, Ws as r, gn as s, RC as t, hn as u, Xe as v, Ze as w, Qe as x, $e as y };
|