@oddin-gg/havik-player 2.26.0 → 2.26.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
@@ -3004,7 +3004,7 @@ async function Sr() {
3004
3004
  }
3005
3005
  //#endregion
3006
3006
  //#region src/core/version.ts
3007
- var Cr = "2.26.0", wr = {
3007
+ var Cr = "2.26.1", wr = {
3008
3008
  accent: "#E1B600",
3009
3009
  accentText: "#1B1C23",
3010
3010
  background: "#0e0f13",
@@ -3230,16 +3230,19 @@ var Rr = class {
3230
3230
  let t = e === "loading" || e === "buffering";
3231
3231
  this.spinner.style.display = t && !this.statusBox ? "" : "none", (t || this.statusBox) && this.center.classList.add("havik-gone"), this.syncLive();
3232
3232
  }
3233
+ isGone() {
3234
+ return this.player.state === "error" && this.lastError?.code === "GONE";
3235
+ }
3233
3236
  syncStatus(e) {
3234
3237
  let t = null;
3235
3238
  if (this.statusOverlays) {
3236
- let n = this.player.offline && e !== "ended" && e !== "idle", r = !this.hasPlayed && (e === "paused" || e === "waiting");
3237
- e === "ended" ? t = "ended" : n && !r ? t = "offline" : e === "error" ? t = "error" : e === "waiting" ? t = "waiting" : !this.hasPlayed && (e === "idle" || e === "paused") && (t = "preplay");
3239
+ let n = e === "ended" || this.isGone(), r = this.player.offline && !n && e !== "idle", i = !this.hasPlayed && (e === "paused" || e === "waiting");
3240
+ n ? t = "ended" : r && !i ? t = "offline" : e === "error" ? t = "error" : e === "waiting" ? t = "waiting" : !this.hasPlayed && (e === "idle" || e === "paused") && (t = "preplay");
3238
3241
  }
3239
3242
  this.renderStatus(t);
3240
3243
  }
3241
3244
  statusMessageFor(e) {
3242
- return e === "ended" ? this.player.endedReason === "interrupted" ? this.interruptedMessage : this.endedMessage : e === "offline" ? this.offlineMessage : e === "waiting" ? this.hasPlayed ? "Reconnecting — please stand by" : "Starting soon…" : e === "error" ? this.errorMessage === void 0 ? this.lastError?.code === "GEO_DENIED" ? Fr(this.lastError.country) : this.lastError?.code === "DRM_DEVICE_REVOKED" ? Ir : this.lastError?.message ?? "Playback unavailable" : this.errorMessage : null;
3245
+ return e === "ended" ? this.isGone() ? this.endedMessage : this.player.endedReason === "interrupted" ? this.interruptedMessage : this.endedMessage : e === "offline" ? this.offlineMessage : e === "waiting" ? this.hasPlayed ? "Reconnecting — please stand by" : "Starting soon…" : e === "error" ? this.errorMessage === void 0 ? this.lastError?.code === "GEO_DENIED" ? Fr(this.lastError.country) : this.lastError?.code === "DRM_DEVICE_REVOKED" ? Ir : this.lastError?.message ?? "Playback unavailable" : this.errorMessage : null;
3243
3246
  }
3244
3247
  renderStatus(e) {
3245
3248
  let t = this.statusMessageFor(e);
@@ -3298,8 +3301,8 @@ var Rr = class {
3298
3301
  !this.player.getStats().isLive && Number.isFinite(this.video.duration) && (this.time.textContent = `${zr(this.video.currentTime)} / ${zr(this.video.duration)}`);
3299
3302
  }
3300
3303
  syncLive() {
3301
- let e = this.player.getStats(), t = e.isLive !== !1, n = this.player.state === "ended", r = !t && !this.streamEnded();
3302
- this.live.style.display = t && !n ? "" : "none", this.time.style.display = r ? "" : "none", this.seek.style.display = r ? "" : "none", this.live.classList.toggle("is-live", e.atLiveEdge !== !1 && t);
3304
+ let e = this.player.getStats(), t = e.isLive !== !1, n = this.isGone(), r = this.player.state === "ended" || n, i = !t && !this.streamEnded() && !n;
3305
+ this.live.style.display = t && !r ? "" : "none", this.time.style.display = i ? "" : "none", this.seek.style.display = i ? "" : "none", this.live.classList.toggle("is-live", e.atLiveEdge !== !1 && t);
3303
3306
  }
3304
3307
  onSeekDown(e) {
3305
3308
  let t = this.seekableRange();