@banou/media-player 0.10.28 → 0.10.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/chapters/index.d.ts +3 -0
- package/dist/chapters/index.js +2 -0
- package/dist/chapters-EBYXcEml.js +115 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +728 -814
- package/dist/react/components/chrome.d.ts +4 -1
- package/dist/react/components/control-bar.d.ts +3 -1
- package/dist/react/components/tooltip-display.d.ts +2 -0
- package/dist/react/video-player.d.ts +19 -0
- package/dist/remote/index.d.ts +27 -1
- package/dist/remote/index.js +163 -139
- package/dist/remote/protocol.d.ts +16 -4
- package/package.json +5 -1
- package/src/lib/chapters/index.ts +5 -0
- package/src/lib/index.tsx +1 -0
- package/src/lib/react/components/chrome.tsx +12 -3
- package/src/lib/react/components/control-bar.tsx +21 -6
- package/src/lib/react/components/tooltip-display.tsx +14 -2
- package/src/lib/react/video-player.tsx +43 -2
- package/src/lib/remote/index.ts +99 -18
- package/src/lib/remote/protocol.ts +16 -5
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { c as e, l as t, n, o as r, r as i, s as a, t as o, u as s } from "./engine-DeEY2qao.js";
|
|
2
2
|
import { languageOf as c, preferredTrack as l } from "./language/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
3
|
+
import { n as u, r as d, t as f } from "./chapters-EBYXcEml.js";
|
|
4
|
+
import { Children as p, Fragment as m, createContext as h, isValidElement as g, useCallback as _, useContext as v, useEffect as y, useMemo as b, useRef as x, useState as S, useSyncExternalStore as C } from "react";
|
|
5
|
+
import { css as w, keyframes as T } from "@emotion/react";
|
|
6
|
+
import { createPlayer as E, useContainerAttach as D, useMediaAttach as O } from "@videojs/react";
|
|
7
|
+
import { definePlayerFeature as k, videoFeatures as A } from "@videojs/core/dom";
|
|
8
|
+
import { makeRemuxer as j } from "libav-wasm";
|
|
9
|
+
import { createMediaElementSource as M } from "@banou/ponyfill/web-audio";
|
|
10
|
+
import { Fragment as N, jsx as P, jsxs as F } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { Captions as I, CaptionsOff as L, Check as R, ChevronLeft as z, ChevronRight as B, Copy as V, Maximize as H, Minimize as U, Pause as W, Play as ee, RotateCcw as G, Settings as te, TriangleAlert as K, Volume1 as q, Volume2 as J, VolumeX as ne } from "lucide-react";
|
|
12
|
+
import { Tooltip as re } from "react-tooltip";
|
|
12
13
|
//#region src/lib/react/source-feature.ts
|
|
13
|
-
var
|
|
14
|
+
var ie = {
|
|
14
15
|
indexes: [],
|
|
15
16
|
chapters: [],
|
|
16
17
|
thumbnails: [],
|
|
@@ -35,19 +36,19 @@ var q = {
|
|
|
35
36
|
playbackErrors: [],
|
|
36
37
|
ready: !1,
|
|
37
38
|
setSourceState: () => {}
|
|
38
|
-
},
|
|
39
|
+
}, ae = k({
|
|
39
40
|
name: "source",
|
|
40
|
-
state: () => ({ ...
|
|
41
|
+
state: () => ({ ...ie }),
|
|
41
42
|
attach({ set: e }) {
|
|
42
43
|
e({
|
|
43
44
|
setSourceState: (t) => e(t),
|
|
44
45
|
setHideUI: (t) => e({ hideUI: t })
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
|
-
}),
|
|
48
|
-
features: [...
|
|
48
|
+
}), oe = E({
|
|
49
|
+
features: [...A, ae],
|
|
49
50
|
displayName: "MediaPlayer"
|
|
50
|
-
}), Y =
|
|
51
|
+
}), Y = oe.usePlayer, se = (e) => {
|
|
51
52
|
if (e && e !== "und") try {
|
|
52
53
|
return new Intl.DisplayNames([navigator.language || "en"], {
|
|
53
54
|
type: "language",
|
|
@@ -56,81 +57,81 @@ var q = {
|
|
|
56
57
|
} catch {
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
},
|
|
60
|
-
let t = e.map((e) =>
|
|
60
|
+
}, ce = (e) => e?.replace(/_/g, " ").trim() || void 0, le = (e) => {
|
|
61
|
+
let t = e.map((e) => se(e.language) ?? ce(e.title) ?? `Track ${e.streamIndex}`), n = t.reduce((e, t) => ({
|
|
61
62
|
...e,
|
|
62
63
|
[t]: (e[t] ?? 0) + 1
|
|
63
64
|
}), {});
|
|
64
65
|
return e.map((e, r) => {
|
|
65
|
-
let i = t[r], a =
|
|
66
|
+
let i = t[r], a = ce(e.title);
|
|
66
67
|
return {
|
|
67
68
|
track: e,
|
|
68
69
|
label: (n[i] ?? 0) > 1 && a && a !== i ? `${i} (${a})` : i
|
|
69
70
|
};
|
|
70
71
|
});
|
|
71
|
-
},
|
|
72
|
+
}, X = (e) => le(e).map(({ track: e, label: t }) => ({
|
|
72
73
|
id: e.streamIndex,
|
|
73
74
|
label: t
|
|
74
|
-
})),
|
|
75
|
+
})), ue = [
|
|
75
76
|
0,
|
|
76
77
|
250,
|
|
77
78
|
1e3,
|
|
78
79
|
3e3,
|
|
79
80
|
1e4
|
|
80
|
-
],
|
|
81
|
+
], de = 6e4, Z = 500, fe = 15e3, pe = (e, t) => {
|
|
81
82
|
if (e === null) return;
|
|
82
83
|
let n = e === void 0 ? 0 : l(e, t);
|
|
83
84
|
return t[Math.max(n, 0)]?.streamIndex;
|
|
84
|
-
},
|
|
85
|
+
}, me = (e) => e instanceof Error ? e.message : String(e), he = (e) => {
|
|
85
86
|
let t = [], n = e?.cause;
|
|
86
87
|
for (let e = 0; n != null && e < 8; e++) {
|
|
87
88
|
if (typeof MediaError < "u" && n instanceof MediaError) {
|
|
88
89
|
t.push(`MediaError code ${n.code}${n.message ? `: ${n.message}` : ""}`);
|
|
89
90
|
break;
|
|
90
91
|
}
|
|
91
|
-
t.push(
|
|
92
|
+
t.push(me(n)), n = n?.cause;
|
|
92
93
|
}
|
|
93
94
|
return t.length ? t.join("\n") : void 0;
|
|
94
|
-
},
|
|
95
|
-
let o = Y(), { read: s, size: u, publicPath: d = "", libavWorkerUrl: f = "", jassubWorkerUrl:
|
|
95
|
+
}, ge = (e, t, n, i) => {
|
|
96
|
+
let o = Y(), { read: s, size: u, publicPath: d = "", libavWorkerUrl: f = "", jassubWorkerUrl: p = "", jassubWasmUrl: m = "", jassubLegacyWasmUrl: h, defaultFontUrl: g, cjkFontUrl: v, bufferSize: b, autoplay: C = !1, chapters: w, seekPrepareBudgetMs: T = Z } = n ?? {}, E = x(w);
|
|
96
97
|
E.current = w;
|
|
97
|
-
let [D, O] =
|
|
98
|
+
let [D, O] = S(), k = D && D.size === u ? D.streamIndex : void 0, [A, j] = S(0), M = x({
|
|
98
99
|
count: 0,
|
|
99
100
|
at: 0
|
|
100
|
-
}), N =
|
|
101
|
-
|
|
101
|
+
}), N = x(void 0);
|
|
102
|
+
y(() => (M.current = {
|
|
102
103
|
count: 0,
|
|
103
104
|
at: 0
|
|
104
105
|
}, o.setSourceState({ playbackErrors: [] }), () => {
|
|
105
106
|
N.current && clearTimeout(N.current);
|
|
106
107
|
}), [u]);
|
|
107
|
-
let P =
|
|
108
|
+
let P = x(null), F = x(null), I = x(void 0), L = x(u);
|
|
108
109
|
L.current = u;
|
|
109
|
-
let R =
|
|
110
|
+
let R = x({
|
|
110
111
|
audio: [],
|
|
111
112
|
subtitles: []
|
|
112
|
-
}), z =
|
|
113
|
+
}), z = x(s);
|
|
113
114
|
z.current = s;
|
|
114
|
-
let B =
|
|
115
|
+
let B = x(n?.preferredAudioLanguage);
|
|
115
116
|
B.current = n?.preferredAudioLanguage;
|
|
116
|
-
let V =
|
|
117
|
+
let V = x(n?.preferredSubtitleLanguage);
|
|
117
118
|
V.current = n?.preferredSubtitleLanguage;
|
|
118
|
-
let H =
|
|
119
|
+
let H = x(n?.onPreferredAudioLanguageChange);
|
|
119
120
|
H.current = n?.onPreferredAudioLanguageChange;
|
|
120
|
-
let U =
|
|
121
|
+
let U = x(n?.onPreferredSubtitleLanguageChange);
|
|
121
122
|
U.current = n?.onPreferredSubtitleLanguageChange;
|
|
122
|
-
let W =
|
|
123
|
+
let W = x(n?.onSeek);
|
|
123
124
|
W.current = n?.onSeek;
|
|
124
|
-
let ee =
|
|
125
|
+
let ee = x(n?.onPlaybackError);
|
|
125
126
|
ee.current = n?.onPlaybackError;
|
|
126
|
-
let G =
|
|
127
|
+
let G = x(i);
|
|
127
128
|
G.current = i;
|
|
128
|
-
let
|
|
129
|
+
let te = _((e) => {
|
|
129
130
|
let t = typeof e == "number" ? e : void 0, n = o.selectedSubtitleTrack === void 0;
|
|
130
131
|
I.current = L.current, o.setSourceState({ selectedSubtitleTrack: t }), P.current?.selectSubtitleStream(t);
|
|
131
132
|
let r = R.current.subtitles.find((e) => e.streamIndex === t), i = t === void 0 ? null : c(r) ?? (n ? r?.title?.trim() || "und" : void 0);
|
|
132
133
|
i !== void 0 && U.current?.(i);
|
|
133
|
-
}, [o]),
|
|
134
|
+
}, [o]), K = _((e) => {
|
|
134
135
|
let t = P.current;
|
|
135
136
|
if (!t || T <= 0) {
|
|
136
137
|
o.seek(e);
|
|
@@ -146,7 +147,7 @@ var q = {
|
|
|
146
147
|
o.setSourceState({ seekingTo: e });
|
|
147
148
|
let c = t.videoElement, l = () => {
|
|
148
149
|
c?.removeEventListener("seeked", l), clearTimeout(u), o.setSourceState({ seekingTo: void 0 });
|
|
149
|
-
}, u = setTimeout(l,
|
|
150
|
+
}, u = setTimeout(l, fe);
|
|
150
151
|
c?.addEventListener("seeked", l);
|
|
151
152
|
let d = setTimeout(() => {
|
|
152
153
|
a = "deadline", s();
|
|
@@ -154,7 +155,7 @@ var q = {
|
|
|
154
155
|
t.prepareSeek(e).catch(() => {}).finally(() => {
|
|
155
156
|
clearTimeout(d), s();
|
|
156
157
|
});
|
|
157
|
-
}, [o, T]),
|
|
158
|
+
}, [o, T]), q = _((e) => {
|
|
158
159
|
if (typeof e != "number" || L.current === void 0) return;
|
|
159
160
|
o.setSourceState({ selectedAudioTrack: e }), O({
|
|
160
161
|
size: L.current,
|
|
@@ -163,18 +164,18 @@ var q = {
|
|
|
163
164
|
let t = c(R.current.audio.find((t) => t.streamIndex === e));
|
|
164
165
|
t !== void 0 && H.current?.(t);
|
|
165
166
|
}, [o]), J = Y((e) => e.setSourceState);
|
|
166
|
-
|
|
167
|
+
y(() => {
|
|
167
168
|
J({
|
|
168
|
-
selectSubtitleTrack:
|
|
169
|
-
selectAudioTrack:
|
|
170
|
-
requestSeek:
|
|
169
|
+
selectSubtitleTrack: te,
|
|
170
|
+
selectAudioTrack: q,
|
|
171
|
+
requestSeek: K
|
|
171
172
|
});
|
|
172
173
|
}, [
|
|
173
174
|
J,
|
|
174
|
-
K,
|
|
175
175
|
te,
|
|
176
|
-
q
|
|
177
|
-
|
|
176
|
+
q,
|
|
177
|
+
K
|
|
178
|
+
]), y(() => {
|
|
178
179
|
if (!e || !t || !u || !s) return;
|
|
179
180
|
let n = !1;
|
|
180
181
|
o.setSourceState({
|
|
@@ -182,7 +183,7 @@ var q = {
|
|
|
182
183
|
ready: !1
|
|
183
184
|
});
|
|
184
185
|
let i = (t, n) => {
|
|
185
|
-
let r = Date.now(), i =
|
|
186
|
+
let r = Date.now(), i = me(t), a = he(t), s = o.playbackErrors, c = s[s.length - 1];
|
|
186
187
|
if (c && c.message === i && c.detail === a && c.recovered === n) {
|
|
187
188
|
let e = {
|
|
188
189
|
...c,
|
|
@@ -207,11 +208,11 @@ var q = {
|
|
|
207
208
|
let t = r(e);
|
|
208
209
|
if (i(e, t), t) {
|
|
209
210
|
let t = performance.now();
|
|
210
|
-
t - M.current.at >
|
|
211
|
+
t - M.current.at > de && (M.current = {
|
|
211
212
|
count: 0,
|
|
212
213
|
at: t
|
|
213
214
|
});
|
|
214
|
-
let n =
|
|
215
|
+
let n = ue[Math.min(M.current.count, ue.length - 1)];
|
|
215
216
|
M.current = {
|
|
216
217
|
count: M.current.count + 1,
|
|
217
218
|
at: t
|
|
@@ -229,12 +230,12 @@ var q = {
|
|
|
229
230
|
length: u,
|
|
230
231
|
publicPath: d,
|
|
231
232
|
libavWorkerUrl: f,
|
|
232
|
-
jassubWorkerUrl:
|
|
233
|
-
jassubWasmUrl:
|
|
234
|
-
jassubLegacyWasmUrl:
|
|
235
|
-
defaultFontUrl:
|
|
236
|
-
cjkFontUrl:
|
|
237
|
-
bufferSize:
|
|
233
|
+
jassubWorkerUrl: p,
|
|
234
|
+
jassubWasmUrl: m,
|
|
235
|
+
jassubLegacyWasmUrl: h,
|
|
236
|
+
defaultFontUrl: g,
|
|
237
|
+
cjkFontUrl: v,
|
|
238
|
+
bufferSize: b,
|
|
238
239
|
audioStreamIndex: k,
|
|
239
240
|
chooseAudioStream: (e) => {
|
|
240
241
|
let t = B.current;
|
|
@@ -254,13 +255,13 @@ var q = {
|
|
|
254
255
|
onOutput: (e) => G.current?.(e),
|
|
255
256
|
onSubtitleStreams: (e) => {
|
|
256
257
|
n || (R.current.subtitles = e, o.setSourceState({
|
|
257
|
-
subtitleTracks:
|
|
258
|
-
...I.current === u ? {} : { selectedSubtitleTrack:
|
|
258
|
+
subtitleTracks: X(e),
|
|
259
|
+
...I.current === u ? {} : { selectedSubtitleTrack: pe(V.current, e) }
|
|
259
260
|
}));
|
|
260
261
|
},
|
|
261
262
|
onAudioStreams: (e, t) => {
|
|
262
263
|
n || (R.current.audio = e, o.setSourceState({
|
|
263
|
-
audioTracks:
|
|
264
|
+
audioTracks: X(e),
|
|
264
265
|
selectedAudioTrack: t
|
|
265
266
|
}));
|
|
266
267
|
}
|
|
@@ -291,22 +292,22 @@ var q = {
|
|
|
291
292
|
u,
|
|
292
293
|
d,
|
|
293
294
|
f,
|
|
295
|
+
p,
|
|
296
|
+
m,
|
|
294
297
|
h,
|
|
298
|
+
g,
|
|
295
299
|
v,
|
|
296
|
-
y,
|
|
297
300
|
b,
|
|
298
|
-
x,
|
|
299
|
-
S,
|
|
300
301
|
k,
|
|
301
302
|
C,
|
|
302
303
|
A
|
|
303
304
|
]);
|
|
304
|
-
},
|
|
305
|
+
}, _e = 1001 / 24e3, ve = (e, t) => new Promise((n) => {
|
|
305
306
|
let r = setTimeout(n, t);
|
|
306
307
|
e.requestVideoFrameCallback(() => {
|
|
307
308
|
clearTimeout(r), n();
|
|
308
309
|
});
|
|
309
|
-
}),
|
|
310
|
+
}), ye = (e) => {
|
|
310
311
|
let t = !1, n, r = async (i) => {
|
|
311
312
|
if (t) {
|
|
312
313
|
n = i;
|
|
@@ -322,14 +323,14 @@ var q = {
|
|
|
322
323
|
}
|
|
323
324
|
};
|
|
324
325
|
return r;
|
|
325
|
-
},
|
|
326
|
-
let n = Y(), r = Y((e) => e.setSourceState), i =
|
|
326
|
+
}, be = (e, t) => {
|
|
327
|
+
let n = Y(), r = Y((e) => e.setSourceState), i = x(t);
|
|
327
328
|
i.current = t;
|
|
328
329
|
let a = !!t;
|
|
329
|
-
|
|
330
|
+
y(() => {
|
|
330
331
|
let t = e;
|
|
331
332
|
if (!t) return;
|
|
332
|
-
if (typeof t.requestVideoFrameCallback != "function") return a ? (r({ stepFrame:
|
|
333
|
+
if (typeof t.requestVideoFrameCallback != "function") return a ? (r({ stepFrame: ye(async (e) => {
|
|
333
334
|
try {
|
|
334
335
|
await i.current?.(e);
|
|
335
336
|
} catch (e) {
|
|
@@ -348,11 +349,11 @@ var q = {
|
|
|
348
349
|
};
|
|
349
350
|
d = t.requestVideoFrameCallback(f);
|
|
350
351
|
let p = () => {
|
|
351
|
-
if (c.length < 5) return
|
|
352
|
+
if (c.length < 5) return _e;
|
|
352
353
|
let e = [...c].sort((e, t) => e - t), t = e[e.length >> 1], n = e.filter((e) => Math.abs(e - t) <= t / 4);
|
|
353
354
|
return n.reduce((e, t) => e + t, 0) / n.length;
|
|
354
|
-
}, m =
|
|
355
|
-
t.paused || (t.pause(), await
|
|
355
|
+
}, m = ye(async (e) => {
|
|
356
|
+
t.paused || (t.pause(), await ve(t, 100));
|
|
356
357
|
let r = p(), i = n.state.seekingTo, a = i === void 0 ? o ? o.mediaTime + (e > 0 ? 1.5 : -.5) * r : t.currentTime + e * r : i + e * r, s = Math.max(0, Math.min(a, t.duration || a)), c = new Promise((e) => {
|
|
357
358
|
let n = setTimeout(e, 1e3);
|
|
358
359
|
t.addEventListener("seeked", () => {
|
|
@@ -370,13 +371,13 @@ var q = {
|
|
|
370
371
|
n,
|
|
371
372
|
r
|
|
372
373
|
]);
|
|
373
|
-
},
|
|
374
|
-
let [o, s] =
|
|
374
|
+
}, xe = 5e3, Se = 6e4, Ce = ({ publicPath: e, workerUrl: t, length: n, read: r, downloadedRanges: a }) => {
|
|
375
|
+
let [o, s] = S([]), c = x(null), l = x(r);
|
|
375
376
|
l.current = r;
|
|
376
|
-
let u =
|
|
377
|
-
return d.current = u,
|
|
377
|
+
let u = b(() => a?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")]), d = x(u);
|
|
378
|
+
return d.current = u, y(() => {
|
|
378
379
|
if (!n || !r || !e || !t) return;
|
|
379
|
-
let a = !1, o = null, u, f =
|
|
380
|
+
let a = !1, o = null, u, f = xe, p = () => {
|
|
380
381
|
i({
|
|
381
382
|
publicPath: e,
|
|
382
383
|
workerUrl: t,
|
|
@@ -392,7 +393,7 @@ var q = {
|
|
|
392
393
|
}
|
|
393
394
|
o = e, c.current = e, e.update(d.current);
|
|
394
395
|
}, () => {
|
|
395
|
-
a || (u = setTimeout(p, f), f = Math.min(f * 2,
|
|
396
|
+
a || (u = setTimeout(p, f), f = Math.min(f * 2, Se));
|
|
396
397
|
});
|
|
397
398
|
};
|
|
398
399
|
return p(), () => {
|
|
@@ -402,17 +403,17 @@ var q = {
|
|
|
402
403
|
n,
|
|
403
404
|
e,
|
|
404
405
|
t
|
|
405
|
-
]),
|
|
406
|
+
]), y(() => {
|
|
406
407
|
c.current?.update(u);
|
|
407
408
|
}, [u]), {
|
|
408
409
|
thumbnails: o,
|
|
409
|
-
requestThumbnail:
|
|
410
|
+
requestThumbnail: _((e) => {
|
|
410
411
|
c.current?.prioritize(e);
|
|
411
412
|
}, [])
|
|
412
413
|
};
|
|
413
|
-
},
|
|
414
|
-
let r =
|
|
415
|
-
|
|
414
|
+
}, we = (e, t) => {
|
|
415
|
+
let r = x(null), [i, a] = S(!1), [s] = S(() => n());
|
|
416
|
+
y(() => {
|
|
416
417
|
if (!e || !t || !s) return;
|
|
417
418
|
let n = o({
|
|
418
419
|
video: e,
|
|
@@ -428,7 +429,7 @@ var q = {
|
|
|
428
429
|
t,
|
|
429
430
|
s
|
|
430
431
|
]);
|
|
431
|
-
let c =
|
|
432
|
+
let c = _(() => {
|
|
432
433
|
r.current?.toggle().catch((e) => {
|
|
433
434
|
console.warn("picture in picture was refused", e);
|
|
434
435
|
});
|
|
@@ -438,20 +439,20 @@ var q = {
|
|
|
438
439
|
mode: s,
|
|
439
440
|
burnedIn: i
|
|
440
441
|
};
|
|
441
|
-
},
|
|
442
|
-
let t =
|
|
442
|
+
}, Te = "(hover: hover) and (pointer: fine)", Ee = () => typeof matchMedia == "function" ? matchMedia(Te) : void 0, De = (e) => {
|
|
443
|
+
let t = Ee();
|
|
443
444
|
return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
|
|
444
|
-
},
|
|
445
|
-
let [n, r] =
|
|
445
|
+
}, Oe = () => !!Ee()?.matches, ke = () => !1, Ae = (e, t) => {
|
|
446
|
+
let [n, r] = S(!1), [i, a] = S(), o = x(t);
|
|
446
447
|
t && (o.current = t);
|
|
447
|
-
let s =
|
|
448
|
+
let s = x(!1), c = _((e) => {
|
|
448
449
|
s.current !== e && (s.current = e, o.current?.onArmedChange(e));
|
|
449
|
-
}, []), l =
|
|
450
|
+
}, []), l = _((t) => {
|
|
450
451
|
!e || e.readyState < 1 || e.error || (a(t), c(!0));
|
|
451
|
-
}, [e, c]), u =
|
|
452
|
+
}, [e, c]), u = _(() => {
|
|
452
453
|
a(void 0), c(!1);
|
|
453
454
|
}, [c]), d = !!t && !!e;
|
|
454
|
-
|
|
455
|
+
y(() => {
|
|
455
456
|
if (!d || !e) return;
|
|
456
457
|
let t = () => {
|
|
457
458
|
r(!0), u();
|
|
@@ -464,13 +465,13 @@ var q = {
|
|
|
464
465
|
d,
|
|
465
466
|
u
|
|
466
467
|
]);
|
|
467
|
-
let f =
|
|
468
|
-
|
|
468
|
+
let f = C(De, Oe, ke), [p, m] = S(!1);
|
|
469
|
+
y(() => {
|
|
469
470
|
if (!d) return;
|
|
470
471
|
let e = (e) => {
|
|
471
|
-
e.pointerType === "touch" &&
|
|
472
|
+
e.pointerType === "touch" && m(!0);
|
|
472
473
|
}, t = (e) => {
|
|
473
|
-
e.pointerType !== "touch" &&
|
|
474
|
+
e.pointerType !== "touch" && m(!1);
|
|
474
475
|
};
|
|
475
476
|
return window.addEventListener("pointerdown", e, {
|
|
476
477
|
capture: !0,
|
|
@@ -482,39 +483,39 @@ var q = {
|
|
|
482
483
|
window.removeEventListener("pointerdown", e, { capture: !0 }), window.removeEventListener("pointermove", t, { capture: !0 });
|
|
483
484
|
};
|
|
484
485
|
}, [d]);
|
|
485
|
-
let
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}, [
|
|
489
|
-
let
|
|
486
|
+
let h = d && f && !p;
|
|
487
|
+
y(() => {
|
|
488
|
+
h || u();
|
|
489
|
+
}, [h, u]);
|
|
490
|
+
let g = _(() => {
|
|
490
491
|
Promise.resolve(e?.exitPictureInPicture?.()).catch((e) => {
|
|
491
492
|
console.warn("leaving picture in picture was refused", e);
|
|
492
493
|
});
|
|
493
494
|
}, [e]);
|
|
494
|
-
return
|
|
495
|
+
return b(() => h ? {
|
|
495
496
|
active: n,
|
|
496
497
|
armed: i,
|
|
497
498
|
arm: l,
|
|
498
499
|
disarm: u,
|
|
499
|
-
exit:
|
|
500
|
+
exit: g
|
|
500
501
|
} : null, [
|
|
501
|
-
|
|
502
|
+
h,
|
|
502
503
|
n,
|
|
503
504
|
i,
|
|
504
505
|
l,
|
|
505
506
|
u,
|
|
506
|
-
|
|
507
|
+
g
|
|
507
508
|
]);
|
|
508
|
-
},
|
|
509
|
+
}, je = async (e, t, n = {}) => (await e.audioWorklet.addModule(t), new AudioWorkletNode(e, "banou-volume-normalizer", {
|
|
509
510
|
channelCountMode: "max",
|
|
510
511
|
processorOptions: n
|
|
511
|
-
})),
|
|
512
|
+
})), Me = /* @__PURE__ */ new WeakMap(), Ne = (e) => new Promise((t, n) => {
|
|
512
513
|
let r = () => {
|
|
513
514
|
(e.state === "running" || e.state === "closed") && (e.removeEventListener("statechange", r), e.state === "running" ? t() : n(new DOMException("The AudioContext closed before it ran", "InvalidStateError")));
|
|
514
515
|
};
|
|
515
516
|
e.addEventListener("statechange", r), r();
|
|
516
|
-
}),
|
|
517
|
-
let r =
|
|
517
|
+
}), Pe = (e, t, n = {}) => {
|
|
518
|
+
let r = Me.get(e);
|
|
518
519
|
if (r) return r.wake(), r;
|
|
519
520
|
let i = new AudioContext(), a = n.enabled !== !1, o, s = !1, c = () => 20 * Math.log10(Math.max(e.volume, 1e-6)), l = e.ownerDocument, u = () => {
|
|
520
521
|
i.state === "suspended" && i.resume().catch(() => {});
|
|
@@ -530,13 +531,13 @@ var q = {
|
|
|
530
531
|
};
|
|
531
532
|
i.addEventListener("statechange", f), f();
|
|
532
533
|
let p = (async () => {
|
|
533
|
-
let r = await
|
|
534
|
+
let r = await je(i, t, {
|
|
534
535
|
...n,
|
|
535
536
|
enabled: a,
|
|
536
537
|
inputGainDb: c()
|
|
537
538
|
});
|
|
538
|
-
await
|
|
539
|
-
let s =
|
|
539
|
+
await Ne(i);
|
|
540
|
+
let s = M(i, e);
|
|
540
541
|
return r.port.postMessage({
|
|
541
542
|
enabled: a,
|
|
542
543
|
inputGainDb: c()
|
|
@@ -552,14 +553,14 @@ var q = {
|
|
|
552
553
|
a = e, o?.port.postMessage({ enabled: a });
|
|
553
554
|
},
|
|
554
555
|
release: () => {
|
|
555
|
-
s = !0, d(!1), e.isConnected ? i.state === "running" && i.suspend().catch(() => {}) : (
|
|
556
|
+
s = !0, d(!1), e.isConnected ? i.state === "running" && i.suspend().catch(() => {}) : (Me.delete(e), i.close().catch(() => {}));
|
|
556
557
|
},
|
|
557
558
|
wake: () => {
|
|
558
559
|
i.state !== "closed" && (s = !1, u(), f());
|
|
559
560
|
}
|
|
560
561
|
};
|
|
561
|
-
return
|
|
562
|
-
},
|
|
562
|
+
return Me.set(e, m), m;
|
|
563
|
+
}, Fe = 20, Ie = 5, Le = 1, Re = 50, ze = ({ node: t, element: n, scriptUrl: r, source: i }) => {
|
|
563
564
|
let a = !1, o, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = () => {
|
|
564
565
|
for (let e of [...c]) e();
|
|
565
566
|
c.clear();
|
|
@@ -606,7 +607,7 @@ var q = {
|
|
|
606
607
|
}), S = () => p.postMessage({
|
|
607
608
|
type: "playhead",
|
|
608
609
|
time: n.currentTime
|
|
609
|
-
}), C = setInterval(x,
|
|
610
|
+
}), C = setInterval(x, Re), w = [
|
|
610
611
|
"play",
|
|
611
612
|
"playing",
|
|
612
613
|
"pause",
|
|
@@ -617,43 +618,43 @@ var q = {
|
|
|
617
618
|
"ended"
|
|
618
619
|
];
|
|
619
620
|
for (let e of w) n.addEventListener(e, x);
|
|
620
|
-
let T = Infinity,
|
|
621
|
+
let T = Infinity, E = !1, D = 0, O = !1, k = 0, A = 0, M = /* @__PURE__ */ new Map(), N = (e) => {
|
|
621
622
|
let t = e;
|
|
622
623
|
for (let [e, n] of h.spans) e <= t && t < n && (t = n);
|
|
623
624
|
return t >= (h.end ?? T) - .05 ? null : t;
|
|
624
625
|
}, P = (e) => M.get(Math.round(e * 10)) === g ? "idle" : e, F = () => {
|
|
625
|
-
let e = n.currentTime, t = N(e), r =
|
|
626
|
-
if (t !== null && t < e +
|
|
626
|
+
let e = n.currentTime, t = N(e), r = O && y !== D;
|
|
627
|
+
if (t !== null && t < e + Fe) return r && k <= t + 1 && t <= A + Ie ? "read" : P(t);
|
|
627
628
|
if (r) return "read";
|
|
628
629
|
let i = t ?? N(0);
|
|
629
630
|
return i === null ? "done" : P(i);
|
|
630
631
|
}, I = () => {}, L = (e) => (e.catch(() => {}), Promise.race([e, new Promise((e) => {
|
|
631
632
|
I = () => e(void 0);
|
|
632
633
|
})])), R = () => {
|
|
633
|
-
S(),
|
|
634
|
+
S(), E && s.size && typeof F() == "number" && I(), l();
|
|
634
635
|
}, z = () => {
|
|
635
636
|
S(), l();
|
|
636
637
|
};
|
|
637
638
|
n.addEventListener("seeking", R), n.addEventListener("seeked", z), n.addEventListener("timeupdate", z);
|
|
638
639
|
let B, V = async (e) => {
|
|
639
|
-
if (!
|
|
640
|
-
|
|
641
|
-
let t = v("ended",
|
|
640
|
+
if (!O) return;
|
|
641
|
+
O = !1;
|
|
642
|
+
let t = v("ended", D);
|
|
642
643
|
p.postMessage({
|
|
643
644
|
type: "end",
|
|
644
|
-
run:
|
|
645
|
+
run: D,
|
|
645
646
|
finished: e
|
|
646
647
|
}), await t;
|
|
647
648
|
}, H = async (e) => {
|
|
648
|
-
if (
|
|
649
|
-
let t = v("ack",
|
|
649
|
+
if (A = e.pts + e.duration, !e.data.byteLength) return;
|
|
650
|
+
let t = v("ack", D);
|
|
650
651
|
p.postMessage({
|
|
651
652
|
type: "fragment",
|
|
652
|
-
run:
|
|
653
|
+
run: D,
|
|
653
654
|
data: e.data
|
|
654
655
|
}, [e.data]), await t;
|
|
655
656
|
}, U = async (t) => {
|
|
656
|
-
if (B = await
|
|
657
|
+
if (B = await j({
|
|
657
658
|
publicPath: t.publicPath,
|
|
658
659
|
workerUrl: t.libavWorkerUrl,
|
|
659
660
|
workerOptions: { type: "module" },
|
|
@@ -667,9 +668,9 @@ var q = {
|
|
|
667
668
|
type: "init",
|
|
668
669
|
data: n.data,
|
|
669
670
|
codec: n.info.output.audioMimeType
|
|
670
|
-
}, [n.data]),
|
|
671
|
+
}, [n.data]), O = !0, E = !0, p.postMessage({
|
|
671
672
|
type: "run",
|
|
672
|
-
run:
|
|
673
|
+
run: D,
|
|
673
674
|
pts: 0,
|
|
674
675
|
start: !0
|
|
675
676
|
}); !a;) {
|
|
@@ -687,14 +688,14 @@ var q = {
|
|
|
687
688
|
await H(e), e.finished && await V(!0);
|
|
688
689
|
} else {
|
|
689
690
|
await V(!1), M.set(Math.round(e * 10), g);
|
|
690
|
-
let t = B.seek(Math.max(0, e -
|
|
691
|
+
let t = B.seek(Math.max(0, e - Le));
|
|
691
692
|
f(!0);
|
|
692
693
|
let n = await L(t);
|
|
693
694
|
if (a) return;
|
|
694
695
|
if (!n) continue;
|
|
695
|
-
|
|
696
|
+
D++, O = !0, k = n.pts, p.postMessage({
|
|
696
697
|
type: "run",
|
|
697
|
-
run:
|
|
698
|
+
run: D,
|
|
698
699
|
pts: n.pts,
|
|
699
700
|
start: n.pts <= 0
|
|
700
701
|
}), await H(n), n.finished && await V(!0);
|
|
@@ -710,7 +711,7 @@ var q = {
|
|
|
710
711
|
let n = !1, r = (e) => {
|
|
711
712
|
n && p.postMessage({
|
|
712
713
|
type: "end",
|
|
713
|
-
run:
|
|
714
|
+
run: D,
|
|
714
715
|
finished: e
|
|
715
716
|
}), n = !1;
|
|
716
717
|
};
|
|
@@ -725,7 +726,7 @@ var q = {
|
|
|
725
726
|
}, [t]);
|
|
726
727
|
} else if (e.type === "run") r(!1), n = !0, p.postMessage({
|
|
727
728
|
type: "run",
|
|
728
|
-
run: ++
|
|
729
|
+
run: ++D,
|
|
729
730
|
pts: e.pts,
|
|
730
731
|
start: !t && e.pts <= 0,
|
|
731
732
|
join: t
|
|
@@ -735,7 +736,7 @@ var q = {
|
|
|
735
736
|
let t = e.data.slice(0);
|
|
736
737
|
p.postMessage({
|
|
737
738
|
type: "fragment",
|
|
738
|
-
run:
|
|
739
|
+
run: D,
|
|
739
740
|
data: t
|
|
740
741
|
}, [t]);
|
|
741
742
|
}
|
|
@@ -757,12 +758,12 @@ var q = {
|
|
|
757
758
|
},
|
|
758
759
|
stop: G
|
|
759
760
|
};
|
|
760
|
-
},
|
|
761
|
-
let a =
|
|
762
|
-
|
|
761
|
+
}, Be = (e, t, n, r, i) => {
|
|
762
|
+
let a = x(null), [o, s] = S(!1), [c, l] = S(null);
|
|
763
|
+
y(() => {
|
|
763
764
|
if (e && t) {
|
|
764
765
|
if (n && !a.current) {
|
|
765
|
-
let r =
|
|
766
|
+
let r = Pe(e, t, { enabled: n });
|
|
766
767
|
a.current = r, r.routed.then((e) => {
|
|
767
768
|
a.current === r && l(e);
|
|
768
769
|
}, (e) => {
|
|
@@ -775,18 +776,18 @@ var q = {
|
|
|
775
776
|
e,
|
|
776
777
|
t,
|
|
777
778
|
n
|
|
778
|
-
]),
|
|
779
|
+
]), y(() => () => {
|
|
779
780
|
a.current?.release(), a.current = null, l(null);
|
|
780
781
|
}, [e]);
|
|
781
|
-
let u =
|
|
782
|
+
let u = x(i);
|
|
782
783
|
u.current = i;
|
|
783
|
-
let d =
|
|
784
|
+
let d = x(null), f = x(r);
|
|
784
785
|
f.current = r;
|
|
785
|
-
let { length: p, publicPath:
|
|
786
|
-
return
|
|
786
|
+
let { length: p, publicPath: m, libavWorkerUrl: h } = r && "read" in r ? r : {}, g = r && "tap" in r ? r.tap : void 0, _ = r?.audioStreamIndex;
|
|
787
|
+
return y(() => {
|
|
787
788
|
let r = f.current;
|
|
788
789
|
if (!c || !e || !t || !n || !r) return;
|
|
789
|
-
let i =
|
|
790
|
+
let i = ze({
|
|
790
791
|
node: c,
|
|
791
792
|
element: e,
|
|
792
793
|
scriptUrl: t,
|
|
@@ -801,14 +802,14 @@ var q = {
|
|
|
801
802
|
t,
|
|
802
803
|
n,
|
|
803
804
|
p,
|
|
805
|
+
m,
|
|
804
806
|
h,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
]), m(() => {
|
|
807
|
+
_,
|
|
808
|
+
g
|
|
809
|
+
]), y(() => {
|
|
809
810
|
d.current?.update(i);
|
|
810
811
|
}, [i]), { refused: o };
|
|
811
|
-
},
|
|
812
|
+
}, Ve = () => {
|
|
812
813
|
let e, t, n, r = () => n && e?.audioStreamIndex === n.audioStreamIndex ? n : void 0;
|
|
813
814
|
return {
|
|
814
815
|
push: (n) => {
|
|
@@ -857,7 +858,7 @@ var q = {
|
|
|
857
858
|
medium: "\n font-weight: 500;\n font-size: calc(0.8 * var(--mp-unit));\n line-height: calc(1.1 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(1 * var(--mp-unit));\n line-height: calc(1.4 * var(--mp-unit));\n }\n ",
|
|
858
859
|
regular: "\n font-weight: 400;\n font-size: calc(0.8 * var(--mp-unit));\n line-height: calc(1.1 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(1 * var(--mp-unit));\n line-height: calc(1.4 * var(--mp-unit));\n }\n "
|
|
859
860
|
}
|
|
860
|
-
},
|
|
861
|
+
}, He = w`
|
|
861
862
|
display: flex;
|
|
862
863
|
justify-content: center;
|
|
863
864
|
align-items: center;
|
|
@@ -870,7 +871,7 @@ var q = {
|
|
|
870
871
|
margin: auto;
|
|
871
872
|
pointer-events: none;
|
|
872
873
|
}
|
|
873
|
-
`,
|
|
874
|
+
`, Ue = w`
|
|
874
875
|
position: absolute;
|
|
875
876
|
top: 0;
|
|
876
877
|
left: 0;
|
|
@@ -899,9 +900,9 @@ var q = {
|
|
|
899
900
|
|
|
900
901
|
background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.3) 30%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.1) 80%, transparent 100%);
|
|
901
902
|
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
902
|
-
`,
|
|
903
|
+
`, We = T`
|
|
903
904
|
to { transform: rotate(360deg); }
|
|
904
|
-
`,
|
|
905
|
+
`, Ge = w`
|
|
905
906
|
position: absolute;
|
|
906
907
|
inset: 0;
|
|
907
908
|
z-index: 2;
|
|
@@ -917,9 +918,9 @@ var q = {
|
|
|
917
918
|
border-radius: 50%;
|
|
918
919
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
919
920
|
border-top-color: #fff;
|
|
920
|
-
animation: ${
|
|
921
|
+
animation: ${We} 0.8s linear infinite;
|
|
921
922
|
}
|
|
922
|
-
`,
|
|
923
|
+
`, Ke = w`
|
|
923
924
|
position: absolute;
|
|
924
925
|
inset: auto 0 20%;
|
|
925
926
|
z-index: 3;
|
|
@@ -929,34 +930,34 @@ var q = {
|
|
|
929
930
|
${Q.bLarge.regular}
|
|
930
931
|
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
931
932
|
pointer-events: none;
|
|
932
|
-
`,
|
|
933
|
+
`, qe = (e) => e instanceof Error ? e.message : typeof e == "string" ? e : "Playback failed", Je = ({ onSubtitleRef: e }) => {
|
|
933
934
|
let t = Y((e) => e.title), n = Y((e) => e.hideUI), r = Y((e) => e.playbackError), i = Y((e) => e.ready), a = Y((e) => e.size), o = Y((e) => e.waiting), s = Y((e) => e.seekingTo);
|
|
934
|
-
return /* @__PURE__ */
|
|
935
|
-
t ? /* @__PURE__ */
|
|
935
|
+
return /* @__PURE__ */ F(N, { children: [
|
|
936
|
+
t ? /* @__PURE__ */ P("div", {
|
|
936
937
|
className: "title",
|
|
937
|
-
css:
|
|
938
|
+
css: Ue,
|
|
938
939
|
style: { ...n ? {
|
|
939
940
|
opacity: "0",
|
|
940
941
|
pointerEvents: "none"
|
|
941
942
|
} : {} },
|
|
942
943
|
children: t
|
|
943
944
|
}) : void 0,
|
|
944
|
-
((a ? !i : o) || s !== void 0) && !r ? /* @__PURE__ */
|
|
945
|
-
r ? /* @__PURE__ */
|
|
946
|
-
css:
|
|
947
|
-
children:
|
|
945
|
+
((a ? !i : o) || s !== void 0) && !r ? /* @__PURE__ */ P("div", { css: Ge }) : void 0,
|
|
946
|
+
r ? /* @__PURE__ */ P("div", {
|
|
947
|
+
css: Ke,
|
|
948
|
+
children: qe(r)
|
|
948
949
|
}) : void 0,
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ P("div", {
|
|
950
951
|
className: "subtitles",
|
|
951
952
|
ref: e,
|
|
952
|
-
css:
|
|
953
|
+
css: He
|
|
953
954
|
})
|
|
954
955
|
] });
|
|
955
|
-
},
|
|
956
|
+
}, Ye = 1e-4, Xe = 1, Ze = (e) => Math.max(Ye, Math.min(Xe, e)) ** 2, Qe = (e) => Math.max(Ye, Math.min(Xe, e)) ** (Xe / 2), $e = (e) => {
|
|
956
957
|
if (e === void 0) return "0:00";
|
|
957
958
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
|
|
958
959
|
return t > 0 ? `${t}:${n < 10 ? "0" : ""}${n}:${r < 10 ? "0" : ""}${r}` : `${n}:${r < 10 ? "0" : ""}${r}`;
|
|
959
|
-
},
|
|
960
|
+
}, et = (e, t) => `${$e(e)} / ${$e(t)}`, tt = (e) => w`
|
|
960
961
|
display: flex;
|
|
961
962
|
justify-content: flex-start;
|
|
962
963
|
|
|
@@ -991,41 +992,42 @@ var q = {
|
|
|
991
992
|
${Q.bMedium.regular}
|
|
992
993
|
}
|
|
993
994
|
|
|
994
|
-
${e === "sm" &&
|
|
995
|
+
${e === "sm" && w`
|
|
995
996
|
padding: calc(0.4 * var(--mp-unit))!important;
|
|
996
997
|
`}
|
|
997
|
-
${e === "md" &&
|
|
998
|
+
${e === "md" && w`
|
|
998
999
|
padding: calc(0.6 * var(--mp-unit))!important;
|
|
999
1000
|
`}
|
|
1000
|
-
${e === "lg" &&
|
|
1001
|
+
${e === "lg" && w`
|
|
1001
1002
|
padding: calc(1.2 * var(--mp-unit))!important;
|
|
1002
1003
|
`}
|
|
1003
|
-
`,
|
|
1004
|
+
`, nt = {
|
|
1004
1005
|
x: -1,
|
|
1005
1006
|
y: -1,
|
|
1006
1007
|
anchors: 0
|
|
1007
|
-
},
|
|
1008
|
-
|
|
1009
|
-
},
|
|
1008
|
+
}, rt = (e) => {
|
|
1009
|
+
nt.x = e.clientX, nt.y = e.clientY;
|
|
1010
|
+
}, it = () => (nt.anchors++ === 0 && window.addEventListener("pointermove", rt, {
|
|
1010
1011
|
capture: !0,
|
|
1011
1012
|
passive: !0
|
|
1012
1013
|
}), () => {
|
|
1013
|
-
--
|
|
1014
|
-
}), $ = ({ id: e, toolTipText: t, text: n, delayShow: r = 0, closeDelay: i = 0, offset: a = 20, tooltipPlace: o = "top", disabled: s = !1, size: c = "md" }) => {
|
|
1015
|
-
let l =
|
|
1016
|
-
return
|
|
1017
|
-
let e =
|
|
1014
|
+
--nt.anchors === 0 && window.removeEventListener("pointermove", rt, { capture: !0 });
|
|
1015
|
+
}), at = h(!1), $ = ({ id: e, toolTipText: t, text: n, delayShow: r = 0, closeDelay: i = 0, offset: a = 20, tooltipPlace: o = "top", disabled: s = !1, size: c = "md" }) => {
|
|
1016
|
+
let l = x(null), u = x(null), d = v(at);
|
|
1017
|
+
return y(() => {
|
|
1018
|
+
let e = it(), t = () => {
|
|
1018
1019
|
let e = l.current;
|
|
1019
1020
|
if (!e) return;
|
|
1020
1021
|
let { left: t, right: n, top: r, bottom: i } = e.getBoundingClientRect();
|
|
1021
|
-
|
|
1022
|
+
nt.x >= t && nt.x < n && nt.y >= r && nt.y < i || u.current?.close();
|
|
1022
1023
|
}, n = ["fullscreenchange", "webkitfullscreenchange"];
|
|
1023
1024
|
for (let e of n) document.addEventListener(e, t);
|
|
1024
|
-
return () => {
|
|
1025
|
+
return d && window.addEventListener("resize", t), () => {
|
|
1025
1026
|
e();
|
|
1026
1027
|
for (let e of n) document.removeEventListener(e, t);
|
|
1028
|
+
window.removeEventListener("resize", t);
|
|
1027
1029
|
};
|
|
1028
|
-
}, []), /* @__PURE__ */
|
|
1030
|
+
}, [d]), /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
|
|
1029
1031
|
ref: l,
|
|
1030
1032
|
"data-tooltip-id": e,
|
|
1031
1033
|
"data-open": !0,
|
|
@@ -1034,22 +1036,22 @@ var q = {
|
|
|
1034
1036
|
"data-tooltip-delay-hide": i,
|
|
1035
1037
|
"data-tooltip-place": o,
|
|
1036
1038
|
children: n
|
|
1037
|
-
}), !s && /* @__PURE__ */
|
|
1039
|
+
}), !s && /* @__PURE__ */ P(re, {
|
|
1038
1040
|
ref: u,
|
|
1039
|
-
css:
|
|
1041
|
+
css: tt(c),
|
|
1040
1042
|
id: e,
|
|
1041
1043
|
noArrow: !0,
|
|
1042
1044
|
children: t
|
|
1043
1045
|
})] });
|
|
1044
|
-
},
|
|
1045
|
-
let [i, a] =
|
|
1046
|
+
}, ot = ({ ref: e, onChange: t, orientation: n = "horizontal", disabled: r = !1 }) => {
|
|
1047
|
+
let [i, a] = S(!1), o = x(t);
|
|
1046
1048
|
o.current = t;
|
|
1047
|
-
let s =
|
|
1049
|
+
let s = x(null), c = _((t, r) => {
|
|
1048
1050
|
let i = e.current;
|
|
1049
1051
|
if (!i) return 0;
|
|
1050
1052
|
let { left: a, right: o, top: s, bottom: c } = i.getBoundingClientRect(), l = n === "horizontal" ? (t - a) / (o - a) : (c - r) / (c - s);
|
|
1051
1053
|
return Math.min(Math.max(l, 0), 1);
|
|
1052
|
-
}, [e, n]), l =
|
|
1054
|
+
}, [e, n]), l = _((e) => {
|
|
1053
1055
|
if (!(r || e.button > 0)) {
|
|
1054
1056
|
s.current = e.pointerId;
|
|
1055
1057
|
try {
|
|
@@ -1057,9 +1059,9 @@ var q = {
|
|
|
1057
1059
|
} catch {}
|
|
1058
1060
|
a(!0), o.current(c(e.clientX, e.clientY));
|
|
1059
1061
|
}
|
|
1060
|
-
}, [r, c]), u =
|
|
1062
|
+
}, [r, c]), u = _((e) => {
|
|
1061
1063
|
s.current === e.pointerId && o.current(c(e.clientX, e.clientY));
|
|
1062
|
-
}, [c]), d =
|
|
1064
|
+
}, [c]), d = _((e) => {
|
|
1063
1065
|
if (s.current === e.pointerId) {
|
|
1064
1066
|
s.current = null;
|
|
1065
1067
|
try {
|
|
@@ -1068,7 +1070,7 @@ var q = {
|
|
|
1068
1070
|
a(!1);
|
|
1069
1071
|
}
|
|
1070
1072
|
}, []);
|
|
1071
|
-
return
|
|
1073
|
+
return y(() => {
|
|
1072
1074
|
r && (s.current = null, a(!1));
|
|
1073
1075
|
}, [r]), {
|
|
1074
1076
|
dragging: i,
|
|
@@ -1080,118 +1082,7 @@ var q = {
|
|
|
1080
1082
|
style: { touchAction: "none" }
|
|
1081
1083
|
}
|
|
1082
1084
|
};
|
|
1083
|
-
},
|
|
1084
|
-
if (!t) return [];
|
|
1085
|
-
let n = /* @__PURE__ */ new Set();
|
|
1086
|
-
for (let { start: r, end: i } of e) for (let e of [r, i]) {
|
|
1087
|
-
let r = e / t;
|
|
1088
|
-
r <= nt || r >= .995 || n.add(Number((r * 100).toFixed(4)));
|
|
1089
|
-
}
|
|
1090
|
-
return n.size ? [
|
|
1091
|
-
0,
|
|
1092
|
-
...[...n].sort((e, t) => e - t),
|
|
1093
|
-
100
|
|
1094
|
-
] : [];
|
|
1095
|
-
}, ot = (e, t) => {
|
|
1096
|
-
let n = tt / 2, r = e.length - 2, i = [];
|
|
1097
|
-
for (let a = 0; a <= r; a += 1) {
|
|
1098
|
-
let o = e[a], s = e[a + 1], c = a === 0 ? "0%" : `calc(${o}% + ${n}px)`, l = a === r ? "100%" : `calc(${s}% - ${n}px)`;
|
|
1099
|
-
i.push(`${t(a) ? rt : it} ${c} ${l}`), a !== r && i.push(`${it} calc(${s}% - ${n}px) calc(${s}% + ${n}px)`);
|
|
1100
|
-
}
|
|
1101
|
-
return `linear-gradient(90deg, ${i.join(", ")})`;
|
|
1102
|
-
}, st = /* @__PURE__ */ new Set([
|
|
1103
|
-
"op",
|
|
1104
|
-
"ops",
|
|
1105
|
-
"opening",
|
|
1106
|
-
"openings",
|
|
1107
|
-
"ncop",
|
|
1108
|
-
"オープニング",
|
|
1109
|
-
"op主題歌"
|
|
1110
|
-
]), ct = /* @__PURE__ */ new Set([
|
|
1111
|
-
"ed",
|
|
1112
|
-
"eds",
|
|
1113
|
-
"ending",
|
|
1114
|
-
"endings",
|
|
1115
|
-
"nced",
|
|
1116
|
-
"credits",
|
|
1117
|
-
"endcard",
|
|
1118
|
-
"endroll",
|
|
1119
|
-
"エンディング",
|
|
1120
|
-
"エンドカード",
|
|
1121
|
-
"エンドロール",
|
|
1122
|
-
"ed主題歌"
|
|
1123
|
-
]), lt = /* @__PURE__ */ new Set(["intro", "イントロ"]), ut = /* @__PURE__ */ new Set(["outro", "アウトロ"]), dt = {
|
|
1124
|
-
"credits start": "ending",
|
|
1125
|
-
"credits end": null,
|
|
1126
|
-
"preview end": null,
|
|
1127
|
-
"end credits": "ending",
|
|
1128
|
-
"closing credits": "ending"
|
|
1129
|
-
}, ft = /* @__PURE__ */ new Set([
|
|
1130
|
-
"theme",
|
|
1131
|
-
"themes",
|
|
1132
|
-
"song",
|
|
1133
|
-
"sequence",
|
|
1134
|
-
"nc",
|
|
1135
|
-
"non",
|
|
1136
|
-
"credit",
|
|
1137
|
-
"creditless",
|
|
1138
|
-
"textless",
|
|
1139
|
-
"clean",
|
|
1140
|
-
"tv",
|
|
1141
|
-
"size",
|
|
1142
|
-
"version",
|
|
1143
|
-
"ver",
|
|
1144
|
-
"full",
|
|
1145
|
-
"the",
|
|
1146
|
-
"主題歌",
|
|
1147
|
-
"ノンクレジット"
|
|
1148
|
-
]), pt = /* @__PURE__ */ new Set([
|
|
1149
|
-
"post",
|
|
1150
|
-
"pre",
|
|
1151
|
-
"after",
|
|
1152
|
-
"before",
|
|
1153
|
-
"non"
|
|
1154
|
-
]), mt = /[-:|~/\\[\]()「」『』【】,.!?"'’]|\s+by\s+/u, ht = (e) => !e.trim() || /^chapter\s*\d+$/i.test(e.trim()) || /^\d{1,2}:\d{2}:\d{2}([.,]\d+)?$/.test(e.trim()), gt = (e) => e.replace(/([a-z-ヿ一-鿿])\s*\d+\s*$/u, "$1").split(/[\s_]+/u).map((e) => e.replace(/^[^\w-ヿ一-鿿]+|[^\w-ヿ一-鿿]+$/gu, "")).filter((e) => e && !/^\d+$/.test(e) && !ft.has(e)), _t = (e, t) => {
|
|
1155
|
-
if (st.has(e)) return "opening";
|
|
1156
|
-
if (ct.has(e)) return "ending";
|
|
1157
|
-
if (t) {
|
|
1158
|
-
if (lt.has(e)) return "opening";
|
|
1159
|
-
if (ut.has(e)) return "ending";
|
|
1160
|
-
}
|
|
1161
|
-
}, vt = (e, t) => {
|
|
1162
|
-
if (ht(e)) return;
|
|
1163
|
-
let n = e.trim().toLowerCase().replace(/\s+/gu, " ");
|
|
1164
|
-
if (n in dt) return dt[n] ?? void 0;
|
|
1165
|
-
let r = n.split(mt).map((e) => e.trim()).filter(Boolean);
|
|
1166
|
-
if (r.some((e) => e.split(/[\s_]+/u).some((e) => pt.has(e)))) return;
|
|
1167
|
-
let i = r.length > 1 ? [r[0], r.at(-1)] : r;
|
|
1168
|
-
for (let e of i) {
|
|
1169
|
-
let n = gt(e);
|
|
1170
|
-
if (n.length !== 1) continue;
|
|
1171
|
-
let r = _t(n[0], t);
|
|
1172
|
-
if (r) return r;
|
|
1173
|
-
}
|
|
1174
|
-
}, yt = 15, bt = 87, xt = 93, St = (e) => {
|
|
1175
|
-
let t = e.map(() => void 0), n = e.at(-1)?.end ?? 0;
|
|
1176
|
-
if (!n) return t;
|
|
1177
|
-
let r = e.map((e, t) => ({
|
|
1178
|
-
index: t,
|
|
1179
|
-
start: e.start,
|
|
1180
|
-
length: e.end - e.start
|
|
1181
|
-
})).filter(({ length: e }) => e >= bt && e <= xt), i = n / 2, a = r.filter(({ start: e }) => e < i), o = r.filter(({ start: e }) => e >= i);
|
|
1182
|
-
return a.length === 1 && (t[a[0].index] = "opening"), o.length === 1 && (t[o[0].index] = "ending"), t;
|
|
1183
|
-
}, Ct = (e) => {
|
|
1184
|
-
let t = e.map(({ title: e }) => vt(e, !1)), n = e.reduce((e, n, r) => e + (t[r] ? n.end - n.start : 0), 0), r = e.reduce((e, t) => e + (t.end - t.start), 0);
|
|
1185
|
-
if (r > 0 && n * 2 > r) return e.map(() => void 0);
|
|
1186
|
-
let i = e.map((e, n) => {
|
|
1187
|
-
if (e.end - e.start < yt) return;
|
|
1188
|
-
let r = t[n];
|
|
1189
|
-
if (r) return r;
|
|
1190
|
-
let i = vt(e.title, !0);
|
|
1191
|
-
return i && !t.includes(i) ? i : void 0;
|
|
1192
|
-
});
|
|
1193
|
-
return e.every(({ title: e }) => ht(e)) ? St(e) : i;
|
|
1194
|
-
}, wt = y`
|
|
1085
|
+
}, st = w`
|
|
1195
1086
|
position: relative;
|
|
1196
1087
|
height: calc(.4 * var(--mp-unit));
|
|
1197
1088
|
|
|
@@ -1410,58 +1301,58 @@ var q = {
|
|
|
1410
1301
|
--thumbnail-width: calc(18 * var(--mp-unit));
|
|
1411
1302
|
--thumbnail-half: calc(9 * var(--mp-unit));
|
|
1412
1303
|
}
|
|
1413
|
-
`,
|
|
1414
|
-
let e = Y(), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.duration), i = Y((e) => e.size), a = Y((e) => e.downloadedRanges), o = Y((e) => e.buffered), s = Y((e) => e.indexes), c = Y((e) => e.thumbnails), l = Y((e) => e.thumbnailAt),
|
|
1415
|
-
|
|
1416
|
-
},
|
|
1417
|
-
|
|
1418
|
-
if (
|
|
1419
|
-
}, [
|
|
1420
|
-
|
|
1421
|
-
}, [
|
|
1422
|
-
let
|
|
1423
|
-
ref:
|
|
1304
|
+
`, ct = 4, lt = () => {
|
|
1305
|
+
let e = Y(), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.duration), i = Y((e) => e.size), a = Y((e) => e.downloadedRanges), o = Y((e) => e.buffered), s = Y((e) => e.indexes), c = Y((e) => e.thumbnails), l = Y((e) => e.thumbnailAt), f = Y((e) => e.requestThumbnail), p = Y((e) => e.chapters), m = Y((e) => e.seekingTo), h = Y((e) => e.setSourceState), g = Y((e) => e.hideUI), _ = x(null), [v, C] = S(void 0), [w, T] = S(void 0), E = (e) => {
|
|
1306
|
+
T(e), f(e);
|
|
1307
|
+
}, D = !!w;
|
|
1308
|
+
y(() => {
|
|
1309
|
+
if (D) return h({ seekPreview: !0 }), () => h({ seekPreview: !1 });
|
|
1310
|
+
}, [h, D]), y(() => {
|
|
1311
|
+
g && E(void 0);
|
|
1312
|
+
}, [g]);
|
|
1313
|
+
let O = x(void 0), k = x(0), A = x(void 0), j = x(void 0), M = x(!1), { dragging: N, handlers: I } = ot({
|
|
1314
|
+
ref: _,
|
|
1424
1315
|
onChange: (e) => {
|
|
1425
|
-
if (
|
|
1316
|
+
if (k.current += 1, A.current = e, j.current === void 0) j.current = e;
|
|
1426
1317
|
else if (!M.current) {
|
|
1427
|
-
let t =
|
|
1428
|
-
Math.abs(e - j.current) * t >
|
|
1318
|
+
let t = _.current?.getBoundingClientRect().width ?? 0;
|
|
1319
|
+
Math.abs(e - j.current) * t > ct && (M.current = !0);
|
|
1429
1320
|
}
|
|
1430
|
-
|
|
1321
|
+
C(e), O.current !== "mouse" && E(e * r);
|
|
1431
1322
|
}
|
|
1432
|
-
}),
|
|
1433
|
-
|
|
1434
|
-
},
|
|
1435
|
-
|
|
1436
|
-
let i =
|
|
1323
|
+
}), L = (e) => {
|
|
1324
|
+
O.current = e.pointerType, k.current = 0, j.current = void 0, M.current = !1, I.onPointerDown(e);
|
|
1325
|
+
}, R = (t) => {
|
|
1326
|
+
I.onPointerUp(t);
|
|
1327
|
+
let i = k.current > 0 ? A.current : void 0;
|
|
1437
1328
|
if (i !== void 0 && r) {
|
|
1438
1329
|
let t = i * r;
|
|
1439
1330
|
n ? n(t) : e.seek(t);
|
|
1440
1331
|
}
|
|
1441
|
-
|
|
1442
|
-
},
|
|
1443
|
-
if (!
|
|
1444
|
-
let { left: t, right: n } =
|
|
1332
|
+
k.current = 0, M.current = !1, j.current = void 0, t.pointerType !== "mouse" && E(void 0);
|
|
1333
|
+
}, z = (e) => {
|
|
1334
|
+
if (!_.current) return;
|
|
1335
|
+
let { left: t, right: n } = _.current.getBoundingClientRect();
|
|
1445
1336
|
return Math.min(Math.max((e - t) / (n - t), 0), 1) * r;
|
|
1446
|
-
},
|
|
1447
|
-
|
|
1448
|
-
},
|
|
1449
|
-
|
|
1450
|
-
},
|
|
1451
|
-
|
|
1452
|
-
},
|
|
1337
|
+
}, B = x("mouse"), V = (e) => {
|
|
1338
|
+
B.current = e.pointerType;
|
|
1339
|
+
}, H = (e) => {
|
|
1340
|
+
B.current !== "touch" && E(z(e.clientX));
|
|
1341
|
+
}, U = () => {
|
|
1342
|
+
_.current && E(void 0);
|
|
1343
|
+
}, W = (e) => r ? e / r * 100 : 0, ee = (e, t, n) => {
|
|
1453
1344
|
let r = Number((n - t).toFixed(4)), i = t * 100;
|
|
1454
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ P("div", {
|
|
1455
1346
|
className: "loaded-part",
|
|
1456
1347
|
style: {
|
|
1457
1348
|
transform: `scaleX(${r})`,
|
|
1458
1349
|
marginLeft: `${i}%`
|
|
1459
1350
|
}
|
|
1460
1351
|
}, e);
|
|
1461
|
-
},
|
|
1352
|
+
}, G = b(() => i === void 0 ? r ? o.map(([e, t], n) => ee(n, e / r, t / r)) : [] : a?.map((e, t) => {
|
|
1462
1353
|
if (!i || !r) return null;
|
|
1463
1354
|
let n = s.filter((t) => e.startByteOffset <= t.pos && t.pos <= e.endByteOffset), a = n.at(0), o = n.at(-1);
|
|
1464
|
-
return !a || !o ? null :
|
|
1355
|
+
return !a || !o ? null : ee(t, a.timestamp / r, o.timestamp / r);
|
|
1465
1356
|
}) ?? [], [
|
|
1466
1357
|
r,
|
|
1467
1358
|
i,
|
|
@@ -1469,114 +1360,114 @@ var q = {
|
|
|
1469
1360
|
s.length,
|
|
1470
1361
|
a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}/${t}`).join(",")
|
|
1471
1362
|
]);
|
|
1472
|
-
|
|
1473
|
-
|
|
1363
|
+
y(() => {
|
|
1364
|
+
v !== void 0 && r && N && M.current && e.seek(v * r);
|
|
1474
1365
|
}, [
|
|
1475
1366
|
e,
|
|
1476
1367
|
N,
|
|
1477
|
-
|
|
1368
|
+
v,
|
|
1478
1369
|
r
|
|
1479
1370
|
]);
|
|
1480
|
-
let
|
|
1371
|
+
let te = b(() => {
|
|
1481
1372
|
if (!r) return 0;
|
|
1482
|
-
if (N &&
|
|
1483
|
-
let e =
|
|
1373
|
+
if (N && v !== void 0) return v;
|
|
1374
|
+
let e = m ?? t;
|
|
1484
1375
|
return typeof e == "number" ? e / r : 0;
|
|
1485
1376
|
}, [
|
|
1486
1377
|
r,
|
|
1487
1378
|
t,
|
|
1488
1379
|
N,
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
]),
|
|
1492
|
-
if (!
|
|
1493
|
-
let e =
|
|
1494
|
-
return t >= 0 ? t :
|
|
1380
|
+
v,
|
|
1381
|
+
m
|
|
1382
|
+
]), K = b(() => u(p, r), [p, r]), q = K.length > 0, J = b(() => {
|
|
1383
|
+
if (!q || w === void 0 || !r) return -1;
|
|
1384
|
+
let e = w / r * 100, t = K.findIndex((t, n) => n < K.length - 1 && e >= t && e < K[n + 1]);
|
|
1385
|
+
return t >= 0 ? t : K.length - 2;
|
|
1495
1386
|
}, [
|
|
1387
|
+
q,
|
|
1496
1388
|
K,
|
|
1497
|
-
|
|
1498
|
-
S,
|
|
1389
|
+
w,
|
|
1499
1390
|
r
|
|
1500
|
-
]),
|
|
1391
|
+
]), ne = b(() => q ? d(K, (e) => e !== J) : void 0, [
|
|
1392
|
+
q,
|
|
1501
1393
|
K,
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
if (
|
|
1509
|
-
if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= S && S < t);
|
|
1394
|
+
J
|
|
1395
|
+
]), re = b(() => J >= 0 ? d(K, (e) => e === J) : void 0, [K, J]), ie = b(() => {
|
|
1396
|
+
if (w !== void 0) return p.find(({ start: e, end: t }) => e <= w && w < t);
|
|
1397
|
+
}, [p, w]), ae = b(() => {
|
|
1398
|
+
if (w) {
|
|
1399
|
+
if (l) return l(w);
|
|
1400
|
+
if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= w && w < t);
|
|
1510
1401
|
}
|
|
1511
1402
|
}, [
|
|
1512
1403
|
c,
|
|
1513
1404
|
l,
|
|
1514
|
-
|
|
1515
|
-
]),
|
|
1405
|
+
w
|
|
1406
|
+
]), oe = (e, t) => /* @__PURE__ */ F("div", {
|
|
1516
1407
|
className: e ? `track ${e}` : "track",
|
|
1517
1408
|
style: t ? { maskImage: t } : void 0,
|
|
1518
1409
|
children: [
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ P("div", { className: "background-bar" }),
|
|
1411
|
+
/* @__PURE__ */ P("div", {
|
|
1521
1412
|
className: "loaded",
|
|
1522
|
-
children:
|
|
1413
|
+
children: G
|
|
1523
1414
|
}),
|
|
1524
|
-
/* @__PURE__ */
|
|
1415
|
+
/* @__PURE__ */ P("div", {
|
|
1525
1416
|
className: "play-container",
|
|
1526
|
-
children: /* @__PURE__ */
|
|
1417
|
+
children: /* @__PURE__ */ P("div", {
|
|
1527
1418
|
className: "play",
|
|
1528
|
-
style: { transform: `scaleX(${
|
|
1419
|
+
style: { transform: `scaleX(${te})` }
|
|
1529
1420
|
})
|
|
1530
1421
|
})
|
|
1531
1422
|
]
|
|
1532
1423
|
});
|
|
1533
|
-
return /* @__PURE__ */
|
|
1534
|
-
css:
|
|
1535
|
-
ref:
|
|
1424
|
+
return /* @__PURE__ */ F("div", {
|
|
1425
|
+
css: st,
|
|
1426
|
+
ref: _,
|
|
1536
1427
|
className: [
|
|
1537
1428
|
"progress-bar",
|
|
1538
1429
|
N ? "dragging" : "",
|
|
1539
|
-
|
|
1430
|
+
q ? "segmented" : ""
|
|
1540
1431
|
].filter(Boolean).join(" "),
|
|
1541
|
-
onPointerDown:
|
|
1542
|
-
onPointerMove:
|
|
1543
|
-
onMouseMove:
|
|
1544
|
-
onMouseOut:
|
|
1432
|
+
onPointerDown: V,
|
|
1433
|
+
onPointerMove: V,
|
|
1434
|
+
onMouseMove: H,
|
|
1435
|
+
onMouseOut: U,
|
|
1545
1436
|
children: [
|
|
1546
|
-
|
|
1547
|
-
|
|
1437
|
+
oe(void 0, ne),
|
|
1438
|
+
w ? /* @__PURE__ */ F("div", {
|
|
1548
1439
|
className: "cursor-time",
|
|
1549
1440
|
style: {
|
|
1550
|
-
left:
|
|
1551
|
-
maxWidth:
|
|
1441
|
+
left: ie ? `clamp(var(--thumbnail-half), ${W(w)}%, calc(100% - var(--thumbnail-half)))` : `clamp(calc(3 * var(--mp-unit)), ${W(w)}%, calc(100% - calc(3 * var(--mp-unit))))`,
|
|
1442
|
+
maxWidth: ie ? "var(--thumbnail-width)" : void 0
|
|
1552
1443
|
},
|
|
1553
|
-
children: [/* @__PURE__ */
|
|
1444
|
+
children: [/* @__PURE__ */ P("span", {
|
|
1554
1445
|
className: "cursor-time-value",
|
|
1555
|
-
children:
|
|
1556
|
-
}),
|
|
1446
|
+
children: $e(w)
|
|
1447
|
+
}), ie ? /* @__PURE__ */ P("span", {
|
|
1557
1448
|
className: "chapter-title",
|
|
1558
|
-
children:
|
|
1449
|
+
children: ie.title
|
|
1559
1450
|
}) : void 0]
|
|
1560
1451
|
}) : void 0,
|
|
1561
|
-
/* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1452
|
+
/* @__PURE__ */ P("div", { className: "progress" }),
|
|
1453
|
+
/* @__PURE__ */ P("div", { className: "hover" }),
|
|
1454
|
+
re ? oe("focus", re) : void 0,
|
|
1455
|
+
/* @__PURE__ */ P("div", { className: "scrubber" }),
|
|
1456
|
+
/* @__PURE__ */ P("div", {
|
|
1566
1457
|
className: "padding",
|
|
1567
|
-
...
|
|
1568
|
-
onPointerDown:
|
|
1569
|
-
onPointerUp:
|
|
1570
|
-
onPointerCancel:
|
|
1458
|
+
...I,
|
|
1459
|
+
onPointerDown: L,
|
|
1460
|
+
onPointerUp: R,
|
|
1461
|
+
onPointerCancel: R
|
|
1571
1462
|
}),
|
|
1572
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ P("div", {
|
|
1573
1464
|
className: "thumbnail",
|
|
1574
|
-
style: { left: `clamp(var(--thumbnail-half), ${
|
|
1575
|
-
children:
|
|
1465
|
+
style: { left: `clamp(var(--thumbnail-half), ${W(w ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
|
|
1466
|
+
children: ae?.url ? /* @__PURE__ */ P("img", { src: ae.url }) : void 0
|
|
1576
1467
|
})
|
|
1577
1468
|
]
|
|
1578
1469
|
});
|
|
1579
|
-
},
|
|
1470
|
+
}, ut = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%20class='icon%20icon-tabler%20icons-tabler-outline%20icon-tabler-picture-in-picture'%3e%3cpath%20stroke='none'%20d='M0%200h24v24H0z'%20fill='none'%20/%3e%3cpath%20d='M11%2019h-6a2%202%200%200%201%20-2%20-2v-10a2%202%200%200%201%202%20-2h14a2%202%200%200%201%202%202v4'%20/%3e%3cpath%20d='M14%2014m0%201a1%201%200%200%201%201%20-1h5a1%201%200%200%201%201%201v3a1%201%200%200%201%20-1%201h-5a1%201%200%200%201%20-1%20-1z'%20/%3e%3c/svg%3e", dt = {
|
|
1580
1471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1581
1472
|
width: 24,
|
|
1582
1473
|
height: 24,
|
|
@@ -1586,12 +1477,12 @@ var q = {
|
|
|
1586
1477
|
strokeWidth: 2,
|
|
1587
1478
|
strokeLinecap: "round",
|
|
1588
1479
|
strokeLinejoin: "round"
|
|
1589
|
-
},
|
|
1590
|
-
...
|
|
1480
|
+
}, ft = (e) => /* @__PURE__ */ F("svg", {
|
|
1481
|
+
...dt,
|
|
1591
1482
|
...e,
|
|
1592
1483
|
children: [
|
|
1593
|
-
/* @__PURE__ */
|
|
1594
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ P("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
1485
|
+
/* @__PURE__ */ P("rect", {
|
|
1595
1486
|
x: "12",
|
|
1596
1487
|
y: "13",
|
|
1597
1488
|
width: "10",
|
|
@@ -1599,14 +1490,14 @@ var q = {
|
|
|
1599
1490
|
rx: "1",
|
|
1600
1491
|
ry: "1"
|
|
1601
1492
|
}),
|
|
1602
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ P("path", { d: "M14.5 18.5h2m2 0h1" })
|
|
1603
1494
|
]
|
|
1604
|
-
}),
|
|
1605
|
-
...
|
|
1495
|
+
}), pt = (e) => /* @__PURE__ */ F("svg", {
|
|
1496
|
+
...dt,
|
|
1606
1497
|
...e,
|
|
1607
1498
|
children: [
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ P("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
1500
|
+
/* @__PURE__ */ P("rect", {
|
|
1610
1501
|
x: "12",
|
|
1611
1502
|
y: "13",
|
|
1612
1503
|
width: "10",
|
|
@@ -1614,9 +1505,9 @@ var q = {
|
|
|
1614
1505
|
rx: "1",
|
|
1615
1506
|
ry: "1"
|
|
1616
1507
|
}),
|
|
1617
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ P("path", { d: "M6 9h3m2 0h2" })
|
|
1618
1509
|
]
|
|
1619
|
-
}),
|
|
1510
|
+
}), mt = w`
|
|
1620
1511
|
.popover {
|
|
1621
1512
|
position: absolute;
|
|
1622
1513
|
/* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
|
|
@@ -1743,26 +1634,26 @@ var q = {
|
|
|
1743
1634
|
${Q.bSmall.regular}
|
|
1744
1635
|
}
|
|
1745
1636
|
}
|
|
1746
|
-
`,
|
|
1637
|
+
`, ht = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: a, pending: o, failed: s }) => {
|
|
1747
1638
|
let c = o !== void 0, l = (e, i, a) => {
|
|
1748
1639
|
let s = c && o === e, l = c || t.find((t) => t.id === e)?.disabled;
|
|
1749
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ F("div", {
|
|
1750
1641
|
onClick: () => {
|
|
1751
1642
|
l || r(e ?? void 0);
|
|
1752
1643
|
},
|
|
1753
1644
|
className: [a, l ? "unavailable" : null].filter(Boolean).join(" ") || void 0,
|
|
1754
|
-
children: [/* @__PURE__ */
|
|
1645
|
+
children: [/* @__PURE__ */ P("span", { children: i }), /* @__PURE__ */ P("span", { children: s ? "…" : (n ?? null) === e ? "✓" : "" })]
|
|
1755
1646
|
}, e ?? "__off__");
|
|
1756
1647
|
};
|
|
1757
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ F("div", {
|
|
1758
1649
|
className: "popover track-list",
|
|
1759
1650
|
children: [
|
|
1760
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ F("div", {
|
|
1761
1652
|
className: i ? "back" : "back no-hover",
|
|
1762
1653
|
onClick: i,
|
|
1763
|
-
children: [i ? /* @__PURE__ */
|
|
1654
|
+
children: [i ? /* @__PURE__ */ P(z, {}) : null, /* @__PURE__ */ P("span", { children: e })]
|
|
1764
1655
|
}),
|
|
1765
|
-
s ? /* @__PURE__ */
|
|
1656
|
+
s ? /* @__PURE__ */ P("div", {
|
|
1766
1657
|
className: "no-hover failed",
|
|
1767
1658
|
children: "Could not switch. Try again."
|
|
1768
1659
|
}) : null,
|
|
@@ -1770,13 +1661,13 @@ var q = {
|
|
|
1770
1661
|
t.map(({ id: e, label: t }) => l(e, t, "description"))
|
|
1771
1662
|
]
|
|
1772
1663
|
});
|
|
1773
|
-
},
|
|
1774
|
-
let t =
|
|
1664
|
+
}, gt = ({ onReset: e } = {}) => {
|
|
1665
|
+
let t = x(null), [n, r] = S(!1), [i, a] = S(void 0), [o, s] = S(!1), c = x(e);
|
|
1775
1666
|
c.current = e;
|
|
1776
1667
|
let l = () => {
|
|
1777
1668
|
r(!1), c.current?.();
|
|
1778
1669
|
};
|
|
1779
|
-
return
|
|
1670
|
+
return y(() => {
|
|
1780
1671
|
let e = (e) => {
|
|
1781
1672
|
n && t.current && !t.current.contains(e.target) && l();
|
|
1782
1673
|
};
|
|
@@ -1811,7 +1702,7 @@ var q = {
|
|
|
1811
1702
|
});
|
|
1812
1703
|
}
|
|
1813
1704
|
};
|
|
1814
|
-
},
|
|
1705
|
+
}, _t = w`
|
|
1815
1706
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
1816
1707
|
which is the width of the player box, so it can be clamped to it. */
|
|
1817
1708
|
position: static;
|
|
@@ -1827,7 +1718,7 @@ position: static;
|
|
|
1827
1718
|
}
|
|
1828
1719
|
}
|
|
1829
1720
|
|
|
1830
|
-
${
|
|
1721
|
+
${mt}
|
|
1831
1722
|
|
|
1832
1723
|
.popover.error-list {
|
|
1833
1724
|
/* Wider than a track menu and taller, because these rows are sentences rather than labels, and a
|
|
@@ -1899,68 +1790,68 @@ ${jt}
|
|
|
1899
1790
|
}
|
|
1900
1791
|
}
|
|
1901
1792
|
}
|
|
1902
|
-
`,
|
|
1903
|
-
let n =
|
|
1793
|
+
`, vt = (e) => new Date(e).toLocaleTimeString(), yt = (e) => e === void 0 || !Number.isFinite(e) ? void 0 : $e(Math.max(0, e)), bt = (e) => e.reduce((e, t) => e + t.count, 0), xt = (e) => e.map((e, t) => {
|
|
1794
|
+
let n = yt(e.atMediaTime), r = e.count > 1 ? `${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}` : new Date(e.at).toISOString();
|
|
1904
1795
|
return [
|
|
1905
1796
|
`${t + 1}. ${r}${n ? ` (at ${n})` : ""}${e.recovered ? " [recovered]" : ""}`,
|
|
1906
1797
|
e.message,
|
|
1907
1798
|
e.detail
|
|
1908
1799
|
].filter(Boolean).join("\n");
|
|
1909
|
-
}).join("\n\n"),
|
|
1910
|
-
let e = Y((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } =
|
|
1800
|
+
}).join("\n\n"), St = () => {
|
|
1801
|
+
let e = Y((e) => e.playbackErrors), { open: t, toggle: n, containerRef: r } = gt(), [i, a] = S(!1);
|
|
1911
1802
|
if (e.length === 0) return null;
|
|
1912
1803
|
let o = () => {
|
|
1913
|
-
navigator.clipboard?.writeText(
|
|
1804
|
+
navigator.clipboard?.writeText(xt(e)).then(() => {
|
|
1914
1805
|
a(!0), setTimeout(() => a(!1), 2e3);
|
|
1915
1806
|
}, (e) => console.warn("[media-player] could not copy the errors:", e));
|
|
1916
|
-
}, s = `Playback errors (${
|
|
1917
|
-
return /* @__PURE__ */
|
|
1918
|
-
css:
|
|
1807
|
+
}, s = `Playback errors (${bt(e)})`;
|
|
1808
|
+
return /* @__PURE__ */ F("div", {
|
|
1809
|
+
css: _t,
|
|
1919
1810
|
ref: r,
|
|
1920
|
-
children: [/* @__PURE__ */
|
|
1811
|
+
children: [/* @__PURE__ */ P($, {
|
|
1921
1812
|
id: "errors",
|
|
1922
1813
|
disabled: t,
|
|
1923
|
-
text: /* @__PURE__ */
|
|
1814
|
+
text: /* @__PURE__ */ P("button", {
|
|
1924
1815
|
className: "errors",
|
|
1925
1816
|
type: "button",
|
|
1926
1817
|
onClick: n,
|
|
1927
1818
|
"aria-label": s,
|
|
1928
1819
|
"aria-expanded": t,
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1820
|
+
children: /* @__PURE__ */ P(K, { className: "alert-triangle" })
|
|
1930
1821
|
}),
|
|
1931
|
-
toolTipText: /* @__PURE__ */
|
|
1932
|
-
}), t && /* @__PURE__ */
|
|
1822
|
+
toolTipText: /* @__PURE__ */ P("span", { children: s })
|
|
1823
|
+
}), t && /* @__PURE__ */ F("div", {
|
|
1933
1824
|
className: "popover error-list",
|
|
1934
|
-
children: [/* @__PURE__ */
|
|
1825
|
+
children: [/* @__PURE__ */ F("div", {
|
|
1935
1826
|
className: "back no-hover",
|
|
1936
|
-
children: [/* @__PURE__ */
|
|
1827
|
+
children: [/* @__PURE__ */ P("span", { children: s }), /* @__PURE__ */ F("button", {
|
|
1937
1828
|
className: "copy",
|
|
1938
1829
|
type: "button",
|
|
1939
1830
|
onClick: o,
|
|
1940
1831
|
"aria-label": "Copy the errors",
|
|
1941
|
-
children: [
|
|
1832
|
+
children: [P(i ? R : V, {}), /* @__PURE__ */ P("span", { children: i ? "Copied" : "Copy" })]
|
|
1942
1833
|
})]
|
|
1943
|
-
}), e.map((e, t) => /* @__PURE__ */
|
|
1834
|
+
}), e.map((e, t) => /* @__PURE__ */ F("div", {
|
|
1944
1835
|
className: "entry no-hover",
|
|
1945
1836
|
children: [
|
|
1946
|
-
/* @__PURE__ */
|
|
1837
|
+
/* @__PURE__ */ F("span", {
|
|
1947
1838
|
className: "when",
|
|
1948
1839
|
children: [
|
|
1949
|
-
|
|
1950
|
-
e.count > 1 ? ` to ${
|
|
1951
|
-
|
|
1840
|
+
vt(e.at),
|
|
1841
|
+
e.count > 1 ? ` to ${vt(e.lastAt)}` : "",
|
|
1842
|
+
yt(e.atMediaTime) ? ` at ${yt(e.atMediaTime)}` : "",
|
|
1952
1843
|
e.recovered ? " recovered" : "",
|
|
1953
|
-
e.count > 1 ? /* @__PURE__ */
|
|
1844
|
+
e.count > 1 ? /* @__PURE__ */ P("span", {
|
|
1954
1845
|
className: "count",
|
|
1955
1846
|
children: `×${e.count}`
|
|
1956
1847
|
}) : null
|
|
1957
1848
|
]
|
|
1958
1849
|
}),
|
|
1959
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ P("span", {
|
|
1960
1851
|
className: "what",
|
|
1961
1852
|
children: e.message
|
|
1962
1853
|
}),
|
|
1963
|
-
e.detail ? /* @__PURE__ */
|
|
1854
|
+
e.detail ? /* @__PURE__ */ P("span", {
|
|
1964
1855
|
className: "cause",
|
|
1965
1856
|
children: e.detail
|
|
1966
1857
|
}) : null
|
|
@@ -1968,7 +1859,7 @@ ${jt}
|
|
|
1968
1859
|
}, `${e.at}-${t}`))]
|
|
1969
1860
|
})]
|
|
1970
1861
|
});
|
|
1971
|
-
},
|
|
1862
|
+
}, Ct = w`
|
|
1972
1863
|
display: flex;
|
|
1973
1864
|
align-items: center;
|
|
1974
1865
|
justify-content: center;
|
|
@@ -2021,8 +1912,8 @@ width: 100%;
|
|
|
2021
1912
|
}
|
|
2022
1913
|
}
|
|
2023
1914
|
}
|
|
2024
|
-
`,
|
|
2025
|
-
let e = Y(), t = Y((e) => e.playbackRate), n =
|
|
1915
|
+
`, wt = () => {
|
|
1916
|
+
let e = Y(), t = Y((e) => e.playbackRate), n = x(null), r = x(null), i = .25, a = 2.75, o = (e, t = .05) => Math.round(e / t) * t, s = o(t || 1), c = (e) => (e - i) / a * 100, l = (e) => o(i + e * a), { handlers: u } = ot({
|
|
2026
1917
|
ref: r,
|
|
2027
1918
|
onChange: (t) => e.setPlaybackRate(l(t))
|
|
2028
1919
|
}), d = (t) => {
|
|
@@ -2030,33 +1921,33 @@ width: 100%;
|
|
|
2030
1921
|
let n = .05, r = s;
|
|
2031
1922
|
r = t.deltaY < 0 ? Math.min(3, r + n) : Math.max(i, r - n), e.setPlaybackRate(r);
|
|
2032
1923
|
};
|
|
2033
|
-
|
|
1924
|
+
y(() => {
|
|
2034
1925
|
let e = n.current;
|
|
2035
1926
|
return e && e.addEventListener("wheel", d, { passive: !1 }), () => {
|
|
2036
1927
|
e && e.removeEventListener("wheel", d);
|
|
2037
1928
|
};
|
|
2038
1929
|
}, [t]);
|
|
2039
1930
|
let f = c(s);
|
|
2040
|
-
return /* @__PURE__ */
|
|
2041
|
-
css:
|
|
2042
|
-
children: [/* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ F("div", {
|
|
1932
|
+
css: Ct,
|
|
1933
|
+
children: [/* @__PURE__ */ F("div", { children: [s.toFixed(2), "x"] }), /* @__PURE__ */ P("div", {
|
|
2043
1934
|
className: "playback-slider",
|
|
2044
1935
|
ref: n,
|
|
2045
1936
|
...u,
|
|
2046
|
-
children: /* @__PURE__ */
|
|
1937
|
+
children: /* @__PURE__ */ P("div", {
|
|
2047
1938
|
ref: r,
|
|
2048
1939
|
style: { background: `linear-gradient(to right,
|
|
2049
1940
|
#fff 0% ${f}%,
|
|
2050
1941
|
#3A3A3A ${f}% 100%
|
|
2051
1942
|
)` },
|
|
2052
|
-
children: /* @__PURE__ */
|
|
1943
|
+
children: /* @__PURE__ */ P("div", {
|
|
2053
1944
|
className: "playback-handle",
|
|
2054
1945
|
style: { left: `${f}%` }
|
|
2055
1946
|
})
|
|
2056
1947
|
})
|
|
2057
1948
|
})]
|
|
2058
1949
|
});
|
|
2059
|
-
},
|
|
1950
|
+
}, Tt = w`
|
|
2060
1951
|
/* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
|
|
2061
1952
|
as wide as the player box and can therefore be clamped to it. The outside-click check uses
|
|
2062
1953
|
\`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
|
|
@@ -2074,7 +1965,7 @@ position: static;
|
|
|
2074
1965
|
}
|
|
2075
1966
|
}
|
|
2076
1967
|
|
|
2077
|
-
${
|
|
1968
|
+
${mt}
|
|
2078
1969
|
|
|
2079
1970
|
.switch {
|
|
2080
1971
|
position: relative;
|
|
@@ -2150,55 +2041,55 @@ ${jt}
|
|
|
2150
2041
|
}
|
|
2151
2042
|
}
|
|
2152
2043
|
|
|
2153
|
-
`,
|
|
2154
|
-
let e = Y(), t = Y((e) => e.playbackRate), n = Y((e) => e.audioTracks), r = Y((e) => e.selectedAudioTrack), i = Y((e) => e.selectAudioTrack), a = Y((e) => e.quality), o = Y((e) => e.volumeNormalizer), [s, c] =
|
|
2044
|
+
`, Et = () => {
|
|
2045
|
+
let e = Y(), t = Y((e) => e.playbackRate), n = Y((e) => e.audioTracks), r = Y((e) => e.selectedAudioTrack), i = Y((e) => e.selectAudioTrack), a = Y((e) => e.quality), o = Y((e) => e.volumeNormalizer), [s, c] = S(0), { open: l, toggle: u, containerRef: d, pending: f, failed: p, runSelect: m } = gt({ onReset: () => c(0) }), h = (t) => {
|
|
2155
2046
|
e.setPlaybackRate(t), c(0);
|
|
2156
2047
|
}, g = (e) => {
|
|
2157
2048
|
e !== void 0 && m(e, () => i(e));
|
|
2158
|
-
},
|
|
2049
|
+
}, _ = (e) => {
|
|
2159
2050
|
a && m(e ?? null, () => a.select(e === void 0 ? null : String(e)));
|
|
2160
|
-
},
|
|
2051
|
+
}, v = a ? a.options.length + +!!a.offLabel : 0, y = a?.selectedId == null ? a?.offLabel : a.options.find(({ id: e }) => e === a.selectedId)?.label, b = (e) => () => {
|
|
2161
2052
|
c(e);
|
|
2162
2053
|
};
|
|
2163
|
-
return /* @__PURE__ */
|
|
2164
|
-
css:
|
|
2054
|
+
return /* @__PURE__ */ F("div", {
|
|
2055
|
+
css: Tt,
|
|
2165
2056
|
ref: d,
|
|
2166
2057
|
children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ P($, {
|
|
2168
2059
|
id: "settings",
|
|
2169
2060
|
disabled: l,
|
|
2170
|
-
text: /* @__PURE__ */
|
|
2061
|
+
text: /* @__PURE__ */ P("button", {
|
|
2171
2062
|
className: "settings",
|
|
2172
2063
|
type: "button",
|
|
2173
2064
|
onClick: u,
|
|
2174
2065
|
"aria-label": "Settings",
|
|
2175
2066
|
"aria-expanded": l,
|
|
2176
|
-
children: /* @__PURE__ */
|
|
2067
|
+
children: /* @__PURE__ */ P(te, {})
|
|
2177
2068
|
}),
|
|
2178
|
-
toolTipText: /* @__PURE__ */
|
|
2069
|
+
toolTipText: /* @__PURE__ */ P("span", { children: "Settings" })
|
|
2179
2070
|
}),
|
|
2180
|
-
l && s === 0 && /* @__PURE__ */
|
|
2071
|
+
l && s === 0 && /* @__PURE__ */ F("div", {
|
|
2181
2072
|
className: "popover menu",
|
|
2182
2073
|
children: [
|
|
2183
|
-
n.length > 1 ? /* @__PURE__ */
|
|
2184
|
-
onClick:
|
|
2185
|
-
children: [/* @__PURE__ */
|
|
2074
|
+
n.length > 1 ? /* @__PURE__ */ F("div", {
|
|
2075
|
+
onClick: b(2),
|
|
2076
|
+
children: [/* @__PURE__ */ P("div", { children: "Audio" }), /* @__PURE__ */ P("div", { children: /* @__PURE__ */ P(B, {}) })]
|
|
2186
2077
|
}) : null,
|
|
2187
|
-
|
|
2188
|
-
onClick:
|
|
2189
|
-
children: [/* @__PURE__ */
|
|
2078
|
+
v > 1 ? /* @__PURE__ */ F("div", {
|
|
2079
|
+
onClick: b(3),
|
|
2080
|
+
children: [/* @__PURE__ */ P("div", { children: "Quality" }), /* @__PURE__ */ F("div", { children: [y ? /* @__PURE__ */ P("span", {
|
|
2190
2081
|
className: "secondary",
|
|
2191
|
-
children:
|
|
2192
|
-
}) : null, /* @__PURE__ */
|
|
2082
|
+
children: y
|
|
2083
|
+
}) : null, /* @__PURE__ */ P(B, {})] })]
|
|
2193
2084
|
}) : null,
|
|
2194
|
-
/* @__PURE__ */
|
|
2195
|
-
onClick:
|
|
2196
|
-
children: [/* @__PURE__ */
|
|
2085
|
+
/* @__PURE__ */ F("div", {
|
|
2086
|
+
onClick: b(1),
|
|
2087
|
+
children: [/* @__PURE__ */ P("div", { children: "Playback speed" }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("span", {
|
|
2197
2088
|
className: "secondary",
|
|
2198
2089
|
children: t === 1 ? "(Default)" : t.toFixed(2)
|
|
2199
|
-
}), /* @__PURE__ */
|
|
2090
|
+
}), /* @__PURE__ */ P(B, {})] })]
|
|
2200
2091
|
}),
|
|
2201
|
-
o ? /* @__PURE__ */
|
|
2092
|
+
o ? /* @__PURE__ */ F("div", {
|
|
2202
2093
|
role: "switch",
|
|
2203
2094
|
"aria-checked": o.available && o.enabled,
|
|
2204
2095
|
"aria-disabled": !o.available,
|
|
@@ -2206,41 +2097,41 @@ ${jt}
|
|
|
2206
2097
|
onClick: () => {
|
|
2207
2098
|
o.available && o.setEnabled(!o.enabled);
|
|
2208
2099
|
},
|
|
2209
|
-
children: [/* @__PURE__ */
|
|
2100
|
+
children: [/* @__PURE__ */ P("div", { children: "Normalize volume" }), /* @__PURE__ */ P("div", { children: o.available ? /* @__PURE__ */ P("span", { className: o.enabled ? "switch on" : "switch" }) : /* @__PURE__ */ P("span", {
|
|
2210
2101
|
className: "secondary",
|
|
2211
2102
|
children: "Unavailable"
|
|
2212
2103
|
}) })]
|
|
2213
2104
|
}) : null
|
|
2214
2105
|
]
|
|
2215
2106
|
}),
|
|
2216
|
-
l && s === 1 && /* @__PURE__ */
|
|
2107
|
+
l && s === 1 && /* @__PURE__ */ F("div", {
|
|
2217
2108
|
className: "popover playback-rate",
|
|
2218
2109
|
children: [
|
|
2219
|
-
/* @__PURE__ */
|
|
2110
|
+
/* @__PURE__ */ F("div", {
|
|
2220
2111
|
className: "back",
|
|
2221
|
-
onClick:
|
|
2222
|
-
children: [/* @__PURE__ */
|
|
2112
|
+
onClick: b(0),
|
|
2113
|
+
children: [/* @__PURE__ */ P(z, {}), /* @__PURE__ */ P("span", { children: "Playback speed" })]
|
|
2223
2114
|
}),
|
|
2224
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ P("div", {
|
|
2225
2116
|
className: "slider no-hover",
|
|
2226
|
-
children: /* @__PURE__ */
|
|
2117
|
+
children: /* @__PURE__ */ P(wt, {})
|
|
2227
2118
|
}),
|
|
2228
|
-
/* @__PURE__ */
|
|
2119
|
+
/* @__PURE__ */ F("div", {
|
|
2229
2120
|
className: "options no-hover",
|
|
2230
2121
|
children: [
|
|
2231
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ P("div", {
|
|
2232
2123
|
onClick: () => h(.5),
|
|
2233
2124
|
children: "0.5x"
|
|
2234
2125
|
}),
|
|
2235
|
-
/* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ P("div", {
|
|
2236
2127
|
onClick: () => h(1),
|
|
2237
2128
|
children: "1x"
|
|
2238
2129
|
}),
|
|
2239
|
-
/* @__PURE__ */
|
|
2130
|
+
/* @__PURE__ */ P("div", {
|
|
2240
2131
|
onClick: () => h(1.5),
|
|
2241
2132
|
children: "1.5x"
|
|
2242
2133
|
}),
|
|
2243
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ P("div", {
|
|
2244
2135
|
onClick: () => h(2),
|
|
2245
2136
|
children: "2x"
|
|
2246
2137
|
})
|
|
@@ -2248,28 +2139,28 @@ ${jt}
|
|
|
2248
2139
|
})
|
|
2249
2140
|
]
|
|
2250
2141
|
}),
|
|
2251
|
-
l && s === 2 && /* @__PURE__ */
|
|
2142
|
+
l && s === 2 && /* @__PURE__ */ P(ht, {
|
|
2252
2143
|
title: "Audio",
|
|
2253
2144
|
tracks: n,
|
|
2254
2145
|
selected: r,
|
|
2255
2146
|
onSelect: g,
|
|
2256
|
-
onBack:
|
|
2147
|
+
onBack: b(0),
|
|
2257
2148
|
pending: f,
|
|
2258
2149
|
failed: p
|
|
2259
2150
|
}),
|
|
2260
|
-
l && s === 3 && a && /* @__PURE__ */
|
|
2151
|
+
l && s === 3 && a && /* @__PURE__ */ P(ht, {
|
|
2261
2152
|
title: "Quality",
|
|
2262
2153
|
tracks: a.options,
|
|
2263
2154
|
selected: a.selectedId ?? void 0,
|
|
2264
|
-
onSelect:
|
|
2265
|
-
onBack:
|
|
2155
|
+
onSelect: _,
|
|
2156
|
+
onBack: b(0),
|
|
2266
2157
|
offLabel: a.offLabel,
|
|
2267
2158
|
pending: f,
|
|
2268
2159
|
failed: p
|
|
2269
2160
|
})
|
|
2270
2161
|
]
|
|
2271
2162
|
});
|
|
2272
|
-
},
|
|
2163
|
+
}, Dt = w`
|
|
2273
2164
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
2274
2165
|
which is the width of the player box, so it can be clamped to it. */
|
|
2275
2166
|
position: static;
|
|
@@ -2285,28 +2176,28 @@ position: static;
|
|
|
2285
2176
|
}
|
|
2286
2177
|
}
|
|
2287
2178
|
|
|
2288
|
-
${
|
|
2289
|
-
`,
|
|
2290
|
-
let e = Y((e) => e.subtitleTracks), t = Y((e) => e.selectedSubtitleTrack), n = Y((e) => e.selectSubtitleTrack), r = Y((e) => e.subtitleOffLabel), { open: i, toggle: a, containerRef: o, pending: s, failed: c, runSelect: l } =
|
|
2179
|
+
${mt}
|
|
2180
|
+
`, Ot = () => {
|
|
2181
|
+
let e = Y((e) => e.subtitleTracks), t = Y((e) => e.selectedSubtitleTrack), n = Y((e) => e.selectSubtitleTrack), r = Y((e) => e.subtitleOffLabel), { open: i, toggle: a, containerRef: o, pending: s, failed: c, runSelect: l } = gt();
|
|
2291
2182
|
if (e.length === 0) return null;
|
|
2292
2183
|
let u = t !== void 0;
|
|
2293
|
-
return /* @__PURE__ */
|
|
2294
|
-
css:
|
|
2184
|
+
return /* @__PURE__ */ F("div", {
|
|
2185
|
+
css: Dt,
|
|
2295
2186
|
ref: o,
|
|
2296
|
-
children: [/* @__PURE__ */
|
|
2187
|
+
children: [/* @__PURE__ */ P($, {
|
|
2297
2188
|
id: "subtitles",
|
|
2298
2189
|
disabled: i,
|
|
2299
|
-
text: /* @__PURE__ */
|
|
2190
|
+
text: /* @__PURE__ */ P("button", {
|
|
2300
2191
|
className: "subtitles",
|
|
2301
2192
|
type: "button",
|
|
2302
2193
|
onClick: a,
|
|
2303
2194
|
"aria-label": "Subtitles",
|
|
2304
2195
|
"aria-expanded": i,
|
|
2305
2196
|
"aria-pressed": u,
|
|
2306
|
-
children: u ? /* @__PURE__ */
|
|
2197
|
+
children: u ? /* @__PURE__ */ P(I, { className: "captions" }) : /* @__PURE__ */ P(L, { className: "captions-off" })
|
|
2307
2198
|
}),
|
|
2308
|
-
toolTipText: /* @__PURE__ */
|
|
2309
|
-
}), i && /* @__PURE__ */
|
|
2199
|
+
toolTipText: /* @__PURE__ */ P("span", { children: "Subtitles" })
|
|
2200
|
+
}), i && /* @__PURE__ */ P(ht, {
|
|
2310
2201
|
title: "Subtitles",
|
|
2311
2202
|
tracks: e,
|
|
2312
2203
|
selected: t,
|
|
@@ -2316,13 +2207,13 @@ ${jt}
|
|
|
2316
2207
|
failed: c
|
|
2317
2208
|
})]
|
|
2318
2209
|
});
|
|
2319
|
-
},
|
|
2210
|
+
}, kt = {
|
|
2320
2211
|
primary: "#EAEBEE",
|
|
2321
2212
|
secondary: "#D0D0D9",
|
|
2322
2213
|
hover: "rgba(255, 255, 255, 0.13)",
|
|
2323
2214
|
borderPrimary: "#384F70",
|
|
2324
2215
|
backgroundTooltip: "#222222"
|
|
2325
|
-
},
|
|
2216
|
+
}, At = w`
|
|
2326
2217
|
display: flex;
|
|
2327
2218
|
align-items: center;
|
|
2328
2219
|
|
|
@@ -2365,8 +2256,8 @@ ${jt}
|
|
|
2365
2256
|
width: 10px;
|
|
2366
2257
|
height: 10px;
|
|
2367
2258
|
}
|
|
2368
|
-
`,
|
|
2369
|
-
let n = Y((e) => e.volume), r = Y((e) => e.muted), i =
|
|
2259
|
+
`, jt = ({ value: e, onChange: t }) => {
|
|
2260
|
+
let n = Y((e) => e.volume), r = Y((e) => e.muted), i = x(null), a = x(null), { handlers: o } = ot({
|
|
2370
2261
|
ref: a,
|
|
2371
2262
|
onChange: t
|
|
2372
2263
|
}), s = (n) => {
|
|
@@ -2374,37 +2265,37 @@ ${jt}
|
|
|
2374
2265
|
let r = .05, i = e;
|
|
2375
2266
|
i = n.deltaY < 0 ? Math.min(1, i + r) : Math.max(0, i - r), t(i);
|
|
2376
2267
|
};
|
|
2377
|
-
|
|
2268
|
+
y(() => {
|
|
2378
2269
|
let e = i.current;
|
|
2379
2270
|
return e && e.addEventListener("wheel", s, { passive: !1 }), () => {
|
|
2380
2271
|
e && e.removeEventListener("wheel", s);
|
|
2381
2272
|
};
|
|
2382
2273
|
}, [e]);
|
|
2383
|
-
let c = e * 100, l =
|
|
2384
|
-
return /* @__PURE__ */
|
|
2274
|
+
let c = e * 100, l = b(() => Math.round(r ? 0 : Qe(n) * 100), [n, r]);
|
|
2275
|
+
return /* @__PURE__ */ P($, {
|
|
2385
2276
|
id: "volume-slider",
|
|
2386
|
-
text: /* @__PURE__ */
|
|
2277
|
+
text: /* @__PURE__ */ P("div", {
|
|
2387
2278
|
ref: i,
|
|
2388
|
-
css:
|
|
2279
|
+
css: At,
|
|
2389
2280
|
...o,
|
|
2390
|
-
children: /* @__PURE__ */
|
|
2281
|
+
children: /* @__PURE__ */ P("div", {
|
|
2391
2282
|
ref: a,
|
|
2392
2283
|
style: { background: `linear-gradient(to right,
|
|
2393
2284
|
#fff 0% ${c}%,
|
|
2394
2285
|
#3A3A3A ${c}% 100%
|
|
2395
2286
|
)` },
|
|
2396
|
-
children: /* @__PURE__ */
|
|
2287
|
+
children: /* @__PURE__ */ P("div", {
|
|
2397
2288
|
className: "volume-handle",
|
|
2398
2289
|
style: { left: `${e * 100}%` }
|
|
2399
2290
|
})
|
|
2400
2291
|
})
|
|
2401
2292
|
}),
|
|
2402
|
-
toolTipText: /* @__PURE__ */
|
|
2293
|
+
toolTipText: /* @__PURE__ */ F("div", {
|
|
2403
2294
|
className: "volume-value",
|
|
2404
2295
|
children: [l, "%"]
|
|
2405
2296
|
})
|
|
2406
2297
|
});
|
|
2407
|
-
},
|
|
2298
|
+
}, Mt = w`
|
|
2408
2299
|
position: relative;
|
|
2409
2300
|
display: flex;
|
|
2410
2301
|
align-items: center;
|
|
@@ -2467,39 +2358,39 @@ ${jt}
|
|
|
2467
2358
|
}
|
|
2468
2359
|
}
|
|
2469
2360
|
|
|
2470
|
-
`,
|
|
2471
|
-
let t = Y(), n = Y((e) => e.volume), r = Y((e) => e.muted), i =
|
|
2472
|
-
return /* @__PURE__ */
|
|
2473
|
-
css:
|
|
2474
|
-
children: [/* @__PURE__ */
|
|
2361
|
+
`, Nt = ({ ref: e }) => {
|
|
2362
|
+
let t = Y(), n = Y((e) => e.volume), r = Y((e) => e.muted), i = b(() => Qe(n), [n]);
|
|
2363
|
+
return /* @__PURE__ */ F("div", {
|
|
2364
|
+
css: Mt,
|
|
2365
|
+
children: [/* @__PURE__ */ P($, {
|
|
2475
2366
|
id: "sound",
|
|
2476
|
-
text: /* @__PURE__ */
|
|
2367
|
+
text: /* @__PURE__ */ P("button", {
|
|
2477
2368
|
className: "sound",
|
|
2478
2369
|
type: "button",
|
|
2479
2370
|
onClick: () => t.toggleMuted(),
|
|
2480
2371
|
ref: e,
|
|
2481
2372
|
"aria-label": "Mute",
|
|
2482
2373
|
"aria-pressed": r || n === 0,
|
|
2483
|
-
children:
|
|
2374
|
+
children: P(r || n === 0 ? ne : n <= .5 ? q : J, {
|
|
2484
2375
|
size: 18,
|
|
2485
2376
|
color: "#fff"
|
|
2486
2377
|
})
|
|
2487
2378
|
}),
|
|
2488
|
-
toolTipText: /* @__PURE__ */
|
|
2489
|
-
}), /* @__PURE__ */
|
|
2379
|
+
toolTipText: /* @__PURE__ */ P("span", { children: r ? "Unmute (m)" : "Mute (m)" })
|
|
2380
|
+
}), /* @__PURE__ */ P("div", {
|
|
2490
2381
|
className: "volume-slider-container",
|
|
2491
|
-
children: /* @__PURE__ */
|
|
2382
|
+
children: /* @__PURE__ */ P("div", {
|
|
2492
2383
|
className: "volume-slider-background",
|
|
2493
|
-
children: /* @__PURE__ */
|
|
2384
|
+
children: /* @__PURE__ */ P(jt, {
|
|
2494
2385
|
value: r ? 0 : i,
|
|
2495
2386
|
onChange: (e) => {
|
|
2496
|
-
t.setVolume(
|
|
2387
|
+
t.setVolume(Ze(e));
|
|
2497
2388
|
}
|
|
2498
2389
|
})
|
|
2499
2390
|
})
|
|
2500
2391
|
})]
|
|
2501
2392
|
});
|
|
2502
|
-
},
|
|
2393
|
+
}, Pt = .05, Ft = 5, It = 50, Lt = 1e3, Rt = w`
|
|
2503
2394
|
position: absolute;
|
|
2504
2395
|
bottom: 0;
|
|
2505
2396
|
width: 100%;
|
|
@@ -2591,7 +2482,7 @@ ${jt}
|
|
|
2591
2482
|
/* .armed is the hover of a control letting its click through, which takes no pointer events
|
|
2592
2483
|
of its own and so is never :hover */
|
|
2593
2484
|
:hover, &.armed {
|
|
2594
|
-
background-color: ${
|
|
2485
|
+
background-color: ${kt.hover};
|
|
2595
2486
|
}
|
|
2596
2487
|
|
|
2597
2488
|
/* the hit area grows, the icon does not, keyed on the pointer because a narrow desktop
|
|
@@ -2629,174 +2520,179 @@ ${jt}
|
|
|
2629
2520
|
}
|
|
2630
2521
|
}
|
|
2631
2522
|
}
|
|
2632
|
-
`,
|
|
2633
|
-
let
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2523
|
+
`, zt = ({ shortcuts: e = "window", root: t, fullscreen: n }) => {
|
|
2524
|
+
let r = Y(), i = Y((e) => e.paused), a = Y((e) => e.currentTime), o = Y((e) => e.duration), s = Y((e) => e.seekingTo), c = Y((e) => e.fullscreen), l = n ? n.active : c, u = x(n);
|
|
2525
|
+
u.current = n;
|
|
2526
|
+
let d = Y((e) => e.hideUI), f = Y((e) => e.togglePictureInPicture), p = Y((e) => e.pictureInPictureMode), m = Y((e) => e.burnedInSubtitles), h = Y((e) => e.passThroughPictureInPicture), g = Y((e) => e.subtitleTracks), v = Y((e) => e.requestSeek), b = Y((e) => e.stepFrame), [C, w] = S(null), T = x(null), E = x(void 0), D = p === "burn-in", O = g.length > 0, k = o > 0 && a === o, A = _(({ direction: e, stepSize: t }) => {
|
|
2527
|
+
let n = Qe(r.volume), i = e === "up" ? t : -t, a = Math.max(0, Math.min(1, n + i)), o = r.muted;
|
|
2528
|
+
r.setVolume(Ze(a)), o && !r.muted && r.toggleMuted();
|
|
2529
|
+
}, [r]), j = x(!1), M = _(() => {
|
|
2530
|
+
u.current ? u.current.request() : r.toggleFullscreen();
|
|
2531
|
+
}, [r]);
|
|
2532
|
+
y(() => {
|
|
2533
|
+
let n = (e) => v ? v(e) : r.seek(e), i = (e) => e.composedPath()[0], a = (e) => {
|
|
2534
|
+
j.current = !!t.current?.contains(i(e) ?? null);
|
|
2640
2535
|
}, o = (a) => {
|
|
2641
2536
|
let o = i(a);
|
|
2642
2537
|
if (o?.isContentEditable || /^(input|textarea|select)$/i.test(o?.tagName ?? "") || (a.ctrlKey || a.metaKey || a.altKey) && !a.getModifierState("AltGraph")) return;
|
|
2643
|
-
let s = t.current?.contains(o ?? null) || o === document.body &&
|
|
2644
|
-
if (e === "player" && !
|
|
2645
|
-
let
|
|
2646
|
-
if (a.key === "f")
|
|
2647
|
-
else if (a.key === "k")
|
|
2648
|
-
else if (a.key === " ")
|
|
2649
|
-
else if (a.key === "m")
|
|
2650
|
-
else if (a.key === "ArrowUp")
|
|
2538
|
+
let s = t.current?.contains(o ?? null) || o === document.body && j.current, c = u.current ? u.current.active : r.fullscreen;
|
|
2539
|
+
if (e === "player" && !c && !s) return;
|
|
2540
|
+
let l = !0;
|
|
2541
|
+
if (a.key === "f") M();
|
|
2542
|
+
else if (a.key === "k") r.togglePaused();
|
|
2543
|
+
else if (a.key === " ") r.togglePaused();
|
|
2544
|
+
else if (a.key === "m") r.toggleMuted();
|
|
2545
|
+
else if (a.key === "ArrowUp") A({
|
|
2651
2546
|
direction: "up",
|
|
2652
|
-
stepSize:
|
|
2547
|
+
stepSize: Pt
|
|
2653
2548
|
});
|
|
2654
|
-
else if (a.key === "ArrowDown")
|
|
2549
|
+
else if (a.key === "ArrowDown") A({
|
|
2655
2550
|
direction: "down",
|
|
2656
|
-
stepSize:
|
|
2551
|
+
stepSize: Pt
|
|
2657
2552
|
});
|
|
2658
2553
|
else if (a.key === "ArrowRight") {
|
|
2659
|
-
if (!
|
|
2660
|
-
|
|
2661
|
-
} else a.key === "ArrowLeft" ?
|
|
2662
|
-
|
|
2554
|
+
if (!r.duration) return;
|
|
2555
|
+
n(Math.min(r.currentTime + Ft, r.duration));
|
|
2556
|
+
} else a.key === "ArrowLeft" ? n(Math.max(r.currentTime - Ft, 0)) : (a.key === "<" || a.key === ">") && b ? b(a.key === ">" ? 1 : -1) : l = !1;
|
|
2557
|
+
l && a.preventDefault();
|
|
2663
2558
|
};
|
|
2664
2559
|
return window.addEventListener("keydown", o), window.addEventListener("pointerdown", a, !0), window.addEventListener("focusin", a, !0), () => {
|
|
2665
2560
|
window.removeEventListener("keydown", o), window.removeEventListener("pointerdown", a, !0), window.removeEventListener("focusin", a, !0);
|
|
2666
2561
|
};
|
|
2667
2562
|
}, [
|
|
2668
|
-
|
|
2669
|
-
|
|
2563
|
+
r,
|
|
2564
|
+
A,
|
|
2670
2565
|
v,
|
|
2671
|
-
|
|
2566
|
+
b,
|
|
2672
2567
|
e,
|
|
2673
|
-
t
|
|
2568
|
+
t,
|
|
2569
|
+
M
|
|
2674
2570
|
]);
|
|
2675
|
-
let
|
|
2676
|
-
e.preventDefault(), e.deltaY < 0 ?
|
|
2571
|
+
let N = _((e) => {
|
|
2572
|
+
e.preventDefault(), e.deltaY < 0 ? A({
|
|
2677
2573
|
direction: "up",
|
|
2678
|
-
stepSize:
|
|
2679
|
-
}) :
|
|
2574
|
+
stepSize: Pt
|
|
2575
|
+
}) : A({
|
|
2680
2576
|
direction: "down",
|
|
2681
|
-
stepSize:
|
|
2577
|
+
stepSize: Pt
|
|
2682
2578
|
});
|
|
2683
|
-
}, [
|
|
2684
|
-
|
|
2685
|
-
if (
|
|
2686
|
-
}, [
|
|
2687
|
-
let
|
|
2688
|
-
if (!
|
|
2579
|
+
}, [A]);
|
|
2580
|
+
y(() => {
|
|
2581
|
+
if (C) return C.addEventListener("wheel", N, { passive: !1 }), () => C.removeEventListener("wheel", N);
|
|
2582
|
+
}, [C, N]);
|
|
2583
|
+
let I = (e) => {
|
|
2584
|
+
if (!h || h.active || h.armed || e.pointerType === "touch") return;
|
|
2689
2585
|
let { left: t, top: n, width: r, height: i } = e.currentTarget.getBoundingClientRect();
|
|
2690
|
-
|
|
2586
|
+
h.arm({
|
|
2691
2587
|
left: t,
|
|
2692
2588
|
top: n,
|
|
2693
2589
|
width: r,
|
|
2694
2590
|
height: i
|
|
2695
2591
|
});
|
|
2696
|
-
},
|
|
2697
|
-
return
|
|
2698
|
-
if (!
|
|
2699
|
-
clearInterval(
|
|
2592
|
+
}, L = !!h?.armed;
|
|
2593
|
+
return y(() => {
|
|
2594
|
+
if (!L) return;
|
|
2595
|
+
clearInterval(E.current);
|
|
2700
2596
|
let e = Infinity, t = setInterval(() => {
|
|
2701
2597
|
if (Date.now() > e) {
|
|
2702
2598
|
clearInterval(t);
|
|
2703
2599
|
return;
|
|
2704
2600
|
}
|
|
2705
|
-
let n =
|
|
2601
|
+
let n = T.current, r = document.activeElement;
|
|
2706
2602
|
n && r?.tagName === "IFRAME" && r.closest(".video")?.parentElement?.contains(n) && n.focus({ preventScroll: !0 });
|
|
2707
|
-
},
|
|
2708
|
-
return
|
|
2709
|
-
e = Date.now() +
|
|
2603
|
+
}, It);
|
|
2604
|
+
return E.current = t, () => {
|
|
2605
|
+
e = Date.now() + Lt;
|
|
2710
2606
|
};
|
|
2711
|
-
}, [
|
|
2607
|
+
}, [L]), y(() => () => clearInterval(E.current), []), /* @__PURE__ */ F("div", {
|
|
2712
2608
|
className: "control-bar",
|
|
2713
|
-
css:
|
|
2714
|
-
style: { ...
|
|
2609
|
+
css: Rt,
|
|
2610
|
+
style: { ...d ? {
|
|
2715
2611
|
opacity: "0",
|
|
2716
2612
|
pointerEvents: "none"
|
|
2717
|
-
} :
|
|
2718
|
-
children: [/* @__PURE__ */
|
|
2613
|
+
} : L ? { pointerEvents: "none" } : {} },
|
|
2614
|
+
children: [/* @__PURE__ */ P(lt, {}), /* @__PURE__ */ F("div", {
|
|
2719
2615
|
className: "actions",
|
|
2720
|
-
children: [/* @__PURE__ */
|
|
2616
|
+
children: [/* @__PURE__ */ F("div", {
|
|
2721
2617
|
className: "left",
|
|
2722
2618
|
children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ P($, {
|
|
2724
2620
|
id: "play",
|
|
2725
2621
|
tooltipPlace: "top-start",
|
|
2726
|
-
text: /* @__PURE__ */
|
|
2622
|
+
text: /* @__PURE__ */ P("button", {
|
|
2727
2623
|
className: "play",
|
|
2728
2624
|
type: "button",
|
|
2729
|
-
onClick: () =>
|
|
2730
|
-
"aria-label":
|
|
2731
|
-
children: k
|
|
2625
|
+
onClick: () => r.togglePaused(),
|
|
2626
|
+
"aria-label": k ? "Replay" : i ? "Play" : "Pause",
|
|
2627
|
+
children: P(k ? G : i ? ee : W, {})
|
|
2732
2628
|
}),
|
|
2733
|
-
toolTipText: /* @__PURE__ */
|
|
2629
|
+
toolTipText: /* @__PURE__ */ P("span", { children: k ? "Replay (k)" : i ? "Play (k)" : "Pause (k)" })
|
|
2734
2630
|
}),
|
|
2735
|
-
/* @__PURE__ */
|
|
2736
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ P(Nt, { ref: w }),
|
|
2632
|
+
/* @__PURE__ */ P("div", {
|
|
2737
2633
|
className: "time",
|
|
2738
|
-
children:
|
|
2634
|
+
children: et(s ?? a, o)
|
|
2739
2635
|
})
|
|
2740
2636
|
]
|
|
2741
|
-
}), /* @__PURE__ */
|
|
2637
|
+
}), /* @__PURE__ */ F("div", {
|
|
2742
2638
|
className: "right",
|
|
2743
2639
|
children: [
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
|
|
2640
|
+
/* @__PURE__ */ P(St, {}),
|
|
2641
|
+
/* @__PURE__ */ P(Ot, {}),
|
|
2642
|
+
/* @__PURE__ */ P(Et, {}),
|
|
2643
|
+
h ? /* @__PURE__ */ P($, {
|
|
2748
2644
|
id: "picture-in-picture",
|
|
2749
2645
|
tooltipPlace: "top-end",
|
|
2750
|
-
text: /* @__PURE__ */
|
|
2751
|
-
ref:
|
|
2752
|
-
className:
|
|
2646
|
+
text: /* @__PURE__ */ P("button", {
|
|
2647
|
+
ref: T,
|
|
2648
|
+
className: h.armed ? "picture-in-picture armed" : "picture-in-picture",
|
|
2753
2649
|
type: "button",
|
|
2754
|
-
onPointerEnter:
|
|
2755
|
-
onPointerMove:
|
|
2756
|
-
onClick:
|
|
2650
|
+
onPointerEnter: I,
|
|
2651
|
+
onPointerMove: I,
|
|
2652
|
+
onClick: h.active ? h.exit : void 0,
|
|
2757
2653
|
"aria-label": "Picture in picture",
|
|
2758
|
-
"aria-pressed":
|
|
2759
|
-
children: /* @__PURE__ */
|
|
2760
|
-
src:
|
|
2654
|
+
"aria-pressed": h.active,
|
|
2655
|
+
children: /* @__PURE__ */ P("img", {
|
|
2656
|
+
src: ut,
|
|
2761
2657
|
alt: ""
|
|
2762
2658
|
})
|
|
2763
2659
|
}),
|
|
2764
|
-
toolTipText: /* @__PURE__ */
|
|
2765
|
-
}) :
|
|
2660
|
+
toolTipText: /* @__PURE__ */ P("span", { children: h.active ? "Exit picture in picture" : "Picture in picture" })
|
|
2661
|
+
}) : f ? /* @__PURE__ */ P($, {
|
|
2766
2662
|
id: "picture-in-picture",
|
|
2767
2663
|
tooltipPlace: "top-end",
|
|
2768
|
-
text: /* @__PURE__ */
|
|
2664
|
+
text: /* @__PURE__ */ P("button", {
|
|
2769
2665
|
className: "picture-in-picture",
|
|
2770
2666
|
type: "button",
|
|
2771
|
-
onClick:
|
|
2772
|
-
disabled:
|
|
2773
|
-
"aria-label":
|
|
2774
|
-
"aria-pressed":
|
|
2775
|
-
children:
|
|
2776
|
-
src:
|
|
2667
|
+
onClick: f,
|
|
2668
|
+
disabled: D && !O,
|
|
2669
|
+
"aria-label": D ? "Put the subtitles in the video" : "Picture in picture",
|
|
2670
|
+
"aria-pressed": D ? m : void 0,
|
|
2671
|
+
children: D ? P(m ? ft : pt, {}) : /* @__PURE__ */ P("img", {
|
|
2672
|
+
src: ut,
|
|
2777
2673
|
alt: ""
|
|
2778
2674
|
})
|
|
2779
2675
|
}),
|
|
2780
|
-
toolTipText: /* @__PURE__ */
|
|
2676
|
+
toolTipText: /* @__PURE__ */ P("span", { children: D ? O ? m ? "Subtitles are in the picture" : "Put the subtitles in the picture" : "This file has no subtitles" : "Picture in picture" })
|
|
2781
2677
|
}) : null,
|
|
2782
|
-
/* @__PURE__ */
|
|
2678
|
+
/* @__PURE__ */ P($, {
|
|
2783
2679
|
id: "full-screen",
|
|
2784
2680
|
tooltipPlace: "top-end",
|
|
2785
|
-
text: /* @__PURE__ */
|
|
2681
|
+
text: /* @__PURE__ */ P("button", {
|
|
2786
2682
|
className: "full-screen",
|
|
2787
2683
|
type: "button",
|
|
2788
|
-
onClick:
|
|
2684
|
+
onClick: M,
|
|
2789
2685
|
"aria-label": "Full screen",
|
|
2790
|
-
"aria-pressed":
|
|
2791
|
-
children:
|
|
2686
|
+
"aria-pressed": l,
|
|
2687
|
+
children: P(l ? U : H, {})
|
|
2792
2688
|
}),
|
|
2793
|
-
toolTipText: /* @__PURE__ */
|
|
2689
|
+
toolTipText: /* @__PURE__ */ P("span", { children: l ? "Exit full screen (f)" : "Full screen (f)" })
|
|
2794
2690
|
})
|
|
2795
2691
|
]
|
|
2796
2692
|
})]
|
|
2797
2693
|
})]
|
|
2798
2694
|
});
|
|
2799
|
-
},
|
|
2695
|
+
}, Bt = 9e3, Vt = w`
|
|
2800
2696
|
position: absolute;
|
|
2801
2697
|
inset: 0;
|
|
2802
2698
|
z-index: 2;
|
|
@@ -2839,36 +2735,36 @@ ${jt}
|
|
|
2839
2735
|
line-height: 1;
|
|
2840
2736
|
color: #fff;
|
|
2841
2737
|
}
|
|
2842
|
-
`,
|
|
2843
|
-
let e = Y((e) => e.burnedInSubtitles), t = Y((e) => e.pictureInPictureMode), [n, r] =
|
|
2844
|
-
return
|
|
2738
|
+
`, Ht = () => {
|
|
2739
|
+
let e = Y((e) => e.burnedInSubtitles), t = Y((e) => e.pictureInPictureMode), [n, r] = S(!1);
|
|
2740
|
+
return y(() => {
|
|
2845
2741
|
if (t !== "burn-in" || !e) {
|
|
2846
2742
|
r(!1);
|
|
2847
2743
|
return;
|
|
2848
2744
|
}
|
|
2849
2745
|
r(!0);
|
|
2850
|
-
let n = setTimeout(() => r(!1),
|
|
2746
|
+
let n = setTimeout(() => r(!1), Bt);
|
|
2851
2747
|
return () => clearTimeout(n);
|
|
2852
|
-
}, [t, e]), t !== "burn-in" || !e ? null : /* @__PURE__ */
|
|
2853
|
-
css:
|
|
2748
|
+
}, [t, e]), t !== "burn-in" || !e ? null : /* @__PURE__ */ P("div", {
|
|
2749
|
+
css: Vt,
|
|
2854
2750
|
className: n ? "show" : "",
|
|
2855
2751
|
role: "status",
|
|
2856
|
-
children: /* @__PURE__ */
|
|
2752
|
+
children: /* @__PURE__ */ F("div", {
|
|
2857
2753
|
className: "card",
|
|
2858
|
-
children: [/* @__PURE__ */
|
|
2754
|
+
children: [/* @__PURE__ */ P("div", {
|
|
2859
2755
|
className: "text",
|
|
2860
2756
|
children: "Now click your browser's pop out button"
|
|
2861
|
-
}), /* @__PURE__ */
|
|
2757
|
+
}), /* @__PURE__ */ P("div", {
|
|
2862
2758
|
className: "arrow",
|
|
2863
2759
|
"aria-hidden": "true",
|
|
2864
2760
|
children: "→"
|
|
2865
2761
|
})]
|
|
2866
2762
|
})
|
|
2867
2763
|
});
|
|
2868
|
-
},
|
|
2764
|
+
}, Ut = 1, Wt = 6e3, Gt = 1, Kt = {
|
|
2869
2765
|
opening: "Skip Opening",
|
|
2870
2766
|
ending: "Skip Ending"
|
|
2871
|
-
},
|
|
2767
|
+
}, qt = w`
|
|
2872
2768
|
position: absolute;
|
|
2873
2769
|
inset: 0;
|
|
2874
2770
|
z-index: 2;
|
|
@@ -2919,10 +2815,10 @@ ${jt}
|
|
|
2919
2815
|
bottom: calc(9 * var(--mp-unit));
|
|
2920
2816
|
}
|
|
2921
2817
|
}
|
|
2922
|
-
`,
|
|
2923
|
-
let e = Y((e) => e.chapters), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.seekPreview), i = Y(), a =
|
|
2818
|
+
`, Jt = () => {
|
|
2819
|
+
let e = Y((e) => e.chapters), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.seekPreview), i = Y(), a = b(() => f(e), [e]), o = b(() => {
|
|
2924
2820
|
if (typeof t != "number") return;
|
|
2925
|
-
let n = e.findIndex((e, n) => a[n] !== void 0 && e.start -
|
|
2821
|
+
let n = e.findIndex((e, n) => a[n] !== void 0 && e.start - Ut <= t && t < e.end), r = n >= 0 ? a[n] : void 0;
|
|
2926
2822
|
return r ? {
|
|
2927
2823
|
kind: r,
|
|
2928
2824
|
end: e[n].end
|
|
@@ -2931,35 +2827,35 @@ ${jt}
|
|
|
2931
2827
|
e,
|
|
2932
2828
|
a,
|
|
2933
2829
|
t
|
|
2934
|
-
]), s =
|
|
2935
|
-
|
|
2830
|
+
]), s = x(0), [c, l] = S(0);
|
|
2831
|
+
y(() => {
|
|
2936
2832
|
let e = typeof t == "number" ? t : 0, n = s.current;
|
|
2937
|
-
s.current = e, e < n -
|
|
2833
|
+
s.current = e, e < n - Gt && l((e) => e + 1);
|
|
2938
2834
|
}, [t]);
|
|
2939
|
-
let [u, d] =
|
|
2940
|
-
return
|
|
2941
|
-
if (!
|
|
2835
|
+
let [u, d] = S(!1), p = o ? `${o.kind}@${o.end}` : "";
|
|
2836
|
+
return y(() => {
|
|
2837
|
+
if (!p) {
|
|
2942
2838
|
d(!1);
|
|
2943
2839
|
return;
|
|
2944
2840
|
}
|
|
2945
2841
|
d(!0);
|
|
2946
|
-
let e = setTimeout(() => d(!1),
|
|
2842
|
+
let e = setTimeout(() => d(!1), Wt);
|
|
2947
2843
|
return () => clearTimeout(e);
|
|
2948
|
-
}, [
|
|
2844
|
+
}, [p, c]), y(() => {
|
|
2949
2845
|
o || d(!1);
|
|
2950
|
-
}, [o]), o ? /* @__PURE__ */
|
|
2951
|
-
css:
|
|
2846
|
+
}, [o]), o ? /* @__PURE__ */ P("div", {
|
|
2847
|
+
css: qt,
|
|
2952
2848
|
className: u && !r ? "show" : "",
|
|
2953
|
-
children: /* @__PURE__ */
|
|
2849
|
+
children: /* @__PURE__ */ P("button", {
|
|
2954
2850
|
type: "button",
|
|
2955
2851
|
className: "skip-chapter",
|
|
2956
2852
|
onClick: () => {
|
|
2957
2853
|
d(!1), n ? n(o.end) : i.seek(o.end);
|
|
2958
2854
|
},
|
|
2959
|
-
children:
|
|
2855
|
+
children: Kt[o.kind]
|
|
2960
2856
|
})
|
|
2961
2857
|
}) : null;
|
|
2962
|
-
},
|
|
2858
|
+
}, Yt = 3e3, Xt = w`
|
|
2963
2859
|
position: absolute;
|
|
2964
2860
|
inset: 0;
|
|
2965
2861
|
z-index: 2;
|
|
@@ -2970,10 +2866,10 @@ ${jt}
|
|
|
2970
2866
|
hoverable while faded out, popping a tooltip over nothing. It cascades where pointer-events does
|
|
2971
2867
|
not, and transitioning it holds the item on screen for the length of the fade. */
|
|
2972
2868
|
transition: opacity 0.1s cubic-bezier(.4,0,1,1), visibility 0.1s;
|
|
2973
|
-
`,
|
|
2869
|
+
`, Zt = (e, t) => {
|
|
2974
2870
|
let n = e.left - t.left, r = e.top - t.top;
|
|
2975
2871
|
return `path(evenodd, 'M0 0H${t.width}V${t.height}H0Z M${n} ${r}H${n + e.width}V${r + e.height}H${n}Z')`;
|
|
2976
|
-
},
|
|
2872
|
+
}, Qt = w`
|
|
2977
2873
|
position: relative;
|
|
2978
2874
|
background-color: black;
|
|
2979
2875
|
display: flex;
|
|
@@ -3030,216 +2926,233 @@ ${jt}
|
|
|
3030
2926
|
&.hide {
|
|
3031
2927
|
cursor: none;
|
|
3032
2928
|
}
|
|
3033
|
-
`,
|
|
3034
|
-
let r = `${t}${
|
|
3035
|
-
return
|
|
2929
|
+
`, $t = (e, t = "") => p.toArray(e).flatMap((e, n) => {
|
|
2930
|
+
let r = `${t}${g(e) && e.key != null ? e.key : n}`;
|
|
2931
|
+
return g(e) && e.type === m ? $t(e.props.children, `${r}/`) : [{
|
|
3036
2932
|
key: r,
|
|
3037
2933
|
item: e
|
|
3038
2934
|
}];
|
|
3039
|
-
}),
|
|
3040
|
-
let
|
|
2935
|
+
}), en = ({ ref: e, onVideoRef: t, onSubtitleRef: n, overlay: r, controls: i, shortcuts: a, fullscreen: o, children: s }) => {
|
|
2936
|
+
let c = Y(), l = Y((e) => e.hideUI), u = Y((e) => e.setHideUI), d = Y((e) => e.hasMedia), f = Y((e) => e.passThroughPictureInPicture), p = x(void 0), m = x("mouse"), h = x({
|
|
3041
2937
|
x: -1,
|
|
3042
2938
|
y: -1
|
|
3043
|
-
}),
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
}, [
|
|
3047
|
-
let
|
|
3048
|
-
|
|
2939
|
+
}), g = x(!1), _ = x(null);
|
|
2940
|
+
y(() => () => clearTimeout(p.current), []), y(() => {
|
|
2941
|
+
d || (clearTimeout(p.current), u(!1));
|
|
2942
|
+
}, [d, u]);
|
|
2943
|
+
let v = () => {
|
|
2944
|
+
d && u(!0);
|
|
3049
2945
|
}, b = (t) => {
|
|
3050
|
-
|
|
3051
|
-
},
|
|
3052
|
-
if (
|
|
3053
|
-
if (
|
|
2946
|
+
_.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2947
|
+
}, S = () => {
|
|
2948
|
+
if (c.passThroughPictureInPicture?.armed) return !0;
|
|
2949
|
+
if (m.current !== "mouse") return !1;
|
|
3054
2950
|
let { x: e, y: t } = h.current;
|
|
3055
|
-
if (!
|
|
2951
|
+
if (!_.current || e < 0) return !1;
|
|
3056
2952
|
let n = document.elementFromPoint(e, t);
|
|
3057
|
-
return !n || !
|
|
3058
|
-
},
|
|
3059
|
-
if (
|
|
3060
|
-
|
|
2953
|
+
return !n || !_.current.contains(n) || n.closest(".video") ? !1 : !n.closest(".control-bar") || g.current || !!_.current.querySelector(".control-bar [aria-expanded=\"true\"]");
|
|
2954
|
+
}, C = () => {
|
|
2955
|
+
if (S()) {
|
|
2956
|
+
p.current = setTimeout(C, Yt);
|
|
3061
2957
|
return;
|
|
3062
2958
|
}
|
|
3063
|
-
|
|
3064
|
-
},
|
|
3065
|
-
|
|
3066
|
-
},
|
|
3067
|
-
|
|
2959
|
+
v();
|
|
2960
|
+
}, w = () => {
|
|
2961
|
+
u(!1), clearTimeout(p.current), p.current = setTimeout(C, Yt);
|
|
2962
|
+
}, T = (e) => {
|
|
2963
|
+
m.current = e.pointerType, e.pointerType === "mouse" && (h.current = {
|
|
3068
2964
|
x: e.clientX,
|
|
3069
2965
|
y: e.clientY
|
|
3070
|
-
},
|
|
3071
|
-
},
|
|
3072
|
-
|
|
3073
|
-
},
|
|
3074
|
-
|
|
3075
|
-
},
|
|
3076
|
-
return /* @__PURE__ */
|
|
3077
|
-
css:
|
|
2966
|
+
}, w());
|
|
2967
|
+
}, E = (e) => {
|
|
2968
|
+
m.current = e.pointerType, g.current = !0;
|
|
2969
|
+
}, D = () => {
|
|
2970
|
+
g.current = !1;
|
|
2971
|
+
}, O = x(!0);
|
|
2972
|
+
return /* @__PURE__ */ F("div", {
|
|
2973
|
+
css: Qt,
|
|
3078
2974
|
ref: b,
|
|
3079
|
-
onPointerMove:
|
|
3080
|
-
onPointerDown:
|
|
3081
|
-
onPointerUp:
|
|
3082
|
-
onPointerCancel:
|
|
2975
|
+
onPointerMove: T,
|
|
2976
|
+
onPointerDown: E,
|
|
2977
|
+
onPointerUp: D,
|
|
2978
|
+
onPointerCancel: D,
|
|
3083
2979
|
onMouseOut: (e) => {
|
|
3084
2980
|
let t = e.relatedTarget;
|
|
3085
2981
|
if (t && e.currentTarget.contains(t)) return;
|
|
3086
2982
|
let { left: n, right: r, top: i, bottom: a } = e.currentTarget.getBoundingClientRect();
|
|
3087
|
-
e.clientX >= n && e.clientX < r && e.clientY >= i && e.clientY < a || (clearTimeout(
|
|
2983
|
+
e.clientX >= n && e.clientX < r && e.clientY >= i && e.clientY < a || (clearTimeout(p.current), v());
|
|
3088
2984
|
},
|
|
3089
|
-
className:
|
|
2985
|
+
className: l ? "hide" : "",
|
|
3090
2986
|
tabIndex: a === "player" ? -1 : void 0,
|
|
3091
2987
|
children: [
|
|
3092
|
-
/* @__PURE__ */
|
|
3093
|
-
|
|
3094
|
-
css:
|
|
3095
|
-
style: { ...
|
|
2988
|
+
/* @__PURE__ */ P(Je, { onSubtitleRef: n }),
|
|
2989
|
+
$t(r).map(({ key: e, item: t }) => /* @__PURE__ */ P("div", {
|
|
2990
|
+
css: Xt,
|
|
2991
|
+
style: { ...l ? {
|
|
3096
2992
|
opacity: "0",
|
|
3097
2993
|
visibility: "hidden",
|
|
3098
2994
|
pointerEvents: "none"
|
|
3099
2995
|
} : {} },
|
|
3100
2996
|
children: t
|
|
3101
2997
|
}, e)),
|
|
3102
|
-
i === !1 ? null : /* @__PURE__ */
|
|
3103
|
-
|
|
3104
|
-
|
|
2998
|
+
i === !1 ? null : /* @__PURE__ */ P(at, {
|
|
2999
|
+
value: !!o,
|
|
3000
|
+
children: /* @__PURE__ */ P(zt, {
|
|
3001
|
+
shortcuts: a,
|
|
3002
|
+
root: _,
|
|
3003
|
+
fullscreen: o
|
|
3004
|
+
})
|
|
3105
3005
|
}),
|
|
3106
|
-
/* @__PURE__ */
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
|
|
3006
|
+
/* @__PURE__ */ P(Ht, {}),
|
|
3007
|
+
/* @__PURE__ */ P(Jt, {}),
|
|
3008
|
+
f?.armed && _.current ? /* @__PURE__ */ P("div", {
|
|
3109
3009
|
className: "pass-through",
|
|
3110
|
-
style: { clipPath:
|
|
3111
|
-
onPointerOver:
|
|
3010
|
+
style: { clipPath: Zt(f.armed, _.current.getBoundingClientRect()) },
|
|
3011
|
+
onPointerOver: f.disarm
|
|
3112
3012
|
}) : null,
|
|
3113
|
-
/* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ F("div", {
|
|
3114
3014
|
className: "video",
|
|
3115
3015
|
onClick: (e) => {
|
|
3116
|
-
if (
|
|
3016
|
+
if (m.current === "mouse") {
|
|
3117
3017
|
if (e.detail > 1) return;
|
|
3118
|
-
|
|
3018
|
+
O.current = c.paused, c.togglePaused();
|
|
3119
3019
|
return;
|
|
3120
3020
|
}
|
|
3121
|
-
|
|
3021
|
+
l ? w() : (clearTimeout(p.current), v());
|
|
3122
3022
|
},
|
|
3123
3023
|
onDoubleClick: () => {
|
|
3124
|
-
|
|
3024
|
+
m.current === "mouse" && (O.current ? c.pause() : c.play().catch(() => {}), o ? o.request() : c.toggleFullscreen());
|
|
3125
3025
|
},
|
|
3126
|
-
children: [t ? /* @__PURE__ */
|
|
3026
|
+
children: [t ? /* @__PURE__ */ P("video", {
|
|
3127
3027
|
ref: t,
|
|
3128
3028
|
playsInline: !0
|
|
3129
|
-
}) : null,
|
|
3029
|
+
}) : null, s]
|
|
3130
3030
|
})
|
|
3131
3031
|
]
|
|
3132
3032
|
});
|
|
3133
|
-
},
|
|
3134
|
-
let n = "media" in e ? e : null, r = n ? null : e, { title: i, chapters: a } = e, { size: o, downloadedRanges: s, publicPath: l, libavWorkerUrl: u, read: d, thumbnailRead: f, thumbnailsEnabled: p, readsDownload:
|
|
3135
|
-
|
|
3136
|
-
let { expose:
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3033
|
+
}, tn = (e, t) => ({ title: e.options.find((e) => e.id === t)?.label }), nn = (e, t) => e instanceof Promise ? e.then(t) : t(), rn = ({ options: e, children: t }) => {
|
|
3034
|
+
let n = "media" in e ? e : null, r = n ? null : e, { title: i, chapters: a } = e, { size: o, downloadedRanges: s, publicPath: l, libavWorkerUrl: u, read: d, thumbnailRead: f, thumbnailsEnabled: p, readsDownload: m } = r ?? {}, h = O(), g = D(), [_, v] = S(null), [C, w] = S(null), T = n?.media ?? _;
|
|
3035
|
+
y(() => (h?.(T), () => h?.(null)), [T, h]), be(T, n?.stepFrame);
|
|
3036
|
+
let { expose: E } = e, [k, A] = S(null), [j] = S(() => Object.assign(new EventTarget(), {
|
|
3037
|
+
chapters: [],
|
|
3038
|
+
onHostFullscreen: A
|
|
3039
|
+
})), M = E === !0 ? {} : E || void 0, N = x(M);
|
|
3040
|
+
N.current = M;
|
|
3041
|
+
let F = M ? M.id : void 0, I = M ? M.origin : void 0, L = M ? M.channel : void 0;
|
|
3042
|
+
y(() => {
|
|
3043
|
+
if (!E || !T) return;
|
|
3141
3044
|
let e, t = !1;
|
|
3142
3045
|
return import("./remote/index.js").then(({ exposePlayer: n }) => {
|
|
3143
|
-
t || (e = n(
|
|
3046
|
+
t || (e = n(T, {
|
|
3047
|
+
...N.current,
|
|
3048
|
+
player: j
|
|
3049
|
+
}));
|
|
3144
3050
|
}).catch(() => {}), () => {
|
|
3145
3051
|
t = !0, e?.();
|
|
3146
3052
|
};
|
|
3147
3053
|
}, [
|
|
3148
|
-
|
|
3149
|
-
!!
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3054
|
+
T,
|
|
3055
|
+
!!E,
|
|
3056
|
+
F,
|
|
3057
|
+
I,
|
|
3058
|
+
L
|
|
3153
3059
|
]);
|
|
3154
|
-
let
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3060
|
+
let R = Y((e) => e.chapters), z = JSON.stringify(R);
|
|
3061
|
+
y(() => {
|
|
3062
|
+
j.chapters = R, j.dispatchEvent(new Event("chapterschange"));
|
|
3063
|
+
}, [z]);
|
|
3064
|
+
let B = e.fullscreen ?? (k === null ? void 0 : {
|
|
3065
|
+
active: k,
|
|
3066
|
+
request: () => j.dispatchEvent(new Event("fullscreenrequest"))
|
|
3067
|
+
}), V = b(() => Ve(), [o]);
|
|
3068
|
+
ge(_, C, r, m ? V.push : void 0);
|
|
3069
|
+
let H = r?.normalizeVolume ?? !0, [U, W] = S(H);
|
|
3070
|
+
y(() => {
|
|
3071
|
+
W(H);
|
|
3072
|
+
}, [H]);
|
|
3073
|
+
let ee = x(r?.onNormalizeVolumeChange);
|
|
3074
|
+
ee.current = r?.onNormalizeVolumeChange;
|
|
3075
|
+
let G = r?.normalizerWorkletUrl, te = x(f ?? d);
|
|
3076
|
+
te.current = f ?? d;
|
|
3077
|
+
let K = Y((e) => e.selectedAudioTrack), q = !!d, { refused: J } = Be(_, G, U, b(() => q && o && l && u && typeof K == "number" && K >= 0 ? m ? {
|
|
3078
|
+
tap: V,
|
|
3079
|
+
audioStreamIndex: K
|
|
3167
3080
|
} : {
|
|
3168
|
-
read: (e, t) =>
|
|
3081
|
+
read: (e, t) => te.current(e, t),
|
|
3169
3082
|
length: o,
|
|
3170
3083
|
publicPath: l,
|
|
3171
3084
|
libavWorkerUrl: u,
|
|
3172
|
-
audioStreamIndex:
|
|
3085
|
+
audioStreamIndex: K
|
|
3173
3086
|
} : void 0, [
|
|
3174
|
-
|
|
3087
|
+
q,
|
|
3175
3088
|
o,
|
|
3176
3089
|
l,
|
|
3177
3090
|
u,
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
]),
|
|
3182
|
-
enabled:
|
|
3183
|
-
available: !
|
|
3091
|
+
K,
|
|
3092
|
+
m,
|
|
3093
|
+
V
|
|
3094
|
+
]), b(() => s?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [s?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")])), ne = b(() => G && typeof AudioWorkletNode == "function" ? {
|
|
3095
|
+
enabled: U,
|
|
3096
|
+
available: !J,
|
|
3184
3097
|
setEnabled: (e) => {
|
|
3185
|
-
|
|
3098
|
+
W(e), ee.current?.(e);
|
|
3186
3099
|
}
|
|
3187
3100
|
} : null, [
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
]), { thumbnails:
|
|
3101
|
+
G,
|
|
3102
|
+
U,
|
|
3103
|
+
J
|
|
3104
|
+
]), { thumbnails: re, requestThumbnail: ie } = Ce({
|
|
3192
3105
|
publicPath: l,
|
|
3193
3106
|
workerUrl: u,
|
|
3194
3107
|
length: p === !1 ? void 0 : o,
|
|
3195
3108
|
read: f ?? d,
|
|
3196
3109
|
downloadedRanges: s
|
|
3197
|
-
}),
|
|
3198
|
-
|
|
3110
|
+
}), ae = n?.thumbnails?.all ?? re, { toggle: oe, mode: se, burnedIn: ce } = we(_, C), le = Ae(n?.media ?? null, n?.pictureInPicture), X = Y((e) => e.setSourceState), ue = n ? !!n.media : o !== void 0;
|
|
3111
|
+
y(() => {
|
|
3199
3112
|
X({
|
|
3200
3113
|
title: i,
|
|
3201
3114
|
size: o,
|
|
3202
3115
|
downloadedRanges: s,
|
|
3203
|
-
hasMedia:
|
|
3116
|
+
hasMedia: ue
|
|
3204
3117
|
});
|
|
3205
3118
|
}, [
|
|
3206
3119
|
X,
|
|
3207
3120
|
i,
|
|
3208
3121
|
o,
|
|
3209
3122
|
s,
|
|
3210
|
-
|
|
3123
|
+
ue
|
|
3211
3124
|
]);
|
|
3212
|
-
let
|
|
3213
|
-
|
|
3125
|
+
let de = n?.thumbnails?.at;
|
|
3126
|
+
y(() => {
|
|
3214
3127
|
X({
|
|
3215
|
-
thumbnails:
|
|
3216
|
-
thumbnailAt:
|
|
3217
|
-
requestThumbnail:
|
|
3218
|
-
togglePictureInPicture:
|
|
3219
|
-
pictureInPictureMode:
|
|
3220
|
-
burnedInSubtitles:
|
|
3128
|
+
thumbnails: ae,
|
|
3129
|
+
thumbnailAt: de,
|
|
3130
|
+
requestThumbnail: ie,
|
|
3131
|
+
togglePictureInPicture: oe,
|
|
3132
|
+
pictureInPictureMode: se,
|
|
3133
|
+
burnedInSubtitles: ce
|
|
3221
3134
|
});
|
|
3222
3135
|
}, [
|
|
3223
3136
|
X,
|
|
3224
|
-
q,
|
|
3225
3137
|
ae,
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3138
|
+
de,
|
|
3139
|
+
ie,
|
|
3140
|
+
oe,
|
|
3141
|
+
se,
|
|
3142
|
+
ce
|
|
3143
|
+
]), y(() => {
|
|
3144
|
+
X({ volumeNormalizer: ne });
|
|
3145
|
+
}, [X, ne]), y(() => {
|
|
3146
|
+
X({ passThroughPictureInPicture: le });
|
|
3147
|
+
}, [X, le]);
|
|
3148
|
+
let Z = n?.subtitles?.selection, fe = n?.audioTracks?.selection, pe = x({
|
|
3236
3149
|
audio: e.onPreferredAudioLanguageChange,
|
|
3237
3150
|
subtitles: e.onPreferredSubtitleLanguageChange
|
|
3238
3151
|
});
|
|
3239
|
-
|
|
3152
|
+
pe.current = {
|
|
3240
3153
|
audio: e.onPreferredAudioLanguageChange,
|
|
3241
3154
|
subtitles: e.onPreferredSubtitleLanguageChange
|
|
3242
|
-
},
|
|
3155
|
+
}, y(() => {
|
|
3243
3156
|
Z && X({
|
|
3244
3157
|
subtitleTracks: Z.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3245
3158
|
id: e,
|
|
@@ -3248,43 +3161,44 @@ ${jt}
|
|
|
3248
3161
|
})),
|
|
3249
3162
|
selectedSubtitleTrack: Z.selectedId ?? void 0,
|
|
3250
3163
|
selectSubtitleTrack: (e) => {
|
|
3251
|
-
let t = e == null ? null : String(e), n = t === null ? void 0 :
|
|
3252
|
-
return
|
|
3164
|
+
let t = e == null ? null : String(e), n = t === null ? void 0 : tn(Z, t), r = Z.selectedId === null;
|
|
3165
|
+
return nn(Z.select(t), () => {
|
|
3253
3166
|
let e = t === null ? null : c(n) ?? (r ? n?.title : void 0);
|
|
3254
|
-
e !== void 0 &&
|
|
3167
|
+
e !== void 0 && pe.current.subtitles?.(e);
|
|
3255
3168
|
});
|
|
3256
3169
|
},
|
|
3257
3170
|
subtitleOffLabel: Z.offLabel
|
|
3258
3171
|
});
|
|
3259
|
-
}, [X, Z]),
|
|
3260
|
-
|
|
3261
|
-
audioTracks:
|
|
3172
|
+
}, [X, Z]), y(() => {
|
|
3173
|
+
fe && X({
|
|
3174
|
+
audioTracks: fe.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3262
3175
|
id: e,
|
|
3263
3176
|
label: t,
|
|
3264
3177
|
disabled: n
|
|
3265
3178
|
})),
|
|
3266
|
-
selectedAudioTrack:
|
|
3267
|
-
selectAudioTrack: (e) =>
|
|
3268
|
-
let t = c(
|
|
3269
|
-
t !== void 0 &&
|
|
3179
|
+
selectedAudioTrack: fe.selectedId ?? void 0,
|
|
3180
|
+
selectAudioTrack: (e) => nn(fe.select(String(e)), () => {
|
|
3181
|
+
let t = c(tn(fe, String(e)));
|
|
3182
|
+
t !== void 0 && pe.current.audio?.(t);
|
|
3270
3183
|
})
|
|
3271
3184
|
});
|
|
3272
|
-
}, [X,
|
|
3273
|
-
let
|
|
3274
|
-
return
|
|
3275
|
-
X({ quality:
|
|
3276
|
-
}, [X,
|
|
3185
|
+
}, [X, fe]);
|
|
3186
|
+
let me = n?.quality?.selection ?? null;
|
|
3187
|
+
return y(() => {
|
|
3188
|
+
X({ quality: me });
|
|
3189
|
+
}, [X, me]), y(() => {
|
|
3277
3190
|
a && X({ chapters: a });
|
|
3278
|
-
}, [X, a]), /* @__PURE__ */
|
|
3279
|
-
ref:
|
|
3280
|
-
onVideoRef: n ? void 0 :
|
|
3281
|
-
onSubtitleRef:
|
|
3191
|
+
}, [X, a]), /* @__PURE__ */ P(en, {
|
|
3192
|
+
ref: g,
|
|
3193
|
+
onVideoRef: n ? void 0 : v,
|
|
3194
|
+
onSubtitleRef: w,
|
|
3282
3195
|
overlay: e.overlay,
|
|
3283
3196
|
controls: e.controls,
|
|
3284
3197
|
shortcuts: e.shortcuts,
|
|
3198
|
+
fullscreen: B,
|
|
3285
3199
|
children: t
|
|
3286
3200
|
});
|
|
3287
|
-
},
|
|
3201
|
+
}, an = w`
|
|
3288
3202
|
/**
|
|
3289
3203
|
* The chrome's whole scale, in one place.
|
|
3290
3204
|
*
|
|
@@ -3354,17 +3268,17 @@ ${jt}
|
|
|
3354
3268
|
height: 100%;
|
|
3355
3269
|
width: 100%;
|
|
3356
3270
|
overflow: hidden;
|
|
3357
|
-
`,
|
|
3358
|
-
css:
|
|
3359
|
-
children: /* @__PURE__ */
|
|
3271
|
+
`, on = (e) => /* @__PURE__ */ P("div", {
|
|
3272
|
+
css: an,
|
|
3273
|
+
children: /* @__PURE__ */ P(oe.Provider, { children: /* @__PURE__ */ P(rn, {
|
|
3360
3274
|
options: e,
|
|
3361
3275
|
children: e.children
|
|
3362
3276
|
}) })
|
|
3363
|
-
}),
|
|
3277
|
+
}), sn = (e) => !!e && typeof e == "object" && "at" in e, cn = (e) => !!e && typeof e == "object" && "selection" in e, ln = ({ blob: e, name: t }) => ({
|
|
3364
3278
|
length: e.size,
|
|
3365
3279
|
name: t ?? (e instanceof File ? e.name : void 0),
|
|
3366
3280
|
read: (t, n) => e.slice(t, t + n).arrayBuffer()
|
|
3367
|
-
}),
|
|
3281
|
+
}), un = async (e, t) => {
|
|
3368
3282
|
let n = await fetch(e, {
|
|
3369
3283
|
headers: { Range: "bytes=0-1" },
|
|
3370
3284
|
credentials: t
|
|
@@ -3374,8 +3288,8 @@ ${jt}
|
|
|
3374
3288
|
if (!Number.isFinite(i) || i <= 0) throw Error("The source did not report its length");
|
|
3375
3289
|
if (!r && n.status !== 206) throw Error("The source does not support range requests");
|
|
3376
3290
|
return i;
|
|
3377
|
-
},
|
|
3378
|
-
let i = t ?? await
|
|
3291
|
+
}, dn = async ({ url: e, length: t, name: n, credentials: r }) => {
|
|
3292
|
+
let i = t ?? await un(e, r);
|
|
3379
3293
|
return {
|
|
3380
3294
|
length: i,
|
|
3381
3295
|
name: n,
|
|
@@ -3391,9 +3305,9 @@ ${jt}
|
|
|
3391
3305
|
},
|
|
3392
3306
|
readsDownload: !0
|
|
3393
3307
|
};
|
|
3394
|
-
},
|
|
3395
|
-
if ("blob" in e) return
|
|
3396
|
-
if ("url" in e) return
|
|
3308
|
+
}, fn = async (e) => {
|
|
3309
|
+
if ("blob" in e) return ln(e);
|
|
3310
|
+
if ("url" in e) return dn(e);
|
|
3397
3311
|
if ("read" in e) return {
|
|
3398
3312
|
length: e.length,
|
|
3399
3313
|
name: e.name,
|
|
@@ -3402,4 +3316,4 @@ ${jt}
|
|
|
3402
3316
|
throw Error(`Unknown source type: ${e}`);
|
|
3403
3317
|
};
|
|
3404
3318
|
//#endregion
|
|
3405
|
-
export {
|
|
3319
|
+
export { on as MediaPlayer, on as default, oe as Player, t as SUBTITLES_OFF, o as createPictureInPicture, s as createSubtitleRenderer, i as createThumbnailGenerator, fn as inputToRemuxerInput, cn as isDelegatedTracks, sn as isExternalThumbnails, ae as sourceFeature, a as startPlayback, we as usePictureInPicture, Y as usePlayer, Ce as useSeekThumbnails };
|