@vindral/web-sdk 4.3.0-4-g99bdcb75 → 4.3.0-5-ga57504ef
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/{BsO2lOz0.js → BB6Fyi3Y.js} +252 -241
- package/{BTpwaR7x.js → DAK07riM.js} +1 -1
- package/core.d.ts +12 -0
- package/core.js +1 -1
- package/legacy.d.ts +12 -0
- package/legacy.es.js +1892 -1881
- package/legacy.umd.js +8 -8
- package/package.json +1 -1
- package/player.d.ts +12 -0
- package/player.js +2 -2
- package/react.d.ts +12 -0
- package/vindral-player-component.js +2 -2
|
@@ -7439,52 +7439,54 @@ var Qh = 1e4, Q = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMa
|
|
|
7439
7439
|
}
|
|
7440
7440
|
static start(e, r, i, a, o) {
|
|
7441
7441
|
return t(function* () {
|
|
7442
|
-
var t, s, c;
|
|
7443
|
-
let
|
|
7442
|
+
var t, s, c, l;
|
|
7443
|
+
let u = new Map(a.connectInfo.channels.map((e) => [yp(e.catalog.namespace), new wg(new A(e.catalog))])), d = yield a.onConnectInfo(a.connectInfo), f = a.options.get("authenticationToken"), p, m;
|
|
7444
7444
|
switch (typeof a.edgeUrl) {
|
|
7445
7445
|
case "string":
|
|
7446
|
-
|
|
7446
|
+
p = Zh(a.edgeUrl, d, f);
|
|
7447
7447
|
break;
|
|
7448
7448
|
default:
|
|
7449
|
-
|
|
7449
|
+
p = Zh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, d, f), m = Zh(a.edgeUrl.moqWsUrl, d, f);
|
|
7450
7450
|
break;
|
|
7451
7451
|
}
|
|
7452
|
-
let
|
|
7452
|
+
let h = (t = a.connectInfo.channels.find((e) => e.channelId === d.channelId)) == null ? void 0 : t.catalog;
|
|
7453
7453
|
r.debug("Resolved edge url", {
|
|
7454
|
-
edgeUrl:
|
|
7455
|
-
edgeWsUrl:
|
|
7456
|
-
}), de(
|
|
7457
|
-
let
|
|
7458
|
-
url:
|
|
7459
|
-
wsUrl:
|
|
7454
|
+
edgeUrl: p,
|
|
7455
|
+
edgeWsUrl: m
|
|
7456
|
+
}), de(h, "no catalog found");
|
|
7457
|
+
let ee = (s = u.get(yp(h.namespace))) == null ? void 0 : s.getVideoTrack(d.video), te = (c = u.get(yp(h.namespace))) == null ? void 0 : c.getAudioTrack(d.audio), { session: ne, transportSelectionReason: re } = yield dp({
|
|
7458
|
+
url: p,
|
|
7459
|
+
wsUrl: m,
|
|
7460
7460
|
handshakePipelining: !0,
|
|
7461
7461
|
authToken: a.options.get("authenticationToken"),
|
|
7462
7462
|
preferredTransport: a.options.get("webtransportEnabled") ? "webtransport" : "websocket",
|
|
7463
7463
|
role: eu.Subscriber,
|
|
7464
7464
|
websocketFallbackTimeoutMs: 2e3
|
|
7465
|
-
})
|
|
7465
|
+
});
|
|
7466
|
+
(l = a.onTransportConnected) == null || l.call(a);
|
|
7467
|
+
let g = ne.closed().then((e) => {
|
|
7466
7468
|
throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
|
|
7467
|
-
}),
|
|
7468
|
-
Gh.start(
|
|
7469
|
-
namespace:
|
|
7470
|
-
catalog:
|
|
7471
|
-
videoTrack:
|
|
7472
|
-
audioTrack:
|
|
7473
|
-
burstMs:
|
|
7469
|
+
}), ie = yield Promise.race([
|
|
7470
|
+
Gh.start(ne.subscriber, {
|
|
7471
|
+
namespace: h.namespace,
|
|
7472
|
+
catalog: h,
|
|
7473
|
+
videoTrack: ee == null ? void 0 : ee.track,
|
|
7474
|
+
audioTrack: te == null ? void 0 : te.track,
|
|
7475
|
+
burstMs: d.burstMs || 0
|
|
7474
7476
|
}),
|
|
7475
7477
|
hn(Qh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
|
|
7476
|
-
|
|
7477
|
-
]),
|
|
7478
|
-
|
|
7478
|
+
g
|
|
7479
|
+
]), ae = new wg(ie.catalog());
|
|
7480
|
+
u.set(yp(h.namespace), ae), e.emit("received signal", {
|
|
7479
7481
|
type: "client ip",
|
|
7480
|
-
ip:
|
|
7481
|
-
}),
|
|
7482
|
+
ip: ie.connectionInfo().ip
|
|
7483
|
+
}), ie.drm().then((t) => {
|
|
7482
7484
|
t && e.emit("received drm data", t.value);
|
|
7483
7485
|
}).catch((e) => {
|
|
7484
7486
|
r.error("Error getting DRM data", e);
|
|
7485
7487
|
});
|
|
7486
|
-
let
|
|
7487
|
-
return
|
|
7488
|
+
let oe = new n(e, r, ne, ie, u, i, o, re);
|
|
7489
|
+
return d.textTrack && b(lg, oe).call(oe, d.textTrack), oe;
|
|
7488
7490
|
})();
|
|
7489
7491
|
}
|
|
7490
7492
|
getState() {
|
|
@@ -7956,7 +7958,10 @@ var Eg = (e, t) => {
|
|
|
7956
7958
|
};
|
|
7957
7959
|
kg = Pg, e(Pg, "PING_INTERVAL", 5e3), e(Pg, "MAX_MISSED_PINGS", 4), e(Pg, "TLS_ROUNDTRIPS", 3), e(Pg, "start", (e, t, n, r) => new Promise((i, a) => {
|
|
7958
7960
|
let o = new kg(e, t, n, r);
|
|
7959
|
-
o.transport.once("error", (e) => a(e)), o.transport.once("open", () =>
|
|
7961
|
+
o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
|
|
7962
|
+
var e;
|
|
7963
|
+
(e = n.onTransportConnected) == null || e.call(n), i(o);
|
|
7964
|
+
});
|
|
7960
7965
|
}));
|
|
7961
7966
|
//#endregion
|
|
7962
7967
|
//#region ../../libs/web-sdk/src/EdgeSelector.ts
|
|
@@ -7986,12 +7991,12 @@ var Fg = (e) => {
|
|
|
7986
7991
|
reset() {
|
|
7987
7992
|
x(zg, this, void 0), x(Lg, this, []), b(Rg, this).clear();
|
|
7988
7993
|
}
|
|
7989
|
-
}, Vg, Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new
|
|
7994
|
+
}, Vg, Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakMap(), r_ = /* @__PURE__ */ new WeakSet(), i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = class n {
|
|
7990
7995
|
constructor(r, i, a) {
|
|
7991
7996
|
var o = this;
|
|
7992
|
-
S(this,
|
|
7997
|
+
S(this, r_), 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), v(this, Hg, new _(10)), v(this, Ug, !0), v(this, Wg, void 0), v(this, Gg, 0), v(this, Kg, 0), v(this, qg, 0), v(this, Jg, void 0), v(this, Yg, void 0), v(this, Xg, void 0), v(this, Zg, void 0), v(this, Qg, void 0), v(this, $g, void 0), e(this, "unload", () => {
|
|
7993
7998
|
var e;
|
|
7994
|
-
this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(
|
|
7999
|
+
this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(Qg, this, void 0), this.logger.debug("Unloaded module");
|
|
7995
8000
|
}), e(this, "suspend", () => {
|
|
7996
8001
|
var e;
|
|
7997
8002
|
x(Ug, this, !1), (e = this.connectionImpl) == null || e.suspend();
|
|
@@ -8005,7 +8010,8 @@ var Fg = (e) => {
|
|
|
8005
8010
|
estimatedBandwidth: this.estimatedBandwidth,
|
|
8006
8011
|
connectCount: b(qg, this),
|
|
8007
8012
|
connectionAttemptCount: b(Kg, this),
|
|
8008
|
-
connectionSuccessRatio: e
|
|
8013
|
+
connectionSuccessRatio: e,
|
|
8014
|
+
timeToConnected: b(Zg, this)
|
|
8009
8015
|
}) : {
|
|
8010
8016
|
rtt: {
|
|
8011
8017
|
min: 0,
|
|
@@ -8017,17 +8023,20 @@ var Fg = (e) => {
|
|
|
8017
8023
|
connectCount: b(qg, this),
|
|
8018
8024
|
connectionAttemptCount: b(Kg, this),
|
|
8019
8025
|
connectionSuccessRatio: e,
|
|
8026
|
+
timeToConnected: b(Zg, this),
|
|
8020
8027
|
connectionProtocol: void 0,
|
|
8021
8028
|
transportSelectionReason: void 0
|
|
8022
8029
|
};
|
|
8023
8030
|
}), e(this, "connect", () => {
|
|
8024
|
-
x(Ug, this, !0), !b(Wg, this) && x(Wg, this, y(
|
|
8031
|
+
x(Ug, this, !0), !b(Wg, this) && (b(Zg, this) === void 0 && x(Jg, this, performance.now()), x(Wg, this, y(r_, this, s_).call(this)));
|
|
8032
|
+
}), v(this, e_, () => {
|
|
8033
|
+
b(Zg, this) !== void 0 || b(Jg, this) === void 0 || !b(Ug, this) || (x(Zg, this, performance.now() - b(Jg, this)), x(Jg, this, void 0));
|
|
8025
8034
|
}), e(this, "disconnect", (e = "Disconnect Requested") => {
|
|
8026
8035
|
var t;
|
|
8027
|
-
x(Ug, this, !1), b(
|
|
8036
|
+
x(Ug, this, !1), b(a_, this).call(this), (t = this.connectionImpl) == null || t.close(e);
|
|
8028
8037
|
}), e(this, "reconnect", (e) => {
|
|
8029
8038
|
this.disconnect(e), this.connect();
|
|
8030
|
-
}), v(this,
|
|
8039
|
+
}), v(this, t_, t(function* () {
|
|
8031
8040
|
try {
|
|
8032
8041
|
return yield o.apiClient.connect(o.config.options.getOptions());
|
|
8033
8042
|
} catch (e) {
|
|
@@ -8038,7 +8047,7 @@ var Fg = (e) => {
|
|
|
8038
8047
|
}
|
|
8039
8048
|
throw o.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
|
|
8040
8049
|
}
|
|
8041
|
-
})), v(this,
|
|
8050
|
+
})), v(this, n_, t(function* () {
|
|
8042
8051
|
let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
|
|
8043
8052
|
try {
|
|
8044
8053
|
return yield fetch(new URL("/api/v4/connect/ping", o.config.options.get("url")).toString(), {
|
|
@@ -8050,13 +8059,13 @@ var Fg = (e) => {
|
|
|
8050
8059
|
} finally {
|
|
8051
8060
|
clearTimeout(i);
|
|
8052
8061
|
}
|
|
8053
|
-
})), v(this,
|
|
8054
|
-
b(
|
|
8062
|
+
})), v(this, i_, () => {
|
|
8063
|
+
b(a_, this).call(this), x($g, this, setTimeout(() => {
|
|
8055
8064
|
var e;
|
|
8056
|
-
!b(
|
|
8065
|
+
!b(Qg, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), b(Qg, this).reset(), x($g, this, void 0));
|
|
8057
8066
|
}, n.EDGE_SELECTOR_RESET_TIMEOUT));
|
|
8058
|
-
}), v(this,
|
|
8059
|
-
b(
|
|
8067
|
+
}), v(this, a_, () => {
|
|
8068
|
+
b($g, this) !== void 0 && (clearTimeout(b($g, this)), x($g, this, void 0));
|
|
8060
8069
|
}), this.logger = i, this.emitter = r, this.config = a, this.apiClient = new ge({
|
|
8061
8070
|
publicEndpoint: this.config.options.get("url").toString(),
|
|
8062
8071
|
tokenFactory: () => this.config.options.get("authenticationToken")
|
|
@@ -8069,24 +8078,24 @@ var Fg = (e) => {
|
|
|
8069
8078
|
return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Ng(this.rtt);
|
|
8070
8079
|
}
|
|
8071
8080
|
get firstConnectionTime() {
|
|
8072
|
-
return b(
|
|
8081
|
+
return b(Yg, this);
|
|
8073
8082
|
}
|
|
8074
8083
|
get lastConnectionTime() {
|
|
8075
|
-
return b(
|
|
8084
|
+
return b(Xg, this);
|
|
8076
8085
|
}
|
|
8077
8086
|
};
|
|
8078
|
-
Vg =
|
|
8079
|
-
function
|
|
8087
|
+
Vg = o_;
|
|
8088
|
+
function s_() {
|
|
8080
8089
|
var e = this;
|
|
8081
8090
|
return t(function* () {
|
|
8082
8091
|
let t = new Bg({ edgeUrl: e.config.options.get("edgeUrl") });
|
|
8083
|
-
for (x(
|
|
8092
|
+
for (x(Qg, e, t), b(a_, e).call(e), x(Gg, e, 0);;) {
|
|
8084
8093
|
var n, r, i;
|
|
8085
8094
|
x(Gg, e, (n = b(Gg, e), n++, n)), x(Kg, e, (r = b(Kg, e), r++, r));
|
|
8086
8095
|
let o = !1;
|
|
8087
8096
|
try {
|
|
8088
8097
|
var a;
|
|
8089
|
-
let [n, r] = yield Promise.all([b(
|
|
8098
|
+
let [n, r] = yield Promise.all([b(t_, e).call(e), b(n_, e).call(e)]);
|
|
8090
8099
|
if (b(Hg, e).clear(), r !== void 0 && b(Hg, e).push(r / 2), !b(Ug, e)) break;
|
|
8091
8100
|
let i = t.select(n.edges);
|
|
8092
8101
|
if (!i) throw new g("Failed to resolve edge url", {
|
|
@@ -8095,11 +8104,13 @@ function i_() {
|
|
|
8095
8104
|
});
|
|
8096
8105
|
ce(n) ? e.connectionImpl = yield fg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
|
|
8097
8106
|
connectInfo: n,
|
|
8098
|
-
edgeUrl: i
|
|
8107
|
+
edgeUrl: i,
|
|
8108
|
+
onTransportConnected: b(e_, e)
|
|
8099
8109
|
}), b(Hg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Pg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
|
|
8100
8110
|
connectInfo: n,
|
|
8101
|
-
edgeUrl: i
|
|
8102
|
-
|
|
8111
|
+
edgeUrl: i,
|
|
8112
|
+
onTransportConnected: b(e_, e)
|
|
8113
|
+
}), b(Hg, e))), b(i_, e).call(e), x(qg, e, (a = b(qg, e), a++, a)), x(Gg, e, 0), x(Xg, e, Date.now()), b(Yg, e) || x(Yg, e, b(Xg, e)), b(e_, e).call(e), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
|
|
8103
8114
|
} catch (n) {
|
|
8104
8115
|
e.logger.warn("Failed to connect", n);
|
|
8105
8116
|
let r = t.shiftedEdge();
|
|
@@ -8111,7 +8122,7 @@ function i_() {
|
|
|
8111
8122
|
isFatal: !1
|
|
8112
8123
|
}));
|
|
8113
8124
|
}
|
|
8114
|
-
if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(
|
|
8125
|
+
if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(a_, e).call(e), o) {
|
|
8115
8126
|
x(Ug, e, !1);
|
|
8116
8127
|
break;
|
|
8117
8128
|
}
|
|
@@ -8122,20 +8133,20 @@ function i_() {
|
|
|
8122
8133
|
}
|
|
8123
8134
|
if (yield mn(1e3), !b(Ug, e)) break;
|
|
8124
8135
|
}
|
|
8125
|
-
x(
|
|
8136
|
+
x(Qg, e, void 0), b(a_, e).call(e), x(Wg, e, void 0);
|
|
8126
8137
|
})();
|
|
8127
8138
|
}
|
|
8128
|
-
e(
|
|
8139
|
+
e(o_, "PING_TIMEOUT", 1e3), e(o_, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(o_, "create", (e, t, n) => new Vg(e, t, n));
|
|
8129
8140
|
//#endregion
|
|
8130
8141
|
//#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
|
|
8131
|
-
var
|
|
8142
|
+
var c_, l_ = () => ({
|
|
8132
8143
|
video: C(C({}, bn()), {}, { bitRate: yn() }),
|
|
8133
8144
|
audio: { bitRate: yn() }
|
|
8134
|
-
}),
|
|
8145
|
+
}), u_ = () => ({
|
|
8135
8146
|
width: window.innerWidth,
|
|
8136
8147
|
height: window.innerHeight,
|
|
8137
8148
|
bitRate: yn()
|
|
8138
|
-
}),
|
|
8149
|
+
}), d_ = class t {
|
|
8139
8150
|
constructor(n, r, i, a) {
|
|
8140
8151
|
e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
|
|
8141
8152
|
var e;
|
|
@@ -8157,7 +8168,7 @@ var a_, o_ = () => ({
|
|
|
8157
8168
|
this.timers.unload();
|
|
8158
8169
|
}), e(this, "setUserSpecifiedCap", (e) => {
|
|
8159
8170
|
var t;
|
|
8160
|
-
let n = (t = this.getUserSpecifiedCap()) == null ?
|
|
8171
|
+
let n = (t = this.getUserSpecifiedCap()) == null ? l_() : t;
|
|
8161
8172
|
this.userSpecifiedCap = C(C({}, n), {}, {
|
|
8162
8173
|
video: C(C({}, n.video), e.video),
|
|
8163
8174
|
audio: C(C({}, n.audio), e.audio)
|
|
@@ -8181,7 +8192,7 @@ var a_, o_ = () => ({
|
|
|
8181
8192
|
});
|
|
8182
8193
|
}), e(this, "evaluateConstraintCap", () => {
|
|
8183
8194
|
var e, t, n, r;
|
|
8184
|
-
let i = this.sizeBasedResolutionCapEnabled ? C(C({},
|
|
8195
|
+
let i = this.sizeBasedResolutionCapEnabled ? C(C({}, l_()), {}, { video: u_() }) : l_();
|
|
8185
8196
|
if (!this.resizeObserver) {
|
|
8186
8197
|
let e = this.element.getBoundingClientRect();
|
|
8187
8198
|
this.elementSize = {
|
|
@@ -8218,14 +8229,14 @@ var a_, o_ = () => ({
|
|
|
8218
8229
|
this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
|
|
8219
8230
|
}
|
|
8220
8231
|
};
|
|
8221
|
-
|
|
8232
|
+
c_ = d_, e(d_, "CHECK_SIZE_INTERVAL", 1e3), e(d_, "create", (e, t, n, r) => new c_(e, t, n, r));
|
|
8222
8233
|
//#endregion
|
|
8223
8234
|
//#region ../../libs/web-sdk/src/modules/DecoderModule.ts
|
|
8224
|
-
var
|
|
8235
|
+
var f_ = 5, p_ = 100, m_ = 1e3, h_ = class r {
|
|
8225
8236
|
constructor(t, n, r, i, a = !1, o = !1, s = !1) {
|
|
8226
8237
|
e(this, "timers", j.create()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), 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", () => {
|
|
8227
|
-
let e = this._audioWebCodecsInUse ? 20 :
|
|
8228
|
-
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate,
|
|
8238
|
+
let e = this._audioWebCodecsInUse ? 20 : p_;
|
|
8239
|
+
this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, m_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
|
|
8229
8240
|
}), e(this, "unload", () => {
|
|
8230
8241
|
this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.isAudioEmitRetryScheduled = !1, this.videoKeyframeTimestamps = [], this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
|
|
8231
8242
|
}), e(this, "suspend", () => {
|
|
@@ -8282,7 +8293,7 @@ var l_ = 5, u_ = 100, d_ = 1e3, f_ = class r {
|
|
|
8282
8293
|
if (this.isSuspended) return;
|
|
8283
8294
|
t.sampleDuration = e.duration / e.timescale * 1e3;
|
|
8284
8295
|
let n = e.compositionTimeOffset || 0, { decoderContext: r, buffer: i } = t, a = (e.timestamp + n) / e.timescale * 1e3, o = e.duration / e.timescale * 1e3, s = i[i.length - 1];
|
|
8285
|
-
if (!s || a -
|
|
8296
|
+
if (!s || a - f_ > s.end ? i.push({
|
|
8286
8297
|
start: a,
|
|
8287
8298
|
end: a + o
|
|
8288
8299
|
}) : a + o * 5 < s.end ? (t.buffer = [{
|
|
@@ -8402,7 +8413,7 @@ var l_ = 5, u_ = 100, d_ = 1e3, f_ = class r {
|
|
|
8402
8413
|
return new r(e, i, t, s, p, m, h);
|
|
8403
8414
|
})();
|
|
8404
8415
|
}
|
|
8405
|
-
},
|
|
8416
|
+
}, g_, __ = class {
|
|
8406
8417
|
constructor(t) {
|
|
8407
8418
|
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, "unload", () => {
|
|
8408
8419
|
document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
|
|
@@ -8436,12 +8447,12 @@ var l_ = 5, u_ = 100, d_ = 1e3, f_ = class r {
|
|
|
8436
8447
|
return document.visibilityState === "visible";
|
|
8437
8448
|
}
|
|
8438
8449
|
};
|
|
8439
|
-
|
|
8450
|
+
g_ = __, e(__, "create", (e) => new g_(e));
|
|
8440
8451
|
//#endregion
|
|
8441
8452
|
//#region ../../libs/web-sdk/src/modules/EventModule.ts
|
|
8442
|
-
var
|
|
8453
|
+
var v_, y_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, b_ = class t {
|
|
8443
8454
|
constructor(n, r, i) {
|
|
8444
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered",
|
|
8455
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", y_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
|
|
8445
8456
|
this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
|
|
8446
8457
|
}), e(this, "unload", () => {
|
|
8447
8458
|
this.timers.unload(), this.emitter.off("add event", this.addEvent);
|
|
@@ -8468,10 +8479,10 @@ var h_, g_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
|
|
|
8468
8479
|
}), this.logger = r, this.emitter = n, this.timeSource = i;
|
|
8469
8480
|
}
|
|
8470
8481
|
};
|
|
8471
|
-
|
|
8482
|
+
v_ = b_, e(b_, "EVENT_TIMEOUT", 5e3), e(b_, "EVENT_CHECK_INTERVAL", 20), e(b_, "create", (e, t, n) => new v_(e, t, n));
|
|
8472
8483
|
//#endregion
|
|
8473
8484
|
//#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
|
|
8474
|
-
var
|
|
8485
|
+
var x_, S_ = class t {
|
|
8475
8486
|
constructor(n) {
|
|
8476
8487
|
e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "bytesReceived", /* @__PURE__ */ new Map()), e(this, "timeoutInterval", void 0), e(this, "lastBytesUpdated", Date.now()), e(this, "load", () => {
|
|
8477
8488
|
this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
|
|
@@ -8506,10 +8517,10 @@ var v_, y_ = class t {
|
|
|
8506
8517
|
}), this.emitter = n;
|
|
8507
8518
|
}
|
|
8508
8519
|
};
|
|
8509
|
-
|
|
8520
|
+
x_ = S_, e(S_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(S_, "NO_DATA_TIMEOUT", 5 * 1e3), e(S_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(S_, "create", (e) => new x_(e));
|
|
8510
8521
|
//#endregion
|
|
8511
8522
|
//#region ../../libs/web-sdk/src/modules/JitterModule.ts
|
|
8512
|
-
var
|
|
8523
|
+
var C_ = 1e3, w_ = 50, T_ = class t {
|
|
8513
8524
|
constructor(t) {
|
|
8514
8525
|
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", () => {
|
|
8515
8526
|
this.logger.debug("JitterModule loaded");
|
|
@@ -8530,9 +8541,9 @@ var b_ = 1e3, x_ = 50, S_ = class t {
|
|
|
8530
8541
|
this.trackingState.set(a, {
|
|
8531
8542
|
lastArrivalTime: o,
|
|
8532
8543
|
lastTimestampMs: s,
|
|
8533
|
-
jitterSamples: new _(
|
|
8534
|
-
interArrivalTimes: new _(
|
|
8535
|
-
}), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(
|
|
8544
|
+
jitterSamples: new _(C_),
|
|
8545
|
+
interArrivalTimes: new _(C_)
|
|
8546
|
+
}), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(w_));
|
|
8536
8547
|
return;
|
|
8537
8548
|
}
|
|
8538
8549
|
let l = s - c.lastTimestampMs;
|
|
@@ -8545,7 +8556,7 @@ var b_ = 1e3, x_ = 50, S_ = class t {
|
|
|
8545
8556
|
let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
|
|
8546
8557
|
this.runningJitter.set(a, p);
|
|
8547
8558
|
let m = this.recentJitterSamples.get(a);
|
|
8548
|
-
m || (m = new _(
|
|
8559
|
+
m || (m = new _(w_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
|
|
8549
8560
|
}
|
|
8550
8561
|
getJitterForType(e) {
|
|
8551
8562
|
for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
|
|
@@ -8576,10 +8587,10 @@ var b_ = 1e3, x_ = 50, S_ = class t {
|
|
|
8576
8587
|
videoJitter: this.getJitterForType("video")
|
|
8577
8588
|
};
|
|
8578
8589
|
}
|
|
8579
|
-
},
|
|
8590
|
+
}, E_ = () => window.AudioContext || window.webkitAudioContext, D_ = class n extends _e {
|
|
8580
8591
|
constructor() {
|
|
8581
8592
|
var r;
|
|
8582
|
-
super(), r = this, e(this, "context", new (
|
|
8593
|
+
super(), r = this, e(this, "context", new (E_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
|
|
8583
8594
|
try {
|
|
8584
8595
|
return yield Promise.race([r.context.resume(), hn(1e3, p())]);
|
|
8585
8596
|
} catch (e) {
|
|
@@ -8608,10 +8619,10 @@ var b_ = 1e3, x_ = 50, S_ = class t {
|
|
|
8608
8619
|
return this.context.state;
|
|
8609
8620
|
}
|
|
8610
8621
|
};
|
|
8611
|
-
e(
|
|
8622
|
+
e(D_, "CHECK_INTERVAL", 1e3);
|
|
8612
8623
|
//#endregion
|
|
8613
8624
|
//#region ../../libs/web-audio-player/src/AudioPlayer.ts
|
|
8614
|
-
var
|
|
8625
|
+
var O_, k_ = 150, A_ = 400, j_ = (e) => e === void 0 ? 5 : e <= k_ ? 1 : e <= A_ ? 2 : 5, M_ = class extends _e {
|
|
8615
8626
|
get isContextRunning() {
|
|
8616
8627
|
var e;
|
|
8617
8628
|
return ((e = this.audio) == null ? void 0 : e.state) === "running";
|
|
@@ -8652,7 +8663,7 @@ var T_, E_ = 150, D_ = 400, O_ = (e) => e === void 0 ? 5 : e <= E_ ? 1 : e <= D_
|
|
|
8652
8663
|
return this._bufferTime;
|
|
8653
8664
|
}
|
|
8654
8665
|
set bufferTime(e) {
|
|
8655
|
-
this._bufferTime = e, this.audioBufferMultiplier =
|
|
8666
|
+
this._bufferTime = e, this.audioBufferMultiplier = j_(e);
|
|
8656
8667
|
}
|
|
8657
8668
|
get audioNode() {
|
|
8658
8669
|
return this.splitter;
|
|
@@ -8742,14 +8753,14 @@ var T_, E_ = 150, D_ = 400, O_ = (e) => e === void 0 ? 5 : e <= E_ ? 1 : e <= D_
|
|
|
8742
8753
|
}
|
|
8743
8754
|
})), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
|
|
8744
8755
|
var e, t, n;
|
|
8745
|
-
return (e = this.audio) == null || e.unload(), this.audio = new
|
|
8756
|
+
return (e = this.audio) == null || e.unload(), this.audio = new D_(), this.audio.on("state", (e) => {
|
|
8746
8757
|
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);
|
|
8747
8758
|
}), this.audio.on("stuck", () => {
|
|
8748
8759
|
this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
|
|
8749
8760
|
}), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
|
|
8750
8761
|
}), e(this, "setGain", (e) => {
|
|
8751
8762
|
this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
|
|
8752
|
-
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier =
|
|
8763
|
+
}), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = j_(s);
|
|
8753
8764
|
}
|
|
8754
8765
|
useMediaStreamDestination() {
|
|
8755
8766
|
var e;
|
|
@@ -8762,10 +8773,10 @@ var T_, E_ = 150, D_ = 400, O_ = (e) => e === void 0 ? 5 : e <= E_ ? 1 : e <= D_
|
|
|
8762
8773
|
return (e = this.gainNode) == null || e.connect(t), t;
|
|
8763
8774
|
}
|
|
8764
8775
|
};
|
|
8765
|
-
|
|
8776
|
+
O_ = M_, e(M_, "create", (e, t, n) => new O_(e, t, n));
|
|
8766
8777
|
//#endregion
|
|
8767
8778
|
//#region ../../libs/web-sdk/src/players/VideoPlayer.ts
|
|
8768
|
-
var
|
|
8779
|
+
var N_, P_ = class {
|
|
8769
8780
|
constructor(t, n, r, i, a, o) {
|
|
8770
8781
|
e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new or()), 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", () => {
|
|
8771
8782
|
this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
|
|
@@ -8855,12 +8866,12 @@ var A_, j_ = class {
|
|
|
8855
8866
|
}), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
|
|
8856
8867
|
}
|
|
8857
8868
|
};
|
|
8858
|
-
|
|
8869
|
+
N_ = P_, e(P_, "create", (e, t, n, r, i, a) => new N_(e, t, n, r, i, a));
|
|
8859
8870
|
//#endregion
|
|
8860
8871
|
//#region ../../libs/web-sdk/src/TextTracks.ts
|
|
8861
|
-
var
|
|
8872
|
+
var F_ = /* @__PURE__ */ new WeakMap(), I_ = class {
|
|
8862
8873
|
constructor() {
|
|
8863
|
-
v(this,
|
|
8874
|
+
v(this, F_, []), x(F_, this, []);
|
|
8864
8875
|
}
|
|
8865
8876
|
addTextTrack(e, t, n) {
|
|
8866
8877
|
let r = [], i = {
|
|
@@ -8877,37 +8888,37 @@ var M_ = /* @__PURE__ */ new WeakMap(), N_ = class {
|
|
|
8877
8888
|
t !== -1 && r.splice(t, 1);
|
|
8878
8889
|
}
|
|
8879
8890
|
};
|
|
8880
|
-
return b(
|
|
8891
|
+
return b(F_, this).push(i), i;
|
|
8881
8892
|
}
|
|
8882
8893
|
set language(e) {
|
|
8883
|
-
b(
|
|
8894
|
+
b(F_, this).forEach((t) => {
|
|
8884
8895
|
t.language === e ? t.mode = "showing" : t.mode = "hidden";
|
|
8885
8896
|
});
|
|
8886
8897
|
}
|
|
8887
8898
|
get language() {
|
|
8888
8899
|
var e;
|
|
8889
|
-
return (e = b(
|
|
8900
|
+
return (e = b(F_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
|
|
8890
8901
|
}
|
|
8891
8902
|
getActiveCues(e) {
|
|
8892
|
-
let t = b(
|
|
8903
|
+
let t = b(F_, this).find((e) => e.mode === "showing");
|
|
8893
8904
|
return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
|
|
8894
8905
|
}
|
|
8895
|
-
},
|
|
8906
|
+
}, L_ = (e, t) => {
|
|
8896
8907
|
let n;
|
|
8897
8908
|
for (n = t; e > 1; e--) n += t;
|
|
8898
8909
|
return n;
|
|
8899
|
-
},
|
|
8910
|
+
}, R_ = class {
|
|
8900
8911
|
constructor() {
|
|
8901
8912
|
e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
|
|
8902
8913
|
let t = document.createElement("div");
|
|
8903
8914
|
t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
|
|
8904
8915
|
let n = t.children.item(0);
|
|
8905
|
-
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" +
|
|
8916
|
+
if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + L_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + L_(16, "gICA") + L_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + L_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + L_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + L_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + L_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
|
|
8906
8917
|
else throw Error("Failed to create audio tag");
|
|
8907
8918
|
}
|
|
8908
|
-
},
|
|
8919
|
+
}, z_, B_ = class {
|
|
8909
8920
|
constructor(t, n, r, i, a, o, s, c) {
|
|
8910
|
-
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
|
|
8921
|
+
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 R_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new I_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
|
|
8911
8922
|
this.audioPlayer.useDefaultDestination(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.isLoaded = !0, this.isVideoRenderingEnabled && (this.videoPlayer.load(), this.isVideoPlayerLoaded = !0, this.startTextTrackInterval());
|
|
8912
8923
|
}), e(this, "unload", () => {
|
|
8913
8924
|
this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
|
|
@@ -8943,7 +8954,7 @@ var M_ = /* @__PURE__ */ new WeakMap(), N_ = class {
|
|
|
8943
8954
|
e instanceof Error && this.emitter.emit("error", re(!1, e));
|
|
8944
8955
|
}
|
|
8945
8956
|
this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
|
|
8946
|
-
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer =
|
|
8957
|
+
}), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = M_.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
8947
8958
|
muted: a,
|
|
8948
8959
|
reInitWhenStuck: !0,
|
|
8949
8960
|
bufferTime: c
|
|
@@ -8954,7 +8965,7 @@ var M_ = /* @__PURE__ */ new WeakMap(), N_ = class {
|
|
|
8954
8965
|
volume: this.volume,
|
|
8955
8966
|
isMuted: this.muted
|
|
8956
8967
|
});
|
|
8957
|
-
}), this.videoPlayer =
|
|
8968
|
+
}), this.videoPlayer = P_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
|
|
8958
8969
|
}
|
|
8959
8970
|
get volume() {
|
|
8960
8971
|
return this.audioPlayer.volume;
|
|
@@ -9010,12 +9021,12 @@ var M_ = /* @__PURE__ */ new WeakMap(), N_ = class {
|
|
|
9010
9021
|
this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
|
|
9011
9022
|
}
|
|
9012
9023
|
};
|
|
9013
|
-
|
|
9024
|
+
z_ = B_, e(B_, "create", (e, t, n, r, i, a, o, s) => new z_(e, t, n, r, i, a, o, s));
|
|
9014
9025
|
//#endregion
|
|
9015
9026
|
//#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
|
|
9016
|
-
var
|
|
9027
|
+
var V_, H_ = class {
|
|
9017
9028
|
constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
|
|
9018
|
-
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new
|
|
9029
|
+
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new I_()), e(this, "reset", () => {}), e(this, "load", () => {
|
|
9019
9030
|
this.mediaElement.load(), 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.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.nativeTextTrack = this.mediaElement.element.addTextTrack("subtitles", "", ""), this.nativeTextTrack.mode = "showing", this.timers.setInterval(() => {
|
|
9020
9031
|
if (!this.textTracks.language) {
|
|
9021
9032
|
this.clearNativeTrackCues();
|
|
@@ -9102,7 +9113,7 @@ var R_, z_ = class {
|
|
|
9102
9113
|
this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
|
|
9103
9114
|
}), this.mediaElement.on("media element state", (e) => {
|
|
9104
9115
|
e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
|
|
9105
|
-
}), this.audioPlayer =
|
|
9116
|
+
}), this.audioPlayer = M_.create(this.logger.createContext("AudioPlayerModule"), i, {
|
|
9106
9117
|
muted: !1,
|
|
9107
9118
|
reInitWhenStuck: !1,
|
|
9108
9119
|
bufferTime: d
|
|
@@ -9110,7 +9121,7 @@ var R_, z_ = class {
|
|
|
9110
9121
|
this.isDisconnected = !0;
|
|
9111
9122
|
}), this.audioPlayer.on("state change", (e) => {
|
|
9112
9123
|
e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
|
|
9113
|
-
}), this.videoPlayer =
|
|
9124
|
+
}), this.videoPlayer = P_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
|
|
9114
9125
|
volume: this.volume,
|
|
9115
9126
|
isMuted: this.muted
|
|
9116
9127
|
};
|
|
@@ -9168,10 +9179,10 @@ var R_, z_ = class {
|
|
|
9168
9179
|
this.mediaElement.pause();
|
|
9169
9180
|
}
|
|
9170
9181
|
};
|
|
9171
|
-
|
|
9182
|
+
V_ = H_, e(H_, "create", (e, t, n, r, i) => new V_(e, t, n, r, i));
|
|
9172
9183
|
//#endregion
|
|
9173
9184
|
//#region ../../libs/mse/src/AsyncSourceBuffer.ts
|
|
9174
|
-
var
|
|
9185
|
+
var U_ = () => (e) => W_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), W_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), G_ = (e) => (t) => t.appendBuffer(e), K_ = (e) => (t) => t.changeType(e), q_ = (e) => (t) => e(t), J_ = class {
|
|
9175
9186
|
constructor(t) {
|
|
9176
9187
|
e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "errorCallback", void 0), e(this, "currentInit", void 0), e(this, "setErrorCallback", (e) => {
|
|
9177
9188
|
this.errorCallback = e;
|
|
@@ -9185,30 +9196,30 @@ var B_ = () => (e) => V_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9185
9196
|
}
|
|
9186
9197
|
}), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
|
|
9187
9198
|
if (t && this.currentInit !== t) {
|
|
9188
|
-
let e = new Dt(
|
|
9199
|
+
let e = new Dt(G_(t), n, r);
|
|
9189
9200
|
this.commandQueue.push(e), this.currentInit = t;
|
|
9190
9201
|
}
|
|
9191
|
-
let i = new Dt(
|
|
9202
|
+
let i = new Dt(G_(e), n, r);
|
|
9192
9203
|
this.commandQueue.push(i), this.handleQueue();
|
|
9193
9204
|
})), e(this, "execute", (e) => new Promise((t, n) => {
|
|
9194
|
-
let r = new Dt(
|
|
9205
|
+
let r = new Dt(q_(e), t, n);
|
|
9195
9206
|
this.commandQueue.push(r), this.handleQueue();
|
|
9196
9207
|
})), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
|
|
9197
9208
|
this.dispose(), e.removeSourceBuffer(this.sourceBuffer);
|
|
9198
9209
|
}), e(this, "dispose", () => {
|
|
9199
9210
|
this.sourceBuffer.removeEventListener("updateend", this.handleQueue), this.sourceBuffer.removeEventListener("error", this.onError), this.commandQueue = [], this.errorCallback = void 0;
|
|
9200
9211
|
}), e(this, "changeType", (e) => new Promise((t, n) => {
|
|
9201
|
-
let r = new Dt(
|
|
9212
|
+
let r = new Dt(K_(e), t, n);
|
|
9202
9213
|
this.commandQueue.push(r), this.handleQueue();
|
|
9203
9214
|
})), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
|
|
9204
|
-
let i = new Dt(
|
|
9215
|
+
let i = new Dt(W_(e, t), n, r);
|
|
9205
9216
|
this.commandQueue.push(i), this.handleQueue();
|
|
9206
9217
|
})), e(this, "flush", () => new Promise((e, t) => {
|
|
9207
|
-
let n = new Dt(
|
|
9218
|
+
let n = new Dt(U_, e, t);
|
|
9208
9219
|
this.commandQueue.push(n), this.handleQueue();
|
|
9209
9220
|
})), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue), this.sourceBuffer.addEventListener("error", this.onError);
|
|
9210
9221
|
}
|
|
9211
|
-
},
|
|
9222
|
+
}, Y_ = class extends _e {
|
|
9212
9223
|
constructor() {
|
|
9213
9224
|
super(), e(this, "MediaSource", Ve()), e(this, "mediaSource", new this.MediaSource()), e(this, "isOpen", () => this.mediaSource.readyState === "open"), e(this, "isClosed", () => this.mediaSource.readyState === "closed"), e(this, "isEnded", () => this.mediaSource.readyState === "ended"), e(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource)), e(this, "attach", (e) => {
|
|
9214
9225
|
let t = e;
|
|
@@ -9224,7 +9235,7 @@ var B_ = () => (e) => V_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9224
9235
|
this.mediaSource.endOfStream();
|
|
9225
9236
|
} catch (e) {}
|
|
9226
9237
|
e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
|
|
9227
|
-
}), e(this, "addSourceBuffer", (e) => new
|
|
9238
|
+
}), e(this, "addSourceBuffer", (e) => new J_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
|
|
9228
9239
|
e.removeFromMediaSource(this.mediaSource);
|
|
9229
9240
|
}), e(this, "endOfStream", (e) => {
|
|
9230
9241
|
this.mediaSource.endOfStream(e);
|
|
@@ -9241,13 +9252,13 @@ var B_ = () => (e) => V_(e.buffered.start(0), e.buffered.end(e.buffered.length -
|
|
|
9241
9252
|
}), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
|
|
9242
9253
|
}
|
|
9243
9254
|
};
|
|
9244
|
-
e(
|
|
9255
|
+
e(Y_, "isTypeSupported", (e) => {
|
|
9245
9256
|
var t, n;
|
|
9246
9257
|
return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
|
|
9247
9258
|
});
|
|
9248
9259
|
//#endregion
|
|
9249
9260
|
//#region ../../libs/web-sdk/src/modules/MseModule.ts
|
|
9250
|
-
var
|
|
9261
|
+
var X_, Z_ = class {
|
|
9251
9262
|
constructor() {
|
|
9252
9263
|
e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
|
|
9253
9264
|
var r;
|
|
@@ -9259,7 +9270,7 @@ var q_, J_ = class {
|
|
|
9259
9270
|
});
|
|
9260
9271
|
}
|
|
9261
9272
|
};
|
|
9262
|
-
function
|
|
9273
|
+
function Q_(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
9263
9274
|
return C(C({}, e), {}, {
|
|
9264
9275
|
state: "initialized",
|
|
9265
9276
|
mimeType: n,
|
|
@@ -9271,10 +9282,10 @@ function Y_(e, { mediaSource: t, mimeType: n, codec: r }) {
|
|
|
9271
9282
|
lastBufferCleanupTime: Date.now()
|
|
9272
9283
|
});
|
|
9273
9284
|
}
|
|
9274
|
-
function
|
|
9285
|
+
function $_({ initSegments: e, pendingSamples: t }) {
|
|
9275
9286
|
return {
|
|
9276
9287
|
state: "uninitialized",
|
|
9277
|
-
initSegments: e == null ? new
|
|
9288
|
+
initSegments: e == null ? new Z_() : e,
|
|
9278
9289
|
sequenceNumber: 0,
|
|
9279
9290
|
isWorkingOnPendingSamples: !1,
|
|
9280
9291
|
hasFirstSync: t.some((e) => e.isSync),
|
|
@@ -9284,10 +9295,10 @@ function X_({ initSegments: e, pendingSamples: t }) {
|
|
|
9284
9295
|
successfulAppendCalls: 0
|
|
9285
9296
|
};
|
|
9286
9297
|
}
|
|
9287
|
-
var
|
|
9298
|
+
var ev = class {
|
|
9288
9299
|
constructor(n, a, s) {
|
|
9289
9300
|
var u = this;
|
|
9290
|
-
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new
|
|
9301
|
+
e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new Y_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
|
|
9291
9302
|
this.emitter.on("init segment", this.init), this.emitter.on("coded sample", this.onCodedSample), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("fragment", this.onFragment);
|
|
9292
9303
|
}), e(this, "unload", () => {
|
|
9293
9304
|
this.logger.debug("Unloading module..."), this.emitter.off("init segment", this.init), this.emitter.off("coded sample", this.onCodedSample), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("fragment", this.onFragment), this.mediaSource.off("source ended", this.onSourceEnded), this.mediaSource.off("source open", this.onSourceOpen), this.mediaElement.removeEventListener("error", this.onMediaElementError), this.mediaElement.removeEventListener("waiting", this.onPlaybackStall), this.mediaElement.removeEventListener("stalled", this.onPlaybackStall), this.mediaElement.removeEventListener("playing", this.onPlaybackProgress), this.mediaElement.removeEventListener("pause", this.onPlaybackPauseOrSeek), this.mediaElement.removeEventListener("seeking", this.onPlaybackPauseOrSeek), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
|
|
@@ -9324,7 +9335,7 @@ var Z_ = class {
|
|
|
9324
9335
|
var n, r, i;
|
|
9325
9336
|
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;
|
|
9326
9337
|
for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
|
|
9327
|
-
let l =
|
|
9338
|
+
let l = $_({
|
|
9328
9339
|
pendingSamples: o,
|
|
9329
9340
|
initSegments: s
|
|
9330
9341
|
});
|
|
@@ -9335,14 +9346,14 @@ var Z_ = class {
|
|
|
9335
9346
|
this.trackContexts.forEach((e, n) => {
|
|
9336
9347
|
if (t.has(n)) return;
|
|
9337
9348
|
e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
|
|
9338
|
-
let r =
|
|
9349
|
+
let r = $_({
|
|
9339
9350
|
pendingSamples: [],
|
|
9340
9351
|
initSegments: e.initSegments
|
|
9341
9352
|
});
|
|
9342
9353
|
this.trackContexts.set(n, r);
|
|
9343
9354
|
});
|
|
9344
9355
|
}), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
|
|
9345
|
-
let n =
|
|
9356
|
+
let n = Q_(e, {
|
|
9346
9357
|
mimeType: t.mimeType,
|
|
9347
9358
|
mediaSource: this.mediaSource,
|
|
9348
9359
|
codec: t.codec
|
|
@@ -9369,9 +9380,9 @@ var Z_ = class {
|
|
|
9369
9380
|
}
|
|
9370
9381
|
for (let t of e) {
|
|
9371
9382
|
let n = u.trackContexts.get(t.type);
|
|
9372
|
-
if (n || (n =
|
|
9383
|
+
if (n || (n = $_({
|
|
9373
9384
|
pendingSamples: [],
|
|
9374
|
-
initSegments: new
|
|
9385
|
+
initSegments: new Z_()
|
|
9375
9386
|
}), u.trackContexts.set(t.type, n)), n.state === "initialized") {
|
|
9376
9387
|
if (t.mimeType !== n.sourceBufferMimeType) try {
|
|
9377
9388
|
yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
|
|
@@ -9387,7 +9398,7 @@ var Z_ = class {
|
|
|
9387
9398
|
u.logger.warn("removeSourceBuffer failed", { removeError: t }), u.reopenMediaSource("changeType recovery failed"), u.pendingTracksToAddSourceBuffers = e;
|
|
9388
9399
|
return;
|
|
9389
9400
|
}
|
|
9390
|
-
let i =
|
|
9401
|
+
let i = $_({
|
|
9391
9402
|
pendingSamples: n.pendingSamples,
|
|
9392
9403
|
initSegments: n.initSegments
|
|
9393
9404
|
});
|
|
@@ -9411,7 +9422,7 @@ var Z_ = class {
|
|
|
9411
9422
|
};
|
|
9412
9423
|
}), e(this, "getNextBufferedRangeStart", (e) => {
|
|
9413
9424
|
let t = this.getCommonBufferedRangesForCurrentTracks();
|
|
9414
|
-
if (t) return
|
|
9425
|
+
if (t) return nv(e, t);
|
|
9415
9426
|
}), e(this, "getVideoKeyframeTimestamps", () => this.videoKeyframeTimestamps), e(this, "init", ({ initSegment: e, mimeType: t }) => {
|
|
9416
9427
|
this.logger.debug("Added init segment", {
|
|
9417
9428
|
channel: e.channelId,
|
|
@@ -9510,7 +9521,7 @@ var Z_ = class {
|
|
|
9510
9521
|
let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
|
|
9511
9522
|
r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
|
|
9512
9523
|
}
|
|
9513
|
-
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples ||
|
|
9524
|
+
t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || sv(t, this.append, this.maxChunkSize).catch((n) => {
|
|
9514
9525
|
if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
|
|
9515
9526
|
if (!this.isCurrentTrackContext(e.type, t)) {
|
|
9516
9527
|
this.logger.debug("Suppressing append error from stale track context", { type: e.type });
|
|
@@ -9594,14 +9605,14 @@ var Z_ = class {
|
|
|
9594
9605
|
if (this.mediaSource.isClosed()) return;
|
|
9595
9606
|
let e = this.getInitializedTrackBuffers();
|
|
9596
9607
|
if (e.length !== 0) return this.getCommonBufferedRanges(e);
|
|
9597
|
-
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) =>
|
|
9608
|
+
}), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => rv(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => tv(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
|
|
9598
9609
|
}
|
|
9599
9610
|
};
|
|
9600
|
-
|
|
9601
|
-
let r = new
|
|
9611
|
+
X_ = ev, e(ev, "create", (e, t, n) => {
|
|
9612
|
+
let r = new X_(e, t, n);
|
|
9602
9613
|
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("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
|
|
9603
9614
|
});
|
|
9604
|
-
var
|
|
9615
|
+
var tv = (e, t) => t.some((t) => t.start <= e && e < t.end), nv = (e, t) => {
|
|
9605
9616
|
for (let r = 0; r < t.length; r++) {
|
|
9606
9617
|
let i = t[r];
|
|
9607
9618
|
if (i) {
|
|
@@ -9612,7 +9623,7 @@ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
|
|
|
9612
9623
|
}
|
|
9613
9624
|
}
|
|
9614
9625
|
}
|
|
9615
|
-
},
|
|
9626
|
+
}, rv = (e, t) => {
|
|
9616
9627
|
let n = [], r = 0, i = 0;
|
|
9617
9628
|
for (; r < e.length && i < t.length;) {
|
|
9618
9629
|
let a = e[r], o = t[i];
|
|
@@ -9624,20 +9635,20 @@ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
|
|
|
9624
9635
|
}), a.end <= o.end ? r++ : i++;
|
|
9625
9636
|
}
|
|
9626
9637
|
return n;
|
|
9627
|
-
},
|
|
9638
|
+
}, iv = (e, t) => {
|
|
9628
9639
|
var n;
|
|
9629
9640
|
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;
|
|
9630
9641
|
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;
|
|
9631
|
-
},
|
|
9642
|
+
}, av = 32, ov = (e) => {
|
|
9632
9643
|
let t = e.pendingSamplesOffset;
|
|
9633
9644
|
if (t !== 0) {
|
|
9634
9645
|
if (t >= e.pendingSamples.length) {
|
|
9635
9646
|
e.pendingSamples = [], e.pendingSamplesOffset = 0;
|
|
9636
9647
|
return;
|
|
9637
9648
|
}
|
|
9638
|
-
t <
|
|
9649
|
+
t < av || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
|
|
9639
9650
|
}
|
|
9640
|
-
},
|
|
9651
|
+
}, sv = function() {
|
|
9641
9652
|
var e = t(function* (e, t, n) {
|
|
9642
9653
|
for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
|
|
9643
9654
|
let r = [], i = e.pendingSamplesOffset;
|
|
@@ -9645,7 +9656,7 @@ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
|
|
|
9645
9656
|
i = t;
|
|
9646
9657
|
let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
|
|
9647
9658
|
if (a && (r.push(a), o)) {
|
|
9648
|
-
if (
|
|
9659
|
+
if (iv(a, o)) break;
|
|
9649
9660
|
let e = (a.timestamp + a.duration) / a.timescale;
|
|
9650
9661
|
if (o.timestamp / o.timescale - e > .1) break;
|
|
9651
9662
|
}
|
|
@@ -9653,14 +9664,14 @@ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
|
|
|
9653
9664
|
}
|
|
9654
9665
|
let a = r[0];
|
|
9655
9666
|
if (!a) break;
|
|
9656
|
-
yield t(r, e.previousSample ?
|
|
9667
|
+
yield t(r, e.previousSample ? iv(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], ov(e);
|
|
9657
9668
|
}
|
|
9658
9669
|
e.isWorkingOnPendingSamples = !1;
|
|
9659
9670
|
});
|
|
9660
9671
|
return function(t, n, r) {
|
|
9661
9672
|
return e.apply(this, arguments);
|
|
9662
9673
|
};
|
|
9663
|
-
}(),
|
|
9674
|
+
}(), cv, lv = class {
|
|
9664
9675
|
constructor(n, r) {
|
|
9665
9676
|
var i = this;
|
|
9666
9677
|
e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
|
|
@@ -9692,10 +9703,10 @@ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
|
|
|
9692
9703
|
}()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
|
|
9693
9704
|
}
|
|
9694
9705
|
};
|
|
9695
|
-
|
|
9706
|
+
cv = lv, e(lv, "create", (e, t) => new cv(e, t));
|
|
9696
9707
|
//#endregion
|
|
9697
9708
|
//#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
|
|
9698
|
-
var
|
|
9709
|
+
var uv, dv = class {
|
|
9699
9710
|
constructor(t, n, r, i) {
|
|
9700
9711
|
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", () => {
|
|
9701
9712
|
this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
|
|
@@ -9713,24 +9724,24 @@ var sv, cv = class {
|
|
|
9713
9724
|
}), 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);
|
|
9714
9725
|
}
|
|
9715
9726
|
};
|
|
9716
|
-
|
|
9727
|
+
uv = dv, e(dv, "create", (e, t, n, r) => new uv(e, t, n, r));
|
|
9717
9728
|
//#endregion
|
|
9718
9729
|
//#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
|
|
9719
|
-
var
|
|
9730
|
+
var fv, pv = () => ({
|
|
9720
9731
|
upgradesFromLevel: [],
|
|
9721
9732
|
downgradesFromLevel: [],
|
|
9722
9733
|
bufferingRanges: [],
|
|
9723
9734
|
activeRanges: [],
|
|
9724
9735
|
decodeRate: 2 ** 53 - 1
|
|
9725
|
-
}),
|
|
9736
|
+
}), mv = () => ({
|
|
9726
9737
|
levels: {},
|
|
9727
9738
|
levelDowngrades: [],
|
|
9728
9739
|
levelUpgrades: [],
|
|
9729
9740
|
bufferFullness: 0,
|
|
9730
|
-
general:
|
|
9731
|
-
}),
|
|
9741
|
+
general: pv()
|
|
9742
|
+
}), hv = class {
|
|
9732
9743
|
constructor(t, n, r) {
|
|
9733
|
-
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics",
|
|
9744
|
+
e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", mv()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
|
|
9734
9745
|
this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
|
|
9735
9746
|
}), e(this, "unload", () => {
|
|
9736
9747
|
this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.suspend();
|
|
@@ -9798,14 +9809,14 @@ var lv, uv = () => ({
|
|
|
9798
9809
|
let d = !1;
|
|
9799
9810
|
if (e.from) {
|
|
9800
9811
|
var f;
|
|
9801
|
-
let e = (f = this.metrics.levels[l]) == null ?
|
|
9812
|
+
let e = (f = this.metrics.levels[l]) == null ? pv() : f;
|
|
9802
9813
|
l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), sn(e.activeRanges);
|
|
9803
9814
|
let t = e.bufferingRanges[e.bufferingRanges.length - 1];
|
|
9804
9815
|
d = !!t && !t.end, sn(e.bufferingRanges), this.metrics.levels[l] = e;
|
|
9805
9816
|
}
|
|
9806
9817
|
if (e.to) {
|
|
9807
9818
|
var p;
|
|
9808
|
-
let e = (p = this.metrics.levels[u]) == null ?
|
|
9819
|
+
let e = (p = this.metrics.levels[u]) == null ? pv() : p;
|
|
9809
9820
|
cn(e.activeRanges), d && cn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
|
|
9810
9821
|
}
|
|
9811
9822
|
}), e(this, "onBufferFullness", (e) => {
|
|
@@ -9874,10 +9885,10 @@ var lv, uv = () => ({
|
|
|
9874
9885
|
cn(this.metrics.general.activeRanges);
|
|
9875
9886
|
}
|
|
9876
9887
|
};
|
|
9877
|
-
|
|
9888
|
+
fv = hv, e(hv, "create", (e, t, n) => new fv(e, t, n));
|
|
9878
9889
|
//#endregion
|
|
9879
9890
|
//#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
|
|
9880
|
-
var
|
|
9891
|
+
var gv, _v = class {
|
|
9881
9892
|
constructor(t, n) {
|
|
9882
9893
|
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", () => {
|
|
9883
9894
|
this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
|
|
@@ -9952,10 +9963,10 @@ var pv, mv = class {
|
|
|
9952
9963
|
}), 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);
|
|
9953
9964
|
}
|
|
9954
9965
|
};
|
|
9955
|
-
|
|
9966
|
+
gv = _v, e(_v, "create", (e, t) => new gv(e, t));
|
|
9956
9967
|
//#endregion
|
|
9957
9968
|
//#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
|
|
9958
|
-
var
|
|
9969
|
+
var vv, yv = (e) => JSON.parse(JSON.stringify(e)), bv = 1e4, xv = class {
|
|
9959
9970
|
constructor(t, n, r) {
|
|
9960
9971
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
|
|
9961
9972
|
this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
|
|
@@ -9993,23 +10004,23 @@ var hv, gv = (e) => JSON.parse(JSON.stringify(e)), _v = 1e4, vv = class {
|
|
|
9993
10004
|
this.logger.debug("onSubscriptionChanged", {
|
|
9994
10005
|
to: e,
|
|
9995
10006
|
reset: t
|
|
9996
|
-
}), t ? this.targetSubscription =
|
|
10007
|
+
}), t ? this.targetSubscription = yv(this.currentSubscription) : this.currentSubscription = yv(e), this._isSwitchingSubscription = this.isNewSubscription();
|
|
9997
10008
|
}), e(this, "scheduleSubscriptionChange", () => {
|
|
9998
|
-
this.targetSubscription =
|
|
10009
|
+
this.targetSubscription = yv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
|
|
9999
10010
|
let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
|
|
10000
10011
|
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(() => {
|
|
10001
|
-
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription =
|
|
10002
|
-
},
|
|
10012
|
+
this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = yv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
|
|
10013
|
+
}, bv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
|
|
10003
10014
|
type: "subscribe",
|
|
10004
10015
|
subscription: this.getTargetSubscription()
|
|
10005
10016
|
}), 0));
|
|
10006
|
-
}), this.logger = t, this.targetSubscription = n, this.currentSubscription =
|
|
10017
|
+
}), this.logger = t, this.targetSubscription = n, this.currentSubscription = yv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
|
|
10007
10018
|
}
|
|
10008
10019
|
};
|
|
10009
|
-
|
|
10020
|
+
vv = xv, e(xv, "create", (e, t, n) => new vv(e, n, t));
|
|
10010
10021
|
//#endregion
|
|
10011
10022
|
//#region ../../libs/web-sdk/src/modules/SyncModule.ts
|
|
10012
|
-
var
|
|
10023
|
+
var Sv, Cv = 5e3, wv = () => Ye() || Ke(), Tv = (e) => e && wv() ? 100 : 0, Ev = (e) => (t) => t > e, Dv = {
|
|
10013
10024
|
seek: {
|
|
10014
10025
|
toleranceMs: 200,
|
|
10015
10026
|
toleranceMaxMs: 2500,
|
|
@@ -10041,7 +10052,7 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10041
10052
|
decayCooldownMultiplier: 3,
|
|
10042
10053
|
decayCheckInterval: 15e3
|
|
10043
10054
|
}
|
|
10044
|
-
},
|
|
10055
|
+
}, Ov = class {
|
|
10045
10056
|
get driftSamplesToCollect() {
|
|
10046
10057
|
return this._driftSamplesToCollect;
|
|
10047
10058
|
}
|
|
@@ -10087,7 +10098,7 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10087
10098
|
}), e(this, "processSample", (e) => {
|
|
10088
10099
|
var t;
|
|
10089
10100
|
if (!e.channelId) throw Error("Sample must be assigned to a channel");
|
|
10090
|
-
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 -
|
|
10101
|
+
this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Cv);
|
|
10091
10102
|
let n = e.type === "video" && e.isSync;
|
|
10092
10103
|
if (this.currentChannelId !== e.channelId) {
|
|
10093
10104
|
let t = 2 ** 53 - 1;
|
|
@@ -10104,7 +10115,7 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10104
10115
|
this.currentChannelId || (this.currentChannelId = e);
|
|
10105
10116
|
let r = t.mediaType();
|
|
10106
10117
|
if (!r) throw Error("Fragment must have a media type");
|
|
10107
|
-
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 -
|
|
10118
|
+
this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Cv);
|
|
10108
10119
|
let i = t.mediaType() === "video" && t.startsWithKeyframe();
|
|
10109
10120
|
if (this.currentChannelId !== e) {
|
|
10110
10121
|
let t = 2 ** 53 - 1;
|
|
@@ -10212,7 +10223,7 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10212
10223
|
return;
|
|
10213
10224
|
}
|
|
10214
10225
|
if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
|
|
10215
|
-
let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(
|
|
10226
|
+
let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Ev(r)).length;
|
|
10216
10227
|
if (i && this.state.timeshiftToleranceMultiplier > 2) {
|
|
10217
10228
|
this.logger.debug("Too many timeshifts within sliding window", {
|
|
10218
10229
|
timeshiftCooldownThreshold: r,
|
|
@@ -10292,7 +10303,7 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10292
10303
|
if (!r && !this.isAllowedToSyncIgnoringCooldown() || r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
|
|
10293
10304
|
let i = r ? t : At(this.driftSamples.items());
|
|
10294
10305
|
if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
|
|
10295
|
-
let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(
|
|
10306
|
+
let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Ev(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
|
|
10296
10307
|
if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
|
|
10297
10308
|
this.logger.debug("Too many seek adjustments within sliding window", {
|
|
10298
10309
|
seekCooldownThreshold: a,
|
|
@@ -10323,11 +10334,11 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10323
10334
|
let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
|
|
10324
10335
|
if (t && r) return n;
|
|
10325
10336
|
}
|
|
10326
|
-
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot =
|
|
10327
|
-
seek: C({},
|
|
10328
|
-
timeshift: C({},
|
|
10329
|
-
playbackRate: C({},
|
|
10330
|
-
backoff: C({},
|
|
10337
|
+
}), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = Tv(o), this.config = {
|
|
10338
|
+
seek: C({}, Dv.seek),
|
|
10339
|
+
timeshift: C({}, Dv.timeshift),
|
|
10340
|
+
playbackRate: C({}, Dv.playbackRate),
|
|
10341
|
+
backoff: C({}, Dv.backoff)
|
|
10331
10342
|
}, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
|
|
10332
10343
|
seekToleranceMultiplier: 1,
|
|
10333
10344
|
timeshiftToleranceMultiplier: 1
|
|
@@ -10389,10 +10400,10 @@ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv =
|
|
|
10389
10400
|
return this.serverCurrentTime - this.playbackSource.currentTime;
|
|
10390
10401
|
}
|
|
10391
10402
|
};
|
|
10392
|
-
|
|
10403
|
+
Sv = Ov, e(Ov, "create", (e, t, n, r, i, a = !0) => new Sv(e, t, n, r, i, a));
|
|
10393
10404
|
//#endregion
|
|
10394
10405
|
//#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
|
|
10395
|
-
var
|
|
10406
|
+
var kv, Av = {
|
|
10396
10407
|
enabled: !0,
|
|
10397
10408
|
interval: 3e4,
|
|
10398
10409
|
includeErrors: !0,
|
|
@@ -10401,11 +10412,11 @@ var Ev, Dv = {
|
|
|
10401
10412
|
maxRetries: 10,
|
|
10402
10413
|
maxErrorReports: 50,
|
|
10403
10414
|
maxEvents: 50
|
|
10404
|
-
},
|
|
10415
|
+
}, jv = (e, t) => C(C({}, t), {}, {
|
|
10405
10416
|
type: e,
|
|
10406
10417
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
10407
10418
|
discriminator: "web"
|
|
10408
|
-
}),
|
|
10419
|
+
}), Mv = class {
|
|
10409
10420
|
constructor(n, r, i, a) {
|
|
10410
10421
|
var o = this;
|
|
10411
10422
|
e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new _(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
|
|
@@ -10422,7 +10433,7 @@ var Ev, Dv = {
|
|
|
10422
10433
|
initiator: "interval"
|
|
10423
10434
|
}, n = {}) => {
|
|
10424
10435
|
if (!this.options.includeStats) return;
|
|
10425
|
-
let r = this.parentContext.getStatistics(), i =
|
|
10436
|
+
let r = this.parentContext.getStatistics(), i = jv("stats", C(C(C({}, n), r), {}, {
|
|
10426
10437
|
isFinal: e,
|
|
10427
10438
|
initiator: t,
|
|
10428
10439
|
count: this.statsCount++
|
|
@@ -10430,7 +10441,7 @@ var Ev, Dv = {
|
|
|
10430
10441
|
this.unsentLines.push(i);
|
|
10431
10442
|
}), e(this, "addEvent", (e) => {
|
|
10432
10443
|
if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
|
|
10433
|
-
let t =
|
|
10444
|
+
let t = jv("event", C(C({}, this.parentContext.getStatistics()), e));
|
|
10434
10445
|
this.eventCount++, this.unsentLines.push(t);
|
|
10435
10446
|
}), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
|
|
10436
10447
|
var e = t(function* (e) {
|
|
@@ -10476,15 +10487,15 @@ var Ev, Dv = {
|
|
|
10476
10487
|
if (t && e instanceof g) {
|
|
10477
10488
|
if (this.errorCount++, this.errorCount > n) return;
|
|
10478
10489
|
let t = this.parentContext.getStatistics();
|
|
10479
|
-
this.unsentLines.push(
|
|
10490
|
+
this.unsentLines.push(jv("error", C(C({}, t), e.toStringifiable())));
|
|
10480
10491
|
}
|
|
10481
|
-
}), this.logger = n, this.emitter = r, this.options = C(C({},
|
|
10492
|
+
}), this.logger = n, this.emitter = r, this.options = C(C({}, Av), i), this.parentContext = a;
|
|
10482
10493
|
}
|
|
10483
10494
|
};
|
|
10484
|
-
|
|
10495
|
+
kv = Mv, e(Mv, "create", (e, t, n, r) => new kv(e, t, n, r));
|
|
10485
10496
|
//#endregion
|
|
10486
10497
|
//#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
|
|
10487
|
-
var
|
|
10498
|
+
var Nv, Pv = class {
|
|
10488
10499
|
constructor(t, n, r) {
|
|
10489
10500
|
e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
|
|
10490
10501
|
this.timers.unload();
|
|
@@ -10493,10 +10504,10 @@ var Av, jv = class {
|
|
|
10493
10504
|
}), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
|
|
10494
10505
|
}
|
|
10495
10506
|
};
|
|
10496
|
-
|
|
10507
|
+
Nv = Pv, e(Pv, "create", (e, t, n) => new Nv(e, t, n));
|
|
10497
10508
|
//#endregion
|
|
10498
10509
|
//#region ../../libs/web-sdk/src/OptionsProvider.ts
|
|
10499
|
-
var
|
|
10510
|
+
var Fv = [
|
|
10500
10511
|
"minBufferTime",
|
|
10501
10512
|
"maxBufferTime",
|
|
10502
10513
|
"burstEnabled",
|
|
@@ -10506,10 +10517,10 @@ var Mv = [
|
|
|
10506
10517
|
"offscreenCanvasEnabled",
|
|
10507
10518
|
"videoCodecs"
|
|
10508
10519
|
];
|
|
10509
|
-
function
|
|
10510
|
-
return
|
|
10520
|
+
function Iv(e) {
|
|
10521
|
+
return Fv.includes(e);
|
|
10511
10522
|
}
|
|
10512
|
-
var
|
|
10523
|
+
var Lv = class {
|
|
10513
10524
|
constructor(t) {
|
|
10514
10525
|
e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
|
|
10515
10526
|
}
|
|
@@ -10523,7 +10534,7 @@ var Pv = class {
|
|
|
10523
10534
|
this.options[e] = t;
|
|
10524
10535
|
}
|
|
10525
10536
|
get(e, t) {
|
|
10526
|
-
if (t &&
|
|
10537
|
+
if (t && Iv(e)) {
|
|
10527
10538
|
var n;
|
|
10528
10539
|
let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
10529
10540
|
if (r !== void 0) return r;
|
|
@@ -10534,7 +10545,7 @@ var Pv = class {
|
|
|
10534
10545
|
var n;
|
|
10535
10546
|
return (n = this.overrides.get(t)) == null ? void 0 : n[e];
|
|
10536
10547
|
}
|
|
10537
|
-
},
|
|
10548
|
+
}, Rv = 6, zv = (e) => {
|
|
10538
10549
|
let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
|
|
10539
10550
|
var i, a;
|
|
10540
10551
|
if (e.flags && qo(e.flags)) {
|
|
@@ -10546,7 +10557,7 @@ var Pv = class {
|
|
|
10546
10557
|
return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
|
|
10547
10558
|
};
|
|
10548
10559
|
return (e, n = !1) => {
|
|
10549
|
-
if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length <
|
|
10560
|
+
if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length < Rv && i) && t.length > 0) {
|
|
10550
10561
|
i = !1;
|
|
10551
10562
|
let n = e;
|
|
10552
10563
|
for (let e = t.length - 1; e > 0; e--) {
|
|
@@ -10559,13 +10570,13 @@ var Pv = class {
|
|
|
10559
10570
|
}
|
|
10560
10571
|
return t.push(e), [];
|
|
10561
10572
|
};
|
|
10562
|
-
},
|
|
10573
|
+
}, Bv = ["mse", "wasm"], Vv = (e) => e == null ? Bv : e, Hv = (e) => {
|
|
10563
10574
|
if (!e) return !1;
|
|
10564
10575
|
let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
|
|
10565
10576
|
return !!(t || n);
|
|
10566
|
-
},
|
|
10567
|
-
if (
|
|
10568
|
-
let r =
|
|
10577
|
+
}, Uv = (e, t, n) => {
|
|
10578
|
+
if (Hv(n)) return "mse";
|
|
10579
|
+
let r = Vv(e);
|
|
10569
10580
|
for (let e of r) switch (e) {
|
|
10570
10581
|
case "mse":
|
|
10571
10582
|
if (t) return "mse";
|
|
@@ -10576,7 +10587,7 @@ var Pv = class {
|
|
|
10576
10587
|
case "wasm": return "wasm";
|
|
10577
10588
|
}
|
|
10578
10589
|
return "wasm";
|
|
10579
|
-
},
|
|
10590
|
+
}, Wv = (e, t, n) => {
|
|
10580
10591
|
if (gn(t)) return C(C({}, e), {}, {
|
|
10581
10592
|
type: "video",
|
|
10582
10593
|
codec: t.codec,
|
|
@@ -10597,8 +10608,8 @@ var Pv = class {
|
|
|
10597
10608
|
data: e.payload,
|
|
10598
10609
|
duration: 0
|
|
10599
10610
|
});
|
|
10600
|
-
},
|
|
10601
|
-
if (!
|
|
10611
|
+
}, Gv = (e, t) => e && typeof e == "object" && t in e, Kv = (e) => !(typeof e != "object" || !Gv(e, "channelId") || typeof e.channelId != "string" || !Gv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), qv = (e) => {
|
|
10612
|
+
if (!Kv(e)) throw new g("Invalid options", {
|
|
10602
10613
|
isFatal: !0,
|
|
10603
10614
|
code: "invalid_options"
|
|
10604
10615
|
});
|
|
@@ -10607,13 +10618,13 @@ var Pv = class {
|
|
|
10607
10618
|
let n = t;
|
|
10608
10619
|
n[e] === void 0 && delete n[e];
|
|
10609
10620
|
}), t;
|
|
10610
|
-
},
|
|
10621
|
+
}, Jv = (e) => {
|
|
10611
10622
|
if (typeof e != "object" || !e) throw Error("not an object");
|
|
10612
10623
|
if (!("video" in e)) throw Error("missing video in subscription");
|
|
10613
10624
|
if (!("audio" in e)) throw Error("missing audio in subscription");
|
|
10614
10625
|
if (!("channelId" in e)) throw Error("missing channelId");
|
|
10615
10626
|
return !0;
|
|
10616
|
-
},
|
|
10627
|
+
}, Yv = class {
|
|
10617
10628
|
constructor(n) {
|
|
10618
10629
|
var r = this;
|
|
10619
10630
|
e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
|
|
@@ -10674,10 +10685,10 @@ var Pv = class {
|
|
|
10674
10685
|
return this.inFlight.set(e, o), o;
|
|
10675
10686
|
}), this.logger = n;
|
|
10676
10687
|
}
|
|
10677
|
-
},
|
|
10688
|
+
}, Xv = /* @__PURE__ */ new WeakMap(), Zv = /* @__PURE__ */ new WeakMap(), Qv = /* @__PURE__ */ new WeakMap(), $v = class n extends _e {
|
|
10678
10689
|
constructor(r) {
|
|
10679
10690
|
var i, a;
|
|
10680
|
-
super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", pn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new fn()), e(this, "encryptedMediaExtensions", void 0), v(this,
|
|
10691
|
+
super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", pn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new fn()), e(this, "encryptedMediaExtensions", void 0), v(this, Xv, 0), v(this, Zv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Qv, void 0), e(this, "attach", (e) => {
|
|
10681
10692
|
var t;
|
|
10682
10693
|
(t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
|
|
10683
10694
|
}), e(this, "setElement", (e) => {
|
|
@@ -10760,20 +10771,20 @@ var Pv = class {
|
|
|
10760
10771
|
}), e(this, "updateTextTracks", (e) => {
|
|
10761
10772
|
let t = e.filter((e) => e.codec === "webvtt");
|
|
10762
10773
|
t.forEach((e) => {
|
|
10763
|
-
if (!b(
|
|
10774
|
+
if (!b(Zv, this).find((t) => t.language === e.language)) {
|
|
10764
10775
|
if (this.modules.canvasModule) {
|
|
10765
10776
|
let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
|
|
10766
|
-
b(
|
|
10777
|
+
b(Zv, this).push(t);
|
|
10767
10778
|
} else if (this.mediaElement instanceof HTMLVideoElement) {
|
|
10768
10779
|
let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
|
|
10769
|
-
b(
|
|
10780
|
+
b(Zv, this).push(t);
|
|
10770
10781
|
}
|
|
10771
10782
|
}
|
|
10772
10783
|
});
|
|
10773
|
-
for (let e of b(
|
|
10784
|
+
for (let e of b(Zv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
|
|
10774
10785
|
this.emit("text tracks", this.textTracks);
|
|
10775
10786
|
}), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
|
|
10776
|
-
b(
|
|
10787
|
+
b(Zv, this).forEach((t) => {
|
|
10777
10788
|
if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
|
|
10778
10789
|
});
|
|
10779
10790
|
}), e(this, "filterRenditions", function() {
|
|
@@ -10907,8 +10918,8 @@ var Pv = class {
|
|
|
10907
10918
|
u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
|
|
10908
10919
|
}
|
|
10909
10920
|
else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
|
|
10910
|
-
let f = yield
|
|
10911
|
-
if (m instanceof
|
|
10921
|
+
let f = yield h_.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
|
|
10922
|
+
if (m instanceof B_) if (p === "OffscreenCanvas" && d) {
|
|
10912
10923
|
m.setVideoRenderingEnabled(!1);
|
|
10913
10924
|
let e = i.element;
|
|
10914
10925
|
e.parentElement ? e.parentElement.replaceChild(d, e) : i.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), i.offscreenCanvasElement = d, i.setElement(d);
|
|
@@ -10920,10 +10931,10 @@ var Pv = class {
|
|
|
10920
10931
|
t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
|
|
10921
10932
|
}
|
|
10922
10933
|
}
|
|
10923
|
-
else m instanceof
|
|
10934
|
+
else m instanceof H_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
|
|
10924
10935
|
(e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
|
|
10925
10936
|
})), e(this, "setupOffscreenSubtitleRouting", () => {
|
|
10926
|
-
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof
|
|
10937
|
+
if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof H_) return;
|
|
10927
10938
|
let e = this.modules.decoder, t = this.modules.canvasModule;
|
|
10928
10939
|
if (!t) return;
|
|
10929
10940
|
let n = !1;
|
|
@@ -10962,10 +10973,10 @@ var Pv = class {
|
|
|
10962
10973
|
e && "reset" in e && e.reset();
|
|
10963
10974
|
}), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
|
|
10964
10975
|
}), e(this, "getRuntimeInfo", () => {
|
|
10965
|
-
let e = this.modules.canvasModule instanceof
|
|
10976
|
+
let e = this.modules.canvasModule instanceof H_ ? !0 : void 0;
|
|
10966
10977
|
return C({
|
|
10967
10978
|
uptime: Date.now() - this.createdAt,
|
|
10968
|
-
version: "4.3.0-
|
|
10979
|
+
version: "4.3.0-5-ga57504ef",
|
|
10969
10980
|
clientId: this.clientId,
|
|
10970
10981
|
sessionId: this.sessionId,
|
|
10971
10982
|
channelId: this.channelId,
|
|
@@ -10999,7 +11010,7 @@ var Pv = class {
|
|
|
10999
11010
|
}), e(this, "timeToFirstFrame", () => {
|
|
11000
11011
|
let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
|
|
11001
11012
|
if (t && e) return e - t;
|
|
11002
|
-
}), this.options = new
|
|
11013
|
+
}), this.options = new Lv(C(C({}, Sn), qv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
|
|
11003
11014
|
let o = {
|
|
11004
11015
|
channelId: this.options.get("channelId"),
|
|
11005
11016
|
audio: {
|
|
@@ -11012,16 +11023,16 @@ var Pv = class {
|
|
|
11012
11023
|
height: this.options.get("maxSize").height
|
|
11013
11024
|
}
|
|
11014
11025
|
}, s = O.get();
|
|
11015
|
-
s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new
|
|
11026
|
+
s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Yv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
|
|
11016
11027
|
let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
|
|
11017
11028
|
c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
|
|
11018
11029
|
let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
|
|
11019
11030
|
l && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), l && !f && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
|
|
11020
|
-
let p =
|
|
11031
|
+
let p = lv.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = o_.create(this.emitter, this.logger.createContext("ConnectionModule"), {
|
|
11021
11032
|
reconnectHandler: this.options.get("reconnectHandler"),
|
|
11022
11033
|
options: this.options,
|
|
11023
11034
|
onConnectInfo: this.onConnectInfo
|
|
11024
|
-
}), te =
|
|
11035
|
+
}), te = xv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = _v.create(this.emitter, te), re = hv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = dv.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
|
|
11025
11036
|
this.encryptedMediaExtensions = new Vr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
|
|
11026
11037
|
setHeaders: (e) => {
|
|
11027
11038
|
this.encryptedMediaExtensions.headers = e;
|
|
@@ -11030,7 +11041,7 @@ var Pv = class {
|
|
|
11030
11041
|
this.encryptedMediaExtensions.queryParams = e;
|
|
11031
11042
|
}
|
|
11032
11043
|
};
|
|
11033
|
-
let ae =
|
|
11044
|
+
let ae = __.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
|
|
11034
11045
|
if (this.willUseMediaSource()) {
|
|
11035
11046
|
let e = new ds({
|
|
11036
11047
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
@@ -11040,9 +11051,9 @@ var Pv = class {
|
|
|
11040
11051
|
logger: this.logger.createContext("MediaElement"),
|
|
11041
11052
|
poster: se
|
|
11042
11053
|
});
|
|
11043
|
-
e.on("buffer state", (e) => this.onMediaElementBufferState(e, _)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ =
|
|
11054
|
+
e.on("buffer state", (e) => this.onMediaElementBufferState(e, _)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = ev.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = Pv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
|
|
11044
11055
|
} else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
|
|
11045
|
-
let e =
|
|
11056
|
+
let e = H_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
|
|
11046
11057
|
type: this.options.get("media") === "audio" ? "audio" : "video",
|
|
11047
11058
|
muted: this.options.get("muted") || this.options.get("media") === "video",
|
|
11048
11059
|
volume: this.options.get("volume"),
|
|
@@ -11052,10 +11063,10 @@ var Pv = class {
|
|
|
11052
11063
|
}), t = e.element();
|
|
11053
11064
|
this.element = t.element, this.playbackSource = e, S = e;
|
|
11054
11065
|
let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
|
|
11055
|
-
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y =
|
|
11066
|
+
this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = Pv.create(this.logger.createContext("UnpauseModule"), t, ae));
|
|
11056
11067
|
} else {
|
|
11057
11068
|
let e;
|
|
11058
|
-
e =
|
|
11069
|
+
e = B_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
|
|
11059
11070
|
this.setElement(e.element());
|
|
11060
11071
|
}, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new ts());
|
|
11061
11072
|
}
|
|
@@ -11072,9 +11083,9 @@ var Pv = class {
|
|
|
11072
11083
|
let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de = {
|
|
11073
11084
|
getTargetBufferTime: () => ie.getTargetBufferTime(),
|
|
11074
11085
|
getNextBufferedRangeStart: _ ? (e) => _.getNextBufferedRangeStart(e) : void 0
|
|
11075
|
-
}, fe =
|
|
11086
|
+
}, fe = Ov.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = T_.create(this.logger.createContext("JitterModule")), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ge = new URL("/telemetry", me).toString();
|
|
11076
11087
|
this.modules = {
|
|
11077
|
-
telemetry:
|
|
11088
|
+
telemetry: Mv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
|
|
11078
11089
|
url: ge,
|
|
11079
11090
|
enabled: this.options.get("telemetryEnabled"),
|
|
11080
11091
|
includeStats: !1,
|
|
@@ -11084,10 +11095,10 @@ var Pv = class {
|
|
|
11084
11095
|
maxBufferTime: this.options.get("maxBufferTime"),
|
|
11085
11096
|
minBufferTime: this.options.get("minBufferTime")
|
|
11086
11097
|
}),
|
|
11087
|
-
incomingData:
|
|
11098
|
+
incomingData: S_.create(this.emitter),
|
|
11088
11099
|
adaptivity: Ss.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
|
|
11089
|
-
constraintCap:
|
|
11090
|
-
event:
|
|
11100
|
+
constraintCap: d_.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
|
|
11101
|
+
event: b_.create(this.emitter, this.logger.createContext("EventModule"), fe),
|
|
11091
11102
|
sync: fe,
|
|
11092
11103
|
jitter: pe,
|
|
11093
11104
|
documentState: ae,
|
|
@@ -11140,7 +11151,7 @@ var Pv = class {
|
|
|
11140
11151
|
let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
|
|
11141
11152
|
if (e.telemetry) {
|
|
11142
11153
|
var i;
|
|
11143
|
-
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry =
|
|
11154
|
+
(i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Mv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
|
|
11144
11155
|
}
|
|
11145
11156
|
}), this.emitter.on("adapt level", (e) => {
|
|
11146
11157
|
this.logger.debug("adapt level", { direction: e });
|
|
@@ -11172,8 +11183,8 @@ var Pv = class {
|
|
|
11172
11183
|
audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
|
|
11173
11184
|
})), this.emitter.emit("adapted level");
|
|
11174
11185
|
}), this.emitter.on("text track data", (e) => {
|
|
11175
|
-
let t = b(
|
|
11176
|
-
if (x(
|
|
11186
|
+
let t = b(Zv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Xv, this);
|
|
11187
|
+
if (x(Xv, this, n), t) {
|
|
11177
11188
|
if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
|
|
11178
11189
|
for (let r of e.cues) {
|
|
11179
11190
|
let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
|
|
@@ -11187,19 +11198,19 @@ var Pv = class {
|
|
|
11187
11198
|
this.clientIp = t.ip;
|
|
11188
11199
|
break;
|
|
11189
11200
|
case "renditions":
|
|
11190
|
-
this.updateTextTracks(t.renditions), x(
|
|
11201
|
+
this.updateTextTracks(t.renditions), x(Qv, this, this.filterRenditions(t.renditions).then((e) => {
|
|
11191
11202
|
this.emitter.emit("renditions", {
|
|
11192
11203
|
renditions: e,
|
|
11193
11204
|
channelId: this.currentSubscription.channelId
|
|
11194
11205
|
}), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
|
|
11195
11206
|
}).finally(() => {
|
|
11196
|
-
x(
|
|
11207
|
+
x(Qv, this, void 0);
|
|
11197
11208
|
}));
|
|
11198
11209
|
break;
|
|
11199
11210
|
case "subscription changed":
|
|
11200
11211
|
var r;
|
|
11201
11212
|
try {
|
|
11202
|
-
|
|
11213
|
+
Jv(t.subscription);
|
|
11203
11214
|
} catch (e) {
|
|
11204
11215
|
this.emitter.emit("error", new g("Subscription failed validation", {
|
|
11205
11216
|
source: e instanceof Error ? e : void 0,
|
|
@@ -11314,7 +11325,7 @@ var Pv = class {
|
|
|
11314
11325
|
let xe = function() {
|
|
11315
11326
|
var e = t(function* (e) {
|
|
11316
11327
|
let t = e.channelId;
|
|
11317
|
-
b(
|
|
11328
|
+
b(Qv, i) && (yield b(Qv, i));
|
|
11318
11329
|
let n = i.modules.renditions.getRendition(e.renditionId, t);
|
|
11319
11330
|
if (!Yo(e.flags)) {
|
|
11320
11331
|
if (Xo(e.flags)) {
|
|
@@ -11322,8 +11333,8 @@ var Pv = class {
|
|
|
11322
11333
|
if (e.renditionId !== 0) {
|
|
11323
11334
|
let e = le(t);
|
|
11324
11335
|
if (e && e.language !== void 0) {
|
|
11325
|
-
let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(
|
|
11326
|
-
if (x(
|
|
11336
|
+
let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(Zv, i).find((t) => t.language === e.language), o = r - b(Xv, i);
|
|
11337
|
+
if (x(Xv, i, r), a) {
|
|
11327
11338
|
if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
|
|
11328
11339
|
for (let e of t) {
|
|
11329
11340
|
let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
|
|
@@ -11355,10 +11366,10 @@ var Pv = class {
|
|
|
11355
11366
|
mimeType: s
|
|
11356
11367
|
}), i.emit("initialized media");
|
|
11357
11368
|
} else {
|
|
11358
|
-
let t =
|
|
11369
|
+
let t = Wv(e, n, i.sizes.get(e.renditionId));
|
|
11359
11370
|
i.modules.jitter.recordSample(t);
|
|
11360
11371
|
let a = i.sampleProcessingSesssions.get(r);
|
|
11361
|
-
if (!a) a =
|
|
11372
|
+
if (!a) a = zv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
|
|
11362
11373
|
else {
|
|
11363
11374
|
let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
|
|
11364
11375
|
n.forEach((e) => {
|
|
@@ -11466,7 +11477,7 @@ var Pv = class {
|
|
|
11466
11477
|
this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
|
|
11467
11478
|
}
|
|
11468
11479
|
set textTrack(e) {
|
|
11469
|
-
e !== this.textTrack && (b(
|
|
11480
|
+
e !== this.textTrack && (b(Zv, this).forEach((t) => {
|
|
11470
11481
|
if (t.label === e) t.mode = "showing";
|
|
11471
11482
|
else {
|
|
11472
11483
|
if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
|
|
@@ -11475,11 +11486,11 @@ var Pv = class {
|
|
|
11475
11486
|
}), this.emitter.emit("text track", e));
|
|
11476
11487
|
}
|
|
11477
11488
|
get textTracks() {
|
|
11478
|
-
return b(
|
|
11489
|
+
return b(Zv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
|
|
11479
11490
|
}
|
|
11480
11491
|
get textTrack() {
|
|
11481
11492
|
var e;
|
|
11482
|
-
return (e = b(
|
|
11493
|
+
return (e = b(Zv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
|
|
11483
11494
|
}
|
|
11484
11495
|
get channelId() {
|
|
11485
11496
|
var e, t;
|
|
@@ -11613,7 +11624,7 @@ var Pv = class {
|
|
|
11613
11624
|
return this.modules.subscription.getTargetSubscription();
|
|
11614
11625
|
}
|
|
11615
11626
|
resolvedDecoder(e) {
|
|
11616
|
-
return
|
|
11627
|
+
return Uv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
|
|
11617
11628
|
}
|
|
11618
11629
|
willUseMediaSource() {
|
|
11619
11630
|
return this.resolvedDecoder() === "mse";
|
|
@@ -11632,6 +11643,6 @@ var Pv = class {
|
|
|
11632
11643
|
return t === void 0 ? this.shouldUseWebCodecs(e) : t;
|
|
11633
11644
|
}
|
|
11634
11645
|
};
|
|
11635
|
-
e(
|
|
11646
|
+
e($v, "MAX_POOL_SIZE", 10), e($v, "DISCONNECT_TIMEOUT", 15 * 1e3), e($v, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
|
|
11636
11647
|
//#endregion
|
|
11637
|
-
export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s,
|
|
11648
|
+
export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, $v as t, gt as u, Qe as v };
|