@grizzshutsdown/simpleplayer 0.1.8 → 0.1.10
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 +2 -2
- package/dist/simple-player.js +104 -79
- package/dist/simple-player.js.map +1 -1
- package/package.json +1 -1
- package/skill/simpleplayer/SKILL.md +3 -1
package/README.md
CHANGED
|
@@ -99,9 +99,9 @@ declare module 'react' {
|
|
|
99
99
|
- `preload-margin`: lazy-load margin before the video enters view. Default: `360px 0px`.
|
|
100
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
|
-
- `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.
|
|
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. The tray automatically resizes to fit the text as the time changes during playback.
|
|
103
103
|
|
|
104
|
-
The default player matches the simple preview: play/pause, scrubber, muted autoplay, and no extra side controls.
|
|
104
|
+
The default player matches the simple preview: play/pause, scrubber, muted autoplay, and no extra side controls. Hovering over the scrubber shows a translucent fill that follows the cursor, previewing the seek position.
|
|
105
105
|
|
|
106
106
|
Keep the HTML clean and manage controls with JavaScript:
|
|
107
107
|
|
package/dist/simple-player.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const p = "16 / 9", m = "360px 0px", f = [
|
|
2
2
|
"src",
|
|
3
3
|
"aspect-ratio",
|
|
4
4
|
"preload-margin",
|
|
@@ -49,8 +49,10 @@ function a(o) {
|
|
|
49
49
|
}
|
|
50
50
|
function k(o) {
|
|
51
51
|
const t = o;
|
|
52
|
-
if (t.audioTracks && typeof t.audioTracks.length == "number")
|
|
53
|
-
|
|
52
|
+
if (t.audioTracks && typeof t.audioTracks.length == "number") {
|
|
53
|
+
if (t.audioTracks.length > 0) return "available";
|
|
54
|
+
if (o.readyState >= HTMLMediaElement.HAVE_METADATA) return "unavailable";
|
|
55
|
+
}
|
|
54
56
|
const s = o;
|
|
55
57
|
if (typeof s.mozHasAudio == "boolean")
|
|
56
58
|
return s.mozHasAudio ? "available" : "unavailable";
|
|
@@ -80,7 +82,7 @@ function E(o, t) {
|
|
|
80
82
|
}
|
|
81
83
|
const C = `
|
|
82
84
|
:host {
|
|
83
|
-
--simple-player-aspect-ratio: ${
|
|
85
|
+
--simple-player-aspect-ratio: ${p};
|
|
84
86
|
--space: 4px;
|
|
85
87
|
--white: #fff;
|
|
86
88
|
--black: #000;
|
|
@@ -164,6 +166,7 @@ const C = `
|
|
|
164
166
|
min-height: 100%;
|
|
165
167
|
overflow: hidden;
|
|
166
168
|
--sp-progress-inset: 100%;
|
|
169
|
+
--sp-hover-fill-inset: 100%;
|
|
167
170
|
--sp-scrub-preview-left: 0px;
|
|
168
171
|
--sp-return-marker-left: 0px;
|
|
169
172
|
--sp-return-marker-base-opacity: 1;
|
|
@@ -752,6 +755,28 @@ const C = `
|
|
|
752
755
|
will-change: clip-path;
|
|
753
756
|
}
|
|
754
757
|
|
|
758
|
+
.sp-progress-hover-fill {
|
|
759
|
+
position: absolute;
|
|
760
|
+
bottom: calc(var(--space) * 2);
|
|
761
|
+
left: 2px;
|
|
762
|
+
right: 2px;
|
|
763
|
+
z-index: 0;
|
|
764
|
+
height: var(--sp-progress-height);
|
|
765
|
+
border-radius: 3px;
|
|
766
|
+
background: var(--white);
|
|
767
|
+
opacity: 0;
|
|
768
|
+
pointer-events: none;
|
|
769
|
+
clip-path: inset(0 var(--sp-hover-fill-inset) 0 0 round 3px);
|
|
770
|
+
transform: translateZ(0);
|
|
771
|
+
transition: height 180ms ease, opacity 120ms ease;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.sp-progress:hover .sp-progress-hover-fill,
|
|
775
|
+
.sp-player.is-progress-hovering .sp-progress-hover-fill,
|
|
776
|
+
.sp-player.is-scrubbing .sp-progress-hover-fill {
|
|
777
|
+
opacity: 0.2;
|
|
778
|
+
}
|
|
779
|
+
|
|
755
780
|
.sp-progress-marker {
|
|
756
781
|
position: absolute;
|
|
757
782
|
bottom: calc((var(--space) * 2) + 1.5px);
|
|
@@ -875,7 +900,6 @@ const C = `
|
|
|
875
900
|
|
|
876
901
|
.sp-tray-time-holder .sp-control-tray-slots::before {
|
|
877
902
|
width: calc(100% - (var(--sp-control-tray-padding) * 2));
|
|
878
|
-
opacity: var(--sp-control-hover-opacity);
|
|
879
903
|
}
|
|
880
904
|
|
|
881
905
|
.sp-tray-time-holder .sp-tray-time-text {
|
|
@@ -1034,8 +1058,8 @@ const C = `
|
|
|
1034
1058
|
transform: translateY(0) scale(1);
|
|
1035
1059
|
}
|
|
1036
1060
|
}
|
|
1037
|
-
`,
|
|
1038
|
-
|
|
1061
|
+
`, u = document.createElement("template");
|
|
1062
|
+
u.innerHTML = `
|
|
1039
1063
|
<style>${C}</style>
|
|
1040
1064
|
<div class="sp-player is-loading" data-sp-player>
|
|
1041
1065
|
<video
|
|
@@ -1067,6 +1091,7 @@ p.innerHTML = `
|
|
|
1067
1091
|
<span class="sp-time-text" data-sp-time-text>0:00</span>
|
|
1068
1092
|
</span>
|
|
1069
1093
|
<span class="sp-progress-fill" data-sp-progress></span>
|
|
1094
|
+
<span class="sp-progress-hover-fill" aria-hidden="true"></span>
|
|
1070
1095
|
<span class="sp-progress-marker" aria-hidden="true"></span>
|
|
1071
1096
|
</div>
|
|
1072
1097
|
<span class="sp-tray-time" data-sp-tray-time>
|
|
@@ -1141,8 +1166,8 @@ class A extends HTMLElement {
|
|
|
1141
1166
|
#o;
|
|
1142
1167
|
#z;
|
|
1143
1168
|
#d;
|
|
1144
|
-
#O;
|
|
1145
1169
|
#Z;
|
|
1170
|
+
#O;
|
|
1146
1171
|
#K = [];
|
|
1147
1172
|
#ot = 0;
|
|
1148
1173
|
#a = !1;
|
|
@@ -1183,7 +1208,7 @@ class A extends HTMLElement {
|
|
|
1183
1208
|
#It = !1;
|
|
1184
1209
|
#v = !1;
|
|
1185
1210
|
#Rt = !1;
|
|
1186
|
-
#
|
|
1211
|
+
#pt = !1;
|
|
1187
1212
|
#U = !1;
|
|
1188
1213
|
#os = null;
|
|
1189
1214
|
#ns = null;
|
|
@@ -1191,7 +1216,7 @@ class A extends HTMLElement {
|
|
|
1191
1216
|
#F = !1;
|
|
1192
1217
|
#N = !1;
|
|
1193
1218
|
#n = null;
|
|
1194
|
-
#
|
|
1219
|
+
#ut = 0;
|
|
1195
1220
|
#dt = 0;
|
|
1196
1221
|
#mt = 0;
|
|
1197
1222
|
#as = null;
|
|
@@ -1205,8 +1230,8 @@ class A extends HTMLElement {
|
|
|
1205
1230
|
#Ss = 1200;
|
|
1206
1231
|
#Ht = 1600;
|
|
1207
1232
|
#ce = 140;
|
|
1208
|
-
#
|
|
1209
|
-
#
|
|
1233
|
+
#pe = 380;
|
|
1234
|
+
#ue = 650;
|
|
1210
1235
|
#de = 2e3;
|
|
1211
1236
|
#me = 3;
|
|
1212
1237
|
#fe = 10;
|
|
@@ -1214,7 +1239,7 @@ class A extends HTMLElement {
|
|
|
1214
1239
|
#be = 8;
|
|
1215
1240
|
#ve = 18;
|
|
1216
1241
|
constructor() {
|
|
1217
|
-
super(), this.#r = this.attachShadow({ mode: "open" }), this.#r.append(
|
|
1242
|
+
super(), this.#r = this.attachShadow({ mode: "open" }), this.#r.append(u.content.cloneNode(!0));
|
|
1218
1243
|
}
|
|
1219
1244
|
get src() {
|
|
1220
1245
|
return this.getAttribute("src") ?? "";
|
|
@@ -1223,7 +1248,7 @@ class A extends HTMLElement {
|
|
|
1223
1248
|
this.#cs("src", t);
|
|
1224
1249
|
}
|
|
1225
1250
|
get aspectRatio() {
|
|
1226
|
-
return this.getAttribute("aspect-ratio") ||
|
|
1251
|
+
return this.getAttribute("aspect-ratio") || p;
|
|
1227
1252
|
}
|
|
1228
1253
|
set aspectRatio(t) {
|
|
1229
1254
|
this.#cs("aspect-ratio", t);
|
|
@@ -1268,7 +1293,7 @@ class A extends HTMLElement {
|
|
|
1268
1293
|
return this.controlsEnabled && !this.hasAttribute("disable-volume") && !this.hasAttribute("no-volume");
|
|
1269
1294
|
}
|
|
1270
1295
|
set volumeEnabled(t) {
|
|
1271
|
-
this.#
|
|
1296
|
+
this.#ps("volume", t);
|
|
1272
1297
|
}
|
|
1273
1298
|
get volumeSliderEnabled() {
|
|
1274
1299
|
return !this.hasAttribute("disable-volume-slider") && !this.hasAttribute("no-volume-slider");
|
|
@@ -1284,19 +1309,19 @@ class A extends HTMLElement {
|
|
|
1284
1309
|
return this.controlsEnabled && !this.hasAttribute("disable-picture-in-picture") && !this.hasAttribute("no-picture-in-picture");
|
|
1285
1310
|
}
|
|
1286
1311
|
set pictureInPictureEnabled(t) {
|
|
1287
|
-
this.#
|
|
1312
|
+
this.#ps("picture-in-picture", t);
|
|
1288
1313
|
}
|
|
1289
1314
|
get fullscreenEnabled() {
|
|
1290
1315
|
return this.controlsEnabled && !this.hasAttribute("disable-fullscreen") && !this.hasAttribute("no-fullscreen");
|
|
1291
1316
|
}
|
|
1292
1317
|
set fullscreenEnabled(t) {
|
|
1293
|
-
this.#
|
|
1318
|
+
this.#ps("fullscreen", t);
|
|
1294
1319
|
}
|
|
1295
1320
|
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.#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.#
|
|
1321
|
+
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.#Z = this.#r.querySelector("[data-sp-picture-in-picture-control]"), this.#O = this.#r.querySelector("[data-sp-fullscreen-control]"), this.#K = [this.#o, this.#Z, this.#O], this.#Ms(), this.#ts || (this.#ge(), this.#ts = !0), this.#Bt(), this.#ms(), this.#us(), this.#ds(), this.#w(), this.#y(), this.#Tt(), this.#Qt(), this.#u();
|
|
1297
1322
|
}
|
|
1298
1323
|
disconnectedCallback() {
|
|
1299
|
-
this.#E?.disconnect(), this.#E = null, this.#At.forEach((t) => t()), this.#At = [], this.#ts = !1, this.#P(), this.#$s(), this.#
|
|
1324
|
+
this.#E?.disconnect(), this.#E = null, this.#At.forEach((t) => t()), this.#At = [], this.#ts = !1, this.#P(), this.#$s(), this.#Zt(), this.#gs(), this.#rt(), this.#Ot(), 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();
|
|
1300
1325
|
}
|
|
1301
1326
|
attributeChangedCallback(t, s, e) {
|
|
1302
1327
|
if (s !== e) {
|
|
@@ -1313,14 +1338,14 @@ class A extends HTMLElement {
|
|
|
1313
1338
|
return;
|
|
1314
1339
|
}
|
|
1315
1340
|
if ((t === "disable-autoplay" || t === "no-autoplay") && this.isConnected) {
|
|
1316
|
-
this.#Bt(), this.#y(), this.#
|
|
1341
|
+
this.#Bt(), this.#y(), this.#u();
|
|
1317
1342
|
return;
|
|
1318
1343
|
}
|
|
1319
1344
|
if (t === "show-time" && this.isConnected) {
|
|
1320
1345
|
this.#ds();
|
|
1321
1346
|
return;
|
|
1322
1347
|
}
|
|
1323
|
-
(t === "controls" || t.startsWith("enable-") || t.startsWith("disable-") || t.startsWith("no-")) && this.isConnected && (this.#
|
|
1348
|
+
(t === "controls" || t.startsWith("enable-") || t.startsWith("disable-") || t.startsWith("no-")) && this.isConnected && (this.#us(), this.#y(), this.#Tt(), this.#Qt(), this.#ds());
|
|
1324
1349
|
}
|
|
1325
1350
|
}
|
|
1326
1351
|
#cs(t, s) {
|
|
@@ -1330,7 +1355,7 @@ class A extends HTMLElement {
|
|
|
1330
1355
|
}
|
|
1331
1356
|
this.setAttribute(t, s);
|
|
1332
1357
|
}
|
|
1333
|
-
#
|
|
1358
|
+
#ps(t, s) {
|
|
1334
1359
|
if (s) {
|
|
1335
1360
|
this.setAttribute(`enable-${t}`, ""), this.removeAttribute(`disable-${t}`), this.removeAttribute(`no-${t}`);
|
|
1336
1361
|
return;
|
|
@@ -1349,12 +1374,12 @@ class A extends HTMLElement {
|
|
|
1349
1374
|
}
|
|
1350
1375
|
this.#t.removeAttribute("autoplay"), this.#C || (this.#t.muted = !1, this.#t.removeAttribute("muted"));
|
|
1351
1376
|
}
|
|
1352
|
-
#
|
|
1377
|
+
#us() {
|
|
1353
1378
|
if (!this.#s) return;
|
|
1354
1379
|
const t = this.#T(), s = [
|
|
1355
1380
|
{ button: this.#o, enabled: t, className: "has-volume-control" },
|
|
1356
|
-
{ button: this.#
|
|
1357
|
-
{ button: this.#
|
|
1381
|
+
{ button: this.#Z, enabled: this.pictureInPictureEnabled, className: "has-picture-in-picture-control" },
|
|
1382
|
+
{ button: this.#O, enabled: this.fullscreenEnabled, className: "has-fullscreen-control" }
|
|
1358
1383
|
];
|
|
1359
1384
|
let e = 0;
|
|
1360
1385
|
for (const i of s)
|
|
@@ -1368,14 +1393,14 @@ class A extends HTMLElement {
|
|
|
1368
1393
|
this.#s && (this.#s.classList.toggle("has-pinned-time", this.#bt), this.#bt && this.#wt());
|
|
1369
1394
|
}
|
|
1370
1395
|
#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.#
|
|
1396
|
+
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.#Ze), this.#e(this.#z, "pointerenter", this.#se), this.#e(this.#z, "pointerleave", this.#ee), this.#e(this.#d, "pointerdown", this.#Oe), 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.#Z, "click", this.#ti), this.#e(this.#O, "click", this.#si), this.#e(this.#c, "click", this.#Xe);
|
|
1372
1397
|
for (const t of this.#K)
|
|
1373
1398
|
this.#e(t, "pointerenter", this.#qs), this.#e(t, "mouseenter", this.#qs), this.#e(t, "pointerdown", this.#ke);
|
|
1374
1399
|
"ResizeObserver" in window && (this.#Mt = new ResizeObserver(() => {
|
|
1375
1400
|
this.#$t();
|
|
1376
1401
|
}), this.#Mt.observe(this.#c), this.#At.push(() => {
|
|
1377
1402
|
this.#Mt?.disconnect(), this.#Mt = null;
|
|
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.#
|
|
1403
|
+
})), 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.#pi), this.#e(this.#t, "pause", this.#ui), 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
1404
|
}
|
|
1380
1405
|
#$t() {
|
|
1381
1406
|
if (!this.#s || !this.#c) return;
|
|
@@ -1443,11 +1468,11 @@ class A extends HTMLElement {
|
|
|
1443
1468
|
return i.width <= 0 || i.height <= 0 ? !1 : s >= i.left && s <= i.right && e >= i.top && e <= i.bottom;
|
|
1444
1469
|
}
|
|
1445
1470
|
#zs() {
|
|
1446
|
-
this.#v && (this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#xt(), this.#wt());
|
|
1471
|
+
this.#v && (this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#s.style.setProperty("--sp-hover-fill-inset", "100%"), this.#xt(), this.#wt());
|
|
1447
1472
|
}
|
|
1448
1473
|
#Is(t, s) {
|
|
1449
1474
|
if (this.#m()) return;
|
|
1450
|
-
!this.#
|
|
1475
|
+
!this.#p() && this.#Vs(this.#i, t, s) ? (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t, !1, !1)) : this.#p() || this.#zs();
|
|
1451
1476
|
const e = this.#K.find((r) => !r.hidden && !this.#bs(r) && this.#Vs(r, t, s)) ?? null;
|
|
1452
1477
|
if (!e) return;
|
|
1453
1478
|
const i = Number(e.dataset.spControlIndex ?? 0);
|
|
@@ -1515,13 +1540,13 @@ class A extends HTMLElement {
|
|
|
1515
1540
|
#$s() {
|
|
1516
1541
|
this.#lt && (window.clearTimeout(this.#lt), this.#lt = 0);
|
|
1517
1542
|
}
|
|
1518
|
-
#
|
|
1543
|
+
#Zt() {
|
|
1519
1544
|
this.#Q && (window.clearTimeout(this.#Q), this.#Q = 0);
|
|
1520
1545
|
}
|
|
1521
1546
|
#gs() {
|
|
1522
1547
|
this.#tt && (window.clearTimeout(this.#tt), this.#tt = 0);
|
|
1523
1548
|
}
|
|
1524
|
-
#
|
|
1549
|
+
#Ot() {
|
|
1525
1550
|
this.#Vt && (window.clearTimeout(this.#Vt), this.#Vt = 0);
|
|
1526
1551
|
}
|
|
1527
1552
|
#Us() {
|
|
@@ -1538,16 +1563,16 @@ class A extends HTMLElement {
|
|
|
1538
1563
|
this.#s.classList.remove("is-progress-settling");
|
|
1539
1564
|
return;
|
|
1540
1565
|
}
|
|
1541
|
-
this.#ht = !0, this.#As = performance.now() + this.#
|
|
1566
|
+
this.#ht = !0, this.#As = performance.now() + this.#ue, this.#p() || this.#l(), this.#g(), this.#s.classList.remove("is-progress-settling"), this.#u();
|
|
1542
1567
|
}
|
|
1543
1568
|
};
|
|
1544
1569
|
#Te() {
|
|
1545
|
-
this.#ht || this.#tt || (this.#s.classList.add("is-progress-settling"), this.#_(0), this.#tt = window.setTimeout(this.#Ns, this.#
|
|
1570
|
+
this.#ht || this.#tt || (this.#s.classList.add("is-progress-settling"), this.#_(0), this.#tt = window.setTimeout(this.#Ns, this.#pe));
|
|
1546
1571
|
}
|
|
1547
1572
|
async #Y() {
|
|
1548
1573
|
if (this.#C) return;
|
|
1549
1574
|
const t = this.#t.dataset.src || this.src;
|
|
1550
|
-
t && (this.#
|
|
1575
|
+
t && (this.#Zt(), this.#Ot(), this.#is += 1, this.#C = !0, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#s.classList.remove("has-visible-frame"), this.#Bt(), this.#t.src = t, this.#t.preload = "auto", this.#t.load(), this.#t.autoplay && this.#t.muted && await this.#t.play().catch(() => {
|
|
1551
1576
|
}));
|
|
1552
1577
|
}
|
|
1553
1578
|
#Ys() {
|
|
@@ -1603,32 +1628,32 @@ class A extends HTMLElement {
|
|
|
1603
1628
|
#Ce() {
|
|
1604
1629
|
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"));
|
|
1605
1630
|
}
|
|
1606
|
-
#
|
|
1631
|
+
#p() {
|
|
1607
1632
|
return this.#x || this.#a || this.#I;
|
|
1608
1633
|
}
|
|
1609
1634
|
#Ae() {
|
|
1610
1635
|
this.#is >= this.#me || this.#Q || (this.#Q = window.setTimeout(() => {
|
|
1611
|
-
this.#Q = 0, this.#
|
|
1636
|
+
this.#Q = 0, this.#Ot(), this.#C = !1, this.#A = !1, this.#L = !1, this.#q = !1, this.#B = !1, this.#$ += 1, this.#s.classList.remove("has-visible-frame"), this.#s.classList.contains("has-loaded-once") || this.#_(0), this.#t.removeAttribute("src"), this.#t.load(), this.#Y();
|
|
1612
1637
|
}, this.#de));
|
|
1613
1638
|
}
|
|
1614
1639
|
#_s() {
|
|
1615
1640
|
return this.#I ? (this.#I = !1, this.#nt = !1, this.#l(), this.#g(), !0) : !1;
|
|
1616
1641
|
}
|
|
1617
1642
|
#Ws() {
|
|
1618
|
-
return this.#
|
|
1643
|
+
return this.#Zt(), !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.#p() || this.#l(), this.#g(), !0);
|
|
1619
1644
|
}
|
|
1620
1645
|
#Le() {
|
|
1621
1646
|
if (this.#A || this.#q || this.#t.error) return;
|
|
1622
1647
|
this.#q = !0;
|
|
1623
1648
|
const t = this.#$, s = () => {
|
|
1624
1649
|
if (t === this.#$) {
|
|
1625
|
-
if (this.#
|
|
1650
|
+
if (this.#Ot(), this.#q = !1, this.#A = !this.#t.error && this.#t.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && this.#t.videoWidth > 0 && this.#t.videoHeight > 0, this.#A) {
|
|
1626
1651
|
if (this.#B || this.#L) return;
|
|
1627
1652
|
this.#B = !0, window.requestAnimationFrame(() => {
|
|
1628
1653
|
window.requestAnimationFrame(() => {
|
|
1629
|
-
t === this.#$ && (this.#B = !1, this.#L = !0, this.#Ws(), this.#
|
|
1654
|
+
t === this.#$ && (this.#B = !1, this.#L = !0, this.#Ws(), this.#u());
|
|
1630
1655
|
});
|
|
1631
|
-
}), this.#
|
|
1656
|
+
}), this.#u();
|
|
1632
1657
|
return;
|
|
1633
1658
|
}
|
|
1634
1659
|
this.#w();
|
|
@@ -1657,7 +1682,7 @@ class A extends HTMLElement {
|
|
|
1657
1682
|
#H() {
|
|
1658
1683
|
this.#k = null, this.#st = null;
|
|
1659
1684
|
}
|
|
1660
|
-
#
|
|
1685
|
+
#Zs() {
|
|
1661
1686
|
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) {
|
|
1662
1687
|
this.#k = null;
|
|
1663
1688
|
return;
|
|
@@ -1667,7 +1692,7 @@ class A extends HTMLElement {
|
|
|
1667
1692
|
}
|
|
1668
1693
|
#Fe() {
|
|
1669
1694
|
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) {
|
|
1670
|
-
this.#st = null, this.#
|
|
1695
|
+
this.#st = null, this.#Zs();
|
|
1671
1696
|
return;
|
|
1672
1697
|
}
|
|
1673
1698
|
const t = this.#s.style.getPropertyValue("--sp-progress-inset"), s = Number.parseFloat(t), e = Number.isFinite(s) ? Math.min(1, Math.max(0, 1 - s / 100)) : null, i = this.#X(), r = Math.min(1, Math.max(0, i / this.#t.duration)), n = Math.max(e ?? 0, r);
|
|
@@ -1678,7 +1703,7 @@ class A extends HTMLElement {
|
|
|
1678
1703
|
}
|
|
1679
1704
|
#X() {
|
|
1680
1705
|
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime || 0;
|
|
1681
|
-
if (this.#
|
|
1706
|
+
if (this.#p()) return this.#f;
|
|
1682
1707
|
if (this.#k !== null) return this.#k;
|
|
1683
1708
|
if (!this.#js()) return this.#t.currentTime || 0;
|
|
1684
1709
|
if (this.#zt || !this.#ht || performance.now() < this.#As)
|
|
@@ -1724,7 +1749,7 @@ class A extends HTMLElement {
|
|
|
1724
1749
|
} : { percent: e, targetTime: r };
|
|
1725
1750
|
}
|
|
1726
1751
|
#wt(t = this.#X()) {
|
|
1727
|
-
!this.#bt || this.#v || this.#
|
|
1752
|
+
!this.#bt || this.#v || this.#p() || (this.#c.textContent = this.#ks(t), this.#$t());
|
|
1728
1753
|
}
|
|
1729
1754
|
#g(t = this.#X()) {
|
|
1730
1755
|
const s = Number.isFinite(this.#t.duration) && this.#t.duration > 0;
|
|
@@ -1745,7 +1770,7 @@ class A extends HTMLElement {
|
|
|
1745
1770
|
#W(t, s = this.#a, e = !0) {
|
|
1746
1771
|
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime;
|
|
1747
1772
|
const i = this.#i.getBoundingClientRect(), r = this.#Ve(t, i), n = this.#Ie(t, i, r, s);
|
|
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(
|
|
1773
|
+
return this.#s.style.setProperty("--sp-hover-fill-inset", `${(1 - r) * 100}%`), 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(
|
|
1749
1774
|
"aria-valuetext",
|
|
1750
1775
|
`${a(n.targetTime)} of ${a(this.#t.duration)}`
|
|
1751
1776
|
)), this.#Re(), n.targetTime;
|
|
@@ -1771,7 +1796,7 @@ class A extends HTMLElement {
|
|
|
1771
1796
|
};
|
|
1772
1797
|
this.#ot = window.requestAnimationFrame(t);
|
|
1773
1798
|
}
|
|
1774
|
-
#
|
|
1799
|
+
#u() {
|
|
1775
1800
|
const t = !this.#t.paused && (!this.#t.ended || this.#t.loop) || this.#a && this.#G, s = this.#b ? this.#b === "playing" : t;
|
|
1776
1801
|
if (this.#s.classList.toggle("is-playing", s), this.#M.setAttribute("aria-label", s ? "Pause video" : "Play video"), this.#a) {
|
|
1777
1802
|
this.#kt();
|
|
@@ -1786,7 +1811,7 @@ class A extends HTMLElement {
|
|
|
1786
1811
|
return k(this.#t);
|
|
1787
1812
|
}
|
|
1788
1813
|
#T() {
|
|
1789
|
-
return this.volumeEnabled && this.#
|
|
1814
|
+
return this.volumeEnabled && this.#pt && this.#Rt;
|
|
1790
1815
|
}
|
|
1791
1816
|
#S() {
|
|
1792
1817
|
this.#Ct(), this.#Jt(this.#n), this.#F = !1, this.#N = !1, this.#n = null, this.#o.classList.remove("is-volume-open", "is-control-tap-active"), this.#z.classList.remove("is-scrubbing-volume");
|
|
@@ -1796,17 +1821,17 @@ class A extends HTMLElement {
|
|
|
1796
1821
|
this.#s.classList.remove("is-volume-unavailable", "is-volume-muted", "is-volume-sound", "is-volume-icon-animating"), this.#S(), this.#o.disabled = !0, this.#o.setAttribute("aria-disabled", "true");
|
|
1797
1822
|
return;
|
|
1798
1823
|
}
|
|
1799
|
-
if (!this.#
|
|
1824
|
+
if (!this.#pt) {
|
|
1800
1825
|
const l = this.#He();
|
|
1801
|
-
l !== "unknown" ? (this.#
|
|
1826
|
+
l !== "unknown" ? (this.#pt = !0, this.#Rt = l === "available") : this.#t.readyState >= HTMLMediaElement.HAVE_METADATA && !P(this.#t) && (this.#pt = !0, this.#Rt = !0);
|
|
1802
1827
|
}
|
|
1803
1828
|
const t = this.#o.hidden, s = this.#T(), e = !s || this.#t.muted || this.#t.volume <= 0, i = s && !this.#t.muted ? this.#t.volume : 0, r = Math.round(i * 100), n = e ? "muted" : "sound";
|
|
1804
1829
|
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(
|
|
1805
1830
|
"aria-label",
|
|
1806
1831
|
s ? e ? "Unmute video" : "Mute video" : "Video has no audio"
|
|
1807
|
-
), this.#d.setAttribute("aria-valuenow", `${r}`), this.#d.setAttribute("aria-valuetext", `${r}%`), s || this.#S(), t === s && this.#
|
|
1832
|
+
), this.#d.setAttribute("aria-valuenow", `${r}`), this.#d.setAttribute("aria-valuetext", `${r}%`), s || this.#S(), t === s && this.#us();
|
|
1808
1833
|
};
|
|
1809
|
-
#
|
|
1834
|
+
#Os(t) {
|
|
1810
1835
|
if (!this.#T()) return;
|
|
1811
1836
|
const s = this.#d.getBoundingClientRect(), e = Math.min(1, Math.max(0, 1 - (t - s.top) / s.height)), i = Math.round(e * 100) / 100;
|
|
1812
1837
|
this.#t.volume = i, this.#t.muted = i <= 0, this.#y();
|
|
@@ -1819,7 +1844,7 @@ class A extends HTMLElement {
|
|
|
1819
1844
|
}
|
|
1820
1845
|
#Tt = () => {
|
|
1821
1846
|
const t = document.pictureInPictureElement === this.#t, s = this.#t, e = !!(this.pictureInPictureEnabled && document.pictureInPictureEnabled && s.requestPictureInPicture);
|
|
1822
|
-
this.#s.classList.toggle("is-picture-in-picture", t), this.#
|
|
1847
|
+
this.#s.classList.toggle("is-picture-in-picture", t), this.#Z.disabled = !e, this.#Z.setAttribute("aria-label", t ? "Exit picture in picture" : "Enter picture in picture");
|
|
1823
1848
|
};
|
|
1824
1849
|
#ys() {
|
|
1825
1850
|
return b(this.#r);
|
|
@@ -1838,7 +1863,7 @@ class A extends HTMLElement {
|
|
|
1838
1863
|
}
|
|
1839
1864
|
#Qt = () => {
|
|
1840
1865
|
const t = this.#ys(), s = t === this.#s || t === this, e = this.#Ks();
|
|
1841
|
-
return this.#s.classList.toggle("is-fullscreen", s), this.#
|
|
1866
|
+
return this.#s.classList.toggle("is-fullscreen", s), this.#O.disabled = !e, this.#O.setAttribute("aria-label", s ? "Exit fullscreen" : "Enter fullscreen"), s;
|
|
1842
1867
|
};
|
|
1843
1868
|
#Et = () => {
|
|
1844
1869
|
const t = this.#Qt();
|
|
@@ -1850,7 +1875,7 @@ class A extends HTMLElement {
|
|
|
1850
1875
|
s instanceof HTMLElement && s.blur(), t ? this.#Rs() : this.#Yt();
|
|
1851
1876
|
}
|
|
1852
1877
|
#Gs = () => {
|
|
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.#
|
|
1878
|
+
!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());
|
|
1854
1879
|
};
|
|
1855
1880
|
#ws(t) {
|
|
1856
1881
|
t !== null && this.#i.hasPointerCapture(t) && this.#i.releasePointerCapture(t);
|
|
@@ -1858,10 +1883,10 @@ class A extends HTMLElement {
|
|
|
1858
1883
|
async #Js(t, s, e) {
|
|
1859
1884
|
if (!this.#x && !this.#a) return;
|
|
1860
1885
|
const i = this.#a;
|
|
1861
|
-
this.#rt(), this.#x = !1, this.#a = !1, this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#h = null, this.#s.classList.remove("is-scrubbing"), this.#xt(), this.#ws(s), e && t !== null && (this.#H(), this.#f = this.#W(t, i), this.#I = !0, this.#nt = this.#G, this.#t.currentTime = this.#f, this.#l(this.#f)), this.#g(this.#f), i && this.#G && await this.#t.play(), this.#R();
|
|
1886
|
+
this.#rt(), this.#x = !1, this.#a = !1, this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#s.style.setProperty("--sp-hover-fill-inset", "100%"), this.#h = null, this.#s.classList.remove("is-scrubbing"), this.#xt(), this.#ws(s), e && t !== null && (this.#H(), this.#f = this.#W(t, i), this.#I = !0, this.#nt = this.#G, this.#t.currentTime = this.#f, this.#l(this.#f)), this.#g(this.#f), i && this.#G && await this.#t.play(), this.#R();
|
|
1862
1887
|
}
|
|
1863
1888
|
#xs(t) {
|
|
1864
|
-
!this.#x && !this.#a || (this.#rt(), this.#x = !1, this.#a = !1, this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#h = null, this.#s.classList.remove("is-scrubbing"), this.#xt(), this.#ws(t), this.#l(), this.#g(), this.#G && this.#t.play(), this.#R());
|
|
1889
|
+
!this.#x && !this.#a || (this.#rt(), this.#x = !1, this.#a = !1, this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#s.style.setProperty("--sp-hover-fill-inset", "100%"), this.#h = null, this.#s.classList.remove("is-scrubbing"), this.#xt(), this.#ws(t), this.#l(), this.#g(), this.#G && this.#t.play(), this.#R());
|
|
1865
1890
|
}
|
|
1866
1891
|
#ks(t) {
|
|
1867
1892
|
if (!this.#ls) return a(t);
|
|
@@ -1877,15 +1902,15 @@ class A extends HTMLElement {
|
|
|
1877
1902
|
}, 240);
|
|
1878
1903
|
}
|
|
1879
1904
|
#Xe = (t) => {
|
|
1880
|
-
t.stopPropagation(), this.#ls = !this.#ls, this.#Ye(), this.#
|
|
1905
|
+
t.stopPropagation(), this.#ls = !this.#ls, this.#Ye(), this.#p() || this.#v ? this.#c && (this.#c.textContent = this.#ks(this.#f), this.#$t()) : this.#wt(this.#X());
|
|
1881
1906
|
};
|
|
1882
1907
|
#_e = async () => {
|
|
1883
1908
|
if (performance.now() < this.#Cs)
|
|
1884
1909
|
return;
|
|
1885
1910
|
const t = this.#b ? this.#b !== "playing" : this.#t.paused || this.#t.ended, s = !t || this.#Ce();
|
|
1886
|
-
this.#D(), s && (this.#b = t ? "playing" : "paused", this.#
|
|
1911
|
+
this.#D(), s && (this.#b = t ? "playing" : "paused", this.#u()), t ? (this.#H(), await this.#Y(), await this.#t.play().catch(() => {
|
|
1887
1912
|
this.#b = null;
|
|
1888
|
-
})) : (this.#Fe(), this.#t.pause()), this.#
|
|
1913
|
+
})) : (this.#Fe(), this.#t.pause()), this.#u(), this.#R();
|
|
1889
1914
|
};
|
|
1890
1915
|
#We = (t) => {
|
|
1891
1916
|
if (!(t instanceof PointerEvent)) return;
|
|
@@ -1896,7 +1921,7 @@ class A extends HTMLElement {
|
|
|
1896
1921
|
t.stopPropagation();
|
|
1897
1922
|
};
|
|
1898
1923
|
#Ct() {
|
|
1899
|
-
this.#
|
|
1924
|
+
this.#ut && (window.clearTimeout(this.#ut), this.#ut = 0);
|
|
1900
1925
|
}
|
|
1901
1926
|
#Qs() {
|
|
1902
1927
|
if (!this.#T() || !this.volumeSliderEnabled) {
|
|
@@ -1906,10 +1931,10 @@ class A extends HTMLElement {
|
|
|
1906
1931
|
this.#Ct(), this.#o.classList.add("is-volume-open");
|
|
1907
1932
|
}
|
|
1908
1933
|
#Ps = () => {
|
|
1909
|
-
this.#
|
|
1934
|
+
this.#ut = 0, !(this.#N || this.#F) && this.#o.classList.remove("is-volume-open");
|
|
1910
1935
|
};
|
|
1911
1936
|
#te(t = 150) {
|
|
1912
|
-
this.#Ct(), this.#
|
|
1937
|
+
this.#Ct(), this.#ut = window.setTimeout(this.#Ps, t);
|
|
1913
1938
|
}
|
|
1914
1939
|
#se = () => {
|
|
1915
1940
|
if (!this.#m()) {
|
|
@@ -1929,24 +1954,24 @@ class A extends HTMLElement {
|
|
|
1929
1954
|
this.#N = !1, this.#te();
|
|
1930
1955
|
}
|
|
1931
1956
|
};
|
|
1932
|
-
#
|
|
1957
|
+
#Ze = (t) => {
|
|
1933
1958
|
if (t.preventDefault(), t.stopPropagation(), !this.#T()) {
|
|
1934
1959
|
this.#S();
|
|
1935
1960
|
return;
|
|
1936
1961
|
}
|
|
1937
1962
|
!this.#gt() || this.#Xt() || (this.#D(), this.#Ps(), this.#t.muted || this.#t.volume <= 0 ? (this.#t.volume <= 0 && (this.#t.volume = 0.7), this.#t.muted = !1) : this.#t.muted = !0, this.#y(), this.#R());
|
|
1938
1963
|
};
|
|
1939
|
-
#
|
|
1964
|
+
#Oe = (t) => {
|
|
1940
1965
|
if (t instanceof PointerEvent) {
|
|
1941
1966
|
if (t.preventDefault(), t.stopPropagation(), !this.#T() || !this.volumeSliderEnabled || this.#m()) {
|
|
1942
1967
|
this.#S();
|
|
1943
1968
|
return;
|
|
1944
1969
|
}
|
|
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.#
|
|
1970
|
+
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.#Os(t.clientY);
|
|
1946
1971
|
}
|
|
1947
1972
|
};
|
|
1948
1973
|
#Ke = (t) => {
|
|
1949
|
-
t instanceof PointerEvent && this.#F && (this.#n !== null && t.pointerId !== this.#n || (t.preventDefault(), t.stopPropagation(), this.#
|
|
1974
|
+
t instanceof PointerEvent && this.#F && (this.#n !== null && t.pointerId !== this.#n || (t.preventDefault(), t.stopPropagation(), this.#Os(t.clientY)));
|
|
1950
1975
|
};
|
|
1951
1976
|
#Ge = (t) => {
|
|
1952
1977
|
t instanceof PointerEvent && (this.#n !== null && t.pointerId !== this.#n || (t.stopPropagation(), this.#Pt(t.pointerId), this.#R()));
|
|
@@ -1990,10 +2015,10 @@ class A extends HTMLElement {
|
|
|
1990
2015
|
}
|
|
1991
2016
|
};
|
|
1992
2017
|
#ie = (t) => {
|
|
1993
|
-
this.#m() || this.#
|
|
2018
|
+
this.#m() || this.#p() || !(t instanceof PointerEvent) && !(t instanceof MouseEvent) || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
|
|
1994
2019
|
};
|
|
1995
2020
|
#re = () => {
|
|
1996
|
-
this.#
|
|
2021
|
+
this.#p() || this.#zs();
|
|
1997
2022
|
};
|
|
1998
2023
|
#ei = (t) => {
|
|
1999
2024
|
if (t instanceof PointerEvent) {
|
|
@@ -2049,14 +2074,14 @@ class A extends HTMLElement {
|
|
|
2049
2074
|
#ci = () => {
|
|
2050
2075
|
this.#ys() || this.#Yt();
|
|
2051
2076
|
};
|
|
2052
|
-
#ui = () => {
|
|
2053
|
-
this.#b = null, this.#H(), this.#u() || this.#l(), this.#p();
|
|
2054
|
-
};
|
|
2055
2077
|
#pi = () => {
|
|
2056
|
-
this.#b = null, this.#
|
|
2078
|
+
this.#b = null, this.#H(), this.#p() || this.#l(), this.#u();
|
|
2079
|
+
};
|
|
2080
|
+
#ui = () => {
|
|
2081
|
+
this.#b = null, this.#p() || this.#Zs(), this.#w(), this.#u();
|
|
2057
2082
|
};
|
|
2058
2083
|
#di = () => {
|
|
2059
|
-
this.#b = null, this.#H(), this.#
|
|
2084
|
+
this.#b = null, this.#H(), this.#p() || this.#l(), this.#u();
|
|
2060
2085
|
};
|
|
2061
2086
|
#mi = () => {
|
|
2062
2087
|
this.#yt(!0, !0);
|
|
@@ -2065,21 +2090,21 @@ class A extends HTMLElement {
|
|
|
2065
2090
|
this.#yt(!0);
|
|
2066
2091
|
};
|
|
2067
2092
|
#fi = () => {
|
|
2068
|
-
this.#H(), this.#y(), this.#
|
|
2093
|
+
this.#H(), this.#y(), this.#p() || this.#l(), this.#w(), this.#g();
|
|
2069
2094
|
};
|
|
2070
2095
|
#bi = () => {
|
|
2071
2096
|
const t = this.#Kt();
|
|
2072
|
-
this.#y(), t && !this.#
|
|
2097
|
+
this.#y(), t && !this.#p() && this.#l(), this.#u();
|
|
2073
2098
|
};
|
|
2074
2099
|
#vi = () => {
|
|
2075
2100
|
if (this.#H(), this.#w(), this.#I && (!this.#nt || this.#t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA)) {
|
|
2076
|
-
this.#_s(), this.#
|
|
2101
|
+
this.#_s(), this.#u();
|
|
2077
2102
|
return;
|
|
2078
2103
|
}
|
|
2079
|
-
this.#
|
|
2104
|
+
this.#p() || this.#l(), this.#g();
|
|
2080
2105
|
};
|
|
2081
2106
|
#gi = () => {
|
|
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.#
|
|
2107
|
+
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();
|
|
2083
2108
|
};
|
|
2084
2109
|
#yi = () => {
|
|
2085
2110
|
this.#y(), this.#g();
|
|
@@ -2091,7 +2116,7 @@ class A extends HTMLElement {
|
|
|
2091
2116
|
return window.matchMedia("(max-width: 768px)").matches && window.matchMedia("(hover: none), (pointer: coarse)").matches;
|
|
2092
2117
|
}
|
|
2093
2118
|
#xi() {
|
|
2094
|
-
this.#t && (this.#E?.disconnect(), this.#E = null, this.#
|
|
2119
|
+
this.#t && (this.#E?.disconnect(), this.#E = null, this.#Zt(), 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.#pt = !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());
|
|
2095
2120
|
}
|
|
2096
2121
|
}
|
|
2097
2122
|
customElements.get("simple-player") || customElements.define("simple-player", A);
|