@vindral/web-sdk 4.7.2-15-gf5e093ee → 4.7.2-17-g3c99bc71
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/{BjkoNfwT.js → 7wALr-wP.js} +864 -806
- package/{BK3DBk5v.js → B4-xdAhj.js} +1 -1
- package/core.js +1 -1
- package/legacy.es.js +717 -658
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.js +2 -2
- package/vindral-player-component.js +2 -2
|
@@ -6974,20 +6974,20 @@ function Oh(e) {
|
|
|
6974
6974
|
}
|
|
6975
6975
|
//#endregion
|
|
6976
6976
|
//#region ../../libs/voq/src/tracks/Track.ts
|
|
6977
|
-
var kh, Ah = 2e3, jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakMap(),
|
|
6977
|
+
var kh, Ah = 2e3, jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakMap(), Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakMap(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakSet();
|
|
6978
6978
|
kh = Symbol.asyncIterator;
|
|
6979
|
-
var
|
|
6979
|
+
var Gh = class e {
|
|
6980
6980
|
constructor(e, c) {
|
|
6981
6981
|
var l = this;
|
|
6982
|
-
x(this,
|
|
6982
|
+
x(this, X), i(this, jh, void 0), i(this, Mh, void 0), i(this, Nh, new r(100)), i(this, Ph, void 0), i(this, Fh, !1), i(this, Ih, void 0), i(this, Lh, void 0), i(this, Rh, !1), i(this, zh, /* @__PURE__ */ new Set()), i(this, Bh, !1), i(this, Vh, !1), i(this, Hh, !1), i(this, Uh, void 0), i(this, Wh, function() {
|
|
6983
6983
|
var e = t(function* (e) {
|
|
6984
6984
|
if (e === void 0) return s(jh, l).close();
|
|
6985
|
-
if (a(
|
|
6985
|
+
if (a(Fh, l, !0), s(Ph, l)) for (let t of s(Ph, l)) t > e && s(Ph, l).delete(t);
|
|
6986
6986
|
else {
|
|
6987
6987
|
let t = s(Nh, l).items().reduce((e, t) => e < t ? e : t, e);
|
|
6988
|
-
a(
|
|
6988
|
+
a(Ph, l, o(X, l, ig).call(l, t, e));
|
|
6989
6989
|
}
|
|
6990
|
-
o(
|
|
6990
|
+
o(X, l, Kh).call(l, !0);
|
|
6991
6991
|
});
|
|
6992
6992
|
return function(t) {
|
|
6993
6993
|
return e.apply(this, arguments);
|
|
@@ -6995,12 +6995,12 @@ var Wh = class e {
|
|
|
6995
6995
|
}()), a(jh, this, e), a(Mh, this, c), e.done().then(function() {
|
|
6996
6996
|
var e = t(function* (e) {
|
|
6997
6997
|
var t;
|
|
6998
|
-
return s(
|
|
6998
|
+
return s(Wh, l).call(l, (t = e.finalInfo) == null ? void 0 : t.group);
|
|
6999
6999
|
});
|
|
7000
7000
|
return function(t) {
|
|
7001
7001
|
return e.apply(this, arguments);
|
|
7002
7002
|
};
|
|
7003
|
-
}()).catch(n), a(
|
|
7003
|
+
}()).catch(n), a(Uh, this, e.groups());
|
|
7004
7004
|
}
|
|
7005
7005
|
static subscribe(n, r) {
|
|
7006
7006
|
return t(function* () {
|
|
@@ -7017,12 +7017,12 @@ var Wh = class e {
|
|
|
7017
7017
|
return s(Mh, this);
|
|
7018
7018
|
}
|
|
7019
7019
|
needsRenewal() {
|
|
7020
|
-
return s(jh, this).expiryState() === "active" && s(
|
|
7020
|
+
return s(jh, this).expiryState() === "active" && s(Ph, this) === void 0;
|
|
7021
7021
|
}
|
|
7022
7022
|
endOfTrack(e) {
|
|
7023
7023
|
var n = this;
|
|
7024
7024
|
return t(function* () {
|
|
7025
|
-
if (s(
|
|
7025
|
+
if (s(Fh, n)) return o(X, n, Xh).call(n, void 0, e);
|
|
7026
7026
|
let t = s(Nh, n).items().reduce((e, t) => e < t ? e : t, e);
|
|
7027
7027
|
return n.update(t, e);
|
|
7028
7028
|
})();
|
|
@@ -7030,7 +7030,7 @@ var Wh = class e {
|
|
|
7030
7030
|
update(e, n) {
|
|
7031
7031
|
var r = this;
|
|
7032
7032
|
return t(function* () {
|
|
7033
|
-
return s(
|
|
7033
|
+
return s(Fh, r) ? o(X, r, Xh).call(r, e, n) : (a(Ph, r, o(X, r, ig).call(r, e, n)), s(Ph, r).size === 0 && (yield s(jh, r).close()), s(jh, r).update(e, n));
|
|
7034
7034
|
})();
|
|
7035
7035
|
}
|
|
7036
7036
|
unsubscribe() {
|
|
@@ -7039,125 +7039,125 @@ var Wh = class e {
|
|
|
7039
7039
|
next() {
|
|
7040
7040
|
var e = this;
|
|
7041
7041
|
return t(function* () {
|
|
7042
|
-
a(
|
|
7042
|
+
a(Hh, e, !0), o(X, e, qh).call(e);
|
|
7043
7043
|
try {
|
|
7044
|
-
return yield o(
|
|
7044
|
+
return yield o(X, e, Qh).call(e);
|
|
7045
7045
|
} finally {
|
|
7046
|
-
a(
|
|
7046
|
+
a(Hh, e, !1), clearTimeout(s(Lh, e));
|
|
7047
7047
|
}
|
|
7048
7048
|
})();
|
|
7049
7049
|
}
|
|
7050
7050
|
return() {
|
|
7051
7051
|
var e;
|
|
7052
|
-
return (e = s(jh, this).close()) == null || e.catch(n), a(
|
|
7052
|
+
return (e = s(jh, this).close()) == null || e.catch(n), a(Bh, this, !0), o(X, this, Yh).call(this), o(X, this, ng).call(this), s(jh, this).return();
|
|
7053
7053
|
}
|
|
7054
7054
|
[kh]() {
|
|
7055
7055
|
return this;
|
|
7056
7056
|
}
|
|
7057
7057
|
};
|
|
7058
|
-
function
|
|
7058
|
+
function Kh(e) {
|
|
7059
7059
|
var t;
|
|
7060
|
-
s(
|
|
7061
|
-
}
|
|
7062
|
-
function Kh() {
|
|
7063
|
-
s(Bh, this) || !s(Ph, this) || !s(Vh, this) || (clearTimeout(s(Ih, this)), a(Ih, this, setTimeout(() => o(Z, this, qh).call(this), Ah)));
|
|
7060
|
+
s(Vh, this) || (((t = s(Ph, this)) == null ? void 0 : t.size) === 0 ? o(X, this, Jh).call(this) : e && o(X, this, qh).call(this));
|
|
7064
7061
|
}
|
|
7065
7062
|
function qh() {
|
|
7066
|
-
|
|
7063
|
+
s(Vh, this) || !s(Fh, this) || !s(Hh, this) || (clearTimeout(s(Lh, this)), a(Lh, this, setTimeout(() => o(X, this, Jh).call(this), Ah)));
|
|
7064
|
+
}
|
|
7065
|
+
function Jh() {
|
|
7066
|
+
if (o(X, this, Yh).call(this), o(X, this, ng).call(this), !s(Bh, this)) {
|
|
7067
7067
|
var e;
|
|
7068
7068
|
(e = s(jh, this).close()) == null || e.catch(n);
|
|
7069
7069
|
}
|
|
7070
7070
|
}
|
|
7071
|
-
function
|
|
7072
|
-
a(
|
|
7071
|
+
function Yh() {
|
|
7072
|
+
a(Vh, this, !0), clearTimeout(s(Lh, this));
|
|
7073
7073
|
}
|
|
7074
|
-
function
|
|
7074
|
+
function Xh(e, t) {
|
|
7075
7075
|
var n;
|
|
7076
|
-
let r = s(
|
|
7076
|
+
let r = s(Ih, this), i = {
|
|
7077
7077
|
startGroup: r && r.startGroup > (e == null ? 0n : e) ? r.startGroup : e == null ? 0n : e,
|
|
7078
7078
|
endGroup: r && r.endGroup < t ? r.endGroup : t
|
|
7079
7079
|
};
|
|
7080
|
-
a(
|
|
7081
|
-
for (let e of (n = s(
|
|
7080
|
+
a(Ih, this, i);
|
|
7081
|
+
for (let e of (n = s(Ph, this)) == null ? [] : n) if (!o(X, this, Zh).call(this, e)) {
|
|
7082
7082
|
var c;
|
|
7083
|
-
(c = s(
|
|
7083
|
+
(c = s(Ph, this)) == null || c.delete(e);
|
|
7084
7084
|
}
|
|
7085
|
-
o(
|
|
7085
|
+
o(X, this, Kh).call(this, !1);
|
|
7086
7086
|
}
|
|
7087
|
-
function
|
|
7088
|
-
let t = s(
|
|
7087
|
+
function Zh(e) {
|
|
7088
|
+
let t = s(Ih, this);
|
|
7089
7089
|
return !t || e >= t.startGroup && e <= t.endGroup;
|
|
7090
7090
|
}
|
|
7091
|
-
function
|
|
7091
|
+
function Qh() {
|
|
7092
7092
|
var e = this;
|
|
7093
7093
|
return t(function* () {
|
|
7094
7094
|
let t = !1;
|
|
7095
7095
|
for (;;) {
|
|
7096
|
-
if (s(
|
|
7096
|
+
if (s(Ph, e) && s(Ph, e).size === 0) return t ? o(X, e, $h).call(e) : {
|
|
7097
7097
|
done: !0,
|
|
7098
7098
|
value: void 0
|
|
7099
7099
|
};
|
|
7100
7100
|
let n;
|
|
7101
7101
|
try {
|
|
7102
|
-
n = yield o(
|
|
7102
|
+
n = yield o(X, e, tg).call(e, () => s(Uh, e).next());
|
|
7103
7103
|
} catch (n) {
|
|
7104
|
-
if (t) return o(
|
|
7104
|
+
if (t) return o(X, e, $h).call(e);
|
|
7105
7105
|
throw n;
|
|
7106
7106
|
}
|
|
7107
|
-
if (n === void 0) return o(
|
|
7107
|
+
if (n === void 0) return o(X, e, $h).call(e);
|
|
7108
7108
|
if (n.done) return n;
|
|
7109
|
-
if (!o(
|
|
7110
|
-
if (!(yield o(
|
|
7109
|
+
if (!o(X, e, Zh).call(e, n.value.groupId())) {
|
|
7110
|
+
if (!(yield o(X, e, eg).call(e, n.value))) return o(X, e, $h).call(e);
|
|
7111
7111
|
t = !0;
|
|
7112
7112
|
continue;
|
|
7113
7113
|
}
|
|
7114
|
-
return o(
|
|
7114
|
+
return o(X, e, rg).call(e, n);
|
|
7115
7115
|
}
|
|
7116
7116
|
})();
|
|
7117
7117
|
}
|
|
7118
|
-
function
|
|
7118
|
+
function $h() {
|
|
7119
7119
|
var e, t, r;
|
|
7120
|
-
return (e = s(
|
|
7120
|
+
return (e = s(Ph, this)) == null || e.clear(), o(X, this, Jh).call(this), (t = (r = s(Uh, this)).return) == null || (t = t.call(r)) == null || t.catch(n), {
|
|
7121
7121
|
done: !0,
|
|
7122
7122
|
value: void 0
|
|
7123
7123
|
};
|
|
7124
7124
|
}
|
|
7125
|
-
function
|
|
7125
|
+
function eg(e) {
|
|
7126
7126
|
var n = this;
|
|
7127
7127
|
return t(function* () {
|
|
7128
7128
|
var t;
|
|
7129
|
-
return s(
|
|
7129
|
+
return s(Bh, n) || (t = yield o(X, n, tg).call(n, () => {
|
|
7130
7130
|
var t, n;
|
|
7131
7131
|
return ((t = (n = e.return) == null ? void 0 : n.call(e)) == null ? Promise.resolve() : t).then(() => !0, () => !1);
|
|
7132
7132
|
})) == null ? !1 : t;
|
|
7133
7133
|
})();
|
|
7134
7134
|
}
|
|
7135
|
-
function
|
|
7135
|
+
function tg(e) {
|
|
7136
7136
|
var n = this;
|
|
7137
7137
|
return t(function* () {
|
|
7138
|
-
if (s(
|
|
7138
|
+
if (s(Rh, n)) return;
|
|
7139
7139
|
let t = e(), r, i = new Promise((e) => {
|
|
7140
7140
|
r = () => e(void 0);
|
|
7141
7141
|
});
|
|
7142
|
-
s(
|
|
7142
|
+
s(zh, n).add(r);
|
|
7143
7143
|
try {
|
|
7144
7144
|
return yield Promise.race([t, i]);
|
|
7145
7145
|
} finally {
|
|
7146
|
-
s(
|
|
7146
|
+
s(zh, n).delete(r);
|
|
7147
7147
|
}
|
|
7148
7148
|
})();
|
|
7149
7149
|
}
|
|
7150
|
-
function
|
|
7151
|
-
a(
|
|
7152
|
-
for (let e of s(
|
|
7153
|
-
s(
|
|
7150
|
+
function ng() {
|
|
7151
|
+
a(Rh, this, !0);
|
|
7152
|
+
for (let e of s(zh, this)) e();
|
|
7153
|
+
s(zh, this).clear();
|
|
7154
7154
|
}
|
|
7155
|
-
function
|
|
7155
|
+
function rg(e) {
|
|
7156
7156
|
var t;
|
|
7157
7157
|
let n = e.value.groupId();
|
|
7158
|
-
return (t = s(
|
|
7158
|
+
return (t = s(Ph, this)) != null && t.delete(n) && s(Fh, this) && o(X, this, Kh).call(this, !0), s(Nh, this).push(n), s(Mh, this) || a(Mh, this, n), a(Mh, this, s(Mh, this) < n ? n : s(Mh, this)), e;
|
|
7159
7159
|
}
|
|
7160
|
-
function
|
|
7160
|
+
function ig(e, t) {
|
|
7161
7161
|
let n = /* @__PURE__ */ new Set();
|
|
7162
7162
|
for (let r = e; r <= t; r++) n == null || n.add(r);
|
|
7163
7163
|
return s(Nh, this).items().forEach((e) => {
|
|
@@ -7166,7 +7166,7 @@ function rg(e, t) {
|
|
|
7166
7166
|
}
|
|
7167
7167
|
//#endregion
|
|
7168
7168
|
//#region \0@oxc-project+runtime@0.115.0/helpers/asyncGeneratorDelegate.js
|
|
7169
|
-
function
|
|
7169
|
+
function ag(e) {
|
|
7170
7170
|
var t = {}, n = !1;
|
|
7171
7171
|
function r(t, r) {
|
|
7172
7172
|
return n = !0, r = new Promise(function(n) {
|
|
@@ -7189,24 +7189,24 @@ function ig(e) {
|
|
|
7189
7189
|
}
|
|
7190
7190
|
//#endregion
|
|
7191
7191
|
//#region ../../libs/voq/src/tracks/Renewable.ts
|
|
7192
|
-
var
|
|
7193
|
-
|
|
7194
|
-
var
|
|
7192
|
+
var og, sg = /* @__PURE__ */ new WeakMap(), cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = /* @__PURE__ */ new WeakSet(), fg = /* @__PURE__ */ new WeakMap();
|
|
7193
|
+
og = Symbol.asyncIterator;
|
|
7194
|
+
var pg = class e {
|
|
7195
7195
|
constructor(e) {
|
|
7196
7196
|
var r = this;
|
|
7197
|
-
x(this,
|
|
7197
|
+
x(this, dg), i(this, sg, void 0), i(this, cg, void 0), i(this, lg, new fe(10)), i(this, ug, void 0), i(this, fg, function() {
|
|
7198
7198
|
var e = t(function* (e, t) {
|
|
7199
7199
|
try {
|
|
7200
7200
|
var i = hp();
|
|
7201
|
-
let a = i.u(yield s(
|
|
7201
|
+
let a = i.u(yield s(sg, r).lock()), c = { subscribeId: a.value.subscribeId() };
|
|
7202
7202
|
if (!a.value.needsRenewal()) {
|
|
7203
|
-
s(
|
|
7203
|
+
s(ug, r).debug("Subscription does not need renewal", c);
|
|
7204
7204
|
return;
|
|
7205
7205
|
}
|
|
7206
7206
|
let l = a.value.largestGroupId(), u = l !== void 0, d = new xh().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
|
|
7207
|
-
switch (c.largestGroupId = l, s(
|
|
7207
|
+
switch (c.largestGroupId = l, s(ug, r).debug("Renewing subscription", c), t.filterType.type) {
|
|
7208
7208
|
case "absolute-range":
|
|
7209
|
-
s(
|
|
7209
|
+
s(ug, r).debug("Absolute range is not renewed", c);
|
|
7210
7210
|
return;
|
|
7211
7211
|
case "absolute-start":
|
|
7212
7212
|
case "latest-group":
|
|
@@ -7217,9 +7217,9 @@ var fg = class e {
|
|
|
7217
7217
|
let f = d.build();
|
|
7218
7218
|
c.newTrack = f;
|
|
7219
7219
|
let [p] = yield Promise.all([e.subscribe(f), u ? a.value.update(l, l) : a.value.unsubscribe()]);
|
|
7220
|
-
p.done().then((e) => o(
|
|
7221
|
-
let m = new
|
|
7222
|
-
a.value = m, yield s(
|
|
7220
|
+
p.done().then((e) => o(dg, r, mg).call(r, p, e.finalInfo !== void 0)).catch(n), p.expiryNotification().then(() => s(fg, r).call(r, e, f)).catch(n);
|
|
7221
|
+
let m = new Gh(p, l);
|
|
7222
|
+
a.value = m, yield s(lg, r).push(m), s(ug, r).info("Subscription renewed", c);
|
|
7223
7223
|
} catch (e) {
|
|
7224
7224
|
i.e = e;
|
|
7225
7225
|
} finally {
|
|
@@ -7229,24 +7229,24 @@ var fg = class e {
|
|
|
7229
7229
|
return function(t, n) {
|
|
7230
7230
|
return e.apply(this, arguments);
|
|
7231
7231
|
};
|
|
7232
|
-
}()), a(
|
|
7232
|
+
}()), a(sg, this, new Lt(e)), a(cg, this, e), a(ug, this, b.get().createContext(`Renewable '${e.name()}'`));
|
|
7233
7233
|
}
|
|
7234
7234
|
static subscribe(r, i, a) {
|
|
7235
7235
|
return t(function* () {
|
|
7236
|
-
let t = a == null ? void 0 : a.params, c = a == null ? void 0 : a.largestGroupId, l = yield r.subscribe(i, t), u = new e(new
|
|
7237
|
-
return l.done().then((e) => o(
|
|
7236
|
+
let t = a == null ? void 0 : a.params, c = a == null ? void 0 : a.largestGroupId, l = yield r.subscribe(i, t), u = new e(new Gh(l, c));
|
|
7237
|
+
return l.done().then((e) => o(dg, u, mg).call(u, l, e.finalInfo !== void 0)).catch(n), l.expiryNotification().then(() => s(fg, u).call(u, r, i)).catch(n), u;
|
|
7238
7238
|
})();
|
|
7239
7239
|
}
|
|
7240
7240
|
largestGroupId() {
|
|
7241
|
-
return s(
|
|
7241
|
+
return s(sg, this).unsafeValue().largestGroupId();
|
|
7242
7242
|
}
|
|
7243
7243
|
update(e, n) {
|
|
7244
7244
|
var r = this;
|
|
7245
7245
|
return t(function* () {
|
|
7246
7246
|
try {
|
|
7247
7247
|
var t = hp();
|
|
7248
|
-
let i = t.u(yield s(
|
|
7249
|
-
return s(
|
|
7248
|
+
let i = t.u(yield s(sg, r).lock());
|
|
7249
|
+
return s(lg, r).close(), i.value.update(e, n);
|
|
7250
7250
|
} catch (e) {
|
|
7251
7251
|
t.e = e;
|
|
7252
7252
|
} finally {
|
|
@@ -7259,8 +7259,8 @@ var fg = class e {
|
|
|
7259
7259
|
return t(function* () {
|
|
7260
7260
|
try {
|
|
7261
7261
|
var t = hp();
|
|
7262
|
-
let r = t.u(yield s(
|
|
7263
|
-
return s(
|
|
7262
|
+
let r = t.u(yield s(sg, n).lock());
|
|
7263
|
+
return s(lg, n).close(), r.value.endOfTrack(e);
|
|
7264
7264
|
} catch (e) {
|
|
7265
7265
|
t.e = e;
|
|
7266
7266
|
} finally {
|
|
@@ -7273,8 +7273,8 @@ var fg = class e {
|
|
|
7273
7273
|
return t(function* () {
|
|
7274
7274
|
try {
|
|
7275
7275
|
var t = hp();
|
|
7276
|
-
let n = t.u(yield s(
|
|
7277
|
-
return s(
|
|
7276
|
+
let n = t.u(yield s(sg, e).lock());
|
|
7277
|
+
return s(lg, e).close(), n.value.unsubscribe();
|
|
7278
7278
|
} catch (e) {
|
|
7279
7279
|
t.e = e;
|
|
7280
7280
|
} finally {
|
|
@@ -7287,8 +7287,8 @@ var fg = class e {
|
|
|
7287
7287
|
return t(function* () {
|
|
7288
7288
|
try {
|
|
7289
7289
|
var t = hp();
|
|
7290
|
-
let n = t.u(yield s(
|
|
7291
|
-
return s(
|
|
7290
|
+
let n = t.u(yield s(sg, e).lock());
|
|
7291
|
+
return s(lg, e).close(), n.value.return();
|
|
7292
7292
|
} catch (e) {
|
|
7293
7293
|
t.e = e;
|
|
7294
7294
|
} finally {
|
|
@@ -7299,17 +7299,17 @@ var fg = class e {
|
|
|
7299
7299
|
next() {
|
|
7300
7300
|
var e = this;
|
|
7301
7301
|
return t(function* () {
|
|
7302
|
-
let t = yield s(
|
|
7302
|
+
let t = yield s(cg, e).next();
|
|
7303
7303
|
if (t.done) {
|
|
7304
7304
|
var n, r;
|
|
7305
|
-
yield (n = (r = s(
|
|
7306
|
-
let t = yield s(
|
|
7307
|
-
if (t) return a(
|
|
7305
|
+
yield (n = (r = s(cg, e)).return) == null ? void 0 : n.call(r);
|
|
7306
|
+
let t = yield s(lg, e).pop();
|
|
7307
|
+
if (t) return a(cg, e, t), e.next();
|
|
7308
7308
|
}
|
|
7309
7309
|
return t;
|
|
7310
7310
|
})();
|
|
7311
7311
|
}
|
|
7312
|
-
[
|
|
7312
|
+
[og]() {
|
|
7313
7313
|
return this;
|
|
7314
7314
|
}
|
|
7315
7315
|
objects() {
|
|
@@ -7319,7 +7319,7 @@ var fg = class e {
|
|
|
7319
7319
|
try {
|
|
7320
7320
|
for (var i = V(e), a; t = !(a = yield E(i.next())).done; t = !1) try {
|
|
7321
7321
|
var o = hp();
|
|
7322
|
-
yield*
|
|
7322
|
+
yield* ag(V(o.a(a.value)));
|
|
7323
7323
|
} catch (e) {
|
|
7324
7324
|
o.e = e;
|
|
7325
7325
|
} finally {
|
|
@@ -7337,19 +7337,19 @@ var fg = class e {
|
|
|
7337
7337
|
})();
|
|
7338
7338
|
}
|
|
7339
7339
|
};
|
|
7340
|
-
function
|
|
7340
|
+
function mg(e, n) {
|
|
7341
7341
|
var r = this;
|
|
7342
7342
|
return t(function* () {
|
|
7343
7343
|
if (e.unsubscribed() || e.endRequested()) {
|
|
7344
|
-
s(
|
|
7344
|
+
s(ug, r).info("Server initiated subscribe done but the subscription is already closing");
|
|
7345
7345
|
return;
|
|
7346
7346
|
}
|
|
7347
|
-
if (s(
|
|
7348
|
-
s(
|
|
7347
|
+
if (s(sg, r).unsafeValue().subscribeId() !== e.id) {
|
|
7348
|
+
s(ug, r).info("subscribeId mismatch - the subscription already has been renewed");
|
|
7349
7349
|
return;
|
|
7350
7350
|
}
|
|
7351
7351
|
if (n) {
|
|
7352
|
-
s(
|
|
7352
|
+
s(lg, r).close();
|
|
7353
7353
|
return;
|
|
7354
7354
|
}
|
|
7355
7355
|
return r.return();
|
|
@@ -7357,50 +7357,50 @@ function pg(e, n) {
|
|
|
7357
7357
|
}
|
|
7358
7358
|
//#endregion
|
|
7359
7359
|
//#region ../../libs/voq/src/tracks/Catalog.ts
|
|
7360
|
-
var
|
|
7361
|
-
function
|
|
7360
|
+
var hg = "catalog";
|
|
7361
|
+
function gg(e) {
|
|
7362
7362
|
let t = Oh(e.payload);
|
|
7363
7363
|
if (!Dh(t)) throw Error("unexpected catalog type");
|
|
7364
7364
|
return t;
|
|
7365
7365
|
}
|
|
7366
|
-
var
|
|
7366
|
+
var _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakMap(), xg = /* @__PURE__ */ new WeakSet(), Sg = class e {
|
|
7367
7367
|
constructor(e, t, r) {
|
|
7368
|
-
x(this,
|
|
7368
|
+
x(this, xg), i(this, _g, void 0), i(this, vg, void 0), i(this, yg, void 0), i(this, bg, void 0), a(vg, this, e), a(_g, this, t), a(yg, this, r), a(bg, this, o(xg, this, Cg).call(this)), this.closed().finally(() => s(_g, this).close()).catch(n);
|
|
7369
7369
|
}
|
|
7370
7370
|
catalog() {
|
|
7371
|
-
return s(
|
|
7371
|
+
return s(_g, this);
|
|
7372
7372
|
}
|
|
7373
7373
|
closed() {
|
|
7374
|
-
return s(
|
|
7374
|
+
return s(bg, this);
|
|
7375
7375
|
}
|
|
7376
7376
|
close() {
|
|
7377
7377
|
var e = this;
|
|
7378
7378
|
return t(function* () {
|
|
7379
|
-
return s(
|
|
7379
|
+
return s(_g, e).close(), (yield s(vg, e).promise).unsubscribe();
|
|
7380
7380
|
})();
|
|
7381
7381
|
}
|
|
7382
7382
|
static start(n, r) {
|
|
7383
7383
|
return t(function* () {
|
|
7384
|
-
let t = S.fromPromise(
|
|
7384
|
+
let t = S.fromPromise(pg.subscribe(n, new xh().name(r.catalogName || hg).groupOrder("ascending").build())), i = S.fromPromise(t.promise.then((e) => e.objects()));
|
|
7385
7385
|
if (r.catalog) return new e(t, new D(r.catalog), i);
|
|
7386
7386
|
let a = yield (yield i.promise).next();
|
|
7387
7387
|
if (!a.value) throw Error("No catalog found");
|
|
7388
|
-
return new e(t, new D(
|
|
7388
|
+
return new e(t, new D(gg(a.value)), i);
|
|
7389
7389
|
})();
|
|
7390
7390
|
}
|
|
7391
7391
|
};
|
|
7392
|
-
function
|
|
7392
|
+
function Cg() {
|
|
7393
7393
|
var e = this;
|
|
7394
7394
|
return t(function* () {
|
|
7395
|
-
let t = yield s(
|
|
7395
|
+
let t = yield s(yg, e).promise;
|
|
7396
7396
|
var n = !1, r = !1, i;
|
|
7397
7397
|
try {
|
|
7398
7398
|
for (var a = V(t), o; n = !(o = yield a.next()).done; n = !1) {
|
|
7399
7399
|
let t = o.value;
|
|
7400
7400
|
{
|
|
7401
7401
|
if (t.objectStatus !== B.Normal) continue;
|
|
7402
|
-
let n =
|
|
7403
|
-
s(
|
|
7402
|
+
let n = gg(t);
|
|
7403
|
+
s(_g, e).update(n);
|
|
7404
7404
|
}
|
|
7405
7405
|
}
|
|
7406
7406
|
} catch (e) {
|
|
@@ -7416,51 +7416,51 @@ function Sg() {
|
|
|
7416
7416
|
}
|
|
7417
7417
|
//#endregion
|
|
7418
7418
|
//#region ../../libs/voq/src/tracks/Cmaf.ts
|
|
7419
|
-
var
|
|
7420
|
-
|
|
7421
|
-
var
|
|
7419
|
+
var wg, Tg, Eg, Dg, Og, kg, Ag, jg, Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakSet();
|
|
7420
|
+
wg = kt(), Tg = Symbol.dispose;
|
|
7421
|
+
var Vg = class {
|
|
7422
7422
|
constructor(e, t) {
|
|
7423
|
-
x(this,
|
|
7423
|
+
x(this, Bg), i(this, Mg, void 0), i(this, Ng, void 0), i(this, Pg, void 0), i(this, Fg, void 0), i(this, Ig, void 0), i(this, Lg, void 0), i(this, Rg, void 0), i(this, zg, 0), a(Mg, this, e), a(Ng, this, t);
|
|
7424
7424
|
}
|
|
7425
7425
|
onFragment(e, t, n, r, i) {
|
|
7426
7426
|
var o;
|
|
7427
|
-
s(
|
|
7428
|
-
name: s(
|
|
7427
|
+
s(Pg, this) === void 0 && (a(Pg, this, e), a(Fg, this, t), a(Ig, this, n), a(Lg, this, r), s(Mg, this).debug("group start", {
|
|
7428
|
+
name: s(Ng, this).name,
|
|
7429
7429
|
groupId: e,
|
|
7430
7430
|
startTimeMs: r,
|
|
7431
7431
|
endTimeMs: i,
|
|
7432
7432
|
subscribeId: t,
|
|
7433
7433
|
mediaType: n,
|
|
7434
|
-
namespace: s(
|
|
7435
|
-
})), a(
|
|
7436
|
-
}
|
|
7437
|
-
[Cg]() {
|
|
7438
|
-
o(zg, this, Vg).call(this);
|
|
7434
|
+
namespace: s(Ng, this).namespace
|
|
7435
|
+
})), a(zg, this, (o = s(zg, this), o++, o)), a(Rg, this, i);
|
|
7439
7436
|
}
|
|
7440
7437
|
[wg]() {
|
|
7441
|
-
o(
|
|
7438
|
+
o(Bg, this, Hg).call(this);
|
|
7439
|
+
}
|
|
7440
|
+
[Tg]() {
|
|
7441
|
+
o(Bg, this, Hg).call(this);
|
|
7442
7442
|
}
|
|
7443
7443
|
};
|
|
7444
|
-
function
|
|
7445
|
-
s(
|
|
7446
|
-
name: s(
|
|
7447
|
-
groupId: s(
|
|
7448
|
-
startTimeMs: s(
|
|
7449
|
-
endTimeMs: s(
|
|
7450
|
-
durationMs: s(
|
|
7451
|
-
fragmentCount: s(
|
|
7452
|
-
subscribeId: s(
|
|
7453
|
-
mediaType: s(
|
|
7454
|
-
namespace: s(
|
|
7444
|
+
function Hg() {
|
|
7445
|
+
s(Pg, this) !== void 0 && s(Lg, this) !== void 0 && s(Rg, this) !== void 0 && s(Mg, this).debug("group end", {
|
|
7446
|
+
name: s(Ng, this).name,
|
|
7447
|
+
groupId: s(Pg, this),
|
|
7448
|
+
startTimeMs: s(Lg, this),
|
|
7449
|
+
endTimeMs: s(Rg, this),
|
|
7450
|
+
durationMs: s(Rg, this) - s(Lg, this),
|
|
7451
|
+
fragmentCount: s(zg, this),
|
|
7452
|
+
subscribeId: s(Fg, this),
|
|
7453
|
+
mediaType: s(Ig, this),
|
|
7454
|
+
namespace: s(Ng, this).namespace
|
|
7455
7455
|
});
|
|
7456
7456
|
}
|
|
7457
|
-
var
|
|
7458
|
-
|
|
7459
|
-
var
|
|
7457
|
+
var Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakSet();
|
|
7458
|
+
Eg = Symbol.asyncIterator, Dg = Ot(), Og = Symbol.asyncDispose;
|
|
7459
|
+
var Jg = class {
|
|
7460
7460
|
constructor(t, n, r, o) {
|
|
7461
|
-
x(this,
|
|
7461
|
+
x(this, qg), i(this, Ug, void 0), i(this, Wg, void 0), i(this, Gg, void 0), e(this, "track", void 0), i(this, Kg, b.get().createContext("CmafGroup")), this.track = o, a(Ug, this, r), a(Wg, this, t), a(Gg, this, n);
|
|
7462
7462
|
}
|
|
7463
|
-
[
|
|
7463
|
+
[Eg]() {
|
|
7464
7464
|
var e = this;
|
|
7465
7465
|
return zt(function* () {
|
|
7466
7466
|
try {
|
|
@@ -7468,18 +7468,18 @@ var qg = class {
|
|
|
7468
7468
|
let c = {
|
|
7469
7469
|
name: e.track.trackObject.name,
|
|
7470
7470
|
namespace: e.track.namespace
|
|
7471
|
-
}, l = t.u(new
|
|
7471
|
+
}, l = t.u(new Vg(s(Kg, e), c));
|
|
7472
7472
|
var n = !1, r = !1, i;
|
|
7473
7473
|
try {
|
|
7474
|
-
for (var a = V(s(
|
|
7474
|
+
for (var a = V(s(Wg, e)), o; n = !(o = yield E(a.next())).done; n = !1) {
|
|
7475
7475
|
let t = o.value;
|
|
7476
7476
|
{
|
|
7477
7477
|
if (t.objectStatus === B.EndOfTrackAndGroup && (yield E(e.track.endOfTrack(t.groupId))), t.objectStatus !== B.Normal) continue;
|
|
7478
|
-
let n = s(
|
|
7478
|
+
let n = s(Gg, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = s(Ug, e) / 1e3 * r;
|
|
7479
7479
|
n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - o);
|
|
7480
7480
|
let u = e.track.timestampRange();
|
|
7481
7481
|
if (u && i >= u[1]) break;
|
|
7482
|
-
s(
|
|
7482
|
+
s(Kg, e).trace("fragment", y(y({}, c), {}, {
|
|
7483
7483
|
startTime: i,
|
|
7484
7484
|
endTime: a,
|
|
7485
7485
|
subscribeId: t.subscribeId,
|
|
@@ -7505,25 +7505,25 @@ var qg = class {
|
|
|
7505
7505
|
}
|
|
7506
7506
|
})();
|
|
7507
7507
|
}
|
|
7508
|
-
[Eg]() {
|
|
7509
|
-
return o(Kg, this, Jg).call(this);
|
|
7510
|
-
}
|
|
7511
7508
|
[Dg]() {
|
|
7512
|
-
return o(
|
|
7509
|
+
return o(qg, this, Yg).call(this);
|
|
7510
|
+
}
|
|
7511
|
+
[Og]() {
|
|
7512
|
+
return o(qg, this, Yg).call(this);
|
|
7513
7513
|
}
|
|
7514
7514
|
};
|
|
7515
|
-
function
|
|
7515
|
+
function Yg() {
|
|
7516
7516
|
var e = this;
|
|
7517
7517
|
return t(function* () {
|
|
7518
7518
|
var t, n;
|
|
7519
|
-
return yield (t = (n = s(
|
|
7519
|
+
return yield (t = (n = s(Wg, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
|
|
7520
7520
|
})();
|
|
7521
7521
|
}
|
|
7522
|
-
var
|
|
7523
|
-
|
|
7524
|
-
var
|
|
7522
|
+
var Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap();
|
|
7523
|
+
kg = Symbol.asyncIterator, Ag = Ot(), jg = Symbol.asyncDispose;
|
|
7524
|
+
var e_ = class n {
|
|
7525
7525
|
constructor(t, n, r, o, s) {
|
|
7526
|
-
i(this,
|
|
7526
|
+
i(this, Xg, void 0), i(this, Zg, void 0), i(this, Qg, void 0), i(this, $g, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, a(Zg, this, r), a(Xg, this, o), a(Qg, this, s);
|
|
7527
7527
|
}
|
|
7528
7528
|
static subscribe(e, r, { timestampOffsetMs: i, startGroup: a, params: o }) {
|
|
7529
7529
|
return t(function* () {
|
|
@@ -7532,14 +7532,14 @@ var $g = class n {
|
|
|
7532
7532
|
a !== void 0 && t.startGroup(a);
|
|
7533
7533
|
let s = t.build();
|
|
7534
7534
|
if (r.initTrack) {
|
|
7535
|
-
let t = new xh().name(r.initTrack).build(), [c, l] = yield Promise.all([
|
|
7535
|
+
let t = new xh().name(r.initTrack).build(), [c, l] = yield Promise.all([t_.call(n, e, t), pg.subscribe(e, s, {
|
|
7536
7536
|
params: o,
|
|
7537
7537
|
largestGroupId: a ? a - w(1) : void 0
|
|
7538
7538
|
})]), u = new $a(c);
|
|
7539
7539
|
return new n(r, e.namespace(), l, u, i);
|
|
7540
7540
|
}
|
|
7541
7541
|
d(r.initData, "no init data found on track");
|
|
7542
|
-
let c = Te(r.initData), l = new $a(new Uint8Array(c)), u = yield
|
|
7542
|
+
let c = Te(r.initData), l = new $a(new Uint8Array(c)), u = yield pg.subscribe(e, s, {
|
|
7543
7543
|
params: o,
|
|
7544
7544
|
largestGroupId: a ? a - w(1) : void 0
|
|
7545
7545
|
});
|
|
@@ -7547,59 +7547,59 @@ var $g = class n {
|
|
|
7547
7547
|
})();
|
|
7548
7548
|
}
|
|
7549
7549
|
largestGroupId() {
|
|
7550
|
-
return s(
|
|
7550
|
+
return s(Zg, this).largestGroupId();
|
|
7551
7551
|
}
|
|
7552
7552
|
stopAfterTimestampReached(e) {
|
|
7553
|
-
a(
|
|
7553
|
+
a($g, this, [0, e]);
|
|
7554
7554
|
}
|
|
7555
7555
|
timestampRange() {
|
|
7556
|
-
return s(
|
|
7556
|
+
return s($g, this);
|
|
7557
7557
|
}
|
|
7558
7558
|
endOfTrack(e) {
|
|
7559
|
-
return s(
|
|
7559
|
+
return s(Zg, this).endOfTrack(e);
|
|
7560
7560
|
}
|
|
7561
7561
|
update(e, t) {
|
|
7562
|
-
return s(
|
|
7562
|
+
return s(Zg, this).update(e, t);
|
|
7563
7563
|
}
|
|
7564
7564
|
unsubscribe() {
|
|
7565
7565
|
var e = this;
|
|
7566
7566
|
return t(function* () {
|
|
7567
|
-
return s(
|
|
7567
|
+
return s(Zg, e).unsubscribe();
|
|
7568
7568
|
})();
|
|
7569
7569
|
}
|
|
7570
7570
|
next() {
|
|
7571
7571
|
var e = this;
|
|
7572
7572
|
return t(function* () {
|
|
7573
|
-
let t = yield s(
|
|
7573
|
+
let t = yield s(Zg, e).next();
|
|
7574
7574
|
return t.done ? t : {
|
|
7575
7575
|
done: !1,
|
|
7576
|
-
value: new
|
|
7576
|
+
value: new Jg(t.value, s(Xg, e), s(Qg, e), e)
|
|
7577
7577
|
};
|
|
7578
7578
|
})();
|
|
7579
7579
|
}
|
|
7580
7580
|
return() {
|
|
7581
7581
|
var e = this;
|
|
7582
7582
|
return t(function* () {
|
|
7583
|
-
return yield s(
|
|
7583
|
+
return yield s(Zg, e).return(), {
|
|
7584
7584
|
done: !0,
|
|
7585
7585
|
value: void 0
|
|
7586
7586
|
};
|
|
7587
7587
|
})();
|
|
7588
7588
|
}
|
|
7589
|
-
[
|
|
7589
|
+
[kg]() {
|
|
7590
7590
|
return this;
|
|
7591
7591
|
}
|
|
7592
|
-
[
|
|
7592
|
+
[Ag]() {
|
|
7593
7593
|
return this.unsubscribe();
|
|
7594
7594
|
}
|
|
7595
|
-
[
|
|
7595
|
+
[jg]() {
|
|
7596
7596
|
var e = this;
|
|
7597
7597
|
return t(function* () {
|
|
7598
7598
|
return e.unsubscribe();
|
|
7599
7599
|
})();
|
|
7600
7600
|
}
|
|
7601
7601
|
};
|
|
7602
|
-
function
|
|
7602
|
+
function t_(e, n) {
|
|
7603
7603
|
return t(function* () {
|
|
7604
7604
|
try {
|
|
7605
7605
|
var t = hp();
|
|
@@ -7615,46 +7615,46 @@ function e_(e, n) {
|
|
|
7615
7615
|
}
|
|
7616
7616
|
//#endregion
|
|
7617
7617
|
//#region ../../libs/voq/src/tracks/Timeline.ts
|
|
7618
|
-
var
|
|
7618
|
+
var n_ = 1e4, r_ = 3e4, i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap(), s_ = /* @__PURE__ */ new WeakMap(), c_ = /* @__PURE__ */ new WeakMap(), l_ = /* @__PURE__ */ new WeakMap(), u_ = /* @__PURE__ */ new WeakSet(), d_ = class e {
|
|
7619
7619
|
constructor(e, t, r) {
|
|
7620
|
-
x(this,
|
|
7620
|
+
x(this, u_), i(this, i_, b.get().createContext("Timeline")), i(this, a_, new D([])), i(this, o_, void 0), i(this, s_, void 0), i(this, c_, void 0), i(this, l_, void 0), a(s_, this, e), a(c_, this, r), a(o_, this, t), a(l_, this, o(u_, this, f_).call(this, s(o_, this))), this.closed().finally(() => s(a_, this).close()).catch(n);
|
|
7621
7621
|
}
|
|
7622
7622
|
closed() {
|
|
7623
|
-
return s(
|
|
7623
|
+
return s(l_, this);
|
|
7624
7624
|
}
|
|
7625
7625
|
close() {
|
|
7626
7626
|
var e = this;
|
|
7627
7627
|
return t(function* () {
|
|
7628
|
-
return (yield s(
|
|
7628
|
+
return (yield s(o_, e).promise).unsubscribe();
|
|
7629
7629
|
})();
|
|
7630
7630
|
}
|
|
7631
7631
|
timeline() {
|
|
7632
|
-
let [e, t] = s(
|
|
7632
|
+
let [e, t] = s(a_, this).value();
|
|
7633
7633
|
return e;
|
|
7634
7634
|
}
|
|
7635
7635
|
timestampWallclockOffset() {
|
|
7636
7636
|
return vt(this.timeline().map((e) => e.mediaPts - e.wallclock));
|
|
7637
7637
|
}
|
|
7638
7638
|
static start(t, n) {
|
|
7639
|
-
return new e(t, S.fromPromise(
|
|
7639
|
+
return new e(t, S.fromPromise(pg.subscribe(t, new xh().name(n).groupOrder("ascending").build())), n);
|
|
7640
7640
|
}
|
|
7641
7641
|
waitForWallclockTime(e) {
|
|
7642
7642
|
var n = this;
|
|
7643
7643
|
return t(function* () {
|
|
7644
|
-
return yield s(
|
|
7644
|
+
return yield s(a_, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
|
|
7645
7645
|
})();
|
|
7646
7646
|
}
|
|
7647
7647
|
waitForTimelineToHaveMinDuration() {
|
|
7648
7648
|
var e = this;
|
|
7649
7649
|
return t(function* () {
|
|
7650
|
-
return yield s(
|
|
7650
|
+
return yield s(a_, e).waitFor((e) => {
|
|
7651
7651
|
let t = e[0], n = e[e.length - 1];
|
|
7652
|
-
return !t || !n ? !1 : n.wallclock - t.wallclock >
|
|
7652
|
+
return !t || !n ? !1 : n.wallclock - t.wallclock > n_;
|
|
7653
7653
|
}), e.timeline();
|
|
7654
7654
|
})();
|
|
7655
7655
|
}
|
|
7656
7656
|
};
|
|
7657
|
-
function
|
|
7657
|
+
function f_(e) {
|
|
7658
7658
|
var n = this;
|
|
7659
7659
|
return t(function* () {
|
|
7660
7660
|
let t = yield e.promise;
|
|
@@ -7669,13 +7669,13 @@ function d_(e) {
|
|
|
7669
7669
|
let e = h.value;
|
|
7670
7670
|
{
|
|
7671
7671
|
if (e.objectStatus !== B.Normal) continue;
|
|
7672
|
-
let r =
|
|
7673
|
-
s(
|
|
7672
|
+
let r = m_(e.payload);
|
|
7673
|
+
s(a_, n).update((e) => {
|
|
7674
7674
|
var t, n;
|
|
7675
|
-
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 >
|
|
7675
|
+
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 > r_;) e.shift();
|
|
7676
7676
|
return e;
|
|
7677
|
-
}), t === s(
|
|
7678
|
-
s(
|
|
7677
|
+
}), t === s(o_, n).resolved && e.groupId > w(0) && e.objectId === w(0) && o(u_, n, p_).call(n, e.groupId).catch((e) => {
|
|
7678
|
+
s(i_, n).warn("backfill failed", e);
|
|
7679
7679
|
});
|
|
7680
7680
|
}
|
|
7681
7681
|
}
|
|
@@ -7704,20 +7704,20 @@ function d_(e) {
|
|
|
7704
7704
|
}
|
|
7705
7705
|
})();
|
|
7706
7706
|
}
|
|
7707
|
-
function
|
|
7707
|
+
function p_(e) {
|
|
7708
7708
|
var n = this;
|
|
7709
7709
|
return t(function* () {
|
|
7710
7710
|
let t = e - w(1), r = n.timeline(), i = r[0], a = r[r.length - 1];
|
|
7711
|
-
if (!i || !a || a.wallclock - i.wallclock >
|
|
7712
|
-
s(
|
|
7711
|
+
if (!i || !a || a.wallclock - i.wallclock > n_) return;
|
|
7712
|
+
s(i_, n).debug("backfilling timeline", {
|
|
7713
7713
|
currentGroupId: e,
|
|
7714
7714
|
backfillGroupId: t
|
|
7715
7715
|
});
|
|
7716
|
-
let c = S.fromPromise(
|
|
7717
|
-
return o(
|
|
7716
|
+
let c = S.fromPromise(pg.subscribe(s(s_, n), new xh().name(s(c_, n)).groupOrder("ascending").range(t, t).build()));
|
|
7717
|
+
return o(u_, n, f_).call(n, c);
|
|
7718
7718
|
})();
|
|
7719
7719
|
}
|
|
7720
|
-
function
|
|
7720
|
+
function m_(e) {
|
|
7721
7721
|
var t;
|
|
7722
7722
|
let n = new TextDecoder("utf-8").decode(e).split("\n");
|
|
7723
7723
|
return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
|
|
@@ -7734,46 +7734,46 @@ function p_(e) {
|
|
|
7734
7734
|
}
|
|
7735
7735
|
//#endregion
|
|
7736
7736
|
//#region ../../libs/voq/src/tracks/WebVTT.ts
|
|
7737
|
-
var
|
|
7738
|
-
function
|
|
7737
|
+
var h_, g_, __;
|
|
7738
|
+
function v_(e) {
|
|
7739
7739
|
return typeof e.language == "string";
|
|
7740
7740
|
}
|
|
7741
|
-
var
|
|
7742
|
-
|
|
7743
|
-
var
|
|
7741
|
+
var y_ = /* @__PURE__ */ new WeakMap(), b_ = /* @__PURE__ */ new WeakMap(), x_ = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap();
|
|
7742
|
+
h_ = Symbol.asyncIterator, g_ = Ot(), __ = Symbol.asyncDispose;
|
|
7743
|
+
var C_ = class n {
|
|
7744
7744
|
constructor(t, n, r, o, s) {
|
|
7745
|
-
i(this,
|
|
7745
|
+
i(this, y_, new ic()), i(this, b_, void 0), i(this, x_, void 0), i(this, S_, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), a(x_, this, t), a(b_, this, n), this.trackObject = r, this.namespace = o, a(S_, this, s);
|
|
7746
7746
|
}
|
|
7747
7747
|
static subscribe(e, r, i) {
|
|
7748
7748
|
return t(function* () {
|
|
7749
|
-
if (!
|
|
7750
|
-
let t = new xh().name(r.name).build(), a = yield
|
|
7749
|
+
if (!v_(r)) throw Error("track object language is required");
|
|
7750
|
+
let t = new xh().name(r.name).build(), a = yield pg.subscribe(e, t);
|
|
7751
7751
|
return new n(a, a.objects(), r, e.namespace(), i);
|
|
7752
7752
|
})();
|
|
7753
7753
|
}
|
|
7754
7754
|
largestGroupId() {
|
|
7755
|
-
return s(
|
|
7755
|
+
return s(x_, this).largestGroupId();
|
|
7756
7756
|
}
|
|
7757
7757
|
update(e, t) {
|
|
7758
|
-
return s(
|
|
7758
|
+
return s(x_, this).update(e, t);
|
|
7759
7759
|
}
|
|
7760
7760
|
unsubscribe() {
|
|
7761
|
-
return s(
|
|
7761
|
+
return s(x_, this).unsubscribe();
|
|
7762
7762
|
}
|
|
7763
7763
|
next() {
|
|
7764
7764
|
var e = this;
|
|
7765
7765
|
return t(function* () {
|
|
7766
7766
|
for (;;) {
|
|
7767
|
-
let t = yield s(
|
|
7767
|
+
let t = yield s(b_, e).next();
|
|
7768
7768
|
if (t.done) return t;
|
|
7769
7769
|
if (t.value.objectStatus !== B.Normal) continue;
|
|
7770
7770
|
let n = new TextDecoder().decode(t.value.payload), r;
|
|
7771
7771
|
try {
|
|
7772
|
-
r = s(
|
|
7772
|
+
r = s(y_, e).parse(n);
|
|
7773
7773
|
} catch (e) {
|
|
7774
7774
|
continue;
|
|
7775
7775
|
}
|
|
7776
|
-
let i = r.map((t) => (t.startTime -= s(
|
|
7776
|
+
let i = r.map((t) => (t.startTime -= s(S_, e) / 1e3, t.endTime -= s(S_, e) / 1e3, t));
|
|
7777
7777
|
return {
|
|
7778
7778
|
done: !1,
|
|
7779
7779
|
value: {
|
|
@@ -7787,29 +7787,29 @@ var S_ = class n {
|
|
|
7787
7787
|
return() {
|
|
7788
7788
|
var e = this;
|
|
7789
7789
|
return t(function* () {
|
|
7790
|
-
return yield s(
|
|
7790
|
+
return yield s(x_, e).return(), {
|
|
7791
7791
|
done: !0,
|
|
7792
7792
|
value: void 0
|
|
7793
7793
|
};
|
|
7794
7794
|
})();
|
|
7795
7795
|
}
|
|
7796
|
-
[
|
|
7796
|
+
[h_]() {
|
|
7797
7797
|
return this;
|
|
7798
7798
|
}
|
|
7799
|
-
[
|
|
7799
|
+
[g_]() {
|
|
7800
7800
|
return this.unsubscribe();
|
|
7801
7801
|
}
|
|
7802
|
-
[
|
|
7802
|
+
[__]() {
|
|
7803
7803
|
return this.unsubscribe();
|
|
7804
7804
|
}
|
|
7805
|
-
},
|
|
7805
|
+
}, w_ = /* @__PURE__ */ new WeakMap(), T_ = /* @__PURE__ */ new WeakMap(), E_ = /* @__PURE__ */ new WeakMap(), D_ = /* @__PURE__ */ new WeakMap(), O_ = /* @__PURE__ */ new WeakSet(), k_ = class n {
|
|
7806
7806
|
constructor(t, n, r, o, s) {
|
|
7807
|
-
x(this,
|
|
7807
|
+
x(this, O_), e(this, "namespace", void 0), i(this, w_, void 0), i(this, T_, void 0), i(this, E_, void 0), i(this, D_, void 0), this.namespace = o, a(w_, this, t), a(T_, this, n), a(E_, this, r), a(D_, this, s);
|
|
7808
7808
|
}
|
|
7809
7809
|
static start(e, r) {
|
|
7810
7810
|
return t(function* () {
|
|
7811
|
-
|
|
7812
|
-
let t = new wh(e, { namespace: r.namespace }), [i, a] = yield Promise.all([
|
|
7811
|
+
j_._.info("Enter 'start'", { config: r });
|
|
7812
|
+
let t = new wh(e, { namespace: r.namespace }), [i, a] = yield Promise.all([d_.start(t, "timeline"), Sg.start(t, {
|
|
7813
7813
|
catalog: r.catalog,
|
|
7814
7814
|
namespace: r.namespace
|
|
7815
7815
|
})]);
|
|
@@ -7817,42 +7817,42 @@ var S_ = class n {
|
|
|
7817
7817
|
})();
|
|
7818
7818
|
}
|
|
7819
7819
|
closed() {
|
|
7820
|
-
return Promise.race([s(
|
|
7820
|
+
return Promise.race([s(E_, this).closed(), s(T_, this).closed()]);
|
|
7821
7821
|
}
|
|
7822
7822
|
catalog() {
|
|
7823
|
-
return s(
|
|
7823
|
+
return s(E_, this).catalog();
|
|
7824
7824
|
}
|
|
7825
7825
|
timestampWallclockOffset() {
|
|
7826
|
-
return s(
|
|
7826
|
+
return s(T_, this).timestampWallclockOffset();
|
|
7827
7827
|
}
|
|
7828
7828
|
timestampOffsetMs() {
|
|
7829
|
-
return s(
|
|
7829
|
+
return s(D_, this);
|
|
7830
7830
|
}
|
|
7831
7831
|
setTimestampOffsetMs(e) {
|
|
7832
|
-
a(
|
|
7832
|
+
a(D_, this, e);
|
|
7833
7833
|
}
|
|
7834
7834
|
waitForWallclockTime(e) {
|
|
7835
|
-
return s(
|
|
7835
|
+
return s(T_, this).waitForWallclockTime(e);
|
|
7836
7836
|
}
|
|
7837
7837
|
subscribeCmafTrack(e, t) {
|
|
7838
7838
|
let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, i = this.catalog().current().tracks, a = e["com.vindral.variant_uid"] === void 0 ? void 0 : i.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
|
|
7839
|
-
return o(
|
|
7840
|
-
timestampOffsetMs: s(
|
|
7839
|
+
return o(O_, this, A_).call(this, () => e_.subscribe(s(w_, this), a == null ? e : a, {
|
|
7840
|
+
timestampOffsetMs: s(D_, this),
|
|
7841
7841
|
startGroup: n,
|
|
7842
7842
|
params: r
|
|
7843
7843
|
}));
|
|
7844
7844
|
}
|
|
7845
7845
|
subscribeWebVttTrack(e) {
|
|
7846
|
-
return o(
|
|
7846
|
+
return o(O_, this, A_).call(this, () => C_.subscribe(s(w_, this), e, s(D_, this)));
|
|
7847
7847
|
}
|
|
7848
7848
|
subscribeTrack(e) {
|
|
7849
|
-
return o(
|
|
7849
|
+
return o(O_, this, A_).call(this, () => s(w_, this).subscribe(e));
|
|
7850
7850
|
}
|
|
7851
7851
|
close() {
|
|
7852
|
-
return Promise.all([s(
|
|
7852
|
+
return Promise.all([s(E_, this).close(), s(T_, this).close()]);
|
|
7853
7853
|
}
|
|
7854
7854
|
};
|
|
7855
|
-
function
|
|
7855
|
+
function A_(e) {
|
|
7856
7856
|
var n = this;
|
|
7857
7857
|
return t(function* () {
|
|
7858
7858
|
let [t, r] = n.catalog().value();
|
|
@@ -7864,45 +7864,45 @@ function k_(e) {
|
|
|
7864
7864
|
}
|
|
7865
7865
|
})();
|
|
7866
7866
|
}
|
|
7867
|
-
var
|
|
7868
|
-
function
|
|
7867
|
+
var j_ = { _: b.get().createContext("Channel") }, M_ = w(8);
|
|
7868
|
+
function N_(e) {
|
|
7869
7869
|
if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
|
|
7870
7870
|
return {
|
|
7871
|
-
type:
|
|
7871
|
+
type: M_,
|
|
7872
7872
|
payload: new Uint8Array([e >> 8 & 255, e & 255])
|
|
7873
7873
|
};
|
|
7874
7874
|
}
|
|
7875
7875
|
//#endregion
|
|
7876
7876
|
//#region ../../libs/voq/src/ProducerReferenceClock.ts
|
|
7877
|
-
var
|
|
7877
|
+
var P_ = /* @__PURE__ */ new WeakMap(), F_ = /* @__PURE__ */ new WeakMap(), I_ = /* @__PURE__ */ new WeakSet(), L_ = class e {
|
|
7878
7878
|
constructor(e) {
|
|
7879
|
-
x(this,
|
|
7879
|
+
x(this, I_), i(this, P_, void 0), i(this, F_, void 0);
|
|
7880
7880
|
let [t, n] = e.value.value();
|
|
7881
|
-
a(
|
|
7881
|
+
a(P_, this, {
|
|
7882
7882
|
createdAt: /* @__PURE__ */ new Date(),
|
|
7883
7883
|
wallclock: new Date(t.ntpTimestamp),
|
|
7884
7884
|
rtt: t.rtt
|
|
7885
|
-
}), a(
|
|
7885
|
+
}), a(F_, this, o(I_, this, R_).call(this, e));
|
|
7886
7886
|
}
|
|
7887
7887
|
wallclock() {
|
|
7888
|
-
let e = Date.now() - s(
|
|
7889
|
-
return s(
|
|
7888
|
+
let e = Date.now() - s(P_, this).createdAt.getTime();
|
|
7889
|
+
return s(P_, this).wallclock.getTime() + e;
|
|
7890
7890
|
}
|
|
7891
7891
|
closed() {
|
|
7892
|
-
return s(
|
|
7892
|
+
return s(F_, this);
|
|
7893
7893
|
}
|
|
7894
7894
|
static start(t) {
|
|
7895
7895
|
return new e(t);
|
|
7896
7896
|
}
|
|
7897
7897
|
};
|
|
7898
|
-
function
|
|
7898
|
+
function R_(e) {
|
|
7899
7899
|
var n = this;
|
|
7900
7900
|
return t(function* () {
|
|
7901
7901
|
var t = !1, r = !1, i;
|
|
7902
7902
|
try {
|
|
7903
7903
|
for (var o = V(e.value), s; t = !(s = yield o.next()).done; t = !1) {
|
|
7904
7904
|
let e = s.value;
|
|
7905
|
-
a(
|
|
7905
|
+
a(P_, n, {
|
|
7906
7906
|
createdAt: /* @__PURE__ */ new Date(),
|
|
7907
7907
|
wallclock: new Date(e.ntpTimestamp),
|
|
7908
7908
|
rtt: e.rtt
|
|
@@ -7921,7 +7921,7 @@ function L_(e) {
|
|
|
7921
7921
|
}
|
|
7922
7922
|
//#endregion
|
|
7923
7923
|
//#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js
|
|
7924
|
-
function
|
|
7924
|
+
function z_(e, t) {
|
|
7925
7925
|
if (e == null) return {};
|
|
7926
7926
|
var n = {};
|
|
7927
7927
|
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
|
|
@@ -7932,9 +7932,9 @@ function R_(e, t) {
|
|
|
7932
7932
|
}
|
|
7933
7933
|
//#endregion
|
|
7934
7934
|
//#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutProperties.js
|
|
7935
|
-
function
|
|
7935
|
+
function B_(e, t) {
|
|
7936
7936
|
if (e == null) return {};
|
|
7937
|
-
var n, r, i =
|
|
7937
|
+
var n, r, i = z_(e, t);
|
|
7938
7938
|
if (Object.getOwnPropertySymbols) {
|
|
7939
7939
|
var a = Object.getOwnPropertySymbols(e);
|
|
7940
7940
|
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
|
|
@@ -7943,27 +7943,27 @@ function z_(e, t) {
|
|
|
7943
7943
|
}
|
|
7944
7944
|
//#endregion
|
|
7945
7945
|
//#region ../../libs/voq/src/tracks/Drm.ts
|
|
7946
|
-
var
|
|
7947
|
-
function V_(e) {
|
|
7948
|
-
return typeof e == "string" || e == null;
|
|
7949
|
-
}
|
|
7946
|
+
var V_ = ["fairplayCertificate"];
|
|
7950
7947
|
function H_(e) {
|
|
7951
|
-
return
|
|
7948
|
+
return typeof e == "string" || e == null;
|
|
7952
7949
|
}
|
|
7953
7950
|
function U_(e) {
|
|
7951
|
+
return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || H_(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || H_(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || H_(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || H_(e.fairplayCertificate));
|
|
7952
|
+
}
|
|
7953
|
+
function W_(e) {
|
|
7954
7954
|
try {
|
|
7955
7955
|
return Te(e);
|
|
7956
7956
|
} catch (e) {
|
|
7957
7957
|
throw Error("Failed to convert fairplayCertificate");
|
|
7958
7958
|
}
|
|
7959
7959
|
}
|
|
7960
|
-
function
|
|
7960
|
+
function G_(e) {
|
|
7961
7961
|
let t = new TextDecoder().decode(e), n = JSON.parse(t);
|
|
7962
|
-
if (!
|
|
7962
|
+
if (!U_(n)) throw Error("Invalid drm object");
|
|
7963
7963
|
let { fairplayCertificate: r } = n;
|
|
7964
|
-
return y(y({},
|
|
7964
|
+
return y(y({}, B_(n, V_)), {}, { fairplayCertificate: r ? W_(r) : void 0 });
|
|
7965
7965
|
}
|
|
7966
|
-
var
|
|
7966
|
+
var K_ = class n {
|
|
7967
7967
|
constructor(t) {
|
|
7968
7968
|
e(this, "value", void 0), this.value = t;
|
|
7969
7969
|
}
|
|
@@ -7973,7 +7973,7 @@ var G_ = class n {
|
|
|
7973
7973
|
var t = hp();
|
|
7974
7974
|
let a = yield t.a(yield e.subscribeTrack(new xh().name("drm").build())).objects().next();
|
|
7975
7975
|
if (a.done) throw Error("No drm object received");
|
|
7976
|
-
return new n(y(y({},
|
|
7976
|
+
return new n(y(y({}, G_(a.value.payload)), {}, {
|
|
7977
7977
|
videoCodec: r,
|
|
7978
7978
|
audioCodec: i
|
|
7979
7979
|
}));
|
|
@@ -7987,32 +7987,32 @@ var G_ = class n {
|
|
|
7987
7987
|
};
|
|
7988
7988
|
//#endregion
|
|
7989
7989
|
//#region ../../libs/voq/src/tracks/Stats.ts
|
|
7990
|
-
function
|
|
7990
|
+
function q_(e) {
|
|
7991
7991
|
return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
|
|
7992
7992
|
}
|
|
7993
|
-
function
|
|
7993
|
+
function J_(e) {
|
|
7994
7994
|
let t = new TextDecoder().decode(e), n = JSON.parse(t);
|
|
7995
|
-
if (!
|
|
7995
|
+
if (!q_(n)) throw Error("Invalid stats object");
|
|
7996
7996
|
return n;
|
|
7997
7997
|
}
|
|
7998
|
-
var
|
|
7998
|
+
var Y_ = /* @__PURE__ */ new WeakMap(), X_ = /* @__PURE__ */ new WeakSet(), Z_ = class r {
|
|
7999
7999
|
constructor(t, r, s) {
|
|
8000
|
-
x(this,
|
|
8000
|
+
x(this, X_), e(this, "ip", void 0), e(this, "value", void 0), i(this, Y_, void 0), this.ip = s, this.value = new D(r), a(Y_, this, o(X_, this, Q_).call(this, t)), this.closed().catch(n);
|
|
8001
8001
|
}
|
|
8002
8002
|
closed() {
|
|
8003
|
-
return s(
|
|
8003
|
+
return s(Y_, this);
|
|
8004
8004
|
}
|
|
8005
8005
|
static start(e) {
|
|
8006
8006
|
return t(function* () {
|
|
8007
8007
|
let t = (yield e.subscribe(new xh().name("stats").groupOrder("ascending").build())).objects(), n = yield t.next();
|
|
8008
8008
|
if (n.done) throw Error("No stats object received");
|
|
8009
|
-
let i =
|
|
8009
|
+
let i = J_(n.value.payload);
|
|
8010
8010
|
if (!i.ip) throw Error("Expected IP in initial stats object");
|
|
8011
8011
|
return new r(t, i, i.ip);
|
|
8012
8012
|
})();
|
|
8013
8013
|
}
|
|
8014
8014
|
};
|
|
8015
|
-
function
|
|
8015
|
+
function Q_(e) {
|
|
8016
8016
|
var n = this;
|
|
8017
8017
|
return t(function* () {
|
|
8018
8018
|
var t = !1, r = !1, i;
|
|
@@ -8021,7 +8021,7 @@ function Z_(e) {
|
|
|
8021
8021
|
let e = o.value;
|
|
8022
8022
|
{
|
|
8023
8023
|
if (e.objectStatus !== B.Normal) continue;
|
|
8024
|
-
let t =
|
|
8024
|
+
let t = J_(e.payload);
|
|
8025
8025
|
n.value.update(t);
|
|
8026
8026
|
}
|
|
8027
8027
|
}
|
|
@@ -8038,21 +8038,21 @@ function Z_(e) {
|
|
|
8038
8038
|
}
|
|
8039
8039
|
//#endregion
|
|
8040
8040
|
//#region ../../libs/voq/src/UpstreamWatcher.ts
|
|
8041
|
-
var
|
|
8041
|
+
var $_ = /* @__PURE__ */ new WeakMap(), ev = /* @__PURE__ */ new WeakMap(), tv = class {
|
|
8042
8042
|
constructor(e) {
|
|
8043
|
-
i(this,
|
|
8043
|
+
i(this, $_, b.get().createContext("UpstreamWatcher")), i(this, ev, void 0), a(ev, this, new D(S.fromPromise(e.closed())));
|
|
8044
8044
|
}
|
|
8045
8045
|
update(e) {
|
|
8046
|
-
s(
|
|
8046
|
+
s(ev, this).update(S.fromPromise(e.closed()));
|
|
8047
8047
|
}
|
|
8048
8048
|
closed() {
|
|
8049
8049
|
var e = this;
|
|
8050
8050
|
return t(function* () {
|
|
8051
8051
|
try {
|
|
8052
8052
|
for (;;) {
|
|
8053
|
-
let [t, n] = s(
|
|
8053
|
+
let [t, n] = s(ev, e).value(), r = !1;
|
|
8054
8054
|
yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
|
|
8055
|
-
if (!r) throw s(
|
|
8055
|
+
if (!r) throw s($_, e).warn("Upstream closed"), Error("Upstream closed");
|
|
8056
8056
|
})]);
|
|
8057
8057
|
}
|
|
8058
8058
|
} catch (e) {
|
|
@@ -8060,19 +8060,19 @@ var Q_ = /* @__PURE__ */ new WeakMap(), $_ = /* @__PURE__ */ new WeakMap(), ev =
|
|
|
8060
8060
|
}
|
|
8061
8061
|
})();
|
|
8062
8062
|
}
|
|
8063
|
-
},
|
|
8064
|
-
|
|
8065
|
-
var
|
|
8063
|
+
}, nv, rv = 5e3, iv = /* @__PURE__ */ new WeakMap(), av = /* @__PURE__ */ new WeakMap(), ov = /* @__PURE__ */ new WeakMap();
|
|
8064
|
+
nv = Symbol.asyncIterator;
|
|
8065
|
+
var sv = class {
|
|
8066
8066
|
constructor(e, t) {
|
|
8067
|
-
i(this,
|
|
8067
|
+
i(this, iv, b.get().createContext("TracksIterator")), i(this, av, void 0), i(this, ov, void 0), a(av, this, e), a(ov, this, t);
|
|
8068
8068
|
}
|
|
8069
|
-
[
|
|
8069
|
+
[nv]() {
|
|
8070
8070
|
var e = this;
|
|
8071
8071
|
return zt(function* () {
|
|
8072
|
-
let t = s(
|
|
8072
|
+
let t = s(ov, e);
|
|
8073
8073
|
var n = !1, r = !1, i;
|
|
8074
8074
|
try {
|
|
8075
|
-
for (var a = V(s(
|
|
8075
|
+
for (var a = V(s(av, e)), o; n = !(o = yield E(a.next())).done; n = !1) {
|
|
8076
8076
|
let n = o.value;
|
|
8077
8077
|
{
|
|
8078
8078
|
if (!n) continue;
|
|
@@ -8080,7 +8080,7 @@ var ov = class {
|
|
|
8080
8080
|
name: n.trackObject.name,
|
|
8081
8081
|
namespace: n.namespace
|
|
8082
8082
|
};
|
|
8083
|
-
s(
|
|
8083
|
+
s(iv, e).debug("track start", y({ mediaType: t }, r)), yield* ag(V(n)), s(iv, e).debug("track end", y({ mediaType: t }, r));
|
|
8084
8084
|
}
|
|
8085
8085
|
}
|
|
8086
8086
|
} catch (e) {
|
|
@@ -8092,97 +8092,97 @@ var ov = class {
|
|
|
8092
8092
|
if (r) throw i;
|
|
8093
8093
|
}
|
|
8094
8094
|
}
|
|
8095
|
-
s(
|
|
8095
|
+
s(iv, e).debug("tracks ended", { mediaType: t });
|
|
8096
8096
|
})();
|
|
8097
8097
|
}
|
|
8098
|
-
},
|
|
8098
|
+
}, cv = /* @__PURE__ */ new WeakMap(), lv = /* @__PURE__ */ new WeakMap(), uv = /* @__PURE__ */ new WeakMap(), dv = /* @__PURE__ */ new WeakMap(), fv = /* @__PURE__ */ new WeakMap(), pv = /* @__PURE__ */ new WeakMap(), mv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v = /* @__PURE__ */ new WeakMap(), vv = /* @__PURE__ */ new WeakSet(), yv = class r {
|
|
8099
8099
|
constructor(t, r, c) {
|
|
8100
|
-
x(this,
|
|
8101
|
-
o(
|
|
8102
|
-
o(
|
|
8103
|
-
o(
|
|
8104
|
-
s(
|
|
8105
|
-
])), s(
|
|
8100
|
+
x(this, vv), i(this, cv, void 0), i(this, lv, void 0), i(this, uv, void 0), i(this, dv, b.get().createContext("Player")), i(this, fv, void 0), i(this, pv, new D(void 0)), i(this, mv, new D(void 0)), i(this, hv, new D(void 0)), i(this, gv, void 0), i(this, _v, void 0), e(this, "subtitles", new sv(s(hv, this), "subtitles")), e(this, "video", new sv(s(mv, this), "video")), e(this, "audio", new sv(s(pv, this), "audio")), a(cv, this, t), a(lv, this, L_.start(c)), a(uv, this, c), a(fv, this, new D(r)), a(gv, this, new tv(r)), a(_v, this, Promise.race([
|
|
8101
|
+
o(vv, this, wv).call(this),
|
|
8102
|
+
o(vv, this, bv).call(this),
|
|
8103
|
+
o(vv, this, Cv).call(this),
|
|
8104
|
+
s(gv, this).closed()
|
|
8105
|
+
])), s(cv, this).closed().then(() => this.close()).catch(n);
|
|
8106
8106
|
}
|
|
8107
8107
|
closed() {
|
|
8108
|
-
return s(
|
|
8108
|
+
return s(_v, this);
|
|
8109
8109
|
}
|
|
8110
8110
|
static start(e, n) {
|
|
8111
8111
|
return t(function* () {
|
|
8112
8112
|
let t = /* @__PURE__ */ new Map();
|
|
8113
8113
|
if (n.burstMs !== void 0) {
|
|
8114
|
-
let e =
|
|
8114
|
+
let e = N_(n.burstMs);
|
|
8115
8115
|
t.set(e.type, e);
|
|
8116
8116
|
}
|
|
8117
|
-
let i = new wh(e, { namespace: Th("auxiliary") }), [[a, o, c], l] = yield Promise.all([
|
|
8117
|
+
let i = new wh(e, { namespace: Th("auxiliary") }), [[a, o, c], l] = yield Promise.all([k_.start(e, n).then((e) => Promise.all([
|
|
8118
8118
|
Promise.resolve(e),
|
|
8119
8119
|
n.videoTrack ? e.subscribeCmafTrack(n.videoTrack, { params: t }) : void 0,
|
|
8120
8120
|
n.audioTrack ? e.subscribeCmafTrack(n.audioTrack, { params: t }) : void 0
|
|
8121
|
-
])),
|
|
8122
|
-
return c && s(
|
|
8121
|
+
])), Z_.start(i)]), u = new r(e, a, l);
|
|
8122
|
+
return c && s(pv, u).update(c), o && s(mv, u).update(o), u;
|
|
8123
8123
|
})();
|
|
8124
8124
|
}
|
|
8125
8125
|
connectionInfo() {
|
|
8126
|
-
let e = s(
|
|
8126
|
+
let e = s(uv, this).value.current();
|
|
8127
8127
|
return {
|
|
8128
|
-
ip: s(
|
|
8128
|
+
ip: s(uv, this).ip,
|
|
8129
8129
|
rtt: e.rtt,
|
|
8130
8130
|
estimatedBandwidth: e.estimatedBandwidth
|
|
8131
8131
|
};
|
|
8132
8132
|
}
|
|
8133
8133
|
stats() {
|
|
8134
|
-
return s(
|
|
8134
|
+
return s(uv, this).value;
|
|
8135
8135
|
}
|
|
8136
8136
|
catalog() {
|
|
8137
|
-
return s(
|
|
8137
|
+
return s(fv, this).current().catalog();
|
|
8138
8138
|
}
|
|
8139
8139
|
namespace() {
|
|
8140
|
-
return s(
|
|
8140
|
+
return s(fv, this).current().namespace;
|
|
8141
8141
|
}
|
|
8142
8142
|
videoTrack() {
|
|
8143
8143
|
var e;
|
|
8144
|
-
return (e = s(
|
|
8144
|
+
return (e = s(mv, this).current()) == null ? void 0 : e.trackObject;
|
|
8145
8145
|
}
|
|
8146
8146
|
audioTrack() {
|
|
8147
8147
|
var e;
|
|
8148
|
-
return (e = s(
|
|
8148
|
+
return (e = s(pv, this).current()) == null ? void 0 : e.trackObject;
|
|
8149
8149
|
}
|
|
8150
8150
|
referenceClock() {
|
|
8151
|
-
return s(
|
|
8151
|
+
return s(lv, this);
|
|
8152
8152
|
}
|
|
8153
8153
|
drm() {
|
|
8154
8154
|
var e = this;
|
|
8155
8155
|
return t(function* () {
|
|
8156
8156
|
var t, n;
|
|
8157
|
-
if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return
|
|
8157
|
+
if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return K_.create(s(fv, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
|
|
8158
8158
|
})();
|
|
8159
8159
|
}
|
|
8160
8160
|
close() {
|
|
8161
|
-
return s(
|
|
8162
|
-
s(
|
|
8163
|
-
s(
|
|
8164
|
-
o(
|
|
8165
|
-
o(
|
|
8166
|
-
o(
|
|
8161
|
+
return s(dv, this).info("Enter 'close'"), Promise.all([
|
|
8162
|
+
s(fv, this).current().close(),
|
|
8163
|
+
s(fv, this).close(),
|
|
8164
|
+
o(vv, this, xv).call(this, s(pv, this)),
|
|
8165
|
+
o(vv, this, xv).call(this, s(mv, this)),
|
|
8166
|
+
o(vv, this, xv).call(this, s(hv, this))
|
|
8167
8167
|
]);
|
|
8168
8168
|
}
|
|
8169
8169
|
zap(e, n) {
|
|
8170
8170
|
var r = this;
|
|
8171
8171
|
return t(function* () {
|
|
8172
|
-
s(
|
|
8172
|
+
s(dv, r).info("Enter 'zap'", {
|
|
8173
8173
|
config: e,
|
|
8174
8174
|
zapOffsetMs: n
|
|
8175
8175
|
});
|
|
8176
|
-
let t = yield
|
|
8177
|
-
s(
|
|
8176
|
+
let t = yield k_.start(s(cv, r), e), i = s(lv, r).wallclock() - n, a = s(fv, r).current(), o = a.timestampWallclockOffset(), c = yield t.waitForWallclockTime(i);
|
|
8177
|
+
s(gv, r).update(t), yield s(fv, r).current().close();
|
|
8178
8178
|
let l = c.toReversed().find((e) => e.wallclock <= i), u = l != null && l.mediaPts ? l.mediaPts - a.timestampOffsetMs() : void 0, d = t.timestampWallclockOffset() - o + a.timestampOffsetMs();
|
|
8179
8179
|
t.setTimestampOffsetMs(d);
|
|
8180
8180
|
let f = (l == null ? void 0 : l.groupId) !== void 0 && !Number.isNaN(l.groupId) ? w(l.groupId) : void 0;
|
|
8181
8181
|
if (u) {
|
|
8182
8182
|
var p, m;
|
|
8183
|
-
(p = s(
|
|
8183
|
+
(p = s(mv, r).current()) == null || p.stopAfterTimestampReached(u), (m = s(pv, r).current()) == null || m.stopAfterTimestampReached(u);
|
|
8184
8184
|
}
|
|
8185
|
-
s(
|
|
8185
|
+
s(fv, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), s(dv, r).info("Return 'zap'");
|
|
8186
8186
|
})();
|
|
8187
8187
|
}
|
|
8188
8188
|
setSubtitleTrack(e) {
|
|
@@ -8191,49 +8191,49 @@ var ov = class {
|
|
|
8191
8191
|
var t;
|
|
8192
8192
|
if (!e) {
|
|
8193
8193
|
var r;
|
|
8194
|
-
yield (r = s(
|
|
8194
|
+
yield (r = s(hv, n).current()) == null ? void 0 : r.unsubscribe();
|
|
8195
8195
|
return;
|
|
8196
8196
|
}
|
|
8197
|
-
let [i] = yield Promise.all([s(
|
|
8198
|
-
s(
|
|
8197
|
+
let [i] = yield Promise.all([s(fv, n).current().subscribeWebVttTrack(e), (t = s(hv, n).current()) == null ? void 0 : t.unsubscribe()]);
|
|
8198
|
+
s(hv, n).update(i);
|
|
8199
8199
|
})();
|
|
8200
8200
|
}
|
|
8201
8201
|
setVideoTrack(e, n) {
|
|
8202
8202
|
var r = this;
|
|
8203
8203
|
return t(function* () {
|
|
8204
|
-
let t = yield o(
|
|
8205
|
-
s(
|
|
8204
|
+
let t = yield o(vv, r, Sv).call(r, s(fv, r).current(), e, s(mv, r).current(), n);
|
|
8205
|
+
s(mv, r).update(t);
|
|
8206
8206
|
})();
|
|
8207
8207
|
}
|
|
8208
8208
|
setAudioTrack(e, n) {
|
|
8209
8209
|
var r = this;
|
|
8210
8210
|
return t(function* () {
|
|
8211
|
-
let t = yield o(
|
|
8212
|
-
s(
|
|
8211
|
+
let t = yield o(vv, r, Sv).call(r, s(fv, r).current(), e, s(pv, r).current(), n);
|
|
8212
|
+
s(pv, r).update(t);
|
|
8213
8213
|
})();
|
|
8214
8214
|
}
|
|
8215
8215
|
};
|
|
8216
|
-
function
|
|
8216
|
+
function bv() {
|
|
8217
8217
|
var e = this;
|
|
8218
8218
|
return t(function* () {
|
|
8219
8219
|
let t = !1;
|
|
8220
|
-
for (s(
|
|
8220
|
+
for (s(cv, e).closed().then(() => {
|
|
8221
8221
|
t = !0;
|
|
8222
8222
|
}).catch(n);;) {
|
|
8223
|
-
let n = performance.now() - s(
|
|
8224
|
-
if (n >=
|
|
8225
|
-
if (yield ln(
|
|
8223
|
+
let n = performance.now() - s(cv, e).lastReceived();
|
|
8224
|
+
if (n >= rv) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
|
|
8225
|
+
if (yield ln(rv - n), t) return;
|
|
8226
8226
|
}
|
|
8227
8227
|
})();
|
|
8228
8228
|
}
|
|
8229
|
-
function
|
|
8229
|
+
function xv(e) {
|
|
8230
8230
|
let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
|
|
8231
8231
|
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);
|
|
8232
8232
|
}
|
|
8233
|
-
function
|
|
8233
|
+
function Sv(e, n, r, i) {
|
|
8234
8234
|
var a = this;
|
|
8235
8235
|
return t(function* () {
|
|
8236
|
-
s(
|
|
8236
|
+
s(dv, a).info("Enter '#replaceTrack'", {
|
|
8237
8237
|
trackObject: n,
|
|
8238
8238
|
startGroupId: i
|
|
8239
8239
|
});
|
|
@@ -8241,18 +8241,18 @@ function xv(e, n, r, i) {
|
|
|
8241
8241
|
return o;
|
|
8242
8242
|
})();
|
|
8243
8243
|
}
|
|
8244
|
-
function
|
|
8244
|
+
function Cv() {
|
|
8245
8245
|
var e = this;
|
|
8246
8246
|
return t(function* () {
|
|
8247
8247
|
var t = !1, n = !1, r;
|
|
8248
8248
|
try {
|
|
8249
|
-
for (var i = V(s(
|
|
8249
|
+
for (var i = V(s(fv, e)), a; t = !(a = yield i.next()).done; t = !1) {
|
|
8250
8250
|
let t = a.value;
|
|
8251
8251
|
var c = !1, l = !1, u;
|
|
8252
8252
|
try {
|
|
8253
8253
|
for (var d = V(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
|
|
8254
8254
|
let t = f.value;
|
|
8255
|
-
yield Promise.all([o(
|
|
8255
|
+
yield Promise.all([o(vv, e, Tv).call(e, t, s(mv, e)), o(vv, e, Tv).call(e, t, s(pv, e))]);
|
|
8256
8256
|
}
|
|
8257
8257
|
} catch (e) {
|
|
8258
8258
|
l = !0, u = e;
|
|
@@ -8275,17 +8275,17 @@ function Sv() {
|
|
|
8275
8275
|
}
|
|
8276
8276
|
})();
|
|
8277
8277
|
}
|
|
8278
|
-
function
|
|
8278
|
+
function wv() {
|
|
8279
8279
|
var e = this;
|
|
8280
8280
|
return t(function* () {
|
|
8281
8281
|
try {
|
|
8282
|
-
return yield s(
|
|
8282
|
+
return yield s(uv, e).closed(), /* @__PURE__ */ Error("Stats closed");
|
|
8283
8283
|
} catch (e) {
|
|
8284
8284
|
return e;
|
|
8285
8285
|
}
|
|
8286
8286
|
})();
|
|
8287
8287
|
}
|
|
8288
|
-
function
|
|
8288
|
+
function Tv(e, n) {
|
|
8289
8289
|
var r = this;
|
|
8290
8290
|
return t(function* () {
|
|
8291
8291
|
let t = n.current();
|
|
@@ -8296,17 +8296,85 @@ function wv(e, n) {
|
|
|
8296
8296
|
n.update(void 0);
|
|
8297
8297
|
return;
|
|
8298
8298
|
}
|
|
8299
|
-
n.update(yield s(
|
|
8299
|
+
n.update(yield s(fv, r).current().subscribeCmafTrack(c));
|
|
8300
8300
|
}
|
|
8301
8301
|
})();
|
|
8302
8302
|
}
|
|
8303
8303
|
//#endregion
|
|
8304
|
+
//#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
|
|
8305
|
+
var Ev, Dv = (e) => JSON.parse(JSON.stringify(e)), Ov = [
|
|
8306
|
+
"burstMs",
|
|
8307
|
+
"meta",
|
|
8308
|
+
"initiator",
|
|
8309
|
+
"channelGroupId"
|
|
8310
|
+
], kv = (e, t) => Et(qt(e, Ov), qt(t, Ov)), Av = 1e4, jv = class {
|
|
8311
|
+
constructor(t, n, r) {
|
|
8312
|
+
e(this, "logger", void 0), e(this, "timers", new O()), 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", () => {
|
|
8313
|
+
this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
|
|
8314
|
+
}), e(this, "isSwitchingSubscription", () => this._isSwitchingSubscription), e(this, "getTargetSubscription", () => this.targetSubscription), e(this, "getCurrentSubscription", () => this.currentSubscription), e(this, "enableBurst", (e) => {
|
|
8315
|
+
this.burstMs = e;
|
|
8316
|
+
}), e(this, "setSize", (e) => {
|
|
8317
|
+
this.targetSubscription.video.width = e.width, this.targetSubscription.video.height = e.height, this.scheduleSubscriptionChange();
|
|
8318
|
+
}), e(this, "setVideoConstraint", (e) => {
|
|
8319
|
+
this.targetSubscription.video = e, this.scheduleSubscriptionChange();
|
|
8320
|
+
}), e(this, "setAudioConstraint", (e) => {
|
|
8321
|
+
this.targetSubscription.audio = e, this.scheduleSubscriptionChange();
|
|
8322
|
+
}), e(this, "setVideoBitRate", (e) => {
|
|
8323
|
+
this.targetSubscription.video.bitRate = e, this.scheduleSubscriptionChange();
|
|
8324
|
+
}), e(this, "setAudioBitRate", (e) => {
|
|
8325
|
+
this.targetSubscription.audio.bitRate = e, this.scheduleSubscriptionChange();
|
|
8326
|
+
}), e(this, "setChannelId", (e) => {
|
|
8327
|
+
this.targetSubscription.channelId = e, this.scheduleSubscriptionChange();
|
|
8328
|
+
}), e(this, "setLanguage", (e) => {
|
|
8329
|
+
this.targetSubscription.audio.language = e, this.scheduleSubscriptionChange();
|
|
8330
|
+
}), e(this, "setVideoCodec", (e) => {
|
|
8331
|
+
this.targetSubscription.video.codec = e, this.scheduleSubscriptionChange();
|
|
8332
|
+
}), e(this, "setAudioCodec", (e) => {
|
|
8333
|
+
this.targetSubscription.audio.codec = e, this.scheduleSubscriptionChange();
|
|
8334
|
+
}), e(this, "setBurst", (e) => {
|
|
8335
|
+
e ? this.targetSubscription.burstMs = e : delete this.targetSubscription.burstMs;
|
|
8336
|
+
}), e(this, "isNewSubscription", () => !kv(this.currentSubscription, this.targetSubscription)), e(this, "isRequestOutdated", () => this.requestedSubscription !== void 0 && !kv(this.requestedSubscription, this.targetSubscription)), e(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
|
|
8337
|
+
var n;
|
|
8338
|
+
this.logger.debug("onSubscriptionChanged", {
|
|
8339
|
+
to: e,
|
|
8340
|
+
reset: t
|
|
8341
|
+
}), t ? (this.targetSubscription = Dv(this.currentSubscription), this.requestedSubscription = void 0) : (this.currentSubscription = Dv(e), this.requestedSubscription && (kv(this.requestedSubscription, e) || kv(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();
|
|
8342
|
+
}), e(this, "armChannelSwitchDeadline", () => {
|
|
8343
|
+
let e = this.targetSubscription.channelId;
|
|
8344
|
+
this.channelSwitchTimeout || this.currentSubscription.channelId === e || (this.channelSwitchTimeout = {
|
|
8345
|
+
id: this.timers.setTimeout(() => {
|
|
8346
|
+
this.channelSwitchTimeout = void 0, this.logger.warn("Channel switch timeout", e);
|
|
8347
|
+
let { video: t, audio: n } = this.targetSubscription;
|
|
8348
|
+
this.targetSubscription = Dv(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();
|
|
8349
|
+
}, Av),
|
|
8350
|
+
channelId: e
|
|
8351
|
+
});
|
|
8352
|
+
}), e(this, "clearChannelSwitchTimeout", () => {
|
|
8353
|
+
this.channelSwitchTimeout && (this.timers.clearTimeout(this.channelSwitchTimeout.id), this.channelSwitchTimeout = void 0);
|
|
8354
|
+
}), e(this, "isSwitching", () => this.isNewSubscription() || this.isRequestOutdated()), e(this, "scheduleSubscriptionChange", () => {
|
|
8355
|
+
this.targetSubscription = Dv(this.targetSubscription);
|
|
8356
|
+
let e = this.isSwitching();
|
|
8357
|
+
this._isSwitchingSubscription = e || this._isSwitchingSubscription && this.requestedSubscription !== void 0;
|
|
8358
|
+
let t = this.targetSubscription.channelId, n = this.currentSubscription.channelId !== t;
|
|
8359
|
+
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));
|
|
8360
|
+
}), e(this, "sendTargetSubscription", () => {
|
|
8361
|
+
this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0);
|
|
8362
|
+
let e = Dv(this.targetSubscription);
|
|
8363
|
+
this.requestedSubscription = e, this.armChannelSwitchDeadline(), this.emitter.emit("send signal", {
|
|
8364
|
+
type: "subscribe",
|
|
8365
|
+
subscription: e
|
|
8366
|
+
});
|
|
8367
|
+
}), this.logger = t, this.targetSubscription = n, this.currentSubscription = Dv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
8368
|
+
}
|
|
8369
|
+
};
|
|
8370
|
+
Ev = jv, e(jv, "create", (e, t, n) => new Ev(e, n, t));
|
|
8371
|
+
//#endregion
|
|
8304
8372
|
//#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
|
|
8305
|
-
var
|
|
8373
|
+
var Mv = (e, t) => {
|
|
8306
8374
|
var n, r;
|
|
8307
8375
|
let i = new URL("/subscribe", e);
|
|
8308
8376
|
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 && 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();
|
|
8309
|
-
},
|
|
8377
|
+
}, Nv = (e) => {
|
|
8310
8378
|
try {
|
|
8311
8379
|
return e ? new URL(e).origin : void 0;
|
|
8312
8380
|
} catch (e) {
|
|
@@ -8315,11 +8383,11 @@ var Tv = (e, t) => {
|
|
|
8315
8383
|
};
|
|
8316
8384
|
//#endregion
|
|
8317
8385
|
//#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
|
|
8318
|
-
function
|
|
8386
|
+
function Pv(e, t, n) {
|
|
8319
8387
|
let r = new URL("/voq/subscribe", e);
|
|
8320
8388
|
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;
|
|
8321
8389
|
}
|
|
8322
|
-
function
|
|
8390
|
+
function Fv(e, t) {
|
|
8323
8391
|
let n = [];
|
|
8324
8392
|
for (let r of e == null ? [] : e) try {
|
|
8325
8393
|
n.push({
|
|
@@ -8334,73 +8402,75 @@ function Ov(e, t) {
|
|
|
8334
8402
|
}
|
|
8335
8403
|
return n.length > 0 ? n : void 0;
|
|
8336
8404
|
}
|
|
8337
|
-
function
|
|
8405
|
+
function Iv(e, t, n) {
|
|
8338
8406
|
return n !== void 0 && e.get("webtransportEnabled") && !e.get("unstableWebtransportEnabled") && !!self.WebTransport && t.protocol.startsWith("https") && Le();
|
|
8339
8407
|
}
|
|
8340
|
-
var
|
|
8408
|
+
var Lv = 1e4, Z = /* @__PURE__ */ new WeakMap(), Rv = /* @__PURE__ */ new WeakMap(), zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakMap(), Vv = /* @__PURE__ */ new WeakMap(), Hv = /* @__PURE__ */ new WeakMap(), Uv = /* @__PURE__ */ new WeakMap(), Wv = /* @__PURE__ */ new WeakMap(), Gv = /* @__PURE__ */ new WeakMap(), Kv = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakSet(), qv = /* @__PURE__ */ new WeakMap(), Jv = /* @__PURE__ */ new WeakMap(), Yv = /* @__PURE__ */ new WeakMap(), Xv = /* @__PURE__ */ new WeakMap(), Zv = /* @__PURE__ */ new WeakMap(), Qv = class r {
|
|
8341
8409
|
get estimatedBandwidth() {
|
|
8342
|
-
return s(
|
|
8410
|
+
return s(Wv, this);
|
|
8343
8411
|
}
|
|
8344
8412
|
unload() {
|
|
8345
|
-
s(
|
|
8413
|
+
s(Z, this).off("send signal", s(Jv, this)), s(Z, this).off("disconnect", this.disconnect), s(Z, this).off("text track", s(qv, this)), this.disconnect();
|
|
8346
8414
|
}
|
|
8347
8415
|
suspend() {}
|
|
8348
8416
|
unsuspend() {}
|
|
8349
8417
|
getStatistics() {
|
|
8350
|
-
let e = s(
|
|
8418
|
+
let e = s(zv, this).transportType() === "webtransport" ? "moq" : "moq_ws";
|
|
8351
8419
|
return {
|
|
8352
|
-
edgeUrl:
|
|
8420
|
+
edgeUrl: Nv(s(zv, this).url()),
|
|
8353
8421
|
connectionProtocol: e,
|
|
8354
|
-
transportSelectionReason: s(
|
|
8422
|
+
transportSelectionReason: s(Gv, this)
|
|
8355
8423
|
};
|
|
8356
8424
|
}
|
|
8357
8425
|
constructor(t, r, c, l, u, d, f, p) {
|
|
8358
|
-
x(this,
|
|
8426
|
+
x(this, $), i(this, Z, void 0), i(this, Rv, void 0), i(this, zv, void 0), i(this, Bv, "disconnected"), i(this, Q, void 0), i(this, Vv, /* @__PURE__ */ new Map()), i(this, Hv, void 0), i(this, Uv, void 0), i(this, Wv, void 0), i(this, Gv, void 0), i(this, Kv, /* @__PURE__ */ new Map()), i(this, qv, (e) => {
|
|
8359
8427
|
if (!e) {
|
|
8360
|
-
s(
|
|
8428
|
+
s(Q, this).setSubtitleTrack(void 0).catch(n);
|
|
8361
8429
|
return;
|
|
8362
8430
|
}
|
|
8363
|
-
let t = s(
|
|
8364
|
-
r && s(
|
|
8365
|
-
}), i(this,
|
|
8431
|
+
let t = s(Vv, this).get(Eh(s(Q, this).namespace())), r = t == null ? void 0 : t.getTextTrack(e);
|
|
8432
|
+
r && s(Q, this).setSubtitleTrack(r).catch(n);
|
|
8433
|
+
}), i(this, Jv, (e) => {
|
|
8366
8434
|
switch (e.type) {
|
|
8367
8435
|
case "subscribe":
|
|
8368
|
-
|
|
8369
|
-
s(
|
|
8370
|
-
|
|
8436
|
+
{
|
|
8437
|
+
if (s(Yv, this)) return;
|
|
8438
|
+
let t = s(Zv, this);
|
|
8439
|
+
if (t) {
|
|
8440
|
+
if (kv(t, e.subscription)) {
|
|
8441
|
+
a(Xv, this, void 0);
|
|
8442
|
+
return;
|
|
8443
|
+
}
|
|
8444
|
+
s(Rv, this).info("Queueing - we are already switching"), a(Xv, this, e.subscription);
|
|
8445
|
+
return;
|
|
8446
|
+
}
|
|
8447
|
+
o($, this, ty).call(this, e.subscription);
|
|
8371
8448
|
}
|
|
8372
|
-
a(Uv, this, !0), o(Bv, this, qv).call(this, e.subscription).catch((t) => {
|
|
8373
|
-
s(jv, this).error("error handling subscription", t), s(Q, this).emit("received signal", {
|
|
8374
|
-
type: "subscription changed",
|
|
8375
|
-
subscription: e.subscription,
|
|
8376
|
-
reset: !0
|
|
8377
|
-
});
|
|
8378
|
-
}).finally(() => a(Uv, this, !1));
|
|
8379
8449
|
break;
|
|
8380
8450
|
case "telemetry":
|
|
8381
|
-
m(new URL("/api/telemetry", s(
|
|
8451
|
+
m(new URL("/api/telemetry", s(zv, this).url().replace("wss://", "https://")), {
|
|
8382
8452
|
body: e.body,
|
|
8383
8453
|
headers: { "Content-Type": "text/plain" }
|
|
8384
8454
|
}).catch(n);
|
|
8385
8455
|
break;
|
|
8386
8456
|
case "refresh auth":
|
|
8387
|
-
s(
|
|
8457
|
+
s(zv, this).updateAuthToken(e.token);
|
|
8388
8458
|
break;
|
|
8389
8459
|
}
|
|
8390
|
-
}), i(this,
|
|
8391
|
-
s(
|
|
8392
|
-
}), a(
|
|
8460
|
+
}), i(this, Yv, !1), i(this, Xv, void 0), i(this, Zv, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
|
|
8461
|
+
s(Rv, this).info("Disconnecting", e), o($, this, ey).call(this), s(zv, this).close(), s(Q, this).close().catch(n), a(Kv, this, /* @__PURE__ */ new Map()), o($, this, iy).call(this, "disconnected");
|
|
8462
|
+
}), a(Z, this, t), a(Rv, this, r), a(zv, this, c), a(Q, this, l), a(Vv, this, u), a(Hv, this, d), a(Uv, this, f), a(Gv, this, p), s(Z, this).on("send signal", s(Jv, this)), s(Z, this).on("disconnect", this.disconnect), s(Z, this).on("text track", s(qv, this)), o($, this, $v).call(this).catch(n), o($, this, ay).call(this).catch(n);
|
|
8393
8463
|
}
|
|
8394
8464
|
static start(e, n, i, a, o) {
|
|
8395
8465
|
return t(function* () {
|
|
8396
8466
|
var t, c, l, u;
|
|
8397
|
-
let f = new Map(a.connectInfo.channels.map((e) => [Eh(e.catalog.namespace), new
|
|
8467
|
+
let f = new Map(a.connectInfo.channels.map((e) => [Eh(e.catalog.namespace), new fy(new D(e.catalog))])), p = yield a.onConnectInfo(a.connectInfo), m = a.options.get("authenticationToken"), h, g, ee;
|
|
8398
8468
|
switch (typeof a.edgeUrl) {
|
|
8399
8469
|
case "string":
|
|
8400
|
-
h =
|
|
8470
|
+
h = Pv(a.edgeUrl, p, m);
|
|
8401
8471
|
break;
|
|
8402
8472
|
default:
|
|
8403
|
-
h =
|
|
8473
|
+
h = Pv(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, p, m), g = Pv(a.edgeUrl.moqWsUrl, p, m), ee = Fv(a.edgeUrl.serverCertificateHashes, n);
|
|
8404
8474
|
break;
|
|
8405
8475
|
}
|
|
8406
8476
|
let _ = (t = a.connectInfo.channels.find((e) => e.channelId === p.channelId)) == null ? void 0 : t.catalog;
|
|
@@ -8408,7 +8478,7 @@ var Av = 1e4, Q = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMa
|
|
|
8408
8478
|
edgeUrl: h,
|
|
8409
8479
|
edgeWsUrl: g
|
|
8410
8480
|
}), d(_, "no catalog found");
|
|
8411
|
-
let te = (c = f.get(Eh(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), v = (l = f.get(Eh(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), ne =
|
|
8481
|
+
let te = (c = f.get(Eh(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), v = (l = f.get(Eh(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), ne = Iv(a.options, h, g), re;
|
|
8412
8482
|
try {
|
|
8413
8483
|
re = yield vh({
|
|
8414
8484
|
url: h,
|
|
@@ -8430,20 +8500,20 @@ var Av = 1e4, Q = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMa
|
|
|
8430
8500
|
}), ae;
|
|
8431
8501
|
try {
|
|
8432
8502
|
ae = yield Promise.race([
|
|
8433
|
-
|
|
8503
|
+
yv.start(y.subscriber, {
|
|
8434
8504
|
namespace: _.namespace,
|
|
8435
8505
|
catalog: _,
|
|
8436
8506
|
videoTrack: te == null ? void 0 : te.track,
|
|
8437
8507
|
audioTrack: v == null ? void 0 : v.track,
|
|
8438
8508
|
burstMs: p.burstMs || 0
|
|
8439
8509
|
}),
|
|
8440
|
-
un(
|
|
8510
|
+
un(Lv, /* @__PURE__ */ Error("Timeout waiting for player to start")),
|
|
8441
8511
|
ie
|
|
8442
8512
|
]);
|
|
8443
8513
|
} catch (e) {
|
|
8444
8514
|
throw y.close(), e;
|
|
8445
8515
|
}
|
|
8446
|
-
let x = new
|
|
8516
|
+
let x = new fy(ae.catalog());
|
|
8447
8517
|
f.set(Eh(_.namespace), x), e.emit("received signal", {
|
|
8448
8518
|
type: "client ip",
|
|
8449
8519
|
ip: ae.connectionInfo().ip
|
|
@@ -8453,28 +8523,28 @@ var Av = 1e4, Q = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMa
|
|
|
8453
8523
|
n.error("Error getting DRM data", e);
|
|
8454
8524
|
});
|
|
8455
8525
|
let oe = new r(e, n, y, ae, f, i, o, b);
|
|
8456
|
-
return p.textTrack && s(
|
|
8526
|
+
return p.textTrack && s(qv, oe).call(oe, p.textTrack), oe;
|
|
8457
8527
|
})();
|
|
8458
8528
|
}
|
|
8459
8529
|
getState() {
|
|
8460
|
-
return s(
|
|
8530
|
+
return s(Bv, this);
|
|
8461
8531
|
}
|
|
8462
8532
|
close() {
|
|
8463
|
-
s(
|
|
8533
|
+
o($, this, ey).call(this), s(zv, this).close();
|
|
8464
8534
|
}
|
|
8465
8535
|
closed() {
|
|
8466
|
-
return Promise.race([s(
|
|
8536
|
+
return Promise.race([s(zv, this).closed(), s(Q, this).closed()]);
|
|
8467
8537
|
}
|
|
8468
8538
|
};
|
|
8469
|
-
function
|
|
8539
|
+
function $v() {
|
|
8470
8540
|
var e = this;
|
|
8471
8541
|
return t(function* () {
|
|
8472
|
-
s(
|
|
8542
|
+
s(zv, e).transportType() === "websocket" && (yield ln(5e3));
|
|
8473
8543
|
var t = !1, n = !1, r;
|
|
8474
8544
|
try {
|
|
8475
|
-
for (var i = V(s(
|
|
8545
|
+
for (var i = V(s(Q, e).stats()), o; t = !(o = yield i.next()).done; t = !1) {
|
|
8476
8546
|
let { rtt: t, estimatedBandwidth: n } = o.value;
|
|
8477
|
-
a(
|
|
8547
|
+
a(Wv, e, n), s(Uv, e).push(t), s(Z, e).emit("rtt", vt(s(Uv, e).items()));
|
|
8478
8548
|
}
|
|
8479
8549
|
} catch (e) {
|
|
8480
8550
|
n = !0, r = e;
|
|
@@ -8487,76 +8557,95 @@ function Gv() {
|
|
|
8487
8557
|
}
|
|
8488
8558
|
})();
|
|
8489
8559
|
}
|
|
8490
|
-
function
|
|
8560
|
+
function ey() {
|
|
8561
|
+
a(Yv, this, !0), a(Xv, this, void 0);
|
|
8562
|
+
}
|
|
8563
|
+
function ty(e) {
|
|
8564
|
+
a(Zv, this, e), o($, this, ry).call(this, e).catch((t) => {
|
|
8565
|
+
s(Rv, this).error("error handling subscription", t);
|
|
8566
|
+
let n = s(Xv, this);
|
|
8567
|
+
a(Xv, this, void 0), s(Z, this).emit("received signal", {
|
|
8568
|
+
type: "subscription changed",
|
|
8569
|
+
subscription: n == null ? e : n,
|
|
8570
|
+
reset: !0
|
|
8571
|
+
});
|
|
8572
|
+
}).finally(() => {
|
|
8573
|
+
a(Zv, this, void 0);
|
|
8574
|
+
let e = s(Xv, this);
|
|
8575
|
+
a(Xv, this, void 0), e && !s(Yv, this) && o($, this, ty).call(this, e);
|
|
8576
|
+
});
|
|
8577
|
+
}
|
|
8578
|
+
function ny(e) {
|
|
8491
8579
|
var n = this;
|
|
8492
8580
|
return t(function* () {
|
|
8493
8581
|
var t;
|
|
8494
|
-
let r = yield s(
|
|
8582
|
+
let r = yield s(Hv, n).connect({ channelId: e });
|
|
8495
8583
|
if (!c(r)) throw Error("no moq connect info found");
|
|
8496
8584
|
let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
|
|
8497
8585
|
if (!i) throw Error("no catalog found");
|
|
8498
8586
|
return i;
|
|
8499
8587
|
})();
|
|
8500
8588
|
}
|
|
8501
|
-
function
|
|
8589
|
+
function ry(e) {
|
|
8502
8590
|
var n = this;
|
|
8503
8591
|
return t(function* () {
|
|
8504
8592
|
var t, r;
|
|
8505
|
-
s(
|
|
8506
|
-
let i = s(
|
|
8507
|
-
if (a || (a = new
|
|
8593
|
+
s(Rv, n).info("handle subscription", e);
|
|
8594
|
+
let i = s(Q, n), a = s(Vv, n).get(e.channelId);
|
|
8595
|
+
if (a || (a = new fy(new D(yield o($, n, ny).call(n, e.channelId))), s(Vv, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
|
|
8508
8596
|
var c;
|
|
8509
|
-
s(
|
|
8597
|
+
s(Rv, n).info("changing channel", e.channelId);
|
|
8510
8598
|
let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
|
|
8511
|
-
yield i.zap({
|
|
8599
|
+
if (yield i.zap({
|
|
8512
8600
|
namespace: a.namespace(),
|
|
8513
8601
|
catalog: a.catalog(),
|
|
8514
8602
|
videoTrack: t == null ? void 0 : t.track,
|
|
8515
8603
|
audioTrack: r == null ? void 0 : r.track
|
|
8516
8604
|
}, 500), i.drm().then((e) => {
|
|
8517
|
-
e && s(
|
|
8605
|
+
e && s(Z, n).emit("received drm data", e.value);
|
|
8518
8606
|
}).catch((e) => {
|
|
8519
|
-
s(
|
|
8520
|
-
}), s(
|
|
8607
|
+
s(Rv, n).error("Error getting DRM data", e);
|
|
8608
|
+
}), s(Rv, n).info("switched channel", e.channelId), (c = s(Vv, n).get(Eh(i.namespace()))) == null || c.updateCatalog(i.catalog()), s(Yv, n)) return;
|
|
8609
|
+
s(Z, n).emit("received signal", {
|
|
8521
8610
|
type: "subscription changed",
|
|
8522
8611
|
subscription: e
|
|
8523
8612
|
});
|
|
8524
8613
|
return;
|
|
8525
8614
|
}
|
|
8526
8615
|
let l = a.getVideoTrack(e.video), u = a.getAudioTrack(e.audio);
|
|
8527
|
-
yield Promise.all([l && l.track.name !== ((t = s(
|
|
8616
|
+
yield Promise.all([l && l.track.name !== ((t = s(Q, n).videoTrack()) == null ? void 0 : t.name) ? s(Q, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = s(Q, n).audioTrack()) == null ? void 0 : r.name) ? s(Q, n).setAudioTrack(u.track) : void 0]), !s(Yv, n) && s(Z, n).emit("received signal", {
|
|
8528
8617
|
type: "subscription changed",
|
|
8529
8618
|
subscription: e
|
|
8530
8619
|
});
|
|
8531
8620
|
})();
|
|
8532
8621
|
}
|
|
8533
|
-
function
|
|
8534
|
-
a(
|
|
8622
|
+
function iy(e) {
|
|
8623
|
+
a(Bv, this, e), s(Z, this).emit("connection state", e);
|
|
8535
8624
|
}
|
|
8536
|
-
function
|
|
8625
|
+
function ay() {
|
|
8537
8626
|
var e = this;
|
|
8538
8627
|
return t(function* () {
|
|
8539
8628
|
try {
|
|
8540
|
-
o(
|
|
8541
|
-
o(
|
|
8542
|
-
o(
|
|
8543
|
-
o(
|
|
8544
|
-
]), yield s(
|
|
8629
|
+
o($, e, iy).call(e, "connecting"), s(Rv, e).info("Connecting..."), o($, e, iy).call(e, "connected"), yield Promise.all([
|
|
8630
|
+
o($, e, sy).call(e, s(Q, e).referenceClock(), s(Q, e).audio),
|
|
8631
|
+
o($, e, sy).call(e, s(Q, e).referenceClock(), s(Q, e).video),
|
|
8632
|
+
o($, e, oy).call(e, s(Q, e).subtitles)
|
|
8633
|
+
]), yield s(Q, e).closed(), s(zv, e).close(), s(Rv, e).info("Session closed");
|
|
8545
8634
|
} catch (t) {
|
|
8546
|
-
s(
|
|
8635
|
+
s(Rv, e).warn("Session error", t), s(zv, e).close();
|
|
8547
8636
|
} finally {
|
|
8548
|
-
o(
|
|
8637
|
+
o($, e, iy).call(e, "disconnected");
|
|
8549
8638
|
}
|
|
8550
8639
|
})();
|
|
8551
8640
|
}
|
|
8552
|
-
function
|
|
8641
|
+
function oy(e) {
|
|
8553
8642
|
var n = this;
|
|
8554
8643
|
return t(function* () {
|
|
8555
8644
|
var t = !1, r = !1, i;
|
|
8556
8645
|
try {
|
|
8557
8646
|
for (var a = V(e), o; t = !(o = yield a.next()).done; t = !1) {
|
|
8558
8647
|
let e = o.value;
|
|
8559
|
-
s(
|
|
8648
|
+
s(Z, n).emit("text track data", e);
|
|
8560
8649
|
}
|
|
8561
8650
|
} catch (e) {
|
|
8562
8651
|
r = !0, i = e;
|
|
@@ -8569,10 +8658,10 @@ function Xv(e) {
|
|
|
8569
8658
|
}
|
|
8570
8659
|
})();
|
|
8571
8660
|
}
|
|
8572
|
-
function
|
|
8661
|
+
function sy(e, n) {
|
|
8573
8662
|
var r = this;
|
|
8574
8663
|
return t(function* () {
|
|
8575
|
-
let t = "", i = "", a, o = s(
|
|
8664
|
+
let t = "", i = "", a, o = s(Q, r).videoTrack() === void 0;
|
|
8576
8665
|
var c = !1, l = !1, u;
|
|
8577
8666
|
try {
|
|
8578
8667
|
for (var d = V(n), f; c = !(f = yield d.next()).done; c = !1) {
|
|
@@ -8594,18 +8683,18 @@ function Zv(e, n) {
|
|
|
8594
8683
|
drmTransition: a !== void 0 && a !== v
|
|
8595
8684
|
};
|
|
8596
8685
|
t = c, i = l, a = v;
|
|
8597
|
-
let g = m.producerReferenceTime(), ee = s(
|
|
8686
|
+
let g = m.producerReferenceTime(), ee = s(Kv, r).get(n.track.namespace), _ = performance.now();
|
|
8598
8687
|
if (g && (ee === void 0 || _ - ee > 1e3)) {
|
|
8599
|
-
s(
|
|
8688
|
+
s(Kv, r).set(n.track.namespace, _);
|
|
8600
8689
|
let t = e.wallclock() - g.getTime();
|
|
8601
|
-
s(
|
|
8690
|
+
s(Rv, r).debug("timing-info", {
|
|
8602
8691
|
mediaType: m.mediaType(),
|
|
8603
8692
|
referenceClock: e,
|
|
8604
8693
|
delta: t,
|
|
8605
8694
|
groupId: p,
|
|
8606
8695
|
timestamp: m.baseMediaDecodeTime() / m.timescale() * 1e3 + t,
|
|
8607
8696
|
wallclockTime: g.getTime()
|
|
8608
|
-
}), s(
|
|
8697
|
+
}), s(Z, r).emit("received signal", {
|
|
8609
8698
|
type: "timing info",
|
|
8610
8699
|
timingInfo: {
|
|
8611
8700
|
channelId: c,
|
|
@@ -8614,7 +8703,7 @@ function Zv(e, n) {
|
|
|
8614
8703
|
}
|
|
8615
8704
|
});
|
|
8616
8705
|
}
|
|
8617
|
-
s(
|
|
8706
|
+
s(Z, r).emit("received moq data", {
|
|
8618
8707
|
payload: m,
|
|
8619
8708
|
channelId: c,
|
|
8620
8709
|
groupId: p,
|
|
@@ -8622,7 +8711,7 @@ function Zv(e, n) {
|
|
|
8622
8711
|
codec: u,
|
|
8623
8712
|
codecString: d,
|
|
8624
8713
|
switchInfo: h,
|
|
8625
|
-
renditionId:
|
|
8714
|
+
renditionId: cy(n.track.trackObject.name)
|
|
8626
8715
|
});
|
|
8627
8716
|
}
|
|
8628
8717
|
}
|
|
@@ -8648,48 +8737,48 @@ function Zv(e, n) {
|
|
|
8648
8737
|
}
|
|
8649
8738
|
})();
|
|
8650
8739
|
}
|
|
8651
|
-
function
|
|
8740
|
+
function cy(e) {
|
|
8652
8741
|
return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
|
|
8653
8742
|
}
|
|
8654
|
-
var
|
|
8743
|
+
var ly = /* @__PURE__ */ new WeakMap(), uy = /* @__PURE__ */ new WeakMap(), dy = /* @__PURE__ */ new WeakSet(), fy = class {
|
|
8655
8744
|
constructor(e) {
|
|
8656
|
-
x(this,
|
|
8745
|
+
x(this, dy), i(this, ly, void 0), i(this, uy, void 0), a(ly, this, e), a(uy, this, o(dy, this, py).call(this));
|
|
8657
8746
|
}
|
|
8658
8747
|
catalog() {
|
|
8659
|
-
return s(
|
|
8748
|
+
return s(ly, this).current();
|
|
8660
8749
|
}
|
|
8661
8750
|
namespace() {
|
|
8662
|
-
return s(
|
|
8751
|
+
return s(ly, this).current().namespace;
|
|
8663
8752
|
}
|
|
8664
8753
|
updateCatalog(e) {
|
|
8665
|
-
a(
|
|
8754
|
+
a(ly, this, e);
|
|
8666
8755
|
}
|
|
8667
8756
|
getTextTrack(e) {
|
|
8668
|
-
return s(
|
|
8757
|
+
return s(ly, this).current().tracks.find((t) => t.label === e);
|
|
8669
8758
|
}
|
|
8670
8759
|
getAudioTrack(e) {
|
|
8671
8760
|
if (!e.codec) return;
|
|
8672
|
-
let t = s(
|
|
8761
|
+
let t = s(uy, this).filter((t) => !(!fn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
|
|
8673
8762
|
return t[t.length - 1];
|
|
8674
8763
|
}
|
|
8675
8764
|
getVideoTrack(e) {
|
|
8676
8765
|
if (!e.codec) return;
|
|
8677
|
-
let t = s(
|
|
8766
|
+
let t = s(uy, this).filter((t) => !(!dn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
|
|
8678
8767
|
return t[t.length - 1];
|
|
8679
8768
|
}
|
|
8680
8769
|
renditions() {
|
|
8681
|
-
return s(
|
|
8770
|
+
return s(uy, this);
|
|
8682
8771
|
}
|
|
8683
8772
|
};
|
|
8684
|
-
function
|
|
8685
|
-
let [e, t] = s(
|
|
8773
|
+
function py() {
|
|
8774
|
+
let [e, t] = s(ly, this).value();
|
|
8686
8775
|
return u(e);
|
|
8687
8776
|
}
|
|
8688
8777
|
//#endregion
|
|
8689
8778
|
//#region ../../libs/web-sdk/src/transports/WebSocket.ts
|
|
8690
|
-
var
|
|
8779
|
+
var my = /* @__PURE__ */ function(e) {
|
|
8691
8780
|
return e[e.AuthenticationFailed = 4e3] = "AuthenticationFailed", e[e.AuthenticationRefreshFailed = 4001] = "AuthenticationRefreshFailed", e[e.AuthenticationExpired = 4002] = "AuthenticationExpired", e[e.ChannelNotFound = 4003] = "ChannelNotFound", e[e.Inactivity = 4010] = "Inactivity", e;
|
|
8692
|
-
}({}),
|
|
8781
|
+
}({}), hy = class extends ie {
|
|
8693
8782
|
constructor(r, i) {
|
|
8694
8783
|
var a;
|
|
8695
8784
|
super(), a = 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, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
|
|
@@ -8727,19 +8816,19 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8727
8816
|
})), this.close("websocket was closed");
|
|
8728
8817
|
let n;
|
|
8729
8818
|
switch (e.code) {
|
|
8730
|
-
case
|
|
8819
|
+
case my.AuthenticationFailed:
|
|
8731
8820
|
n = qn(Kn());
|
|
8732
8821
|
break;
|
|
8733
|
-
case
|
|
8822
|
+
case my.AuthenticationRefreshFailed:
|
|
8734
8823
|
n = qn(Kn());
|
|
8735
8824
|
break;
|
|
8736
|
-
case
|
|
8825
|
+
case my.AuthenticationExpired:
|
|
8737
8826
|
n = Jn(Kn());
|
|
8738
8827
|
break;
|
|
8739
|
-
case
|
|
8828
|
+
case my.ChannelNotFound:
|
|
8740
8829
|
n = Xn("internal", Kn());
|
|
8741
8830
|
break;
|
|
8742
|
-
case
|
|
8831
|
+
case my.Inactivity:
|
|
8743
8832
|
n = Yn("internal", Kn());
|
|
8744
8833
|
break;
|
|
8745
8834
|
default: t && (n = $n(/* @__PURE__ */ Error("WebSocket closed before open")));
|
|
@@ -8790,10 +8879,10 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8790
8879
|
get connectTime() {
|
|
8791
8880
|
return this._connectTime;
|
|
8792
8881
|
}
|
|
8793
|
-
},
|
|
8794
|
-
let t = e ||
|
|
8795
|
-
return
|
|
8796
|
-
},
|
|
8882
|
+
}, gy, _y = 65536 * 8, vy = .9, yy = 40, by = (e) => {
|
|
8883
|
+
let t = e || yy;
|
|
8884
|
+
return _y * vy * 1e3 / t;
|
|
8885
|
+
}, xy = class r {
|
|
8797
8886
|
constructor(i, a, o, s) {
|
|
8798
8887
|
var c = this;
|
|
8799
8888
|
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, "connectCount", 0), e(this, "missedPings", 0), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new S()), e(this, "unload", () => {
|
|
@@ -8815,7 +8904,7 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8815
8904
|
}
|
|
8816
8905
|
this.transport.send(JSON.stringify(e));
|
|
8817
8906
|
}), e(this, "getStatistics", () => ({
|
|
8818
|
-
edgeUrl:
|
|
8907
|
+
edgeUrl: Nv(this.config.edgeUrl),
|
|
8819
8908
|
connectionProtocol: "vindral_ws",
|
|
8820
8909
|
transportSelectionReason: void 0
|
|
8821
8910
|
})), e(this, "onMessage", (e) => {
|
|
@@ -8842,7 +8931,7 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8842
8931
|
}
|
|
8843
8932
|
this.handleMessage(e);
|
|
8844
8933
|
}), e(this, "resolveEdgeUrl", t(function* () {
|
|
8845
|
-
let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n =
|
|
8934
|
+
let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = Mv(c.config.edgeUrl, {
|
|
8846
8935
|
video: t.video,
|
|
8847
8936
|
audio: t.audio,
|
|
8848
8937
|
burstMs: t.burstMs,
|
|
@@ -8879,7 +8968,7 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8879
8968
|
}
|
|
8880
8969
|
}
|
|
8881
8970
|
}), e(this, "connectWebSocketTransport", () => {
|
|
8882
|
-
let e = new
|
|
8971
|
+
let e = new hy({
|
|
8883
8972
|
reconnectDelay: 1e3,
|
|
8884
8973
|
onMessage: this.onMessage,
|
|
8885
8974
|
reconnectHandler: this.config.reconnectHandler,
|
|
@@ -8914,8 +9003,8 @@ var iy = /* @__PURE__ */ function(e) {
|
|
|
8914
9003
|
return this.disconnected.promise;
|
|
8915
9004
|
}
|
|
8916
9005
|
};
|
|
8917
|
-
|
|
8918
|
-
let o = new
|
|
9006
|
+
gy = xy, e(xy, "PING_INTERVAL", 5e3), e(xy, "MAX_MISSED_PINGS", 4), e(xy, "TLS_ROUNDTRIPS", 3), e(xy, "start", (e, t, n, r) => new Promise((i, a) => {
|
|
9007
|
+
let o = new gy(e, t, n, r);
|
|
8919
9008
|
o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
|
|
8920
9009
|
var e;
|
|
8921
9010
|
(e = n.onTransportConnected) == null || e.call(n), i(o);
|
|
@@ -8923,51 +9012,51 @@ oy = dy, e(dy, "PING_INTERVAL", 5e3), e(dy, "MAX_MISSED_PINGS", 4), e(dy, "TLS_R
|
|
|
8923
9012
|
}));
|
|
8924
9013
|
//#endregion
|
|
8925
9014
|
//#region ../../libs/web-sdk/src/EdgeSelector.ts
|
|
8926
|
-
var
|
|
9015
|
+
var Sy = (e) => {
|
|
8927
9016
|
var t;
|
|
8928
9017
|
return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
|
|
8929
|
-
},
|
|
9018
|
+
}, Cy = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, wy = /* @__PURE__ */ new WeakMap(), Ty = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = class {
|
|
8930
9019
|
constructor(e) {
|
|
8931
|
-
i(this,
|
|
9020
|
+
i(this, wy, void 0), i(this, Ty, []), i(this, Ey, /* @__PURE__ */ new Set()), i(this, Dy, void 0), a(wy, this, e);
|
|
8932
9021
|
}
|
|
8933
9022
|
select(e) {
|
|
8934
|
-
if (s(
|
|
9023
|
+
if (s(wy, this).edgeUrl) return s(wy, this).edgeUrl;
|
|
8935
9024
|
if (e.length > 0) {
|
|
8936
|
-
a(
|
|
8937
|
-
let t = new Set(s(
|
|
8938
|
-
for (let e of s(
|
|
9025
|
+
a(Ty, this, [...e]);
|
|
9026
|
+
let t = new Set(s(Ty, this).map((e) => Sy(e)));
|
|
9027
|
+
for (let e of s(Ey, this)) t.has(e) || s(Ey, this).delete(e);
|
|
8939
9028
|
}
|
|
8940
|
-
if (s(
|
|
8941
|
-
let t = s(
|
|
8942
|
-
t.length === 0 && (s(
|
|
9029
|
+
if (s(Ty, this).length === 0) return;
|
|
9030
|
+
let t = s(Ty, this).filter((e) => !s(Ey, this).has(Sy(e)));
|
|
9031
|
+
t.length === 0 && (s(Ey, this).clear(), t = s(Ty, this));
|
|
8943
9032
|
let n = t[0];
|
|
8944
|
-
if (n) return s(
|
|
9033
|
+
if (n) return s(Ey, this).add(Sy(n)), a(Dy, this, n), n;
|
|
8945
9034
|
}
|
|
8946
9035
|
shiftedEdge() {
|
|
8947
|
-
return s(
|
|
9036
|
+
return s(Dy, this);
|
|
8948
9037
|
}
|
|
8949
9038
|
hasRemainingEdges() {
|
|
8950
|
-
return s(
|
|
9039
|
+
return s(Ty, this).some((e) => !s(Ey, this).has(Sy(e)));
|
|
8951
9040
|
}
|
|
8952
9041
|
reset() {
|
|
8953
|
-
a(
|
|
9042
|
+
a(Dy, this, void 0), a(Ty, this, []), s(Ey, this).clear();
|
|
8954
9043
|
}
|
|
8955
|
-
},
|
|
9044
|
+
}, ky, Ay = /* @__PURE__ */ new WeakMap(), jy = /* @__PURE__ */ new WeakMap(), My = /* @__PURE__ */ new WeakMap(), Ny = /* @__PURE__ */ new WeakMap(), Py = /* @__PURE__ */ new WeakMap(), Fy = /* @__PURE__ */ new WeakMap(), Iy = /* @__PURE__ */ new WeakMap(), Ly = /* @__PURE__ */ new WeakMap(), Ry = /* @__PURE__ */ new WeakMap(), zy = /* @__PURE__ */ new WeakMap(), By = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMap(), Hy = /* @__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 WeakSet(), Xy = /* @__PURE__ */ new WeakMap(), Zy = /* @__PURE__ */ new WeakMap(), Qy = /* @__PURE__ */ new WeakMap(), $y = /* @__PURE__ */ new WeakMap(), eb = /* @__PURE__ */ new WeakMap(), tb = /* @__PURE__ */ new WeakMap(), nb = class n {
|
|
8956
9045
|
constructor(c, l, u) {
|
|
8957
9046
|
var d = this;
|
|
8958
|
-
x(this,
|
|
9047
|
+
x(this, Yy), 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), i(this, Ay, new r(10)), i(this, jy, !0), i(this, My, void 0), i(this, Ny, 0), i(this, Py, 0), i(this, Fy, 0), i(this, Iy, void 0), i(this, Ly, void 0), i(this, Ry, void 0), i(this, zy, void 0), i(this, By, void 0), i(this, Vy, void 0), i(this, Hy, void 0), i(this, Uy, []), i(this, Wy, void 0), e(this, "unload", () => {
|
|
8959
9048
|
var e;
|
|
8960
|
-
this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(
|
|
9049
|
+
this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(Hy, this, void 0), this.logger.debug("Unloaded module");
|
|
8961
9050
|
}), e(this, "suspend", () => {
|
|
8962
9051
|
var e;
|
|
8963
|
-
a(
|
|
9052
|
+
a(jy, this, !1), (e = this.connectionImpl) == null || e.suspend();
|
|
8964
9053
|
}), e(this, "unsuspend", () => {
|
|
8965
9054
|
var e;
|
|
8966
|
-
a(
|
|
9055
|
+
a(jy, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
|
|
8967
9056
|
}), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
|
|
8968
|
-
let e = s(
|
|
9057
|
+
let e = s(Py, this) > 0 ? s(Fy, this) / s(Py, this) : 0;
|
|
8969
9058
|
if (!this.connectionImpl) {
|
|
8970
|
-
let t = s(
|
|
9059
|
+
let t = s(Gy, this).call(this);
|
|
8971
9060
|
return {
|
|
8972
9061
|
rtt: {
|
|
8973
9062
|
min: 0,
|
|
@@ -8976,35 +9065,35 @@ var fy = (e) => {
|
|
|
8976
9065
|
last: 0
|
|
8977
9066
|
},
|
|
8978
9067
|
estimatedBandwidth: 0,
|
|
8979
|
-
connectCount: s(
|
|
8980
|
-
connectionAttemptCount: s(
|
|
9068
|
+
connectCount: s(Fy, this),
|
|
9069
|
+
connectionAttemptCount: s(Py, this),
|
|
8981
9070
|
connectionSuccessRatio: e,
|
|
8982
|
-
timeToConnected: s(
|
|
9071
|
+
timeToConnected: s(zy, this),
|
|
8983
9072
|
edgeUrl: t == null ? void 0 : t.edgeUrl,
|
|
8984
9073
|
connectionProtocol: t == null ? void 0 : t.connectionProtocol,
|
|
8985
9074
|
transportSelectionReason: t == null ? void 0 : t.transportSelectionReason
|
|
8986
9075
|
};
|
|
8987
9076
|
}
|
|
8988
9077
|
return y(y({}, this.connectionImpl.getStatistics()), {}, {
|
|
8989
|
-
rtt: xt(s(
|
|
9078
|
+
rtt: xt(s(Ay, this).items()),
|
|
8990
9079
|
estimatedBandwidth: this.estimatedBandwidth,
|
|
8991
|
-
connectCount: s(
|
|
8992
|
-
connectionAttemptCount: s(
|
|
9080
|
+
connectCount: s(Fy, this),
|
|
9081
|
+
connectionAttemptCount: s(Py, this),
|
|
8993
9082
|
connectionSuccessRatio: e,
|
|
8994
|
-
timeToConnected: s(
|
|
9083
|
+
timeToConnected: s(zy, this)
|
|
8995
9084
|
});
|
|
8996
|
-
}), i(this,
|
|
8997
|
-
if (a(
|
|
9085
|
+
}), i(this, Gy, () => s(jy, this) && s(Vy, this) ? s(Vy, this) : s(By, this)), e(this, "connect", () => {
|
|
9086
|
+
if (a(jy, this, !0), s(My, this)) return;
|
|
8998
9087
|
let e = performance.now();
|
|
8999
|
-
s(
|
|
9000
|
-
}), i(this,
|
|
9001
|
-
s(
|
|
9088
|
+
s(zy, this) === void 0 && a(Iy, this, e), s(Ly, this) === void 0 && a(Ly, this, e), a(My, this, o(Yy, this, rb).call(this));
|
|
9089
|
+
}), i(this, Ky, () => {
|
|
9090
|
+
s(zy, this) !== void 0 || s(Iy, this) === void 0 || !s(jy, this) || (a(zy, this, performance.now() - s(Iy, this)), a(Iy, this, void 0));
|
|
9002
9091
|
}), e(this, "disconnect", (e = "Disconnect Requested") => {
|
|
9003
9092
|
var t;
|
|
9004
|
-
a(
|
|
9093
|
+
a(jy, this, !1), s(Zy, this).call(this), (t = this.connectionImpl) == null || t.close(e);
|
|
9005
9094
|
}), e(this, "reconnect", (e) => {
|
|
9006
9095
|
this.disconnect(e), this.connect();
|
|
9007
|
-
}), i(this,
|
|
9096
|
+
}), i(this, qy, t(function* () {
|
|
9008
9097
|
try {
|
|
9009
9098
|
return yield d.apiClient.connect(d.config.options.getOptions());
|
|
9010
9099
|
} catch (e) {
|
|
@@ -9015,7 +9104,7 @@ var fy = (e) => {
|
|
|
9015
9104
|
}
|
|
9016
9105
|
throw d.emitter.emit("error", $n(e instanceof Error ? e : void 0)), e;
|
|
9017
9106
|
}
|
|
9018
|
-
})), i(this,
|
|
9107
|
+
})), i(this, Jy, t(function* () {
|
|
9019
9108
|
let e = performance.now(), t = () => performance.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
|
|
9020
9109
|
try {
|
|
9021
9110
|
return yield fetch(new URL("/api/v4/connect/ping", d.config.options.get("url")).toString(), {
|
|
@@ -9027,27 +9116,27 @@ var fy = (e) => {
|
|
|
9027
9116
|
} finally {
|
|
9028
9117
|
clearTimeout(i);
|
|
9029
9118
|
}
|
|
9030
|
-
})), i(this,
|
|
9031
|
-
s(
|
|
9119
|
+
})), i(this, Xy, () => {
|
|
9120
|
+
s(Zy, this).call(this), a(Wy, this, setTimeout(() => {
|
|
9032
9121
|
var e;
|
|
9033
|
-
!s(
|
|
9122
|
+
!s(Hy, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), s(Hy, this).reset(), a(Wy, this, void 0));
|
|
9034
9123
|
}, n.EDGE_SELECTOR_RESET_TIMEOUT));
|
|
9035
|
-
}), i(this,
|
|
9036
|
-
s(
|
|
9037
|
-
}), i(this,
|
|
9124
|
+
}), i(this, Zy, () => {
|
|
9125
|
+
s(Wy, this) !== void 0 && (clearTimeout(s(Wy, this)), a(Wy, this, void 0));
|
|
9126
|
+
}), i(this, Qy, function() {
|
|
9038
9127
|
var e = t(function* (e) {
|
|
9039
|
-
return (yield d.config.reconnectHandler({ reconnectRetries: s(
|
|
9128
|
+
return (yield d.config.reconnectHandler({ reconnectRetries: s(Ny, d) })) ? (s(eb, d).call(d) ? (d.logger.info("Reconnect burst detected, applying backoff before retrying"), yield ln(n.RECONNECT_BACKOFF_MS)) : d.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), s(jy, d)) : (a(jy, d, !1), d.emitter.emit("error", er()), !1);
|
|
9040
9129
|
});
|
|
9041
9130
|
return function(t) {
|
|
9042
9131
|
return e.apply(this, arguments);
|
|
9043
9132
|
};
|
|
9044
|
-
}()), i(this,
|
|
9045
|
-
s(
|
|
9046
|
-
}), i(this,
|
|
9047
|
-
for (; s(
|
|
9048
|
-
let t = s(
|
|
9133
|
+
}()), i(this, $y, (e = performance.now()) => {
|
|
9134
|
+
s(tb, this).call(this, e), s(Uy, this).push(e);
|
|
9135
|
+
}), i(this, eb, (e = performance.now()) => (s(tb, this).call(this, e), s(Uy, this).length >= n.RECONNECT_BACKOFF_BURST_THRESHOLD)), i(this, tb, (e) => {
|
|
9136
|
+
for (; s(Uy, this).length > 0;) {
|
|
9137
|
+
let t = s(Uy, this)[0];
|
|
9049
9138
|
if (t === void 0 || t > e - n.RECONNECT_BACKOFF_BURST_WINDOW_MS) return;
|
|
9050
|
-
s(
|
|
9139
|
+
s(Uy, this).shift();
|
|
9051
9140
|
}
|
|
9052
9141
|
}), this.logger = l, this.emitter = c, this.config = u, this.apiClient = new g({
|
|
9053
9142
|
publicEndpoint: this.config.options.get("url").toString(),
|
|
@@ -9055,57 +9144,60 @@ var fy = (e) => {
|
|
|
9055
9144
|
});
|
|
9056
9145
|
}
|
|
9057
9146
|
get rtt() {
|
|
9058
|
-
return s(
|
|
9147
|
+
return s(Ay, this).items().length > 0 ? vt(s(Ay, this).items()) : 0;
|
|
9148
|
+
}
|
|
9149
|
+
get isMoq() {
|
|
9150
|
+
return this.connectionImpl instanceof Qv;
|
|
9059
9151
|
}
|
|
9060
9152
|
get estimatedBandwidth() {
|
|
9061
9153
|
if (this.connectionImpl && "estimatedBandwidth" in this.connectionImpl) {
|
|
9062
9154
|
let e = this.connectionImpl.estimatedBandwidth;
|
|
9063
9155
|
if (e && Number.isFinite(e)) return e;
|
|
9064
9156
|
}
|
|
9065
|
-
return
|
|
9157
|
+
return by(this.rtt);
|
|
9066
9158
|
}
|
|
9067
9159
|
get firstConnectStartTime() {
|
|
9068
|
-
return s(
|
|
9160
|
+
return s(Ly, this);
|
|
9069
9161
|
}
|
|
9070
9162
|
get lastConnectionTime() {
|
|
9071
|
-
return s(
|
|
9163
|
+
return s(Ry, this);
|
|
9072
9164
|
}
|
|
9073
9165
|
};
|
|
9074
|
-
|
|
9075
|
-
function
|
|
9166
|
+
ky = nb;
|
|
9167
|
+
function rb() {
|
|
9076
9168
|
var e = this;
|
|
9077
9169
|
return t(function* () {
|
|
9078
|
-
let t = new
|
|
9079
|
-
for (a(
|
|
9170
|
+
let t = new Oy({ edgeUrl: e.config.options.get("edgeUrl") });
|
|
9171
|
+
for (a(Hy, e, t), s(Zy, e).call(e), a(Ny, e, 0), a(Uy, e, []);;) {
|
|
9080
9172
|
var n, r, i;
|
|
9081
9173
|
let l = "standard";
|
|
9082
|
-
a(
|
|
9174
|
+
a(Ny, e, (n = s(Ny, e), n++, n)), a(Py, e, (r = s(Py, e), r++, r)), s($y, e).call(e);
|
|
9083
9175
|
let u = !1;
|
|
9084
|
-
a(
|
|
9176
|
+
a(Vy, e, {});
|
|
9085
9177
|
try {
|
|
9086
9178
|
var o;
|
|
9087
|
-
let [n, r] = yield Promise.all([s(
|
|
9088
|
-
if (s(
|
|
9179
|
+
let [n, r] = yield Promise.all([s(qy, e).call(e), s(Jy, e).call(e)]);
|
|
9180
|
+
if (s(Ay, e).clear(), r !== void 0 && s(Ay, e).push(r / 2), !s(jy, e)) break;
|
|
9089
9181
|
let i = t.select(n.edges);
|
|
9090
9182
|
if (!i) throw new k("Failed to resolve edge url", {
|
|
9091
9183
|
isFatal: !0,
|
|
9092
9184
|
code: "failed_to_resolve_edge_url"
|
|
9093
9185
|
});
|
|
9094
|
-
a(
|
|
9186
|
+
a(Vy, e, { edgeUrl: Nv(Cy(i)) });
|
|
9095
9187
|
try {
|
|
9096
|
-
c(n) ? e.connectionImpl = yield
|
|
9188
|
+
c(n) ? e.connectionImpl = yield Qv.start(e.emitter, e.logger, e.apiClient, y(y({}, e.config), {}, {
|
|
9097
9189
|
connectInfo: n,
|
|
9098
9190
|
edgeUrl: i,
|
|
9099
|
-
onTransportConnected: s(
|
|
9100
|
-
}), s(
|
|
9191
|
+
onTransportConnected: s(Ky, e)
|
|
9192
|
+
}), s(Ay, e)) : (d(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield xy.start(e.emitter, e.logger, y(y({}, e.config), {}, {
|
|
9101
9193
|
connectInfo: n,
|
|
9102
9194
|
edgeUrl: i,
|
|
9103
|
-
onTransportConnected: s(
|
|
9104
|
-
}), s(
|
|
9195
|
+
onTransportConnected: s(Ky, e)
|
|
9196
|
+
}), s(Ay, e)));
|
|
9105
9197
|
} catch (e) {
|
|
9106
9198
|
throw l = "cached_edge", e;
|
|
9107
9199
|
}
|
|
9108
|
-
a(
|
|
9200
|
+
a(By, e, e.connectionImpl.getStatistics()), a(Vy, e, void 0), s(jy, e) || e.connectionImpl.close("Disconnected during connect"), s(Xy, e).call(e), a(Fy, e, (o = s(Fy, e), o++, o)), a(Ny, e, 0), a(Ry, e, performance.now()), s(Ky, e).call(e);
|
|
9109
9201
|
let u = yield e.connectionImpl.closed();
|
|
9110
9202
|
e.logger.info("Connection closed", { reason: u instanceof Error ? u.message : u }), l = "cached_edge";
|
|
9111
9203
|
} catch (n) {
|
|
@@ -9113,32 +9205,32 @@ function qy() {
|
|
|
9113
9205
|
let r = t.shiftedEdge();
|
|
9114
9206
|
r && e.emitter.emit("telemetry event", {
|
|
9115
9207
|
code: "shifted_edge",
|
|
9116
|
-
edgeUrl:
|
|
9208
|
+
edgeUrl: Cy(r)
|
|
9117
9209
|
}), n instanceof k ? (e.emitter.emit("error", n), u = n.isFatal()) : n instanceof Error && e.emitter.emit("error", new k(n.message, {
|
|
9118
9210
|
code: "start_failed",
|
|
9119
9211
|
isFatal: !1
|
|
9120
9212
|
}));
|
|
9121
9213
|
}
|
|
9122
|
-
if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, s(
|
|
9123
|
-
a(
|
|
9214
|
+
if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, s(Zy, e).call(e), u) {
|
|
9215
|
+
a(jy, e, !1);
|
|
9124
9216
|
break;
|
|
9125
9217
|
}
|
|
9126
|
-
if (!s(
|
|
9218
|
+
if (!s(jy, e) || !(yield s(Qy, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
|
|
9127
9219
|
}
|
|
9128
|
-
a(
|
|
9220
|
+
a(Vy, e, void 0), a(Hy, e, void 0), s(Zy, e).call(e), a(My, e, void 0);
|
|
9129
9221
|
})();
|
|
9130
9222
|
}
|
|
9131
|
-
e(
|
|
9223
|
+
e(nb, "PING_TIMEOUT", 1e3), e(nb, "RECONNECT_BACKOFF_MS", 1e3), e(nb, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(nb, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(nb, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(nb, "create", (e, t, n) => new ky(e, t, n));
|
|
9132
9224
|
//#endregion
|
|
9133
9225
|
//#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
|
|
9134
|
-
var
|
|
9226
|
+
var ib, ab = () => ({
|
|
9135
9227
|
video: y(y({}, hn()), {}, { bitRate: mn() }),
|
|
9136
9228
|
audio: { bitRate: mn() }
|
|
9137
|
-
}),
|
|
9229
|
+
}), ob = () => ({
|
|
9138
9230
|
width: window.innerWidth,
|
|
9139
9231
|
height: window.innerHeight,
|
|
9140
9232
|
bitRate: mn()
|
|
9141
|
-
}),
|
|
9233
|
+
}), sb = class t {
|
|
9142
9234
|
constructor(n, r, i, a) {
|
|
9143
9235
|
e(this, "emitter", void 0), e(this, "timers", new O()), 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", () => {
|
|
9144
9236
|
var e;
|
|
@@ -9160,7 +9252,7 @@ var Jy, Yy = () => ({
|
|
|
9160
9252
|
this.timers.unload();
|
|
9161
9253
|
}), e(this, "setUserSpecifiedCap", (e) => {
|
|
9162
9254
|
var t;
|
|
9163
|
-
let n = (t = this.getUserSpecifiedCap()) == null ?
|
|
9255
|
+
let n = (t = this.getUserSpecifiedCap()) == null ? ab() : t;
|
|
9164
9256
|
this.userSpecifiedCap = y(y({}, n), {}, {
|
|
9165
9257
|
video: y(y({}, n.video), e.video),
|
|
9166
9258
|
audio: y(y({}, n.audio), e.audio)
|
|
@@ -9184,7 +9276,7 @@ var Jy, Yy = () => ({
|
|
|
9184
9276
|
});
|
|
9185
9277
|
}), e(this, "evaluateConstraintCap", () => {
|
|
9186
9278
|
var e, t, n, r;
|
|
9187
|
-
let i = this.sizeBasedResolutionCapEnabled ? y(y({},
|
|
9279
|
+
let i = this.sizeBasedResolutionCapEnabled ? y(y({}, ab()), {}, { video: ob() }) : ab();
|
|
9188
9280
|
if (!this.resizeObserver) {
|
|
9189
9281
|
let e = this.element.getBoundingClientRect();
|
|
9190
9282
|
this.elementSize = {
|
|
@@ -9221,20 +9313,20 @@ var Jy, Yy = () => ({
|
|
|
9221
9313
|
this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
|
|
9222
9314
|
}
|
|
9223
9315
|
};
|
|
9224
|
-
|
|
9316
|
+
ib = sb, e(sb, "CHECK_SIZE_INTERVAL", 1e3), e(sb, "create", (e, t, n, r) => new ib(e, t, n, r));
|
|
9225
9317
|
//#endregion
|
|
9226
9318
|
//#region ../../libs/web-sdk/src/renditionKey.ts
|
|
9227
|
-
var
|
|
9319
|
+
var cb = (e, t) => `${e}\u0000${t == null ? "" : t}`, lb = (e, t, n, r) => e === n && t === r, ub = class {
|
|
9228
9320
|
constructor() {
|
|
9229
9321
|
e(this, "lastKey", void 0), e(this, "shouldNotify", (e, t) => {
|
|
9230
|
-
let n =
|
|
9322
|
+
let n = cb(e, t);
|
|
9231
9323
|
return this.lastKey === n ? !1 : (this.lastKey = n, !0);
|
|
9232
9324
|
});
|
|
9233
9325
|
}
|
|
9234
|
-
},
|
|
9326
|
+
}, db = 5, fb = 40, pb = 1, mb = 3e4, hb = 5, gb = (e) => {
|
|
9235
9327
|
var t, n;
|
|
9236
9328
|
return ((t = e.maxCompositionOffsetMs) == null ? 0 : t) - ((n = e.minCompositionOffsetMs) == null ? 0 : n);
|
|
9237
|
-
},
|
|
9329
|
+
}, _b = (e, t, n) => {
|
|
9238
9330
|
let r = [];
|
|
9239
9331
|
for (let i of e) {
|
|
9240
9332
|
let e = r[r.length - 1];
|
|
@@ -9248,10 +9340,10 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9248
9340
|
});
|
|
9249
9341
|
}
|
|
9250
9342
|
return r;
|
|
9251
|
-
},
|
|
9343
|
+
}, vb = (e, t) => {
|
|
9252
9344
|
let n = e[e.length - 1];
|
|
9253
9345
|
n && n.end > t && n.start < t && (n.end = t);
|
|
9254
|
-
},
|
|
9346
|
+
}, yb = 100, bb = 1e3, xb = class n {
|
|
9255
9347
|
constructor(t, n, r, i, a = !1, o = !1, s = !1) {
|
|
9256
9348
|
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", () => {
|
|
9257
9349
|
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);
|
|
@@ -9269,8 +9361,8 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9269
9361
|
}), e(this, "unsuspend", () => {
|
|
9270
9362
|
this.isSuspended = !1, this.emitDecodedFrames(), this._audioWebCodecsInUse && this.scheduleAudioEmitRetry();
|
|
9271
9363
|
}), e(this, "armTimers", () => {
|
|
9272
|
-
let e = this._audioWebCodecsInUse ? 20 :
|
|
9273
|
-
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate,
|
|
9364
|
+
let e = this._audioWebCodecsInUse ? 20 : yb;
|
|
9365
|
+
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, bb);
|
|
9274
9366
|
}), e(this, "replaceTimers", () => {
|
|
9275
9367
|
let e = this.isAudioEmitRetryScheduled;
|
|
9276
9368
|
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());
|
|
@@ -9339,27 +9431,27 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9339
9431
|
i.stream = `${e.channelId}/${e.renditionId}`;
|
|
9340
9432
|
let c = (e.timestamp + a) / e.timescale * 1e3, l = e.duration / e.timescale * 1e3;
|
|
9341
9433
|
l > 0 && (i.sampleDuration = l);
|
|
9342
|
-
let u = i.sampleDuration ||
|
|
9434
|
+
let u = i.sampleDuration || fb, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = gb(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * hb, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
|
|
9343
9435
|
i.lastDecodeTimestampMs = g ? d : Math.max((r = i.lastDecodeTimestampMs) == null ? d : r, d);
|
|
9344
|
-
let ee = i.channelId !== void 0 &&
|
|
9436
|
+
let ee = i.channelId !== void 0 && !lb(i.channelId, i.renditionId, e.channelId, e.renditionId);
|
|
9345
9437
|
i.channelId = e.channelId, i.renditionId = e.renditionId, (g || ee) && (i.minCompositionOffsetMs = void 0, i.maxCompositionOffsetMs = void 0, i.hasAnchoredGop = !1, i.isReorderStructureStale = !0);
|
|
9346
9438
|
let _ = i.hasAnchoredGop === !0;
|
|
9347
9439
|
if (e.isSync && (i.hasAnchoredGop = !0), !g && i.hasAnchoredGop) {
|
|
9348
9440
|
var te, v;
|
|
9349
9441
|
i.minCompositionOffsetMs = Math.min((te = i.minCompositionOffsetMs) == null ? f : te, f), i.maxCompositionOffsetMs = Math.max((v = i.maxCompositionOffsetMs) == null ? f : v, f), _ && (i.isReorderStructureStale = !1);
|
|
9350
9442
|
}
|
|
9351
|
-
let ne =
|
|
9443
|
+
let ne = gb(i) > 0;
|
|
9352
9444
|
if (g) i.buffer = [{
|
|
9353
9445
|
start: c,
|
|
9354
9446
|
end: c + u
|
|
9355
9447
|
}], i.frontierSampleDurationMs = u, e.type === "video" && (this.videoKeyframeTimestamps = []);
|
|
9356
9448
|
else {
|
|
9357
9449
|
var re;
|
|
9358
|
-
!ne && !i.isReorderStructureStale &&
|
|
9450
|
+
!ne && !i.isReorderStructureStale && vb(s, c + u);
|
|
9359
9451
|
let e = (re = s[s.length - 1]) == null ? void 0 : re.end;
|
|
9360
|
-
(e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), nn(s, c, c + u,
|
|
9452
|
+
(e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), nn(s, c, c + u, db);
|
|
9361
9453
|
}
|
|
9362
|
-
if (an(i.buffer, this.playbackSource.currentTime -
|
|
9454
|
+
if (an(i.buffer, this.playbackSource.currentTime - mb), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
|
|
9363
9455
|
let e = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
9364
9456
|
e !== void 0 && c < e && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(c), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
9365
9457
|
}
|
|
@@ -9396,11 +9488,11 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9396
9488
|
}
|
|
9397
9489
|
this.currentVideoDecodeRate = this.calculateVideoDecodeRate(), this.emitter.emit("video decode rate", this.currentVideoDecodeRate);
|
|
9398
9490
|
}), e(this, "playableRanges", (e) => {
|
|
9399
|
-
let t =
|
|
9491
|
+
let t = gb(e);
|
|
9400
9492
|
if (t <= 0) return e.buffer;
|
|
9401
9493
|
if (e.playableRangesCache === void 0) {
|
|
9402
9494
|
var n, r;
|
|
9403
|
-
e.playableRangesCache =
|
|
9495
|
+
e.playableRangesCache = _b(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - pb, t + (e.sampleDuration || fb) + pb);
|
|
9404
9496
|
}
|
|
9405
9497
|
return e.playableRangesCache;
|
|
9406
9498
|
}), e(this, "updateBufferState", () => {
|
|
@@ -9487,7 +9579,7 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9487
9579
|
var e;
|
|
9488
9580
|
if (this._offscreenCanvasInUse) return (e = this.trackContexts.get("video")) == null ? void 0 : e.decoderContext.videoTrack;
|
|
9489
9581
|
}
|
|
9490
|
-
},
|
|
9582
|
+
}, Sb, Cb = class {
|
|
9491
9583
|
constructor(t) {
|
|
9492
9584
|
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", () => {
|
|
9493
9585
|
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);
|
|
@@ -9517,12 +9609,12 @@ var Qy = (e, t) => `${e}\u0000${t == null ? "" : t}`, $y = (e, t, n, r) => e ===
|
|
|
9517
9609
|
return document.visibilityState === "visible" && !this.isBehindAnotherApp;
|
|
9518
9610
|
}
|
|
9519
9611
|
};
|
|
9520
|
-
|
|
9612
|
+
Sb = Cb, e(Cb, "create", (e) => new Sb(e));
|
|
9521
9613
|
//#endregion
|
|
9522
9614
|
//#region ../../libs/web-sdk/src/modules/EventModule.ts
|
|
9523
|
-
var
|
|
9615
|
+
var wb, Tb = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, Eb = class t {
|
|
9524
9616
|
constructor(n, r, i) {
|
|
9525
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered",
|
|
9617
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Tb(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new O()), e(this, "load", () => {
|
|
9526
9618
|
this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
|
|
9527
9619
|
}), e(this, "unload", () => {
|
|
9528
9620
|
this.timers.unload(), this.emitter.off("add event", this.addEvent);
|
|
@@ -9549,10 +9641,10 @@ var mb, hb = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
|
|
|
9549
9641
|
}), this.logger = r, this.emitter = n, this.timeSource = i;
|
|
9550
9642
|
}
|
|
9551
9643
|
};
|
|
9552
|
-
|
|
9644
|
+
wb = Eb, e(Eb, "EVENT_TIMEOUT", 5e3), e(Eb, "EVENT_CHECK_INTERVAL", 20), e(Eb, "create", (e, t, n) => new wb(e, t, n));
|
|
9553
9645
|
//#endregion
|
|
9554
9646
|
//#region ../../libs/web-sdk/src/modules/JitterModule.ts
|
|
9555
|
-
var
|
|
9647
|
+
var Db = 1e3, Ob = 50, kb = class t {
|
|
9556
9648
|
constructor(t) {
|
|
9557
9649
|
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", () => {
|
|
9558
9650
|
this.logger.debug("JitterModule loaded");
|
|
@@ -9573,9 +9665,9 @@ var _b = 1e3, vb = 50, yb = class t {
|
|
|
9573
9665
|
this.trackingState.set(n, {
|
|
9574
9666
|
lastArrivalTime: i,
|
|
9575
9667
|
lastTimestampMs: a,
|
|
9576
|
-
jitterSamples: new r(
|
|
9577
|
-
interArrivalTimes: new r(
|
|
9578
|
-
}), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(
|
|
9668
|
+
jitterSamples: new r(Db),
|
|
9669
|
+
interArrivalTimes: new r(Db)
|
|
9670
|
+
}), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(Ob));
|
|
9579
9671
|
return;
|
|
9580
9672
|
}
|
|
9581
9673
|
let s = a - o.lastTimestampMs;
|
|
@@ -9588,7 +9680,7 @@ var _b = 1e3, vb = 50, yb = class t {
|
|
|
9588
9680
|
let u = (t = this.runningJitter.get(n)) == null ? 0 : t, d = u + (l - u) / 16;
|
|
9589
9681
|
this.runningJitter.set(n, d);
|
|
9590
9682
|
let f = this.recentJitterSamples.get(n);
|
|
9591
|
-
f || (f = new r(
|
|
9683
|
+
f || (f = new r(Ob), this.recentJitterSamples.set(n, f)), f.push(l), o.lastArrivalTime = i, o.lastTimestampMs = a;
|
|
9592
9684
|
}
|
|
9593
9685
|
getJitterForType(e) {
|
|
9594
9686
|
for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
|
|
@@ -9619,10 +9711,10 @@ var _b = 1e3, vb = 50, yb = class t {
|
|
|
9619
9711
|
videoJitter: this.getJitterForType("video")
|
|
9620
9712
|
};
|
|
9621
9713
|
}
|
|
9622
|
-
},
|
|
9714
|
+
}, Ab = () => window.AudioContext || window.webkitAudioContext, jb = class r extends ie {
|
|
9623
9715
|
constructor() {
|
|
9624
9716
|
var i;
|
|
9625
|
-
super(), i = this, e(this, "context", new (
|
|
9717
|
+
super(), i = this, e(this, "context", new (Ab())()), e(this, "timers", O.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* () {
|
|
9626
9718
|
let e = !0, t = i.context.resume();
|
|
9627
9719
|
t.then(() => {
|
|
9628
9720
|
e = !1;
|
|
@@ -9657,10 +9749,10 @@ var _b = 1e3, vb = 50, yb = class t {
|
|
|
9657
9749
|
return this.context.state;
|
|
9658
9750
|
}
|
|
9659
9751
|
};
|
|
9660
|
-
e(
|
|
9752
|
+
e(jb, "CHECK_INTERVAL", 1e3);
|
|
9661
9753
|
//#endregion
|
|
9662
9754
|
//#region ../../libs/web-audio-player/src/AudioPlayer.ts
|
|
9663
|
-
var
|
|
9755
|
+
var Mb, Nb = 150, Pb = 400, Fb = (e) => e === void 0 ? 5 : e <= Nb ? 1 : e <= Pb ? 2 : 5, Ib = class extends ie {
|
|
9664
9756
|
get isContextRunning() {
|
|
9665
9757
|
var e;
|
|
9666
9758
|
return ((e = this.audio) == null ? void 0 : e.state) === "running";
|
|
@@ -9707,7 +9799,7 @@ var Sb, Cb = 150, wb = 400, Tb = (e) => e === void 0 ? 5 : e <= Cb ? 1 : e <= wb
|
|
|
9707
9799
|
return this._bufferTime;
|
|
9708
9800
|
}
|
|
9709
9801
|
set bufferTime(e) {
|
|
9710
|
-
this._bufferTime = e, this.audioBufferMultiplier =
|
|
9802
|
+
this._bufferTime = e, this.audioBufferMultiplier = Fb(e);
|
|
9711
9803
|
}
|
|
9712
9804
|
get sinkPaused() {
|
|
9713
9805
|
return this._sinkPaused;
|
|
@@ -9813,7 +9905,7 @@ var Sb, Cb = 150, wb = 400, Tb = (e) => e === void 0 ? 5 : e <= Cb ? 1 : e <= wb
|
|
|
9813
9905
|
this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
|
|
9814
9906
|
}), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
|
|
9815
9907
|
var e, t, r;
|
|
9816
|
-
return (e = this.audio) == null || e.unload(), this.audio = new
|
|
9908
|
+
return (e = this.audio) == null || e.unload(), this.audio = new jb(), this.audio.on("state", (e) => {
|
|
9817
9909
|
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);
|
|
9818
9910
|
}), this.audio.on("stuck", () => {
|
|
9819
9911
|
if (!this.reInitWhenStuck) {
|
|
@@ -9824,7 +9916,7 @@ var Sb, Cb = 150, wb = 400, Tb = (e) => e === void 0 ? 5 : e <= Cb ? 1 : e <= wb
|
|
|
9824
9916
|
}), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (r = this.splitter) == null || r.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
|
|
9825
9917
|
}), e(this, "setGain", (e) => {
|
|
9826
9918
|
this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
|
|
9827
|
-
}), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier =
|
|
9919
|
+
}), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier = Fb(c);
|
|
9828
9920
|
}
|
|
9829
9921
|
useMediaStreamDestination() {
|
|
9830
9922
|
var e;
|
|
@@ -9837,10 +9929,10 @@ var Sb, Cb = 150, wb = 400, Tb = (e) => e === void 0 ? 5 : e <= Cb ? 1 : e <= wb
|
|
|
9837
9929
|
return (e = this.gainNode) == null || e.connect(t), t;
|
|
9838
9930
|
}
|
|
9839
9931
|
};
|
|
9840
|
-
|
|
9932
|
+
Mb = Ib, e(Ib, "create", (e, t, n) => new Mb(e, t, n));
|
|
9841
9933
|
//#endregion
|
|
9842
9934
|
//#region ../../libs/web-sdk/src/players/VideoPlayer.ts
|
|
9843
|
-
var
|
|
9935
|
+
var Lb, Rb = class {
|
|
9844
9936
|
constructor(t, n, r, i, a, o) {
|
|
9845
9937
|
e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new Hr()), 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", () => {
|
|
9846
9938
|
this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
|
|
@@ -9930,12 +10022,12 @@ var Db, Ob = class {
|
|
|
9930
10022
|
}), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
|
|
9931
10023
|
}
|
|
9932
10024
|
};
|
|
9933
|
-
|
|
10025
|
+
Lb = Rb, e(Rb, "create", (e, t, n, r, i, a) => new Lb(e, t, n, r, i, a));
|
|
9934
10026
|
//#endregion
|
|
9935
10027
|
//#region ../../libs/web-sdk/src/TextTracks.ts
|
|
9936
|
-
var
|
|
10028
|
+
var zb = /* @__PURE__ */ new WeakMap(), Bb = class {
|
|
9937
10029
|
constructor() {
|
|
9938
|
-
i(this,
|
|
10030
|
+
i(this, zb, []), a(zb, this, []);
|
|
9939
10031
|
}
|
|
9940
10032
|
addTextTrack(e, t, n) {
|
|
9941
10033
|
let r = [], i = {
|
|
@@ -9952,43 +10044,43 @@ var kb = /* @__PURE__ */ new WeakMap(), Ab = class {
|
|
|
9952
10044
|
t !== -1 && r.splice(t, 1);
|
|
9953
10045
|
}
|
|
9954
10046
|
};
|
|
9955
|
-
return s(
|
|
10047
|
+
return s(zb, this).push(i), i;
|
|
9956
10048
|
}
|
|
9957
10049
|
set language(e) {
|
|
9958
|
-
s(
|
|
10050
|
+
s(zb, this).forEach((t) => {
|
|
9959
10051
|
t.language === e ? t.mode = "showing" : t.mode = "hidden";
|
|
9960
10052
|
});
|
|
9961
10053
|
}
|
|
9962
10054
|
get language() {
|
|
9963
10055
|
var e;
|
|
9964
|
-
return (e = s(
|
|
10056
|
+
return (e = s(zb, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
|
|
9965
10057
|
}
|
|
9966
10058
|
get tracks() {
|
|
9967
|
-
return s(
|
|
10059
|
+
return s(zb, this);
|
|
9968
10060
|
}
|
|
9969
10061
|
get activeTrack() {
|
|
9970
|
-
return s(
|
|
10062
|
+
return s(zb, this).find((e) => e.mode === "showing");
|
|
9971
10063
|
}
|
|
9972
10064
|
getActiveCues(e) {
|
|
9973
|
-
let t = s(
|
|
10065
|
+
let t = s(zb, this).find((e) => e.mode === "showing");
|
|
9974
10066
|
return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e < n) : [];
|
|
9975
10067
|
}
|
|
9976
|
-
},
|
|
10068
|
+
}, Vb = (e, t) => {
|
|
9977
10069
|
let n;
|
|
9978
10070
|
for (n = t; e > 1; e--) n += t;
|
|
9979
10071
|
return n;
|
|
9980
|
-
},
|
|
10072
|
+
}, Hb = class {
|
|
9981
10073
|
constructor() {
|
|
9982
10074
|
e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(n));
|
|
9983
10075
|
let t = document.createElement("div");
|
|
9984
10076
|
t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
9985
10077
|
let r = t.children.item(0);
|
|
9986
|
-
if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
10078
|
+
if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Vb(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Vb(16, "gICA") + Vb(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Vb(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Vb(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Vb(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Vb(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
9987
10079
|
else throw Error("Failed to create audio tag");
|
|
9988
10080
|
}
|
|
9989
|
-
},
|
|
10081
|
+
}, Ub, Wb = class {
|
|
9990
10082
|
constructor(t, n, r, i, a, o, s, c) {
|
|
9991
|
-
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
|
|
10083
|
+
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 Hb()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new O()), 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 Bb()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
|
|
9992
10084
|
let e = {
|
|
9993
10085
|
volume: this.volume,
|
|
9994
10086
|
isMuted: this.userMuted
|
|
@@ -10030,13 +10122,13 @@ var kb = /* @__PURE__ */ new WeakMap(), Ab = class {
|
|
|
10030
10122
|
e instanceof Error && this.emitter.emit("error", Bn(!1, e));
|
|
10031
10123
|
}
|
|
10032
10124
|
this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
|
|
10033
|
-
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer =
|
|
10125
|
+
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Ib.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
10034
10126
|
muted: a,
|
|
10035
10127
|
reInitWhenStuck: !0,
|
|
10036
10128
|
bufferTime: c
|
|
10037
10129
|
}), o !== void 0 && (this.audioPlayer.volume = o), this.audioPlayer.on("stuck", () => {
|
|
10038
10130
|
this.isDisconnected = !0;
|
|
10039
|
-
}), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer =
|
|
10131
|
+
}), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Rb.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
|
|
10040
10132
|
}
|
|
10041
10133
|
get volume() {
|
|
10042
10134
|
return this.audioPlayer.volume;
|
|
@@ -10095,29 +10187,29 @@ var kb = /* @__PURE__ */ new WeakMap(), Ab = class {
|
|
|
10095
10187
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
10096
10188
|
}
|
|
10097
10189
|
};
|
|
10098
|
-
|
|
10190
|
+
Ub = Wb, e(Wb, "create", (e, t, n, r, i, a, o, s) => new Ub(e, t, n, r, i, a, o, s));
|
|
10099
10191
|
//#endregion
|
|
10100
10192
|
//#region ../../libs/web-sdk/src/modules/MediaSessionModule.ts
|
|
10101
|
-
var
|
|
10193
|
+
var Gb, Kb = [
|
|
10102
10194
|
"play",
|
|
10103
10195
|
"pause",
|
|
10104
10196
|
"stop"
|
|
10105
|
-
],
|
|
10197
|
+
], qb, Jb = /* @__PURE__ */ new Set(), Yb = class t {
|
|
10106
10198
|
constructor(n, r, i) {
|
|
10107
10199
|
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", () => {
|
|
10108
|
-
this.isLoaded || !t.isSupported() || (this.isLoaded = !0,
|
|
10200
|
+
this.isLoaded || !t.isSupported() || (this.isLoaded = !0, Jb.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
|
|
10109
10201
|
}), e(this, "unload", () => {
|
|
10110
10202
|
var e;
|
|
10111
|
-
this.isLoaded && (this.isLoaded = !1,
|
|
10203
|
+
this.isLoaded && (this.isLoaded = !1, Jb.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());
|
|
10112
10204
|
}), e(this, "stop", () => {
|
|
10113
10205
|
var e;
|
|
10114
|
-
this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(),
|
|
10206
|
+
this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), qb === this && this.handOverOwnership("on stop");
|
|
10115
10207
|
}), e(this, "getStatistics", () => {
|
|
10116
10208
|
var e;
|
|
10117
10209
|
return {
|
|
10118
10210
|
mediaSessionSupported: t.isSupported(),
|
|
10119
|
-
mediaSessionOwner:
|
|
10120
|
-
mediaSessionPlaybackState:
|
|
10211
|
+
mediaSessionOwner: qb === this,
|
|
10212
|
+
mediaSessionPlaybackState: qb === this ? this.isPaused ? "paused" : "playing" : "none",
|
|
10121
10213
|
decoyState: (e = this.options.decoy) == null ? void 0 : e.getStatistics().decoyState
|
|
10122
10214
|
};
|
|
10123
10215
|
}), e(this, "onPlaybackState", (e) => {
|
|
@@ -10126,23 +10218,23 @@ var Fb, Ib = [
|
|
|
10126
10218
|
this.update();
|
|
10127
10219
|
}), e(this, "update", () => {
|
|
10128
10220
|
if (this.isLoaded) {
|
|
10129
|
-
if (this.isEligibleToOwn &&
|
|
10221
|
+
if (this.isEligibleToOwn && qb !== this) {
|
|
10130
10222
|
this.claimOwnership();
|
|
10131
10223
|
return;
|
|
10132
10224
|
}
|
|
10133
10225
|
this.sync();
|
|
10134
10226
|
}
|
|
10135
10227
|
}), e(this, "handOverOwnership", (e) => {
|
|
10136
|
-
if (
|
|
10228
|
+
if (qb === this) {
|
|
10137
10229
|
this.logger.debug(`Handing over the media session ${e}`), this.releaseOwnership();
|
|
10138
|
-
for (let e of
|
|
10230
|
+
for (let e of Jb) if (e !== this && e.isEligibleToOwn) {
|
|
10139
10231
|
e.claimOwnership();
|
|
10140
10232
|
return;
|
|
10141
10233
|
}
|
|
10142
10234
|
}
|
|
10143
10235
|
}), e(this, "sync", () => {
|
|
10144
10236
|
var e, t, n, r, i, a;
|
|
10145
|
-
if (
|
|
10237
|
+
if (qb !== this) return;
|
|
10146
10238
|
if ((e = (t = this.options).isSuppressed) != null && e.call(t)) {
|
|
10147
10239
|
var o;
|
|
10148
10240
|
(o = this.options.decoy) == null || o.unload(), this.handOverOwnership("as suppressed");
|
|
@@ -10175,8 +10267,8 @@ var Fb, Ib = [
|
|
|
10175
10267
|
(f = this.options.decoy) == null || f.play();
|
|
10176
10268
|
}
|
|
10177
10269
|
}), e(this, "claimOwnership", () => {
|
|
10178
|
-
|
|
10179
|
-
for (let e of
|
|
10270
|
+
qb == null || qb.releaseOwnership(), qb = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
|
|
10271
|
+
for (let e of Kb) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
|
|
10180
10272
|
this.safely("position state", () => {
|
|
10181
10273
|
var e, t;
|
|
10182
10274
|
return (e = (t = navigator.mediaSession).setPositionState) == null ? void 0 : e.call(t, {
|
|
@@ -10192,9 +10284,9 @@ var Fb, Ib = [
|
|
|
10192
10284
|
});
|
|
10193
10285
|
}), e(this, "releaseOwnership", () => {
|
|
10194
10286
|
var e;
|
|
10195
|
-
if (
|
|
10196
|
-
|
|
10197
|
-
for (let e of
|
|
10287
|
+
if (qb === this) {
|
|
10288
|
+
qb = void 0, (e = this.options.decoy) == null || e.pause();
|
|
10289
|
+
for (let e of Kb) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
|
|
10198
10290
|
this.options.metadata && this.safely("metadata restore", () => {
|
|
10199
10291
|
navigator.mediaSession.metadata = this.pageMetadata;
|
|
10200
10292
|
}), this.safely("release", () => {
|
|
@@ -10228,15 +10320,15 @@ var Fb, Ib = [
|
|
|
10228
10320
|
return this.playbackState !== void 0 && !this.isPaused && !this.options.isMuted() && ((e = (t = this.options).isSuppressed) == null ? void 0 : e.call(t)) !== !0;
|
|
10229
10321
|
}
|
|
10230
10322
|
};
|
|
10231
|
-
|
|
10323
|
+
Gb = Yb, e(Yb, "create", (e, t, n) => new Gb(e, t, n)), e(Yb, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
|
|
10232
10324
|
//#endregion
|
|
10233
10325
|
//#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
|
|
10234
|
-
var
|
|
10326
|
+
var Xb, Zb = class {
|
|
10235
10327
|
constructor(t, r, i, a, { muted: o, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d, backgroundPlaybackEnabled: f, splitAudio: p }) {
|
|
10236
10328
|
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 O()), 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", (() => {
|
|
10237
10329
|
let e = qe().platform;
|
|
10238
10330
|
return e.isIOS && e.iosVersion <= 16;
|
|
10239
|
-
})()), e(this, "volumeState", void 0), e(this, "textTracks", new
|
|
10331
|
+
})()), e(this, "volumeState", void 0), e(this, "textTracks", new Bb()), e(this, "reset", () => {}), e(this, "load", () => {
|
|
10240
10332
|
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);
|
|
10241
10333
|
}), e(this, "unload", () => {
|
|
10242
10334
|
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);
|
|
@@ -10389,13 +10481,13 @@ var Bb, Vb = class {
|
|
|
10389
10481
|
}), this.soundElement.on("media element state", (e) => {
|
|
10390
10482
|
e === "paused" && this.audioPlayer.flushBuffer(), this.audioPlayer.sinkPaused = e === "paused", this.emitPlaybackState();
|
|
10391
10483
|
}), 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));
|
|
10392
|
-
this.audioPlayer =
|
|
10484
|
+
this.audioPlayer = Ib.create(this.logger.createContext("AudioPlayerModule"), a, {
|
|
10393
10485
|
muted: !1,
|
|
10394
10486
|
reInitWhenStuck: !1,
|
|
10395
10487
|
bufferTime: d
|
|
10396
10488
|
}), this.audioPlayer.on("state change", (e) => {
|
|
10397
10489
|
e === "suspended" || e === "interrupted" ? this.soundElement.muted = !0 : e === "running" && this.applyVisibilityMutePolicy(), this.updateVolumeState();
|
|
10398
|
-
}), this.videoPlayer =
|
|
10490
|
+
}), this.videoPlayer = Rb.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
|
|
10399
10491
|
}
|
|
10400
10492
|
get volume() {
|
|
10401
10493
|
return this.soundElement.volume;
|
|
@@ -10467,10 +10559,10 @@ var Bb, Vb = class {
|
|
|
10467
10559
|
return this.renderCanvasSubtitlesInNativeFullscreen && !this.offscreenCanvas;
|
|
10468
10560
|
}
|
|
10469
10561
|
};
|
|
10470
|
-
|
|
10562
|
+
Xb = Zb, e(Zb, "create", (e, t, n, r, i) => new Xb(e, t, n, r, i));
|
|
10471
10563
|
//#endregion
|
|
10472
10564
|
//#region ../../libs/web-sdk/src/modules/MseModule.ts
|
|
10473
|
-
var
|
|
10565
|
+
var Qb, $b = class {
|
|
10474
10566
|
constructor() {
|
|
10475
10567
|
e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
|
|
10476
10568
|
var r;
|
|
@@ -10482,7 +10574,7 @@ var Hb, Ub = class {
|
|
|
10482
10574
|
});
|
|
10483
10575
|
}
|
|
10484
10576
|
};
|
|
10485
|
-
function
|
|
10577
|
+
function ex(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
10486
10578
|
return y(y({}, e), {}, {
|
|
10487
10579
|
state: "initialized",
|
|
10488
10580
|
mimeType: n,
|
|
@@ -10494,10 +10586,10 @@ function Wb(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
|
10494
10586
|
lastBufferCleanupTime: performance.now()
|
|
10495
10587
|
});
|
|
10496
10588
|
}
|
|
10497
|
-
function
|
|
10589
|
+
function tx({ initSegments: e, pendingSamples: t }) {
|
|
10498
10590
|
return {
|
|
10499
10591
|
state: "uninitialized",
|
|
10500
|
-
initSegments: e == null ? new
|
|
10592
|
+
initSegments: e == null ? new $b() : e,
|
|
10501
10593
|
sequenceNumber: 0,
|
|
10502
10594
|
isWorkingOnPendingSamples: !1,
|
|
10503
10595
|
hasFirstSync: t.some((e) => e.isSync),
|
|
@@ -10507,7 +10599,7 @@ function Gb({ initSegments: e, pendingSamples: t }) {
|
|
|
10507
10599
|
successfulAppendCalls: 0
|
|
10508
10600
|
};
|
|
10509
10601
|
}
|
|
10510
|
-
var
|
|
10602
|
+
var nx = class {
|
|
10511
10603
|
constructor(r, i, a) {
|
|
10512
10604
|
var o = this;
|
|
10513
10605
|
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", O.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new Ys()), 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, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
|
|
@@ -10553,7 +10645,7 @@ var Kb = class {
|
|
|
10553
10645
|
var n, r, i;
|
|
10554
10646
|
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;
|
|
10555
10647
|
for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
|
|
10556
|
-
let l =
|
|
10648
|
+
let l = tx({
|
|
10557
10649
|
pendingSamples: o,
|
|
10558
10650
|
initSegments: s
|
|
10559
10651
|
});
|
|
@@ -10564,14 +10656,14 @@ var Kb = class {
|
|
|
10564
10656
|
this.trackContexts.forEach((e, n) => {
|
|
10565
10657
|
if (t.has(n)) return;
|
|
10566
10658
|
e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
|
|
10567
|
-
let r =
|
|
10659
|
+
let r = tx({
|
|
10568
10660
|
pendingSamples: [],
|
|
10569
10661
|
initSegments: e.initSegments
|
|
10570
10662
|
});
|
|
10571
10663
|
this.trackContexts.set(n, r);
|
|
10572
10664
|
});
|
|
10573
10665
|
}), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
|
|
10574
|
-
let n =
|
|
10666
|
+
let n = ex(e, {
|
|
10575
10667
|
mimeType: t.mimeType,
|
|
10576
10668
|
mediaSource: this.mediaSource,
|
|
10577
10669
|
codec: t.codec
|
|
@@ -10598,9 +10690,9 @@ var Kb = class {
|
|
|
10598
10690
|
}
|
|
10599
10691
|
for (let t of e) {
|
|
10600
10692
|
let n = o.trackContexts.get(t.type);
|
|
10601
|
-
if (n || (n =
|
|
10693
|
+
if (n || (n = tx({
|
|
10602
10694
|
pendingSamples: [],
|
|
10603
|
-
initSegments: new
|
|
10695
|
+
initSegments: new $b()
|
|
10604
10696
|
}), o.trackContexts.set(t.type, n)), n.state === "initialized") {
|
|
10605
10697
|
if (t.mimeType !== n.sourceBufferMimeType) try {
|
|
10606
10698
|
yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
|
|
@@ -10617,7 +10709,7 @@ var Kb = class {
|
|
|
10617
10709
|
o.logger.warn("removeSourceBuffer failed", { removeError: t }), o.reopenMediaSource("changeType recovery failed"), o.pendingTracksToAddSourceBuffers = e;
|
|
10618
10710
|
return;
|
|
10619
10711
|
}
|
|
10620
|
-
let i =
|
|
10712
|
+
let i = tx({
|
|
10621
10713
|
pendingSamples: n.pendingSamples,
|
|
10622
10714
|
initSegments: n.initSegments
|
|
10623
10715
|
});
|
|
@@ -10641,7 +10733,7 @@ var Kb = class {
|
|
|
10641
10733
|
};
|
|
10642
10734
|
}), e(this, "getNextBufferedRangeStart", (e) => {
|
|
10643
10735
|
let t = this.getCommonBufferedRangesForCurrentTracks();
|
|
10644
|
-
if (t) return
|
|
10736
|
+
if (t) return rx(e, t);
|
|
10645
10737
|
}), e(this, "getBufferedEndAt", (e) => {
|
|
10646
10738
|
var t;
|
|
10647
10739
|
let n = this.getCommonBufferedRangesForCurrentTracks();
|
|
@@ -10691,9 +10783,9 @@ var Kb = class {
|
|
|
10691
10783
|
s > 0 && performance.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = performance.now(), yield r.sourceBuffer.removeBuffer(0, s + 10));
|
|
10692
10784
|
try {
|
|
10693
10785
|
let t = r.sequenceNumber;
|
|
10694
|
-
if ("fragmented" in n) for (let t of
|
|
10786
|
+
if ("fragmented" in n) for (let t of cx(e)) {
|
|
10695
10787
|
var c;
|
|
10696
|
-
yield r.sourceBuffer.appendBuffer(
|
|
10788
|
+
yield r.sourceBuffer.appendBuffer(lx(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
|
|
10697
10789
|
}
|
|
10698
10790
|
else {
|
|
10699
10791
|
let n = Fs(e, t++);
|
|
@@ -10741,7 +10833,7 @@ var Kb = class {
|
|
|
10741
10833
|
let t = this.trackContexts.get(e.type);
|
|
10742
10834
|
if (!t) throw Un(e.type, e.renditionId);
|
|
10743
10835
|
let n = t.pendingSamples.length - t.pendingSamplesOffset;
|
|
10744
|
-
if (t.state === "uninitialized" && n >=
|
|
10836
|
+
if (t.state === "uninitialized" && n >= ax && (e.isSync || n >= 2 * ax) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), !(!t.hasFirstSync && !e.isSync)) {
|
|
10745
10837
|
if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
|
|
10746
10838
|
this.hasAddedInitialPosterFrame = !1;
|
|
10747
10839
|
let n = y({}, e);
|
|
@@ -10752,7 +10844,7 @@ var Kb = class {
|
|
|
10752
10844
|
let t = (e.timestamp + ((r = e.compositionTimeOffset) == null ? 0 : r)) / e.timescale * 1e3, n = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
10753
10845
|
n !== void 0 && t < n && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
10754
10846
|
}
|
|
10755
|
-
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples ||
|
|
10847
|
+
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || dx(t, this.append, this.maxChunkSize).catch((n) => {
|
|
10756
10848
|
if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
|
|
10757
10849
|
if (!this.isCurrentTrackContext(e.type, t)) {
|
|
10758
10850
|
this.logger.debug("Suppressing append error from stale track context", { type: e.type });
|
|
@@ -10871,14 +10963,14 @@ var Kb = class {
|
|
|
10871
10963
|
if (this.mediaSource.isClosed()) return;
|
|
10872
10964
|
let e = this.getInitializedTrackBuffers();
|
|
10873
10965
|
if (e.length !== 0) return this.getCommonBufferedRanges(e);
|
|
10874
|
-
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) =>
|
|
10966
|
+
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => sx(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => rn(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
|
|
10875
10967
|
}
|
|
10876
10968
|
};
|
|
10877
|
-
|
|
10878
|
-
let r = new
|
|
10969
|
+
Qb = nx, e(nx, "create", (e, t, n) => {
|
|
10970
|
+
let r = new Qb(e, t, n);
|
|
10879
10971
|
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;
|
|
10880
10972
|
});
|
|
10881
|
-
var
|
|
10973
|
+
var rx = (e, t) => {
|
|
10882
10974
|
for (let r = 0; r < t.length; r++) {
|
|
10883
10975
|
let i = t[r];
|
|
10884
10976
|
if (i) {
|
|
@@ -10889,11 +10981,11 @@ var qb = (e, t) => {
|
|
|
10889
10981
|
}
|
|
10890
10982
|
}
|
|
10891
10983
|
}
|
|
10892
|
-
},
|
|
10984
|
+
}, ix = (e, t) => {
|
|
10893
10985
|
var n;
|
|
10894
10986
|
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;
|
|
10895
10987
|
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;
|
|
10896
|
-
},
|
|
10988
|
+
}, ax = 1e3, ox = 32, sx = (e, t) => {
|
|
10897
10989
|
let n = [], r = 0, i = 0;
|
|
10898
10990
|
for (; r < e.length && i < t.length;) {
|
|
10899
10991
|
let a = e[r], o = t[i];
|
|
@@ -10905,7 +10997,7 @@ var qb = (e, t) => {
|
|
|
10905
10997
|
}), a.end <= o.end ? r++ : i++;
|
|
10906
10998
|
}
|
|
10907
10999
|
return n;
|
|
10908
|
-
},
|
|
11000
|
+
}, cx = (e) => {
|
|
10909
11001
|
let t = [];
|
|
10910
11002
|
for (let r of e) {
|
|
10911
11003
|
var n;
|
|
@@ -10914,21 +11006,21 @@ var qb = (e, t) => {
|
|
|
10914
11006
|
(e == null || (n = e[0]) == null ? void 0 : n.initData) === r.initData ? e.push(r) : t.push([r]);
|
|
10915
11007
|
}
|
|
10916
11008
|
return t;
|
|
10917
|
-
},
|
|
11009
|
+
}, lx = (e) => {
|
|
10918
11010
|
if (e.length === 1 && e[0]) return e[0];
|
|
10919
11011
|
let t = new Uint8Array(e.reduce((e, t) => e + t.byteLength, 0)), n = 0;
|
|
10920
11012
|
for (let r of e) t.set(r, n), n += r.byteLength;
|
|
10921
11013
|
return t;
|
|
10922
|
-
},
|
|
11014
|
+
}, ux = (e) => {
|
|
10923
11015
|
let t = e.pendingSamplesOffset;
|
|
10924
11016
|
if (t !== 0) {
|
|
10925
11017
|
if (t >= e.pendingSamples.length) {
|
|
10926
11018
|
e.pendingSamples = [], e.pendingSamplesOffset = 0;
|
|
10927
11019
|
return;
|
|
10928
11020
|
}
|
|
10929
|
-
t <
|
|
11021
|
+
t < ox || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
|
|
10930
11022
|
}
|
|
10931
|
-
},
|
|
11023
|
+
}, dx = function() {
|
|
10932
11024
|
var e = t(function* (e, t, n) {
|
|
10933
11025
|
for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
|
|
10934
11026
|
let r = [], i = e.pendingSamplesOffset;
|
|
@@ -10936,7 +11028,7 @@ var qb = (e, t) => {
|
|
|
10936
11028
|
i = t;
|
|
10937
11029
|
let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
|
|
10938
11030
|
if (a && (r.push(a), o)) {
|
|
10939
|
-
if (
|
|
11031
|
+
if (ix(a, o)) break;
|
|
10940
11032
|
let e = (a.timestamp + a.duration) / a.timescale;
|
|
10941
11033
|
if (o.timestamp / o.timescale - e > .1) break;
|
|
10942
11034
|
}
|
|
@@ -10944,14 +11036,14 @@ var qb = (e, t) => {
|
|
|
10944
11036
|
}
|
|
10945
11037
|
let a = r[0];
|
|
10946
11038
|
if (!a) break;
|
|
10947
|
-
yield t(r, e.previousSample ?
|
|
11039
|
+
yield t(r, e.previousSample ? ix(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], ux(e);
|
|
10948
11040
|
}
|
|
10949
11041
|
e.isWorkingOnPendingSamples = !1;
|
|
10950
11042
|
});
|
|
10951
11043
|
return function(t, n, r) {
|
|
10952
11044
|
return e.apply(this, arguments);
|
|
10953
11045
|
};
|
|
10954
|
-
}(),
|
|
11046
|
+
}(), fx, px = class {
|
|
10955
11047
|
constructor(n, r) {
|
|
10956
11048
|
var i = this;
|
|
10957
11049
|
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
|
|
@@ -10983,10 +11075,10 @@ var qb = (e, t) => {
|
|
|
10983
11075
|
}()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && dt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
|
|
10984
11076
|
}
|
|
10985
11077
|
};
|
|
10986
|
-
|
|
11078
|
+
fx = px, e(px, "create", (e, t) => new fx(e, t));
|
|
10987
11079
|
//#endregion
|
|
10988
11080
|
//#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
|
|
10989
|
-
var
|
|
11081
|
+
var mx, hx = class {
|
|
10990
11082
|
constructor(t, n, r, i) {
|
|
10991
11083
|
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", () => {
|
|
10992
11084
|
this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
|
|
@@ -11004,24 +11096,24 @@ var ix, ax = class {
|
|
|
11004
11096
|
}), 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);
|
|
11005
11097
|
}
|
|
11006
11098
|
};
|
|
11007
|
-
|
|
11099
|
+
mx = hx, e(hx, "create", (e, t, n, r) => new mx(e, t, n, r));
|
|
11008
11100
|
//#endregion
|
|
11009
11101
|
//#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
|
|
11010
|
-
var
|
|
11102
|
+
var gx, _x = () => ({
|
|
11011
11103
|
upgradesFromLevel: [],
|
|
11012
11104
|
downgradesFromLevel: [],
|
|
11013
11105
|
bufferingRanges: [],
|
|
11014
11106
|
activeRanges: [],
|
|
11015
11107
|
decodeRate: 2 ** 53 - 1
|
|
11016
|
-
}),
|
|
11108
|
+
}), vx = () => ({
|
|
11017
11109
|
levels: {},
|
|
11018
11110
|
levelDowngrades: [],
|
|
11019
11111
|
levelUpgrades: [],
|
|
11020
11112
|
bufferFullness: 0,
|
|
11021
|
-
general:
|
|
11022
|
-
}),
|
|
11113
|
+
general: _x()
|
|
11114
|
+
}), yx = 100, bx = 3600, xx = 1e3, Sx = class {
|
|
11023
11115
|
constructor(t, n, i, a) {
|
|
11024
|
-
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", O.create()), e(this, "metrics",
|
|
11116
|
+
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", O.create()), e(this, "metrics", vx()), e(this, "bufferFullness", new r(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, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
|
|
11025
11117
|
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);
|
|
11026
11118
|
}), e(this, "unload", () => {
|
|
11027
11119
|
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.suspend();
|
|
@@ -11039,7 +11131,7 @@ var ox, sx = () => ({
|
|
|
11039
11131
|
return this.metrics.levels[a];
|
|
11040
11132
|
}), e(this, "getBufferFullnessRegression", (e = !1) => {
|
|
11041
11133
|
if (!e) return this.bufferFullnessRegression;
|
|
11042
|
-
if (performance.now() - this.lastDeliveryResumeTime <
|
|
11134
|
+
if (performance.now() - this.lastDeliveryResumeTime < xx) return;
|
|
11043
11135
|
let t = this.bufferFullness.items().filter(({ time: e }) => e >= this.lastDeliveryResumeTime);
|
|
11044
11136
|
return t.length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression(t) : void 0;
|
|
11045
11137
|
}), e(this, "getTargetBufferTime", () => {
|
|
@@ -11099,21 +11191,21 @@ var ox, sx = () => ({
|
|
|
11099
11191
|
let d = !1;
|
|
11100
11192
|
if (e.from) {
|
|
11101
11193
|
var f;
|
|
11102
|
-
let e = (f = this.metrics.levels[l]) == null ?
|
|
11194
|
+
let e = (f = this.metrics.levels[l]) == null ? _x() : f;
|
|
11103
11195
|
l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Qt(e.activeRanges);
|
|
11104
11196
|
let t = e.bufferingRanges[e.bufferingRanges.length - 1];
|
|
11105
11197
|
d = !!t && !t.end, Qt(e.bufferingRanges), this.metrics.levels[l] = e;
|
|
11106
11198
|
}
|
|
11107
11199
|
if (e.to) {
|
|
11108
11200
|
var p;
|
|
11109
|
-
let e = (p = this.metrics.levels[u]) == null ?
|
|
11201
|
+
let e = (p = this.metrics.levels[u]) == null ? _x() : p;
|
|
11110
11202
|
$t(e.activeRanges), d && $t(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
|
|
11111
11203
|
}
|
|
11112
11204
|
}), e(this, "onMediaDeliveryResumed", () => {
|
|
11113
11205
|
this.lastDeliveryResumeTime = performance.now();
|
|
11114
11206
|
}), e(this, "onBufferFullness", (e) => {
|
|
11115
11207
|
if (this.metrics.bufferFullness = e, this.isSuspended) return;
|
|
11116
|
-
let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e /
|
|
11208
|
+
let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / yx);
|
|
11117
11209
|
if (n && r(n.time) === r(t)) n.time = t, n.value = e;
|
|
11118
11210
|
else {
|
|
11119
11211
|
var i, a;
|
|
@@ -11121,7 +11213,7 @@ var ox, sx = () => ({
|
|
|
11121
11213
|
time: t,
|
|
11122
11214
|
value: e
|
|
11123
11215
|
});
|
|
11124
|
-
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 -
|
|
11216
|
+
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 - bx, r);
|
|
11125
11217
|
this.bufferFullness.filterPop(({ time: e }) => e >= o);
|
|
11126
11218
|
}
|
|
11127
11219
|
this.bufferFullnessRegression = this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression() : void 0;
|
|
@@ -11193,10 +11285,10 @@ var ox, sx = () => ({
|
|
|
11193
11285
|
$t(this.metrics.general.activeRanges);
|
|
11194
11286
|
}
|
|
11195
11287
|
};
|
|
11196
|
-
|
|
11288
|
+
gx = Sx, e(Sx, "create", (e, t, n, r) => new gx(e, t, n, r));
|
|
11197
11289
|
//#endregion
|
|
11198
11290
|
//#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
|
|
11199
|
-
var
|
|
11291
|
+
var Cx, wx = class {
|
|
11200
11292
|
constructor(t, n) {
|
|
11201
11293
|
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", () => {
|
|
11202
11294
|
this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
|
|
@@ -11246,7 +11338,7 @@ var px, mx = class {
|
|
|
11246
11338
|
from: t
|
|
11247
11339
|
});
|
|
11248
11340
|
}), e(this, "onSubscriptionChanged", (e) => {
|
|
11249
|
-
this.updateRenditionLevels(e);
|
|
11341
|
+
this.updateRenditionLevels(e.reset ? y(y({}, e), {}, { to: e.from }) : e);
|
|
11250
11342
|
}), e(this, "updateRenditionLevels", ({ to: e, from: t }) => {
|
|
11251
11343
|
var n;
|
|
11252
11344
|
let { channelId: r, initiator: i } = e, a = this.getRenditionLevel(t), o = /* @__PURE__ */ new Set();
|
|
@@ -11271,64 +11363,10 @@ var px, mx = class {
|
|
|
11271
11363
|
}), 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);
|
|
11272
11364
|
}
|
|
11273
11365
|
};
|
|
11274
|
-
|
|
11275
|
-
//#endregion
|
|
11276
|
-
//#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
|
|
11277
|
-
var hx, gx = (e) => JSON.parse(JSON.stringify(e)), _x = 1e4, vx = class {
|
|
11278
|
-
constructor(t, n, r) {
|
|
11279
|
-
e(this, "logger", void 0), e(this, "timers", new O()), 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, "burstMs", 0), e(this, "unload", () => {
|
|
11280
|
-
this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
|
|
11281
|
-
}), e(this, "isSwitchingSubscription", () => this._isSwitchingSubscription), e(this, "getTargetSubscription", () => this.targetSubscription), e(this, "getCurrentSubscription", () => this.currentSubscription), e(this, "enableBurst", (e) => {
|
|
11282
|
-
this.burstMs = e;
|
|
11283
|
-
}), e(this, "setSize", (e) => {
|
|
11284
|
-
this.targetSubscription.video.width = e.width, this.targetSubscription.video.height = e.height, this.scheduleSubscriptionChange();
|
|
11285
|
-
}), e(this, "setVideoConstraint", (e) => {
|
|
11286
|
-
this.targetSubscription.video = e, this.scheduleSubscriptionChange();
|
|
11287
|
-
}), e(this, "setAudioConstraint", (e) => {
|
|
11288
|
-
this.targetSubscription.audio = e, this.scheduleSubscriptionChange();
|
|
11289
|
-
}), e(this, "setVideoBitRate", (e) => {
|
|
11290
|
-
this.targetSubscription.video.bitRate = e, this.scheduleSubscriptionChange();
|
|
11291
|
-
}), e(this, "setAudioBitRate", (e) => {
|
|
11292
|
-
this.targetSubscription.audio.bitRate = e, this.scheduleSubscriptionChange();
|
|
11293
|
-
}), e(this, "setChannelId", (e) => {
|
|
11294
|
-
this.targetSubscription.channelId = e, this.scheduleSubscriptionChange();
|
|
11295
|
-
}), e(this, "setLanguage", (e) => {
|
|
11296
|
-
this.targetSubscription.audio.language = e, this.scheduleSubscriptionChange();
|
|
11297
|
-
}), e(this, "setVideoCodec", (e) => {
|
|
11298
|
-
this.targetSubscription.video.codec = e, this.scheduleSubscriptionChange();
|
|
11299
|
-
}), e(this, "setAudioCodec", (e) => {
|
|
11300
|
-
this.targetSubscription.audio.codec = e, this.scheduleSubscriptionChange();
|
|
11301
|
-
}), e(this, "setBurst", (e) => {
|
|
11302
|
-
e ? this.targetSubscription.burstMs = e : delete this.targetSubscription.burstMs;
|
|
11303
|
-
}), e(this, "isNewSubscription", () => {
|
|
11304
|
-
let e = [
|
|
11305
|
-
"burstMs",
|
|
11306
|
-
"meta",
|
|
11307
|
-
"initiator",
|
|
11308
|
-
"channelGroupId"
|
|
11309
|
-
];
|
|
11310
|
-
return !Et(qt(this.currentSubscription, e), qt(this.targetSubscription, e));
|
|
11311
|
-
}), e(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
|
|
11312
|
-
this.logger.debug("onSubscriptionChanged", {
|
|
11313
|
-
to: e,
|
|
11314
|
-
reset: t
|
|
11315
|
-
}), t ? this.targetSubscription = gx(this.currentSubscription) : this.currentSubscription = gx(e), this._isSwitchingSubscription = this.isNewSubscription();
|
|
11316
|
-
}), e(this, "scheduleSubscriptionChange", () => {
|
|
11317
|
-
this.targetSubscription = gx(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
|
|
11318
|
-
let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
|
|
11319
|
-
this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
|
|
11320
|
-
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = gx(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
|
|
11321
|
-
}, _x), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
|
|
11322
|
-
type: "subscribe",
|
|
11323
|
-
subscription: this.getTargetSubscription()
|
|
11324
|
-
}), 0));
|
|
11325
|
-
}), this.logger = t, this.targetSubscription = n, this.currentSubscription = gx(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
11326
|
-
}
|
|
11327
|
-
};
|
|
11328
|
-
hx = vx, e(vx, "create", (e, t, n) => new hx(e, n, t));
|
|
11366
|
+
Cx = wx, e(wx, "create", (e, t) => new Cx(e, t));
|
|
11329
11367
|
//#endregion
|
|
11330
11368
|
//#region ../../libs/web-sdk/src/BFrameTracker.ts
|
|
11331
|
-
var
|
|
11369
|
+
var Tx = class t {
|
|
11332
11370
|
constructor() {
|
|
11333
11371
|
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 Dt(t.MAX_REMEMBERED_RENDITIONS));
|
|
11334
11372
|
}
|
|
@@ -11364,7 +11402,7 @@ var yx = class t {
|
|
|
11364
11402
|
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;
|
|
11365
11403
|
}
|
|
11366
11404
|
remember(e) {
|
|
11367
|
-
this.channelId !== void 0 && this.rememberedRenditions.set(
|
|
11405
|
+
this.channelId !== void 0 && this.rememberedRenditions.set(cb(this.channelId, this.renditionId), e);
|
|
11368
11406
|
}
|
|
11369
11407
|
latchBFrames() {
|
|
11370
11408
|
this.hasBFramesValue = !0, this.hasObservedReordering = !0, this.isAwaitingAssessment = !1, this.remember(!0);
|
|
@@ -11376,18 +11414,18 @@ var yx = class t {
|
|
|
11376
11414
|
this.hasSeenKeyframe && !this.hasObservedReordering && (this.remember(!1), this.hasBFramesValue = !1), this.hasSeenKeyframe = !0, this.omittedBoundaryCrossings = 0;
|
|
11377
11415
|
}
|
|
11378
11416
|
resetOnSwitch(e, t) {
|
|
11379
|
-
if (
|
|
11417
|
+
if (!lb(e, t, this.channelId, this.renditionId)) {
|
|
11380
11418
|
let n = this.channelId !== void 0;
|
|
11381
11419
|
this.channelId = e, this.renditionId = t, this.anchorCts = void 0, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1;
|
|
11382
|
-
let r = this.rememberedRenditions.get(
|
|
11420
|
+
let r = this.rememberedRenditions.get(cb(e, t));
|
|
11383
11421
|
this.hasBFramesValue = r == null ? !1 : r, n && (this.isAwaitingAssessment = r === void 0);
|
|
11384
11422
|
}
|
|
11385
11423
|
}
|
|
11386
11424
|
};
|
|
11387
|
-
e(
|
|
11425
|
+
e(Tx, "MAX_REMEMBERED_RENDITIONS", 32);
|
|
11388
11426
|
//#endregion
|
|
11389
11427
|
//#region ../../libs/web-sdk/src/modules/SyncModule.ts
|
|
11390
|
-
var
|
|
11428
|
+
var Ex, Dx = 5e3, Ox = .5, kx = 3e3, Ax = () => Fe() || Me(), jx = (e) => e && Ax() ? 100 : 0, Mx = (e) => (t) => t > e, Nx = 100, Px = 1e3, Fx = 1e3, Ix = 1e3, Lx = 100, Rx = 50, zx = {
|
|
11391
11429
|
seek: {
|
|
11392
11430
|
toleranceMs: 200,
|
|
11393
11431
|
toleranceMaxMs: 2500,
|
|
@@ -11419,7 +11457,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11419
11457
|
decayCooldownMultiplier: 3,
|
|
11420
11458
|
decayCheckInterval: 15e3
|
|
11421
11459
|
}
|
|
11422
|
-
},
|
|
11460
|
+
}, Bx = class {
|
|
11423
11461
|
get driftSamplesToCollect() {
|
|
11424
11462
|
return this._driftSamplesToCollect;
|
|
11425
11463
|
}
|
|
@@ -11427,8 +11465,8 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11427
11465
|
this._driftSamplesToCollect = e, this.driftSamples = new r(e);
|
|
11428
11466
|
}
|
|
11429
11467
|
constructor(t, n, i, a, o, s = !0) {
|
|
11430
|
-
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(10)), e(this, "lastSeekTime", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs",
|
|
11431
|
-
this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ?
|
|
11468
|
+
e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(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", Nx), 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", O.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 r(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new Tx()), 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", () => {
|
|
11469
|
+
this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? Px : Nx);
|
|
11432
11470
|
}), e(this, "unload", () => {
|
|
11433
11471
|
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");
|
|
11434
11472
|
}), e(this, "suspend", () => {
|
|
@@ -11446,7 +11484,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11446
11484
|
var e;
|
|
11447
11485
|
return (e = this.timestampOffset) == null ? 0 : e;
|
|
11448
11486
|
}), e(this, "getCurrentChannelId", () => this.currentChannelId), e(this, "resetSyncState", () => {
|
|
11449
|
-
this.state.seekToleranceMultiplier = 1, this.state.timeshiftToleranceMultiplier = 1, this.seekAdjustmentTimestamps = [], this.timeshiftAdjustmentTimestamps = [], this.driftSamples.clear(), this.playbackState = void 0, this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags();
|
|
11487
|
+
this.state.seekToleranceMultiplier = 1, this.state.timeshiftToleranceMultiplier = 1, this.seekAdjustmentTimestamps = [], this.timeshiftAdjustmentTimestamps = [], this.driftSamples.clear(), this.timeshiftDeferralStartedAt = void 0, this.playbackState = void 0, this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags();
|
|
11450
11488
|
}), e(this, "getEffectiveSeekToleranceMs", () => this.config.timeshift.enabled ? this.config.seek.toleranceMs * 2 : this.config.seek.toleranceMs), e(this, "isTimeshiftUnsafe", () => this.usesMse && (this.hasObservedBFrames || this.bFrameDetector.isAwaitingReorderAssessment)), e(this, "clearBFrameLatch", () => {
|
|
11451
11489
|
this.hasObservedBFrames = !1;
|
|
11452
11490
|
}), e(this, "latchBFramesIfDetected", () => {
|
|
@@ -11470,7 +11508,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11470
11508
|
}), e(this, "processSample", (e) => {
|
|
11471
11509
|
var t;
|
|
11472
11510
|
if (!e.channelId) throw Error("Sample must be assigned to a channel");
|
|
11473
|
-
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 -
|
|
11511
|
+
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Dx);
|
|
11474
11512
|
let n = e.type === "video" && e.isSync;
|
|
11475
11513
|
if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
|
|
11476
11514
|
let t = 2 ** 53 - 1;
|
|
@@ -11478,8 +11516,8 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11478
11516
|
t = Math.min(t, e);
|
|
11479
11517
|
});
|
|
11480
11518
|
let n = e.timestamp / e.timescale * 1e3;
|
|
11481
|
-
this.currentChannelId = e.channelId, this.timestampOffset = n - t;
|
|
11482
|
-
} else (n || this.allowTimeshiftOnAudio) && this.tryTimeshiftSync();
|
|
11519
|
+
this.currentChannelId = e.channelId, this.timestampOffset = n - t, this.timeshiftDeferralStartedAt = void 0;
|
|
11520
|
+
} else (n || this.allowTimeshiftOnAudio) && this.tryTimeshiftSync(this.usesMse);
|
|
11483
11521
|
let r = this.timestampOffset * e.timescale / 1e3;
|
|
11484
11522
|
return e.timestamp -= r, n && this.keyframeTimestamps.push(e.timestamp / e.timescale * 1e3), this.highestSeenTimestamps.set(e.type, Math.max((t = this.highestSeenTimestamps.get(e.type)) == null ? 0 : t, e.timestamp / e.timescale * 1e3)), e;
|
|
11485
11523
|
}), e(this, "processFragment", (e, t, n) => {
|
|
@@ -11487,7 +11525,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11487
11525
|
this.currentChannelId || (this.currentChannelId = e);
|
|
11488
11526
|
let i = t.mediaType();
|
|
11489
11527
|
if (!i) throw Error("Fragment must have a media type");
|
|
11490
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
11528
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Dx);
|
|
11491
11529
|
let a = i === "video" && t.startsWithKeyframe();
|
|
11492
11530
|
if (i === "video" && (this.bFrameDetector.updateFromFragment({
|
|
11493
11531
|
type: i,
|
|
@@ -11500,12 +11538,12 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11500
11538
|
let t = 2 ** 53 - 1;
|
|
11501
11539
|
console.assert(this.highestSeenTimestamps.size !== 0, "no known timestamps"), this.highestSeenTimestamps.forEach((e) => {
|
|
11502
11540
|
t = Math.min(t, e);
|
|
11503
|
-
}), this.currentChannelId = e;
|
|
11504
|
-
} else (a || this.allowTimeshiftOnAudio) && this.tryTimeshiftSync();
|
|
11541
|
+
}), this.currentChannelId = e, this.timeshiftDeferralStartedAt = void 0;
|
|
11542
|
+
} else (a || this.allowTimeshiftOnAudio) && this.tryTimeshiftSync(this.usesMse);
|
|
11505
11543
|
let o = this.timestampOffset * t.timescale() / 1e3;
|
|
11506
11544
|
return t.updateBaseMediaDecodeTime(t.baseMediaDecodeTime() - o), a && this.keyframeTimestamps.push(t.baseMediaDecodeTime() / t.timescale() * 1e3), this.highestSeenTimestamps.set(i, Math.max((r = this.highestSeenTimestamps.get(i)) == null ? 0 : r, t.baseMediaDecodeTime() / t.timescale() * 1e3)), t;
|
|
11507
11545
|
}), e(this, "forceSeek", () => {
|
|
11508
|
-
this.logger.debug("Forcing seek", { amount: this.serverCurrentTime - this.playbackSource.currentTime }), this.clearRecoverySeekFlags(), this.playbackSource.currentTime = this.serverCurrentTime, this.positionSetBySeek = this.playbackSource.currentTime;
|
|
11546
|
+
this.logger.debug("Forcing seek", { amount: this.serverCurrentTime - this.playbackSource.currentTime }), this.clearRecoverySeekFlags(), this.playbackSource.currentTime = this.serverCurrentTime, this.timeshiftDeferralStartedAt = void 0, this.positionSetBySeek = this.playbackSource.currentTime;
|
|
11509
11547
|
}), e(this, "forceTimeshift", () => {
|
|
11510
11548
|
this.queuedTimeshift = !0;
|
|
11511
11549
|
}), e(this, "setPlaybackRateAdjustmentEnabled", (e) => {
|
|
@@ -11592,31 +11630,47 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11592
11630
|
})), !0;
|
|
11593
11631
|
}
|
|
11594
11632
|
return !t && n < this.config.playbackRate.startDiff ? !0 : t;
|
|
11595
|
-
}), e(this, "tryTimeshiftSync", () => {
|
|
11596
|
-
var
|
|
11633
|
+
}), e(this, "tryTimeshiftSync", (e = !1) => {
|
|
11634
|
+
var t;
|
|
11597
11635
|
if (!this.config.timeshift.enabled) return;
|
|
11598
11636
|
if (this.isTimeshiftUnsafe()) {
|
|
11599
11637
|
this.queuedTimeshift && this.hasObservedBFrames && (this.queuedTimeshift = !1, this.logger.info("Dropping forced timeshift: suppressed for B-frame stream, use forceSeek to resync"));
|
|
11600
11638
|
return;
|
|
11601
11639
|
}
|
|
11602
11640
|
if (this.hasPendingRecoverySeek() || !this.isAllowedToSync() || this.playbackSource.playbackRate !== 1) return;
|
|
11603
|
-
let
|
|
11604
|
-
this.driftSamples.push(
|
|
11605
|
-
let
|
|
11606
|
-
if (this.queuedTimeshift &&
|
|
11607
|
-
this.queuedTimeshift = !1, this.applyTimeshift(
|
|
11641
|
+
let n = (t = this.drift) == null ? 0 : t;
|
|
11642
|
+
this.driftSamples.push(n);
|
|
11643
|
+
let r = bt(this.driftSamples.items());
|
|
11644
|
+
if (this.queuedTimeshift && r > 0) {
|
|
11645
|
+
this.queuedTimeshift = !1, this.applyTimeshift(r);
|
|
11646
|
+
return;
|
|
11647
|
+
}
|
|
11648
|
+
if (r >= this.getEffectiveSeekToleranceMs()) return;
|
|
11649
|
+
if (r < this.currentTimeshiftToleranceMs()) {
|
|
11650
|
+
this.timeshiftDeferralStartedAt = void 0;
|
|
11608
11651
|
return;
|
|
11609
11652
|
}
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
if (i && this.state.timeshiftToleranceMultiplier > 2) {
|
|
11653
|
+
let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(Mx(i)).length;
|
|
11654
|
+
if (a && this.state.timeshiftToleranceMultiplier > 2) {
|
|
11613
11655
|
this.logger.debug("Too many timeshifts within sliding window", {
|
|
11614
|
-
timeshiftCooldownThreshold:
|
|
11615
|
-
recentTimeshiftCount:
|
|
11656
|
+
timeshiftCooldownThreshold: i,
|
|
11657
|
+
recentTimeshiftCount: a
|
|
11616
11658
|
});
|
|
11617
11659
|
return;
|
|
11618
11660
|
}
|
|
11619
|
-
|
|
11661
|
+
if (e) {
|
|
11662
|
+
var o, s;
|
|
11663
|
+
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);
|
|
11664
|
+
if (n - r < this.bufferSource.getTargetBufferTime() * Ox) {
|
|
11665
|
+
let e = performance.now();
|
|
11666
|
+
if (this.timeshiftDeferralStartedAt === void 0 && (this.timeshiftDeferralStartedAt = e, this.logger.debug("Deferring timeshift while buffered ahead is thin", {
|
|
11667
|
+
drift: r,
|
|
11668
|
+
bufferedAhead: n
|
|
11669
|
+
})), e - this.timeshiftDeferralStartedAt < kx) return;
|
|
11670
|
+
}
|
|
11671
|
+
this.timeshiftDeferralStartedAt !== void 0 && this.logger.debug("Releasing timeshift deferral", { deferredMs: performance.now() - this.timeshiftDeferralStartedAt });
|
|
11672
|
+
}
|
|
11673
|
+
this.applyTimeshift(r);
|
|
11620
11674
|
}), e(this, "clearRecoverySeekFlags", () => {
|
|
11621
11675
|
this.shouldSeekAfterBuffering = !1, this.shouldSeekWhileStuck = !1;
|
|
11622
11676
|
}), e(this, "hasActiveRecoveryTrigger", () => this.playbackState === "buffering"), e(this, "hasPendingRecoverySeek", () => (this.refreshRecoverySeekState(), this.getRecoverySeekReason() !== void 0)), e(this, "refreshRecoverySeekState", () => {
|
|
@@ -11632,20 +11686,20 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11632
11686
|
let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
|
|
11633
11687
|
return this.shouldSeekAfterBuffering = n !== void 0, n;
|
|
11634
11688
|
}), e(this, "observePlayheadProgress", () => {
|
|
11635
|
-
let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek >
|
|
11689
|
+
let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > Rx);
|
|
11636
11690
|
this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
|
|
11637
11691
|
}), e(this, "isPlayheadStuckInBuffer", () => {
|
|
11638
11692
|
var e, t;
|
|
11639
|
-
if (performance.now() - this.lastPlayheadProgressAt <
|
|
11693
|
+
if (performance.now() - this.lastPlayheadProgressAt < Fx) return !1;
|
|
11640
11694
|
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
|
|
11641
|
-
return r !== void 0 && r - n >=
|
|
11695
|
+
return r !== void 0 && r - n >= Ix;
|
|
11642
11696
|
}), e(this, "getRecoverySeekReason", () => {
|
|
11643
11697
|
if (this.needsMediaSourceRecovery) return "media source reopen";
|
|
11644
11698
|
if (this.shouldSeekWhileStuck) return "stuck in buffer";
|
|
11645
11699
|
if (this.shouldSeekAfterBuffering) return "buffering";
|
|
11646
11700
|
}), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 ? !0 : !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildStuckInBufferSeekPlan", () => {
|
|
11647
11701
|
var e, t;
|
|
11648
|
-
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot,
|
|
11702
|
+
let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, Lx);
|
|
11649
11703
|
if (r === void 0 || i >= r) return;
|
|
11650
11704
|
let a = this.findKeyframeCloseToTimestamp(i);
|
|
11651
11705
|
return {
|
|
@@ -11693,7 +11747,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11693
11747
|
let i = performance.now();
|
|
11694
11748
|
this.lastSeekTime = i, t && t !== "stuck in buffer" && (this.hasPerformedRecoverySeekInCurrentRecoveryState = !0), this.clearRecoverySeekFlags(), this.driftSamples.clear(), this.seekAdjustmentTimestamps.push(i), this.seekAdjustmentCount++;
|
|
11695
11749
|
let a = t === "stuck in buffer" ? 0 : Math.min(n, this.bufferSource.getTargetBufferTime());
|
|
11696
|
-
this.playbackSource.currentTime = r.targetCurrentTime + a, this.positionSetBySeek = this.playbackSource.currentTime, t === "stuck in buffer" && (this.hasPerformedStuckSeekInCurrentStillness = !0, this.lastPlayheadPosition = this.playbackSource.currentTime, this.positionSetBySeek = void 0), this.applyBackoff();
|
|
11750
|
+
this.playbackSource.currentTime = r.targetCurrentTime + a, this.timeshiftDeferralStartedAt = void 0, this.positionSetBySeek = this.playbackSource.currentTime, t === "stuck in buffer" && (this.hasPerformedStuckSeekInCurrentStillness = !0, this.lastPlayheadPosition = this.playbackSource.currentTime, this.positionSetBySeek = void 0), this.applyBackoff();
|
|
11697
11751
|
}), e(this, "applyTimeshift", (e) => {
|
|
11698
11752
|
var t;
|
|
11699
11753
|
let n = (t = e == null ? this.drift : e) == null ? 0 : t;
|
|
@@ -11705,7 +11759,7 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11705
11759
|
currentTime: this.playbackSource.currentTime,
|
|
11706
11760
|
rtt: this.rtt,
|
|
11707
11761
|
timeshiftToleranceMultiplier: this.state.timeshiftToleranceMultiplier
|
|
11708
|
-
}), this.timestampOffset += r;
|
|
11762
|
+
}), this.timestampOffset += r, this.timeshiftDeferralStartedAt = void 0;
|
|
11709
11763
|
let i = performance.now();
|
|
11710
11764
|
if (this.lastSeekTime = i, this.lastAdjustmentTime = i, !this.playbackSource.isPaused && (this.driftSamples.clear(), this.timeshiftAdjustmentTimestamps.push(i), this.timeshiftAdjustmentCount++, this.config.backoff.enabled && this.timeshiftAdjustmentCount > 0 && this.timeshiftAdjustmentCount % this.config.timeshift.backoffEveryN === 0)) {
|
|
11711
11765
|
let e = this.state.timeshiftToleranceMultiplier, t = this.config.timeshift.toleranceMaxMs / this.config.timeshift.toleranceMs;
|
|
@@ -11719,10 +11773,14 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11719
11773
|
var e;
|
|
11720
11774
|
this.tryDecayMultipliers(), this.refreshRecoverySeekState();
|
|
11721
11775
|
let t = (e = this.drift) == null ? 0 : e, n = this.getRecoverySeekReason(), r = n !== void 0;
|
|
11722
|
-
if (!r && !this.isAllowedToSyncIgnoringCooldown()
|
|
11776
|
+
if (!r && !this.isAllowedToSyncIgnoringCooldown()) {
|
|
11777
|
+
this.timeshiftDeferralStartedAt = void 0;
|
|
11778
|
+
return;
|
|
11779
|
+
}
|
|
11780
|
+
if (r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), bt(this.driftSamples.items()) < this.currentTimeshiftToleranceMs() && (this.timeshiftDeferralStartedAt = void 0), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
|
|
11723
11781
|
let i = r ? t : bt(this.driftSamples.items());
|
|
11724
11782
|
if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
|
|
11725
|
-
let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(
|
|
11783
|
+
let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Mx(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
|
|
11726
11784
|
if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
|
|
11727
11785
|
this.logger.debug("Too many seek adjustments within sliding window", {
|
|
11728
11786
|
seekCooldownThreshold: a,
|
|
@@ -11751,9 +11809,9 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11751
11809
|
return;
|
|
11752
11810
|
}
|
|
11753
11811
|
}), e(this, "onPageActive", (e) => {
|
|
11754
|
-
this.setSyncInterval(e ?
|
|
11812
|
+
this.setSyncInterval(e ? Nx : Px), e && this.onSync();
|
|
11755
11813
|
}), e(this, "onPageShow", (e) => {
|
|
11756
|
-
e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ?
|
|
11814
|
+
e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? Px : Nx), this.onSync());
|
|
11757
11815
|
}), e(this, "setSyncInterval", (e) => {
|
|
11758
11816
|
this.syncInterval !== void 0 && this.currentSyncIntervalMs === e || (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
|
|
11759
11817
|
}), e(this, "clearSyncInterval", () => {
|
|
@@ -11764,11 +11822,11 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11764
11822
|
let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
|
|
11765
11823
|
if (t && r) return n;
|
|
11766
11824
|
}
|
|
11767
|
-
}), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot =
|
|
11768
|
-
seek: y({},
|
|
11769
|
-
timeshift: y({},
|
|
11770
|
-
playbackRate: y({},
|
|
11771
|
-
backoff: y({},
|
|
11825
|
+
}), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = jx(s), this.config = {
|
|
11826
|
+
seek: y({}, zx.seek),
|
|
11827
|
+
timeshift: y({}, zx.timeshift),
|
|
11828
|
+
playbackRate: y({}, zx.playbackRate),
|
|
11829
|
+
backoff: y({}, zx.backoff)
|
|
11772
11830
|
}, this.config.timeshift.enabled = o, s || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
|
|
11773
11831
|
seekToleranceMultiplier: 1,
|
|
11774
11832
|
timeshiftToleranceMultiplier: 1
|
|
@@ -11830,10 +11888,10 @@ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx =
|
|
|
11830
11888
|
return this.serverCurrentTime - this.playbackSource.currentTime;
|
|
11831
11889
|
}
|
|
11832
11890
|
};
|
|
11833
|
-
|
|
11891
|
+
Ex = Bx, e(Bx, "create", (e, t, n, r, i, a = !0) => new Ex(e, t, n, r, i, a));
|
|
11834
11892
|
//#endregion
|
|
11835
11893
|
//#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
|
|
11836
|
-
var
|
|
11894
|
+
var Vx, Hx = {
|
|
11837
11895
|
enabled: !0,
|
|
11838
11896
|
interval: 3e4,
|
|
11839
11897
|
includeErrors: !0,
|
|
@@ -11842,11 +11900,11 @@ var Nx, Px = {
|
|
|
11842
11900
|
maxRetries: 10,
|
|
11843
11901
|
maxErrorReports: 50,
|
|
11844
11902
|
maxEvents: 50
|
|
11845
|
-
},
|
|
11903
|
+
}, Ux = (e, t) => y(y({}, t), {}, {
|
|
11846
11904
|
type: e,
|
|
11847
11905
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
11848
11906
|
discriminator: "web"
|
|
11849
|
-
}),
|
|
11907
|
+
}), Wx = class {
|
|
11850
11908
|
constructor(n, i, a, o) {
|
|
11851
11909
|
var s = this;
|
|
11852
11910
|
e(this, "logger", void 0), e(this, "timers", new O()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new r(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
|
|
@@ -11863,7 +11921,7 @@ var Nx, Px = {
|
|
|
11863
11921
|
initiator: "interval"
|
|
11864
11922
|
}, n = {}) => {
|
|
11865
11923
|
if (!this.options.includeStats) return;
|
|
11866
|
-
let r = this.parentContext.getStatistics(), i =
|
|
11924
|
+
let r = this.parentContext.getStatistics(), i = Ux("stats", y(y(y({}, n), r), {}, {
|
|
11867
11925
|
isFinal: e,
|
|
11868
11926
|
initiator: t,
|
|
11869
11927
|
count: this.statsCount++
|
|
@@ -11871,7 +11929,7 @@ var Nx, Px = {
|
|
|
11871
11929
|
this.unsentLines.push(i);
|
|
11872
11930
|
}), e(this, "addEvent", (e) => {
|
|
11873
11931
|
if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
|
|
11874
|
-
let t =
|
|
11932
|
+
let t = Ux("event", y(y({}, this.parentContext.getStatistics()), e));
|
|
11875
11933
|
this.eventCount++, this.unsentLines.push(t);
|
|
11876
11934
|
}), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
|
|
11877
11935
|
var e = t(function* (e) {
|
|
@@ -11916,14 +11974,14 @@ var Nx, Px = {
|
|
|
11916
11974
|
let { includeErrors: t, maxErrorReports: n } = this.options;
|
|
11917
11975
|
if (!(e instanceof k) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
|
|
11918
11976
|
let r = this.parentContext.getStatistics();
|
|
11919
|
-
this.unsentLines.push(
|
|
11920
|
-
}), this.logger = n, this.emitter = i, this.options = y(y({},
|
|
11977
|
+
this.unsentLines.push(Ux("error", y(y({}, r), e.toStringifiable())));
|
|
11978
|
+
}), this.logger = n, this.emitter = i, this.options = y(y({}, Hx), a), this.parentContext = o;
|
|
11921
11979
|
}
|
|
11922
11980
|
};
|
|
11923
|
-
|
|
11981
|
+
Vx = Wx, e(Wx, "create", (e, t, n, r) => new Vx(e, t, n, r));
|
|
11924
11982
|
//#endregion
|
|
11925
11983
|
//#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
|
|
11926
|
-
var
|
|
11984
|
+
var Gx, Kx = class {
|
|
11927
11985
|
constructor(t, n, r) {
|
|
11928
11986
|
e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new O()), e(this, "unload", () => {
|
|
11929
11987
|
this.timers.unload();
|
|
@@ -11932,10 +11990,10 @@ var Lx, Rx = class {
|
|
|
11932
11990
|
}), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
|
|
11933
11991
|
}
|
|
11934
11992
|
};
|
|
11935
|
-
|
|
11993
|
+
Gx = Kx, e(Kx, "create", (e, t, n) => new Gx(e, t, n));
|
|
11936
11994
|
//#endregion
|
|
11937
11995
|
//#region ../../libs/web-sdk/src/OptionsProvider.ts
|
|
11938
|
-
var
|
|
11996
|
+
var qx = [
|
|
11939
11997
|
"minBufferTime",
|
|
11940
11998
|
"maxBufferTime",
|
|
11941
11999
|
"burstEnabled",
|
|
@@ -11944,10 +12002,10 @@ var zx = [
|
|
|
11944
12002
|
"offscreenCanvasEnabled",
|
|
11945
12003
|
"videoCodecs"
|
|
11946
12004
|
];
|
|
11947
|
-
function
|
|
11948
|
-
return
|
|
12005
|
+
function Jx(e) {
|
|
12006
|
+
return qx.includes(e);
|
|
11949
12007
|
}
|
|
11950
|
-
var
|
|
12008
|
+
var Yx = class {
|
|
11951
12009
|
constructor(t) {
|
|
11952
12010
|
e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
|
|
11953
12011
|
}
|
|
@@ -11961,7 +12019,7 @@ var Vx = class {
|
|
|
11961
12019
|
this.options[e] = t;
|
|
11962
12020
|
}
|
|
11963
12021
|
get(e, t) {
|
|
11964
|
-
if (t &&
|
|
12022
|
+
if (t && Jx(e)) {
|
|
11965
12023
|
var n;
|
|
11966
12024
|
let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
11967
12025
|
if (r !== void 0) return r;
|
|
@@ -11972,7 +12030,7 @@ var Vx = class {
|
|
|
11972
12030
|
var n;
|
|
11973
12031
|
return (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
11974
12032
|
}
|
|
11975
|
-
},
|
|
12033
|
+
}, Xx = 6, Zx = (e) => {
|
|
11976
12034
|
let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
|
|
11977
12035
|
var i, a;
|
|
11978
12036
|
if (e.flags && Ls(e.flags)) {
|
|
@@ -11984,7 +12042,7 @@ var Vx = class {
|
|
|
11984
12042
|
return u > 0 && (r = u), y(y({}, e), {}, { duration: u > 0 ? u : r });
|
|
11985
12043
|
};
|
|
11986
12044
|
return (e, n = !1) => {
|
|
11987
|
-
if (e.flags && Ls(e.flags) && n && (i = !i), !(n && t.length <
|
|
12045
|
+
if (e.flags && Ls(e.flags) && n && (i = !i), !(n && t.length < Xx && i) && t.length > 0) {
|
|
11988
12046
|
i = !1;
|
|
11989
12047
|
let n = e;
|
|
11990
12048
|
for (let e = t.length - 1; e > 0; e--) {
|
|
@@ -11997,13 +12055,13 @@ var Vx = class {
|
|
|
11997
12055
|
}
|
|
11998
12056
|
return t.push(e), [];
|
|
11999
12057
|
};
|
|
12000
|
-
},
|
|
12058
|
+
}, Qx = ["mse", "wasm"], $x = (e) => e == null ? Qx : e, eS = (e) => {
|
|
12001
12059
|
if (!e) return !1;
|
|
12002
12060
|
let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
|
|
12003
12061
|
return !!(t || n);
|
|
12004
|
-
},
|
|
12005
|
-
if (
|
|
12006
|
-
let r =
|
|
12062
|
+
}, tS = (e, t, n) => {
|
|
12063
|
+
if (eS(n)) return "mse";
|
|
12064
|
+
let r = $x(e);
|
|
12007
12065
|
for (let e of r) switch (e) {
|
|
12008
12066
|
case "mse":
|
|
12009
12067
|
if (t) return "mse";
|
|
@@ -12014,7 +12072,7 @@ var Vx = class {
|
|
|
12014
12072
|
case "wasm": return "wasm";
|
|
12015
12073
|
}
|
|
12016
12074
|
return "wasm";
|
|
12017
|
-
},
|
|
12075
|
+
}, nS = (e, t, n) => {
|
|
12018
12076
|
if (dn(t)) return y(y({}, e), {}, {
|
|
12019
12077
|
type: "video",
|
|
12020
12078
|
codec: t.codec,
|
|
@@ -12035,12 +12093,12 @@ var Vx = class {
|
|
|
12035
12093
|
data: e.payload,
|
|
12036
12094
|
duration: 0
|
|
12037
12095
|
});
|
|
12038
|
-
},
|
|
12096
|
+
}, rS = ({ average: e, last: t, max: n, min: r }) => ({
|
|
12039
12097
|
average: Math.round(e),
|
|
12040
12098
|
last: Math.round(t),
|
|
12041
12099
|
max: Math.round(n),
|
|
12042
12100
|
min: Math.round(r)
|
|
12043
|
-
}),
|
|
12101
|
+
}), iS = [
|
|
12044
12102
|
"timeSpentBuffering",
|
|
12045
12103
|
"timePerBufferingEvent",
|
|
12046
12104
|
"drift",
|
|
@@ -12052,24 +12110,24 @@ var Vx = class {
|
|
|
12052
12110
|
"videoKeyframeIntervalMs",
|
|
12053
12111
|
"timeToConnected",
|
|
12054
12112
|
"mediaSourceOpenTime"
|
|
12055
|
-
],
|
|
12113
|
+
], aS = [
|
|
12056
12114
|
"videoDecodeTime",
|
|
12057
12115
|
"audioDecodeTime",
|
|
12058
12116
|
"videoTransportTime",
|
|
12059
12117
|
"rtt"
|
|
12060
|
-
],
|
|
12118
|
+
], oS = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, sS = (e) => {
|
|
12061
12119
|
let t = y({}, e);
|
|
12062
|
-
for (let e of
|
|
12120
|
+
for (let e of iS) {
|
|
12063
12121
|
let n = t[e];
|
|
12064
12122
|
typeof n == "number" && (t[e] = Math.round(n));
|
|
12065
12123
|
}
|
|
12066
|
-
for (let e of
|
|
12124
|
+
for (let e of aS) {
|
|
12067
12125
|
let n = t[e];
|
|
12068
|
-
|
|
12126
|
+
oS(n) && (t[e] = rS(n));
|
|
12069
12127
|
}
|
|
12070
12128
|
return t;
|
|
12071
|
-
},
|
|
12072
|
-
if (!
|
|
12129
|
+
}, cS = (e, t) => e && typeof e == "object" && t in e, lS = (e) => !(typeof e != "object" || !cS(e, "channelId") || typeof e.channelId != "string" || !cS(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), uS = (e) => {
|
|
12130
|
+
if (!lS(e)) throw new k("Invalid options", {
|
|
12073
12131
|
isFatal: !0,
|
|
12074
12132
|
code: "invalid_options"
|
|
12075
12133
|
});
|
|
@@ -12078,13 +12136,13 @@ var Vx = class {
|
|
|
12078
12136
|
let n = t;
|
|
12079
12137
|
n[e] === void 0 && delete n[e];
|
|
12080
12138
|
}), t;
|
|
12081
|
-
},
|
|
12139
|
+
}, dS = (e) => {
|
|
12082
12140
|
if (typeof e != "object" || !e) throw Error("not an object");
|
|
12083
12141
|
if (!("video" in e)) throw Error("missing video in subscription");
|
|
12084
12142
|
if (!("audio" in e)) throw Error("missing audio in subscription");
|
|
12085
12143
|
if (!("channelId" in e)) throw Error("missing channelId");
|
|
12086
12144
|
return !0;
|
|
12087
|
-
},
|
|
12145
|
+
}, fS = class {
|
|
12088
12146
|
constructor(n) {
|
|
12089
12147
|
var r = this;
|
|
12090
12148
|
e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
|
|
@@ -12145,10 +12203,10 @@ var Vx = class {
|
|
|
12145
12203
|
return this.inFlight.set(e, o), o;
|
|
12146
12204
|
}), this.logger = n;
|
|
12147
12205
|
}
|
|
12148
|
-
},
|
|
12206
|
+
}, pS = 1e4, mS = 1280 * 720, hS = /* @__PURE__ */ new WeakMap(), gS = /* @__PURE__ */ new WeakMap(), _S = /* @__PURE__ */ new WeakMap(), vS = class n extends ie {
|
|
12149
12207
|
constructor(r) {
|
|
12150
12208
|
var o, c, u;
|
|
12151
|
-
super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", qe()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ie()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", cn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !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 oe(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new sn()), e(this, "encryptedMediaExtensions", void 0), i(this,
|
|
12209
|
+
super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", qe()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ie()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", cn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !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 oe(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new sn()), e(this, "encryptedMediaExtensions", void 0), i(this, hS, 0), i(this, gS, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new ub()), e(this, "unextractableSamplesWarned", new ub()), 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), i(this, _S, void 0), e(this, "attach", (e) => {
|
|
12152
12210
|
var t;
|
|
12153
12211
|
(t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
|
|
12154
12212
|
}), e(this, "setElement", (e) => {
|
|
@@ -12244,20 +12302,20 @@ var Vx = class {
|
|
|
12244
12302
|
}), e(this, "updateTextTracks", (e) => {
|
|
12245
12303
|
let t = e.filter((e) => e.codec === "webvtt");
|
|
12246
12304
|
t.forEach((e) => {
|
|
12247
|
-
if (!s(
|
|
12305
|
+
if (!s(gS, this).find((t) => t.language === e.language)) {
|
|
12248
12306
|
if (this.modules.canvasModule) {
|
|
12249
12307
|
let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
|
|
12250
|
-
s(
|
|
12308
|
+
s(gS, this).push(t);
|
|
12251
12309
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
12252
12310
|
let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
|
|
12253
|
-
s(
|
|
12311
|
+
s(gS, this).push(t);
|
|
12254
12312
|
}
|
|
12255
12313
|
}
|
|
12256
12314
|
});
|
|
12257
|
-
for (let e of s(
|
|
12315
|
+
for (let e of s(gS, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
|
|
12258
12316
|
this.emit("text tracks", this.textTracks);
|
|
12259
12317
|
}), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
|
|
12260
|
-
s(
|
|
12318
|
+
s(gS, this).forEach((t) => {
|
|
12261
12319
|
if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
|
|
12262
12320
|
});
|
|
12263
12321
|
}), e(this, "filterRenditions", function() {
|
|
@@ -12413,8 +12471,8 @@ var Vx = class {
|
|
|
12413
12471
|
u = void 0, d = void 0, o.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
|
|
12414
12472
|
}
|
|
12415
12473
|
else s && o.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
|
|
12416
|
-
let f = o.capturesCanvasOnWebKit(u), p = yield
|
|
12417
|
-
if (h instanceof
|
|
12474
|
+
let f = o.capturesCanvasOnWebKit(u), p = yield xb.create(o.emitter, o.logger.createContext("DecoderModule"), o.options.get("logLevel"), n, o.playbackSource, o.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = o.modules.canvasModule;
|
|
12475
|
+
if (h instanceof Wb) if (m === "OffscreenCanvas" && d) {
|
|
12418
12476
|
h.setVideoRenderingEnabled(!1);
|
|
12419
12477
|
let e = o.element;
|
|
12420
12478
|
e.parentElement ? e.parentElement.replaceChild(d, e) : o.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), o.offscreenCanvasElement = d, o.setElement(d);
|
|
@@ -12426,11 +12484,11 @@ var Vx = class {
|
|
|
12426
12484
|
t.parentElement && t.parentElement.replaceChild(e, t), o.setElement(e);
|
|
12427
12485
|
}
|
|
12428
12486
|
}
|
|
12429
|
-
else h instanceof
|
|
12487
|
+
else h instanceof Zb && (h.setBackgroundPlaybackEnabled(o.isBackgroundPlayEnabled(o.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), o.offscreenCanvasElement = d, f && o.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), o.offscreenCanvasElement = void 0));
|
|
12430
12488
|
(e = o.modules.decoder) == null || e.unload(), o.modules.decoder = p, o.isHiddenWithBackgroundPlayback() && o.modules.decoder.enableBackgroundTimers(), o.modules.decoder.setVideoRenderingEnabled(o.isVideoOnScreen()), o.modules.decoder.load(), o.setupOffscreenSubtitleRouting();
|
|
12431
|
-
})), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof
|
|
12489
|
+
})), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof Zb), e(this, "connectWebKitVideoOutput", (e, t) => {
|
|
12432
12490
|
let n = () => {
|
|
12433
|
-
t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(
|
|
12491
|
+
t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(mS);
|
|
12434
12492
|
};
|
|
12435
12493
|
e.onVideoTrackLost((e) => {
|
|
12436
12494
|
this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
|
|
@@ -12438,7 +12496,7 @@ var Vx = class {
|
|
|
12438
12496
|
let r = e.videoTrack;
|
|
12439
12497
|
r ? t.setVideoTrack(r) : n();
|
|
12440
12498
|
}), e(this, "setupOffscreenSubtitleRouting", () => {
|
|
12441
|
-
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof
|
|
12499
|
+
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof Zb) return;
|
|
12442
12500
|
let e = this.modules.decoder, t = this.modules.canvasModule;
|
|
12443
12501
|
if (!t) return;
|
|
12444
12502
|
let n = !1;
|
|
@@ -12480,7 +12538,7 @@ var Vx = class {
|
|
|
12480
12538
|
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(), n.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();
|
|
12481
12539
|
}), e(this, "getStatistics", () => {
|
|
12482
12540
|
let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? y(y({}, 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;
|
|
12483
|
-
return
|
|
12541
|
+
return sS(y(y({}, e), {}, {
|
|
12484
12542
|
averageBitRate: t,
|
|
12485
12543
|
reconnectsPerHour: i,
|
|
12486
12544
|
seekAdjustmentsPerMinute: s,
|
|
@@ -12489,7 +12547,7 @@ var Vx = class {
|
|
|
12489
12547
|
}), e(this, "resetModules", () => {
|
|
12490
12548
|
Object.values(this.modules).forEach((e) => {
|
|
12491
12549
|
e && "reset" in e && e.reset();
|
|
12492
|
-
}), this.playbackSource instanceof dc && this.modules.adaptivity.holdReconnect(
|
|
12550
|
+
}), this.playbackSource instanceof dc && this.modules.adaptivity.holdReconnect(pS), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
12493
12551
|
}), e(this, "disconnectForInactivePage", (e) => {
|
|
12494
12552
|
if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
|
|
12495
12553
|
var t;
|
|
@@ -12520,10 +12578,10 @@ var Vx = class {
|
|
|
12520
12578
|
e && "unsuspend" in e && e.unsuspend();
|
|
12521
12579
|
});
|
|
12522
12580
|
}), e(this, "getRuntimeInfo", () => {
|
|
12523
|
-
let e = this.modules.canvasModule instanceof
|
|
12581
|
+
let e = this.modules.canvasModule instanceof Zb ? !0 : void 0;
|
|
12524
12582
|
return y({
|
|
12525
12583
|
uptime: this.uptime,
|
|
12526
|
-
version: "4.7.2-
|
|
12584
|
+
version: "4.7.2-17-g3c99bc71",
|
|
12527
12585
|
clientId: this.clientId,
|
|
12528
12586
|
sessionId: this.sessionId,
|
|
12529
12587
|
channelId: this.channelId,
|
|
@@ -12568,7 +12626,7 @@ var Vx = class {
|
|
|
12568
12626
|
if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
|
|
12569
12627
|
let t = (e = this.modules) == null ? void 0 : e.decoder;
|
|
12570
12628
|
return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
|
|
12571
|
-
}), this.options = new
|
|
12629
|
+
}), this.options = new Yx(y(y({}, ar), uS(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
12572
12630
|
let d = {
|
|
12573
12631
|
channelId: this.options.get("channelId"),
|
|
12574
12632
|
audio: {
|
|
@@ -12581,14 +12639,14 @@ var Vx = class {
|
|
|
12581
12639
|
height: this.options.get("maxSize").height
|
|
12582
12640
|
}
|
|
12583
12641
|
}, f = b.get();
|
|
12584
|
-
f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new
|
|
12642
|
+
f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new fS(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
|
|
12585
12643
|
let p = (c = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : c;
|
|
12586
12644
|
p !== void 0 && (this.options.set("streamToMediaElementEnabled", p), this.options.set("iosMediaElementEnabled", p)), r.iosBackgroundPlayEnabled !== void 0 && this.logger.warn("Option iosBackgroundPlayEnabled is deprecated and will be removed in a future release. Use backgroundPlayEnabled instead.");
|
|
12587
12645
|
let m = (u = r.backgroundPlayEnabled) == null ? r.iosBackgroundPlayEnabled : u;
|
|
12588
12646
|
m !== void 0 && (this.options.set("backgroundPlayEnabled", m), this.options.set("iosBackgroundPlayEnabled", m));
|
|
12589
12647
|
let g = r.mseEnabled !== void 0, ee = r.decoders !== void 0;
|
|
12590
12648
|
g && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), g && !ee && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
|
|
12591
|
-
let _ =
|
|
12649
|
+
let _ = px.create(this.emitter, this.logger.createContext("PictureInPictureModule")), te = this.options.get("mediaSessionEnabled") ? Yb.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
|
|
12592
12650
|
metadata: this.options.get("mediaSessionMetadata"),
|
|
12593
12651
|
decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : Ac.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
|
|
12594
12652
|
isMuted: () => this.playbackSource.userMuted,
|
|
@@ -12599,11 +12657,11 @@ var Vx = class {
|
|
|
12599
12657
|
holdDecoyWhilePaused: this.holdsDecoyWhilePaused(),
|
|
12600
12658
|
keepDecoyWhenMuted: this.isWebKitCanvasPath(),
|
|
12601
12659
|
pauseMeansMute: !this.options.get("pauseSupportEnabled")
|
|
12602
|
-
}) : void 0, v = O.create(), re =
|
|
12660
|
+
}) : void 0, v = O.create(), re = nb.create(this.emitter, this.logger.createContext("ConnectionModule"), {
|
|
12603
12661
|
reconnectHandler: this.options.get("reconnectHandler"),
|
|
12604
12662
|
options: this.options,
|
|
12605
12663
|
onConnectInfo: this.onConnectInfo
|
|
12606
|
-
}), ae =
|
|
12664
|
+
}), ae = jv.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), x = wx.create(this.emitter, ae), S = hx.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), se = Sx.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), x, S);
|
|
12607
12665
|
this.encryptedMediaExtensions = new Ci(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
|
|
12608
12666
|
setHeaders: (e) => {
|
|
12609
12667
|
this.encryptedMediaExtensions.headers = e;
|
|
@@ -12612,7 +12670,7 @@ var Vx = class {
|
|
|
12612
12670
|
this.encryptedMediaExtensions.queryParams = e;
|
|
12613
12671
|
}
|
|
12614
12672
|
};
|
|
12615
|
-
let ce =
|
|
12673
|
+
let ce = Cb.create(this.emitter), le = this.options.get("poster"), ue = le === !0 ? this.getThumbnailUrl() : le || void 0, C, de, fe;
|
|
12616
12674
|
if (this.willUseMediaSource()) {
|
|
12617
12675
|
let e = new dc({
|
|
12618
12676
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
@@ -12622,9 +12680,9 @@ var Vx = class {
|
|
|
12622
12680
|
logger: this.logger.createContext("MediaElement"),
|
|
12623
12681
|
poster: ue
|
|
12624
12682
|
});
|
|
12625
|
-
e.on("buffer state", (e) => this.onMediaElementBufferState(e, C)), 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, Ci.isSupported() && this.encryptedMediaExtensions.attach(e.element), C =
|
|
12683
|
+
e.on("buffer state", (e) => this.onMediaElementBufferState(e, C)), 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, Ci.isSupported() && this.encryptedMediaExtensions.attach(e.element), C = nx.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (de = Kx.create(this.logger.createContext("UnpauseModule"), [e], ce)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
|
|
12626
12684
|
} else if (this.streamsToMediaElement()) {
|
|
12627
|
-
let e =
|
|
12685
|
+
let e = Zb.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
|
|
12628
12686
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
12629
12687
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
12630
12688
|
volume: this.options.get("volume"),
|
|
@@ -12636,10 +12694,10 @@ var Vx = class {
|
|
|
12636
12694
|
});
|
|
12637
12695
|
this.element = e.element().element, this.playbackSource = e, fe = e;
|
|
12638
12696
|
let t = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
|
|
12639
|
-
this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (de =
|
|
12697
|
+
this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (de = Kx.create(this.logger.createContext("UnpauseModule"), e.elements(), ce));
|
|
12640
12698
|
} else {
|
|
12641
12699
|
let e;
|
|
12642
|
-
e =
|
|
12700
|
+
e = Wb.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
|
|
12643
12701
|
this.setElement(e.element());
|
|
12644
12702
|
}, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, fe = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Qs());
|
|
12645
12703
|
}
|
|
@@ -12657,9 +12715,9 @@ var Vx = class {
|
|
|
12657
12715
|
getTargetBufferTime: () => S.getTargetBufferTime(),
|
|
12658
12716
|
getNextBufferedRangeStart: C ? (e) => C.getNextBufferedRangeStart(e) : void 0,
|
|
12659
12717
|
getBufferedEndAt: C ? (e) => C.getBufferedEndAt(e) : void 0
|
|
12660
|
-
}, ge =
|
|
12718
|
+
}, ge = Bx.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, he, me, pe), _e = kb.create(this.logger.createContext("JitterModule")), ve = mc.create(this.emitter), ye = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), w = new URL("/telemetry", ye).toString();
|
|
12661
12719
|
this.modules = {
|
|
12662
|
-
telemetry:
|
|
12720
|
+
telemetry: Wx.create(this.logger.createContext("TelemetryModule"), this.emitter, {
|
|
12663
12721
|
url: w,
|
|
12664
12722
|
enabled: this.options.get("telemetryEnabled"),
|
|
12665
12723
|
includeStats: !1,
|
|
@@ -12671,8 +12729,8 @@ var Vx = class {
|
|
|
12671
12729
|
}),
|
|
12672
12730
|
incomingData: ve,
|
|
12673
12731
|
adaptivity: wc.create(this.emitter, this.logger.createContext("AdaptivityModule"), se, ve, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
|
|
12674
|
-
constraintCap:
|
|
12675
|
-
event:
|
|
12732
|
+
constraintCap: sb.create(this.emitter, this.element, x, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
|
|
12733
|
+
event: Eb.create(this.emitter, this.logger.createContext("EventModule"), ge),
|
|
12676
12734
|
sync: ge,
|
|
12677
12735
|
jitter: _e,
|
|
12678
12736
|
documentState: ce,
|
|
@@ -12744,7 +12802,7 @@ var Vx = class {
|
|
|
12744
12802
|
let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
|
|
12745
12803
|
if (e.telemetry) {
|
|
12746
12804
|
var i;
|
|
12747
|
-
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry =
|
|
12805
|
+
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Wx.create(this.logger.createContext("TelemetryModule"), this.emitter, y(y({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
|
|
12748
12806
|
}
|
|
12749
12807
|
}), this.emitter.on("adapt level", (e) => {
|
|
12750
12808
|
let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
|
|
@@ -12779,15 +12837,15 @@ var Vx = class {
|
|
|
12779
12837
|
return;
|
|
12780
12838
|
}
|
|
12781
12839
|
}
|
|
12782
|
-
if (a === r) return;
|
|
12840
|
+
if (this.modules.connection.isMoq && this.modules.subscription.isSwitchingSubscription() || a === r) return;
|
|
12783
12841
|
let f = t[a];
|
|
12784
12842
|
this.alignSizeAndBitRate(y(y({}, this.targetSubscription), {}, {
|
|
12785
12843
|
video: y(y({}, this.targetSubscription.video), f == null ? void 0 : f.video),
|
|
12786
12844
|
audio: y(y({}, this.targetSubscription.audio), f == null ? void 0 : f.audio)
|
|
12787
12845
|
})), this.emitter.emit("adapted level");
|
|
12788
12846
|
}), this.emitter.on("ping timeout", this.stepDownForRejoin), this.emitter.on("text track data", (e) => {
|
|
12789
|
-
let t = s(
|
|
12790
|
-
if (a(
|
|
12847
|
+
let t = s(gS, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(hS, this);
|
|
12848
|
+
if (a(hS, this, n), t) {
|
|
12791
12849
|
if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
|
|
12792
12850
|
for (let r of e.cues) {
|
|
12793
12851
|
let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
|
|
@@ -12803,19 +12861,19 @@ var Vx = class {
|
|
|
12803
12861
|
this.clientIp = t.ip;
|
|
12804
12862
|
break;
|
|
12805
12863
|
case "renditions":
|
|
12806
|
-
this.updateTextTracks(t.renditions), a(
|
|
12864
|
+
this.updateTextTracks(t.renditions), a(_S, this, this.filterRenditions(t.renditions, n.channelId).then((e) => {
|
|
12807
12865
|
r === this.sessionId && (this.emitter.emit("renditions", {
|
|
12808
12866
|
renditions: e,
|
|
12809
12867
|
channelId: n.channelId
|
|
12810
12868
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged());
|
|
12811
12869
|
}).finally(() => {
|
|
12812
|
-
a(
|
|
12870
|
+
a(_S, this, void 0);
|
|
12813
12871
|
}));
|
|
12814
12872
|
break;
|
|
12815
12873
|
case "subscription changed":
|
|
12816
12874
|
var i;
|
|
12817
12875
|
try {
|
|
12818
|
-
|
|
12876
|
+
dS(t.subscription);
|
|
12819
12877
|
} catch (e) {
|
|
12820
12878
|
this.emitter.emit("error", new k("Subscription failed validation", {
|
|
12821
12879
|
source: e instanceof Error ? e : void 0,
|
|
@@ -12834,7 +12892,7 @@ var Vx = class {
|
|
|
12834
12892
|
break;
|
|
12835
12893
|
}
|
|
12836
12894
|
}), this.emitter.on("channel switch timeout", (e) => {
|
|
12837
|
-
this.emit("error", rr(e)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
|
|
12895
|
+
this.alignSizeAndBitRate(this.targetSubscription), this.emit("error", rr(e)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
|
|
12838
12896
|
}), this.emitter.on("received data", (e) => {
|
|
12839
12897
|
let t = this.modules.subscription.getCurrentSubscription(), n = Hs(e);
|
|
12840
12898
|
if (!t) {
|
|
@@ -12946,7 +13004,7 @@ var Vx = class {
|
|
|
12946
13004
|
let xe = function() {
|
|
12947
13005
|
var e = t(function* (e) {
|
|
12948
13006
|
let t = e.channelId;
|
|
12949
|
-
s(
|
|
13007
|
+
s(_S, o) && (yield s(_S, o));
|
|
12950
13008
|
let n = o.modules.renditions.getRendition(e.renditionId, t);
|
|
12951
13009
|
if (!zs(e.flags)) {
|
|
12952
13010
|
if (Bs(e.flags)) {
|
|
@@ -12960,8 +13018,8 @@ var Vx = class {
|
|
|
12960
13018
|
} catch (e) {
|
|
12961
13019
|
o.logger.warn("failed to parse WebVTT segment, dropping it", e);
|
|
12962
13020
|
}
|
|
12963
|
-
let i = n / 1e3, c = s(
|
|
12964
|
-
if (a(
|
|
13021
|
+
let i = n / 1e3, c = s(gS, o).find((t) => t.language === e.language), l = i - s(hS, o);
|
|
13022
|
+
if (a(hS, o, i), c) {
|
|
12965
13023
|
if (c.cues) for (let e of c.cues) e.startTime -= l, e.endTime -= l;
|
|
12966
13024
|
for (let e of r) {
|
|
12967
13025
|
let t = new VTTCue(e.startTime - i, e.endTime - i, e.text);
|
|
@@ -12997,10 +13055,10 @@ var Vx = class {
|
|
|
12997
13055
|
mimeType: s
|
|
12998
13056
|
}), o.emit("initialized media");
|
|
12999
13057
|
} else {
|
|
13000
|
-
let t =
|
|
13058
|
+
let t = nS(e, n, o.sizes.get(e.renditionId));
|
|
13001
13059
|
o.modules.jitter.recordSample(t);
|
|
13002
13060
|
let i = o.sampleProcessingSesssions.get(r);
|
|
13003
|
-
if (!i) i =
|
|
13061
|
+
if (!i) i = Zx(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
|
|
13004
13062
|
else {
|
|
13005
13063
|
let e = o.willUseMediaSource() && o.isSwitchingRenditionLevel && t.type === "video", n = i(o.modules.sync.processSample(t), e), r = t;
|
|
13006
13064
|
n.forEach((e) => {
|
|
@@ -13107,7 +13165,7 @@ var Vx = class {
|
|
|
13107
13165
|
this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
|
|
13108
13166
|
}
|
|
13109
13167
|
set textTrack(e) {
|
|
13110
|
-
e !== this.textTrack && (s(
|
|
13168
|
+
e !== this.textTrack && (s(gS, this).forEach((t) => {
|
|
13111
13169
|
if (t.label === e) t.mode = "showing";
|
|
13112
13170
|
else {
|
|
13113
13171
|
if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
|
|
@@ -13116,11 +13174,11 @@ var Vx = class {
|
|
|
13116
13174
|
}), this.emitter.emit("text track", e));
|
|
13117
13175
|
}
|
|
13118
13176
|
get textTracks() {
|
|
13119
|
-
return s(
|
|
13177
|
+
return s(gS, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
|
|
13120
13178
|
}
|
|
13121
13179
|
get textTrack() {
|
|
13122
13180
|
var e;
|
|
13123
|
-
return (e = s(
|
|
13181
|
+
return (e = s(gS, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
|
|
13124
13182
|
}
|
|
13125
13183
|
get channelId() {
|
|
13126
13184
|
var e, t;
|
|
@@ -13258,7 +13316,7 @@ var Vx = class {
|
|
|
13258
13316
|
return this.modules.subscription.getTargetSubscription();
|
|
13259
13317
|
}
|
|
13260
13318
|
resolvedDecoder(e) {
|
|
13261
|
-
return
|
|
13319
|
+
return tS(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
|
|
13262
13320
|
}
|
|
13263
13321
|
usesSplitCanvasAudio() {
|
|
13264
13322
|
return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && gt(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
|
|
@@ -13298,6 +13356,6 @@ var Vx = class {
|
|
|
13298
13356
|
return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
|
|
13299
13357
|
}
|
|
13300
13358
|
};
|
|
13301
|
-
e(
|
|
13359
|
+
e(vS, "MAX_POOL_SIZE", 10), e(vS, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(vS, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(vS, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
|
|
13302
13360
|
//#endregion
|
|
13303
|
-
export { ft as C, ht as D, dt as E, Ve as O, mt as S, st as T, rt as _, xn as a, nt as b, _n as c, Cn as d, k as f, et as g, it as h, yn as i, Be as k, On as l, tt as m, Pn as n, Sn as o, Jt as p, bn as r, vn as s,
|
|
13361
|
+
export { ft as C, ht as D, dt as E, Ve as O, mt as S, st as T, rt as _, xn as a, nt as b, _n as c, Cn as d, k as f, et as g, it as h, yn as i, Be as k, On as l, tt as m, Pn as n, Sn as o, Jt as p, bn as r, vn as s, vS as t, wn as u, lt as v, ut as w, ot as x, $e as y };
|