@vindral/web-sdk 4.5.1-17-g1fb63dd0b → 4.5.1-18-g846892c8d

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.
@@ -1,5 +1,5 @@
1
1
  import { n as e, t } from "./BsfwXDui.js";
2
- import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as d, o as te, p as ne, r as re, s as ie, t as ae, u as oe, v as se } from "./CJN8L0VO.js";
2
+ import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as d, o as te, p as ne, r as re, s as ie, t as ae, u as oe, v as se } from "./CaL1HjW4.js";
3
3
  import { P as ce } from "./CiWlpwR0.js";
4
4
  import { i as f, n as p, r as m, t as h } from "./DSw1XhvD.js";
5
5
  import { c as le, n as ue, t as de } from "./BOdyvABa.js";
@@ -8602,6 +8602,9 @@ var I_ = (e, t) => `${e}\u0000${t == null ? "" : t}`, L_ = (e, t, n, r) => e ===
8602
8602
  audioRenderer: "AudioContext",
8603
8603
  audioDecoder: this._audioWebCodecsInUse ? "WebCodecs" : "WASM"
8604
8604
  });
8605
+ }), e(this, "setVideoRenderingEnabled", (e) => {
8606
+ var t, n, r;
8607
+ this._offscreenCanvasInUse && ((t = this.trackContexts.get("video")) == null || (r = (n = t.decoderContext).setRenderingEnabled) == null || r.call(n, e));
8605
8608
  }), e(this, "setSubtitleCues", (e, t, n, r, i) => {
8606
8609
  var a;
8607
8610
  if (!this._offscreenCanvasInUse) return;
@@ -8744,7 +8747,7 @@ var I_ = (e, t) => `${e}\u0000${t == null ? "" : t}`, L_ = (e, t, n, r) => e ===
8744
8747
  break;
8745
8748
  }
8746
8749
  case "video": {
8747
- let { VideoDecoderWorkerContext: n } = yield import("./ir89G42i.js"), a = yield n.create(r.createContext("VideoDecoderWorker"), i, c, l, u, d, () => s.currentTime);
8750
+ let { VideoDecoderWorkerContext: n } = yield import("./DBL4St0f.js"), a = yield n.create(r.createContext("VideoDecoderWorker"), i, c, l, u, d, () => s.currentTime);
8748
8751
  p = a.isWebCodecs, h = a.usingOffscreenCanvas, t.set(e.type, {
8749
8752
  buffer: [],
8750
8753
  decoderContext: a,
@@ -11407,7 +11410,7 @@ var dy = class {
11407
11410
  }
11408
11411
  }
11409
11412
  else h instanceof xv && (h.setBackgroundPlaybackEnabled(i.isBackgroundPlayEnabled(i.channelId)), p === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (h.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
11410
- (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.isHiddenWithBackgroundPlayback() && i.modules.decoder.enableBackgroundTimers(), i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
11413
+ (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.isHiddenWithBackgroundPlayback() && i.modules.decoder.enableBackgroundTimers(), i.modules.decoder.setVideoRenderingEnabled(i.isVideoOnScreen()), i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
11411
11414
  })), e(this, "setupOffscreenSubtitleRouting", () => {
11412
11415
  if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof xv) return;
11413
11416
  let e = this.modules.decoder, t = this.modules.canvasModule;
@@ -11459,7 +11462,7 @@ var dy = class {
11459
11462
  }, n.BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT);
11460
11463
  }), e(this, "clearInactivityDisconnect", () => {
11461
11464
  this.inactivityDisconnectInterval !== void 0 && (this.modules.timer.clearInterval(this.inactivityDisconnectInterval), this.inactivityDisconnectInterval = void 0);
11462
- }), e(this, "isHiddenWithBackgroundPlayback", () => !this.modules.documentState.isVisible && this.shouldAllowBackgroundPlayback(this.channelId)), e(this, "isHiddenWithBackgroundPlayDisabled", () => !this.modules.documentState.isVisible && !this.isBackgroundPlayEnabled(this.channelId)), e(this, "resumeModules", () => {
11465
+ }), e(this, "isHiddenWithBackgroundPlayback", () => !this.modules.documentState.isVisible && this.shouldAllowBackgroundPlayback(this.channelId)), e(this, "isVideoOnScreen", (e = this.modules.documentState.isVisible) => e || this.modules.pictureInPicture.isPictureInPictureActive()), e(this, "isHiddenWithBackgroundPlayDisabled", () => !this.modules.documentState.isVisible && !this.isBackgroundPlayEnabled(this.channelId)), e(this, "resumeModules", () => {
11463
11466
  Object.values(this.modules).forEach((e) => {
11464
11467
  e && "unsuspend" in e && e.unsuspend();
11465
11468
  });
@@ -11467,7 +11470,7 @@ var dy = class {
11467
11470
  let e = this.modules.canvasModule instanceof xv ? !0 : void 0;
11468
11471
  return O({
11469
11472
  uptime: this.uptime,
11470
- version: "4.5.1-17-g1fb63dd0b",
11473
+ version: "4.5.1-18-g846892c8d",
11471
11474
  clientId: this.clientId,
11472
11475
  sessionId: this.sessionId,
11473
11476
  channelId: this.channelId,
@@ -11610,11 +11613,18 @@ var dy = class {
11610
11613
  mseModule: oe,
11611
11614
  unpause: ce,
11612
11615
  canvasModule: T
11613
- }, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (e) => {
11614
- if (e) this.clearInactivityDisconnect(), this.isUserPaused || (this.logger.debug("Unsuspending"), this.unsuspend());
11616
+ }, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("enter picture in picture", () => {
11617
+ var e;
11618
+ return (e = this.modules.decoder) == null ? void 0 : e.setVideoRenderingEnabled(!0);
11619
+ }), this.emitter.on("exit picture in picture", () => {
11620
+ var e;
11621
+ return (e = this.modules.decoder) == null ? void 0 : e.setVideoRenderingEnabled(this.modules.documentState.isVisible);
11622
+ }), this.emitter.on("page active", (e) => {
11623
+ var t;
11624
+ if ((t = this.modules.decoder) == null || t.setVideoRenderingEnabled(this.isVideoOnScreen(e)), e) this.clearInactivityDisconnect(), this.isUserPaused || (this.logger.debug("Unsuspending"), this.unsuspend());
11615
11625
  else if (this.logger.debug("Suspending"), this.suspend(), this.shouldAllowBackgroundPlayback(this.channelId)) {
11616
- var t, n, r;
11617
- (t = this.modules.decoder) == null || t.enableBackgroundTimers(), this.modules.connection.unsuspend(), this.modules.sync.unsuspend(), (n = this.modules.decoder) == null || n.unsuspend(), (r = this.modules.canvasModule) == null || r.unsuspend(), this.scheduleInactivityDisconnect();
11626
+ var n, r, i;
11627
+ (n = this.modules.decoder) == null || n.enableBackgroundTimers(), this.modules.connection.unsuspend(), this.modules.sync.unsuspend(), (r = this.modules.decoder) == null || r.unsuspend(), (i = this.modules.canvasModule) == null || i.unsuspend(), this.scheduleInactivityDisconnect();
11618
11628
  } else this.disconnectForInactivePage(this.isUserPaused ? "Background playback paused" : "Background playback disabled");
11619
11629
  }), this.emitter.on("pageshow", (e) => {
11620
11630
  if (!e.persisted || this.isUserPaused) return;