@grizzshutsdown/simpleplayer 0.1.6 → 0.1.7
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/player/media.d.ts +3 -1
- package/dist/simple-player.js +961 -818
- package/dist/simple-player.js.map +1 -1
- package/package.json +1 -1
package/dist/simple-player.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var pi = (d) => {
|
|
3
|
-
throw TypeError(d);
|
|
4
|
-
};
|
|
5
|
-
var Yi = (d, p, i) => p in d ? Ui(d, p, { enumerable: !0, configurable: !0, writable: !0, value: i }) : d[p] = i;
|
|
6
|
-
var di = (d, p, i) => Yi(d, typeof p != "symbol" ? p + "" : p, i), _e = (d, p, i) => p.has(d) || pi("Cannot " + i);
|
|
7
|
-
var t = (d, p, i) => (_e(d, p, "read from private field"), i ? i.call(d) : p.get(d)), n = (d, p, i) => p.has(d) ? pi("Cannot add the same private member more than once") : p instanceof WeakSet ? p.add(d) : p.set(d, i), r = (d, p, i, a) => (_e(d, p, "write to private field"), a ? a.call(d, i) : p.set(d, i), i), e = (d, p, i) => (_e(d, p, "access private method"), i);
|
|
8
|
-
const mi = "16 / 9", Xi = "360px 0px", _i = [
|
|
1
|
+
const u = "16 / 9", m = "360px 0px", f = [
|
|
9
2
|
"src",
|
|
10
3
|
"aspect-ratio",
|
|
11
4
|
"preload-margin",
|
|
@@ -25,60 +18,69 @@ const mi = "16 / 9", Xi = "360px 0px", _i = [
|
|
|
25
18
|
"no-picture-in-picture",
|
|
26
19
|
"no-fullscreen"
|
|
27
20
|
];
|
|
28
|
-
function
|
|
29
|
-
const
|
|
30
|
-
return
|
|
21
|
+
function b(o) {
|
|
22
|
+
const t = document;
|
|
23
|
+
return o.fullscreenElement || document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement || null;
|
|
24
|
+
}
|
|
25
|
+
function v(o, t, s) {
|
|
26
|
+
const e = document, i = t, r = s, n = !!((document.fullscreenEnabled ?? e.webkitFullscreenEnabled ?? e.mozFullScreenEnabled ?? e.msFullscreenEnabled ?? !1) && (i.requestFullscreen || i.webkitRequestFullscreen || i.mozRequestFullScreen || i.msRequestFullscreen)), l = !!(r.webkitSupportsFullscreen || r.webkitEnterFullscreen || r.webkitEnterFullScreen);
|
|
27
|
+
return !!(o && (n || l));
|
|
31
28
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
34
|
-
return
|
|
29
|
+
function g(o) {
|
|
30
|
+
const t = o, s = t.requestFullscreen || t.webkitRequestFullscreen || t.mozRequestFullScreen || t.msRequestFullscreen;
|
|
31
|
+
return Promise.resolve(s?.call(t));
|
|
35
32
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
return
|
|
33
|
+
function y(o) {
|
|
34
|
+
const t = o;
|
|
35
|
+
return typeof t.requestFullscreen == "function" || typeof t.webkitRequestFullscreen == "function" || typeof t.mozRequestFullScreen == "function" || typeof t.msRequestFullscreen == "function";
|
|
39
36
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
|
|
37
|
+
function w(o) {
|
|
38
|
+
const t = o;
|
|
39
|
+
(t.webkitEnterFullscreen || t.webkitEnterFullScreen)?.call(t);
|
|
43
40
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
|
|
41
|
+
function x() {
|
|
42
|
+
const o = document, t = document.exitFullscreen || o.webkitExitFullscreen || o.mozCancelFullScreen || o.msExitFullscreen;
|
|
43
|
+
return Promise.resolve(t?.call(o));
|
|
47
44
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
function a(o) {
|
|
46
|
+
if (!Number.isFinite(o) || o < 0) return "0:00";
|
|
47
|
+
const t = Math.floor(o), s = t % 60, e = Math.floor(t / 60), i = e % 60, r = Math.floor(e / 60);
|
|
48
|
+
return r > 0 ? r + ":" + String(i).padStart(2, "0") + ":" + String(s).padStart(2, "0") : i + ":" + String(s).padStart(2, "0");
|
|
51
49
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
function k(o) {
|
|
51
|
+
const t = o;
|
|
52
|
+
if (t.audioTracks && typeof t.audioTracks.length == "number")
|
|
53
|
+
return t.audioTracks.length > 0 ? "available" : "unavailable";
|
|
54
|
+
const s = o;
|
|
55
|
+
if (typeof s.mozHasAudio == "boolean")
|
|
56
|
+
return s.mozHasAudio ? "available" : "unavailable";
|
|
57
|
+
const e = o, i = e.captureStream ?? e.mozCaptureStream;
|
|
58
|
+
if (i && o.readyState >= HTMLMediaElement.HAVE_METADATA)
|
|
59
|
+
try {
|
|
60
|
+
return i.call(o).getAudioTracks().length > 0 ? "available" : "unavailable";
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
const r = o;
|
|
64
|
+
return typeof r.webkitAudioDecodedByteCount == "number" && o.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && o.currentTime > 0.25 ? r.webkitAudioDecodedByteCount > 0 ? "available" : "unavailable" : "unknown";
|
|
56
65
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
59
|
-
if (i.audioTracks && typeof i.audioTracks.length == "number")
|
|
60
|
-
return i.audioTracks.length > 0;
|
|
61
|
-
const a = d;
|
|
62
|
-
if (typeof a.mozHasAudio == "boolean")
|
|
63
|
-
return a.mozHasAudio;
|
|
64
|
-
const l = d;
|
|
65
|
-
return typeof l.webkitAudioDecodedByteCount == "number" && d.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && !d.muted && d.currentTime > 0.25 ? l.webkitAudioDecodedByteCount > 0 : p;
|
|
66
|
+
function P(o) {
|
|
67
|
+
return typeof o.webkitAudioDecodedByteCount == "number" && o.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && o.currentTime <= 0.25;
|
|
66
68
|
}
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
return { rect:
|
|
69
|
+
function c(o) {
|
|
70
|
+
const t = Math.min(2, Math.max(0, o.width / 2)), s = Math.max(1, o.width - t * 2);
|
|
71
|
+
return { rect: o, sideInset: t, innerWidth: s };
|
|
70
72
|
}
|
|
71
|
-
function
|
|
72
|
-
const { sideInset:
|
|
73
|
-
return
|
|
73
|
+
function T(o, t) {
|
|
74
|
+
const { sideInset: s, innerWidth: e } = c(t), i = Math.min(1, Math.max(0, o));
|
|
75
|
+
return s + i * e;
|
|
74
76
|
}
|
|
75
|
-
function
|
|
76
|
-
const { sideInset:
|
|
77
|
-
return Math.min(1, Math.max(0, (
|
|
77
|
+
function E(o, t) {
|
|
78
|
+
const { sideInset: s, innerWidth: e } = c(t);
|
|
79
|
+
return Math.min(1, Math.max(0, (o - t.left - s) / e));
|
|
78
80
|
}
|
|
79
|
-
const
|
|
81
|
+
const C = `
|
|
80
82
|
:host {
|
|
81
|
-
--simple-player-aspect-ratio: ${
|
|
83
|
+
--simple-player-aspect-ratio: ${u};
|
|
82
84
|
--space: 4px;
|
|
83
85
|
--white: #fff;
|
|
84
86
|
--black: #000;
|
|
@@ -534,13 +536,23 @@ const sr = `
|
|
|
534
536
|
|
|
535
537
|
.sp-player.is-volume-unavailable [data-sp-volume-control] {
|
|
536
538
|
cursor: default;
|
|
537
|
-
pointer-events:
|
|
539
|
+
pointer-events: auto;
|
|
538
540
|
}
|
|
539
541
|
|
|
540
542
|
.sp-player.is-volume-unavailable .sp-volume-icon {
|
|
541
543
|
transition: none;
|
|
542
544
|
}
|
|
543
545
|
|
|
546
|
+
.sp-player.is-volume-unavailable [data-sp-volume-control]:hover {
|
|
547
|
+
background: transparent;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.sp-player.is-volume-unavailable [data-sp-volume-control]:hover .sp-control-icon,
|
|
551
|
+
.sp-player.is-volume-unavailable [data-sp-volume-control].is-control-tap-active .sp-control-icon {
|
|
552
|
+
opacity: var(--sp-control-icon-opacity);
|
|
553
|
+
transform: translateY(0) scale(1);
|
|
554
|
+
}
|
|
555
|
+
|
|
544
556
|
.sp-player.is-volume-unavailable .sp-control-tray-slots:has([data-sp-volume-control]:hover)::before,
|
|
545
557
|
.sp-player.is-volume-unavailable .sp-control-tray-slots:has([data-sp-volume-control].is-control-tap-active)::before {
|
|
546
558
|
opacity: 0;
|
|
@@ -849,29 +861,33 @@ const sr = `
|
|
|
849
861
|
position: relative;
|
|
850
862
|
right: auto;
|
|
851
863
|
bottom: auto;
|
|
852
|
-
width: var(--sp-tray-time-width,
|
|
864
|
+
width: calc(var(--sp-tray-time-width, 40px) + (var(--sp-control-tray-padding) * 2));
|
|
865
|
+
height: calc(var(--sp-control-slot-size) + (var(--sp-control-tray-padding) * 2));
|
|
853
866
|
transition: width 240ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
854
867
|
overflow: hidden;
|
|
855
868
|
}
|
|
856
869
|
|
|
857
870
|
.sp-tray-time-holder .sp-control-tray-slots {
|
|
858
871
|
position: relative;
|
|
859
|
-
width:
|
|
872
|
+
width: 100%;
|
|
873
|
+
height: 100%;
|
|
860
874
|
}
|
|
861
875
|
|
|
862
876
|
.sp-tray-time-holder .sp-control-tray-slots::before {
|
|
863
877
|
width: calc(100% - (var(--sp-control-tray-padding) * 2));
|
|
878
|
+
opacity: var(--sp-control-hover-opacity);
|
|
864
879
|
}
|
|
865
880
|
|
|
866
881
|
.sp-tray-time-holder .sp-tray-time-text {
|
|
867
882
|
aspect-ratio: auto;
|
|
868
|
-
|
|
869
|
-
width: auto;
|
|
883
|
+
width: 100%;
|
|
870
884
|
height: var(--sp-control-slot-size);
|
|
871
885
|
max-height: var(--sp-control-slot-size);
|
|
872
886
|
padding: 0 8px;
|
|
873
887
|
font: 600 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
874
888
|
font-variant-numeric: tabular-nums;
|
|
889
|
+
color: var(--white);
|
|
890
|
+
border-radius: 3px;
|
|
875
891
|
}
|
|
876
892
|
|
|
877
893
|
.sp-tray-time-text {
|
|
@@ -1018,9 +1034,9 @@ const sr = `
|
|
|
1018
1034
|
transform: translateY(0) scale(1);
|
|
1019
1035
|
}
|
|
1020
1036
|
}
|
|
1021
|
-
`,
|
|
1022
|
-
|
|
1023
|
-
<style>${
|
|
1037
|
+
`, p = document.createElement("template");
|
|
1038
|
+
p.innerHTML = `
|
|
1039
|
+
<style>${C}</style>
|
|
1024
1040
|
<div class="sp-player is-loading" data-sp-player>
|
|
1025
1041
|
<video
|
|
1026
1042
|
class="sp-video sp-asset"
|
|
@@ -1105,402 +1121,124 @@ fi.innerHTML = `
|
|
|
1105
1121
|
</div>
|
|
1106
1122
|
</div>
|
|
1107
1123
|
`;
|
|
1108
|
-
|
|
1109
|
-
|
|
1124
|
+
class A extends HTMLElement {
|
|
1125
|
+
static observedAttributes = f;
|
|
1126
|
+
#r;
|
|
1127
|
+
#At = [];
|
|
1128
|
+
#E = null;
|
|
1129
|
+
#ts = !1;
|
|
1130
|
+
#C = !1;
|
|
1131
|
+
#s;
|
|
1132
|
+
#t;
|
|
1133
|
+
#M;
|
|
1134
|
+
#i;
|
|
1135
|
+
#V;
|
|
1136
|
+
#j;
|
|
1137
|
+
#oe;
|
|
1138
|
+
#m;
|
|
1139
|
+
#ss;
|
|
1140
|
+
#Es;
|
|
1141
|
+
#o;
|
|
1142
|
+
#z;
|
|
1143
|
+
#p;
|
|
1144
|
+
#O;
|
|
1145
|
+
#Z;
|
|
1146
|
+
#K = [];
|
|
1147
|
+
#ot = 0;
|
|
1148
|
+
#a = !1;
|
|
1149
|
+
#x = !1;
|
|
1150
|
+
#G = !1;
|
|
1151
|
+
#f = 0;
|
|
1152
|
+
#Lt = 0;
|
|
1153
|
+
#J = 0;
|
|
1154
|
+
#Ft = !1;
|
|
1155
|
+
#I = !1;
|
|
1156
|
+
#nt = !1;
|
|
1157
|
+
#es = 0;
|
|
1158
|
+
#St = 0;
|
|
1159
|
+
#h = null;
|
|
1160
|
+
#b = null;
|
|
1161
|
+
#is = 0;
|
|
1162
|
+
#Q = 0;
|
|
1163
|
+
#at = 0;
|
|
1164
|
+
#lt = 0;
|
|
1165
|
+
#tt = 0;
|
|
1166
|
+
#Cs = 0;
|
|
1167
|
+
#rs = 0;
|
|
1168
|
+
#Mt = null;
|
|
1169
|
+
#A = !1;
|
|
1170
|
+
#L = !1;
|
|
1171
|
+
#q = !1;
|
|
1172
|
+
#B = !1;
|
|
1173
|
+
#$ = 0;
|
|
1174
|
+
#Vt = 0;
|
|
1175
|
+
#ht = !1;
|
|
1176
|
+
#As = 0;
|
|
1177
|
+
#zt = !0;
|
|
1178
|
+
#Ls = 0;
|
|
1179
|
+
#Fs = performance.now();
|
|
1180
|
+
#ct = 0;
|
|
1181
|
+
#k = null;
|
|
1182
|
+
#st = null;
|
|
1183
|
+
#It = !1;
|
|
1184
|
+
#v = !1;
|
|
1185
|
+
#Rt = !1;
|
|
1186
|
+
#ut = !1;
|
|
1187
|
+
#U = !1;
|
|
1188
|
+
#os = null;
|
|
1189
|
+
#ns = null;
|
|
1190
|
+
#Dt = !1;
|
|
1191
|
+
#F = !1;
|
|
1192
|
+
#N = !1;
|
|
1193
|
+
#n = null;
|
|
1194
|
+
#pt = 0;
|
|
1195
|
+
#dt = 0;
|
|
1196
|
+
#mt = 0;
|
|
1197
|
+
#as = null;
|
|
1198
|
+
#ls = !1;
|
|
1199
|
+
#ft = 0;
|
|
1200
|
+
#ne = 4;
|
|
1201
|
+
#ae = 3.5;
|
|
1202
|
+
#hs = 6;
|
|
1203
|
+
#le = 0.08;
|
|
1204
|
+
#he = 240;
|
|
1205
|
+
#Ss = 1200;
|
|
1206
|
+
#Ht = 1600;
|
|
1207
|
+
#ce = 140;
|
|
1208
|
+
#ue = 380;
|
|
1209
|
+
#pe = 650;
|
|
1210
|
+
#de = 2e3;
|
|
1211
|
+
#me = 3;
|
|
1212
|
+
#fe = 10;
|
|
1213
|
+
#qt = 0.18;
|
|
1214
|
+
#be = 8;
|
|
1215
|
+
#ve = 18;
|
|
1110
1216
|
constructor() {
|
|
1111
|
-
super();
|
|
1112
|
-
n(this, s);
|
|
1113
|
-
n(this, b);
|
|
1114
|
-
n(this, St, []);
|
|
1115
|
-
n(this, H, null);
|
|
1116
|
-
n(this, ss, !1);
|
|
1117
|
-
n(this, B, !1);
|
|
1118
|
-
n(this, h);
|
|
1119
|
-
n(this, o);
|
|
1120
|
-
n(this, Y);
|
|
1121
|
-
n(this, m);
|
|
1122
|
-
n(this, X);
|
|
1123
|
-
n(this, j);
|
|
1124
|
-
n(this, Js);
|
|
1125
|
-
n(this, L);
|
|
1126
|
-
n(this, es);
|
|
1127
|
-
n(this, ks);
|
|
1128
|
-
n(this, w);
|
|
1129
|
-
n(this, O);
|
|
1130
|
-
n(this, T);
|
|
1131
|
-
n(this, et);
|
|
1132
|
-
n(this, it);
|
|
1133
|
-
n(this, rt, []);
|
|
1134
|
-
n(this, vt, 0);
|
|
1135
|
-
n(this, g, !1);
|
|
1136
|
-
n(this, R, !1);
|
|
1137
|
-
n(this, ot, !1);
|
|
1138
|
-
n(this, F, 0);
|
|
1139
|
-
n(this, Mt, 0);
|
|
1140
|
-
n(this, nt, 0);
|
|
1141
|
-
n(this, Vt, !1);
|
|
1142
|
-
n(this, _, !1);
|
|
1143
|
-
n(this, gt, !1);
|
|
1144
|
-
n(this, is, 0);
|
|
1145
|
-
n(this, zt, 0);
|
|
1146
|
-
n(this, P, null);
|
|
1147
|
-
n(this, S, null);
|
|
1148
|
-
n(this, rs, 0);
|
|
1149
|
-
n(this, at, 0);
|
|
1150
|
-
n(this, yt, 0);
|
|
1151
|
-
n(this, wt, 0);
|
|
1152
|
-
n(this, lt, 0);
|
|
1153
|
-
n(this, Ps, 0);
|
|
1154
|
-
n(this, os, 0);
|
|
1155
|
-
n(this, It, null);
|
|
1156
|
-
n(this, $, !1);
|
|
1157
|
-
n(this, N, !1);
|
|
1158
|
-
n(this, Z, !1);
|
|
1159
|
-
n(this, K, !1);
|
|
1160
|
-
n(this, G, 0);
|
|
1161
|
-
n(this, Rt, 0);
|
|
1162
|
-
n(this, xt, !1);
|
|
1163
|
-
n(this, Ts, 0);
|
|
1164
|
-
n(this, Dt, !0);
|
|
1165
|
-
n(this, Es, 0);
|
|
1166
|
-
n(this, Cs, performance.now());
|
|
1167
|
-
n(this, kt, 0);
|
|
1168
|
-
n(this, D, null);
|
|
1169
|
-
n(this, ht, null);
|
|
1170
|
-
n(this, qt, !1);
|
|
1171
|
-
n(this, M, !1);
|
|
1172
|
-
n(this, y, !0);
|
|
1173
|
-
n(this, J, !1);
|
|
1174
|
-
n(this, ns, null);
|
|
1175
|
-
n(this, as, null);
|
|
1176
|
-
n(this, Ht, !1);
|
|
1177
|
-
n(this, W, !1);
|
|
1178
|
-
n(this, ct, !1);
|
|
1179
|
-
n(this, x, null);
|
|
1180
|
-
n(this, Pt, 0);
|
|
1181
|
-
n(this, Tt, 0);
|
|
1182
|
-
n(this, Et, 0);
|
|
1183
|
-
n(this, ls, null);
|
|
1184
|
-
n(this, hs, !1);
|
|
1185
|
-
n(this, Ct, 0);
|
|
1186
|
-
n(this, Qs, 4);
|
|
1187
|
-
n(this, te, 3.5);
|
|
1188
|
-
n(this, cs, 6);
|
|
1189
|
-
n(this, se, 0.08);
|
|
1190
|
-
n(this, ee, 240);
|
|
1191
|
-
n(this, As, 1200);
|
|
1192
|
-
n(this, Bt, 1600);
|
|
1193
|
-
n(this, ie, 140);
|
|
1194
|
-
n(this, re, 380);
|
|
1195
|
-
n(this, oe, 650);
|
|
1196
|
-
n(this, ne, 2e3);
|
|
1197
|
-
n(this, ae, 3);
|
|
1198
|
-
n(this, le, 10);
|
|
1199
|
-
n(this, $t, 0.18);
|
|
1200
|
-
n(this, he, 8);
|
|
1201
|
-
n(this, ce, 18);
|
|
1202
|
-
n(this, Nt, (i) => {
|
|
1203
|
-
i.preventDefault();
|
|
1204
|
-
});
|
|
1205
|
-
n(this, ue, () => {
|
|
1206
|
-
if (r(this, yt, 0), !(t(this, R) || t(this, g) || t(this, W))) {
|
|
1207
|
-
if (e(this, s, A).call(this)) {
|
|
1208
|
-
t(this, h).classList.remove("is-controls-visible");
|
|
1209
|
-
return;
|
|
1210
|
-
}
|
|
1211
|
-
t(this, J) || t(this, h).classList.remove("is-pointer-active");
|
|
1212
|
-
}
|
|
1213
|
-
});
|
|
1214
|
-
n(this, Ut, (i) => {
|
|
1215
|
-
e(this, s, Ot).call(this, i) && e(this, s, Ys).call(this, !0);
|
|
1216
|
-
});
|
|
1217
|
-
n(this, Yt, (i) => {
|
|
1218
|
-
e(this, s, Ot).call(this, i) && ((i instanceof PointerEvent || i instanceof MouseEvent) && e(this, s, Ke).call(this, i.clientX, i.clientY), e(this, s, Ys).call(this, !0));
|
|
1219
|
-
});
|
|
1220
|
-
n(this, Ls, (i) => {
|
|
1221
|
-
e(this, s, Ot).call(this, i) && ((i instanceof PointerEvent || i instanceof MouseEvent) && e(this, s, Ke).call(this, i.clientX, i.clientY), e(this, s, Ge).call(this));
|
|
1222
|
-
});
|
|
1223
|
-
n(this, Xt, () => {
|
|
1224
|
-
e(this, s, bs).call(this);
|
|
1225
|
-
});
|
|
1226
|
-
n(this, ut, (i) => {
|
|
1227
|
-
e(this, s, Ot).call(this, i) && (r(this, J, !0), t(this, h).classList.add("is-pointer-active"), e(this, s, U).call(this));
|
|
1228
|
-
});
|
|
1229
|
-
n(this, pt, () => {
|
|
1230
|
-
r(this, J, !1), e(this, s, fs).call(this, t(this, Bt));
|
|
1231
|
-
});
|
|
1232
|
-
n(this, Fs, () => {
|
|
1233
|
-
e(this, s, A).call(this) ? t(this, h).classList.add("is-controls-visible") : t(this, h).classList.add("is-pointer-active"), e(this, s, U).call(this);
|
|
1234
|
-
});
|
|
1235
|
-
n(this, pe, () => {
|
|
1236
|
-
e(this, s, fs).call(this, t(this, Bt));
|
|
1237
|
-
});
|
|
1238
|
-
n(this, Ss, (i) => {
|
|
1239
|
-
const a = i.currentTarget;
|
|
1240
|
-
if (e(this, s, Xs).call(this, a)) {
|
|
1241
|
-
t(this, j).style.removeProperty("--sp-control-hover-offset");
|
|
1242
|
-
return;
|
|
1243
|
-
}
|
|
1244
|
-
const u = Number(a.dataset.spControlIndex ?? 0);
|
|
1245
|
-
t(this, j).style.setProperty("--sp-control-hover-offset", `calc(var(--sp-control-slot-size) * ${u})`);
|
|
1246
|
-
});
|
|
1247
|
-
n(this, Ms, () => {
|
|
1248
|
-
r(this, Et, 0), t(this, rt).forEach((i) => i.classList.remove("is-control-tap-active")), this.style.removeProperty("--sp-touch-control-hover-offset");
|
|
1249
|
-
});
|
|
1250
|
-
n(this, de, (i) => {
|
|
1251
|
-
if (!(i instanceof PointerEvent) || i.pointerType !== "touch") return;
|
|
1252
|
-
const a = i.currentTarget;
|
|
1253
|
-
if (!a || !e(this, s, Zt).call(this) || e(this, s, Xs).call(this, a)) return;
|
|
1254
|
-
const l = Number(a.dataset.spControlIndex ?? 0);
|
|
1255
|
-
e(this, s, _s).call(this), t(this, rt).forEach((u) => u.classList.toggle("is-control-tap-active", u === a)), this.style.setProperty("--sp-touch-control-hover-offset", `calc(var(--sp-control-slot-size) * ${l})`), r(this, Et, window.setTimeout(t(this, Ms), 280));
|
|
1256
|
-
});
|
|
1257
|
-
n(this, Vs, () => {
|
|
1258
|
-
if (t(this, lt) || t(this, h).classList.contains("is-progress-settling")) {
|
|
1259
|
-
if (e(this, s, Ws).call(this), t(this, xt)) {
|
|
1260
|
-
t(this, h).classList.remove("is-progress-settling");
|
|
1261
|
-
return;
|
|
1262
|
-
}
|
|
1263
|
-
r(this, xt, !0), r(this, Ts, performance.now() + t(this, oe)), e(this, s, E).call(this) || e(this, s, k).call(this), e(this, s, I).call(this), t(this, h).classList.remove("is-progress-settling"), e(this, s, C).call(this);
|
|
1264
|
-
}
|
|
1265
|
-
});
|
|
1266
|
-
n(this, z, () => {
|
|
1267
|
-
if (t(this, o).error) {
|
|
1268
|
-
e(this, s, Kt).call(this, !0, !0);
|
|
1269
|
-
return;
|
|
1270
|
-
}
|
|
1271
|
-
e(this, s, Kt).call(this, !t(this, B) || !t(this, N) || t(this, o).readyState < HTMLMediaElement.HAVE_FUTURE_DATA);
|
|
1272
|
-
});
|
|
1273
|
-
n(this, _t, () => {
|
|
1274
|
-
if (t(this, o).error || t(this, o).readyState < HTMLMediaElement.HAVE_CURRENT_DATA || t(this, o).videoWidth <= 0 || t(this, o).videoHeight <= 0)
|
|
1275
|
-
return t(this, z).call(this), !1;
|
|
1276
|
-
if (!t(this, $))
|
|
1277
|
-
return e(this, s, Ti).call(this), t(this, z).call(this), !1;
|
|
1278
|
-
const i = e(this, s, ii).call(this);
|
|
1279
|
-
return t(this, V).call(this), i;
|
|
1280
|
-
});
|
|
1281
|
-
n(this, V, () => {
|
|
1282
|
-
if (!this.volumeEnabled) {
|
|
1283
|
-
t(this, h).classList.remove("is-volume-unavailable", "is-volume-muted", "is-volume-sound", "is-volume-icon-animating"), t(this, w).disabled = !0, t(this, w).setAttribute("aria-disabled", "true");
|
|
1284
|
-
return;
|
|
1285
|
-
}
|
|
1286
|
-
r(this, y, e(this, s, zi).call(this));
|
|
1287
|
-
const i = !t(this, y) || t(this, o).muted || t(this, o).volume <= 0, a = t(this, y) && !t(this, o).muted ? t(this, o).volume : 0, l = Math.round(a * 100), u = i ? "muted" : "sound";
|
|
1288
|
-
t(this, ls) && t(this, ls) !== u && e(this, s, yi).call(this), r(this, ls, u), t(this, h).classList.toggle("is-volume-unavailable", !t(this, y)), t(this, h).classList.toggle("is-volume-muted", i), t(this, h).classList.toggle("is-volume-sound", !i), t(this, h).style.setProperty("--sp-volume-level", `${l}%`), t(this, w).disabled = !t(this, y), t(this, w).setAttribute("aria-disabled", `${!t(this, y)}`), t(this, w).setAttribute(
|
|
1289
|
-
"aria-label",
|
|
1290
|
-
t(this, y) ? i ? "Unmute video" : "Mute video" : "Video has no audio"
|
|
1291
|
-
), t(this, T).setAttribute("aria-valuenow", `${l}`), t(this, T).setAttribute("aria-valuetext", `${l}%`);
|
|
1292
|
-
});
|
|
1293
|
-
n(this, At, () => {
|
|
1294
|
-
const i = document.pictureInPictureElement === t(this, o), a = t(this, o), l = !!(this.pictureInPictureEnabled && document.pictureInPictureEnabled && a.requestPictureInPicture);
|
|
1295
|
-
t(this, h).classList.toggle("is-picture-in-picture", i), t(this, et).disabled = !l, t(this, et).setAttribute("aria-label", i ? "Exit picture in picture" : "Enter picture in picture");
|
|
1296
|
-
});
|
|
1297
|
-
n(this, Wt, () => {
|
|
1298
|
-
const i = e(this, s, Os).call(this), a = i === t(this, h) || i === this, l = e(this, s, ai).call(this);
|
|
1299
|
-
return t(this, h).classList.toggle("is-fullscreen", a), t(this, it).disabled = !l, t(this, it).setAttribute("aria-label", a ? "Exit fullscreen" : "Enter fullscreen"), a;
|
|
1300
|
-
});
|
|
1301
|
-
n(this, Lt, () => {
|
|
1302
|
-
const i = t(this, Wt).call(this);
|
|
1303
|
-
e(this, s, qi).call(this, i);
|
|
1304
|
-
});
|
|
1305
|
-
n(this, zs, () => {
|
|
1306
|
-
!t(this, R) || t(this, g) || (e(this, s, st).call(this), e(this, s, U).call(this), e(this, s, Ft).call(this), r(this, g, !0), t(this, h).classList.add("is-scrubbing"), r(this, F, e(this, s, bt).call(this, t(this, is), !0)), t(this, ot) && t(this, o).pause(), t(this, o).currentTime = t(this, F), e(this, s, k).call(this, t(this, F)), e(this, s, I).call(this, t(this, F)), e(this, s, Qt).call(this), e(this, s, C).call(this));
|
|
1307
|
-
});
|
|
1308
|
-
n(this, me, (i) => {
|
|
1309
|
-
i.stopPropagation(), r(this, hs, !t(this, hs)), e(this, s, Bi).call(this), e(this, s, E).call(this) || t(this, M) ? t(this, L) && (t(this, L).textContent = e(this, s, Gs).call(this, t(this, F))) : e(this, s, Gt).call(this, e(this, s, mt).call(this));
|
|
1310
|
-
});
|
|
1311
|
-
n(this, fe, async () => {
|
|
1312
|
-
if (performance.now() < t(this, Ps))
|
|
1313
|
-
return;
|
|
1314
|
-
const i = t(this, S) ? t(this, S) !== "playing" : t(this, o).paused || t(this, o).ended, a = !i || e(this, s, ki).call(this);
|
|
1315
|
-
e(this, s, tt).call(this), a && (r(this, S, i ? "playing" : "paused"), e(this, s, C).call(this)), i ? (e(this, s, st).call(this), await e(this, s, dt).call(this), await t(this, o).play().catch(() => {
|
|
1316
|
-
r(this, S, null);
|
|
1317
|
-
})) : (e(this, s, Ei).call(this), t(this, o).pause()), e(this, s, C).call(this), e(this, s, Q).call(this);
|
|
1318
|
-
});
|
|
1319
|
-
n(this, be, (i) => {
|
|
1320
|
-
if (!(i instanceof PointerEvent)) return;
|
|
1321
|
-
const a = t(this, Y).getBoundingClientRect(), l = i.clientX >= a.left && i.clientX <= a.right && i.clientY >= a.top && i.clientY <= a.bottom, u = t(this, X).getBoundingClientRect(), f = i.clientX >= u.left && i.clientX <= u.right && i.clientY >= u.top && i.clientY <= u.bottom, v = t(this, m).getBoundingClientRect(), Hs = i.clientX >= v.left && i.clientX <= v.right && i.clientY >= v.top && i.clientY <= v.bottom, ds = e(this, s, tt).call(this);
|
|
1322
|
-
ds && l && r(this, Ps, performance.now() + 260), ds && (f || Hs) && r(this, os, performance.now() + 260), e(this, s, dt).call(this);
|
|
1323
|
-
});
|
|
1324
|
-
n(this, ve, (i) => {
|
|
1325
|
-
i.stopPropagation();
|
|
1326
|
-
});
|
|
1327
|
-
n(this, us, () => {
|
|
1328
|
-
r(this, Pt, 0), !(t(this, ct) || t(this, W)) && t(this, w).classList.remove("is-volume-open");
|
|
1329
|
-
});
|
|
1330
|
-
n(this, Is, () => {
|
|
1331
|
-
e(this, s, A).call(this) || !this.volumeSliderEnabled || !t(this, y) || (r(this, ct, !0), e(this, s, hi).call(this));
|
|
1332
|
-
});
|
|
1333
|
-
n(this, Rs, () => {
|
|
1334
|
-
e(this, s, A).call(this) || !this.volumeSliderEnabled || !t(this, y) || (r(this, ct, !1), e(this, s, ci).call(this));
|
|
1335
|
-
});
|
|
1336
|
-
n(this, ge, (i) => {
|
|
1337
|
-
!this.volumeEnabled || !t(this, y) || (i.preventDefault(), i.stopPropagation(), !(!e(this, s, Zt).call(this) || e(this, s, vs).call(this)) && (e(this, s, tt).call(this), t(this, us).call(this), t(this, o).muted || t(this, o).volume <= 0 ? (t(this, o).volume <= 0 && (t(this, o).volume = 0.7), t(this, o).muted = !1) : t(this, o).muted = !0, t(this, V).call(this), e(this, s, Q).call(this)));
|
|
1338
|
-
});
|
|
1339
|
-
n(this, ye, (i) => {
|
|
1340
|
-
i instanceof PointerEvent && (!this.volumeEnabled || !this.volumeSliderEnabled || !t(this, y) || e(this, s, A).call(this) || (i.preventDefault(), i.stopPropagation(), e(this, s, tt).call(this), e(this, s, U).call(this), e(this, s, hi).call(this), r(this, W, !0), r(this, x, i.pointerId), t(this, O).classList.add("is-scrubbing-volume"), t(this, T).setPointerCapture(i.pointerId), e(this, s, ni).call(this, i.clientY)));
|
|
1341
|
-
});
|
|
1342
|
-
n(this, we, (i) => {
|
|
1343
|
-
i instanceof PointerEvent && t(this, W) && (t(this, x) !== null && i.pointerId !== t(this, x) || (i.preventDefault(), i.stopPropagation(), e(this, s, ni).call(this, i.clientY)));
|
|
1344
|
-
});
|
|
1345
|
-
n(this, xe, (i) => {
|
|
1346
|
-
i instanceof PointerEvent && (t(this, x) !== null && i.pointerId !== t(this, x) || (i.stopPropagation(), e(this, s, ts).call(this, i.pointerId), e(this, s, Q).call(this)));
|
|
1347
|
-
});
|
|
1348
|
-
n(this, ke, (i) => {
|
|
1349
|
-
i instanceof PointerEvent && (t(this, x) !== null && i.pointerId !== t(this, x) || (i.stopPropagation(), e(this, s, ts).call(this, i.pointerId)));
|
|
1350
|
-
});
|
|
1351
|
-
n(this, Pe, (i) => {
|
|
1352
|
-
if (!(i instanceof KeyboardEvent) || !this.volumeEnabled || !t(this, y) || !["ArrowUp", "ArrowDown", "Home", "End"].includes(i.key)) return;
|
|
1353
|
-
i.preventDefault(), i.stopPropagation();
|
|
1354
|
-
const a = i.shiftKey ? 0.1 : 0.05, l = i.key === "Home" ? 0 : i.key === "End" ? 1 : t(this, o).volume + (i.key === "ArrowUp" ? a : -a);
|
|
1355
|
-
t(this, o).volume = Math.min(1, Math.max(0, l)), t(this, o).muted = t(this, o).volume <= 0, t(this, V).call(this);
|
|
1356
|
-
});
|
|
1357
|
-
n(this, Te, async () => {
|
|
1358
|
-
const i = t(this, o);
|
|
1359
|
-
if (!(!this.pictureInPictureEnabled || !document.pictureInPictureEnabled || !i.requestPictureInPicture) && !(!e(this, s, Zt).call(this) || e(this, s, vs).call(this))) {
|
|
1360
|
-
e(this, s, tt).call(this);
|
|
1361
|
-
try {
|
|
1362
|
-
await e(this, s, dt).call(this), document.pictureInPictureElement === t(this, o) ? await document.exitPictureInPicture() : await i.requestPictureInPicture();
|
|
1363
|
-
} catch {
|
|
1364
|
-
} finally {
|
|
1365
|
-
t(this, At).call(this), e(this, s, Q).call(this);
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
});
|
|
1369
|
-
n(this, Ee, async (i) => {
|
|
1370
|
-
if (e(this, s, ai).call(this) && (i.preventDefault(), i.stopPropagation(), !(!e(this, s, Zt).call(this) || e(this, s, vs).call(this)))) {
|
|
1371
|
-
e(this, s, Ot).call(this, i), e(this, s, tt).call(this);
|
|
1372
|
-
try {
|
|
1373
|
-
const a = e(this, s, Os).call(this);
|
|
1374
|
-
a === t(this, h) || a === this ? await e(this, s, Di).call(this) : (await e(this, s, dt).call(this), Zi(t(this, h)) ? await e(this, s, Ii).call(this) : e(this, s, Ri).call(this));
|
|
1375
|
-
} catch {
|
|
1376
|
-
} finally {
|
|
1377
|
-
t(this, Wt).call(this), e(this, s, Q).call(this);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
n(this, Ds, (i) => {
|
|
1382
|
-
e(this, s, A).call(this) || e(this, s, E).call(this) || !(i instanceof PointerEvent) && !(i instanceof MouseEvent) || (r(this, M, !0), t(this, h).classList.add("is-progress-hovering"), e(this, s, bt).call(this, i.clientX, !1, !1));
|
|
1383
|
-
});
|
|
1384
|
-
n(this, qs, () => {
|
|
1385
|
-
e(this, s, E).call(this) || e(this, s, Ze).call(this);
|
|
1386
|
-
});
|
|
1387
|
-
n(this, Ce, (i) => {
|
|
1388
|
-
if (i instanceof PointerEvent) {
|
|
1389
|
-
if (i.preventDefault(), !e(this, s, Zt).call(this) || e(this, s, vs).call(this)) {
|
|
1390
|
-
e(this, s, tt).call(this), e(this, s, A).call(this) && r(this, os, performance.now() + 260);
|
|
1391
|
-
return;
|
|
1392
|
-
}
|
|
1393
|
-
e(this, s, tt).call(this), e(this, s, U).call(this), t(this, Vs).call(this), r(this, _, !1), r(this, gt, !1), e(this, s, Fi).call(this, e(this, s, mt).call(this)), r(this, R, !0), r(this, P, i.pointerId), r(this, is, i.clientX), r(this, ot, !t(this, o).paused && !t(this, o).ended), t(this, m).setPointerCapture(i.pointerId), r(this, F, e(this, s, bt).call(this, i.clientX, !1)), e(this, s, Ft).call(this), r(this, zt, window.setTimeout(t(this, zs), t(this, ee)));
|
|
1394
|
-
}
|
|
1395
|
-
});
|
|
1396
|
-
n(this, Ae, (i) => {
|
|
1397
|
-
if (!(i instanceof KeyboardEvent) || !Number.isFinite(t(this, o).duration) || t(this, o).duration <= 0 || !["ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown"].includes(i.key)) return;
|
|
1398
|
-
i.preventDefault(), i.stopPropagation(), t(this, Fs).call(this);
|
|
1399
|
-
const a = e(this, s, mt).call(this), l = i.shiftKey ? 10 : 5, u = Math.max(10, t(this, o).duration * 0.1), f = i.key === "Home" ? 0 : i.key === "End" ? t(this, o).duration : i.key === "PageUp" ? a + u : i.key === "PageDown" ? a - u : a + (i.key === "ArrowRight" ? l : -l);
|
|
1400
|
-
t(this, o).currentTime = Math.min(t(this, o).duration, Math.max(0, f)), e(this, s, k).call(this, t(this, o).currentTime), e(this, s, I).call(this, t(this, o).currentTime);
|
|
1401
|
-
});
|
|
1402
|
-
n(this, Le, (i) => {
|
|
1403
|
-
if (i instanceof PointerEvent) {
|
|
1404
|
-
if (!t(this, R)) {
|
|
1405
|
-
e(this, s, A).call(this) || (r(this, M, !0), t(this, h).classList.add("is-progress-hovering"), e(this, s, bt).call(this, i.clientX, !1, !1));
|
|
1406
|
-
return;
|
|
1407
|
-
}
|
|
1408
|
-
t(this, P) !== null && i.pointerId !== t(this, P) || (!t(this, g) && Math.abs(i.clientX - t(this, is)) >= t(this, Qs) && t(this, zs).call(this), t(this, g) && r(this, F, e(this, s, bt).call(this, i.clientX)));
|
|
1409
|
-
}
|
|
1410
|
-
});
|
|
1411
|
-
n(this, Fe, (i) => {
|
|
1412
|
-
i instanceof PointerEvent && (t(this, P) !== null && i.pointerId !== t(this, P) || e(this, s, li).call(this, i.clientX, i.pointerId, !0));
|
|
1413
|
-
});
|
|
1414
|
-
n(this, Se, (i) => {
|
|
1415
|
-
i instanceof PointerEvent && (t(this, P) !== null && i.pointerId !== t(this, P) || e(this, s, Ks).call(this, i.pointerId));
|
|
1416
|
-
});
|
|
1417
|
-
n(this, Me, (i) => {
|
|
1418
|
-
if (i instanceof PointerEvent) {
|
|
1419
|
-
if (t(this, x) !== null && i.pointerId === t(this, x)) {
|
|
1420
|
-
e(this, s, ts).call(this, i.pointerId);
|
|
1421
|
-
return;
|
|
1422
|
-
}
|
|
1423
|
-
t(this, P) === null || i.pointerId !== t(this, P) || e(this, s, li).call(this, i.clientX, i.pointerId, !0);
|
|
1424
|
-
}
|
|
1425
|
-
});
|
|
1426
|
-
n(this, Ve, (i) => {
|
|
1427
|
-
if (i instanceof PointerEvent) {
|
|
1428
|
-
if (t(this, x) !== null && i.pointerId === t(this, x)) {
|
|
1429
|
-
e(this, s, ts).call(this, i.pointerId);
|
|
1430
|
-
return;
|
|
1431
|
-
}
|
|
1432
|
-
t(this, P) === null || i.pointerId !== t(this, P) || e(this, s, Ks).call(this, i.pointerId);
|
|
1433
|
-
}
|
|
1434
|
-
});
|
|
1435
|
-
n(this, ze, () => {
|
|
1436
|
-
e(this, s, ts).call(this, t(this, x)), e(this, s, Ks).call(this, t(this, P));
|
|
1437
|
-
});
|
|
1438
|
-
n(this, Ie, () => {
|
|
1439
|
-
e(this, s, Os).call(this) || e(this, s, bs).call(this);
|
|
1440
|
-
});
|
|
1441
|
-
n(this, Re, () => {
|
|
1442
|
-
r(this, S, null), e(this, s, st).call(this), e(this, s, E).call(this) || e(this, s, k).call(this), e(this, s, C).call(this);
|
|
1443
|
-
});
|
|
1444
|
-
n(this, De, () => {
|
|
1445
|
-
r(this, S, null), e(this, s, E).call(this) || e(this, s, oi).call(this), t(this, z).call(this), e(this, s, C).call(this);
|
|
1446
|
-
});
|
|
1447
|
-
n(this, qe, () => {
|
|
1448
|
-
r(this, S, null), e(this, s, st).call(this), e(this, s, E).call(this) || e(this, s, k).call(this), e(this, s, C).call(this);
|
|
1449
|
-
});
|
|
1450
|
-
n(this, He, () => {
|
|
1451
|
-
e(this, s, Kt).call(this, !0, !0);
|
|
1452
|
-
});
|
|
1453
|
-
n(this, ps, () => {
|
|
1454
|
-
e(this, s, Kt).call(this, !0);
|
|
1455
|
-
});
|
|
1456
|
-
n(this, Be, () => {
|
|
1457
|
-
e(this, s, st).call(this), r(this, y, !0), t(this, V).call(this), e(this, s, E).call(this) || e(this, s, k).call(this), t(this, z).call(this), e(this, s, I).call(this);
|
|
1458
|
-
});
|
|
1459
|
-
n(this, $e, () => {
|
|
1460
|
-
const i = t(this, _t).call(this);
|
|
1461
|
-
t(this, V).call(this), i && !e(this, s, E).call(this) && e(this, s, k).call(this), e(this, s, C).call(this);
|
|
1462
|
-
});
|
|
1463
|
-
n(this, Ne, () => {
|
|
1464
|
-
if (e(this, s, st).call(this), t(this, z).call(this), t(this, _) && (!t(this, gt) || t(this, o).readyState >= HTMLMediaElement.HAVE_FUTURE_DATA)) {
|
|
1465
|
-
e(this, s, ei).call(this), e(this, s, C).call(this);
|
|
1466
|
-
return;
|
|
1467
|
-
}
|
|
1468
|
-
e(this, s, E).call(this) || e(this, s, k).call(this), e(this, s, I).call(this);
|
|
1469
|
-
});
|
|
1470
|
-
n(this, Ue, () => {
|
|
1471
|
-
r(this, S, null), r(this, $, !1), r(this, N, !1), r(this, Z, !1), r(this, K, !1), r(this, G, t(this, G) + 1), t(this, h).classList.remove("has-visible-frame"), e(this, s, Kt).call(this, !0, !0), e(this, s, C).call(this), e(this, s, Pi).call(this);
|
|
1472
|
-
});
|
|
1473
|
-
n(this, Ye, () => {
|
|
1474
|
-
t(this, V).call(this), e(this, s, I).call(this);
|
|
1475
|
-
});
|
|
1476
|
-
n(this, Xe, () => {
|
|
1477
|
-
t(this, V).call(this);
|
|
1478
|
-
});
|
|
1479
|
-
r(this, b, this.attachShadow({ mode: "open" })), t(this, b).append(fi.content.cloneNode(!0));
|
|
1217
|
+
super(), this.#r = this.attachShadow({ mode: "open" }), this.#r.append(p.content.cloneNode(!0));
|
|
1480
1218
|
}
|
|
1481
1219
|
get src() {
|
|
1482
1220
|
return this.getAttribute("src") ?? "";
|
|
1483
1221
|
}
|
|
1484
|
-
set src(
|
|
1485
|
-
|
|
1222
|
+
set src(t) {
|
|
1223
|
+
this.#cs("src", t);
|
|
1486
1224
|
}
|
|
1487
1225
|
get aspectRatio() {
|
|
1488
|
-
return this.getAttribute("aspect-ratio") ||
|
|
1226
|
+
return this.getAttribute("aspect-ratio") || u;
|
|
1489
1227
|
}
|
|
1490
|
-
set aspectRatio(
|
|
1491
|
-
|
|
1228
|
+
set aspectRatio(t) {
|
|
1229
|
+
this.#cs("aspect-ratio", t);
|
|
1492
1230
|
}
|
|
1493
1231
|
get preloadMargin() {
|
|
1494
|
-
return this.getAttribute("preload-margin") ||
|
|
1232
|
+
return this.getAttribute("preload-margin") || m;
|
|
1495
1233
|
}
|
|
1496
|
-
set preloadMargin(
|
|
1497
|
-
|
|
1234
|
+
set preloadMargin(t) {
|
|
1235
|
+
this.#cs("preload-margin", t);
|
|
1498
1236
|
}
|
|
1499
1237
|
get autoplayEnabled() {
|
|
1500
1238
|
return !this.hasAttribute("disable-autoplay") && !this.hasAttribute("no-autoplay");
|
|
1501
1239
|
}
|
|
1502
|
-
set autoplayEnabled(
|
|
1503
|
-
if (
|
|
1240
|
+
set autoplayEnabled(t) {
|
|
1241
|
+
if (t) {
|
|
1504
1242
|
this.removeAttribute("disable-autoplay"), this.removeAttribute("no-autoplay");
|
|
1505
1243
|
return;
|
|
1506
1244
|
}
|
|
@@ -1509,8 +1247,8 @@ class bi extends HTMLElement {
|
|
|
1509
1247
|
get controlsEnabled() {
|
|
1510
1248
|
return this.hasAttribute("controls");
|
|
1511
1249
|
}
|
|
1512
|
-
set controlsEnabled(
|
|
1513
|
-
if (
|
|
1250
|
+
set controlsEnabled(t) {
|
|
1251
|
+
if (t) {
|
|
1514
1252
|
this.setAttribute("controls", "");
|
|
1515
1253
|
return;
|
|
1516
1254
|
}
|
|
@@ -1519,8 +1257,8 @@ class bi extends HTMLElement {
|
|
|
1519
1257
|
get timeVisible() {
|
|
1520
1258
|
return this.hasAttribute("show-time");
|
|
1521
1259
|
}
|
|
1522
|
-
set timeVisible(
|
|
1523
|
-
if (
|
|
1260
|
+
set timeVisible(t) {
|
|
1261
|
+
if (t) {
|
|
1524
1262
|
this.setAttribute("show-time", "");
|
|
1525
1263
|
return;
|
|
1526
1264
|
}
|
|
@@ -1529,14 +1267,14 @@ class bi extends HTMLElement {
|
|
|
1529
1267
|
get volumeEnabled() {
|
|
1530
1268
|
return this.controlsEnabled && !this.hasAttribute("disable-volume") && !this.hasAttribute("no-volume");
|
|
1531
1269
|
}
|
|
1532
|
-
set volumeEnabled(
|
|
1533
|
-
|
|
1270
|
+
set volumeEnabled(t) {
|
|
1271
|
+
this.#us("volume", t);
|
|
1534
1272
|
}
|
|
1535
1273
|
get volumeSliderEnabled() {
|
|
1536
1274
|
return !this.hasAttribute("disable-volume-slider") && !this.hasAttribute("no-volume-slider");
|
|
1537
1275
|
}
|
|
1538
|
-
set volumeSliderEnabled(
|
|
1539
|
-
if (
|
|
1276
|
+
set volumeSliderEnabled(t) {
|
|
1277
|
+
if (t) {
|
|
1540
1278
|
this.removeAttribute("disable-volume-slider"), this.removeAttribute("no-volume-slider");
|
|
1541
1279
|
return;
|
|
1542
1280
|
}
|
|
@@ -1545,411 +1283,816 @@ class bi extends HTMLElement {
|
|
|
1545
1283
|
get pictureInPictureEnabled() {
|
|
1546
1284
|
return this.controlsEnabled && !this.hasAttribute("disable-picture-in-picture") && !this.hasAttribute("no-picture-in-picture");
|
|
1547
1285
|
}
|
|
1548
|
-
set pictureInPictureEnabled(
|
|
1549
|
-
|
|
1286
|
+
set pictureInPictureEnabled(t) {
|
|
1287
|
+
this.#us("picture-in-picture", t);
|
|
1550
1288
|
}
|
|
1551
1289
|
get fullscreenEnabled() {
|
|
1552
1290
|
return this.controlsEnabled && !this.hasAttribute("disable-fullscreen") && !this.hasAttribute("no-fullscreen");
|
|
1553
1291
|
}
|
|
1554
|
-
set fullscreenEnabled(
|
|
1555
|
-
|
|
1292
|
+
set fullscreenEnabled(t) {
|
|
1293
|
+
this.#us("fullscreen", t);
|
|
1556
1294
|
}
|
|
1557
1295
|
connectedCallback() {
|
|
1558
|
-
|
|
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();
|
|
1559
1297
|
}
|
|
1560
1298
|
disconnectedCallback() {
|
|
1561
|
-
|
|
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();
|
|
1562
1300
|
}
|
|
1563
|
-
attributeChangedCallback(
|
|
1564
|
-
if (
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1301
|
+
attributeChangedCallback(t, s, e) {
|
|
1302
|
+
if (s !== e) {
|
|
1303
|
+
if (t === "aspect-ratio") {
|
|
1304
|
+
this.#Ms();
|
|
1567
1305
|
return;
|
|
1568
1306
|
}
|
|
1569
|
-
if (
|
|
1570
|
-
|
|
1307
|
+
if (t === "preload-margin" && this.isConnected) {
|
|
1308
|
+
this.#E?.disconnect(), this.#ms();
|
|
1571
1309
|
return;
|
|
1572
1310
|
}
|
|
1573
|
-
if (
|
|
1574
|
-
|
|
1311
|
+
if (t === "src" && this.isConnected) {
|
|
1312
|
+
this.#xi(), this.#ms();
|
|
1575
1313
|
return;
|
|
1576
1314
|
}
|
|
1577
|
-
if ((
|
|
1578
|
-
|
|
1315
|
+
if ((t === "disable-autoplay" || t === "no-autoplay") && this.isConnected) {
|
|
1316
|
+
this.#Bt(), this.#y(), this.#u();
|
|
1579
1317
|
return;
|
|
1580
1318
|
}
|
|
1581
|
-
if (
|
|
1582
|
-
|
|
1319
|
+
if (t === "show-time" && this.isConnected) {
|
|
1320
|
+
this.#ds();
|
|
1583
1321
|
return;
|
|
1584
1322
|
}
|
|
1585
|
-
(
|
|
1323
|
+
(t === "controls" || t.startsWith("enable-") || t.startsWith("disable-") || t.startsWith("no-")) && this.isConnected && (this.#ps(), this.#y(), this.#Tt(), this.#Qt(), this.#ds());
|
|
1586
1324
|
}
|
|
1587
1325
|
}
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
this.removeAttribute(i);
|
|
1592
|
-
return;
|
|
1593
|
-
}
|
|
1594
|
-
this.setAttribute(i, a);
|
|
1595
|
-
}, $s = function(i, a) {
|
|
1596
|
-
if (a) {
|
|
1597
|
-
this.setAttribute(`enable-${i}`, ""), this.removeAttribute(`disable-${i}`), this.removeAttribute(`no-${i}`);
|
|
1598
|
-
return;
|
|
1599
|
-
}
|
|
1600
|
-
this.removeAttribute(`enable-${i}`), this.setAttribute(`disable-${i}`, "");
|
|
1601
|
-
}, We = function() {
|
|
1602
|
-
this.style.setProperty("--simple-player-aspect-ratio", this.aspectRatio);
|
|
1603
|
-
}, ms = function() {
|
|
1604
|
-
if (!t(this, o)) return;
|
|
1605
|
-
const i = this.autoplayEnabled;
|
|
1606
|
-
if (t(this, o).autoplay = i, i) {
|
|
1607
|
-
t(this, o).muted = !0, t(this, o).setAttribute("autoplay", ""), t(this, o).setAttribute("muted", "");
|
|
1608
|
-
return;
|
|
1609
|
-
}
|
|
1610
|
-
t(this, o).removeAttribute("autoplay"), t(this, B) || (t(this, o).muted = !1, t(this, o).removeAttribute("muted"));
|
|
1611
|
-
}, je = function() {
|
|
1612
|
-
if (!t(this, h)) return;
|
|
1613
|
-
const i = [
|
|
1614
|
-
{ button: t(this, w), enabled: this.volumeEnabled, className: "has-volume-control" },
|
|
1615
|
-
{ button: t(this, et), enabled: this.pictureInPictureEnabled, className: "has-picture-in-picture-control" },
|
|
1616
|
-
{ button: t(this, it), enabled: this.fullscreenEnabled, className: "has-fullscreen-control" }
|
|
1617
|
-
];
|
|
1618
|
-
let a = 0;
|
|
1619
|
-
for (const l of i)
|
|
1620
|
-
t(this, h).classList.toggle(l.className, l.enabled), l.button.hidden = !l.enabled, l.enabled ? (l.button.dataset.spControlIndex = `${a}`, a += 1) : delete l.button.dataset.spControlIndex;
|
|
1621
|
-
this.style.setProperty("--sp-enabled-controls-count", `${a}`), this.style.setProperty("--sp-control-tray-display", a > 0 ? "block" : "none"), t(this, h).classList.toggle("has-volume-slider-control", this.volumeEnabled && this.volumeSliderEnabled), (!this.volumeEnabled || !this.volumeSliderEnabled) && (t(this, us).call(this), e(this, s, js).call(this, t(this, x)), r(this, W, !1), r(this, ct, !1), t(this, O).classList.remove("is-scrubbing-volume")), t(this, j).style.removeProperty("--sp-control-hover-offset");
|
|
1622
|
-
}, jt = function() {
|
|
1623
|
-
return this.timeVisible && this.controlsEnabled;
|
|
1624
|
-
}, Ns = function() {
|
|
1625
|
-
t(this, h) && (t(this, h).classList.toggle("has-pinned-time", t(this, s, jt)), t(this, s, jt) && e(this, s, Gt).call(this));
|
|
1626
|
-
}, vi = function() {
|
|
1627
|
-
e(this, s, c).call(this, t(this, Y), "click", t(this, fe)), e(this, s, c).call(this, this, "pointerenter", t(this, Ut)), e(this, s, c).call(this, this, "pointermove", t(this, Yt)), e(this, s, c).call(this, this, "pointerleave", t(this, Xt)), e(this, s, c).call(this, this, "mouseenter", t(this, Ut)), e(this, s, c).call(this, this, "mousemove", t(this, Yt)), e(this, s, c).call(this, this, "mouseleave", t(this, Xt)), e(this, s, c).call(this, t(this, h), "pointerenter", t(this, Ut)), e(this, s, c).call(this, t(this, h), "pointermove", t(this, Yt)), e(this, s, c).call(this, t(this, h), "pointerleave", t(this, Xt)), e(this, s, c).call(this, t(this, h), "mouseenter", t(this, Ut)), e(this, s, c).call(this, t(this, h), "mousemove", t(this, Yt)), e(this, s, c).call(this, t(this, h), "mouseleave", t(this, Xt)), e(this, s, c).call(this, t(this, Y), "pointerenter", t(this, ut)), e(this, s, c).call(this, t(this, Y), "pointerleave", t(this, pt)), e(this, s, c).call(this, t(this, Y), "mouseenter", t(this, ut)), e(this, s, c).call(this, t(this, Y), "mouseleave", t(this, pt)), e(this, s, c).call(this, t(this, m), "pointerenter", t(this, ut)), e(this, s, c).call(this, t(this, m), "pointerleave", t(this, pt)), e(this, s, c).call(this, t(this, m), "mouseenter", t(this, ut)), e(this, s, c).call(this, t(this, m), "mouseleave", t(this, pt)), e(this, s, c).call(this, t(this, m), "pointerenter", t(this, Ds)), e(this, s, c).call(this, t(this, m), "pointerleave", t(this, qs)), e(this, s, c).call(this, t(this, m), "mouseenter", t(this, Ds)), e(this, s, c).call(this, t(this, m), "mouseleave", t(this, qs)), e(this, s, c).call(this, t(this, X), "pointerenter", t(this, ut)), e(this, s, c).call(this, t(this, X), "pointerleave", t(this, pt)), e(this, s, c).call(this, t(this, X), "mouseenter", t(this, ut)), e(this, s, c).call(this, t(this, X), "mouseleave", t(this, pt)), e(this, s, c).call(this, t(this, b), "focusin", t(this, Fs)), e(this, s, c).call(this, t(this, b), "focusout", t(this, pe)), e(this, s, c).call(this, t(this, h), "pointerdown", t(this, be)), e(this, s, c).call(this, t(this, h), "dragstart", t(this, Nt)), e(this, s, c).call(this, t(this, h), "selectstart", t(this, Nt)), e(this, s, c).call(this, t(this, o), "dragstart", t(this, Nt)), e(this, s, c).call(this, t(this, o), "selectstart", t(this, Nt)), e(this, s, c).call(this, t(this, m), "pointerdown", t(this, Ce)), e(this, s, c).call(this, t(this, m), "pointermove", t(this, Le)), e(this, s, c).call(this, t(this, m), "pointerup", t(this, Fe)), e(this, s, c).call(this, t(this, m), "pointercancel", t(this, Se)), e(this, s, c).call(this, t(this, m), "keydown", t(this, Ae)), e(this, s, c).call(this, t(this, w), "pointerenter", t(this, Is)), e(this, s, c).call(this, t(this, w), "pointerleave", t(this, Rs)), e(this, s, c).call(this, t(this, w), "click", t(this, ge)), e(this, s, c).call(this, t(this, O), "pointerenter", t(this, Is)), e(this, s, c).call(this, t(this, O), "pointerleave", t(this, Rs)), e(this, s, c).call(this, t(this, T), "pointerdown", t(this, ye)), e(this, s, c).call(this, t(this, T), "pointermove", t(this, we)), e(this, s, c).call(this, t(this, T), "pointerup", t(this, xe)), e(this, s, c).call(this, t(this, T), "pointercancel", t(this, ke)), e(this, s, c).call(this, t(this, T), "click", t(this, ve)), e(this, s, c).call(this, t(this, T), "keydown", t(this, Pe)), e(this, s, c).call(this, t(this, et), "click", t(this, Te)), e(this, s, c).call(this, t(this, it), "click", t(this, Ee)), e(this, s, c).call(this, t(this, L), "click", t(this, me));
|
|
1628
|
-
for (const i of t(this, rt))
|
|
1629
|
-
e(this, s, c).call(this, i, "pointerenter", t(this, Ss)), e(this, s, c).call(this, i, "mouseenter", t(this, Ss)), e(this, s, c).call(this, i, "pointerdown", t(this, de));
|
|
1630
|
-
"ResizeObserver" in window && (r(this, It, new ResizeObserver(() => {
|
|
1631
|
-
t(this, h).style.setProperty("--sp-tray-time-width", `${t(this, L).offsetWidth + 4}px`);
|
|
1632
|
-
})), t(this, It).observe(t(this, L)), t(this, St).push(() => {
|
|
1633
|
-
t(this, It)?.disconnect(), r(this, It, null);
|
|
1634
|
-
})), e(this, s, c).call(this, document, "pointerup", t(this, Me)), e(this, s, c).call(this, document, "pointercancel", t(this, Ve)), e(this, s, c).call(this, document, "pointermove", t(this, Ls)), e(this, s, c).call(this, document, "mousemove", t(this, Ls)), e(this, s, c).call(this, document, "fullscreenchange", t(this, Lt)), e(this, s, c).call(this, document, "webkitfullscreenchange", t(this, Lt)), e(this, s, c).call(this, document, "mozfullscreenchange", t(this, Lt)), e(this, s, c).call(this, document, "MSFullscreenChange", t(this, Lt)), e(this, s, c).call(this, t(this, b), "fullscreenchange", t(this, Lt)), e(this, s, c).call(this, window, "blur", t(this, ze)), e(this, s, c).call(this, window, "focus", t(this, Ie)), e(this, s, c).call(this, t(this, o), "play", t(this, Re)), e(this, s, c).call(this, t(this, o), "pause", t(this, De)), e(this, s, c).call(this, t(this, o), "ended", t(this, qe)), e(this, s, c).call(this, t(this, o), "loadstart", t(this, He)), e(this, s, c).call(this, t(this, o), "waiting", t(this, ps)), e(this, s, c).call(this, t(this, o), "stalled", t(this, ps)), e(this, s, c).call(this, t(this, o), "seeking", t(this, ps)), e(this, s, c).call(this, t(this, o), "loadeddata", t(this, _t)), e(this, s, c).call(this, t(this, o), "loadedmetadata", t(this, Be)), e(this, s, c).call(this, t(this, o), "canplay", t(this, _t)), e(this, s, c).call(this, t(this, o), "canplaythrough", t(this, _t)), e(this, s, c).call(this, t(this, o), "playing", t(this, $e)), e(this, s, c).call(this, t(this, o), "seeked", t(this, Ne)), e(this, s, c).call(this, t(this, o), "error", t(this, Ue)), e(this, s, c).call(this, t(this, o), "progress", t(this, z)), e(this, s, c).call(this, t(this, o), "suspend", t(this, z)), e(this, s, c).call(this, t(this, o), "timeupdate", t(this, Ye)), e(this, s, c).call(this, t(this, o), "volumechange", t(this, Xe)), e(this, s, c).call(this, t(this, o), "enterpictureinpicture", t(this, At)), e(this, s, c).call(this, t(this, o), "leavepictureinpicture", t(this, At));
|
|
1635
|
-
}, c = function(i, a, l) {
|
|
1636
|
-
i.addEventListener(a, l), t(this, St).push(() => i.removeEventListener(a, l));
|
|
1637
|
-
}, Us = function() {
|
|
1638
|
-
if (!(!this.src || t(this, B))) {
|
|
1639
|
-
if (t(this, H)?.disconnect(), t(this, o).dataset.src = this.src, "IntersectionObserver" in window) {
|
|
1640
|
-
r(this, H, new IntersectionObserver((i, a) => {
|
|
1641
|
-
i.some((l) => l.isIntersecting) && (a.disconnect(), r(this, H, null), e(this, s, dt).call(this));
|
|
1642
|
-
}, { rootMargin: this.preloadMargin })), t(this, H).observe(t(this, h));
|
|
1326
|
+
#cs(t, s) {
|
|
1327
|
+
if (s === "") {
|
|
1328
|
+
this.removeAttribute(t);
|
|
1643
1329
|
return;
|
|
1644
1330
|
}
|
|
1645
|
-
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
},
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
}
|
|
1697
|
-
t
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1331
|
+
this.setAttribute(t, s);
|
|
1332
|
+
}
|
|
1333
|
+
#us(t, s) {
|
|
1334
|
+
if (s) {
|
|
1335
|
+
this.setAttribute(`enable-${t}`, ""), this.removeAttribute(`disable-${t}`), this.removeAttribute(`no-${t}`);
|
|
1336
|
+
return;
|
|
1337
|
+
}
|
|
1338
|
+
this.removeAttribute(`enable-${t}`), this.setAttribute(`disable-${t}`, "");
|
|
1339
|
+
}
|
|
1340
|
+
#Ms() {
|
|
1341
|
+
this.style.setProperty("--simple-player-aspect-ratio", this.aspectRatio);
|
|
1342
|
+
}
|
|
1343
|
+
#Bt() {
|
|
1344
|
+
if (!this.#t) return;
|
|
1345
|
+
const t = this.autoplayEnabled;
|
|
1346
|
+
if (this.#t.autoplay = t, t) {
|
|
1347
|
+
this.#t.muted = !0, this.#t.setAttribute("autoplay", ""), this.#t.setAttribute("muted", "");
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
this.#t.removeAttribute("autoplay"), this.#C || (this.#t.muted = !1, this.#t.removeAttribute("muted"));
|
|
1351
|
+
}
|
|
1352
|
+
#ps() {
|
|
1353
|
+
if (!this.#s) return;
|
|
1354
|
+
const t = this.#T(), s = [
|
|
1355
|
+
{ button: this.#o, enabled: t, className: "has-volume-control" },
|
|
1356
|
+
{ button: this.#O, enabled: this.pictureInPictureEnabled, className: "has-picture-in-picture-control" },
|
|
1357
|
+
{ button: this.#Z, enabled: this.fullscreenEnabled, className: "has-fullscreen-control" }
|
|
1358
|
+
];
|
|
1359
|
+
let e = 0;
|
|
1360
|
+
for (const i of s)
|
|
1361
|
+
this.#s.classList.toggle(i.className, i.enabled), i.button.hidden = !i.enabled, i.enabled ? (i.button.dataset.spControlIndex = `${e}`, e += 1) : delete i.button.dataset.spControlIndex;
|
|
1362
|
+
this.style.setProperty("--sp-enabled-controls-count", `${e}`), this.style.setProperty("--sp-control-tray-display", e > 0 ? "block" : "none"), this.#s.classList.toggle("has-volume-slider-control", t && this.volumeSliderEnabled), (!t || !this.volumeSliderEnabled) && (this.#Ps(), this.#Jt(this.#n), this.#F = !1, this.#N = !1, this.#z.classList.remove("is-scrubbing-volume")), this.#j.style.removeProperty("--sp-control-hover-offset");
|
|
1363
|
+
}
|
|
1364
|
+
get #bt() {
|
|
1365
|
+
return this.timeVisible && this.controlsEnabled;
|
|
1366
|
+
}
|
|
1367
|
+
#ds() {
|
|
1368
|
+
this.#s && (this.#s.classList.toggle("has-pinned-time", this.#bt), this.#bt && this.#wt());
|
|
1369
|
+
}
|
|
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);
|
|
1372
|
+
for (const t of this.#K)
|
|
1373
|
+
this.#e(t, "pointerenter", this.#qs), this.#e(t, "mouseenter", this.#qs), this.#e(t, "pointerdown", this.#ke);
|
|
1374
|
+
"ResizeObserver" in window && (this.#Mt = new ResizeObserver(() => {
|
|
1375
|
+
this.#$t();
|
|
1376
|
+
}), this.#Mt.observe(this.#m), this.#At.push(() => {
|
|
1377
|
+
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.#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
|
+
}
|
|
1380
|
+
#$t() {
|
|
1381
|
+
!this.#s || !this.#m || this.#s.style.setProperty("--sp-tray-time-width", `${Math.ceil(this.#m.scrollWidth)}px`);
|
|
1382
|
+
}
|
|
1383
|
+
#e(t, s, e) {
|
|
1384
|
+
t.addEventListener(s, e), this.#At.push(() => t.removeEventListener(s, e));
|
|
1385
|
+
}
|
|
1386
|
+
#ms() {
|
|
1387
|
+
if (!(!this.src || this.#C)) {
|
|
1388
|
+
if (this.#E?.disconnect(), this.#t.dataset.src = this.src, "IntersectionObserver" in window) {
|
|
1389
|
+
this.#E = new IntersectionObserver((t, s) => {
|
|
1390
|
+
t.some((e) => e.isIntersecting) && (s.disconnect(), this.#E = null, this.#Y());
|
|
1391
|
+
}, { rootMargin: this.preloadMargin }), this.#E.observe(this.#s);
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
this.#Y();
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
#Ut = (t) => {
|
|
1398
|
+
t.preventDefault();
|
|
1399
|
+
};
|
|
1400
|
+
#P() {
|
|
1401
|
+
this.#at && (window.clearTimeout(this.#at), this.#at = 0);
|
|
1402
|
+
}
|
|
1403
|
+
#ye = () => {
|
|
1404
|
+
if (this.#at = 0, !(this.#x || this.#a || this.#F)) {
|
|
1405
|
+
if (this.#d()) {
|
|
1406
|
+
this.#s.classList.remove("is-controls-visible");
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
this.#U || this.#s.classList.remove("is-pointer-active");
|
|
1410
|
+
}
|
|
1411
|
+
};
|
|
1412
|
+
#Nt(t = this.#d() ? this.#Ss : this.#Ht) {
|
|
1413
|
+
this.#P(), this.#at = window.setTimeout(this.#ye, t);
|
|
1414
|
+
}
|
|
1415
|
+
#R() {
|
|
1416
|
+
this.#d() && this.#Nt(this.#Ss);
|
|
1417
|
+
}
|
|
1418
|
+
#D() {
|
|
1419
|
+
if (!this.#d()) return !1;
|
|
1420
|
+
const t = this.#s.classList.contains("is-controls-visible");
|
|
1421
|
+
return this.#s.classList.add("is-controls-visible"), this.#R(), !t;
|
|
1422
|
+
}
|
|
1423
|
+
#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));
|
|
1425
|
+
}
|
|
1426
|
+
#Yt() {
|
|
1427
|
+
this.#U = !1, this.#P(), this.#s.classList.remove("is-pointer-active");
|
|
1428
|
+
}
|
|
1429
|
+
#vt(t) {
|
|
1430
|
+
return t instanceof PointerEvent ? (this.#Dt = t.pointerType === "touch", this.#Dt ? !1 : (this.#os = t.clientX, this.#ns = t.clientY, !0)) : t instanceof MouseEvent ? (this.#Dt = !1, this.#os = t.clientX, this.#ns = t.clientY, !0) : !1;
|
|
1431
|
+
}
|
|
1432
|
+
#we(t, s) {
|
|
1433
|
+
if (t === null || s === null || t < 0 || s < 0 || t > window.innerWidth || s > window.innerHeight) return !1;
|
|
1434
|
+
const e = this.getBoundingClientRect();
|
|
1435
|
+
return e.width <= 0 || e.height <= 0 ? !1 : t >= e.left && t <= e.right && s >= e.top && s <= e.bottom;
|
|
1436
|
+
}
|
|
1437
|
+
#Vs(t, s, e) {
|
|
1438
|
+
if (!t) return !1;
|
|
1439
|
+
const i = t.getBoundingClientRect();
|
|
1440
|
+
return i.width <= 0 || i.height <= 0 ? !1 : s >= i.left && s <= i.right && e >= i.top && e <= i.bottom;
|
|
1441
|
+
}
|
|
1442
|
+
#zs() {
|
|
1443
|
+
this.#v && (this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#xt(), this.#wt());
|
|
1444
|
+
}
|
|
1445
|
+
#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();
|
|
1448
|
+
const e = this.#K.find((r) => !r.hidden && !this.#bs(r) && this.#Vs(r, t, s)) ?? null;
|
|
1449
|
+
if (!e) return;
|
|
1450
|
+
const i = Number(e.dataset.spControlIndex ?? 0);
|
|
1451
|
+
this.#j.style.setProperty("--sp-control-hover-offset", `calc(var(--sp-control-slot-size) * ${i})`);
|
|
1452
|
+
}
|
|
1453
|
+
#gt() {
|
|
1454
|
+
return this.#s.classList.contains("is-controls-visible") || this.#s.classList.contains("is-pointer-active") || this.#r.activeElement instanceof HTMLElement;
|
|
1455
|
+
}
|
|
1456
|
+
#Xt() {
|
|
1457
|
+
return this.#d() && performance.now() < this.#rs;
|
|
1458
|
+
}
|
|
1459
|
+
#bs(t) {
|
|
1460
|
+
return t instanceof HTMLButtonElement && (t.disabled || t === this.#o && !this.#T());
|
|
1461
|
+
}
|
|
1462
|
+
#Rs() {
|
|
1463
|
+
if (!this.#Dt && this.#we(this.#os, this.#ns)) {
|
|
1464
|
+
this.#fs(!0);
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
this.#Yt();
|
|
1468
|
+
}
|
|
1469
|
+
#_t = (t) => {
|
|
1470
|
+
this.#vt(t) && this.#fs(!0);
|
|
1471
|
+
};
|
|
1472
|
+
#Wt = (t) => {
|
|
1473
|
+
this.#vt(t) && ((t instanceof PointerEvent || t instanceof MouseEvent) && this.#Is(t.clientX, t.clientY), this.#fs(!0));
|
|
1474
|
+
};
|
|
1475
|
+
#Ds = (t) => {
|
|
1476
|
+
this.#vt(t) && ((t instanceof PointerEvent || t instanceof MouseEvent) && this.#Is(t.clientX, t.clientY), this.#Rs());
|
|
1477
|
+
};
|
|
1478
|
+
#jt = () => {
|
|
1479
|
+
this.#Yt();
|
|
1480
|
+
};
|
|
1481
|
+
#et = (t) => {
|
|
1482
|
+
this.#vt(t) && (this.#U = !0, this.#s.classList.add("is-pointer-active"), this.#P());
|
|
1483
|
+
};
|
|
1484
|
+
#it = () => {
|
|
1485
|
+
this.#U = !1, this.#Nt(this.#Ht);
|
|
1486
|
+
};
|
|
1487
|
+
#Hs = () => {
|
|
1488
|
+
this.#d() ? this.#s.classList.add("is-controls-visible") : this.#s.classList.add("is-pointer-active"), this.#P();
|
|
1489
|
+
};
|
|
1490
|
+
#xe = () => {
|
|
1491
|
+
this.#Nt(this.#Ht);
|
|
1492
|
+
};
|
|
1493
|
+
#qs = (t) => {
|
|
1494
|
+
const s = t.currentTarget;
|
|
1495
|
+
if (this.#bs(s)) return;
|
|
1496
|
+
const i = Number(s.dataset.spControlIndex ?? 0);
|
|
1497
|
+
this.#j.style.setProperty("--sp-control-hover-offset", `calc(var(--sp-control-slot-size) * ${i})`);
|
|
1498
|
+
};
|
|
1499
|
+
#vs() {
|
|
1500
|
+
this.#mt && (window.clearTimeout(this.#mt), this.#mt = 0);
|
|
1501
|
+
}
|
|
1502
|
+
#Bs = () => {
|
|
1503
|
+
this.#mt = 0, this.#K.forEach((t) => t.classList.remove("is-control-tap-active")), this.style.removeProperty("--sp-touch-control-hover-offset");
|
|
1504
|
+
};
|
|
1505
|
+
#ke = (t) => {
|
|
1506
|
+
if (!(t instanceof PointerEvent) || t.pointerType !== "touch") return;
|
|
1507
|
+
const s = t.currentTarget;
|
|
1508
|
+
if (!s || !this.#gt() || this.#bs(s)) return;
|
|
1509
|
+
const e = Number(s.dataset.spControlIndex ?? 0);
|
|
1510
|
+
this.#vs(), this.#K.forEach((i) => i.classList.toggle("is-control-tap-active", i === s)), this.style.setProperty("--sp-touch-control-hover-offset", `calc(var(--sp-control-slot-size) * ${e})`), this.#mt = window.setTimeout(this.#Bs, 280);
|
|
1511
|
+
};
|
|
1512
|
+
#$s() {
|
|
1513
|
+
this.#lt && (window.clearTimeout(this.#lt), this.#lt = 0);
|
|
1514
|
+
}
|
|
1515
|
+
#Ot() {
|
|
1516
|
+
this.#Q && (window.clearTimeout(this.#Q), this.#Q = 0);
|
|
1517
|
+
}
|
|
1518
|
+
#gs() {
|
|
1519
|
+
this.#tt && (window.clearTimeout(this.#tt), this.#tt = 0);
|
|
1520
|
+
}
|
|
1521
|
+
#Zt() {
|
|
1522
|
+
this.#Vt && (window.clearTimeout(this.#Vt), this.#Vt = 0);
|
|
1523
|
+
}
|
|
1524
|
+
#Us() {
|
|
1525
|
+
this.#dt && (window.clearTimeout(this.#dt), this.#dt = 0);
|
|
1526
|
+
}
|
|
1527
|
+
#Pe() {
|
|
1528
|
+
this.#Us(), this.#s.classList.remove("is-volume-icon-animating"), this.#o.offsetWidth, this.#s.classList.add("is-volume-icon-animating"), this.#dt = window.setTimeout(() => {
|
|
1529
|
+
this.#dt = 0, this.#s.classList.remove("is-volume-icon-animating");
|
|
1530
|
+
}, 240);
|
|
1531
|
+
}
|
|
1532
|
+
#Ns = () => {
|
|
1533
|
+
if (this.#tt || this.#s.classList.contains("is-progress-settling")) {
|
|
1534
|
+
if (this.#gs(), this.#ht) {
|
|
1535
|
+
this.#s.classList.remove("is-progress-settling");
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
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();
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
#Te() {
|
|
1542
|
+
this.#ht || this.#tt || (this.#s.classList.add("is-progress-settling"), this.#_(0), this.#tt = window.setTimeout(this.#Ns, this.#ue));
|
|
1543
|
+
}
|
|
1544
|
+
async #Y() {
|
|
1545
|
+
if (this.#C) return;
|
|
1546
|
+
const t = this.#t.dataset.src || this.src;
|
|
1547
|
+
t && (this.#Ot(), this.#Zt(), 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(() => {
|
|
1548
|
+
}));
|
|
1549
|
+
}
|
|
1550
|
+
#Ys() {
|
|
1551
|
+
return !this.#t.loop || this.#t.paused || !Number.isFinite(this.#t.duration) || this.#t.duration <= 0 ? !1 : this.#t.currentTime < 0.28 || this.#t.duration - this.#t.currentTime < 0.28;
|
|
1552
|
+
}
|
|
1553
|
+
#Ee(t = this.#t.currentTime) {
|
|
1554
|
+
if (!Number.isFinite(t)) return 0;
|
|
1555
|
+
const s = Math.max(0, t);
|
|
1556
|
+
try {
|
|
1557
|
+
for (let e = 0; e < this.#t.buffered.length; e += 1) {
|
|
1558
|
+
const i = this.#t.buffered.start(e), r = this.#t.buffered.end(e);
|
|
1559
|
+
if (s + this.#qt >= i && s <= r + this.#qt)
|
|
1560
|
+
return Math.max(0, r - s);
|
|
1561
|
+
}
|
|
1562
|
+
} catch {
|
|
1563
|
+
return 0;
|
|
1725
1564
|
}
|
|
1726
|
-
} catch {
|
|
1727
1565
|
return 0;
|
|
1728
1566
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
return;
|
|
1744
|
-
}
|
|
1745
|
-
r(this, wt, window.setTimeout(() => {
|
|
1746
|
-
if (r(this, wt, 0), !t(this, N) || !e(this, s, ti).call(this) && !e(this, s, si).call(this)) {
|
|
1747
|
-
r(this, Dt, !0), t(this, h).classList.add("is-loading");
|
|
1567
|
+
#Xs(t = this.#fe) {
|
|
1568
|
+
if (!this.#C || this.#t.error || !this.#s.classList.contains("has-loaded-once") || !Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return !1;
|
|
1569
|
+
const s = Math.max(0, this.#t.duration - this.#t.currentTime), e = Math.min(t, s);
|
|
1570
|
+
return e <= this.#qt || this.#Ee() + this.#qt >= e;
|
|
1571
|
+
}
|
|
1572
|
+
#yt(t, s = !1) {
|
|
1573
|
+
this.#$s();
|
|
1574
|
+
const e = t && !this.#Ys() && !this.#Xs(), r = t && !this.#L || e;
|
|
1575
|
+
if (this.#zt = r, !r) {
|
|
1576
|
+
this.#s.classList.remove("is-loading");
|
|
1577
|
+
return;
|
|
1578
|
+
}
|
|
1579
|
+
if (s) {
|
|
1580
|
+
this.#s.classList.add("is-loading");
|
|
1748
1581
|
return;
|
|
1749
1582
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
return t(this, B) && !t(this, o).error && t(this, $) && (t(this, o).readyState >= HTMLMediaElement.HAVE_FUTURE_DATA || t(this, o).readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && !t(this, h).classList.contains("is-loading"));
|
|
1754
|
-
}, E = function() {
|
|
1755
|
-
return t(this, R) || t(this, g) || t(this, _);
|
|
1756
|
-
}, Pi = function() {
|
|
1757
|
-
t(this, rs) >= t(this, ae) || t(this, at) || r(this, at, window.setTimeout(() => {
|
|
1758
|
-
r(this, at, 0), e(this, s, ys).call(this), r(this, B, !1), r(this, $, !1), r(this, N, !1), r(this, Z, !1), r(this, K, !1), r(this, G, t(this, G) + 1), t(this, h).classList.remove("has-visible-frame"), t(this, h).classList.contains("has-loaded-once") || e(this, s, ft).call(this, 0), t(this, o).removeAttribute("src"), t(this, o).load(), e(this, s, dt).call(this);
|
|
1759
|
-
}, t(this, ne)));
|
|
1760
|
-
}, ei = function() {
|
|
1761
|
-
return t(this, _) ? (r(this, _, !1), r(this, gt, !1), e(this, s, k).call(this), e(this, s, I).call(this), !0) : !1;
|
|
1762
|
-
}, ii = function() {
|
|
1763
|
-
return e(this, s, gs).call(this), !t(this, h).classList.contains("has-loaded-once") && e(this, s, wi).call(this), t(this, h).classList.add("has-loaded-once"), t(this, h).classList.add("has-visible-frame"), t(this, z).call(this), r(this, S, null), t(this, _) ? (e(this, s, ei).call(this), !0) : (e(this, s, E).call(this) || e(this, s, k).call(this), e(this, s, I).call(this), !0);
|
|
1764
|
-
}, Ti = function() {
|
|
1765
|
-
if (t(this, $) || t(this, Z) || t(this, o).error) return;
|
|
1766
|
-
r(this, Z, !0);
|
|
1767
|
-
const i = t(this, G), a = () => {
|
|
1768
|
-
if (i === t(this, G)) {
|
|
1769
|
-
if (e(this, s, ys).call(this), r(this, Z, !1), r(this, $, !t(this, o).error && t(this, o).readyState >= HTMLMediaElement.HAVE_CURRENT_DATA && t(this, o).videoWidth > 0 && t(this, o).videoHeight > 0), t(this, $)) {
|
|
1770
|
-
if (t(this, K) || t(this, N)) return;
|
|
1771
|
-
r(this, K, !0), window.requestAnimationFrame(() => {
|
|
1772
|
-
window.requestAnimationFrame(() => {
|
|
1773
|
-
i === t(this, G) && (r(this, K, !1), r(this, N, !0), e(this, s, ii).call(this), e(this, s, C).call(this));
|
|
1774
|
-
});
|
|
1775
|
-
}), e(this, s, C).call(this);
|
|
1583
|
+
this.#lt = window.setTimeout(() => {
|
|
1584
|
+
if (this.#lt = 0, !this.#L || !this.#Ys() && !this.#Xs()) {
|
|
1585
|
+
this.#zt = !0, this.#s.classList.add("is-loading");
|
|
1776
1586
|
return;
|
|
1777
1587
|
}
|
|
1778
|
-
|
|
1588
|
+
this.#zt = !1, this.#s.classList.remove("is-loading");
|
|
1589
|
+
}, this.#ce);
|
|
1590
|
+
}
|
|
1591
|
+
#w = () => {
|
|
1592
|
+
if (this.#t.error) {
|
|
1593
|
+
this.#yt(!0, !0);
|
|
1594
|
+
return;
|
|
1779
1595
|
}
|
|
1596
|
+
this.#yt(
|
|
1597
|
+
!this.#C || !this.#L || this.#t.readyState < HTMLMediaElement.HAVE_FUTURE_DATA
|
|
1598
|
+
);
|
|
1780
1599
|
};
|
|
1781
|
-
|
|
1782
|
-
t(this
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
},
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
},
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
t
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1600
|
+
#Ce() {
|
|
1601
|
+
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
|
+
}
|
|
1603
|
+
#c() {
|
|
1604
|
+
return this.#x || this.#a || this.#I;
|
|
1605
|
+
}
|
|
1606
|
+
#Ae() {
|
|
1607
|
+
this.#is >= this.#me || this.#Q || (this.#Q = window.setTimeout(() => {
|
|
1608
|
+
this.#Q = 0, this.#Zt(), 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();
|
|
1609
|
+
}, this.#de));
|
|
1610
|
+
}
|
|
1611
|
+
#_s() {
|
|
1612
|
+
return this.#I ? (this.#I = !1, this.#nt = !1, this.#l(), this.#g(), !0) : !1;
|
|
1613
|
+
}
|
|
1614
|
+
#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);
|
|
1616
|
+
}
|
|
1617
|
+
#Le() {
|
|
1618
|
+
if (this.#A || this.#q || this.#t.error) return;
|
|
1619
|
+
this.#q = !0;
|
|
1620
|
+
const t = this.#$, s = () => {
|
|
1621
|
+
if (t === this.#$) {
|
|
1622
|
+
if (this.#Zt(), 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) {
|
|
1623
|
+
if (this.#B || this.#L) return;
|
|
1624
|
+
this.#B = !0, window.requestAnimationFrame(() => {
|
|
1625
|
+
window.requestAnimationFrame(() => {
|
|
1626
|
+
t === this.#$ && (this.#B = !1, this.#L = !0, this.#Ws(), this.#u());
|
|
1627
|
+
});
|
|
1628
|
+
}), this.#u();
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
this.#w();
|
|
1632
|
+
}
|
|
1633
|
+
};
|
|
1634
|
+
if ("requestVideoFrameCallback" in this.#t) {
|
|
1635
|
+
this.#t.requestVideoFrameCallback(s), this.#Vt = window.setTimeout(s, 180);
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
window.requestAnimationFrame(s);
|
|
1639
|
+
}
|
|
1640
|
+
#Kt = () => {
|
|
1641
|
+
if (this.#t.error || this.#t.readyState < HTMLMediaElement.HAVE_CURRENT_DATA || this.#t.videoWidth <= 0 || this.#t.videoHeight <= 0)
|
|
1642
|
+
return this.#w(), !1;
|
|
1643
|
+
if (!this.#A)
|
|
1644
|
+
return this.#Le(), this.#w(), !1;
|
|
1645
|
+
const t = this.#Ws();
|
|
1646
|
+
return this.#y(), t;
|
|
1647
|
+
};
|
|
1648
|
+
#js() {
|
|
1649
|
+
return !this.#t.paused && (!this.#t.ended || this.#t.loop) && this.#t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA;
|
|
1650
|
+
}
|
|
1651
|
+
#l(t = this.#t.currentTime) {
|
|
1652
|
+
this.#Ls = Number.isFinite(t) ? Math.max(0, t) : 0, this.#Fs = performance.now();
|
|
1653
|
+
}
|
|
1654
|
+
#H() {
|
|
1655
|
+
this.#k = null, this.#st = null;
|
|
1656
|
+
}
|
|
1657
|
+
#Os() {
|
|
1658
|
+
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) {
|
|
1659
|
+
this.#k = null;
|
|
1660
|
+
return;
|
|
1661
|
+
}
|
|
1662
|
+
const t = Number.isFinite(this.#t.currentTime) ? Math.max(0, this.#t.currentTime) : 0, s = Number.isFinite(this.#ct) ? this.#ct : t;
|
|
1663
|
+
this.#k = Math.min(this.#t.duration, Math.max(t, s)), this.#l(this.#k);
|
|
1664
|
+
}
|
|
1665
|
+
#Fe() {
|
|
1666
|
+
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) {
|
|
1667
|
+
this.#st = null, this.#Os();
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1670
|
+
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);
|
|
1671
|
+
this.#st = n, this.#k = n * this.#t.duration, this.#l(this.#k), this.#_(n), this.#i.setAttribute("aria-valuenow", `${this.#k}`), this.#i.setAttribute(
|
|
1672
|
+
"aria-valuetext",
|
|
1673
|
+
`${a(this.#k)} of ${a(this.#t.duration)}`
|
|
1674
|
+
);
|
|
1675
|
+
}
|
|
1676
|
+
#X() {
|
|
1677
|
+
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime || 0;
|
|
1678
|
+
if (this.#c()) return this.#f;
|
|
1679
|
+
if (this.#k !== null) return this.#k;
|
|
1680
|
+
if (!this.#js()) return this.#t.currentTime || 0;
|
|
1681
|
+
if (this.#zt || !this.#ht || performance.now() < this.#As)
|
|
1682
|
+
return this.#l(), this.#t.currentTime || 0;
|
|
1683
|
+
if (this.#s.classList.contains("is-loading") && this.#t.readyState < HTMLMediaElement.HAVE_FUTURE_DATA)
|
|
1684
|
+
return this.#l(), this.#t.currentTime || 0;
|
|
1685
|
+
const t = (performance.now() - this.#Fs) / 1e3, s = this.#Ls + t, e = this.#t.loop ? s % this.#t.duration : Math.min(s, this.#t.duration);
|
|
1686
|
+
return !this.#t.loop && this.#t.currentTime - e > 0.45 ? (this.#l(), this.#t.currentTime) : e;
|
|
1687
|
+
}
|
|
1688
|
+
#_(t) {
|
|
1689
|
+
const s = Math.min(1, Math.max(0, t)), e = (1 - s) * 100, { innerWidth: i } = this.#Me(), r = 1 / i, n = this.#a && this.#Ft && this.#J + r < s;
|
|
1690
|
+
if (this.#s.style.setProperty("--sp-progress-inset", `${e}%`), this.#s.style.setProperty("--sp-return-marker-base-opacity", n ? "0" : "1"), n) {
|
|
1691
|
+
const l = this.#Gt(this.#J), h = Math.max(0, i - 2), d = Math.min(h, Math.max(0, l - 3));
|
|
1692
|
+
this.#s.style.setProperty("--sp-return-marker-hole-left", `${d}px`);
|
|
1693
|
+
} else
|
|
1694
|
+
this.#s.style.setProperty("--sp-return-marker-hole-left", "-9999px");
|
|
1695
|
+
}
|
|
1696
|
+
#Se(t) {
|
|
1697
|
+
return !Number.isFinite(this.#t.duration) || this.#t.duration <= 0 ? 0 : Math.min(1, Math.max(0, t / this.#t.duration));
|
|
1698
|
+
}
|
|
1699
|
+
#Me(t = this.#i.getBoundingClientRect()) {
|
|
1700
|
+
return c(t);
|
|
1701
|
+
}
|
|
1702
|
+
#Gt(t, s = this.#i.getBoundingClientRect()) {
|
|
1703
|
+
return T(t, s);
|
|
1704
|
+
}
|
|
1705
|
+
#Ve(t, s) {
|
|
1706
|
+
return E(t, s);
|
|
1707
|
+
}
|
|
1708
|
+
#ze(t) {
|
|
1709
|
+
this.#Lt = Number.isFinite(t) ? Math.max(0, t) : 0, this.#J = this.#Se(this.#Lt);
|
|
1710
|
+
const s = this.#i.getBoundingClientRect(), e = this.#Gt(this.#J, s), i = e >= this.#hs && e <= Math.max(this.#hs, s.width - this.#hs);
|
|
1711
|
+
this.#Ft = this.#Lt > this.#le && i, this.#s.classList.toggle("has-return-marker", this.#Ft), this.#s.style.setProperty("--sp-return-marker-left", `${e}px`);
|
|
1712
|
+
}
|
|
1713
|
+
#Ie(t, s, e, i = this.#a) {
|
|
1714
|
+
const r = e * this.#t.duration;
|
|
1715
|
+
if (!i || !this.#Ft)
|
|
1716
|
+
return { percent: e, targetTime: r };
|
|
1717
|
+
const n = s.left + this.#Gt(this.#J, s);
|
|
1718
|
+
return Math.abs(t - n) <= this.#ae ? {
|
|
1719
|
+
percent: this.#J,
|
|
1720
|
+
targetTime: this.#Lt
|
|
1721
|
+
} : { percent: e, targetTime: r };
|
|
1722
|
+
}
|
|
1723
|
+
#wt(t = this.#X()) {
|
|
1724
|
+
!this.#bt || this.#v || this.#c() || (this.#m.textContent = this.#ks(t), this.#$t());
|
|
1725
|
+
}
|
|
1726
|
+
#g(t = this.#X()) {
|
|
1727
|
+
const s = Number.isFinite(this.#t.duration) && this.#t.duration > 0;
|
|
1728
|
+
if (s && this.#st !== null) {
|
|
1729
|
+
const r = this.#st * this.#t.duration;
|
|
1730
|
+
this.#ct = r, this.#_(this.#st), this.#i.setAttribute("aria-valuemin", "0"), this.#i.setAttribute("aria-valuemax", `${this.#t.duration}`), this.#i.setAttribute("aria-valuenow", `${r}`), this.#i.setAttribute(
|
|
1731
|
+
"aria-valuetext",
|
|
1732
|
+
`${a(r)} of ${a(this.#t.duration)}`
|
|
1733
|
+
), this.#wt(r);
|
|
1734
|
+
return;
|
|
1735
|
+
}
|
|
1736
|
+
const e = s ? Math.min(this.#t.duration, Math.max(0, t)) : t, i = s ? e / this.#t.duration : 0;
|
|
1737
|
+
this.#ct = Number.isFinite(e) ? Math.max(0, e) : 0, this.#_(i), this.#i.setAttribute("aria-valuemin", "0"), this.#i.setAttribute("aria-valuemax", s ? `${this.#t.duration}` : "0"), this.#i.setAttribute("aria-valuenow", s ? `${e}` : "0"), this.#i.setAttribute(
|
|
1855
1738
|
"aria-valuetext",
|
|
1856
|
-
`${
|
|
1857
|
-
),
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
"aria-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1739
|
+
s ? `${a(e)} of ${a(this.#t.duration)}` : "Loading video"
|
|
1740
|
+
), this.#wt(e);
|
|
1741
|
+
}
|
|
1742
|
+
#W(t, s = this.#a, e = !0) {
|
|
1743
|
+
if (!Number.isFinite(this.#t.duration) || this.#t.duration <= 0) return this.#t.currentTime;
|
|
1744
|
+
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(
|
|
1746
|
+
"aria-valuetext",
|
|
1747
|
+
`${a(n.targetTime)} of ${a(this.#t.duration)}`
|
|
1748
|
+
)), this.#Re(), n.targetTime;
|
|
1749
|
+
}
|
|
1750
|
+
#xt() {
|
|
1751
|
+
this.#It = !1, this.#s?.classList.remove("has-controls-collision");
|
|
1752
|
+
}
|
|
1753
|
+
#Re() {
|
|
1754
|
+
if (!this.#a && !this.#v || !this.#V || !this.#ss || this.#bt) {
|
|
1755
|
+
this.#xt();
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
const t = this.#V.getBoundingClientRect(), s = this.#ss.getBoundingClientRect(), e = t.width > 0 && t.height > 0, i = this.#It ? this.#ve : this.#be, r = e && s.right >= t.left - i && s.left <= t.right + i && s.bottom >= t.top - i && s.top <= t.bottom + i;
|
|
1759
|
+
this.#It = r, this.#s.classList.toggle("has-controls-collision", this.#It);
|
|
1760
|
+
}
|
|
1761
|
+
#kt() {
|
|
1762
|
+
this.#ot && (window.cancelAnimationFrame(this.#ot), this.#ot = 0);
|
|
1763
|
+
}
|
|
1764
|
+
#De() {
|
|
1765
|
+
this.#kt(), this.#l();
|
|
1766
|
+
const t = () => {
|
|
1767
|
+
this.#g(this.#X()), this.#js() && (this.#ot = window.requestAnimationFrame(t));
|
|
1768
|
+
};
|
|
1769
|
+
this.#ot = window.requestAnimationFrame(t);
|
|
1770
|
+
}
|
|
1771
|
+
#u() {
|
|
1772
|
+
const t = !this.#t.paused && (!this.#t.ended || this.#t.loop) || this.#a && this.#G, s = this.#b ? this.#b === "playing" : t;
|
|
1773
|
+
if (this.#s.classList.toggle("is-playing", s), this.#M.setAttribute("aria-label", s ? "Pause video" : "Play video"), this.#a) {
|
|
1774
|
+
this.#kt();
|
|
1775
|
+
return;
|
|
1776
|
+
}
|
|
1777
|
+
t && this.#s.classList.contains("has-loaded-once") && !this.#s.classList.contains("is-progress-settling") ? this.#De() : (this.#kt(), this.#g());
|
|
1778
|
+
}
|
|
1779
|
+
#rt() {
|
|
1780
|
+
this.#St && (window.clearTimeout(this.#St), this.#St = 0);
|
|
1781
|
+
}
|
|
1782
|
+
#He() {
|
|
1783
|
+
return k(this.#t);
|
|
1784
|
+
}
|
|
1785
|
+
#T() {
|
|
1786
|
+
return this.volumeEnabled && this.#ut && this.#Rt;
|
|
1787
|
+
}
|
|
1788
|
+
#S() {
|
|
1789
|
+
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");
|
|
1790
|
+
}
|
|
1791
|
+
#y = () => {
|
|
1792
|
+
if (!this.volumeEnabled) {
|
|
1793
|
+
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");
|
|
1794
|
+
return;
|
|
1795
|
+
}
|
|
1796
|
+
if (!this.#ut) {
|
|
1797
|
+
const l = this.#He();
|
|
1798
|
+
l !== "unknown" ? (this.#ut = !0, this.#Rt = l === "available") : this.#t.readyState >= HTMLMediaElement.HAVE_METADATA && !P(this.#t) && (this.#ut = !0, this.#Rt = !0);
|
|
1799
|
+
}
|
|
1800
|
+
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";
|
|
1801
|
+
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
|
+
"aria-label",
|
|
1803
|
+
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();
|
|
1805
|
+
};
|
|
1806
|
+
#Zs(t) {
|
|
1807
|
+
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;
|
|
1809
|
+
this.#t.volume = i, this.#t.muted = i <= 0, this.#y();
|
|
1810
|
+
}
|
|
1811
|
+
#Jt(t) {
|
|
1812
|
+
t !== null && this.#p.hasPointerCapture(t) && this.#p.releasePointerCapture(t);
|
|
1813
|
+
}
|
|
1814
|
+
#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);
|
|
1816
|
+
}
|
|
1817
|
+
#Tt = () => {
|
|
1818
|
+
const t = document.pictureInPictureElement === this.#t, s = this.#t, e = !!(this.pictureInPictureEnabled && document.pictureInPictureEnabled && s.requestPictureInPicture);
|
|
1819
|
+
this.#s.classList.toggle("is-picture-in-picture", t), this.#O.disabled = !e, this.#O.setAttribute("aria-label", t ? "Exit picture in picture" : "Enter picture in picture");
|
|
1820
|
+
};
|
|
1821
|
+
#ys() {
|
|
1822
|
+
return b(this.#r);
|
|
1823
|
+
}
|
|
1824
|
+
#Ks() {
|
|
1825
|
+
return v(this.fullscreenEnabled, this.#s, this.#t);
|
|
1826
|
+
}
|
|
1827
|
+
#qe() {
|
|
1828
|
+
return g(this.#s);
|
|
1829
|
+
}
|
|
1830
|
+
#Be() {
|
|
1831
|
+
w(this.#t);
|
|
1832
|
+
}
|
|
1833
|
+
#$e() {
|
|
1834
|
+
return x();
|
|
1835
|
+
}
|
|
1836
|
+
#Qt = () => {
|
|
1837
|
+
const t = this.#ys(), s = t === this.#s || t === this, e = this.#Ks();
|
|
1838
|
+
return this.#s.classList.toggle("is-fullscreen", s), this.#Z.disabled = !e, this.#Z.setAttribute("aria-label", s ? "Exit fullscreen" : "Enter fullscreen"), s;
|
|
1839
|
+
};
|
|
1840
|
+
#Et = () => {
|
|
1841
|
+
const t = this.#Qt();
|
|
1842
|
+
this.#Ue(t);
|
|
1843
|
+
};
|
|
1844
|
+
#Ue(t) {
|
|
1845
|
+
this.#P(), this.#Ct(), this.#ws(this.#h), this.#Jt(this.#n), this.#rt(), this.#x = !1, this.#a = !1, this.#v = !1, this.#s.classList.remove("is-progress-hovering"), this.#h = null, this.#U = !1, this.#N = !1, this.#F = !1, this.#n = null, this.#vs(), this.#Bs(), this.#j.style.removeProperty("--sp-control-hover-offset"), this.#o.classList.remove("is-volume-open"), this.#z.classList.remove("is-scrubbing-volume"), this.#s.classList.remove("is-scrubbing"), this.#s.classList.remove("is-pointer-active");
|
|
1846
|
+
const s = this.#r.activeElement;
|
|
1847
|
+
s instanceof HTMLElement && s.blur(), t ? this.#Rs() : this.#Yt();
|
|
1848
|
+
}
|
|
1849
|
+
#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());
|
|
1851
|
+
};
|
|
1852
|
+
#ws(t) {
|
|
1853
|
+
t !== null && this.#i.hasPointerCapture(t) && this.#i.releasePointerCapture(t);
|
|
1854
|
+
}
|
|
1855
|
+
async #Js(t, s, e) {
|
|
1856
|
+
if (!this.#x && !this.#a) return;
|
|
1857
|
+
const i = this.#a;
|
|
1858
|
+
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();
|
|
1859
|
+
}
|
|
1860
|
+
#xs(t) {
|
|
1861
|
+
!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());
|
|
1862
|
+
}
|
|
1863
|
+
#ks(t) {
|
|
1864
|
+
if (!this.#ls) return a(t);
|
|
1865
|
+
const s = Number.isFinite(this.#t.duration) ? this.#t.duration : 0;
|
|
1866
|
+
return s <= 0 ? a(t) : `-${a(Math.max(0, s - t))}`;
|
|
1867
|
+
}
|
|
1868
|
+
#Ne() {
|
|
1869
|
+
this.#ft && (window.clearTimeout(this.#ft), this.#ft = 0);
|
|
1870
|
+
}
|
|
1871
|
+
#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");
|
|
1874
|
+
}, 240);
|
|
1875
|
+
}
|
|
1876
|
+
#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());
|
|
1878
|
+
};
|
|
1879
|
+
#_e = async () => {
|
|
1880
|
+
if (performance.now() < this.#Cs)
|
|
1881
|
+
return;
|
|
1882
|
+
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(() => {
|
|
1884
|
+
this.#b = null;
|
|
1885
|
+
})) : (this.#Fe(), this.#t.pause()), this.#u(), this.#R();
|
|
1886
|
+
};
|
|
1887
|
+
#We = (t) => {
|
|
1888
|
+
if (!(t instanceof PointerEvent)) return;
|
|
1889
|
+
const s = this.#M.getBoundingClientRect(), e = t.clientX >= s.left && t.clientX <= s.right && t.clientY >= s.top && t.clientY <= s.bottom, i = this.#V.getBoundingClientRect(), r = t.clientX >= i.left && t.clientX <= i.right && t.clientY >= i.top && t.clientY <= i.bottom, n = this.#i.getBoundingClientRect(), l = t.clientX >= n.left && t.clientX <= n.right && t.clientY >= n.top && t.clientY <= n.bottom, h = this.#D();
|
|
1890
|
+
h && e && (this.#Cs = performance.now() + 260), h && (r || l) && (this.#rs = performance.now() + 260), this.#Y();
|
|
1891
|
+
};
|
|
1892
|
+
#je = (t) => {
|
|
1893
|
+
t.stopPropagation();
|
|
1894
|
+
};
|
|
1895
|
+
#Ct() {
|
|
1896
|
+
this.#pt && (window.clearTimeout(this.#pt), this.#pt = 0);
|
|
1897
|
+
}
|
|
1898
|
+
#Qs() {
|
|
1899
|
+
if (!this.#T() || !this.volumeSliderEnabled) {
|
|
1900
|
+
this.#S();
|
|
1901
|
+
return;
|
|
1902
|
+
}
|
|
1903
|
+
this.#Ct(), this.#o.classList.add("is-volume-open");
|
|
1904
|
+
}
|
|
1905
|
+
#Ps = () => {
|
|
1906
|
+
this.#pt = 0, !(this.#N || this.#F) && this.#o.classList.remove("is-volume-open");
|
|
1907
|
+
};
|
|
1908
|
+
#te(t = 150) {
|
|
1909
|
+
this.#Ct(), this.#pt = window.setTimeout(this.#Ps, t);
|
|
1910
|
+
}
|
|
1911
|
+
#se = () => {
|
|
1912
|
+
if (!this.#d()) {
|
|
1913
|
+
if (!this.#T() || !this.volumeSliderEnabled) {
|
|
1914
|
+
this.#S();
|
|
1915
|
+
return;
|
|
1916
|
+
}
|
|
1917
|
+
this.#N = !0, this.#Qs();
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
#ee = () => {
|
|
1921
|
+
if (!this.#d()) {
|
|
1922
|
+
if (!this.#T() || !this.volumeSliderEnabled) {
|
|
1923
|
+
this.#S();
|
|
1924
|
+
return;
|
|
1925
|
+
}
|
|
1926
|
+
this.#N = !1, this.#te();
|
|
1927
|
+
}
|
|
1928
|
+
};
|
|
1929
|
+
#Oe = (t) => {
|
|
1930
|
+
if (t.preventDefault(), t.stopPropagation(), !this.#T()) {
|
|
1931
|
+
this.#S();
|
|
1932
|
+
return;
|
|
1933
|
+
}
|
|
1934
|
+
!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());
|
|
1935
|
+
};
|
|
1936
|
+
#Ze = (t) => {
|
|
1937
|
+
if (t instanceof PointerEvent) {
|
|
1938
|
+
if (t.preventDefault(), t.stopPropagation(), !this.#T() || !this.volumeSliderEnabled || this.#d()) {
|
|
1939
|
+
this.#S();
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
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);
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
#Ke = (t) => {
|
|
1946
|
+
t instanceof PointerEvent && this.#F && (this.#n !== null && t.pointerId !== this.#n || (t.preventDefault(), t.stopPropagation(), this.#Zs(t.clientY)));
|
|
1947
|
+
};
|
|
1948
|
+
#Ge = (t) => {
|
|
1949
|
+
t instanceof PointerEvent && (this.#n !== null && t.pointerId !== this.#n || (t.stopPropagation(), this.#Pt(t.pointerId), this.#R()));
|
|
1950
|
+
};
|
|
1951
|
+
#Je = (t) => {
|
|
1952
|
+
t instanceof PointerEvent && (this.#n !== null && t.pointerId !== this.#n || (t.stopPropagation(), this.#Pt(t.pointerId)));
|
|
1953
|
+
};
|
|
1954
|
+
#Qe = (t) => {
|
|
1955
|
+
if (!(t instanceof KeyboardEvent)) return;
|
|
1956
|
+
if (!this.#T()) {
|
|
1957
|
+
t.preventDefault(), t.stopPropagation(), this.#S();
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
if (!["ArrowUp", "ArrowDown", "Home", "End"].includes(t.key)) return;
|
|
1961
|
+
t.preventDefault(), t.stopPropagation();
|
|
1962
|
+
const s = t.shiftKey ? 0.1 : 0.05, e = t.key === "Home" ? 0 : t.key === "End" ? 1 : this.#t.volume + (t.key === "ArrowUp" ? s : -s);
|
|
1963
|
+
this.#t.volume = Math.min(1, Math.max(0, e)), this.#t.muted = this.#t.volume <= 0, this.#y();
|
|
1964
|
+
};
|
|
1965
|
+
#ti = async () => {
|
|
1966
|
+
const t = this.#t;
|
|
1967
|
+
if (!(!this.pictureInPictureEnabled || !document.pictureInPictureEnabled || !t.requestPictureInPicture) && !(!this.#gt() || this.#Xt())) {
|
|
1968
|
+
this.#D();
|
|
1969
|
+
try {
|
|
1970
|
+
await this.#Y(), document.pictureInPictureElement === this.#t ? await document.exitPictureInPicture() : await t.requestPictureInPicture();
|
|
1971
|
+
} catch {
|
|
1972
|
+
} finally {
|
|
1973
|
+
this.#Tt(), this.#R();
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
};
|
|
1977
|
+
#si = async (t) => {
|
|
1978
|
+
if (this.#Ks() && (t.preventDefault(), t.stopPropagation(), !(!this.#gt() || this.#Xt()))) {
|
|
1979
|
+
this.#vt(t), this.#D();
|
|
1980
|
+
try {
|
|
1981
|
+
const s = this.#ys();
|
|
1982
|
+
s === this.#s || s === this ? await this.#$e() : (await this.#Y(), y(this.#s) ? await this.#qe() : this.#Be());
|
|
1983
|
+
} catch {
|
|
1984
|
+
} finally {
|
|
1985
|
+
this.#Qt(), this.#R();
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
#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));
|
|
1991
|
+
};
|
|
1992
|
+
#re = () => {
|
|
1993
|
+
this.#c() || this.#zs();
|
|
1994
|
+
};
|
|
1995
|
+
#ei = (t) => {
|
|
1996
|
+
if (t instanceof PointerEvent) {
|
|
1997
|
+
if (t.preventDefault(), !this.#gt() || this.#Xt()) {
|
|
1998
|
+
this.#D(), this.#d() && (this.#rs = performance.now() + 260);
|
|
1999
|
+
return;
|
|
2000
|
+
}
|
|
2001
|
+
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);
|
|
2002
|
+
}
|
|
2003
|
+
};
|
|
2004
|
+
#ii = (t) => {
|
|
2005
|
+
if (!(t instanceof KeyboardEvent) || !Number.isFinite(this.#t.duration) || this.#t.duration <= 0 || !["ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown"].includes(t.key)) return;
|
|
2006
|
+
t.preventDefault(), t.stopPropagation(), this.#Hs();
|
|
2007
|
+
const s = this.#X(), e = t.shiftKey ? 10 : 5, i = Math.max(10, this.#t.duration * 0.1), r = t.key === "Home" ? 0 : t.key === "End" ? this.#t.duration : t.key === "PageUp" ? s + i : t.key === "PageDown" ? s - i : s + (t.key === "ArrowRight" ? e : -e);
|
|
2008
|
+
this.#t.currentTime = Math.min(this.#t.duration, Math.max(0, r)), this.#l(this.#t.currentTime), this.#g(this.#t.currentTime);
|
|
2009
|
+
};
|
|
2010
|
+
#ri = (t) => {
|
|
2011
|
+
if (t instanceof PointerEvent) {
|
|
2012
|
+
if (!this.#x) {
|
|
2013
|
+
this.#d() || (this.#v = !0, this.#s.classList.add("is-progress-hovering"), this.#W(t.clientX, !1, !1));
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
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)));
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
#oi = (t) => {
|
|
2020
|
+
t instanceof PointerEvent && (this.#h !== null && t.pointerId !== this.#h || this.#Js(t.clientX, t.pointerId, !0));
|
|
2021
|
+
};
|
|
2022
|
+
#ni = (t) => {
|
|
2023
|
+
t instanceof PointerEvent && (this.#h !== null && t.pointerId !== this.#h || this.#xs(t.pointerId));
|
|
2024
|
+
};
|
|
2025
|
+
#ai = (t) => {
|
|
2026
|
+
if (t instanceof PointerEvent) {
|
|
2027
|
+
if (this.#n !== null && t.pointerId === this.#n) {
|
|
2028
|
+
this.#Pt(t.pointerId);
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
this.#h === null || t.pointerId !== this.#h || this.#Js(t.clientX, t.pointerId, !0);
|
|
2032
|
+
}
|
|
2033
|
+
};
|
|
2034
|
+
#li = (t) => {
|
|
2035
|
+
if (t instanceof PointerEvent) {
|
|
2036
|
+
if (this.#n !== null && t.pointerId === this.#n) {
|
|
2037
|
+
this.#Pt(t.pointerId);
|
|
2038
|
+
return;
|
|
2039
|
+
}
|
|
2040
|
+
this.#h === null || t.pointerId !== this.#h || this.#xs(t.pointerId);
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
#hi = () => {
|
|
2044
|
+
this.#Pt(this.#n), this.#xs(this.#h);
|
|
2045
|
+
};
|
|
2046
|
+
#ci = () => {
|
|
2047
|
+
this.#ys() || this.#Yt();
|
|
2048
|
+
};
|
|
2049
|
+
#ui = () => {
|
|
2050
|
+
this.#b = null, this.#H(), this.#c() || this.#l(), this.#u();
|
|
1887
2051
|
};
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
}
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
if (!t(this, hs)) return q(i);
|
|
1932
|
-
const a = Number.isFinite(t(this, o).duration) ? t(this, o).duration : 0;
|
|
1933
|
-
return a <= 0 ? q(i) : `-${q(Math.max(0, a - i))}`;
|
|
1934
|
-
}, Hi = function() {
|
|
1935
|
-
t(this, Ct) && (window.clearTimeout(t(this, Ct)), r(this, Ct, 0));
|
|
1936
|
-
}, Bi = function() {
|
|
1937
|
-
e(this, s, Hi).call(this), t(this, L).classList.remove("is-time-animating"), t(this, L).offsetWidth, t(this, L).classList.add("is-time-animating"), r(this, Ct, window.setTimeout(() => {
|
|
1938
|
-
r(this, Ct, 0), t(this, L).classList.remove("is-time-animating");
|
|
1939
|
-
}, 240));
|
|
1940
|
-
}, me = new WeakMap(), fe = new WeakMap(), be = new WeakMap(), ve = new WeakMap(), xs = function() {
|
|
1941
|
-
t(this, Pt) && (window.clearTimeout(t(this, Pt)), r(this, Pt, 0));
|
|
1942
|
-
}, hi = function() {
|
|
1943
|
-
!this.volumeEnabled || !this.volumeSliderEnabled || !t(this, y) || (e(this, s, xs).call(this), t(this, w).classList.add("is-volume-open"));
|
|
1944
|
-
}, us = new WeakMap(), ci = function(i = 150) {
|
|
1945
|
-
e(this, s, xs).call(this), r(this, Pt, window.setTimeout(t(this, us), i));
|
|
1946
|
-
}, Is = new WeakMap(), Rs = new WeakMap(), ge = new WeakMap(), ye = new WeakMap(), we = new WeakMap(), xe = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Te = new WeakMap(), Ee = new WeakMap(), Ds = new WeakMap(), qs = new WeakMap(), Ce = new WeakMap(), Ae = new WeakMap(), Le = new WeakMap(), Fe = new WeakMap(), Se = new WeakMap(), Me = new WeakMap(), Ve = new WeakMap(), ze = new WeakMap(), Ie = new WeakMap(), Re = new WeakMap(), De = new WeakMap(), qe = new WeakMap(), He = new WeakMap(), ps = new WeakMap(), Be = new WeakMap(), $e = new WeakMap(), Ne = new WeakMap(), Ue = new WeakMap(), Ye = new WeakMap(), Xe = new WeakMap(), A = function() {
|
|
1947
|
-
return window.matchMedia("(max-width: 768px)").matches && window.matchMedia("(hover: none), (pointer: coarse)").matches;
|
|
1948
|
-
}, $i = function() {
|
|
1949
|
-
t(this, o) && (t(this, H)?.disconnect(), r(this, H, null), e(this, s, gs).call(this), e(this, s, Ws).call(this), r(this, B, !1), r(this, rs, 0), r(this, $, !1), r(this, N, !1), r(this, Z, !1), r(this, K, !1), r(this, G, t(this, G) + 1), r(this, xt, !1), r(this, kt, 0), e(this, s, st).call(this), r(this, y, !0), r(this, _, !1), r(this, gt, !1), r(this, S, null), t(this, h).classList.remove("has-loaded-once", "has-visible-frame", "is-progress-settling"), t(this, o).dataset.src = this.src, t(this, o).pause(), t(this, o).removeAttribute("src"), t(this, o).preload = "none", e(this, s, ms).call(this), t(this, o).load(), e(this, s, ft).call(this, 0), t(this, V).call(this), t(this, z).call(this), e(this, s, C).call(this));
|
|
1950
|
-
}, di(bi, "observedAttributes", _i);
|
|
1951
|
-
customElements.get("simple-player") || customElements.define("simple-player", bi);
|
|
2052
|
+
#pi = () => {
|
|
2053
|
+
this.#b = null, this.#c() || this.#Os(), this.#w(), this.#u();
|
|
2054
|
+
};
|
|
2055
|
+
#di = () => {
|
|
2056
|
+
this.#b = null, this.#H(), this.#c() || this.#l(), this.#u();
|
|
2057
|
+
};
|
|
2058
|
+
#mi = () => {
|
|
2059
|
+
this.#yt(!0, !0);
|
|
2060
|
+
};
|
|
2061
|
+
#Ts = () => {
|
|
2062
|
+
this.#yt(!0);
|
|
2063
|
+
};
|
|
2064
|
+
#fi = () => {
|
|
2065
|
+
this.#H(), this.#y(), this.#c() || this.#l(), this.#w(), this.#g();
|
|
2066
|
+
};
|
|
2067
|
+
#bi = () => {
|
|
2068
|
+
const t = this.#Kt();
|
|
2069
|
+
this.#y(), t && !this.#c() && this.#l(), this.#u();
|
|
2070
|
+
};
|
|
2071
|
+
#vi = () => {
|
|
2072
|
+
if (this.#H(), this.#w(), this.#I && (!this.#nt || this.#t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA)) {
|
|
2073
|
+
this.#_s(), this.#u();
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
this.#c() || this.#l(), this.#g();
|
|
2077
|
+
};
|
|
2078
|
+
#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();
|
|
2080
|
+
};
|
|
2081
|
+
#yi = () => {
|
|
2082
|
+
this.#y(), this.#g();
|
|
2083
|
+
};
|
|
2084
|
+
#wi = () => {
|
|
2085
|
+
this.#y();
|
|
2086
|
+
};
|
|
2087
|
+
#d() {
|
|
2088
|
+
return window.matchMedia("(max-width: 768px)").matches && window.matchMedia("(hover: none), (pointer: coarse)").matches;
|
|
2089
|
+
}
|
|
2090
|
+
#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());
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
customElements.get("simple-player") || customElements.define("simple-player", A);
|
|
1952
2095
|
export {
|
|
1953
|
-
|
|
2096
|
+
A as SimplePlayer
|
|
1954
2097
|
};
|
|
1955
2098
|
//# sourceMappingURL=simple-player.js.map
|