@vindral/web-sdk 4.7.2-7-gbceb2a43 → 4.7.2-8-gde5e8235

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.
@@ -4043,7 +4043,7 @@ var hc, gc = .15, _c = .2, vc = .4, yc = .5, bc = .6, xc = 1800, Sc = {
4043
4043
  maxCooldownRatio: 2
4044
4044
  }, Cc = (e) => (t) => t > e, wc = class {
4045
4045
  constructor(t, n, r, i, a) {
4046
- e(this, "qualityOfServiceSource", void 0), e(this, "incomingDataSource", void 0), e(this, "config", void 0), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "isSuspended", !1), e(this, "lastAdaptTime", performance.now()), e(this, "isEnabled", !0), e(this, "load", () => {
4046
+ e(this, "qualityOfServiceSource", void 0), e(this, "incomingDataSource", void 0), e(this, "config", void 0), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "isSuspended", !1), e(this, "lastAdaptTime", performance.now()), e(this, "reconnectHoldUntil", -Infinity), e(this, "isEnabled", !0), e(this, "load", () => {
4047
4047
  this.emitter.on("buffer state", this.onBufferState), this.emitter.on("adapted level", this.onAdaptedLevel);
4048
4048
  }), e(this, "unload", () => {
4049
4049
  this.emitter.off("buffer state", this.onBufferState), this.emitter.off("adapted level", this.onAdaptedLevel);
@@ -4053,6 +4053,8 @@ var hc, gc = .15, _c = .2, vc = .4, yc = .5, bc = .6, xc = 1800, Sc = {
4053
4053
  this.reset(), this.isSuspended = !1;
4054
4054
  }), e(this, "reset", (e = 0) => {
4055
4055
  this.lastAdaptTime = performance.now() + e;
4056
+ }), e(this, "holdReconnect", (e) => {
4057
+ this.reconnectHoldUntil = performance.now() + e;
4056
4058
  }), e(this, "getStatistics", () => ({ isAbrEnabled: this.isEnabled })), e(this, "isQoSOk", (e) => {
4057
4059
  let t = this.qualityOfServiceSource.getLevelStats(e), { upgradesFromLevel: n, downgradesFromLevel: r } = t == null ? {
4058
4060
  upgradesFromLevel: [],
@@ -4079,7 +4081,7 @@ var hc, gc = .15, _c = .2, vc = .4, yc = .5, bc = .6, xc = 1800, Sc = {
4079
4081
  }), e(this, "onBufferState", (e) => {
4080
4082
  if (!this.isEnabled || this.isSuspended || this.lastAdaptTime + this.config.cooldownTime > performance.now()) return;
4081
4083
  let { bufferFullness: t, general: n } = this.qualityOfServiceSource.getMetrics(), r = this.qualityOfServiceSource.getBufferFullnessRegression(), i = 10 * 1e3, a = 30 * 1e3, o = this.qualityOfServiceSource.timeSpentBufferingLast(a), s = this.qualityOfServiceSource.timeSpentActiveLast(a), c = this.qualityOfServiceSource.bufferingEventsLast(a), l = s > 0 ? o / s : 0, u = this.qualityOfServiceSource.getTargetBufferTime();
4082
- if (t < .15 && l > .8) {
4084
+ if (t < .15 && l > .8 && performance.now() >= this.reconnectHoldUntil) {
4083
4085
  this.adaptLevel("reconnect");
4084
4086
  return;
4085
4087
  }
@@ -4104,6 +4106,9 @@ var hc, gc = .15, _c = .2, vc = .4, yc = .5, bc = .6, xc = 1800, Sc = {
4104
4106
  this.reset();
4105
4107
  }), e(this, "adaptLevel", (e) => this.emitter.emit("adapt level", e)), this.qualityOfServiceSource = r, this.incomingDataSource = i, this.config = y(y({}, Sc), a), this.emitter = t, this.logger = n;
4106
4108
  }
4109
+ updateConfig(e) {
4110
+ this.config = y(y({}, this.config), e);
4111
+ }
4107
4112
  tooMuchTimeBuffering(e) {
4108
4113
  let t = this.qualityOfServiceSource.timeSpentActiveLast(e);
4109
4114
  return (t ? this.qualityOfServiceSource.timeSpentBufferingLast(e) / t : 0) > this.config.maxBufferingRatio.last10Seconds;
@@ -11024,6 +11029,8 @@ var ox, sx = () => ({
11024
11029
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.suspend();
11025
11030
  }), e(this, "suspend", () => {
11026
11031
  this.isSuspended = !0, this.timers.unload(), this.bufferFullness.clear(), this.bufferFullnessRegression = void 0, this.stopBuffering(), this.unsetActive(), this.hasPlayedInSession = !1;
11032
+ }), e(this, "reset", () => {
11033
+ this.bufferFullness.clear(), this.bufferFullnessRegression = void 0;
11027
11034
  }), e(this, "unsuspend", () => {
11028
11035
  this.isSuspended = !1, this.currentLevel && this.setActive();
11029
11036
  }), e(this, "fatalQosGraceTime", () => 1e4 * (this.fatalQosCount + 1)), e(this, "incrementFatalQosCount", () => {
@@ -12205,7 +12212,7 @@ var Vx = class {
12205
12212
  if ((s || c) && (o.modules.bufferTime.updateConfig({
12206
12213
  minBufferTime: o.options.get("minBufferTime", o.channelId),
12207
12214
  maxBufferTime: o.options.get("maxBufferTime", o.channelId)
12208
- }), o.targetBufferTime = o.options.get("minBufferTime", o.channelId)), o.applyBurstEnabled(o.channelId), o.emit("is live", i.isLive), !i.isLive) throw Zn();
12215
+ }), o.modules.adaptivity.updateConfig({ cooldownTime: Math.max(o.options.get("minBufferTime", o.channelId), 2e3) }), o.targetBufferTime = o.options.get("minBufferTime", o.channelId)), o.applyBurstEnabled(o.channelId), o.emit("is live", i.isLive), !i.isLive) throw Zn();
12209
12216
  let l = o.modules.connection.estimatedBandwidth;
12210
12217
  o.patchSubscription(i, l), yield o.initializeDecodingModule(), o.resetModules(), o.emit("rendition levels", o.modules.renditions.getRenditionLevels()), o.emit("channels", o.channels), o.emitLanguagesIfChanged(), o.sampleProcessingSesssions.clear();
12211
12218
  let u = o.options.get("burstEnabled", o.channelId) && o.burstFits(l);
@@ -12478,7 +12485,7 @@ var Vx = class {
12478
12485
  }), e(this, "resetModules", () => {
12479
12486
  Object.values(this.modules).forEach((e) => {
12480
12487
  e && "reset" in e && e.reset();
12481
- }), this.playbackSource instanceof dc && this.modules.adaptivity.reset(aS), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12488
+ }), this.playbackSource instanceof dc && this.modules.adaptivity.holdReconnect(aS), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12482
12489
  }), e(this, "disconnectForInactivePage", (e) => {
12483
12490
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
12484
12491
  var t;
@@ -12512,7 +12519,7 @@ var Vx = class {
12512
12519
  let e = this.modules.canvasModule instanceof Vb ? !0 : void 0;
12513
12520
  return y({
12514
12521
  uptime: this.uptime,
12515
- version: "4.7.2-7-gbceb2a43",
12522
+ version: "4.7.2-8-gde5e8235",
12516
12523
  clientId: this.clientId,
12517
12524
  sessionId: this.sessionId,
12518
12525
  channelId: this.channelId,
package/core.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./B7f7kAZQ.js";
1
+ import { a as e, c as t, d as n, f as r, i, l as a, o, r as s, s as c, t as l, u } from "./BfOOuD-G.js";
2
2
  export { s as AUTHENTICATION_EXPIRED_CODE, i as AUTHENTICATION_FAILED_CODE, e as CHANNEL_NOT_FOUND_CODE, o as CHANNEL_NOT_LIVE_CODE, c as CONNECTION_FAILED_AFTER_RETRIES_CODE, t as CONNECTION_FAILED_CODE, a as DISCONNECTED_BY_EDGE, u as INACTIVITY_CODE, n as NO_INCOMING_DATA, l as Vindral, r as VindralError };
package/legacy.es.js CHANGED
@@ -4870,7 +4870,7 @@ var su, cu = .15, lu = .2, uu = .4, du = .5, fu = .6, pu = 1800, mu = {
4870
4870
  maxCooldownRatio: 2
4871
4871
  }, hu = (e) => (t) => t > e, gu = class {
4872
4872
  constructor(e, t, n, r, i) {
4873
- p(this, "qualityOfServiceSource", void 0), p(this, "incomingDataSource", void 0), p(this, "config", void 0), p(this, "emitter", void 0), p(this, "logger", void 0), p(this, "isSuspended", !1), p(this, "lastAdaptTime", performance.now()), p(this, "isEnabled", !0), p(this, "load", () => {
4873
+ p(this, "qualityOfServiceSource", void 0), p(this, "incomingDataSource", void 0), p(this, "config", void 0), p(this, "emitter", void 0), p(this, "logger", void 0), p(this, "isSuspended", !1), p(this, "lastAdaptTime", performance.now()), p(this, "reconnectHoldUntil", -Infinity), p(this, "isEnabled", !0), p(this, "load", () => {
4874
4874
  this.emitter.on("buffer state", this.onBufferState), this.emitter.on("adapted level", this.onAdaptedLevel);
4875
4875
  }), p(this, "unload", () => {
4876
4876
  this.emitter.off("buffer state", this.onBufferState), this.emitter.off("adapted level", this.onAdaptedLevel);
@@ -4880,6 +4880,8 @@ var su, cu = .15, lu = .2, uu = .4, du = .5, fu = .6, pu = 1800, mu = {
4880
4880
  this.reset(), this.isSuspended = !1;
4881
4881
  }), p(this, "reset", (e = 0) => {
4882
4882
  this.lastAdaptTime = performance.now() + e;
4883
+ }), p(this, "holdReconnect", (e) => {
4884
+ this.reconnectHoldUntil = performance.now() + e;
4883
4885
  }), p(this, "getStatistics", () => ({ isAbrEnabled: this.isEnabled })), p(this, "isQoSOk", (e) => {
4884
4886
  let t = this.qualityOfServiceSource.getLevelStats(e), { upgradesFromLevel: n, downgradesFromLevel: r } = t == null ? {
4885
4887
  upgradesFromLevel: [],
@@ -4906,7 +4908,7 @@ var su, cu = .15, lu = .2, uu = .4, du = .5, fu = .6, pu = 1800, mu = {
4906
4908
  }), p(this, "onBufferState", (e) => {
4907
4909
  if (!this.isEnabled || this.isSuspended || this.lastAdaptTime + this.config.cooldownTime > performance.now()) return;
4908
4910
  let { bufferFullness: t, general: n } = this.qualityOfServiceSource.getMetrics(), r = this.qualityOfServiceSource.getBufferFullnessRegression(), i = 10 * 1e3, a = 30 * 1e3, o = this.qualityOfServiceSource.timeSpentBufferingLast(a), s = this.qualityOfServiceSource.timeSpentActiveLast(a), c = this.qualityOfServiceSource.bufferingEventsLast(a), l = s > 0 ? o / s : 0, u = this.qualityOfServiceSource.getTargetBufferTime();
4909
- if (t < .15 && l > .8) {
4911
+ if (t < .15 && l > .8 && performance.now() >= this.reconnectHoldUntil) {
4910
4912
  this.adaptLevel("reconnect");
4911
4913
  return;
4912
4914
  }
@@ -4931,6 +4933,9 @@ var su, cu = .15, lu = .2, uu = .4, du = .5, fu = .6, pu = 1800, mu = {
4931
4933
  this.reset();
4932
4934
  }), p(this, "adaptLevel", (e) => this.emitter.emit("adapt level", e)), this.qualityOfServiceSource = n, this.incomingDataSource = r, this.config = L(L({}, mu), i), this.emitter = e, this.logger = t;
4933
4935
  }
4936
+ updateConfig(e) {
4937
+ this.config = L(L({}, this.config), e);
4938
+ }
4934
4939
  tooMuchTimeBuffering(e) {
4935
4940
  let t = this.qualityOfServiceSource.timeSpentActiveLast(e);
4936
4941
  return (t ? this.qualityOfServiceSource.timeSpentBufferingLast(e) / t : 0) > this.config.maxBufferingRatio.last10Seconds;
@@ -12600,6 +12605,8 @@ var YC, XC = () => ({
12600
12605
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.suspend();
12601
12606
  }), p(this, "suspend", () => {
12602
12607
  this.isSuspended = !0, this.timers.unload(), this.bufferFullness.clear(), this.bufferFullnessRegression = void 0, this.stopBuffering(), this.unsetActive(), this.hasPlayedInSession = !1;
12608
+ }), p(this, "reset", () => {
12609
+ this.bufferFullness.clear(), this.bufferFullnessRegression = void 0;
12603
12610
  }), p(this, "unsuspend", () => {
12604
12611
  this.isSuspended = !1, this.currentLevel && this.setActive();
12605
12612
  }), p(this, "fatalQosGraceTime", () => 1e4 * (this.fatalQosCount + 1)), p(this, "incrementFatalQosCount", () => {
@@ -13789,7 +13796,7 @@ var Jw = 1e4, Yw = 1280 * 720, Xw = /* @__PURE__ */ new WeakMap(), Zw = /* @__PU
13789
13796
  if ((o || s) && (n.modules.bufferTime.updateConfig({
13790
13797
  minBufferTime: n.options.get("minBufferTime", n.channelId),
13791
13798
  maxBufferTime: n.options.get("maxBufferTime", n.channelId)
13792
- }), n.targetBufferTime = n.options.get("minBufferTime", n.channelId)), n.applyBurstEnabled(n.channelId), n.emit("is live", i.isLive), !i.isLive) throw Gi();
13799
+ }), n.modules.adaptivity.updateConfig({ cooldownTime: Math.max(n.options.get("minBufferTime", n.channelId), 2e3) }), n.targetBufferTime = n.options.get("minBufferTime", n.channelId)), n.applyBurstEnabled(n.channelId), n.emit("is live", i.isLive), !i.isLive) throw Gi();
13793
13800
  let c = n.modules.connection.estimatedBandwidth;
13794
13801
  n.patchSubscription(i, c), yield n.initializeDecodingModule(), n.resetModules(), n.emit("rendition levels", n.modules.renditions.getRenditionLevels()), n.emit("channels", n.channels), n.emitLanguagesIfChanged(), n.sampleProcessingSesssions.clear();
13795
13802
  let l = n.options.get("burstEnabled", n.channelId) && n.burstFits(c);
@@ -14062,7 +14069,7 @@ var Jw = 1e4, Yw = 1280 * 720, Xw = /* @__PURE__ */ new WeakMap(), Zw = /* @__PU
14062
14069
  }), p(this, "resetModules", () => {
14063
14070
  Object.values(this.modules).forEach((e) => {
14064
14071
  e && "reset" in e && e.reset();
14065
- }), this.playbackSource instanceof ru && this.modules.adaptivity.reset(Jw), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
14072
+ }), this.playbackSource instanceof ru && this.modules.adaptivity.holdReconnect(Jw), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
14066
14073
  }), p(this, "disconnectForInactivePage", (e) => {
14067
14074
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
14068
14075
  var t;
@@ -14096,7 +14103,7 @@ var Jw = 1e4, Yw = 1280 * 720, Xw = /* @__PURE__ */ new WeakMap(), Zw = /* @__PU
14096
14103
  let e = this.modules.canvasModule instanceof AC ? !0 : void 0;
14097
14104
  return L({
14098
14105
  uptime: this.uptime,
14099
- version: "4.7.2-7-gbceb2a43",
14106
+ version: "4.7.2-8-gde5e8235",
14100
14107
  clientId: this.clientId,
14101
14108
  sessionId: this.sessionId,
14102
14109
  channelId: this.channelId,