@grizzshutsdown/simpleplayer 0.1.7 → 0.1.8

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/README.md CHANGED
@@ -97,7 +97,7 @@ declare module 'react' {
97
97
  - `src`: video URL.
98
98
  - `aspect-ratio`: player aspect ratio. Default: `16 / 9`.
99
99
  - `preload-margin`: lazy-load margin before the video enters view. Default: `360px 0px`.
100
- - `controls`: add a controls tray with volume, Picture-in-Picture, and fullscreen buttons.
100
+ - `controls`: add a controls tray with volume, Picture-in-Picture, and fullscreen buttons. The volume control automatically disables itself if the video has no audio track.
101
101
  - `disable-autoplay`: turn off default autoplay. Autoplay starts muted so browsers allow it.
102
102
  - `show-time`: dual-mode timestamp. When used with `controls`, shows a pinned glass timestamp tray in the bottom-left alongside the controls tray. When used without `controls`, shows a hover tooltip above the scrubber as you drag or hover it. Clicking the timestamp toggles between elapsed and remaining time.
103
103
 
@@ -861,7 +861,7 @@ const C = `
861
861
  position: relative;
862
862
  right: auto;
863
863
  bottom: auto;
864
- width: calc(var(--sp-tray-time-width, 40px) + (var(--sp-control-tray-padding) * 2));
864
+ width: calc(var(--sp-tray-time-width, max-content) + (var(--sp-control-tray-padding) * 2));
865
865
  height: calc(var(--sp-control-slot-size) + (var(--sp-control-tray-padding) * 2));
866
866
  transition: width 240ms cubic-bezier(0.23, 1, 0.32, 1);
867
867
  overflow: hidden;
@@ -1135,12 +1135,12 @@ class A extends HTMLElement {
1135
1135
  #V;
1136
1136
  #j;
1137
1137
  #oe;
1138
- #m;
1138
+ #c;
1139
1139
  #ss;
1140
1140
  #Es;
1141
1141
  #o;
1142
1142
  #z;
1143
- #p;
1143
+ #d;
1144
1144
  #O;
1145
1145
  #Z;
1146
1146
  #K = [];
@@ -1293,7 +1293,7 @@ class A extends HTMLElement {
1293
1293
  this.#us("fullscreen", t);
1294
1294
  }
1295
1295
  connectedCallback() {
1296
- this.#s = this.#r.querySelector("[data-sp-player]"), this.#t = this.#r.querySelector("[data-sp-video]"), this.#M = this.#r.querySelector("[data-sp-button]"), this.#i = this.#r.querySelector("[data-sp-progress-track]"), this.#V = this.#r.querySelector("[data-sp-control-tray]"), this.#j = this.#r.querySelector("[data-sp-control-tray-slots]"), this.#oe = this.#r.querySelector("[data-sp-tray-time]"), this.#m = this.#r.querySelector("[data-sp-tray-time-text]"), this.#ss = this.#r.querySelector("[data-sp-time]"), this.#Es = this.#r.querySelector("[data-sp-time-text]"), this.#o = this.#r.querySelector("[data-sp-volume-control]"), this.#z = this.#r.querySelector("[data-sp-volume-popover]"), this.#p = this.#r.querySelector("[data-sp-volume-track]"), this.#O = this.#r.querySelector("[data-sp-picture-in-picture-control]"), this.#Z = this.#r.querySelector("[data-sp-fullscreen-control]"), this.#K = [this.#o, this.#O, this.#Z], this.#Ms(), this.#ts || (this.#ge(), this.#ts = !0), this.#Bt(), this.#ms(), this.#ps(), this.#ds(), this.#w(), this.#y(), this.#Tt(), this.#Qt(), this.#u();
1296
+ this.#s = this.#r.querySelector("[data-sp-player]"), this.#t = this.#r.querySelector("[data-sp-video]"), this.#M = this.#r.querySelector("[data-sp-button]"), this.#i = this.#r.querySelector("[data-sp-progress-track]"), this.#V = this.#r.querySelector("[data-sp-control-tray]"), this.#j = this.#r.querySelector("[data-sp-control-tray-slots]"), this.#oe = this.#r.querySelector("[data-sp-tray-time]"), this.#c = this.#r.querySelector("[data-sp-tray-time-text]"), this.#ss = this.#r.querySelector("[data-sp-time]"), this.#Es = this.#r.querySelector("[data-sp-time-text]"), this.#o = this.#r.querySelector("[data-sp-volume-control]"), this.#z = this.#r.querySelector("[data-sp-volume-popover]"), this.#d = this.#r.querySelector("[data-sp-volume-track]"), this.#O = this.#r.querySelector("[data-sp-picture-in-picture-control]"), this.#Z = this.#r.querySelector("[data-sp-fullscreen-control]"), this.#K = [this.#o, this.#O, this.#Z], this.#Ms(), this.#ts || (this.#ge(), this.#ts = !0), this.#Bt(), this.#ms(), this.#ps(), this.#ds(), this.#w(), this.#y(), this.#Tt(), this.#Qt(), this.#p();
1297
1297
  }
1298
1298
  disconnectedCallback() {
1299
1299
  this.#E?.disconnect(), this.#E = null, this.#At.forEach((t) => t()), this.#At = [], this.#ts = !1, this.#P(), this.#$s(), this.#Ot(), this.#gs(), this.#rt(), this.#Zt(), this.#Ct(), this.#Us(), this.#vs(), this.#s.classList.remove("is-volume-icon-animating"), this.#j.style.removeProperty("--sp-control-hover-offset"), this.style.removeProperty("--sp-touch-control-hover-offset"), this.#xt(), this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#F = !1, this.#N = !1, this.#U = !1, this.#n = null, this.#o.classList.remove("is-volume-open"), this.#K.forEach((t) => t.classList.remove("is-control-tap-active")), this.#s.classList.remove("is-pointer-active"), this.#kt();
@@ -1313,7 +1313,7 @@ class A extends HTMLElement {
1313
1313
  return;
1314
1314
  }
1315
1315
  if ((t === "disable-autoplay" || t === "no-autoplay") && this.isConnected) {
1316
- this.#Bt(), this.#y(), this.#u();
1316
+ this.#Bt(), this.#y(), this.#p();
1317
1317
  return;
1318
1318
  }
1319
1319
  if (t === "show-time" && this.isConnected) {
@@ -1368,17 +1368,20 @@ class A extends HTMLElement {
1368
1368
  this.#s && (this.#s.classList.toggle("has-pinned-time", this.#bt), this.#bt && this.#wt());
1369
1369
  }
1370
1370
  #ge() {
1371
- this.#e(this.#M, "click", this.#_e), this.#e(this, "pointerenter", this.#_t), this.#e(this, "pointermove", this.#Wt), this.#e(this, "pointerleave", this.#jt), this.#e(this, "mouseenter", this.#_t), this.#e(this, "mousemove", this.#Wt), this.#e(this, "mouseleave", this.#jt), this.#e(this.#s, "pointerenter", this.#_t), this.#e(this.#s, "pointermove", this.#Wt), this.#e(this.#s, "pointerleave", this.#jt), this.#e(this.#s, "mouseenter", this.#_t), this.#e(this.#s, "mousemove", this.#Wt), this.#e(this.#s, "mouseleave", this.#jt), this.#e(this.#M, "pointerenter", this.#et), this.#e(this.#M, "pointerleave", this.#it), this.#e(this.#M, "mouseenter", this.#et), this.#e(this.#M, "mouseleave", this.#it), this.#e(this.#i, "pointerenter", this.#et), this.#e(this.#i, "pointerleave", this.#it), this.#e(this.#i, "mouseenter", this.#et), this.#e(this.#i, "mouseleave", this.#it), this.#e(this.#i, "pointerenter", this.#ie), this.#e(this.#i, "pointerleave", this.#re), this.#e(this.#i, "mouseenter", this.#ie), this.#e(this.#i, "mouseleave", this.#re), this.#e(this.#V, "pointerenter", this.#et), this.#e(this.#V, "pointerleave", this.#it), this.#e(this.#V, "mouseenter", this.#et), this.#e(this.#V, "mouseleave", this.#it), this.#e(this.#r, "focusin", this.#Hs), this.#e(this.#r, "focusout", this.#xe), this.#e(this.#s, "pointerdown", this.#We), this.#e(this.#s, "dragstart", this.#Ut), this.#e(this.#s, "selectstart", this.#Ut), this.#e(this.#t, "dragstart", this.#Ut), this.#e(this.#t, "selectstart", this.#Ut), this.#e(this.#i, "pointerdown", this.#ei), this.#e(this.#i, "pointermove", this.#ri), this.#e(this.#i, "pointerup", this.#oi), this.#e(this.#i, "pointercancel", this.#ni), this.#e(this.#i, "keydown", this.#ii), this.#e(this.#o, "pointerenter", this.#se), this.#e(this.#o, "pointerleave", this.#ee), this.#e(this.#o, "click", this.#Oe), this.#e(this.#z, "pointerenter", this.#se), this.#e(this.#z, "pointerleave", this.#ee), this.#e(this.#p, "pointerdown", this.#Ze), this.#e(this.#p, "pointermove", this.#Ke), this.#e(this.#p, "pointerup", this.#Ge), this.#e(this.#p, "pointercancel", this.#Je), this.#e(this.#p, "click", this.#je), this.#e(this.#p, "keydown", this.#Qe), this.#e(this.#O, "click", this.#ti), this.#e(this.#Z, "click", this.#si), this.#e(this.#m, "click", this.#Xe);
1371
+ this.#e(this.#M, "click", this.#_e), this.#e(this, "pointerenter", this.#_t), this.#e(this, "pointermove", this.#Wt), this.#e(this, "pointerleave", this.#jt), this.#e(this, "mouseenter", this.#_t), this.#e(this, "mousemove", this.#Wt), this.#e(this, "mouseleave", this.#jt), this.#e(this.#s, "pointerenter", this.#_t), this.#e(this.#s, "pointermove", this.#Wt), this.#e(this.#s, "pointerleave", this.#jt), this.#e(this.#s, "mouseenter", this.#_t), this.#e(this.#s, "mousemove", this.#Wt), this.#e(this.#s, "mouseleave", this.#jt), this.#e(this.#M, "pointerenter", this.#et), this.#e(this.#M, "pointerleave", this.#it), this.#e(this.#M, "mouseenter", this.#et), this.#e(this.#M, "mouseleave", this.#it), this.#e(this.#i, "pointerenter", this.#et), this.#e(this.#i, "pointerleave", this.#it), this.#e(this.#i, "mouseenter", this.#et), this.#e(this.#i, "mouseleave", this.#it), this.#e(this.#i, "pointerenter", this.#ie), this.#e(this.#i, "pointerleave", this.#re), this.#e(this.#i, "mouseenter", this.#ie), this.#e(this.#i, "mouseleave", this.#re), this.#e(this.#V, "pointerenter", this.#et), this.#e(this.#V, "pointerleave", this.#it), this.#e(this.#V, "mouseenter", this.#et), this.#e(this.#V, "mouseleave", this.#it), this.#e(this.#r, "focusin", this.#Hs), this.#e(this.#r, "focusout", this.#xe), this.#e(this.#s, "pointerdown", this.#We), this.#e(this.#s, "dragstart", this.#Ut), this.#e(this.#s, "selectstart", this.#Ut), this.#e(this.#t, "dragstart", this.#Ut), this.#e(this.#t, "selectstart", this.#Ut), this.#e(this.#i, "pointerdown", this.#ei), this.#e(this.#i, "pointermove", this.#ri), this.#e(this.#i, "pointerup", this.#oi), this.#e(this.#i, "pointercancel", this.#ni), this.#e(this.#i, "keydown", this.#ii), this.#e(this.#o, "pointerenter", this.#se), this.#e(this.#o, "pointerleave", this.#ee), this.#e(this.#o, "click", this.#Oe), this.#e(this.#z, "pointerenter", this.#se), this.#e(this.#z, "pointerleave", this.#ee), this.#e(this.#d, "pointerdown", this.#Ze), this.#e(this.#d, "pointermove", this.#Ke), this.#e(this.#d, "pointerup", this.#Ge), this.#e(this.#d, "pointercancel", this.#Je), this.#e(this.#d, "click", this.#je), this.#e(this.#d, "keydown", this.#Qe), this.#e(this.#O, "click", this.#ti), this.#e(this.#Z, "click", this.#si), this.#e(this.#c, "click", this.#Xe);
1372
1372
  for (const t of this.#K)
1373
1373
  this.#e(t, "pointerenter", this.#qs), this.#e(t, "mouseenter", this.#qs), this.#e(t, "pointerdown", this.#ke);
1374
1374
  "ResizeObserver" in window && (this.#Mt = new ResizeObserver(() => {
1375
1375
  this.#$t();
1376
- }), this.#Mt.observe(this.#m), this.#At.push(() => {
1376
+ }), this.#Mt.observe(this.#c), this.#At.push(() => {
1377
1377
  this.#Mt?.disconnect(), this.#Mt = null;
1378
1378
  })), this.#e(document, "pointerup", this.#ai), this.#e(document, "pointercancel", this.#li), this.#e(document, "pointermove", this.#Ds), this.#e(document, "mousemove", this.#Ds), this.#e(document, "fullscreenchange", this.#Et), this.#e(document, "webkitfullscreenchange", this.#Et), this.#e(document, "mozfullscreenchange", this.#Et), this.#e(document, "MSFullscreenChange", this.#Et), this.#e(this.#r, "fullscreenchange", this.#Et), this.#e(window, "blur", this.#hi), this.#e(window, "focus", this.#ci), this.#e(this.#t, "play", this.#ui), this.#e(this.#t, "pause", this.#pi), this.#e(this.#t, "ended", this.#di), this.#e(this.#t, "loadstart", this.#mi), this.#e(this.#t, "waiting", this.#Ts), this.#e(this.#t, "stalled", this.#Ts), this.#e(this.#t, "seeking", this.#Ts), this.#e(this.#t, "loadeddata", this.#Kt), this.#e(this.#t, "loadedmetadata", this.#fi), this.#e(this.#t, "canplay", this.#Kt), this.#e(this.#t, "canplaythrough", this.#Kt), this.#e(this.#t, "playing", this.#bi), this.#e(this.#t, "seeked", this.#vi), this.#e(this.#t, "error", this.#gi), this.#e(this.#t, "progress", this.#w), this.#e(this.#t, "suspend", this.#w), this.#e(this.#t, "timeupdate", this.#yi), this.#e(this.#t, "volumechange", this.#wi), this.#e(this.#t, "enterpictureinpicture", this.#Tt), this.#e(this.#t, "leavepictureinpicture", this.#Tt);
1379
1379
  }
1380
1380
  #$t() {
1381
- !this.#s || !this.#m || this.#s.style.setProperty("--sp-tray-time-width", `${Math.ceil(this.#m.scrollWidth)}px`);
1381
+ if (!this.#s || !this.#c) return;
1382
+ this.#c.style.width = "fit-content";
1383
+ const t = Math.ceil(this.#c.scrollWidth);
1384
+ this.#c.style.width = "", this.#s.style.setProperty("--sp-tray-time-width", `${t}px`);
1382
1385
  }
1383
1386
  #e(t, s, e) {
1384
1387
  t.addEventListener(s, e), this.#At.push(() => t.removeEventListener(s, e));
@@ -1402,26 +1405,26 @@ class A extends HTMLElement {
1402
1405
  }
1403
1406
  #ye = () => {
1404
1407
  if (this.#at = 0, !(this.#x || this.#a || this.#F)) {
1405
- if (this.#d()) {
1408
+ if (this.#m()) {
1406
1409
  this.#s.classList.remove("is-controls-visible");
1407
1410
  return;
1408
1411
  }
1409
1412
  this.#U || this.#s.classList.remove("is-pointer-active");
1410
1413
  }
1411
1414
  };
1412
- #Nt(t = this.#d() ? this.#Ss : this.#Ht) {
1415
+ #Nt(t = this.#m() ? this.#Ss : this.#Ht) {
1413
1416
  this.#P(), this.#at = window.setTimeout(this.#ye, t);
1414
1417
  }
1415
1418
  #R() {
1416
- this.#d() && this.#Nt(this.#Ss);
1419
+ this.#m() && this.#Nt(this.#Ss);
1417
1420
  }
1418
1421
  #D() {
1419
- if (!this.#d()) return !1;
1422
+ if (!this.#m()) return !1;
1420
1423
  const t = this.#s.classList.contains("is-controls-visible");
1421
1424
  return this.#s.classList.add("is-controls-visible"), this.#R(), !t;
1422
1425
  }
1423
1426
  #fs(t = !1) {
1424
- !t && this.#d() || (this.#s.classList.add("is-pointer-active"), this.#U ? this.#P() : this.#Nt(t ? this.#Ht : void 0));
1427
+ !t && this.#m() || (this.#s.classList.add("is-pointer-active"), this.#U ? this.#P() : this.#Nt(t ? this.#Ht : void 0));
1425
1428
  }
1426
1429
  #Yt() {
1427
1430
  this.#U = !1, this.#P(), this.#s.classList.remove("is-pointer-active");
@@ -1443,8 +1446,8 @@ class A extends HTMLElement {
1443
1446
  this.#v && (this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#xt(), this.#wt());
1444
1447
  }
1445
1448
  #Is(t, s) {
1446
- if (this.#d()) return;
1447
- !this.#c() && this.#Vs(this.#i, t, s) ? (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t, !1, !1)) : this.#c() || this.#zs();
1449
+ if (this.#m()) return;
1450
+ !this.#u() && this.#Vs(this.#i, t, s) ? (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t, !1, !1)) : this.#u() || this.#zs();
1448
1451
  const e = this.#K.find((r) => !r.hidden && !this.#bs(r) && this.#Vs(r, t, s)) ?? null;
1449
1452
  if (!e) return;
1450
1453
  const i = Number(e.dataset.spControlIndex ?? 0);
@@ -1454,7 +1457,7 @@ class A extends HTMLElement {
1454
1457
  return this.#s.classList.contains("is-controls-visible") || this.#s.classList.contains("is-pointer-active") || this.#r.activeElement instanceof HTMLElement;
1455
1458
  }
1456
1459
  #Xt() {
1457
- return this.#d() && performance.now() < this.#rs;
1460
+ return this.#m() && performance.now() < this.#rs;
1458
1461
  }
1459
1462
  #bs(t) {
1460
1463
  return t instanceof HTMLButtonElement && (t.disabled || t === this.#o && !this.#T());
@@ -1485,7 +1488,7 @@ class A extends HTMLElement {
1485
1488
  this.#U = !1, this.#Nt(this.#Ht);
1486
1489
  };
1487
1490
  #Hs = () => {
1488
- this.#d() ? this.#s.classList.add("is-controls-visible") : this.#s.classList.add("is-pointer-active"), this.#P();
1491
+ this.#m() ? this.#s.classList.add("is-controls-visible") : this.#s.classList.add("is-pointer-active"), this.#P();
1489
1492
  };
1490
1493
  #xe = () => {
1491
1494
  this.#Nt(this.#Ht);
@@ -1535,7 +1538,7 @@ class A extends HTMLElement {
1535
1538
  this.#s.classList.remove("is-progress-settling");
1536
1539
  return;
1537
1540
  }
1538
- this.#ht = !0, this.#As = performance.now() + this.#pe, this.#c() || this.#l(), this.#g(), this.#s.classList.remove("is-progress-settling"), this.#u();
1541
+ this.#ht = !0, this.#As = performance.now() + this.#pe, this.#u() || this.#l(), this.#g(), this.#s.classList.remove("is-progress-settling"), this.#p();
1539
1542
  }
1540
1543
  };
1541
1544
  #Te() {
@@ -1600,7 +1603,7 @@ class A extends HTMLElement {
1600
1603
  #Ce() {
1601
1604
  return this.#C && !this.#t.error && this.#A && (this.#t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA || this.#t.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && !this.#s.classList.contains("is-loading"));
1602
1605
  }
1603
- #c() {
1606
+ #u() {
1604
1607
  return this.#x || this.#a || this.#I;
1605
1608
  }
1606
1609
  #Ae() {
@@ -1612,7 +1615,7 @@ class A extends HTMLElement {
1612
1615
  return this.#I ? (this.#I = !1, this.#nt = !1, this.#l(), this.#g(), !0) : !1;
1613
1616
  }
1614
1617
  #Ws() {
1615
- return this.#Ot(), !this.#s.classList.contains("has-loaded-once") && this.#Te(), this.#s.classList.add("has-loaded-once"), this.#s.classList.add("has-visible-frame"), this.#w(), this.#b = null, this.#I ? (this.#_s(), !0) : (this.#c() || this.#l(), this.#g(), !0);
1618
+ return this.#Ot(), !this.#s.classList.contains("has-loaded-once") && this.#Te(), this.#s.classList.add("has-loaded-once"), this.#s.classList.add("has-visible-frame"), this.#w(), this.#b = null, this.#I ? (this.#_s(), !0) : (this.#u() || this.#l(), this.#g(), !0);
1616
1619
  }
1617
1620
  #Le() {
1618
1621
  if (this.#A || this.#q || this.#t.error) return;
@@ -1623,9 +1626,9 @@ class A extends HTMLElement {
1623
1626
  if (this.#B || this.#L) return;
1624
1627
  this.#B = !0, window.requestAnimationFrame(() => {
1625
1628
  window.requestAnimationFrame(() => {
1626
- t === this.#$ && (this.#B = !1, this.#L = !0, this.#Ws(), this.#u());
1629
+ t === this.#$ && (this.#B = !1, this.#L = !0, this.#Ws(), this.#p());
1627
1630
  });
1628
- }), this.#u();
1631
+ }), this.#p();
1629
1632
  return;
1630
1633
  }
1631
1634
  this.#w();
@@ -1675,7 +1678,7 @@ class A extends HTMLElement {
1675
1678
  }
1676
1679
  #X() {
1677
1680
  if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime || 0;
1678
- if (this.#c()) return this.#f;
1681
+ if (this.#u()) return this.#f;
1679
1682
  if (this.#k !== null) return this.#k;
1680
1683
  if (!this.#js()) return this.#t.currentTime || 0;
1681
1684
  if (this.#zt || !this.#ht || performance.now() < this.#As)
@@ -1721,7 +1724,7 @@ class A extends HTMLElement {
1721
1724
  } : { percent: e, targetTime: r };
1722
1725
  }
1723
1726
  #wt(t = this.#X()) {
1724
- !this.#bt || this.#v || this.#c() || (this.#m.textContent = this.#ks(t), this.#$t());
1727
+ !this.#bt || this.#v || this.#u() || (this.#c.textContent = this.#ks(t), this.#$t());
1725
1728
  }
1726
1729
  #g(t = this.#X()) {
1727
1730
  const s = Number.isFinite(this.#t.duration) && this.#t.duration > 0;
@@ -1742,7 +1745,7 @@ class A extends HTMLElement {
1742
1745
  #W(t, s = this.#a, e = !0) {
1743
1746
  if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime;
1744
1747
  const i = this.#i.getBoundingClientRect(), r = this.#Ve(t, i), n = this.#Ie(t, i, r, s);
1745
- return e && this.#_(n.percent), this.#bt || this.#s.style.setProperty("--sp-scrub-preview-left", `${this.#Gt(n.percent, i)}px`), this.#Es.textContent = a(n.targetTime), this.#m.textContent = this.#ks(n.targetTime), this.#$t(), e && (this.#i.setAttribute("aria-valuenow", `${n.targetTime}`), this.#i.setAttribute(
1748
+ return e && this.#_(n.percent), this.#bt || this.#s.style.setProperty("--sp-scrub-preview-left", `${this.#Gt(n.percent, i)}px`), this.#Es.textContent = a(n.targetTime), this.#c.textContent = this.#ks(n.targetTime), this.#$t(), e && (this.#i.setAttribute("aria-valuenow", `${n.targetTime}`), this.#i.setAttribute(
1746
1749
  "aria-valuetext",
1747
1750
  `${a(n.targetTime)} of ${a(this.#t.duration)}`
1748
1751
  )), this.#Re(), n.targetTime;
@@ -1768,7 +1771,7 @@ class A extends HTMLElement {
1768
1771
  };
1769
1772
  this.#ot = window.requestAnimationFrame(t);
1770
1773
  }
1771
- #u() {
1774
+ #p() {
1772
1775
  const t = !this.#t.paused && (!this.#t.ended || this.#t.loop) || this.#a && this.#G, s = this.#b ? this.#b === "playing" : t;
1773
1776
  if (this.#s.classList.toggle("is-playing", s), this.#M.setAttribute("aria-label", s ? "Pause video" : "Play video"), this.#a) {
1774
1777
  this.#kt();
@@ -1801,18 +1804,18 @@ class A extends HTMLElement {
1801
1804
  this.#as && this.#as !== n && this.#Pe(), this.#as = n, this.#s.classList.toggle("is-volume-unavailable", !s), this.#s.classList.toggle("is-volume-muted", e), this.#s.classList.toggle("is-volume-sound", !e), this.#s.style.setProperty("--sp-volume-level", `${r}%`), this.#o.disabled = !s, this.#o.setAttribute("aria-disabled", `${!s}`), this.#o.setAttribute(
1802
1805
  "aria-label",
1803
1806
  s ? e ? "Unmute video" : "Mute video" : "Video has no audio"
1804
- ), this.#p.setAttribute("aria-valuenow", `${r}`), this.#p.setAttribute("aria-valuetext", `${r}%`), s || this.#S(), t === s && this.#ps();
1807
+ ), this.#d.setAttribute("aria-valuenow", `${r}`), this.#d.setAttribute("aria-valuetext", `${r}%`), s || this.#S(), t === s && this.#ps();
1805
1808
  };
1806
1809
  #Zs(t) {
1807
1810
  if (!this.#T()) return;
1808
- const s = this.#p.getBoundingClientRect(), e = Math.min(1, Math.max(0, 1 - (t - s.top) / s.height)), i = Math.round(e * 100) / 100;
1811
+ const s = this.#d.getBoundingClientRect(), e = Math.min(1, Math.max(0, 1 - (t - s.top) / s.height)), i = Math.round(e * 100) / 100;
1809
1812
  this.#t.volume = i, this.#t.muted = i <= 0, this.#y();
1810
1813
  }
1811
1814
  #Jt(t) {
1812
- t !== null && this.#p.hasPointerCapture(t) && this.#p.releasePointerCapture(t);
1815
+ t !== null && this.#d.hasPointerCapture(t) && this.#d.releasePointerCapture(t);
1813
1816
  }
1814
1817
  #Pt(t) {
1815
- this.#F = !1, this.#n = null, this.#z.classList.remove("is-scrubbing-volume"), this.#p.blur(), this.#Jt(t), this.#te(260);
1818
+ this.#F = !1, this.#n = null, this.#z.classList.remove("is-scrubbing-volume"), this.#d.blur(), this.#Jt(t), this.#te(260);
1816
1819
  }
1817
1820
  #Tt = () => {
1818
1821
  const t = document.pictureInPictureElement === this.#t, s = this.#t, e = !!(this.pictureInPictureEnabled && document.pictureInPictureEnabled && s.requestPictureInPicture);
@@ -1847,7 +1850,7 @@ class A extends HTMLElement {
1847
1850
  s instanceof HTMLElement && s.blur(), t ? this.#Rs() : this.#Yt();
1848
1851
  }
1849
1852
  #Gs = () => {
1850
- !this.#x || this.#a || (this.#H(), this.#P(), this.#rt(), this.#a = !0, this.#s.classList.add("is-scrubbing"), this.#f = this.#W(this.#es, !0), this.#G && this.#t.pause(), this.#t.currentTime = this.#f, this.#l(this.#f), this.#g(this.#f), this.#kt(), this.#u());
1853
+ !this.#x || this.#a || (this.#H(), this.#P(), this.#rt(), this.#a = !0, this.#s.classList.add("is-scrubbing"), this.#f = this.#W(this.#es, !0), this.#G && this.#t.pause(), this.#t.currentTime = this.#f, this.#l(this.#f), this.#g(this.#f), this.#kt(), this.#p());
1851
1854
  };
1852
1855
  #ws(t) {
1853
1856
  t !== null && this.#i.hasPointerCapture(t) && this.#i.releasePointerCapture(t);
@@ -1869,20 +1872,20 @@ class A extends HTMLElement {
1869
1872
  this.#ft && (window.clearTimeout(this.#ft), this.#ft = 0);
1870
1873
  }
1871
1874
  #Ye() {
1872
- this.#Ne(), this.#m.classList.remove("is-time-animating"), this.#m.offsetWidth, this.#m.classList.add("is-time-animating"), this.#ft = window.setTimeout(() => {
1873
- this.#ft = 0, this.#m.classList.remove("is-time-animating");
1875
+ this.#Ne(), this.#c.classList.remove("is-time-animating"), this.#c.offsetWidth, this.#c.classList.add("is-time-animating"), this.#ft = window.setTimeout(() => {
1876
+ this.#ft = 0, this.#c.classList.remove("is-time-animating");
1874
1877
  }, 240);
1875
1878
  }
1876
1879
  #Xe = (t) => {
1877
- t.stopPropagation(), this.#ls = !this.#ls, this.#Ye(), this.#c() || this.#v ? this.#m && (this.#m.textContent = this.#ks(this.#f), this.#$t()) : this.#wt(this.#X());
1880
+ t.stopPropagation(), this.#ls = !this.#ls, this.#Ye(), this.#u() || this.#v ? this.#c && (this.#c.textContent = this.#ks(this.#f), this.#$t()) : this.#wt(this.#X());
1878
1881
  };
1879
1882
  #_e = async () => {
1880
1883
  if (performance.now() < this.#Cs)
1881
1884
  return;
1882
1885
  const t = this.#b ? this.#b !== "playing" : this.#t.paused || this.#t.ended, s = !t || this.#Ce();
1883
- this.#D(), s && (this.#b = t ? "playing" : "paused", this.#u()), t ? (this.#H(), await this.#Y(), await this.#t.play().catch(() => {
1886
+ this.#D(), s && (this.#b = t ? "playing" : "paused", this.#p()), t ? (this.#H(), await this.#Y(), await this.#t.play().catch(() => {
1884
1887
  this.#b = null;
1885
- })) : (this.#Fe(), this.#t.pause()), this.#u(), this.#R();
1888
+ })) : (this.#Fe(), this.#t.pause()), this.#p(), this.#R();
1886
1889
  };
1887
1890
  #We = (t) => {
1888
1891
  if (!(t instanceof PointerEvent)) return;
@@ -1909,7 +1912,7 @@ class A extends HTMLElement {
1909
1912
  this.#Ct(), this.#pt = window.setTimeout(this.#Ps, t);
1910
1913
  }
1911
1914
  #se = () => {
1912
- if (!this.#d()) {
1915
+ if (!this.#m()) {
1913
1916
  if (!this.#T() || !this.volumeSliderEnabled) {
1914
1917
  this.#S();
1915
1918
  return;
@@ -1918,7 +1921,7 @@ class A extends HTMLElement {
1918
1921
  }
1919
1922
  };
1920
1923
  #ee = () => {
1921
- if (!this.#d()) {
1924
+ if (!this.#m()) {
1922
1925
  if (!this.#T() || !this.volumeSliderEnabled) {
1923
1926
  this.#S();
1924
1927
  return;
@@ -1935,11 +1938,11 @@ class A extends HTMLElement {
1935
1938
  };
1936
1939
  #Ze = (t) => {
1937
1940
  if (t instanceof PointerEvent) {
1938
- if (t.preventDefault(), t.stopPropagation(), !this.#T() || !this.volumeSliderEnabled || this.#d()) {
1941
+ if (t.preventDefault(), t.stopPropagation(), !this.#T() || !this.volumeSliderEnabled || this.#m()) {
1939
1942
  this.#S();
1940
1943
  return;
1941
1944
  }
1942
- this.#D(), this.#P(), this.#Qs(), this.#F = !0, this.#n = t.pointerId, this.#z.classList.add("is-scrubbing-volume"), this.#p.setPointerCapture(t.pointerId), this.#Zs(t.clientY);
1945
+ this.#D(), this.#P(), this.#Qs(), this.#F = !0, this.#n = t.pointerId, this.#z.classList.add("is-scrubbing-volume"), this.#d.setPointerCapture(t.pointerId), this.#Zs(t.clientY);
1943
1946
  }
1944
1947
  };
1945
1948
  #Ke = (t) => {
@@ -1987,15 +1990,15 @@ class A extends HTMLElement {
1987
1990
  }
1988
1991
  };
1989
1992
  #ie = (t) => {
1990
- this.#d() || this.#c() || !(t instanceof PointerEvent) && !(t instanceof MouseEvent) || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
1993
+ this.#m() || this.#u() || !(t instanceof PointerEvent) && !(t instanceof MouseEvent) || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
1991
1994
  };
1992
1995
  #re = () => {
1993
- this.#c() || this.#zs();
1996
+ this.#u() || this.#zs();
1994
1997
  };
1995
1998
  #ei = (t) => {
1996
1999
  if (t instanceof PointerEvent) {
1997
2000
  if (t.preventDefault(), !this.#gt() || this.#Xt()) {
1998
- this.#D(), this.#d() && (this.#rs = performance.now() + 260);
2001
+ this.#D(), this.#m() && (this.#rs = performance.now() + 260);
1999
2002
  return;
2000
2003
  }
2001
2004
  this.#D(), this.#P(), this.#Ns(), this.#I = !1, this.#nt = !1, this.#ze(this.#X()), this.#x = !0, this.#h = t.pointerId, this.#es = t.clientX, this.#G = !this.#t.paused && !this.#t.ended, this.#i.setPointerCapture(t.pointerId), this.#f = this.#W(t.clientX, !1), this.#rt(), this.#St = window.setTimeout(this.#Gs, this.#he);
@@ -2010,7 +2013,7 @@ class A extends HTMLElement {
2010
2013
  #ri = (t) => {
2011
2014
  if (t instanceof PointerEvent) {
2012
2015
  if (!this.#x) {
2013
- this.#d() || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
2016
+ this.#m() || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
2014
2017
  return;
2015
2018
  }
2016
2019
  this.#h !== null && t.pointerId !== this.#h || (!this.#a && Math.abs(t.clientX - this.#es) >= this.#ne && this.#Gs(), this.#a && (this.#f = this.#W(t.clientX)));
@@ -2047,13 +2050,13 @@ class A extends HTMLElement {
2047
2050
  this.#ys() || this.#Yt();
2048
2051
  };
2049
2052
  #ui = () => {
2050
- this.#b = null, this.#H(), this.#c() || this.#l(), this.#u();
2053
+ this.#b = null, this.#H(), this.#u() || this.#l(), this.#p();
2051
2054
  };
2052
2055
  #pi = () => {
2053
- this.#b = null, this.#c() || this.#Os(), this.#w(), this.#u();
2056
+ this.#b = null, this.#u() || this.#Os(), this.#w(), this.#p();
2054
2057
  };
2055
2058
  #di = () => {
2056
- this.#b = null, this.#H(), this.#c() || this.#l(), this.#u();
2059
+ this.#b = null, this.#H(), this.#u() || this.#l(), this.#p();
2057
2060
  };
2058
2061
  #mi = () => {
2059
2062
  this.#yt(!0, !0);
@@ -2062,21 +2065,21 @@ class A extends HTMLElement {
2062
2065
  this.#yt(!0);
2063
2066
  };
2064
2067
  #fi = () => {
2065
- this.#H(), this.#y(), this.#c() || this.#l(), this.#w(), this.#g();
2068
+ this.#H(), this.#y(), this.#u() || this.#l(), this.#w(), this.#g();
2066
2069
  };
2067
2070
  #bi = () => {
2068
2071
  const t = this.#Kt();
2069
- this.#y(), t && !this.#c() && this.#l(), this.#u();
2072
+ this.#y(), t && !this.#u() && this.#l(), this.#p();
2070
2073
  };
2071
2074
  #vi = () => {
2072
2075
  if (this.#H(), this.#w(), this.#I && (!this.#nt || this.#t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA)) {
2073
- this.#_s(), this.#u();
2076
+ this.#_s(), this.#p();
2074
2077
  return;
2075
2078
  }
2076
- this.#c() || this.#l(), this.#g();
2079
+ this.#u() || this.#l(), this.#g();
2077
2080
  };
2078
2081
  #gi = () => {
2079
- this.#b = null, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#s.classList.remove("has-visible-frame"), this.#yt(!0, !0), this.#u(), this.#Ae();
2082
+ this.#b = null, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#s.classList.remove("has-visible-frame"), this.#yt(!0, !0), this.#p(), this.#Ae();
2080
2083
  };
2081
2084
  #yi = () => {
2082
2085
  this.#y(), this.#g();
@@ -2084,11 +2087,11 @@ class A extends HTMLElement {
2084
2087
  #wi = () => {
2085
2088
  this.#y();
2086
2089
  };
2087
- #d() {
2090
+ #m() {
2088
2091
  return window.matchMedia("(max-width: 768px)").matches && window.matchMedia("(hover: none), (pointer: coarse)").matches;
2089
2092
  }
2090
2093
  #xi() {
2091
- this.#t && (this.#E?.disconnect(), this.#E = null, this.#Ot(), this.#gs(), this.#C = !1, this.#is = 0, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#ht = !1, this.#ct = 0, this.#H(), this.#Rt = !1, this.#ut = !1, this.#S(), this.#I = !1, this.#nt = !1, this.#b = null, this.#s.classList.remove("has-loaded-once", "has-visible-frame", "is-progress-settling"), this.#t.dataset.src = this.src, this.#t.pause(), this.#t.removeAttribute("src"), this.#t.preload = "none", this.#Bt(), this.#t.load(), this.#_(0), this.#y(), this.#w(), this.#u());
2094
+ this.#t && (this.#E?.disconnect(), this.#E = null, this.#Ot(), this.#gs(), this.#C = !1, this.#is = 0, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#ht = !1, this.#ct = 0, this.#H(), this.#Rt = !1, this.#ut = !1, this.#S(), this.#I = !1, this.#nt = !1, this.#b = null, this.#s.classList.remove("has-loaded-once", "has-visible-frame", "is-progress-settling"), this.#t.dataset.src = this.src, this.#t.pause(), this.#t.removeAttribute("src"), this.#t.preload = "none", this.#Bt(), this.#t.load(), this.#_(0), this.#y(), this.#w(), this.#p());
2092
2095
  }
2093
2096
  }
2094
2097
  customElements.get("simple-player") || customElements.define("simple-player", A);