itube-modern-player 0.4.3 → 0.4.4

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/core.js CHANGED
@@ -21,7 +21,7 @@ function Q(a, t) {
21
21
  l.append(document.createTextNode(n)), e.append(l);
22
22
  }), e;
23
23
  }
24
- function C(a, t, e) {
24
+ function E(a, t, e) {
25
25
  a.innerHTML = t, e !== void 0 && (a.setAttribute("aria-label", e), a.setAttribute("title", e));
26
26
  }
27
27
  function w(a, t, e) {
@@ -416,13 +416,13 @@ class lt {
416
416
  t.clickThrough && (b("click"), this.host.emitter.emit("adclick", { ad: t }), window.open(t.clickThrough, "_blank", "noopener"), n.pause());
417
417
  };
418
418
  n.addEventListener("click", O, { signal: l }), m?.addEventListener("click", O);
419
- let Z = !1, E = !1;
419
+ let Z = !1, C = !1;
420
420
  n.addEventListener("playing", () => {
421
421
  Z = !0;
422
422
  }, { once: !0, signal: l }), n.addEventListener("pause", () => {
423
- n.ended || !s.isConnected || (s.classList.add("imp-ad--paused"), Z && !E && (E = !0, M(t.tracking.pause), this.host.emitter.emit("adpause", { ad: t })));
423
+ n.ended || !s.isConnected || (s.classList.add("imp-ad--paused"), Z && !C && (C = !0, M(t.tracking.pause), this.host.emitter.emit("adpause", { ad: t })));
424
424
  }, { signal: l }), n.addEventListener("play", () => {
425
- s.classList.remove("imp-ad--paused"), E && (E = !1, M(t.tracking.resume), this.host.emitter.emit("adresume", { ad: t }));
425
+ s.classList.remove("imp-ad--paused"), C && (C = !1, M(t.tracking.resume), this.host.emitter.emit("adresume", { ad: t }));
426
426
  }, { signal: l }), s.addEventListener("click", (k) => {
427
427
  (k.target === s || s.classList.contains("imp-ad--paused")) && n.paused && n.play().catch(() => {
428
428
  });
@@ -779,7 +779,7 @@ class ft {
779
779
  t.setVolume(Number(this.volumeSlider.value));
780
780
  }), d.append(this.muteBtn, this.volumeSlider), r.append(d);
781
781
  }
782
- s.time && (this.timeLabel = o("div", "imp-controls__time"), this.liveBadge = o("span", "imp-controls__live"), this.liveBadge.textContent = e.live, this.liveBadge.hidden = !0, r.append(this.timeLabel, this.liveBadge)), this.buildLikeDislike();
782
+ s.time && (this.timeLabel = o("div", "imp-controls__time"), this.timeCurrent = o("span", "imp-controls__time-current"), this.timeTotal = o("span", "imp-controls__time-total"), this.timeLabel.append(this.timeCurrent, this.timeTotal), this.liveBadge = o("span", "imp-controls__live"), this.liveBadge.textContent = e.live, this.liveBadge.hidden = !0, r.append(this.timeLabel, this.liveBadge)), this.buildLikeDislike();
783
783
  for (const d of (t.actionsOptions.custom ?? []).filter((b) => b.placement === "bar")) {
784
784
  const b = g(`imp-btn--custom imp-btn--custom-${d.id}`, d.title, d.icon ?? i.more);
785
785
  b.addEventListener("click", () => t.emit("customaction", { id: d.id })), this.rightItems.set(`custom:${d.id}`, b), this.registerCollapsible({
@@ -1217,7 +1217,7 @@ class ft {
1217
1217
  const t = this.player;
1218
1218
  this.disposers.push(
1219
1219
  t.on("timeupdate", ({ currentTime: e, duration: i }) => {
1220
- this.progress.update(e, i, t.bufferedEnd), this.timeLabel && (t.live ? (this.timeLabel.hidden = !0, this.liveBadge.hidden = !1) : (this.timeLabel.hidden = !1, this.liveBadge.hidden = !0, this.timeLabel.textContent = `${x(e)} / ${x(i)}`));
1220
+ this.progress.update(e, i, t.bufferedEnd), this.timeLabel && (t.live ? (this.timeLabel.hidden = !0, this.liveBadge.hidden = !1) : (this.timeLabel.hidden = !1, this.liveBadge.hidden = !0, this.timeCurrent.textContent = x(e), this.timeTotal.textContent = ` / ${x(i)}`));
1221
1221
  }),
1222
1222
  t.on("play", () => this.syncPlayState()),
1223
1223
  t.on("pause", () => this.syncPlayState()),
@@ -1227,7 +1227,7 @@ class ft {
1227
1227
  this.chapterLabel.textContent = e?.title ?? "";
1228
1228
  }),
1229
1229
  t.on("fullscreenchange", ({ active: e }) => {
1230
- this.fullscreenBtn && C(this.fullscreenBtn, e ? t.icons.fullscreenExit : t.icons.fullscreen, e ? t.labels.exitFullscreen : t.labels.fullscreen), this.scheduleReflow();
1230
+ this.fullscreenBtn && E(this.fullscreenBtn, e ? t.icons.fullscreenExit : t.icons.fullscreen, e ? t.labels.exitFullscreen : t.labels.fullscreen), this.scheduleReflow();
1231
1231
  }),
1232
1232
  t.on("playlistitemchange", () => {
1233
1233
  this.syncPlaylistButtons(), this.scheduleReflow();
@@ -1239,12 +1239,12 @@ class ft {
1239
1239
  }
1240
1240
  syncPlayState() {
1241
1241
  const t = this.player, [e, i] = t.ended ? [t.icons.replay, t.labels.replay] : t.paused ? [t.icons.play, t.labels.play] : [t.icons.pause, t.labels.pause];
1242
- this.playBtn && C(this.playBtn, e, i), this.centerPlayBtn && C(this.centerPlayBtn, e, i);
1242
+ this.playBtn && E(this.playBtn, e, i), this.centerPlayBtn && E(this.centerPlayBtn, e, i);
1243
1243
  }
1244
1244
  syncVolume() {
1245
1245
  if (!this.muteBtn) return;
1246
1246
  const t = this.player, e = t.muted ? 0 : t.volume, i = e === 0 ? t.icons.volumeMute : e < 0.5 ? t.icons.volumeLow : t.icons.volumeHigh;
1247
- C(this.muteBtn, i, t.muted ? t.labels.unmute : t.labels.mute), this.volumeSlider.value = String(e), this.volumeSlider.style.setProperty("--imp-volume-fill", `${e * 100}%`);
1247
+ E(this.muteBtn, i, t.muted ? t.labels.unmute : t.labels.mute), this.volumeSlider.value = String(e), this.volumeSlider.style.setProperty("--imp-volume-fill", `${e * 100}%`);
1248
1248
  }
1249
1249
  /** Called by the player when per-source data (chapters/quality/subtitles) changes. */
1250
1250
  syncFeatureButtons() {
@@ -1537,7 +1537,7 @@ const St = {
1537
1537
  nextPreview: !0,
1538
1538
  hideDelay: 2500
1539
1539
  };
1540
- class Et {
1540
+ class Ct {
1541
1541
  constructor(t, e = {}) {
1542
1542
  this.scrubbing = !1, this.emitter = new J(), this.abort = new AbortController(), this.sources = [], this.currentIndex = -1, this.sourceController = null, this.loadToken = 0, this.chapters = [], this.currentChapter = null, this.sceneGroupList = [], this.activeSceneGroupId = "", this.progressiveQuality = -1, this.thumbTrack = null, this.shuffleMode = !1, this.autoAdvanceEnabled = !0, this.persistKey = null, this.persistVolume = !1, this.persistAutoAdvance = !1, this.decodeRecoveries = 0, this.adManager = null, this.playedOnce = !1, this.idleTimer = null, this.destroyed = !1;
1543
1543
  const i = typeof t == "string" ? document.querySelector(t) : t;
@@ -2060,7 +2060,7 @@ class Et {
2060
2060
  }
2061
2061
  export {
2062
2062
  J as Emitter,
2063
- Et as Player,
2063
+ Ct as Player,
2064
2064
  q as ThumbnailTrack,
2065
2065
  et as buildHeatmapValues,
2066
2066
  j as chapterAt,