@oddin-gg/havik-player 2.25.0 → 2.25.1

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/dist/index.js CHANGED
@@ -309,18 +309,18 @@ function ge(e, t) {
309
309
  }
310
310
  //#endregion
311
311
  //#region src/core/fullscreen.ts
312
- function _e(e) {
312
+ function x(e) {
313
313
  return e.ownerDocument ?? document;
314
314
  }
315
- function ve(e) {
315
+ function _e(e) {
316
316
  return e.fullscreenElement ?? e.webkitFullscreenElement ?? null;
317
317
  }
318
- function ye(e, t) {
319
- let n = ve(_e(e));
318
+ function ve(e, t) {
319
+ let n = _e(x(e));
320
320
  return n != null && (n === e || t != null && n === t) || e.webkitDisplayingFullscreen === !0;
321
321
  }
322
- function x(e, t) {
323
- let n = t ?? e, r = _e(e);
322
+ function ye(e, t) {
323
+ let n = t ?? e, r = x(e);
324
324
  if (typeof n.requestFullscreen == "function") return r.fullscreenEnabled !== !1;
325
325
  if (typeof n.webkitRequestFullscreen == "function") return r.webkitFullscreenEnabled !== !1;
326
326
  let i = e;
@@ -339,7 +339,7 @@ async function C(e, t) {
339
339
  n.webkitExitFullscreen?.();
340
340
  return;
341
341
  }
342
- let r = _e(e), i = ve(r);
342
+ let r = x(e), i = _e(r);
343
343
  i != null && (i === e || t != null && i === t) && (typeof r.exitFullscreen == "function" ? await r.exitFullscreen() : r.webkitExitFullscreen?.());
344
344
  }
345
345
  //#endregion
@@ -1641,6 +1641,7 @@ var Un = class {
1641
1641
  networkRetryTimer = null;
1642
1642
  licenseRetryTimer = null;
1643
1643
  offlineHold = !1;
1644
+ onOffline = null;
1644
1645
  onOnline = null;
1645
1646
  onVisibility = null;
1646
1647
  onSeeking = null;
@@ -1726,14 +1727,16 @@ var Un = class {
1726
1727
  if (typeof t != "number") return;
1727
1728
  let n = typeof e.targetLatency == "number" && e.targetLatency > 0 ? e.targetLatency : 3;
1728
1729
  t - r.currentTime > Math.max(n * 3, 8) && (r.currentTime = t);
1729
- }, document.addEventListener("visibilitychange", this.onVisibility)), typeof window < "u" && (this.onOnline = () => {
1730
- if (this.offlineHold && (this.offlineHold = !1, this.networkRecoveries = 0, this.networkRetryTimer &&= (clearTimeout(this.networkRetryTimer), null), !this.stopped && this.hls)) {
1730
+ }, document.addEventListener("visibilitychange", this.onVisibility)), typeof window < "u" && (this.onOffline = () => {
1731
+ this.offlineHold = !0, this.networkRetryTimer &&= (clearTimeout(this.networkRetryTimer), null), this.lastAdvanceMs = this.lastAdvanceMs ? Date.now() : 0, this.resetStarvationWindow(), this.clearKick();
1732
+ }, this.onOnline = () => {
1733
+ if (this.offlineHold && (this.offlineHold = !1, this.networkRecoveries = 0, this.networkRetryTimer &&= (clearTimeout(this.networkRetryTimer), null), !this.stopped && this.hls && this.loadStarted && !this.loadSuspended)) {
1731
1734
  this.lastAdvanceMs = Date.now(), this.lastFragLoadingMs = 0, this.resetStarvationWindow(), this.resetChaseWindow(), this.clearKick();
1732
1735
  try {
1733
- this.hls.startLoad();
1736
+ this.hls.startLoad(-1);
1734
1737
  } catch {}
1735
1738
  }
1736
- }, window.addEventListener("online", this.onOnline)), this.onSeeking = () => {
1739
+ }, window.addEventListener("offline", this.onOffline), window.addEventListener("online", this.onOnline), R() || this.onOffline()), this.onSeeking = () => {
1737
1740
  this.clampOverSeek(), this.loadSuspended && (this.resumeLoading(), this.schedulePauseSuspend());
1738
1741
  }, r.addEventListener("seeking", this.onSeeking), this.onTimeUpdate = () => this.updateCatchUpBand(), r.addEventListener("timeupdate", this.onTimeUpdate), this.onPause = () => this.schedulePauseSuspend(), this.onPlay = () => this.resumeLoading(), r.addEventListener("pause", this.onPause), r.addEventListener("play", this.onPlay), this.sizeCapManaged && typeof ResizeObserver < "u" && (this.capObserver = new ResizeObserver(() => this.onMediaResize()), this.capObserver.observe(r), this.watchDprChanges());
1739
1742
  }
@@ -2107,7 +2110,7 @@ var Un = class {
2107
2110
  this.lastAdvanceMs = Date.now();
2108
2111
  return;
2109
2112
  }
2110
- if (this.loadSuspended || this.offlineHold) {
2113
+ if (this.loadSuspended || this.offlineHold || !R()) {
2111
2114
  this.lastAdvanceMs = Date.now();
2112
2115
  return;
2113
2116
  }
@@ -2123,7 +2126,7 @@ var Un = class {
2123
2126
  checkStarvation() {
2124
2127
  let e = this.hls, { video: t } = this.deps;
2125
2128
  if (!e || this.endedEmitted || !this.sawLive || this.chaseSuspended) return;
2126
- if (typeof document < "u" && document.hidden || this.loadSuspended || this.offlineHold) {
2129
+ if (typeof document < "u" && document.hidden || this.loadSuspended || this.offlineHold || !R()) {
2127
2130
  this.resetStarvationWindow();
2128
2131
  return;
2129
2132
  }
@@ -2356,7 +2359,7 @@ var Un = class {
2356
2359
  typeof n != "number" || !Number.isFinite(n) || n <= 0 || (this.bwSavedAt = t, Be(n));
2357
2360
  }
2358
2361
  destroy() {
2359
- if (this.maybeRememberBandwidth(!0), this.detachFrames?.(), this.detachFrames = null, this.prefetch?.destroy(), this.prefetch = null, this.clearRecoveryReset(), this.capTimer &&= (clearTimeout(this.capTimer), null), this.capObserver &&= (this.capObserver.disconnect(), null), this.unwatchDprChanges(), this.endWatchdog &&= (clearInterval(this.endWatchdog), null), this.onVisibility && typeof document < "u" && (document.removeEventListener("visibilitychange", this.onVisibility), this.onVisibility = null), this.onOnline && typeof window < "u" && (window.removeEventListener("online", this.onOnline), this.onOnline = null), this.onSeeking &&= (this.deps.video.removeEventListener("seeking", this.onSeeking), null), this.onTimeUpdate &&= (this.deps.video.removeEventListener("timeupdate", this.onTimeUpdate), null), this.onPause &&= (this.deps.video.removeEventListener("pause", this.onPause), null), this.onPlay &&= (this.deps.video.removeEventListener("play", this.onPlay), null), this.pauseSuspendTimer &&= (clearTimeout(this.pauseSuspendTimer), null), this.networkRetryTimer &&= (clearTimeout(this.networkRetryTimer), null), this.licenseRetryTimer &&= (clearTimeout(this.licenseRetryTimer), null), this.hls) {
2362
+ if (this.maybeRememberBandwidth(!0), this.detachFrames?.(), this.detachFrames = null, this.prefetch?.destroy(), this.prefetch = null, this.clearRecoveryReset(), this.capTimer &&= (clearTimeout(this.capTimer), null), this.capObserver &&= (this.capObserver.disconnect(), null), this.unwatchDprChanges(), this.endWatchdog &&= (clearInterval(this.endWatchdog), null), this.onVisibility && typeof document < "u" && (document.removeEventListener("visibilitychange", this.onVisibility), this.onVisibility = null), this.onOffline && typeof window < "u" && (window.removeEventListener("offline", this.onOffline), this.onOffline = null), this.onOnline && typeof window < "u" && (window.removeEventListener("online", this.onOnline), this.onOnline = null), this.onSeeking &&= (this.deps.video.removeEventListener("seeking", this.onSeeking), null), this.onTimeUpdate &&= (this.deps.video.removeEventListener("timeupdate", this.onTimeUpdate), null), this.onPause &&= (this.deps.video.removeEventListener("pause", this.onPause), null), this.onPlay &&= (this.deps.video.removeEventListener("play", this.onPlay), null), this.pauseSuspendTimer &&= (clearTimeout(this.pauseSuspendTimer), null), this.networkRetryTimer &&= (clearTimeout(this.networkRetryTimer), null), this.licenseRetryTimer &&= (clearTimeout(this.licenseRetryTimer), null), this.hls) {
2360
2363
  try {
2361
2364
  this.hls.destroy();
2362
2365
  } catch (e) {
@@ -2923,7 +2926,7 @@ async function fr() {
2923
2926
  }
2924
2927
  //#endregion
2925
2928
  //#region src/core/version.ts
2926
- var pr = "2.25.0", mr = {
2929
+ var pr = "2.25.1", mr = {
2927
2930
  accent: "#E1B600",
2928
2931
  accentText: "#1B1C23",
2929
2932
  background: "#0e0f13",
@@ -3294,14 +3297,14 @@ var Or = class {
3294
3297
  }
3295
3298
  async toggleFullscreen() {
3296
3299
  try {
3297
- ye(this.video, this.root) ? await C(this.video, this.root) : await S(this.video, this.root);
3300
+ ve(this.video, this.root) ? await C(this.video, this.root) : await S(this.video, this.root);
3298
3301
  } catch {}
3299
3302
  }
3300
3303
  syncFullscreenSupport() {
3301
- this.fsSupported = x(this.video, this.root), this.fsBtn.style.display = this.fsSupported ? "" : "none";
3304
+ this.fsSupported = ye(this.video, this.root), this.fsBtn.style.display = this.fsSupported ? "" : "none";
3302
3305
  }
3303
3306
  syncFullscreen() {
3304
- let e = ye(this.video, this.root);
3307
+ let e = ve(this.video, this.root);
3305
3308
  this.setIcon(this.fsBtn, e ? "fullscreenExit" : "fullscreen"), this.fsBtn.setAttribute("aria-label", e ? "Exit fullscreen" : "Fullscreen");
3306
3309
  }
3307
3310
  poke() {
@@ -3993,7 +3996,7 @@ var Gr = class {
3993
3996
  await C(this.opts.video, this.container ?? void 0);
3994
3997
  }
3995
3998
  fullscreenSupported() {
3996
- return !this.destroyed && x(this.opts.video, this.container ?? void 0);
3999
+ return !this.destroyed && ye(this.opts.video, this.container ?? void 0);
3997
4000
  }
3998
4001
  retry() {
3999
4002
  return this.reload();
@@ -4301,6 +4304,6 @@ function $r() {
4301
4304
  e.textContent = "html,body{margin:0;height:100%;background:#000;overflow:hidden}body{display:flex}", document.head.appendChild(e);
4302
4305
  }
4303
4306
  //#endregion
4304
- export { w as LiveStateHttpError, mr as ODDIN_THEME, n as PlaybackError, gr as applyTheme, ct as baseUrlForEnv, Zr as bootEmbed, ke as clearDeviceId, Ve as clearRememberedBandwidth, Wr as createPlayer, E as deriveEventsBaseUrl, it as detectDrmSupport, S as enterVideoFullscreen, C as exitVideoFullscreen, be as fetchCatalog, Se as fetchTournament, we as flattenMatches, x as fullscreenSupported, k as getDeviceId, ot as isLowLatencyManifest, Kr as isOddinMessage, je as licenseRequestHeaders, qr as mountEmbed, fe as pollToLive, y as resolveStream, T as subscribeLiveState, ye as videoFullscreenActive, Ee as watchStatus };
4307
+ export { w as LiveStateHttpError, mr as ODDIN_THEME, n as PlaybackError, gr as applyTheme, ct as baseUrlForEnv, Zr as bootEmbed, ke as clearDeviceId, Ve as clearRememberedBandwidth, Wr as createPlayer, E as deriveEventsBaseUrl, it as detectDrmSupport, S as enterVideoFullscreen, C as exitVideoFullscreen, be as fetchCatalog, Se as fetchTournament, we as flattenMatches, ye as fullscreenSupported, k as getDeviceId, ot as isLowLatencyManifest, Kr as isOddinMessage, je as licenseRequestHeaders, qr as mountEmbed, fe as pollToLive, y as resolveStream, T as subscribeLiveState, ve as videoFullscreenActive, Ee as watchStatus };
4305
4308
 
4306
4309
  //# sourceMappingURL=index.js.map