@banou/media-player 0.10.30 → 0.10.31
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 +20 -0
- package/dist/de-DphEdq0O.js +52 -0
- package/dist/engine/index.js +1 -1
- package/dist/{engine-DeEY2qao.js → engine-5XbZqrD3.js} +213 -162
- package/dist/es-419-D6gsvnn8.js +52 -0
- package/dist/fr-BqAzAJX0.js +52 -0
- package/dist/index.js +931 -844
- package/dist/it-NTcUh3Gr.js +52 -0
- package/dist/ja-DSmX_bxj.js +52 -0
- package/dist/ko-DyPzWasj.js +52 -0
- package/dist/labels.d.ts +71 -0
- package/dist/pl-C6Ow4ra5.js +52 -0
- package/dist/pt-BR-wudK3giz.js +52 -0
- package/dist/react/labels.d.ts +28 -0
- package/dist/react/video-player.d.ts +9 -0
- package/dist/ru-D5kxBkik.js +52 -0
- package/dist/tr-CW7R7N9k.js +52 -0
- package/dist/utils/track-label.d.ts +9 -8
- package/dist/zh-Hans-IhL1Pl78.js +52 -0
- package/dist/zh-Hant-C5YyFjEc.js +52 -0
- package/package.json +3 -1
- package/src/lib/engine/playback.ts +6 -5
- package/src/lib/engine/source-buffer.ts +3 -1
- package/src/lib/labels.ts +75 -0
- package/src/lib/locales/de.json +49 -0
- package/src/lib/locales/es-419.json +49 -0
- package/src/lib/locales/fr.json +49 -0
- package/src/lib/locales/it.json +49 -0
- package/src/lib/locales/ja.json +49 -0
- package/src/lib/locales/ko.json +49 -0
- package/src/lib/locales/pl.json +49 -0
- package/src/lib/locales/pt-BR.json +49 -0
- package/src/lib/locales/ru.json +49 -0
- package/src/lib/locales/tr.json +49 -0
- package/src/lib/locales/zh-Hans.json +49 -0
- package/src/lib/locales/zh-Hant.json +49 -0
- package/src/lib/react/components/burn-in-hint.tsx +4 -1
- package/src/lib/react/components/chrome.tsx +9 -0
- package/src/lib/react/components/control-bar.tsx +15 -26
- package/src/lib/react/components/errors.tsx +11 -9
- package/src/lib/react/components/overlay.tsx +18 -5
- package/src/lib/react/components/playback-slider.tsx +4 -1
- package/src/lib/react/components/settings.tsx +23 -31
- package/src/lib/react/components/skip-chapter.tsx +5 -2
- package/src/lib/react/components/sound.tsx +5 -2
- package/src/lib/react/components/subtitles.tsx +7 -4
- package/src/lib/react/components/track-menu.tsx +8 -4
- package/src/lib/react/components/volume-slider.tsx +3 -1
- package/src/lib/react/hooks/use-playback.ts +12 -2
- package/src/lib/react/labels.tsx +125 -0
- package/src/lib/react/video-player.tsx +14 -1
- package/src/lib/utils/track-label.ts +16 -11
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { c as e, l as t, n,
|
|
2
|
-
import { languageOf as
|
|
3
|
-
import { n as
|
|
4
|
-
import { Children as
|
|
5
|
-
import { css as
|
|
6
|
-
import { createPlayer as
|
|
7
|
-
import { definePlayerFeature as
|
|
8
|
-
import { makeRemuxer as
|
|
9
|
-
import { createMediaElementSource as M } from "@banou/ponyfill/web-audio";
|
|
1
|
+
import { c as e, l as t, m as n, n as r, o as i, p as a, r as o, s, t as c, u as l } from "./engine-5XbZqrD3.js";
|
|
2
|
+
import { languageOf as u, preferredTrack as d } from "./language/index.js";
|
|
3
|
+
import { n as f, r as p, t as m } from "./chapters-EBYXcEml.js";
|
|
4
|
+
import { Children as h, Fragment as g, createContext as _, isValidElement as v, useCallback as y, useContext as b, useEffect as x, useMemo as S, useRef as C, useState as w, useSyncExternalStore as T } from "react";
|
|
5
|
+
import { css as E, keyframes as D } from "@emotion/react";
|
|
6
|
+
import { createPlayer as O, useContainerAttach as k, useMediaAttach as ee } from "@videojs/react";
|
|
7
|
+
import { definePlayerFeature as A, videoFeatures as j } from "@videojs/core/dom";
|
|
8
|
+
import { makeRemuxer as M } from "libav-wasm";
|
|
10
9
|
import { Fragment as N, jsx as P, jsxs as F } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
10
|
+
import { createMediaElementSource as I } from "@banou/ponyfill/web-audio";
|
|
11
|
+
import { Captions as L, CaptionsOff as R, Check as z, ChevronLeft as B, ChevronRight as V, Copy as te, Maximize as H, Minimize as ne, Pause as U, Play as W, RotateCcw as G, Settings as K, TriangleAlert as q, Volume1 as re, Volume2 as ie, VolumeX as ae } from "lucide-react";
|
|
12
|
+
import { Tooltip as oe } from "react-tooltip";
|
|
13
13
|
//#region src/lib/react/source-feature.ts
|
|
14
|
-
var
|
|
14
|
+
var se = {
|
|
15
15
|
indexes: [],
|
|
16
16
|
chapters: [],
|
|
17
17
|
thumbnails: [],
|
|
@@ -36,161 +36,240 @@ var ie = {
|
|
|
36
36
|
playbackErrors: [],
|
|
37
37
|
ready: !1,
|
|
38
38
|
setSourceState: () => {}
|
|
39
|
-
},
|
|
39
|
+
}, ce = A({
|
|
40
40
|
name: "source",
|
|
41
|
-
state: () => ({ ...
|
|
41
|
+
state: () => ({ ...se }),
|
|
42
42
|
attach({ set: e }) {
|
|
43
43
|
e({
|
|
44
44
|
setSourceState: (t) => e(t),
|
|
45
45
|
setHideUI: (t) => e({ hideUI: t })
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
}),
|
|
49
|
-
features: [...
|
|
48
|
+
}), le = O({
|
|
49
|
+
features: [...j, ce],
|
|
50
50
|
displayName: "MediaPlayer"
|
|
51
|
-
}),
|
|
51
|
+
}), J = le.usePlayer, ue = {
|
|
52
|
+
de: () => import("./de-DphEdq0O.js"),
|
|
53
|
+
"es-419": () => import("./es-419-D6gsvnn8.js"),
|
|
54
|
+
fr: () => import("./fr-BqAzAJX0.js"),
|
|
55
|
+
it: () => import("./it-NTcUh3Gr.js"),
|
|
56
|
+
ja: () => import("./ja-DSmX_bxj.js"),
|
|
57
|
+
ko: () => import("./ko-DyPzWasj.js"),
|
|
58
|
+
pl: () => import("./pl-C6Ow4ra5.js"),
|
|
59
|
+
"pt-BR": () => import("./pt-BR-wudK3giz.js"),
|
|
60
|
+
ru: () => import("./ru-D5kxBkik.js"),
|
|
61
|
+
tr: () => import("./tr-CW7R7N9k.js"),
|
|
62
|
+
"zh-Hans": () => import("./zh-Hans-IhL1Pl78.js"),
|
|
63
|
+
"zh-Hant": () => import("./zh-Hant-C5YyFjEc.js")
|
|
64
|
+
}, Y = Object.keys(ue), de = (e) => {
|
|
65
|
+
try {
|
|
66
|
+
let t = new Intl.Locale(e), { language: n, script: r } = t.maximize();
|
|
67
|
+
return {
|
|
68
|
+
tag: t.baseName,
|
|
69
|
+
language: n,
|
|
70
|
+
script: r
|
|
71
|
+
};
|
|
72
|
+
} catch {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}, fe = (e) => {
|
|
76
|
+
let t = de(e);
|
|
77
|
+
if (!t) return;
|
|
78
|
+
let n = Y.map((e) => ({
|
|
79
|
+
...de(e),
|
|
80
|
+
catalogue: e
|
|
81
|
+
}));
|
|
82
|
+
return (n.find(({ tag: e }) => e === t.tag) ?? n.find(({ language: e, script: n }) => e === t.language && n === t.script) ?? n.find(({ language: e }) => e === t.language))?.catalogue;
|
|
83
|
+
}, X = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Map(), pe = (e, t) => {
|
|
84
|
+
let n = Z.get(e);
|
|
85
|
+
return n || (n = Promise.all([import("@formatjs/intl"), ue[t]()]).then(([{ createIntl: t }, { default: n }]) => {
|
|
86
|
+
let r = t({
|
|
87
|
+
locale: e,
|
|
88
|
+
defaultLocale: "en",
|
|
89
|
+
messages: n
|
|
90
|
+
});
|
|
91
|
+
return X.set(e, r), r;
|
|
92
|
+
}), n.catch(() => Z.delete(e)), Z.set(e, n)), n;
|
|
93
|
+
}, me = (e) => {
|
|
94
|
+
try {
|
|
95
|
+
return Intl.getCanonicalLocales(e)[0];
|
|
96
|
+
} catch {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
}, he = (e, t) => {
|
|
100
|
+
let r = t ? me(t) ?? "en" : void 0;
|
|
101
|
+
return {
|
|
102
|
+
format: (t, ...[r]) => e ? e.formatMessage({
|
|
103
|
+
id: t,
|
|
104
|
+
defaultMessage: t
|
|
105
|
+
}, r) : n(t, r),
|
|
106
|
+
number: (e, t) => new Intl.NumberFormat(r ?? "en", t).format(e),
|
|
107
|
+
locale: r
|
|
108
|
+
};
|
|
109
|
+
}, ge = he(void 0, void 0), _e = _(ge), Q = () => b(_e), ve = ({ language: e, children: t }) => {
|
|
110
|
+
let n = e ? fe(e) : void 0, [, r] = w();
|
|
111
|
+
x(() => {
|
|
112
|
+
if (!e || !n || X.has(e)) return;
|
|
113
|
+
let t = !1;
|
|
114
|
+
return pe(e, n).then((e) => {
|
|
115
|
+
t || r(e);
|
|
116
|
+
}, () => {}), () => {
|
|
117
|
+
t = !0;
|
|
118
|
+
};
|
|
119
|
+
}, [e, n]);
|
|
120
|
+
let i = e && n ? X.get(e) : void 0, a = S(() => e ? he(i, e) : ge, [i, e]);
|
|
121
|
+
return /* @__PURE__ */ P(_e.Provider, {
|
|
122
|
+
value: a,
|
|
123
|
+
children: t
|
|
124
|
+
});
|
|
125
|
+
}, ye = (e, t) => {
|
|
52
126
|
if (e && e !== "und") try {
|
|
53
|
-
return new Intl.DisplayNames([navigator.language || "en"], {
|
|
127
|
+
return new Intl.DisplayNames([t ?? (navigator.language || "en")], {
|
|
54
128
|
type: "language",
|
|
55
129
|
fallback: "none"
|
|
56
130
|
}).of(e) || void 0;
|
|
57
131
|
} catch {
|
|
58
132
|
return;
|
|
59
133
|
}
|
|
60
|
-
},
|
|
61
|
-
let t = e.map((e) =>
|
|
134
|
+
}, be = (e) => e?.replace(/_/g, " ").trim() || void 0, xe = (e, t) => {
|
|
135
|
+
let r = (e) => t ? t.format(a.track, { number: e }) : n(a.track, { number: e }), i = e.map((e) => ye(e.language, t?.locale) ?? be(e.title) ?? r(e.streamIndex)), o = i.reduce((e, t) => ({
|
|
62
136
|
...e,
|
|
63
137
|
[t]: (e[t] ?? 0) + 1
|
|
64
138
|
}), {});
|
|
65
|
-
return e.map((e,
|
|
66
|
-
let
|
|
139
|
+
return e.map((e, t) => {
|
|
140
|
+
let n = i[t], r = be(e.title);
|
|
67
141
|
return {
|
|
68
142
|
track: e,
|
|
69
|
-
label: (n
|
|
143
|
+
label: (o[n] ?? 0) > 1 && r && r !== n ? `${n} (${r})` : n
|
|
70
144
|
};
|
|
71
145
|
});
|
|
72
|
-
},
|
|
146
|
+
}, Se = (e, t) => xe(e, t).map(({ track: e, label: t }) => ({
|
|
73
147
|
id: e.streamIndex,
|
|
74
148
|
label: t
|
|
75
|
-
})),
|
|
149
|
+
})), Ce = [
|
|
76
150
|
0,
|
|
77
151
|
250,
|
|
78
152
|
1e3,
|
|
79
153
|
3e3,
|
|
80
154
|
1e4
|
|
81
|
-
],
|
|
155
|
+
], we = 6e4, Te = 500, Ee = 15e3, De = (e, t) => {
|
|
82
156
|
if (e === null) return;
|
|
83
|
-
let n = e === void 0 ? 0 :
|
|
157
|
+
let n = e === void 0 ? 0 : d(e, t);
|
|
84
158
|
return t[Math.max(n, 0)]?.streamIndex;
|
|
85
|
-
},
|
|
159
|
+
}, Oe = (e) => e instanceof Error ? e.message : String(e), ke = (e) => {
|
|
86
160
|
let t = [], n = e?.cause;
|
|
87
161
|
for (let e = 0; n != null && e < 8; e++) {
|
|
88
162
|
if (typeof MediaError < "u" && n instanceof MediaError) {
|
|
89
163
|
t.push(`MediaError code ${n.code}${n.message ? `: ${n.message}` : ""}`);
|
|
90
164
|
break;
|
|
91
165
|
}
|
|
92
|
-
t.push(
|
|
166
|
+
t.push(Oe(n)), n = n?.cause;
|
|
93
167
|
}
|
|
94
168
|
return t.length ? t.join("\n") : void 0;
|
|
95
|
-
},
|
|
96
|
-
let
|
|
97
|
-
E.current =
|
|
98
|
-
let [D, O] =
|
|
169
|
+
}, Ae = (e, t, n, r) => {
|
|
170
|
+
let a = J(), { read: o, size: c, publicPath: l = "", libavWorkerUrl: f = "", jassubWorkerUrl: p = "", jassubWasmUrl: m = "", jassubLegacyWasmUrl: h, defaultFontUrl: g, cjkFontUrl: _, bufferSize: v, autoplay: b = !1, chapters: S, seekPrepareBudgetMs: T = Te } = n ?? {}, E = C(S);
|
|
171
|
+
E.current = S;
|
|
172
|
+
let [D, O] = w(), k = D && D.size === c ? D.streamIndex : void 0, [ee, A] = w(0), j = C({
|
|
99
173
|
count: 0,
|
|
100
174
|
at: 0
|
|
101
|
-
}),
|
|
102
|
-
|
|
175
|
+
}), M = C(void 0);
|
|
176
|
+
x(() => (j.current = {
|
|
103
177
|
count: 0,
|
|
104
178
|
at: 0
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
}), [
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
let
|
|
179
|
+
}, a.setSourceState({ playbackErrors: [] }), () => {
|
|
180
|
+
M.current && clearTimeout(M.current);
|
|
181
|
+
}), [c]);
|
|
182
|
+
let N = C(null), P = C(null), F = C(void 0), I = C(c);
|
|
183
|
+
I.current = c;
|
|
184
|
+
let L = C({
|
|
111
185
|
audio: [],
|
|
112
186
|
subtitles: []
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
let
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
let
|
|
122
|
-
|
|
123
|
-
let
|
|
124
|
-
|
|
125
|
-
let
|
|
126
|
-
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
let t =
|
|
187
|
+
}), R = C(o);
|
|
188
|
+
R.current = o;
|
|
189
|
+
let z = C(n?.preferredAudioLanguage);
|
|
190
|
+
z.current = n?.preferredAudioLanguage;
|
|
191
|
+
let B = C(n?.preferredSubtitleLanguage);
|
|
192
|
+
B.current = n?.preferredSubtitleLanguage;
|
|
193
|
+
let V = C(n?.onPreferredAudioLanguageChange);
|
|
194
|
+
V.current = n?.onPreferredAudioLanguageChange;
|
|
195
|
+
let te = C(n?.onPreferredSubtitleLanguageChange);
|
|
196
|
+
te.current = n?.onPreferredSubtitleLanguageChange;
|
|
197
|
+
let H = C(n?.onSeek);
|
|
198
|
+
H.current = n?.onSeek;
|
|
199
|
+
let ne = C(n?.onPlaybackError);
|
|
200
|
+
ne.current = n?.onPlaybackError;
|
|
201
|
+
let U = C(r);
|
|
202
|
+
U.current = r;
|
|
203
|
+
let W = Q(), G = C(W);
|
|
204
|
+
G.current = W, x(() => {
|
|
205
|
+
let { audio: e, subtitles: t } = L.current;
|
|
206
|
+
t.length && a.setSourceState({ subtitleTracks: Se(t, W) }), e.length && a.setSourceState({ audioTracks: Se(e, W) });
|
|
207
|
+
}, [a, W]);
|
|
208
|
+
let K = y((e) => {
|
|
209
|
+
let t = typeof e == "number" ? e : void 0, n = a.selectedSubtitleTrack === void 0;
|
|
210
|
+
F.current = I.current, a.setSourceState({ selectedSubtitleTrack: t }), N.current?.selectSubtitleStream(t);
|
|
211
|
+
let r = L.current.subtitles.find((e) => e.streamIndex === t), i = t === void 0 ? null : u(r) ?? (n ? r?.title?.trim() || "und" : void 0);
|
|
212
|
+
i !== void 0 && te.current?.(i);
|
|
213
|
+
}, [a]), q = y((e) => {
|
|
214
|
+
let t = N.current;
|
|
136
215
|
if (!t || T <= 0) {
|
|
137
|
-
|
|
216
|
+
a.seek(e);
|
|
138
217
|
return;
|
|
139
218
|
}
|
|
140
|
-
let n = typeof window < "u" && window.__mediaPlayerSeekDebug, r = performance.now(), i = !1,
|
|
141
|
-
if (!i && (i = !0,
|
|
219
|
+
let n = typeof window < "u" && window.__mediaPlayerSeekDebug, r = performance.now(), i = !1, o = "prepared", s = () => {
|
|
220
|
+
if (!i && (i = !0, a.seek(e), n)) {
|
|
142
221
|
let n = t.videoElement, i = 0;
|
|
143
222
|
if (n) for (let t = 0; t < n.buffered.length; t++) n.buffered.start(t) <= e + 1 && e < n.buffered.end(t) && (i = n.buffered.end(t) - e);
|
|
144
|
-
console.warn(`[media-player] seek to ${e.toFixed(2)} moved after ${Math.round(performance.now() - r)}ms via ${
|
|
223
|
+
console.warn(`[media-player] seek to ${e.toFixed(2)} moved after ${Math.round(performance.now() - r)}ms via ${o}, runway ${i.toFixed(1)}s${o === "deadline" ? " (EXPOSED: moved before its data was ready)" : ""}`);
|
|
145
224
|
}
|
|
146
225
|
};
|
|
147
|
-
|
|
226
|
+
a.setSourceState({ seekingTo: e });
|
|
148
227
|
let c = t.videoElement, l = () => {
|
|
149
|
-
c?.removeEventListener("seeked", l), clearTimeout(u),
|
|
150
|
-
}, u = setTimeout(l,
|
|
228
|
+
c?.removeEventListener("seeked", l), clearTimeout(u), a.setSourceState({ seekingTo: void 0 });
|
|
229
|
+
}, u = setTimeout(l, Ee);
|
|
151
230
|
c?.addEventListener("seeked", l);
|
|
152
231
|
let d = setTimeout(() => {
|
|
153
|
-
|
|
232
|
+
o = "deadline", s();
|
|
154
233
|
}, T);
|
|
155
234
|
t.prepareSeek(e).catch(() => {}).finally(() => {
|
|
156
235
|
clearTimeout(d), s();
|
|
157
236
|
});
|
|
158
|
-
}, [
|
|
159
|
-
if (typeof e != "number" ||
|
|
160
|
-
|
|
161
|
-
size:
|
|
237
|
+
}, [a, T]), re = y((e) => {
|
|
238
|
+
if (typeof e != "number" || I.current === void 0) return;
|
|
239
|
+
a.setSourceState({ selectedAudioTrack: e }), O({
|
|
240
|
+
size: I.current,
|
|
162
241
|
streamIndex: e
|
|
163
242
|
});
|
|
164
|
-
let t =
|
|
165
|
-
t !== void 0 &&
|
|
166
|
-
}, [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
selectSubtitleTrack:
|
|
170
|
-
selectAudioTrack:
|
|
171
|
-
requestSeek:
|
|
243
|
+
let t = u(L.current.audio.find((t) => t.streamIndex === e));
|
|
244
|
+
t !== void 0 && V.current?.(t);
|
|
245
|
+
}, [a]), ie = J((e) => e.setSourceState);
|
|
246
|
+
x(() => {
|
|
247
|
+
ie({
|
|
248
|
+
selectSubtitleTrack: K,
|
|
249
|
+
selectAudioTrack: re,
|
|
250
|
+
requestSeek: q
|
|
172
251
|
});
|
|
173
252
|
}, [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
]),
|
|
179
|
-
if (!e || !t || !
|
|
253
|
+
ie,
|
|
254
|
+
K,
|
|
255
|
+
re,
|
|
256
|
+
q
|
|
257
|
+
]), x(() => {
|
|
258
|
+
if (!e || !t || !c || !o) return;
|
|
180
259
|
let n = !1;
|
|
181
|
-
|
|
260
|
+
a.setSourceState({
|
|
182
261
|
playbackError: null,
|
|
183
262
|
ready: !1
|
|
184
263
|
});
|
|
185
|
-
let
|
|
186
|
-
let r = Date.now(), i =
|
|
187
|
-
if (c && c.message === i && c.detail ===
|
|
264
|
+
let r = (t, n) => {
|
|
265
|
+
let r = Date.now(), i = Oe(t), o = ke(t), s = a.playbackErrors, c = s[s.length - 1];
|
|
266
|
+
if (c && c.message === i && c.detail === o && c.recovered === n) {
|
|
188
267
|
let e = {
|
|
189
268
|
...c,
|
|
190
269
|
count: c.count + 1,
|
|
191
270
|
lastAt: r
|
|
192
271
|
};
|
|
193
|
-
|
|
272
|
+
a.setSourceState({ playbackErrors: [...s.slice(0, -1), e] });
|
|
194
273
|
return;
|
|
195
274
|
}
|
|
196
275
|
let l = {
|
|
@@ -199,69 +278,69 @@ var ie = {
|
|
|
199
278
|
count: 1,
|
|
200
279
|
atMediaTime: Number.isFinite(e.currentTime) ? e.currentTime : void 0,
|
|
201
280
|
message: i,
|
|
202
|
-
detail:
|
|
281
|
+
detail: o,
|
|
203
282
|
recovered: n
|
|
204
283
|
};
|
|
205
|
-
|
|
206
|
-
},
|
|
284
|
+
a.setSourceState({ playbackErrors: [...s, l] });
|
|
285
|
+
}, u = (e) => {
|
|
207
286
|
if (n) return;
|
|
208
|
-
let t =
|
|
209
|
-
if (
|
|
287
|
+
let t = i(e);
|
|
288
|
+
if (r(e, t), t) {
|
|
210
289
|
let t = performance.now();
|
|
211
|
-
t -
|
|
290
|
+
t - j.current.at > we && (j.current = {
|
|
212
291
|
count: 0,
|
|
213
292
|
at: t
|
|
214
293
|
});
|
|
215
|
-
let n =
|
|
216
|
-
|
|
217
|
-
count:
|
|
294
|
+
let n = Ce[Math.min(j.current.count, Ce.length - 1)];
|
|
295
|
+
j.current = {
|
|
296
|
+
count: j.current.count + 1,
|
|
218
297
|
at: t
|
|
219
|
-
}, console.warn(`the media element failed; rebuilding the pipeline${n ? ` in ${n}ms` : ""}`, e),
|
|
298
|
+
}, console.warn(`the media element failed; rebuilding the pipeline${n ? ` in ${n}ms` : ""}`, e), M.current && clearTimeout(M.current), M.current = setTimeout(() => A((e) => e + 1), n);
|
|
220
299
|
return;
|
|
221
300
|
}
|
|
222
|
-
console.error("playback failed", e),
|
|
301
|
+
console.error("playback failed", e), a.setSourceState({ playbackError: e }), ne.current?.(e);
|
|
223
302
|
};
|
|
224
303
|
return (async () => {
|
|
225
304
|
try {
|
|
226
|
-
let r = await
|
|
305
|
+
let r = await s({
|
|
227
306
|
videoElement: e,
|
|
228
307
|
subtitleContainer: t,
|
|
229
|
-
read: (e, t) =>
|
|
230
|
-
length:
|
|
231
|
-
publicPath:
|
|
308
|
+
read: (e, t) => R.current(e, t),
|
|
309
|
+
length: c,
|
|
310
|
+
publicPath: l,
|
|
232
311
|
libavWorkerUrl: f,
|
|
233
312
|
jassubWorkerUrl: p,
|
|
234
313
|
jassubWasmUrl: m,
|
|
235
314
|
jassubLegacyWasmUrl: h,
|
|
236
315
|
defaultFontUrl: g,
|
|
237
|
-
cjkFontUrl:
|
|
238
|
-
bufferSize:
|
|
316
|
+
cjkFontUrl: _,
|
|
317
|
+
bufferSize: v,
|
|
239
318
|
audioStreamIndex: k,
|
|
240
319
|
chooseAudioStream: (e) => {
|
|
241
|
-
let t =
|
|
242
|
-
return t === void 0 ? void 0 : e[
|
|
320
|
+
let t = z.current;
|
|
321
|
+
return t === void 0 ? void 0 : e[d(t, e)]?.streamIndex;
|
|
243
322
|
},
|
|
244
323
|
onReady: () => {
|
|
245
324
|
if (n) return;
|
|
246
|
-
|
|
247
|
-
let t =
|
|
248
|
-
|
|
325
|
+
a.setSourceState({ ready: !0 });
|
|
326
|
+
let t = P.current;
|
|
327
|
+
P.current = null, t && t.size === c && t.time > 0 && (e.currentTime = t.time), b && e.play().catch(() => {});
|
|
249
328
|
},
|
|
250
|
-
onError:
|
|
329
|
+
onError: u,
|
|
251
330
|
onRecovered: () => {
|
|
252
|
-
n ||
|
|
331
|
+
n || a.setSourceState({ playbackError: null });
|
|
253
332
|
},
|
|
254
|
-
onSeek: (e) =>
|
|
255
|
-
onOutput: (e) =>
|
|
333
|
+
onSeek: (e) => H.current?.(e),
|
|
334
|
+
onOutput: (e) => U.current?.(e),
|
|
256
335
|
onSubtitleStreams: (e) => {
|
|
257
|
-
n || (
|
|
258
|
-
subtitleTracks:
|
|
259
|
-
...
|
|
336
|
+
n || (L.current.subtitles = e, a.setSourceState({
|
|
337
|
+
subtitleTracks: Se(e, G.current),
|
|
338
|
+
...F.current === c ? {} : { selectedSubtitleTrack: De(B.current, e) }
|
|
260
339
|
}));
|
|
261
340
|
},
|
|
262
341
|
onAudioStreams: (e, t) => {
|
|
263
|
-
n || (
|
|
264
|
-
audioTracks:
|
|
342
|
+
n || (L.current.audio = e, a.setSourceState({
|
|
343
|
+
audioTracks: Se(e, G.current),
|
|
265
344
|
selectedAudioTrack: t
|
|
266
345
|
}));
|
|
267
346
|
}
|
|
@@ -270,44 +349,44 @@ var ie = {
|
|
|
270
349
|
r.destroy();
|
|
271
350
|
return;
|
|
272
351
|
}
|
|
273
|
-
|
|
352
|
+
N.current = r, a.setSourceState({
|
|
274
353
|
indexes: r.indexes,
|
|
275
354
|
chapters: E.current ?? r.chapters
|
|
276
355
|
});
|
|
277
|
-
let i =
|
|
356
|
+
let i = a.selectedSubtitleTrack;
|
|
278
357
|
r.selectSubtitleStream(typeof i == "number" ? i : void 0);
|
|
279
358
|
} catch (e) {
|
|
280
|
-
|
|
359
|
+
u(e);
|
|
281
360
|
}
|
|
282
361
|
})(), () => {
|
|
283
|
-
n = !0,
|
|
362
|
+
n = !0, P.current = {
|
|
284
363
|
time: e.currentTime,
|
|
285
|
-
size:
|
|
286
|
-
},
|
|
364
|
+
size: c
|
|
365
|
+
}, N.current?.destroy(), N.current = null, a.setSourceState({ ready: !1 });
|
|
287
366
|
};
|
|
288
367
|
}, [
|
|
289
|
-
|
|
368
|
+
a,
|
|
290
369
|
e,
|
|
291
370
|
t,
|
|
292
|
-
|
|
293
|
-
|
|
371
|
+
c,
|
|
372
|
+
l,
|
|
294
373
|
f,
|
|
295
374
|
p,
|
|
296
375
|
m,
|
|
297
376
|
h,
|
|
298
377
|
g,
|
|
378
|
+
_,
|
|
299
379
|
v,
|
|
300
|
-
b,
|
|
301
380
|
k,
|
|
302
|
-
|
|
303
|
-
|
|
381
|
+
b,
|
|
382
|
+
ee
|
|
304
383
|
]);
|
|
305
|
-
},
|
|
384
|
+
}, je = 1001 / 24e3, Me = (e, t) => new Promise((n) => {
|
|
306
385
|
let r = setTimeout(n, t);
|
|
307
386
|
e.requestVideoFrameCallback(() => {
|
|
308
387
|
clearTimeout(r), n();
|
|
309
388
|
});
|
|
310
|
-
}),
|
|
389
|
+
}), Ne = (e) => {
|
|
311
390
|
let t = !1, n, r = async (i) => {
|
|
312
391
|
if (t) {
|
|
313
392
|
n = i;
|
|
@@ -323,14 +402,14 @@ var ie = {
|
|
|
323
402
|
}
|
|
324
403
|
};
|
|
325
404
|
return r;
|
|
326
|
-
},
|
|
327
|
-
let n =
|
|
405
|
+
}, Pe = (e, t) => {
|
|
406
|
+
let n = J(), r = J((e) => e.setSourceState), i = C(t);
|
|
328
407
|
i.current = t;
|
|
329
408
|
let a = !!t;
|
|
330
|
-
|
|
409
|
+
x(() => {
|
|
331
410
|
let t = e;
|
|
332
411
|
if (!t) return;
|
|
333
|
-
if (typeof t.requestVideoFrameCallback != "function") return a ? (r({ stepFrame:
|
|
412
|
+
if (typeof t.requestVideoFrameCallback != "function") return a ? (r({ stepFrame: Ne(async (e) => {
|
|
334
413
|
try {
|
|
335
414
|
await i.current?.(e);
|
|
336
415
|
} catch (e) {
|
|
@@ -349,11 +428,11 @@ var ie = {
|
|
|
349
428
|
};
|
|
350
429
|
d = t.requestVideoFrameCallback(f);
|
|
351
430
|
let p = () => {
|
|
352
|
-
if (c.length < 5) return
|
|
431
|
+
if (c.length < 5) return je;
|
|
353
432
|
let e = [...c].sort((e, t) => e - t), t = e[e.length >> 1], n = e.filter((e) => Math.abs(e - t) <= t / 4);
|
|
354
433
|
return n.reduce((e, t) => e + t, 0) / n.length;
|
|
355
|
-
}, m =
|
|
356
|
-
t.paused || (t.pause(), await
|
|
434
|
+
}, m = Ne(async (e) => {
|
|
435
|
+
t.paused || (t.pause(), await Me(t, 100));
|
|
357
436
|
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) => {
|
|
358
437
|
let n = setTimeout(e, 1e3);
|
|
359
438
|
t.addEventListener("seeked", () => {
|
|
@@ -371,88 +450,88 @@ var ie = {
|
|
|
371
450
|
n,
|
|
372
451
|
r
|
|
373
452
|
]);
|
|
374
|
-
},
|
|
375
|
-
let [
|
|
453
|
+
}, Fe = 5e3, Ie = 6e4, Le = ({ publicPath: e, workerUrl: t, length: n, read: r, downloadedRanges: i }) => {
|
|
454
|
+
let [a, s] = w([]), c = C(null), l = C(r);
|
|
376
455
|
l.current = r;
|
|
377
|
-
let u =
|
|
378
|
-
return d.current = u,
|
|
456
|
+
let u = S(() => i?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [i?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")]), d = C(u);
|
|
457
|
+
return d.current = u, x(() => {
|
|
379
458
|
if (!n || !r || !e || !t) return;
|
|
380
|
-
let
|
|
381
|
-
|
|
459
|
+
let i = !1, a = null, u, f = Fe, p = () => {
|
|
460
|
+
o({
|
|
382
461
|
publicPath: e,
|
|
383
462
|
workerUrl: t,
|
|
384
463
|
length: n,
|
|
385
464
|
read: (e, t) => l.current(e, t),
|
|
386
465
|
onThumbnails: (e) => {
|
|
387
|
-
|
|
466
|
+
i || s(e);
|
|
388
467
|
}
|
|
389
468
|
}).then((e) => {
|
|
390
|
-
if (
|
|
469
|
+
if (i) {
|
|
391
470
|
e.destroy();
|
|
392
471
|
return;
|
|
393
472
|
}
|
|
394
|
-
|
|
473
|
+
a = e, c.current = e, e.update(d.current);
|
|
395
474
|
}, () => {
|
|
396
|
-
|
|
475
|
+
i || (u = setTimeout(p, f), f = Math.min(f * 2, Ie));
|
|
397
476
|
});
|
|
398
477
|
};
|
|
399
478
|
return p(), () => {
|
|
400
|
-
|
|
479
|
+
i = !0, clearTimeout(u), c.current = null, a?.destroy(), s([]);
|
|
401
480
|
};
|
|
402
481
|
}, [
|
|
403
482
|
n,
|
|
404
483
|
e,
|
|
405
484
|
t
|
|
406
|
-
]),
|
|
485
|
+
]), x(() => {
|
|
407
486
|
c.current?.update(u);
|
|
408
487
|
}, [u]), {
|
|
409
|
-
thumbnails:
|
|
410
|
-
requestThumbnail:
|
|
488
|
+
thumbnails: a,
|
|
489
|
+
requestThumbnail: y((e) => {
|
|
411
490
|
c.current?.prioritize(e);
|
|
412
491
|
}, [])
|
|
413
492
|
};
|
|
414
|
-
},
|
|
415
|
-
let
|
|
416
|
-
|
|
417
|
-
if (!e || !t || !
|
|
418
|
-
let
|
|
493
|
+
}, Re = (e, t) => {
|
|
494
|
+
let n = C(null), [i, a] = w(!1), [o] = w(() => r());
|
|
495
|
+
x(() => {
|
|
496
|
+
if (!e || !t || !o) return;
|
|
497
|
+
let r = c({
|
|
419
498
|
video: e,
|
|
420
499
|
subtitles: t,
|
|
421
|
-
mode:
|
|
500
|
+
mode: o,
|
|
422
501
|
onBurnedInChange: a
|
|
423
502
|
});
|
|
424
|
-
return
|
|
425
|
-
|
|
503
|
+
return n.current = r, () => {
|
|
504
|
+
r.destroy(), n.current = null, a(!1);
|
|
426
505
|
};
|
|
427
506
|
}, [
|
|
428
507
|
e,
|
|
429
508
|
t,
|
|
430
|
-
|
|
509
|
+
o
|
|
431
510
|
]);
|
|
432
|
-
let
|
|
433
|
-
|
|
511
|
+
let s = y(() => {
|
|
512
|
+
n.current?.toggle().catch((e) => {
|
|
434
513
|
console.warn("picture in picture was refused", e);
|
|
435
514
|
});
|
|
436
515
|
}, []);
|
|
437
516
|
return {
|
|
438
|
-
toggle: e && t &&
|
|
439
|
-
mode:
|
|
517
|
+
toggle: e && t && o ? s : null,
|
|
518
|
+
mode: o,
|
|
440
519
|
burnedIn: i
|
|
441
520
|
};
|
|
442
|
-
},
|
|
443
|
-
let t =
|
|
521
|
+
}, ze = "(hover: hover) and (pointer: fine)", Be = () => typeof matchMedia == "function" ? matchMedia(ze) : void 0, Ve = (e) => {
|
|
522
|
+
let t = Be();
|
|
444
523
|
return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
|
|
445
|
-
},
|
|
446
|
-
let [n, r] =
|
|
524
|
+
}, He = () => !!Be()?.matches, Ue = () => !1, We = (e, t) => {
|
|
525
|
+
let [n, r] = w(!1), [i, a] = w(), o = C(t);
|
|
447
526
|
t && (o.current = t);
|
|
448
|
-
let s =
|
|
527
|
+
let s = C(!1), c = y((e) => {
|
|
449
528
|
s.current !== e && (s.current = e, o.current?.onArmedChange(e));
|
|
450
|
-
}, []), l =
|
|
529
|
+
}, []), l = y((t) => {
|
|
451
530
|
!e || e.readyState < 1 || e.error || (a(t), c(!0));
|
|
452
|
-
}, [e, c]), u =
|
|
531
|
+
}, [e, c]), u = y(() => {
|
|
453
532
|
a(void 0), c(!1);
|
|
454
533
|
}, [c]), d = !!t && !!e;
|
|
455
|
-
|
|
534
|
+
x(() => {
|
|
456
535
|
if (!d || !e) return;
|
|
457
536
|
let t = () => {
|
|
458
537
|
r(!0), u();
|
|
@@ -465,8 +544,8 @@ var ie = {
|
|
|
465
544
|
d,
|
|
466
545
|
u
|
|
467
546
|
]);
|
|
468
|
-
let f =
|
|
469
|
-
|
|
547
|
+
let f = T(Ve, He, Ue), [p, m] = w(!1);
|
|
548
|
+
x(() => {
|
|
470
549
|
if (!d) return;
|
|
471
550
|
let e = (e) => {
|
|
472
551
|
e.pointerType === "touch" && m(!0);
|
|
@@ -484,15 +563,15 @@ var ie = {
|
|
|
484
563
|
};
|
|
485
564
|
}, [d]);
|
|
486
565
|
let h = d && f && !p;
|
|
487
|
-
|
|
566
|
+
x(() => {
|
|
488
567
|
h || u();
|
|
489
568
|
}, [h, u]);
|
|
490
|
-
let g =
|
|
569
|
+
let g = y(() => {
|
|
491
570
|
Promise.resolve(e?.exitPictureInPicture?.()).catch((e) => {
|
|
492
571
|
console.warn("leaving picture in picture was refused", e);
|
|
493
572
|
});
|
|
494
573
|
}, [e]);
|
|
495
|
-
return
|
|
574
|
+
return S(() => h ? {
|
|
496
575
|
active: n,
|
|
497
576
|
armed: i,
|
|
498
577
|
arm: l,
|
|
@@ -506,16 +585,16 @@ var ie = {
|
|
|
506
585
|
u,
|
|
507
586
|
g
|
|
508
587
|
]);
|
|
509
|
-
},
|
|
588
|
+
}, Ge = async (e, t, n = {}) => (await e.audioWorklet.addModule(t), new AudioWorkletNode(e, "banou-volume-normalizer", {
|
|
510
589
|
channelCountMode: "max",
|
|
511
590
|
processorOptions: n
|
|
512
|
-
})),
|
|
591
|
+
})), Ke = /* @__PURE__ */ new WeakMap(), qe = (e) => new Promise((t, n) => {
|
|
513
592
|
let r = () => {
|
|
514
593
|
(e.state === "running" || e.state === "closed") && (e.removeEventListener("statechange", r), e.state === "running" ? t() : n(new DOMException("The AudioContext closed before it ran", "InvalidStateError")));
|
|
515
594
|
};
|
|
516
595
|
e.addEventListener("statechange", r), r();
|
|
517
|
-
}),
|
|
518
|
-
let r =
|
|
596
|
+
}), Je = (e, t, n = {}) => {
|
|
597
|
+
let r = Ke.get(e);
|
|
519
598
|
if (r) return r.wake(), r;
|
|
520
599
|
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 = () => {
|
|
521
600
|
i.state === "suspended" && i.resume().catch(() => {});
|
|
@@ -531,13 +610,13 @@ var ie = {
|
|
|
531
610
|
};
|
|
532
611
|
i.addEventListener("statechange", f), f();
|
|
533
612
|
let p = (async () => {
|
|
534
|
-
let r = await
|
|
613
|
+
let r = await Ge(i, t, {
|
|
535
614
|
...n,
|
|
536
615
|
enabled: a,
|
|
537
616
|
inputGainDb: c()
|
|
538
617
|
});
|
|
539
|
-
await
|
|
540
|
-
let s =
|
|
618
|
+
await qe(i);
|
|
619
|
+
let s = I(i, e);
|
|
541
620
|
return r.port.postMessage({
|
|
542
621
|
enabled: a,
|
|
543
622
|
inputGainDb: c()
|
|
@@ -553,14 +632,14 @@ var ie = {
|
|
|
553
632
|
a = e, o?.port.postMessage({ enabled: a });
|
|
554
633
|
},
|
|
555
634
|
release: () => {
|
|
556
|
-
s = !0, d(!1), e.isConnected ? i.state === "running" && i.suspend().catch(() => {}) : (
|
|
635
|
+
s = !0, d(!1), e.isConnected ? i.state === "running" && i.suspend().catch(() => {}) : (Ke.delete(e), i.close().catch(() => {}));
|
|
557
636
|
},
|
|
558
637
|
wake: () => {
|
|
559
638
|
i.state !== "closed" && (s = !1, u(), f());
|
|
560
639
|
}
|
|
561
640
|
};
|
|
562
|
-
return
|
|
563
|
-
},
|
|
641
|
+
return Ke.set(e, m), m;
|
|
642
|
+
}, Ye = 20, Xe = 5, Ze = 1, Qe = 50, $e = ({ node: t, element: n, scriptUrl: r, source: i }) => {
|
|
564
643
|
let a = !1, o, s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = () => {
|
|
565
644
|
for (let e of [...c]) e();
|
|
566
645
|
c.clear();
|
|
@@ -591,7 +670,7 @@ var ie = {
|
|
|
591
670
|
}, g = 0, _ = /* @__PURE__ */ new Map(), v = (e, t) => new Promise((n) => _.set(`${e}:${t}`, n)), y = -1;
|
|
592
671
|
p.onmessage = ({ data: e }) => {
|
|
593
672
|
if (e.type === "unsupported") {
|
|
594
|
-
|
|
673
|
+
U();
|
|
595
674
|
return;
|
|
596
675
|
}
|
|
597
676
|
e.spans && ((JSON.stringify(e.spans) !== JSON.stringify(h.spans) || e.end !== h.end) && g++, h = {
|
|
@@ -607,7 +686,7 @@ var ie = {
|
|
|
607
686
|
}), S = () => p.postMessage({
|
|
608
687
|
type: "playhead",
|
|
609
688
|
time: n.currentTime
|
|
610
|
-
}), C = setInterval(x,
|
|
689
|
+
}), C = setInterval(x, Qe), w = [
|
|
611
690
|
"play",
|
|
612
691
|
"playing",
|
|
613
692
|
"pause",
|
|
@@ -618,25 +697,25 @@ var ie = {
|
|
|
618
697
|
"ended"
|
|
619
698
|
];
|
|
620
699
|
for (let e of w) n.addEventListener(e, x);
|
|
621
|
-
let T = Infinity, E = !1, D = 0, O = !1, k = 0,
|
|
700
|
+
let T = Infinity, E = !1, D = 0, O = !1, k = 0, ee = 0, A = /* @__PURE__ */ new Map(), j = (e) => {
|
|
622
701
|
let t = e;
|
|
623
702
|
for (let [e, n] of h.spans) e <= t && t < n && (t = n);
|
|
624
703
|
return t >= (h.end ?? T) - .05 ? null : t;
|
|
625
|
-
},
|
|
626
|
-
let e = n.currentTime, t =
|
|
627
|
-
if (t !== null && t < e +
|
|
704
|
+
}, N = (e) => A.get(Math.round(e * 10)) === g ? "idle" : e, P = () => {
|
|
705
|
+
let e = n.currentTime, t = j(e), r = O && y !== D;
|
|
706
|
+
if (t !== null && t < e + Ye) return r && k <= t + 1 && t <= ee + Xe ? "read" : N(t);
|
|
628
707
|
if (r) return "read";
|
|
629
|
-
let i = t ??
|
|
630
|
-
return i === null ? "done" :
|
|
631
|
-
},
|
|
632
|
-
|
|
633
|
-
})])),
|
|
634
|
-
S(), E && s.size && typeof
|
|
635
|
-
},
|
|
708
|
+
let i = t ?? j(0);
|
|
709
|
+
return i === null ? "done" : N(i);
|
|
710
|
+
}, F = () => {}, I = (e) => (e.catch(() => {}), Promise.race([e, new Promise((e) => {
|
|
711
|
+
F = () => e(void 0);
|
|
712
|
+
})])), L = () => {
|
|
713
|
+
S(), E && s.size && typeof P() == "number" && F(), l();
|
|
714
|
+
}, R = () => {
|
|
636
715
|
S(), l();
|
|
637
716
|
};
|
|
638
|
-
n.addEventListener("seeking",
|
|
639
|
-
let
|
|
717
|
+
n.addEventListener("seeking", L), n.addEventListener("seeked", R), n.addEventListener("timeupdate", R);
|
|
718
|
+
let z, B = async (e) => {
|
|
640
719
|
if (!O) return;
|
|
641
720
|
O = !1;
|
|
642
721
|
let t = v("ended", D);
|
|
@@ -645,24 +724,24 @@ var ie = {
|
|
|
645
724
|
run: D,
|
|
646
725
|
finished: e
|
|
647
726
|
}), await t;
|
|
648
|
-
},
|
|
649
|
-
if (
|
|
727
|
+
}, V = async (e) => {
|
|
728
|
+
if (ee = e.pts + e.duration, !e.data.byteLength) return;
|
|
650
729
|
let t = v("ack", D);
|
|
651
730
|
p.postMessage({
|
|
652
731
|
type: "fragment",
|
|
653
732
|
run: D,
|
|
654
733
|
data: e.data
|
|
655
734
|
}, [e.data]), await t;
|
|
656
|
-
},
|
|
657
|
-
if (
|
|
735
|
+
}, te = async (t) => {
|
|
736
|
+
if (z = await M({
|
|
658
737
|
publicPath: t.publicPath,
|
|
659
738
|
workerUrl: t.libavWorkerUrl,
|
|
660
739
|
workerOptions: { type: "module" },
|
|
661
740
|
length: t.length,
|
|
662
741
|
read: (e, n) => d(t, e, n),
|
|
663
742
|
audioStreamIndex: t.audioStreamIndex
|
|
664
|
-
}), a) return e(
|
|
665
|
-
let n = await
|
|
743
|
+
}), a) return e(z);
|
|
744
|
+
let n = await z.init();
|
|
666
745
|
if (!a) {
|
|
667
746
|
for (T = n.info.input.duration || Infinity, p.postMessage({
|
|
668
747
|
type: "init",
|
|
@@ -674,7 +753,7 @@ var ie = {
|
|
|
674
753
|
pts: 0,
|
|
675
754
|
start: !0
|
|
676
755
|
}); !a;) {
|
|
677
|
-
let e =
|
|
756
|
+
let e = P();
|
|
678
757
|
if (e === "done") break;
|
|
679
758
|
if (e === "idle") {
|
|
680
759
|
await u();
|
|
@@ -682,15 +761,15 @@ var ie = {
|
|
|
682
761
|
}
|
|
683
762
|
try {
|
|
684
763
|
if (e === "read") {
|
|
685
|
-
let e = await
|
|
764
|
+
let e = await I(z.read());
|
|
686
765
|
if (a) return;
|
|
687
766
|
if (!e) continue;
|
|
688
|
-
await
|
|
767
|
+
await V(e), e.finished && await B(!0);
|
|
689
768
|
} else {
|
|
690
|
-
await
|
|
691
|
-
let t =
|
|
769
|
+
await B(!1), A.set(Math.round(e * 10), g);
|
|
770
|
+
let t = z.seek(Math.max(0, e - Ze));
|
|
692
771
|
f(!0);
|
|
693
|
-
let n = await
|
|
772
|
+
let n = await I(t);
|
|
694
773
|
if (a) return;
|
|
695
774
|
if (!n) continue;
|
|
696
775
|
D++, O = !0, k = n.pts, p.postMessage({
|
|
@@ -698,16 +777,16 @@ var ie = {
|
|
|
698
777
|
run: D,
|
|
699
778
|
pts: n.pts,
|
|
700
779
|
start: n.pts <= 0
|
|
701
|
-
}), await
|
|
780
|
+
}), await V(n), n.finished && await B(!0);
|
|
702
781
|
}
|
|
703
782
|
} catch {
|
|
704
783
|
if (a) return;
|
|
705
|
-
await
|
|
784
|
+
await B(!1), typeof P() != "number" && await u();
|
|
706
785
|
}
|
|
707
786
|
}
|
|
708
|
-
e(
|
|
787
|
+
e(z), z = void 0;
|
|
709
788
|
}
|
|
710
|
-
},
|
|
789
|
+
}, H = () => {}, ne = (e, t) => {
|
|
711
790
|
let n = !1, r = (e) => {
|
|
712
791
|
n && p.postMessage({
|
|
713
792
|
type: "end",
|
|
@@ -715,7 +794,7 @@ var ie = {
|
|
|
715
794
|
finished: e
|
|
716
795
|
}), n = !1;
|
|
717
796
|
};
|
|
718
|
-
|
|
797
|
+
H = e.attach(t, (e, t) => {
|
|
719
798
|
if (e.type === "init") {
|
|
720
799
|
r(!1);
|
|
721
800
|
let t = e.data.slice(0);
|
|
@@ -741,29 +820,29 @@ var ie = {
|
|
|
741
820
|
}, [t]);
|
|
742
821
|
}
|
|
743
822
|
});
|
|
744
|
-
},
|
|
823
|
+
}, U = () => {
|
|
745
824
|
if (!a) {
|
|
746
825
|
a = !0, f(!0), l(), clearInterval(C);
|
|
747
826
|
for (let e of w) n.removeEventListener(e, x);
|
|
748
|
-
n.removeEventListener("seeking",
|
|
827
|
+
n.removeEventListener("seeking", L), n.removeEventListener("seeked", R), n.removeEventListener("timeupdate", R), H(), z && e(z), p.terminate(), t.port.postMessage({ analysis: null });
|
|
749
828
|
for (let e of _.values()) e(h);
|
|
750
829
|
_.clear();
|
|
751
830
|
}
|
|
752
831
|
};
|
|
753
|
-
return "tap" in i ?
|
|
754
|
-
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e),
|
|
832
|
+
return "tap" in i ? ne(i.tap, i.audioStreamIndex) : te(i).catch((e) => {
|
|
833
|
+
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e), U());
|
|
755
834
|
}), S(), {
|
|
756
835
|
update: (e) => {
|
|
757
836
|
o = e, f(!1);
|
|
758
837
|
},
|
|
759
|
-
stop:
|
|
838
|
+
stop: U
|
|
760
839
|
};
|
|
761
|
-
},
|
|
762
|
-
let a =
|
|
763
|
-
|
|
840
|
+
}, et = (e, t, n, r, i) => {
|
|
841
|
+
let a = C(null), [o, s] = w(!1), [c, l] = w(null);
|
|
842
|
+
x(() => {
|
|
764
843
|
if (e && t) {
|
|
765
844
|
if (n && !a.current) {
|
|
766
|
-
let r =
|
|
845
|
+
let r = Je(e, t, { enabled: n });
|
|
767
846
|
a.current = r, r.routed.then((e) => {
|
|
768
847
|
a.current === r && l(e);
|
|
769
848
|
}, (e) => {
|
|
@@ -776,18 +855,18 @@ var ie = {
|
|
|
776
855
|
e,
|
|
777
856
|
t,
|
|
778
857
|
n
|
|
779
|
-
]),
|
|
858
|
+
]), x(() => () => {
|
|
780
859
|
a.current?.release(), a.current = null, l(null);
|
|
781
860
|
}, [e]);
|
|
782
|
-
let u =
|
|
861
|
+
let u = C(i);
|
|
783
862
|
u.current = i;
|
|
784
|
-
let d =
|
|
863
|
+
let d = C(null), f = C(r);
|
|
785
864
|
f.current = r;
|
|
786
865
|
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
|
|
866
|
+
return x(() => {
|
|
788
867
|
let r = f.current;
|
|
789
868
|
if (!c || !e || !t || !n || !r) return;
|
|
790
|
-
let i =
|
|
869
|
+
let i = $e({
|
|
791
870
|
node: c,
|
|
792
871
|
element: e,
|
|
793
872
|
scriptUrl: t,
|
|
@@ -806,10 +885,10 @@ var ie = {
|
|
|
806
885
|
h,
|
|
807
886
|
_,
|
|
808
887
|
g
|
|
809
|
-
]),
|
|
888
|
+
]), x(() => {
|
|
810
889
|
d.current?.update(i);
|
|
811
890
|
}, [i]), { refused: o };
|
|
812
|
-
},
|
|
891
|
+
}, tt = () => {
|
|
813
892
|
let e, t, n, r = () => n && e?.audioStreamIndex === n.audioStreamIndex ? n : void 0;
|
|
814
893
|
return {
|
|
815
894
|
push: (n) => {
|
|
@@ -831,7 +910,7 @@ var ie = {
|
|
|
831
910
|
};
|
|
832
911
|
}
|
|
833
912
|
};
|
|
834
|
-
},
|
|
913
|
+
}, $ = {
|
|
835
914
|
headings: {
|
|
836
915
|
large: "\n font-weight: 600;\n font-size: calc(2.8 * var(--mp-unit));\n line-height: calc(3.4 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(3.4 * var(--mp-unit));\n line-height: calc(4.1 * var(--mp-unit));\n }\n ",
|
|
837
916
|
medium: "\n font-weight: 600;\n font-size: calc(2.4 * var(--mp-unit));\n line-height: calc(2.9 * var(--mp-unit));\n @media (min-width: 960px) {\n font-size: calc(2.8 * var(--mp-unit));\n line-height: calc(3.4 * var(--mp-unit));\n }\n ",
|
|
@@ -858,7 +937,7 @@ var ie = {
|
|
|
858
937
|
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 ",
|
|
859
938
|
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 "
|
|
860
939
|
}
|
|
861
|
-
},
|
|
940
|
+
}, nt = E`
|
|
862
941
|
display: flex;
|
|
863
942
|
justify-content: center;
|
|
864
943
|
align-items: center;
|
|
@@ -871,7 +950,7 @@ var ie = {
|
|
|
871
950
|
margin: auto;
|
|
872
951
|
pointer-events: none;
|
|
873
952
|
}
|
|
874
|
-
`,
|
|
953
|
+
`, rt = E`
|
|
875
954
|
position: absolute;
|
|
876
955
|
top: 0;
|
|
877
956
|
left: 0;
|
|
@@ -879,7 +958,7 @@ var ie = {
|
|
|
879
958
|
padding: calc(1.2 * var(--mp-unit)) calc(1.6 * var(--mp-unit));
|
|
880
959
|
/* clears a notch once the player is fullscreen; resolves to zero everywhere else */
|
|
881
960
|
padding-top: calc(calc(1.2 * var(--mp-unit)) + env(safe-area-inset-top, 0px));
|
|
882
|
-
${
|
|
961
|
+
${$.headings.small}
|
|
883
962
|
color: white;
|
|
884
963
|
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
885
964
|
z-index: 2;
|
|
@@ -900,9 +979,9 @@ var ie = {
|
|
|
900
979
|
|
|
901
980
|
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%);
|
|
902
981
|
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
903
|
-
`,
|
|
982
|
+
`, it = D`
|
|
904
983
|
to { transform: rotate(360deg); }
|
|
905
|
-
`,
|
|
984
|
+
`, at = E`
|
|
906
985
|
position: absolute;
|
|
907
986
|
inset: 0;
|
|
908
987
|
z-index: 2;
|
|
@@ -918,46 +997,46 @@ var ie = {
|
|
|
918
997
|
border-radius: 50%;
|
|
919
998
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
920
999
|
border-top-color: #fff;
|
|
921
|
-
animation: ${
|
|
1000
|
+
animation: ${it} 0.8s linear infinite;
|
|
922
1001
|
}
|
|
923
|
-
`,
|
|
1002
|
+
`, ot = E`
|
|
924
1003
|
position: absolute;
|
|
925
1004
|
inset: auto 0 20%;
|
|
926
1005
|
z-index: 3;
|
|
927
1006
|
padding: 0 calc(2 * var(--mp-unit));
|
|
928
1007
|
text-align: center;
|
|
929
1008
|
color: #fff;
|
|
930
|
-
${
|
|
1009
|
+
${$.bLarge.regular}
|
|
931
1010
|
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
932
1011
|
pointer-events: none;
|
|
933
|
-
`,
|
|
934
|
-
let t =
|
|
1012
|
+
`, st = new Set(Object.values(a)), ct = (e) => e instanceof Error && st.has(e.label ?? ""), lt = (e, { format: t }) => ct(e) ? t(e.label, e.values) : e instanceof Error ? e.message : typeof e == "string" ? e : t(a.failed), ut = ({ onSubtitleRef: e }) => {
|
|
1013
|
+
let t = Q(), n = J((e) => e.title), r = J((e) => e.hideUI), i = J((e) => e.playbackError), a = J((e) => e.ready), o = J((e) => e.size), s = J((e) => e.waiting), c = J((e) => e.seekingTo);
|
|
935
1014
|
return /* @__PURE__ */ F(N, { children: [
|
|
936
|
-
|
|
1015
|
+
n ? /* @__PURE__ */ P("div", {
|
|
937
1016
|
className: "title",
|
|
938
|
-
css:
|
|
939
|
-
style: { ...
|
|
1017
|
+
css: rt,
|
|
1018
|
+
style: { ...r ? {
|
|
940
1019
|
opacity: "0",
|
|
941
1020
|
pointerEvents: "none"
|
|
942
1021
|
} : {} },
|
|
943
|
-
children:
|
|
1022
|
+
children: n
|
|
944
1023
|
}) : void 0,
|
|
945
|
-
((
|
|
946
|
-
|
|
947
|
-
css:
|
|
948
|
-
children:
|
|
1024
|
+
((o ? !a : s) || c !== void 0) && !i ? /* @__PURE__ */ P("div", { css: at }) : void 0,
|
|
1025
|
+
i ? /* @__PURE__ */ P("div", {
|
|
1026
|
+
css: ot,
|
|
1027
|
+
children: lt(i, t)
|
|
949
1028
|
}) : void 0,
|
|
950
1029
|
/* @__PURE__ */ P("div", {
|
|
951
1030
|
className: "subtitles",
|
|
952
1031
|
ref: e,
|
|
953
|
-
css:
|
|
1032
|
+
css: nt
|
|
954
1033
|
})
|
|
955
1034
|
] });
|
|
956
|
-
},
|
|
1035
|
+
}, dt = 1e-4, ft = 1, pt = (e) => Math.max(dt, Math.min(ft, e)) ** 2, mt = (e) => Math.max(dt, Math.min(ft, e)) ** (ft / 2), ht = (e) => {
|
|
957
1036
|
if (e === void 0) return "0:00";
|
|
958
1037
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
|
|
959
1038
|
return t > 0 ? `${t}:${n < 10 ? "0" : ""}${n}:${r < 10 ? "0" : ""}${r}` : `${n}:${r < 10 ? "0" : ""}${r}`;
|
|
960
|
-
},
|
|
1039
|
+
}, gt = (e, t) => `${ht(e)} / ${ht(t)}`, _t = (e) => E`
|
|
961
1040
|
display: flex;
|
|
962
1041
|
justify-content: flex-start;
|
|
963
1042
|
|
|
@@ -989,37 +1068,37 @@ var ie = {
|
|
|
989
1068
|
z-index: 3;
|
|
990
1069
|
|
|
991
1070
|
* {
|
|
992
|
-
${
|
|
1071
|
+
${$.bMedium.regular}
|
|
993
1072
|
}
|
|
994
1073
|
|
|
995
|
-
${e === "sm" &&
|
|
1074
|
+
${e === "sm" && E`
|
|
996
1075
|
padding: calc(0.4 * var(--mp-unit))!important;
|
|
997
1076
|
`}
|
|
998
|
-
${e === "md" &&
|
|
1077
|
+
${e === "md" && E`
|
|
999
1078
|
padding: calc(0.6 * var(--mp-unit))!important;
|
|
1000
1079
|
`}
|
|
1001
|
-
${e === "lg" &&
|
|
1080
|
+
${e === "lg" && E`
|
|
1002
1081
|
padding: calc(1.2 * var(--mp-unit))!important;
|
|
1003
1082
|
`}
|
|
1004
|
-
`,
|
|
1083
|
+
`, vt = {
|
|
1005
1084
|
x: -1,
|
|
1006
1085
|
y: -1,
|
|
1007
1086
|
anchors: 0
|
|
1008
|
-
},
|
|
1009
|
-
|
|
1010
|
-
},
|
|
1087
|
+
}, yt = (e) => {
|
|
1088
|
+
vt.x = e.clientX, vt.y = e.clientY;
|
|
1089
|
+
}, bt = () => (vt.anchors++ === 0 && window.addEventListener("pointermove", yt, {
|
|
1011
1090
|
capture: !0,
|
|
1012
1091
|
passive: !0
|
|
1013
1092
|
}), () => {
|
|
1014
|
-
--
|
|
1015
|
-
}),
|
|
1016
|
-
let l =
|
|
1017
|
-
return
|
|
1018
|
-
let e =
|
|
1093
|
+
--vt.anchors === 0 && window.removeEventListener("pointermove", yt, { capture: !0 });
|
|
1094
|
+
}), xt = _(!1), St = ({ id: e, toolTipText: t, text: n, delayShow: r = 0, closeDelay: i = 0, offset: a = 20, tooltipPlace: o = "top", disabled: s = !1, size: c = "md" }) => {
|
|
1095
|
+
let l = C(null), u = C(null), d = b(xt);
|
|
1096
|
+
return x(() => {
|
|
1097
|
+
let e = bt(), t = () => {
|
|
1019
1098
|
let e = l.current;
|
|
1020
1099
|
if (!e) return;
|
|
1021
1100
|
let { left: t, right: n, top: r, bottom: i } = e.getBoundingClientRect();
|
|
1022
|
-
|
|
1101
|
+
vt.x >= t && vt.x < n && vt.y >= r && vt.y < i || u.current?.close();
|
|
1023
1102
|
}, n = ["fullscreenchange", "webkitfullscreenchange"];
|
|
1024
1103
|
for (let e of n) document.addEventListener(e, t);
|
|
1025
1104
|
return d && window.addEventListener("resize", t), () => {
|
|
@@ -1036,22 +1115,22 @@ var ie = {
|
|
|
1036
1115
|
"data-tooltip-delay-hide": i,
|
|
1037
1116
|
"data-tooltip-place": o,
|
|
1038
1117
|
children: n
|
|
1039
|
-
}), !s && /* @__PURE__ */ P(
|
|
1118
|
+
}), !s && /* @__PURE__ */ P(oe, {
|
|
1040
1119
|
ref: u,
|
|
1041
|
-
css:
|
|
1120
|
+
css: _t(c),
|
|
1042
1121
|
id: e,
|
|
1043
1122
|
noArrow: !0,
|
|
1044
1123
|
children: t
|
|
1045
1124
|
})] });
|
|
1046
|
-
},
|
|
1047
|
-
let [i, a] =
|
|
1125
|
+
}, Ct = ({ ref: e, onChange: t, orientation: n = "horizontal", disabled: r = !1 }) => {
|
|
1126
|
+
let [i, a] = w(!1), o = C(t);
|
|
1048
1127
|
o.current = t;
|
|
1049
|
-
let s =
|
|
1128
|
+
let s = C(null), c = y((t, r) => {
|
|
1050
1129
|
let i = e.current;
|
|
1051
1130
|
if (!i) return 0;
|
|
1052
1131
|
let { left: a, right: o, top: s, bottom: c } = i.getBoundingClientRect(), l = n === "horizontal" ? (t - a) / (o - a) : (c - r) / (c - s);
|
|
1053
1132
|
return Math.min(Math.max(l, 0), 1);
|
|
1054
|
-
}, [e, n]), l =
|
|
1133
|
+
}, [e, n]), l = y((e) => {
|
|
1055
1134
|
if (!(r || e.button > 0)) {
|
|
1056
1135
|
s.current = e.pointerId;
|
|
1057
1136
|
try {
|
|
@@ -1059,9 +1138,9 @@ var ie = {
|
|
|
1059
1138
|
} catch {}
|
|
1060
1139
|
a(!0), o.current(c(e.clientX, e.clientY));
|
|
1061
1140
|
}
|
|
1062
|
-
}, [r, c]), u =
|
|
1141
|
+
}, [r, c]), u = y((e) => {
|
|
1063
1142
|
s.current === e.pointerId && o.current(c(e.clientX, e.clientY));
|
|
1064
|
-
}, [c]), d =
|
|
1143
|
+
}, [c]), d = y((e) => {
|
|
1065
1144
|
if (s.current === e.pointerId) {
|
|
1066
1145
|
s.current = null;
|
|
1067
1146
|
try {
|
|
@@ -1070,7 +1149,7 @@ var ie = {
|
|
|
1070
1149
|
a(!1);
|
|
1071
1150
|
}
|
|
1072
1151
|
}, []);
|
|
1073
|
-
return
|
|
1152
|
+
return x(() => {
|
|
1074
1153
|
r && (s.current = null, a(!1));
|
|
1075
1154
|
}, [r]), {
|
|
1076
1155
|
dragging: i,
|
|
@@ -1082,7 +1161,7 @@ var ie = {
|
|
|
1082
1161
|
style: { touchAction: "none" }
|
|
1083
1162
|
}
|
|
1084
1163
|
};
|
|
1085
|
-
},
|
|
1164
|
+
}, wt = E`
|
|
1086
1165
|
position: relative;
|
|
1087
1166
|
height: calc(.4 * var(--mp-unit));
|
|
1088
1167
|
|
|
@@ -1167,7 +1246,7 @@ var ie = {
|
|
|
1167
1246
|
box-shadow: 0 0 calc(1 * var(--mp-unit)) rgba(0, 0, 0, .5);
|
|
1168
1247
|
|
|
1169
1248
|
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
1170
|
-
${
|
|
1249
|
+
${$.bMedium.bold}
|
|
1171
1250
|
|
|
1172
1251
|
gap: calc(.6 * var(--mp-unit));
|
|
1173
1252
|
|
|
@@ -1301,46 +1380,46 @@ var ie = {
|
|
|
1301
1380
|
--thumbnail-width: calc(18 * var(--mp-unit));
|
|
1302
1381
|
--thumbnail-half: calc(9 * var(--mp-unit));
|
|
1303
1382
|
}
|
|
1304
|
-
`,
|
|
1305
|
-
let e =
|
|
1306
|
-
T(e),
|
|
1307
|
-
}, D = !!
|
|
1308
|
-
|
|
1383
|
+
`, Tt = 4, Et = () => {
|
|
1384
|
+
let e = J(), t = J((e) => e.currentTime), n = J((e) => e.requestSeek), r = J((e) => e.duration), i = J((e) => e.size), a = J((e) => e.downloadedRanges), o = J((e) => e.buffered), s = J((e) => e.indexes), c = J((e) => e.thumbnails), l = J((e) => e.thumbnailAt), u = J((e) => e.requestThumbnail), d = J((e) => e.chapters), m = J((e) => e.seekingTo), h = J((e) => e.setSourceState), g = J((e) => e.hideUI), _ = C(null), [v, y] = w(void 0), [b, T] = w(void 0), E = (e) => {
|
|
1385
|
+
T(e), u(e);
|
|
1386
|
+
}, D = !!b;
|
|
1387
|
+
x(() => {
|
|
1309
1388
|
if (D) return h({ seekPreview: !0 }), () => h({ seekPreview: !1 });
|
|
1310
|
-
}, [h, D]),
|
|
1389
|
+
}, [h, D]), x(() => {
|
|
1311
1390
|
g && E(void 0);
|
|
1312
1391
|
}, [g]);
|
|
1313
|
-
let O =
|
|
1392
|
+
let O = C(void 0), k = C(0), ee = C(void 0), A = C(void 0), j = C(!1), { dragging: M, handlers: N } = Ct({
|
|
1314
1393
|
ref: _,
|
|
1315
1394
|
onChange: (e) => {
|
|
1316
|
-
if (k.current += 1,
|
|
1317
|
-
else if (!
|
|
1395
|
+
if (k.current += 1, ee.current = e, A.current === void 0) A.current = e;
|
|
1396
|
+
else if (!j.current) {
|
|
1318
1397
|
let t = _.current?.getBoundingClientRect().width ?? 0;
|
|
1319
|
-
Math.abs(e -
|
|
1398
|
+
Math.abs(e - A.current) * t > Tt && (j.current = !0);
|
|
1320
1399
|
}
|
|
1321
|
-
|
|
1400
|
+
y(e), O.current !== "mouse" && E(e * r);
|
|
1322
1401
|
}
|
|
1323
|
-
}),
|
|
1324
|
-
O.current = e.pointerType, k.current = 0,
|
|
1325
|
-
},
|
|
1326
|
-
|
|
1327
|
-
let i = k.current > 0 ?
|
|
1402
|
+
}), I = (e) => {
|
|
1403
|
+
O.current = e.pointerType, k.current = 0, A.current = void 0, j.current = !1, N.onPointerDown(e);
|
|
1404
|
+
}, L = (t) => {
|
|
1405
|
+
N.onPointerUp(t);
|
|
1406
|
+
let i = k.current > 0 ? ee.current : void 0;
|
|
1328
1407
|
if (i !== void 0 && r) {
|
|
1329
1408
|
let t = i * r;
|
|
1330
1409
|
n ? n(t) : e.seek(t);
|
|
1331
1410
|
}
|
|
1332
|
-
k.current = 0,
|
|
1333
|
-
},
|
|
1411
|
+
k.current = 0, j.current = !1, A.current = void 0, t.pointerType !== "mouse" && E(void 0);
|
|
1412
|
+
}, R = (e) => {
|
|
1334
1413
|
if (!_.current) return;
|
|
1335
1414
|
let { left: t, right: n } = _.current.getBoundingClientRect();
|
|
1336
1415
|
return Math.min(Math.max((e - t) / (n - t), 0), 1) * r;
|
|
1337
|
-
},
|
|
1338
|
-
|
|
1339
|
-
},
|
|
1340
|
-
|
|
1341
|
-
},
|
|
1416
|
+
}, z = C("mouse"), B = (e) => {
|
|
1417
|
+
z.current = e.pointerType;
|
|
1418
|
+
}, V = (e) => {
|
|
1419
|
+
z.current !== "touch" && E(R(e.clientX));
|
|
1420
|
+
}, te = () => {
|
|
1342
1421
|
_.current && E(void 0);
|
|
1343
|
-
},
|
|
1422
|
+
}, H = (e) => r ? e / r * 100 : 0, ne = (e, t, n) => {
|
|
1344
1423
|
let r = Number((n - t).toFixed(4)), i = t * 100;
|
|
1345
1424
|
return /* @__PURE__ */ P("div", {
|
|
1346
1425
|
className: "loaded-part",
|
|
@@ -1349,10 +1428,10 @@ var ie = {
|
|
|
1349
1428
|
marginLeft: `${i}%`
|
|
1350
1429
|
}
|
|
1351
1430
|
}, e);
|
|
1352
|
-
},
|
|
1431
|
+
}, U = S(() => i === void 0 ? r ? o.map(([e, t], n) => ne(n, e / r, t / r)) : [] : a?.map((e, t) => {
|
|
1353
1432
|
if (!i || !r) return null;
|
|
1354
1433
|
let n = s.filter((t) => e.startByteOffset <= t.pos && t.pos <= e.endByteOffset), a = n.at(0), o = n.at(-1);
|
|
1355
|
-
return !a || !o ? null :
|
|
1434
|
+
return !a || !o ? null : ne(t, a.timestamp / r, o.timestamp / r);
|
|
1356
1435
|
}) ?? [], [
|
|
1357
1436
|
r,
|
|
1358
1437
|
i,
|
|
@@ -1360,114 +1439,114 @@ var ie = {
|
|
|
1360
1439
|
s.length,
|
|
1361
1440
|
a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}/${t}`).join(",")
|
|
1362
1441
|
]);
|
|
1363
|
-
|
|
1364
|
-
v !== void 0 && r &&
|
|
1442
|
+
x(() => {
|
|
1443
|
+
v !== void 0 && r && M && j.current && e.seek(v * r);
|
|
1365
1444
|
}, [
|
|
1366
1445
|
e,
|
|
1367
|
-
|
|
1446
|
+
M,
|
|
1368
1447
|
v,
|
|
1369
1448
|
r
|
|
1370
1449
|
]);
|
|
1371
|
-
let
|
|
1450
|
+
let W = S(() => {
|
|
1372
1451
|
if (!r) return 0;
|
|
1373
|
-
if (
|
|
1452
|
+
if (M && v !== void 0) return v;
|
|
1374
1453
|
let e = m ?? t;
|
|
1375
1454
|
return typeof e == "number" ? e / r : 0;
|
|
1376
1455
|
}, [
|
|
1377
1456
|
r,
|
|
1378
1457
|
t,
|
|
1379
|
-
|
|
1458
|
+
M,
|
|
1380
1459
|
v,
|
|
1381
1460
|
m
|
|
1382
|
-
]),
|
|
1383
|
-
if (!
|
|
1384
|
-
let e =
|
|
1385
|
-
return t >= 0 ? t :
|
|
1461
|
+
]), G = S(() => f(d, r), [d, r]), K = G.length > 0, q = S(() => {
|
|
1462
|
+
if (!K || b === void 0 || !r) return -1;
|
|
1463
|
+
let e = b / r * 100, t = G.findIndex((t, n) => n < G.length - 1 && e >= t && e < G[n + 1]);
|
|
1464
|
+
return t >= 0 ? t : G.length - 2;
|
|
1386
1465
|
}, [
|
|
1387
|
-
q,
|
|
1388
1466
|
K,
|
|
1389
|
-
|
|
1467
|
+
G,
|
|
1468
|
+
b,
|
|
1390
1469
|
r
|
|
1391
|
-
]),
|
|
1392
|
-
q,
|
|
1470
|
+
]), re = S(() => K ? p(G, (e) => e !== q) : void 0, [
|
|
1393
1471
|
K,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
if (
|
|
1472
|
+
G,
|
|
1473
|
+
q
|
|
1474
|
+
]), ie = S(() => q >= 0 ? p(G, (e) => e === q) : void 0, [G, q]), ae = S(() => {
|
|
1475
|
+
if (b !== void 0) return d.find(({ start: e, end: t }) => e <= b && b < t);
|
|
1476
|
+
}, [d, b]), oe = S(() => {
|
|
1477
|
+
if (b) {
|
|
1478
|
+
if (l) return l(b);
|
|
1479
|
+
if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= b && b < t);
|
|
1401
1480
|
}
|
|
1402
1481
|
}, [
|
|
1403
1482
|
c,
|
|
1404
1483
|
l,
|
|
1405
|
-
|
|
1406
|
-
]),
|
|
1484
|
+
b
|
|
1485
|
+
]), se = (e, t) => /* @__PURE__ */ F("div", {
|
|
1407
1486
|
className: e ? `track ${e}` : "track",
|
|
1408
1487
|
style: t ? { maskImage: t } : void 0,
|
|
1409
1488
|
children: [
|
|
1410
1489
|
/* @__PURE__ */ P("div", { className: "background-bar" }),
|
|
1411
1490
|
/* @__PURE__ */ P("div", {
|
|
1412
1491
|
className: "loaded",
|
|
1413
|
-
children:
|
|
1492
|
+
children: U
|
|
1414
1493
|
}),
|
|
1415
1494
|
/* @__PURE__ */ P("div", {
|
|
1416
1495
|
className: "play-container",
|
|
1417
1496
|
children: /* @__PURE__ */ P("div", {
|
|
1418
1497
|
className: "play",
|
|
1419
|
-
style: { transform: `scaleX(${
|
|
1498
|
+
style: { transform: `scaleX(${W})` }
|
|
1420
1499
|
})
|
|
1421
1500
|
})
|
|
1422
1501
|
]
|
|
1423
1502
|
});
|
|
1424
1503
|
return /* @__PURE__ */ F("div", {
|
|
1425
|
-
css:
|
|
1504
|
+
css: wt,
|
|
1426
1505
|
ref: _,
|
|
1427
1506
|
className: [
|
|
1428
1507
|
"progress-bar",
|
|
1429
|
-
|
|
1430
|
-
|
|
1508
|
+
M ? "dragging" : "",
|
|
1509
|
+
K ? "segmented" : ""
|
|
1431
1510
|
].filter(Boolean).join(" "),
|
|
1432
|
-
onPointerDown:
|
|
1433
|
-
onPointerMove:
|
|
1434
|
-
onMouseMove:
|
|
1435
|
-
onMouseOut:
|
|
1511
|
+
onPointerDown: B,
|
|
1512
|
+
onPointerMove: B,
|
|
1513
|
+
onMouseMove: V,
|
|
1514
|
+
onMouseOut: te,
|
|
1436
1515
|
children: [
|
|
1437
|
-
|
|
1438
|
-
|
|
1516
|
+
se(void 0, re),
|
|
1517
|
+
b ? /* @__PURE__ */ F("div", {
|
|
1439
1518
|
className: "cursor-time",
|
|
1440
1519
|
style: {
|
|
1441
|
-
left:
|
|
1442
|
-
maxWidth:
|
|
1520
|
+
left: ae ? `clamp(var(--thumbnail-half), ${H(b)}%, calc(100% - var(--thumbnail-half)))` : `clamp(calc(3 * var(--mp-unit)), ${H(b)}%, calc(100% - calc(3 * var(--mp-unit))))`,
|
|
1521
|
+
maxWidth: ae ? "var(--thumbnail-width)" : void 0
|
|
1443
1522
|
},
|
|
1444
1523
|
children: [/* @__PURE__ */ P("span", {
|
|
1445
1524
|
className: "cursor-time-value",
|
|
1446
|
-
children:
|
|
1447
|
-
}),
|
|
1525
|
+
children: ht(b)
|
|
1526
|
+
}), ae ? /* @__PURE__ */ P("span", {
|
|
1448
1527
|
className: "chapter-title",
|
|
1449
|
-
children:
|
|
1528
|
+
children: ae.title
|
|
1450
1529
|
}) : void 0]
|
|
1451
1530
|
}) : void 0,
|
|
1452
1531
|
/* @__PURE__ */ P("div", { className: "progress" }),
|
|
1453
1532
|
/* @__PURE__ */ P("div", { className: "hover" }),
|
|
1454
|
-
|
|
1533
|
+
ie ? se("focus", ie) : void 0,
|
|
1455
1534
|
/* @__PURE__ */ P("div", { className: "scrubber" }),
|
|
1456
1535
|
/* @__PURE__ */ P("div", {
|
|
1457
1536
|
className: "padding",
|
|
1458
|
-
...
|
|
1459
|
-
onPointerDown:
|
|
1460
|
-
onPointerUp:
|
|
1461
|
-
onPointerCancel:
|
|
1537
|
+
...N,
|
|
1538
|
+
onPointerDown: I,
|
|
1539
|
+
onPointerUp: L,
|
|
1540
|
+
onPointerCancel: L
|
|
1462
1541
|
}),
|
|
1463
1542
|
/* @__PURE__ */ P("div", {
|
|
1464
1543
|
className: "thumbnail",
|
|
1465
|
-
style: { left: `clamp(var(--thumbnail-half), ${
|
|
1466
|
-
children:
|
|
1544
|
+
style: { left: `clamp(var(--thumbnail-half), ${H(b ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
|
|
1545
|
+
children: oe?.url ? /* @__PURE__ */ P("img", { src: oe.url }) : void 0
|
|
1467
1546
|
})
|
|
1468
1547
|
]
|
|
1469
1548
|
});
|
|
1470
|
-
},
|
|
1549
|
+
}, Dt = "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", Ot = {
|
|
1471
1550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1472
1551
|
width: 24,
|
|
1473
1552
|
height: 24,
|
|
@@ -1477,8 +1556,8 @@ var ie = {
|
|
|
1477
1556
|
strokeWidth: 2,
|
|
1478
1557
|
strokeLinecap: "round",
|
|
1479
1558
|
strokeLinejoin: "round"
|
|
1480
|
-
},
|
|
1481
|
-
...
|
|
1559
|
+
}, kt = (e) => /* @__PURE__ */ F("svg", {
|
|
1560
|
+
...Ot,
|
|
1482
1561
|
...e,
|
|
1483
1562
|
children: [
|
|
1484
1563
|
/* @__PURE__ */ P("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
@@ -1492,8 +1571,8 @@ var ie = {
|
|
|
1492
1571
|
}),
|
|
1493
1572
|
/* @__PURE__ */ P("path", { d: "M14.5 18.5h2m2 0h1" })
|
|
1494
1573
|
]
|
|
1495
|
-
}),
|
|
1496
|
-
...
|
|
1574
|
+
}), At = (e) => /* @__PURE__ */ F("svg", {
|
|
1575
|
+
...Ot,
|
|
1497
1576
|
...e,
|
|
1498
1577
|
children: [
|
|
1499
1578
|
/* @__PURE__ */ P("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
@@ -1507,7 +1586,7 @@ var ie = {
|
|
|
1507
1586
|
}),
|
|
1508
1587
|
/* @__PURE__ */ P("path", { d: "M6 9h3m2 0h2" })
|
|
1509
1588
|
]
|
|
1510
|
-
}),
|
|
1589
|
+
}), jt = E`
|
|
1511
1590
|
.popover {
|
|
1512
1591
|
position: absolute;
|
|
1513
1592
|
/* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
|
|
@@ -1528,9 +1607,10 @@ var ie = {
|
|
|
1528
1607
|
once subtitles moved out to its own button, and a long track list scrolls at the cap either way. */
|
|
1529
1608
|
height: max-content;
|
|
1530
1609
|
/* The room actually above the bar. A short player had the top of the menu clipped by that same
|
|
1531
|
-
\`overflow: hidden\`.
|
|
1532
|
-
|
|
1533
|
-
|
|
1610
|
+
\`overflow: hidden\`. \`--mp-height\` is the player's own height, which the chrome writes: with no
|
|
1611
|
+
size container in the ancestry \`100cqh\` is the small viewport's, and a translated menu whose rows
|
|
1612
|
+
wrap reached the cap and rose 2px past a phone's 220px tall player. */
|
|
1613
|
+
max-height: min(160px, calc(var(--mp-height, 100cqh) - 100% - 16px));
|
|
1534
1614
|
@media (min-width: 768px) {
|
|
1535
1615
|
right: calc(16px + env(safe-area-inset-right, 0px));
|
|
1536
1616
|
width: 250px;
|
|
@@ -1546,7 +1626,7 @@ var ie = {
|
|
|
1546
1626
|
|
|
1547
1627
|
border-radius: 8px;
|
|
1548
1628
|
background-color: rgba(28,28,28,0.95);
|
|
1549
|
-
${
|
|
1629
|
+
${$.bMedium.regular}
|
|
1550
1630
|
|
|
1551
1631
|
z-index: 4;
|
|
1552
1632
|
|
|
@@ -1589,7 +1669,7 @@ var ie = {
|
|
|
1589
1669
|
|
|
1590
1670
|
.secondary {
|
|
1591
1671
|
color: #eee;
|
|
1592
|
-
${
|
|
1672
|
+
${$.bSmall.regular}
|
|
1593
1673
|
}
|
|
1594
1674
|
}
|
|
1595
1675
|
}
|
|
@@ -1631,18 +1711,18 @@ var ie = {
|
|
|
1631
1711
|
.failed {
|
|
1632
1712
|
border-bottom: 1px solid #4D4D4E;
|
|
1633
1713
|
color: #f66;
|
|
1634
|
-
${
|
|
1714
|
+
${$.bSmall.regular}
|
|
1635
1715
|
}
|
|
1636
1716
|
}
|
|
1637
|
-
`,
|
|
1638
|
-
let
|
|
1639
|
-
let
|
|
1717
|
+
`, Mt = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: o, pending: s, failed: c }) => {
|
|
1718
|
+
let { format: l } = Q(), u = s !== void 0, d = (e, i, a) => {
|
|
1719
|
+
let o = u && s === e, c = u || t.find((t) => t.id === e)?.disabled;
|
|
1640
1720
|
return /* @__PURE__ */ F("div", {
|
|
1641
1721
|
onClick: () => {
|
|
1642
|
-
|
|
1722
|
+
c || r(e ?? void 0);
|
|
1643
1723
|
},
|
|
1644
|
-
className: [a,
|
|
1645
|
-
children: [/* @__PURE__ */ P("span", { children: i }), /* @__PURE__ */ P("span", { children:
|
|
1724
|
+
className: [a, c ? "unavailable" : null].filter(Boolean).join(" ") || void 0,
|
|
1725
|
+
children: [/* @__PURE__ */ P("span", { children: i }), /* @__PURE__ */ P("span", { children: o ? "…" : (n ?? null) === e ? "✓" : "" })]
|
|
1646
1726
|
}, e ?? "__off__");
|
|
1647
1727
|
};
|
|
1648
1728
|
return /* @__PURE__ */ F("div", {
|
|
@@ -1651,23 +1731,23 @@ var ie = {
|
|
|
1651
1731
|
/* @__PURE__ */ F("div", {
|
|
1652
1732
|
className: i ? "back" : "back no-hover",
|
|
1653
1733
|
onClick: i,
|
|
1654
|
-
children: [i ? /* @__PURE__ */ P(
|
|
1734
|
+
children: [i ? /* @__PURE__ */ P(B, {}) : null, /* @__PURE__ */ P("span", { children: e })]
|
|
1655
1735
|
}),
|
|
1656
|
-
|
|
1736
|
+
c ? /* @__PURE__ */ P("div", {
|
|
1657
1737
|
className: "no-hover failed",
|
|
1658
|
-
children:
|
|
1738
|
+
children: l(a.switchFailed)
|
|
1659
1739
|
}) : null,
|
|
1660
|
-
|
|
1661
|
-
t.map(({ id: e, label: t }) =>
|
|
1740
|
+
o ? d(null, o) : null,
|
|
1741
|
+
t.map(({ id: e, label: t }) => d(e, t, "description"))
|
|
1662
1742
|
]
|
|
1663
1743
|
});
|
|
1664
|
-
},
|
|
1665
|
-
let t =
|
|
1744
|
+
}, Nt = ({ onReset: e } = {}) => {
|
|
1745
|
+
let t = C(null), [n, r] = w(!1), [i, a] = w(void 0), [o, s] = w(!1), c = C(e);
|
|
1666
1746
|
c.current = e;
|
|
1667
1747
|
let l = () => {
|
|
1668
1748
|
r(!1), c.current?.();
|
|
1669
1749
|
};
|
|
1670
|
-
return
|
|
1750
|
+
return x(() => {
|
|
1671
1751
|
let e = (e) => {
|
|
1672
1752
|
n && t.current && !t.current.contains(e.target) && l();
|
|
1673
1753
|
};
|
|
@@ -1702,7 +1782,7 @@ var ie = {
|
|
|
1702
1782
|
});
|
|
1703
1783
|
}
|
|
1704
1784
|
};
|
|
1705
|
-
},
|
|
1785
|
+
}, Pt = E`
|
|
1706
1786
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
1707
1787
|
which is the width of the player box, so it can be clamped to it. */
|
|
1708
1788
|
position: static;
|
|
@@ -1718,13 +1798,13 @@ position: static;
|
|
|
1718
1798
|
}
|
|
1719
1799
|
}
|
|
1720
1800
|
|
|
1721
|
-
${
|
|
1801
|
+
${jt}
|
|
1722
1802
|
|
|
1723
1803
|
.popover.error-list {
|
|
1724
1804
|
/* Wider than a track menu and taller, because these rows are sentences rather than labels, and a
|
|
1725
1805
|
decoder message that has been ellipsized is not worth copying. */
|
|
1726
1806
|
width: 420px;
|
|
1727
|
-
max-height: min(300px, calc(100cqh - 100% - 16px));
|
|
1807
|
+
max-height: min(300px, calc(var(--mp-height, 100cqh) - 100% - 16px));
|
|
1728
1808
|
|
|
1729
1809
|
/* track-menu's header is a left-aligned label row; here it carries a control too, so the two
|
|
1730
1810
|
ends go to the two ends */
|
|
@@ -1746,7 +1826,7 @@ ${mt}
|
|
|
1746
1826
|
|
|
1747
1827
|
color: #fff;
|
|
1748
1828
|
cursor: pointer;
|
|
1749
|
-
${
|
|
1829
|
+
${$.bSmall.regular}
|
|
1750
1830
|
|
|
1751
1831
|
&:hover {
|
|
1752
1832
|
background-color: rgba(255,255,255,.1);
|
|
@@ -1767,7 +1847,7 @@ ${mt}
|
|
|
1767
1847
|
|
|
1768
1848
|
.when {
|
|
1769
1849
|
color: #bbb;
|
|
1770
|
-
${
|
|
1850
|
+
${$.bSmall.regular}
|
|
1771
1851
|
|
|
1772
1852
|
/* the one part of the line worth scanning for, so it is the one part at full brightness */
|
|
1773
1853
|
.count {
|
|
@@ -1786,61 +1866,63 @@ ${mt}
|
|
|
1786
1866
|
color: #ddd;
|
|
1787
1867
|
overflow-wrap: anywhere;
|
|
1788
1868
|
white-space: pre-wrap;
|
|
1789
|
-
${
|
|
1869
|
+
${$.bSmall.regular}
|
|
1790
1870
|
}
|
|
1791
1871
|
}
|
|
1792
1872
|
}
|
|
1793
|
-
`,
|
|
1794
|
-
let n =
|
|
1873
|
+
`, Ft = (e, t) => new Date(e).toLocaleTimeString(t), It = (e) => e === void 0 || !Number.isFinite(e) ? void 0 : ht(Math.max(0, e)), Lt = (e) => e.reduce((e, t) => e + t.count, 0), Rt = (e) => e.map((e, t) => {
|
|
1874
|
+
let n = It(e.atMediaTime), r = e.count > 1 ? `${new Date(e.at).toISOString()} to ${new Date(e.lastAt).toISOString()} ×${e.count}` : new Date(e.at).toISOString();
|
|
1795
1875
|
return [
|
|
1796
1876
|
`${t + 1}. ${r}${n ? ` (at ${n})` : ""}${e.recovered ? " [recovered]" : ""}`,
|
|
1797
1877
|
e.message,
|
|
1798
1878
|
e.detail
|
|
1799
1879
|
].filter(Boolean).join("\n");
|
|
1800
|
-
}).join("\n\n"),
|
|
1801
|
-
let e =
|
|
1880
|
+
}).join("\n\n"), zt = () => {
|
|
1881
|
+
let e = J((e) => e.playbackErrors), { format: t, locale: n } = Q(), { open: r, toggle: i, containerRef: o } = Nt(), [s, c] = w(!1);
|
|
1802
1882
|
if (e.length === 0) return null;
|
|
1803
|
-
let
|
|
1804
|
-
navigator.clipboard?.writeText(
|
|
1805
|
-
|
|
1883
|
+
let l = () => {
|
|
1884
|
+
navigator.clipboard?.writeText(Rt(e)).then(() => {
|
|
1885
|
+
c(!0), setTimeout(() => c(!1), 2e3);
|
|
1806
1886
|
}, (e) => console.warn("[media-player] could not copy the errors:", e));
|
|
1807
|
-
},
|
|
1887
|
+
}, u = t(a.errors, { count: Lt(e) });
|
|
1808
1888
|
return /* @__PURE__ */ F("div", {
|
|
1809
|
-
css:
|
|
1810
|
-
ref:
|
|
1811
|
-
children: [/* @__PURE__ */ P(
|
|
1889
|
+
css: Pt,
|
|
1890
|
+
ref: o,
|
|
1891
|
+
children: [/* @__PURE__ */ P(St, {
|
|
1812
1892
|
id: "errors",
|
|
1813
|
-
disabled:
|
|
1893
|
+
disabled: r,
|
|
1814
1894
|
text: /* @__PURE__ */ P("button", {
|
|
1815
1895
|
className: "errors",
|
|
1816
1896
|
type: "button",
|
|
1817
|
-
onClick:
|
|
1818
|
-
"aria-label":
|
|
1819
|
-
"aria-expanded":
|
|
1820
|
-
children: /* @__PURE__ */ P(
|
|
1897
|
+
onClick: i,
|
|
1898
|
+
"aria-label": u,
|
|
1899
|
+
"aria-expanded": r,
|
|
1900
|
+
children: /* @__PURE__ */ P(q, { className: "alert-triangle" })
|
|
1821
1901
|
}),
|
|
1822
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
1823
|
-
}),
|
|
1902
|
+
toolTipText: /* @__PURE__ */ P("span", { children: u })
|
|
1903
|
+
}), r && /* @__PURE__ */ F("div", {
|
|
1824
1904
|
className: "popover error-list",
|
|
1825
1905
|
children: [/* @__PURE__ */ F("div", {
|
|
1826
1906
|
className: "back no-hover",
|
|
1827
|
-
children: [/* @__PURE__ */ P("span", { children:
|
|
1907
|
+
children: [/* @__PURE__ */ P("span", { children: u }), /* @__PURE__ */ F("button", {
|
|
1828
1908
|
className: "copy",
|
|
1829
1909
|
type: "button",
|
|
1830
|
-
onClick:
|
|
1831
|
-
"aria-label":
|
|
1832
|
-
children: [P(
|
|
1910
|
+
onClick: l,
|
|
1911
|
+
"aria-label": t(a.copyErrors),
|
|
1912
|
+
children: [P(s ? z : te, {}), /* @__PURE__ */ P("span", { children: t(s ? a.copied : a.copy) })]
|
|
1833
1913
|
})]
|
|
1834
|
-
}), e.map((e,
|
|
1914
|
+
}), e.map((e, r) => /* @__PURE__ */ F("div", {
|
|
1835
1915
|
className: "entry no-hover",
|
|
1836
1916
|
children: [
|
|
1837
1917
|
/* @__PURE__ */ F("span", {
|
|
1838
1918
|
className: "when",
|
|
1839
1919
|
children: [
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1920
|
+
e.count > 1 ? t(a.errorSpan, {
|
|
1921
|
+
start: Ft(e.at, n),
|
|
1922
|
+
end: Ft(e.lastAt, n)
|
|
1923
|
+
}) : Ft(e.at, n),
|
|
1924
|
+
It(e.atMediaTime) ? ` ${t(a.errorAt, { time: It(e.atMediaTime) })}` : "",
|
|
1925
|
+
e.recovered ? ` ${t(a.recovered)}` : "",
|
|
1844
1926
|
e.count > 1 ? /* @__PURE__ */ P("span", {
|
|
1845
1927
|
className: "count",
|
|
1846
1928
|
children: `×${e.count}`
|
|
@@ -1856,10 +1938,10 @@ ${mt}
|
|
|
1856
1938
|
children: e.detail
|
|
1857
1939
|
}) : null
|
|
1858
1940
|
]
|
|
1859
|
-
}, `${e.at}-${
|
|
1941
|
+
}, `${e.at}-${r}`))]
|
|
1860
1942
|
})]
|
|
1861
1943
|
});
|
|
1862
|
-
},
|
|
1944
|
+
}, Bt = E`
|
|
1863
1945
|
display: flex;
|
|
1864
1946
|
align-items: center;
|
|
1865
1947
|
justify-content: center;
|
|
@@ -1912,42 +1994,45 @@ width: 100%;
|
|
|
1912
1994
|
}
|
|
1913
1995
|
}
|
|
1914
1996
|
}
|
|
1915
|
-
`,
|
|
1916
|
-
let e =
|
|
1917
|
-
ref:
|
|
1918
|
-
onChange: (t) => e.setPlaybackRate(
|
|
1919
|
-
}),
|
|
1997
|
+
`, Vt = () => {
|
|
1998
|
+
let e = J(), { format: t, number: n } = Q(), r = J((e) => e.playbackRate), i = C(null), o = C(null), s = .25, c = 2.75, l = (e, t = .05) => Math.round(e / t) * t, u = l(r || 1), d = (e) => (e - s) / c * 100, f = (e) => l(s + e * c), { handlers: p } = Ct({
|
|
1999
|
+
ref: o,
|
|
2000
|
+
onChange: (t) => e.setPlaybackRate(f(t))
|
|
2001
|
+
}), m = (t) => {
|
|
1920
2002
|
t.preventDefault();
|
|
1921
|
-
let n = .05, r =
|
|
1922
|
-
r = t.deltaY < 0 ? Math.min(3, r + n) : Math.max(
|
|
2003
|
+
let n = .05, r = u;
|
|
2004
|
+
r = t.deltaY < 0 ? Math.min(3, r + n) : Math.max(s, r - n), e.setPlaybackRate(r);
|
|
1923
2005
|
};
|
|
1924
|
-
|
|
1925
|
-
let e =
|
|
1926
|
-
return e && e.addEventListener("wheel",
|
|
1927
|
-
e && e.removeEventListener("wheel",
|
|
2006
|
+
x(() => {
|
|
2007
|
+
let e = i.current;
|
|
2008
|
+
return e && e.addEventListener("wheel", m, { passive: !1 }), () => {
|
|
2009
|
+
e && e.removeEventListener("wheel", m);
|
|
1928
2010
|
};
|
|
1929
|
-
}, [
|
|
1930
|
-
let
|
|
2011
|
+
}, [r]);
|
|
2012
|
+
let h = d(u);
|
|
1931
2013
|
return /* @__PURE__ */ F("div", {
|
|
1932
|
-
css:
|
|
1933
|
-
children: [/* @__PURE__ */
|
|
2014
|
+
css: Bt,
|
|
2015
|
+
children: [/* @__PURE__ */ P("div", { children: t(a.speed, { rate: n(u, {
|
|
2016
|
+
minimumFractionDigits: 2,
|
|
2017
|
+
maximumFractionDigits: 2
|
|
2018
|
+
}) }) }), /* @__PURE__ */ P("div", {
|
|
1934
2019
|
className: "playback-slider",
|
|
1935
|
-
ref:
|
|
1936
|
-
...
|
|
2020
|
+
ref: i,
|
|
2021
|
+
...p,
|
|
1937
2022
|
children: /* @__PURE__ */ P("div", {
|
|
1938
|
-
ref:
|
|
2023
|
+
ref: o,
|
|
1939
2024
|
style: { background: `linear-gradient(to right,
|
|
1940
|
-
#fff 0% ${
|
|
1941
|
-
#3A3A3A ${
|
|
2025
|
+
#fff 0% ${h}%,
|
|
2026
|
+
#3A3A3A ${h}% 100%
|
|
1942
2027
|
)` },
|
|
1943
2028
|
children: /* @__PURE__ */ P("div", {
|
|
1944
2029
|
className: "playback-handle",
|
|
1945
|
-
style: { left: `${
|
|
2030
|
+
style: { left: `${h}%` }
|
|
1946
2031
|
})
|
|
1947
2032
|
})
|
|
1948
2033
|
})]
|
|
1949
2034
|
});
|
|
1950
|
-
},
|
|
2035
|
+
}, Ht = E`
|
|
1951
2036
|
/* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
|
|
1952
2037
|
as wide as the player box and can therefore be clamped to it. The outside-click check uses
|
|
1953
2038
|
\`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
|
|
@@ -1965,7 +2050,7 @@ position: static;
|
|
|
1965
2050
|
}
|
|
1966
2051
|
}
|
|
1967
2052
|
|
|
1968
|
-
${
|
|
2053
|
+
${jt}
|
|
1969
2054
|
|
|
1970
2055
|
.switch {
|
|
1971
2056
|
position: relative;
|
|
@@ -2041,126 +2126,120 @@ ${mt}
|
|
|
2041
2126
|
}
|
|
2042
2127
|
}
|
|
2043
2128
|
|
|
2044
|
-
`,
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2129
|
+
`, Ut = [
|
|
2130
|
+
.5,
|
|
2131
|
+
1,
|
|
2132
|
+
1.5,
|
|
2133
|
+
2
|
|
2134
|
+
], Wt = () => {
|
|
2135
|
+
let e = J(), { format: t, number: n } = Q(), r = J((e) => e.playbackRate), i = J((e) => e.audioTracks), o = J((e) => e.selectedAudioTrack), s = J((e) => e.selectAudioTrack), c = J((e) => e.quality), l = J((e) => e.volumeNormalizer), [u, d] = w(0), { open: f, toggle: p, containerRef: m, pending: h, failed: g, runSelect: _ } = Nt({ onReset: () => d(0) }), v = (t) => {
|
|
2136
|
+
e.setPlaybackRate(t), d(0);
|
|
2137
|
+
}, y = (e) => {
|
|
2138
|
+
e !== void 0 && _(e, () => s(e));
|
|
2139
|
+
}, b = (e) => {
|
|
2140
|
+
c && _(e ?? null, () => c.select(e === void 0 ? null : String(e)));
|
|
2141
|
+
}, x = c ? c.options.length + +!!c.offLabel : 0, S = c?.selectedId == null ? c?.offLabel : c.options.find(({ id: e }) => e === c.selectedId)?.label, C = (e) => () => {
|
|
2142
|
+
d(e);
|
|
2053
2143
|
};
|
|
2054
2144
|
return /* @__PURE__ */ F("div", {
|
|
2055
|
-
css:
|
|
2056
|
-
ref:
|
|
2145
|
+
css: Ht,
|
|
2146
|
+
ref: m,
|
|
2057
2147
|
children: [
|
|
2058
|
-
/* @__PURE__ */ P(
|
|
2148
|
+
/* @__PURE__ */ P(St, {
|
|
2059
2149
|
id: "settings",
|
|
2060
|
-
disabled:
|
|
2150
|
+
disabled: f,
|
|
2061
2151
|
text: /* @__PURE__ */ P("button", {
|
|
2062
2152
|
className: "settings",
|
|
2063
2153
|
type: "button",
|
|
2064
|
-
onClick:
|
|
2065
|
-
"aria-label":
|
|
2066
|
-
"aria-expanded":
|
|
2067
|
-
children: /* @__PURE__ */ P(
|
|
2154
|
+
onClick: p,
|
|
2155
|
+
"aria-label": t(a.settings),
|
|
2156
|
+
"aria-expanded": f,
|
|
2157
|
+
children: /* @__PURE__ */ P(K, {})
|
|
2068
2158
|
}),
|
|
2069
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2159
|
+
toolTipText: /* @__PURE__ */ P("span", { children: t(a.settings) })
|
|
2070
2160
|
}),
|
|
2071
|
-
|
|
2161
|
+
f && u === 0 && /* @__PURE__ */ F("div", {
|
|
2072
2162
|
className: "popover menu",
|
|
2073
2163
|
children: [
|
|
2074
|
-
|
|
2075
|
-
onClick:
|
|
2076
|
-
children: [/* @__PURE__ */ P("div", { children:
|
|
2164
|
+
i.length > 1 ? /* @__PURE__ */ F("div", {
|
|
2165
|
+
onClick: C(2),
|
|
2166
|
+
children: [/* @__PURE__ */ P("div", { children: t(a.audio) }), /* @__PURE__ */ P("div", { children: /* @__PURE__ */ P(V, {}) })]
|
|
2077
2167
|
}) : null,
|
|
2078
|
-
|
|
2079
|
-
onClick:
|
|
2080
|
-
children: [/* @__PURE__ */ P("div", { children:
|
|
2168
|
+
x > 1 ? /* @__PURE__ */ F("div", {
|
|
2169
|
+
onClick: C(3),
|
|
2170
|
+
children: [/* @__PURE__ */ P("div", { children: t(a.quality) }), /* @__PURE__ */ F("div", { children: [S ? /* @__PURE__ */ P("span", {
|
|
2081
2171
|
className: "secondary",
|
|
2082
|
-
children:
|
|
2083
|
-
}) : null, /* @__PURE__ */ P(
|
|
2172
|
+
children: S
|
|
2173
|
+
}) : null, /* @__PURE__ */ P(V, {})] })]
|
|
2084
2174
|
}) : null,
|
|
2085
2175
|
/* @__PURE__ */ F("div", {
|
|
2086
|
-
onClick:
|
|
2087
|
-
children: [/* @__PURE__ */ P("div", { children:
|
|
2176
|
+
onClick: C(1),
|
|
2177
|
+
children: [/* @__PURE__ */ P("div", { children: t(a.playbackSpeed) }), /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("span", {
|
|
2088
2178
|
className: "secondary",
|
|
2089
|
-
children:
|
|
2090
|
-
|
|
2179
|
+
children: r === 1 ? t(a.defaultSpeed) : n(r, {
|
|
2180
|
+
minimumFractionDigits: 2,
|
|
2181
|
+
maximumFractionDigits: 2
|
|
2182
|
+
})
|
|
2183
|
+
}), /* @__PURE__ */ P(V, {})] })]
|
|
2091
2184
|
}),
|
|
2092
|
-
|
|
2185
|
+
l ? /* @__PURE__ */ F("div", {
|
|
2093
2186
|
role: "switch",
|
|
2094
|
-
"aria-checked":
|
|
2095
|
-
"aria-disabled": !
|
|
2096
|
-
className:
|
|
2187
|
+
"aria-checked": l.available && l.enabled,
|
|
2188
|
+
"aria-disabled": !l.available,
|
|
2189
|
+
className: l.available ? void 0 : "no-hover unavailable",
|
|
2097
2190
|
onClick: () => {
|
|
2098
|
-
|
|
2191
|
+
l.available && l.setEnabled(!l.enabled);
|
|
2099
2192
|
},
|
|
2100
|
-
children: [/* @__PURE__ */ P("div", { children:
|
|
2193
|
+
children: [/* @__PURE__ */ P("div", { children: t(a.normalizeVolume) }), /* @__PURE__ */ P("div", { children: l.available ? /* @__PURE__ */ P("span", { className: l.enabled ? "switch on" : "switch" }) : /* @__PURE__ */ P("span", {
|
|
2101
2194
|
className: "secondary",
|
|
2102
|
-
children:
|
|
2195
|
+
children: t(a.unavailable)
|
|
2103
2196
|
}) })]
|
|
2104
2197
|
}) : null
|
|
2105
2198
|
]
|
|
2106
2199
|
}),
|
|
2107
|
-
|
|
2200
|
+
f && u === 1 && /* @__PURE__ */ F("div", {
|
|
2108
2201
|
className: "popover playback-rate",
|
|
2109
2202
|
children: [
|
|
2110
2203
|
/* @__PURE__ */ F("div", {
|
|
2111
2204
|
className: "back",
|
|
2112
|
-
onClick:
|
|
2113
|
-
children: [/* @__PURE__ */ P(
|
|
2205
|
+
onClick: C(0),
|
|
2206
|
+
children: [/* @__PURE__ */ P(B, {}), /* @__PURE__ */ P("span", { children: t(a.playbackSpeed) })]
|
|
2114
2207
|
}),
|
|
2115
2208
|
/* @__PURE__ */ P("div", {
|
|
2116
2209
|
className: "slider no-hover",
|
|
2117
|
-
children: /* @__PURE__ */ P(
|
|
2210
|
+
children: /* @__PURE__ */ P(Vt, {})
|
|
2118
2211
|
}),
|
|
2119
|
-
/* @__PURE__ */
|
|
2212
|
+
/* @__PURE__ */ P("div", {
|
|
2120
2213
|
className: "options no-hover",
|
|
2121
|
-
children:
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
}),
|
|
2126
|
-
/* @__PURE__ */ P("div", {
|
|
2127
|
-
onClick: () => h(1),
|
|
2128
|
-
children: "1x"
|
|
2129
|
-
}),
|
|
2130
|
-
/* @__PURE__ */ P("div", {
|
|
2131
|
-
onClick: () => h(1.5),
|
|
2132
|
-
children: "1.5x"
|
|
2133
|
-
}),
|
|
2134
|
-
/* @__PURE__ */ P("div", {
|
|
2135
|
-
onClick: () => h(2),
|
|
2136
|
-
children: "2x"
|
|
2137
|
-
})
|
|
2138
|
-
]
|
|
2214
|
+
children: Ut.map((e) => /* @__PURE__ */ P("div", {
|
|
2215
|
+
onClick: () => v(e),
|
|
2216
|
+
children: t(a.speed, { rate: n(e) })
|
|
2217
|
+
}, e))
|
|
2139
2218
|
})
|
|
2140
2219
|
]
|
|
2141
2220
|
}),
|
|
2142
|
-
|
|
2143
|
-
title:
|
|
2144
|
-
tracks:
|
|
2145
|
-
selected:
|
|
2146
|
-
onSelect:
|
|
2147
|
-
onBack:
|
|
2148
|
-
pending:
|
|
2149
|
-
failed:
|
|
2221
|
+
f && u === 2 && /* @__PURE__ */ P(Mt, {
|
|
2222
|
+
title: t(a.audio),
|
|
2223
|
+
tracks: i,
|
|
2224
|
+
selected: o,
|
|
2225
|
+
onSelect: y,
|
|
2226
|
+
onBack: C(0),
|
|
2227
|
+
pending: h,
|
|
2228
|
+
failed: g
|
|
2150
2229
|
}),
|
|
2151
|
-
|
|
2152
|
-
title:
|
|
2153
|
-
tracks:
|
|
2154
|
-
selected:
|
|
2155
|
-
onSelect:
|
|
2156
|
-
onBack:
|
|
2157
|
-
offLabel:
|
|
2158
|
-
pending:
|
|
2159
|
-
failed:
|
|
2230
|
+
f && u === 3 && c && /* @__PURE__ */ P(Mt, {
|
|
2231
|
+
title: t(a.quality),
|
|
2232
|
+
tracks: c.options,
|
|
2233
|
+
selected: c.selectedId ?? void 0,
|
|
2234
|
+
onSelect: b,
|
|
2235
|
+
onBack: C(0),
|
|
2236
|
+
offLabel: c.offLabel,
|
|
2237
|
+
pending: h,
|
|
2238
|
+
failed: g
|
|
2160
2239
|
})
|
|
2161
2240
|
]
|
|
2162
2241
|
});
|
|
2163
|
-
},
|
|
2242
|
+
}, Gt = E`
|
|
2164
2243
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
2165
2244
|
which is the width of the player box, so it can be clamped to it. */
|
|
2166
2245
|
position: static;
|
|
@@ -2176,44 +2255,44 @@ position: static;
|
|
|
2176
2255
|
}
|
|
2177
2256
|
}
|
|
2178
2257
|
|
|
2179
|
-
${
|
|
2180
|
-
`,
|
|
2181
|
-
let e =
|
|
2182
|
-
if (
|
|
2183
|
-
let
|
|
2258
|
+
${jt}
|
|
2259
|
+
`, Kt = () => {
|
|
2260
|
+
let { format: e } = Q(), t = J((e) => e.subtitleTracks), n = J((e) => e.selectedSubtitleTrack), r = J((e) => e.selectSubtitleTrack), i = J((e) => e.subtitleOffLabel), { open: o, toggle: s, containerRef: c, pending: l, failed: u, runSelect: d } = Nt();
|
|
2261
|
+
if (t.length === 0) return null;
|
|
2262
|
+
let f = n !== void 0;
|
|
2184
2263
|
return /* @__PURE__ */ F("div", {
|
|
2185
|
-
css:
|
|
2186
|
-
ref:
|
|
2187
|
-
children: [/* @__PURE__ */ P(
|
|
2264
|
+
css: Gt,
|
|
2265
|
+
ref: c,
|
|
2266
|
+
children: [/* @__PURE__ */ P(St, {
|
|
2188
2267
|
id: "subtitles",
|
|
2189
|
-
disabled:
|
|
2268
|
+
disabled: o,
|
|
2190
2269
|
text: /* @__PURE__ */ P("button", {
|
|
2191
2270
|
className: "subtitles",
|
|
2192
2271
|
type: "button",
|
|
2193
|
-
onClick:
|
|
2194
|
-
"aria-label":
|
|
2195
|
-
"aria-expanded":
|
|
2196
|
-
"aria-pressed":
|
|
2197
|
-
children:
|
|
2272
|
+
onClick: s,
|
|
2273
|
+
"aria-label": e(a.subtitles),
|
|
2274
|
+
"aria-expanded": o,
|
|
2275
|
+
"aria-pressed": f,
|
|
2276
|
+
children: f ? /* @__PURE__ */ P(L, { className: "captions" }) : /* @__PURE__ */ P(R, { className: "captions-off" })
|
|
2198
2277
|
}),
|
|
2199
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2200
|
-
}),
|
|
2201
|
-
title:
|
|
2202
|
-
tracks:
|
|
2203
|
-
selected:
|
|
2204
|
-
onSelect: (e) =>
|
|
2205
|
-
offLabel:
|
|
2206
|
-
pending:
|
|
2207
|
-
failed:
|
|
2278
|
+
toolTipText: /* @__PURE__ */ P("span", { children: e(a.subtitles) })
|
|
2279
|
+
}), o && /* @__PURE__ */ P(Mt, {
|
|
2280
|
+
title: e(a.subtitles),
|
|
2281
|
+
tracks: t,
|
|
2282
|
+
selected: n,
|
|
2283
|
+
onSelect: (e) => d(e ?? null, () => r(e)),
|
|
2284
|
+
offLabel: i ?? e(a.subtitlesOff),
|
|
2285
|
+
pending: l,
|
|
2286
|
+
failed: u
|
|
2208
2287
|
})]
|
|
2209
2288
|
});
|
|
2210
|
-
},
|
|
2289
|
+
}, qt = {
|
|
2211
2290
|
primary: "#EAEBEE",
|
|
2212
2291
|
secondary: "#D0D0D9",
|
|
2213
2292
|
hover: "rgba(255, 255, 255, 0.13)",
|
|
2214
2293
|
borderPrimary: "#384F70",
|
|
2215
2294
|
backgroundTooltip: "#222222"
|
|
2216
|
-
},
|
|
2295
|
+
}, Jt = E`
|
|
2217
2296
|
display: flex;
|
|
2218
2297
|
align-items: center;
|
|
2219
2298
|
|
|
@@ -2256,33 +2335,33 @@ ${mt}
|
|
|
2256
2335
|
width: 10px;
|
|
2257
2336
|
height: 10px;
|
|
2258
2337
|
}
|
|
2259
|
-
`,
|
|
2260
|
-
let n =
|
|
2261
|
-
ref:
|
|
2338
|
+
`, Yt = ({ value: e, onChange: t }) => {
|
|
2339
|
+
let { number: n } = Q(), r = J((e) => e.volume), i = J((e) => e.muted), a = C(null), o = C(null), { handlers: s } = Ct({
|
|
2340
|
+
ref: o,
|
|
2262
2341
|
onChange: t
|
|
2263
|
-
}),
|
|
2342
|
+
}), c = (n) => {
|
|
2264
2343
|
n.preventDefault();
|
|
2265
2344
|
let r = .05, i = e;
|
|
2266
2345
|
i = n.deltaY < 0 ? Math.min(1, i + r) : Math.max(0, i - r), t(i);
|
|
2267
2346
|
};
|
|
2268
|
-
|
|
2269
|
-
let e =
|
|
2270
|
-
return e && e.addEventListener("wheel",
|
|
2271
|
-
e && e.removeEventListener("wheel",
|
|
2347
|
+
x(() => {
|
|
2348
|
+
let e = a.current;
|
|
2349
|
+
return e && e.addEventListener("wheel", c, { passive: !1 }), () => {
|
|
2350
|
+
e && e.removeEventListener("wheel", c);
|
|
2272
2351
|
};
|
|
2273
2352
|
}, [e]);
|
|
2274
|
-
let
|
|
2275
|
-
return /* @__PURE__ */ P(
|
|
2353
|
+
let l = e * 100, u = S(() => Math.round(i ? 0 : mt(r) * 100), [r, i]);
|
|
2354
|
+
return /* @__PURE__ */ P(St, {
|
|
2276
2355
|
id: "volume-slider",
|
|
2277
2356
|
text: /* @__PURE__ */ P("div", {
|
|
2278
|
-
ref:
|
|
2279
|
-
css:
|
|
2280
|
-
...
|
|
2357
|
+
ref: a,
|
|
2358
|
+
css: Jt,
|
|
2359
|
+
...s,
|
|
2281
2360
|
children: /* @__PURE__ */ P("div", {
|
|
2282
|
-
ref:
|
|
2361
|
+
ref: o,
|
|
2283
2362
|
style: { background: `linear-gradient(to right,
|
|
2284
|
-
#fff 0% ${
|
|
2285
|
-
#3A3A3A ${
|
|
2363
|
+
#fff 0% ${l}%,
|
|
2364
|
+
#3A3A3A ${l}% 100%
|
|
2286
2365
|
)` },
|
|
2287
2366
|
children: /* @__PURE__ */ P("div", {
|
|
2288
2367
|
className: "volume-handle",
|
|
@@ -2290,12 +2369,12 @@ ${mt}
|
|
|
2290
2369
|
})
|
|
2291
2370
|
})
|
|
2292
2371
|
}),
|
|
2293
|
-
toolTipText: /* @__PURE__ */
|
|
2372
|
+
toolTipText: /* @__PURE__ */ P("div", {
|
|
2294
2373
|
className: "volume-value",
|
|
2295
|
-
children:
|
|
2374
|
+
children: n(u / 100, { style: "percent" })
|
|
2296
2375
|
})
|
|
2297
2376
|
});
|
|
2298
|
-
},
|
|
2377
|
+
}, Xt = E`
|
|
2299
2378
|
position: relative;
|
|
2300
2379
|
display: flex;
|
|
2301
2380
|
align-items: center;
|
|
@@ -2320,7 +2399,7 @@ ${mt}
|
|
|
2320
2399
|
border-radius: 4px;
|
|
2321
2400
|
|
|
2322
2401
|
.volume-value {
|
|
2323
|
-
${
|
|
2402
|
+
${$.bMedium.regular};
|
|
2324
2403
|
color: #ffffff;
|
|
2325
2404
|
}
|
|
2326
2405
|
}
|
|
@@ -2358,39 +2437,39 @@ ${mt}
|
|
|
2358
2437
|
}
|
|
2359
2438
|
}
|
|
2360
2439
|
|
|
2361
|
-
`,
|
|
2362
|
-
let t =
|
|
2440
|
+
`, Zt = ({ ref: e }) => {
|
|
2441
|
+
let t = J(), { format: n } = Q(), r = J((e) => e.volume), i = J((e) => e.muted), o = S(() => mt(r), [r]);
|
|
2363
2442
|
return /* @__PURE__ */ F("div", {
|
|
2364
|
-
css:
|
|
2365
|
-
children: [/* @__PURE__ */ P(
|
|
2443
|
+
css: Xt,
|
|
2444
|
+
children: [/* @__PURE__ */ P(St, {
|
|
2366
2445
|
id: "sound",
|
|
2367
2446
|
text: /* @__PURE__ */ P("button", {
|
|
2368
2447
|
className: "sound",
|
|
2369
2448
|
type: "button",
|
|
2370
2449
|
onClick: () => t.toggleMuted(),
|
|
2371
2450
|
ref: e,
|
|
2372
|
-
"aria-label":
|
|
2373
|
-
"aria-pressed":
|
|
2374
|
-
children: P(
|
|
2451
|
+
"aria-label": n(a.mute),
|
|
2452
|
+
"aria-pressed": i || r === 0,
|
|
2453
|
+
children: P(i || r === 0 ? ae : r <= .5 ? re : ie, {
|
|
2375
2454
|
size: 18,
|
|
2376
2455
|
color: "#fff"
|
|
2377
2456
|
})
|
|
2378
2457
|
}),
|
|
2379
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2458
|
+
toolTipText: /* @__PURE__ */ P("span", { children: n(i ? a.unmuteKey : a.muteKey) })
|
|
2380
2459
|
}), /* @__PURE__ */ P("div", {
|
|
2381
2460
|
className: "volume-slider-container",
|
|
2382
2461
|
children: /* @__PURE__ */ P("div", {
|
|
2383
2462
|
className: "volume-slider-background",
|
|
2384
|
-
children: /* @__PURE__ */ P(
|
|
2385
|
-
value:
|
|
2463
|
+
children: /* @__PURE__ */ P(Yt, {
|
|
2464
|
+
value: i ? 0 : o,
|
|
2386
2465
|
onChange: (e) => {
|
|
2387
|
-
t.setVolume(
|
|
2466
|
+
t.setVolume(pt(e));
|
|
2388
2467
|
}
|
|
2389
2468
|
})
|
|
2390
2469
|
})
|
|
2391
2470
|
})]
|
|
2392
2471
|
});
|
|
2393
|
-
},
|
|
2472
|
+
}, Qt = .05, $t = 5, en = 50, tn = 1e3, nn = E`
|
|
2394
2473
|
position: absolute;
|
|
2395
2474
|
bottom: 0;
|
|
2396
2475
|
width: 100%;
|
|
@@ -2482,7 +2561,7 @@ ${mt}
|
|
|
2482
2561
|
/* .armed is the hover of a control letting its click through, which takes no pointer events
|
|
2483
2562
|
of its own and so is never :hover */
|
|
2484
2563
|
:hover, &.armed {
|
|
2485
|
-
background-color: ${
|
|
2564
|
+
background-color: ${qt.hover};
|
|
2486
2565
|
}
|
|
2487
2566
|
|
|
2488
2567
|
/* the hit area grows, the icon does not, keyed on the pointer because a narrow desktop
|
|
@@ -2499,7 +2578,7 @@ ${mt}
|
|
|
2499
2578
|
|
|
2500
2579
|
.left {
|
|
2501
2580
|
.time {
|
|
2502
|
-
${
|
|
2581
|
+
${$.bMedium.regular}
|
|
2503
2582
|
text-shadow: 0 0 4px rgba(0, 0, 0, 1);
|
|
2504
2583
|
}
|
|
2505
2584
|
}
|
|
@@ -2520,40 +2599,40 @@ ${mt}
|
|
|
2520
2599
|
}
|
|
2521
2600
|
}
|
|
2522
2601
|
}
|
|
2523
|
-
`,
|
|
2524
|
-
let r =
|
|
2525
|
-
|
|
2526
|
-
let
|
|
2527
|
-
let n =
|
|
2528
|
-
r.setVolume(
|
|
2529
|
-
}, [r]),
|
|
2530
|
-
|
|
2602
|
+
`, rn = ({ shortcuts: e = "window", root: t, fullscreen: n }) => {
|
|
2603
|
+
let r = J(), { format: i } = Q(), o = J((e) => e.paused), s = J((e) => e.currentTime), c = J((e) => e.duration), l = J((e) => e.seekingTo), u = J((e) => e.fullscreen), d = n ? n.active : u, f = C(n);
|
|
2604
|
+
f.current = n;
|
|
2605
|
+
let p = J((e) => e.hideUI), m = J((e) => e.togglePictureInPicture), h = J((e) => e.pictureInPictureMode), g = J((e) => e.burnedInSubtitles), _ = J((e) => e.passThroughPictureInPicture), v = J((e) => e.subtitleTracks), b = J((e) => e.requestSeek), S = J((e) => e.stepFrame), [T, E] = w(null), D = C(null), O = C(void 0), k = h === "burn-in", ee = v.length > 0, A = c > 0 && s === c, j = y(({ direction: e, stepSize: t }) => {
|
|
2606
|
+
let n = mt(r.volume), i = e === "up" ? t : -t, a = Math.max(0, Math.min(1, n + i)), o = r.muted;
|
|
2607
|
+
r.setVolume(pt(a)), o && !r.muted && r.toggleMuted();
|
|
2608
|
+
}, [r]), M = C(!1), N = y(() => {
|
|
2609
|
+
f.current ? f.current.request() : r.toggleFullscreen();
|
|
2531
2610
|
}, [r]);
|
|
2532
|
-
|
|
2533
|
-
let n = (e) =>
|
|
2534
|
-
|
|
2611
|
+
x(() => {
|
|
2612
|
+
let n = (e) => b ? b(e) : r.seek(e), i = (e) => e.composedPath()[0], a = (e) => {
|
|
2613
|
+
M.current = !!t.current?.contains(i(e) ?? null);
|
|
2535
2614
|
}, o = (a) => {
|
|
2536
2615
|
let o = i(a);
|
|
2537
2616
|
if (o?.isContentEditable || /^(input|textarea|select)$/i.test(o?.tagName ?? "") || (a.ctrlKey || a.metaKey || a.altKey) && !a.getModifierState("AltGraph")) return;
|
|
2538
|
-
let s = t.current?.contains(o ?? null) || o === document.body &&
|
|
2617
|
+
let s = t.current?.contains(o ?? null) || o === document.body && M.current, c = f.current ? f.current.active : r.fullscreen;
|
|
2539
2618
|
if (e === "player" && !c && !s) return;
|
|
2540
2619
|
let l = !0;
|
|
2541
|
-
if (a.key === "f")
|
|
2620
|
+
if (a.key === "f") N();
|
|
2542
2621
|
else if (a.key === "k") r.togglePaused();
|
|
2543
2622
|
else if (a.key === " ") r.togglePaused();
|
|
2544
2623
|
else if (a.key === "m") r.toggleMuted();
|
|
2545
|
-
else if (a.key === "ArrowUp")
|
|
2624
|
+
else if (a.key === "ArrowUp") j({
|
|
2546
2625
|
direction: "up",
|
|
2547
|
-
stepSize:
|
|
2626
|
+
stepSize: Qt
|
|
2548
2627
|
});
|
|
2549
|
-
else if (a.key === "ArrowDown")
|
|
2628
|
+
else if (a.key === "ArrowDown") j({
|
|
2550
2629
|
direction: "down",
|
|
2551
|
-
stepSize:
|
|
2630
|
+
stepSize: Qt
|
|
2552
2631
|
});
|
|
2553
2632
|
else if (a.key === "ArrowRight") {
|
|
2554
2633
|
if (!r.duration) return;
|
|
2555
|
-
n(Math.min(r.currentTime +
|
|
2556
|
-
} else a.key === "ArrowLeft" ? n(Math.max(r.currentTime -
|
|
2634
|
+
n(Math.min(r.currentTime + $t, r.duration));
|
|
2635
|
+
} else a.key === "ArrowLeft" ? n(Math.max(r.currentTime - $t, 0)) : (a.key === "<" || a.key === ">") && S ? S(a.key === ">" ? 1 : -1) : l = !1;
|
|
2557
2636
|
l && a.preventDefault();
|
|
2558
2637
|
};
|
|
2559
2638
|
return window.addEventListener("keydown", o), window.addEventListener("pointerdown", a, !0), window.addEventListener("focusin", a, !0), () => {
|
|
@@ -2561,138 +2640,138 @@ ${mt}
|
|
|
2561
2640
|
};
|
|
2562
2641
|
}, [
|
|
2563
2642
|
r,
|
|
2564
|
-
|
|
2565
|
-
v,
|
|
2643
|
+
j,
|
|
2566
2644
|
b,
|
|
2645
|
+
S,
|
|
2567
2646
|
e,
|
|
2568
2647
|
t,
|
|
2569
|
-
|
|
2648
|
+
N
|
|
2570
2649
|
]);
|
|
2571
|
-
let
|
|
2572
|
-
e.preventDefault(), e.deltaY < 0 ?
|
|
2650
|
+
let I = y((e) => {
|
|
2651
|
+
e.preventDefault(), e.deltaY < 0 ? j({
|
|
2573
2652
|
direction: "up",
|
|
2574
|
-
stepSize:
|
|
2575
|
-
}) :
|
|
2653
|
+
stepSize: Qt
|
|
2654
|
+
}) : j({
|
|
2576
2655
|
direction: "down",
|
|
2577
|
-
stepSize:
|
|
2656
|
+
stepSize: Qt
|
|
2578
2657
|
});
|
|
2579
|
-
}, [
|
|
2580
|
-
|
|
2581
|
-
if (
|
|
2582
|
-
}, [
|
|
2583
|
-
let
|
|
2584
|
-
if (!
|
|
2658
|
+
}, [j]);
|
|
2659
|
+
x(() => {
|
|
2660
|
+
if (T) return T.addEventListener("wheel", I, { passive: !1 }), () => T.removeEventListener("wheel", I);
|
|
2661
|
+
}, [T, I]);
|
|
2662
|
+
let L = (e) => {
|
|
2663
|
+
if (!_ || _.active || _.armed || e.pointerType === "touch") return;
|
|
2585
2664
|
let { left: t, top: n, width: r, height: i } = e.currentTarget.getBoundingClientRect();
|
|
2586
|
-
|
|
2665
|
+
_.arm({
|
|
2587
2666
|
left: t,
|
|
2588
2667
|
top: n,
|
|
2589
2668
|
width: r,
|
|
2590
2669
|
height: i
|
|
2591
2670
|
});
|
|
2592
|
-
},
|
|
2593
|
-
return
|
|
2594
|
-
if (!
|
|
2595
|
-
clearInterval(
|
|
2671
|
+
}, R = !!_?.armed;
|
|
2672
|
+
return x(() => {
|
|
2673
|
+
if (!R) return;
|
|
2674
|
+
clearInterval(O.current);
|
|
2596
2675
|
let e = Infinity, t = setInterval(() => {
|
|
2597
2676
|
if (Date.now() > e) {
|
|
2598
2677
|
clearInterval(t);
|
|
2599
2678
|
return;
|
|
2600
2679
|
}
|
|
2601
|
-
let n =
|
|
2680
|
+
let n = D.current, r = document.activeElement;
|
|
2602
2681
|
n && r?.tagName === "IFRAME" && r.closest(".video")?.parentElement?.contains(n) && n.focus({ preventScroll: !0 });
|
|
2603
|
-
},
|
|
2604
|
-
return
|
|
2605
|
-
e = Date.now() +
|
|
2682
|
+
}, en);
|
|
2683
|
+
return O.current = t, () => {
|
|
2684
|
+
e = Date.now() + tn;
|
|
2606
2685
|
};
|
|
2607
|
-
}, [
|
|
2686
|
+
}, [R]), x(() => () => clearInterval(O.current), []), /* @__PURE__ */ F("div", {
|
|
2608
2687
|
className: "control-bar",
|
|
2609
|
-
css:
|
|
2610
|
-
style: { ...
|
|
2688
|
+
css: nn,
|
|
2689
|
+
style: { ...p ? {
|
|
2611
2690
|
opacity: "0",
|
|
2612
2691
|
pointerEvents: "none"
|
|
2613
|
-
} :
|
|
2614
|
-
children: [/* @__PURE__ */ P(
|
|
2692
|
+
} : R ? { pointerEvents: "none" } : {} },
|
|
2693
|
+
children: [/* @__PURE__ */ P(Et, {}), /* @__PURE__ */ F("div", {
|
|
2615
2694
|
className: "actions",
|
|
2616
2695
|
children: [/* @__PURE__ */ F("div", {
|
|
2617
2696
|
className: "left",
|
|
2618
2697
|
children: [
|
|
2619
|
-
/* @__PURE__ */ P(
|
|
2698
|
+
/* @__PURE__ */ P(St, {
|
|
2620
2699
|
id: "play",
|
|
2621
2700
|
tooltipPlace: "top-start",
|
|
2622
2701
|
text: /* @__PURE__ */ P("button", {
|
|
2623
2702
|
className: "play",
|
|
2624
2703
|
type: "button",
|
|
2625
2704
|
onClick: () => r.togglePaused(),
|
|
2626
|
-
"aria-label":
|
|
2627
|
-
children: P(
|
|
2705
|
+
"aria-label": i(A ? a.replay : o ? a.play : a.pause),
|
|
2706
|
+
children: P(A ? G : o ? W : U, {})
|
|
2628
2707
|
}),
|
|
2629
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2708
|
+
toolTipText: /* @__PURE__ */ P("span", { children: i(A ? a.replayKey : o ? a.playKey : a.pauseKey) })
|
|
2630
2709
|
}),
|
|
2631
|
-
/* @__PURE__ */ P(
|
|
2710
|
+
/* @__PURE__ */ P(Zt, { ref: E }),
|
|
2632
2711
|
/* @__PURE__ */ P("div", {
|
|
2633
2712
|
className: "time",
|
|
2634
|
-
children:
|
|
2713
|
+
children: gt(l ?? s, c)
|
|
2635
2714
|
})
|
|
2636
2715
|
]
|
|
2637
2716
|
}), /* @__PURE__ */ F("div", {
|
|
2638
2717
|
className: "right",
|
|
2639
2718
|
children: [
|
|
2640
|
-
/* @__PURE__ */ P(
|
|
2641
|
-
/* @__PURE__ */ P(
|
|
2642
|
-
/* @__PURE__ */ P(
|
|
2643
|
-
|
|
2719
|
+
/* @__PURE__ */ P(zt, {}),
|
|
2720
|
+
/* @__PURE__ */ P(Kt, {}),
|
|
2721
|
+
/* @__PURE__ */ P(Wt, {}),
|
|
2722
|
+
_ ? /* @__PURE__ */ P(St, {
|
|
2644
2723
|
id: "picture-in-picture",
|
|
2645
2724
|
tooltipPlace: "top-end",
|
|
2646
2725
|
text: /* @__PURE__ */ P("button", {
|
|
2647
|
-
ref:
|
|
2648
|
-
className:
|
|
2726
|
+
ref: D,
|
|
2727
|
+
className: _.armed ? "picture-in-picture armed" : "picture-in-picture",
|
|
2649
2728
|
type: "button",
|
|
2650
|
-
onPointerEnter:
|
|
2651
|
-
onPointerMove:
|
|
2652
|
-
onClick:
|
|
2653
|
-
"aria-label":
|
|
2654
|
-
"aria-pressed":
|
|
2729
|
+
onPointerEnter: L,
|
|
2730
|
+
onPointerMove: L,
|
|
2731
|
+
onClick: _.active ? _.exit : void 0,
|
|
2732
|
+
"aria-label": i(a.pictureInPicture),
|
|
2733
|
+
"aria-pressed": _.active,
|
|
2655
2734
|
children: /* @__PURE__ */ P("img", {
|
|
2656
|
-
src:
|
|
2735
|
+
src: Dt,
|
|
2657
2736
|
alt: ""
|
|
2658
2737
|
})
|
|
2659
2738
|
}),
|
|
2660
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2661
|
-
}) :
|
|
2739
|
+
toolTipText: /* @__PURE__ */ P("span", { children: i(_.active ? a.exitPictureInPicture : a.pictureInPicture) })
|
|
2740
|
+
}) : m ? /* @__PURE__ */ P(St, {
|
|
2662
2741
|
id: "picture-in-picture",
|
|
2663
2742
|
tooltipPlace: "top-end",
|
|
2664
2743
|
text: /* @__PURE__ */ P("button", {
|
|
2665
2744
|
className: "picture-in-picture",
|
|
2666
2745
|
type: "button",
|
|
2667
|
-
onClick:
|
|
2668
|
-
disabled:
|
|
2669
|
-
"aria-label":
|
|
2670
|
-
"aria-pressed":
|
|
2671
|
-
children:
|
|
2672
|
-
src:
|
|
2746
|
+
onClick: m,
|
|
2747
|
+
disabled: k && !ee,
|
|
2748
|
+
"aria-label": i(k ? a.burnIn : a.pictureInPicture),
|
|
2749
|
+
"aria-pressed": k ? g : void 0,
|
|
2750
|
+
children: k ? P(g ? kt : At, {}) : /* @__PURE__ */ P("img", {
|
|
2751
|
+
src: Dt,
|
|
2673
2752
|
alt: ""
|
|
2674
2753
|
})
|
|
2675
2754
|
}),
|
|
2676
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2755
|
+
toolTipText: /* @__PURE__ */ P("span", { children: i(k ? ee ? g ? a.burnedIn : a.burnInOffer : a.noSubtitles : a.pictureInPicture) })
|
|
2677
2756
|
}) : null,
|
|
2678
|
-
/* @__PURE__ */ P(
|
|
2757
|
+
/* @__PURE__ */ P(St, {
|
|
2679
2758
|
id: "full-screen",
|
|
2680
2759
|
tooltipPlace: "top-end",
|
|
2681
2760
|
text: /* @__PURE__ */ P("button", {
|
|
2682
2761
|
className: "full-screen",
|
|
2683
2762
|
type: "button",
|
|
2684
|
-
onClick:
|
|
2685
|
-
"aria-label":
|
|
2686
|
-
"aria-pressed":
|
|
2687
|
-
children: P(
|
|
2763
|
+
onClick: N,
|
|
2764
|
+
"aria-label": i(a.fullScreen),
|
|
2765
|
+
"aria-pressed": d,
|
|
2766
|
+
children: P(d ? ne : H, {})
|
|
2688
2767
|
}),
|
|
2689
|
-
toolTipText: /* @__PURE__ */ P("span", { children:
|
|
2768
|
+
toolTipText: /* @__PURE__ */ P("span", { children: i(d ? a.exitFullScreenKey : a.fullScreenKey) })
|
|
2690
2769
|
})
|
|
2691
2770
|
]
|
|
2692
2771
|
})]
|
|
2693
2772
|
})]
|
|
2694
2773
|
});
|
|
2695
|
-
},
|
|
2774
|
+
}, an = 9e3, on = E`
|
|
2696
2775
|
position: absolute;
|
|
2697
2776
|
inset: 0;
|
|
2698
2777
|
z-index: 2;
|
|
@@ -2724,7 +2803,7 @@ ${mt}
|
|
|
2724
2803
|
}
|
|
2725
2804
|
|
|
2726
2805
|
.text {
|
|
2727
|
-
${
|
|
2806
|
+
${$.bMedium.medium}
|
|
2728
2807
|
color: #fff;
|
|
2729
2808
|
}
|
|
2730
2809
|
|
|
@@ -2735,25 +2814,25 @@ ${mt}
|
|
|
2735
2814
|
line-height: 1;
|
|
2736
2815
|
color: #fff;
|
|
2737
2816
|
}
|
|
2738
|
-
`,
|
|
2739
|
-
let e =
|
|
2740
|
-
return
|
|
2741
|
-
if (
|
|
2742
|
-
|
|
2817
|
+
`, sn = () => {
|
|
2818
|
+
let { format: e } = Q(), t = J((e) => e.burnedInSubtitles), n = J((e) => e.pictureInPictureMode), [r, i] = w(!1);
|
|
2819
|
+
return x(() => {
|
|
2820
|
+
if (n !== "burn-in" || !t) {
|
|
2821
|
+
i(!1);
|
|
2743
2822
|
return;
|
|
2744
2823
|
}
|
|
2745
|
-
|
|
2746
|
-
let
|
|
2747
|
-
return () => clearTimeout(
|
|
2748
|
-
}, [
|
|
2749
|
-
css:
|
|
2750
|
-
className:
|
|
2824
|
+
i(!0);
|
|
2825
|
+
let e = setTimeout(() => i(!1), an);
|
|
2826
|
+
return () => clearTimeout(e);
|
|
2827
|
+
}, [n, t]), n !== "burn-in" || !t ? null : /* @__PURE__ */ P("div", {
|
|
2828
|
+
css: on,
|
|
2829
|
+
className: r ? "show" : "",
|
|
2751
2830
|
role: "status",
|
|
2752
2831
|
children: /* @__PURE__ */ F("div", {
|
|
2753
2832
|
className: "card",
|
|
2754
2833
|
children: [/* @__PURE__ */ P("div", {
|
|
2755
2834
|
className: "text",
|
|
2756
|
-
children:
|
|
2835
|
+
children: e(a.burnInHint)
|
|
2757
2836
|
}), /* @__PURE__ */ P("div", {
|
|
2758
2837
|
className: "arrow",
|
|
2759
2838
|
"aria-hidden": "true",
|
|
@@ -2761,10 +2840,10 @@ ${mt}
|
|
|
2761
2840
|
})]
|
|
2762
2841
|
})
|
|
2763
2842
|
});
|
|
2764
|
-
},
|
|
2765
|
-
opening:
|
|
2766
|
-
ending:
|
|
2767
|
-
},
|
|
2843
|
+
}, cn = 1, ln = 6e3, un = 1, dn = {
|
|
2844
|
+
opening: a.skipOpening,
|
|
2845
|
+
ending: a.skipEnding
|
|
2846
|
+
}, fn = E`
|
|
2768
2847
|
position: absolute;
|
|
2769
2848
|
inset: 0;
|
|
2770
2849
|
z-index: 2;
|
|
@@ -2781,7 +2860,7 @@ ${mt}
|
|
|
2781
2860
|
pointer-events: auto;
|
|
2782
2861
|
cursor: pointer;
|
|
2783
2862
|
|
|
2784
|
-
${
|
|
2863
|
+
${$.bMedium.bold}
|
|
2785
2864
|
color: #fff;
|
|
2786
2865
|
padding: calc(1 * var(--mp-unit)) calc(1.8 * var(--mp-unit));
|
|
2787
2866
|
border: 1px solid rgba(255, 255, 255, .55);
|
|
@@ -2815,47 +2894,47 @@ ${mt}
|
|
|
2815
2894
|
bottom: calc(9 * var(--mp-unit));
|
|
2816
2895
|
}
|
|
2817
2896
|
}
|
|
2818
|
-
`,
|
|
2819
|
-
let e =
|
|
2897
|
+
`, pn = () => {
|
|
2898
|
+
let e = J((e) => e.chapters), t = J((e) => e.currentTime), n = J((e) => e.requestSeek), r = J((e) => e.seekPreview), i = J(), { format: a } = Q(), o = S(() => m(e), [e]), s = S(() => {
|
|
2820
2899
|
if (typeof t != "number") return;
|
|
2821
|
-
let n = e.findIndex((e, n) =>
|
|
2900
|
+
let n = e.findIndex((e, n) => o[n] !== void 0 && e.start - cn <= t && t < e.end), r = n >= 0 ? o[n] : void 0;
|
|
2822
2901
|
return r ? {
|
|
2823
2902
|
kind: r,
|
|
2824
2903
|
end: e[n].end
|
|
2825
2904
|
} : void 0;
|
|
2826
2905
|
}, [
|
|
2827
2906
|
e,
|
|
2828
|
-
|
|
2907
|
+
o,
|
|
2829
2908
|
t
|
|
2830
|
-
]),
|
|
2831
|
-
|
|
2832
|
-
let e = typeof t == "number" ? t : 0, n =
|
|
2833
|
-
|
|
2909
|
+
]), c = C(0), [l, u] = w(0);
|
|
2910
|
+
x(() => {
|
|
2911
|
+
let e = typeof t == "number" ? t : 0, n = c.current;
|
|
2912
|
+
c.current = e, e < n - un && u((e) => e + 1);
|
|
2834
2913
|
}, [t]);
|
|
2835
|
-
let [
|
|
2836
|
-
return
|
|
2914
|
+
let [d, f] = w(!1), p = s ? `${s.kind}@${s.end}` : "";
|
|
2915
|
+
return x(() => {
|
|
2837
2916
|
if (!p) {
|
|
2838
|
-
|
|
2917
|
+
f(!1);
|
|
2839
2918
|
return;
|
|
2840
2919
|
}
|
|
2841
|
-
|
|
2842
|
-
let e = setTimeout(() =>
|
|
2920
|
+
f(!0);
|
|
2921
|
+
let e = setTimeout(() => f(!1), ln);
|
|
2843
2922
|
return () => clearTimeout(e);
|
|
2844
|
-
}, [p,
|
|
2845
|
-
|
|
2846
|
-
}, [
|
|
2847
|
-
css:
|
|
2848
|
-
className:
|
|
2923
|
+
}, [p, l]), x(() => {
|
|
2924
|
+
s || f(!1);
|
|
2925
|
+
}, [s]), s ? /* @__PURE__ */ P("div", {
|
|
2926
|
+
css: fn,
|
|
2927
|
+
className: d && !r ? "show" : "",
|
|
2849
2928
|
children: /* @__PURE__ */ P("button", {
|
|
2850
2929
|
type: "button",
|
|
2851
2930
|
className: "skip-chapter",
|
|
2852
2931
|
onClick: () => {
|
|
2853
|
-
|
|
2932
|
+
f(!1), n ? n(s.end) : i.seek(s.end);
|
|
2854
2933
|
},
|
|
2855
|
-
children:
|
|
2934
|
+
children: a(dn[s.kind])
|
|
2856
2935
|
})
|
|
2857
2936
|
}) : null;
|
|
2858
|
-
},
|
|
2937
|
+
}, mn = 3e3, hn = E`
|
|
2859
2938
|
position: absolute;
|
|
2860
2939
|
inset: 0;
|
|
2861
2940
|
z-index: 2;
|
|
@@ -2866,10 +2945,10 @@ ${mt}
|
|
|
2866
2945
|
hoverable while faded out, popping a tooltip over nothing. It cascades where pointer-events does
|
|
2867
2946
|
not, and transitioning it holds the item on screen for the length of the fade. */
|
|
2868
2947
|
transition: opacity 0.1s cubic-bezier(.4,0,1,1), visibility 0.1s;
|
|
2869
|
-
`,
|
|
2948
|
+
`, gn = (e, t) => {
|
|
2870
2949
|
let n = e.left - t.left, r = e.top - t.top;
|
|
2871
2950
|
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')`;
|
|
2872
|
-
},
|
|
2951
|
+
}, _n = E`
|
|
2873
2952
|
position: relative;
|
|
2874
2953
|
background-color: black;
|
|
2875
2954
|
display: flex;
|
|
@@ -2926,39 +3005,44 @@ ${mt}
|
|
|
2926
3005
|
&.hide {
|
|
2927
3006
|
cursor: none;
|
|
2928
3007
|
}
|
|
2929
|
-
`,
|
|
2930
|
-
let r = `${t}${
|
|
2931
|
-
return
|
|
3008
|
+
`, vn = (e, t = "") => h.toArray(e).flatMap((e, n) => {
|
|
3009
|
+
let r = `${t}${v(e) && e.key != null ? e.key : n}`;
|
|
3010
|
+
return v(e) && e.type === g ? vn(e.props.children, `${r}/`) : [{
|
|
2932
3011
|
key: r,
|
|
2933
3012
|
item: e
|
|
2934
3013
|
}];
|
|
2935
|
-
}),
|
|
2936
|
-
let c =
|
|
3014
|
+
}), yn = ({ ref: e, onVideoRef: t, onSubtitleRef: n, overlay: r, controls: i, shortcuts: a, fullscreen: o, children: s }) => {
|
|
3015
|
+
let c = J(), l = J((e) => e.hideUI), u = J((e) => e.setHideUI), d = J((e) => e.hasMedia), f = J((e) => e.passThroughPictureInPicture), p = C(void 0), m = C("mouse"), h = C({
|
|
2937
3016
|
x: -1,
|
|
2938
3017
|
y: -1
|
|
2939
|
-
}), g =
|
|
2940
|
-
|
|
3018
|
+
}), g = C(!1), _ = C(null);
|
|
3019
|
+
x(() => () => clearTimeout(p.current), []), x(() => {
|
|
3020
|
+
let e = _.current;
|
|
3021
|
+
if (!e) return;
|
|
3022
|
+
let t = new ResizeObserver(([t]) => e.style.setProperty("--mp-height", `${t.contentRect.height}px`));
|
|
3023
|
+
return t.observe(e), () => t.disconnect();
|
|
3024
|
+
}, []), x(() => {
|
|
2941
3025
|
d || (clearTimeout(p.current), u(!1));
|
|
2942
3026
|
}, [d, u]);
|
|
2943
3027
|
let v = () => {
|
|
2944
3028
|
d && u(!0);
|
|
2945
|
-
},
|
|
3029
|
+
}, y = (t) => {
|
|
2946
3030
|
_.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
2947
|
-
},
|
|
3031
|
+
}, b = () => {
|
|
2948
3032
|
if (c.passThroughPictureInPicture?.armed) return !0;
|
|
2949
3033
|
if (m.current !== "mouse") return !1;
|
|
2950
3034
|
let { x: e, y: t } = h.current;
|
|
2951
3035
|
if (!_.current || e < 0) return !1;
|
|
2952
3036
|
let n = document.elementFromPoint(e, t);
|
|
2953
3037
|
return !n || !_.current.contains(n) || n.closest(".video") ? !1 : !n.closest(".control-bar") || g.current || !!_.current.querySelector(".control-bar [aria-expanded=\"true\"]");
|
|
2954
|
-
},
|
|
2955
|
-
if (
|
|
2956
|
-
p.current = setTimeout(
|
|
3038
|
+
}, S = () => {
|
|
3039
|
+
if (b()) {
|
|
3040
|
+
p.current = setTimeout(S, mn);
|
|
2957
3041
|
return;
|
|
2958
3042
|
}
|
|
2959
3043
|
v();
|
|
2960
3044
|
}, w = () => {
|
|
2961
|
-
u(!1), clearTimeout(p.current), p.current = setTimeout(
|
|
3045
|
+
u(!1), clearTimeout(p.current), p.current = setTimeout(S, mn);
|
|
2962
3046
|
}, T = (e) => {
|
|
2963
3047
|
m.current = e.pointerType, e.pointerType === "mouse" && (h.current = {
|
|
2964
3048
|
x: e.clientX,
|
|
@@ -2968,10 +3052,10 @@ ${mt}
|
|
|
2968
3052
|
m.current = e.pointerType, g.current = !0;
|
|
2969
3053
|
}, D = () => {
|
|
2970
3054
|
g.current = !1;
|
|
2971
|
-
}, O =
|
|
3055
|
+
}, O = C(!0);
|
|
2972
3056
|
return /* @__PURE__ */ F("div", {
|
|
2973
|
-
css:
|
|
2974
|
-
ref:
|
|
3057
|
+
css: _n,
|
|
3058
|
+
ref: y,
|
|
2975
3059
|
onPointerMove: T,
|
|
2976
3060
|
onPointerDown: E,
|
|
2977
3061
|
onPointerUp: D,
|
|
@@ -2985,9 +3069,9 @@ ${mt}
|
|
|
2985
3069
|
className: l ? "hide" : "",
|
|
2986
3070
|
tabIndex: a === "player" ? -1 : void 0,
|
|
2987
3071
|
children: [
|
|
2988
|
-
/* @__PURE__ */ P(
|
|
2989
|
-
|
|
2990
|
-
css:
|
|
3072
|
+
/* @__PURE__ */ P(ut, { onSubtitleRef: n }),
|
|
3073
|
+
vn(r).map(({ key: e, item: t }) => /* @__PURE__ */ P("div", {
|
|
3074
|
+
css: hn,
|
|
2991
3075
|
style: { ...l ? {
|
|
2992
3076
|
opacity: "0",
|
|
2993
3077
|
visibility: "hidden",
|
|
@@ -2995,19 +3079,19 @@ ${mt}
|
|
|
2995
3079
|
} : {} },
|
|
2996
3080
|
children: t
|
|
2997
3081
|
}, e)),
|
|
2998
|
-
i === !1 ? null : /* @__PURE__ */ P(
|
|
3082
|
+
i === !1 ? null : /* @__PURE__ */ P(xt, {
|
|
2999
3083
|
value: !!o,
|
|
3000
|
-
children: /* @__PURE__ */ P(
|
|
3084
|
+
children: /* @__PURE__ */ P(rn, {
|
|
3001
3085
|
shortcuts: a,
|
|
3002
3086
|
root: _,
|
|
3003
3087
|
fullscreen: o
|
|
3004
3088
|
})
|
|
3005
3089
|
}),
|
|
3006
|
-
/* @__PURE__ */ P(
|
|
3007
|
-
/* @__PURE__ */ P(
|
|
3090
|
+
/* @__PURE__ */ P(sn, {}),
|
|
3091
|
+
/* @__PURE__ */ P(pn, {}),
|
|
3008
3092
|
f?.armed && _.current ? /* @__PURE__ */ P("div", {
|
|
3009
3093
|
className: "pass-through",
|
|
3010
|
-
style: { clipPath:
|
|
3094
|
+
style: { clipPath: gn(f.armed, _.current.getBoundingClientRect()) },
|
|
3011
3095
|
onPointerOver: f.disarm
|
|
3012
3096
|
}) : null,
|
|
3013
3097
|
/* @__PURE__ */ F("div", {
|
|
@@ -3030,22 +3114,22 @@ ${mt}
|
|
|
3030
3114
|
})
|
|
3031
3115
|
]
|
|
3032
3116
|
});
|
|
3033
|
-
},
|
|
3034
|
-
let n = "media" in e ? e : null, r = n ? null : e, { title: i, chapters: a } = e, { size: o, downloadedRanges: s, publicPath:
|
|
3035
|
-
|
|
3036
|
-
let { expose: E } = e, [
|
|
3117
|
+
}, bn = (e, t) => ({ title: e.options.find((e) => e.id === t)?.label }), xn = (e, t) => e instanceof Promise ? e.then(t) : t(), Sn = ({ options: e, children: t }) => {
|
|
3118
|
+
let n = "media" in e ? e : null, r = n ? null : e, { title: i, chapters: a } = e, { size: o, downloadedRanges: s, publicPath: c, libavWorkerUrl: l, read: d, thumbnailRead: f, thumbnailsEnabled: p, readsDownload: m } = r ?? {}, h = ee(), g = k(), [_, v] = w(null), [y, b] = w(null), T = n?.media ?? _;
|
|
3119
|
+
x(() => (h?.(T), () => h?.(null)), [T, h]), Pe(T, n?.stepFrame);
|
|
3120
|
+
let { expose: E } = e, [D, O] = w(null), [A] = w(() => Object.assign(new EventTarget(), {
|
|
3037
3121
|
chapters: [],
|
|
3038
|
-
onHostFullscreen:
|
|
3039
|
-
})),
|
|
3040
|
-
|
|
3041
|
-
let
|
|
3042
|
-
|
|
3122
|
+
onHostFullscreen: O
|
|
3123
|
+
})), j = E === !0 ? {} : E || void 0, M = C(j);
|
|
3124
|
+
M.current = j;
|
|
3125
|
+
let N = j ? j.id : void 0, F = j ? j.origin : void 0, I = j ? j.channel : void 0;
|
|
3126
|
+
x(() => {
|
|
3043
3127
|
if (!E || !T) return;
|
|
3044
3128
|
let e, t = !1;
|
|
3045
3129
|
return import("./remote/index.js").then(({ exposePlayer: n }) => {
|
|
3046
3130
|
t || (e = n(T, {
|
|
3047
|
-
...
|
|
3048
|
-
player:
|
|
3131
|
+
...M.current,
|
|
3132
|
+
player: A
|
|
3049
3133
|
}));
|
|
3050
3134
|
}).catch(() => {}), () => {
|
|
3051
3135
|
t = !0, e?.();
|
|
@@ -3053,152 +3137,152 @@ ${mt}
|
|
|
3053
3137
|
}, [
|
|
3054
3138
|
T,
|
|
3055
3139
|
!!E,
|
|
3140
|
+
N,
|
|
3056
3141
|
F,
|
|
3057
|
-
I
|
|
3058
|
-
L
|
|
3142
|
+
I
|
|
3059
3143
|
]);
|
|
3060
|
-
let
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
}, [
|
|
3064
|
-
let
|
|
3065
|
-
active:
|
|
3066
|
-
request: () =>
|
|
3067
|
-
}),
|
|
3068
|
-
|
|
3069
|
-
let
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
}, [
|
|
3073
|
-
let
|
|
3074
|
-
|
|
3075
|
-
let
|
|
3076
|
-
|
|
3077
|
-
let
|
|
3078
|
-
tap:
|
|
3079
|
-
audioStreamIndex:
|
|
3144
|
+
let L = J((e) => e.chapters), R = JSON.stringify(L);
|
|
3145
|
+
x(() => {
|
|
3146
|
+
A.chapters = L, A.dispatchEvent(new Event("chapterschange"));
|
|
3147
|
+
}, [R]);
|
|
3148
|
+
let z = e.fullscreen ?? (D === null ? void 0 : {
|
|
3149
|
+
active: D,
|
|
3150
|
+
request: () => A.dispatchEvent(new Event("fullscreenrequest"))
|
|
3151
|
+
}), B = S(() => tt(), [o]);
|
|
3152
|
+
Ae(_, y, r, m ? B.push : void 0);
|
|
3153
|
+
let V = r?.normalizeVolume ?? !0, [te, H] = w(V);
|
|
3154
|
+
x(() => {
|
|
3155
|
+
H(V);
|
|
3156
|
+
}, [V]);
|
|
3157
|
+
let ne = C(r?.onNormalizeVolumeChange);
|
|
3158
|
+
ne.current = r?.onNormalizeVolumeChange;
|
|
3159
|
+
let U = r?.normalizerWorkletUrl, W = C(f ?? d);
|
|
3160
|
+
W.current = f ?? d;
|
|
3161
|
+
let G = J((e) => e.selectedAudioTrack), K = !!d, { refused: q } = et(_, U, te, S(() => K && o && c && l && typeof G == "number" && G >= 0 ? m ? {
|
|
3162
|
+
tap: B,
|
|
3163
|
+
audioStreamIndex: G
|
|
3080
3164
|
} : {
|
|
3081
|
-
read: (e, t) =>
|
|
3165
|
+
read: (e, t) => W.current(e, t),
|
|
3082
3166
|
length: o,
|
|
3083
|
-
publicPath:
|
|
3084
|
-
libavWorkerUrl:
|
|
3085
|
-
audioStreamIndex:
|
|
3167
|
+
publicPath: c,
|
|
3168
|
+
libavWorkerUrl: l,
|
|
3169
|
+
audioStreamIndex: G
|
|
3086
3170
|
} : void 0, [
|
|
3087
|
-
|
|
3171
|
+
K,
|
|
3088
3172
|
o,
|
|
3173
|
+
c,
|
|
3089
3174
|
l,
|
|
3090
|
-
|
|
3091
|
-
K,
|
|
3175
|
+
G,
|
|
3092
3176
|
m,
|
|
3093
|
-
|
|
3094
|
-
]),
|
|
3095
|
-
enabled:
|
|
3096
|
-
available: !
|
|
3177
|
+
B
|
|
3178
|
+
]), S(() => s?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [s?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")])), re = S(() => U && typeof AudioWorkletNode == "function" ? {
|
|
3179
|
+
enabled: te,
|
|
3180
|
+
available: !q,
|
|
3097
3181
|
setEnabled: (e) => {
|
|
3098
|
-
|
|
3182
|
+
H(e), ne.current?.(e);
|
|
3099
3183
|
}
|
|
3100
3184
|
} : null, [
|
|
3101
|
-
G,
|
|
3102
3185
|
U,
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3186
|
+
te,
|
|
3187
|
+
q
|
|
3188
|
+
]), { thumbnails: ie, requestThumbnail: ae } = Le({
|
|
3189
|
+
publicPath: c,
|
|
3190
|
+
workerUrl: l,
|
|
3107
3191
|
length: p === !1 ? void 0 : o,
|
|
3108
3192
|
read: f ?? d,
|
|
3109
3193
|
downloadedRanges: s
|
|
3110
|
-
}),
|
|
3111
|
-
|
|
3112
|
-
|
|
3194
|
+
}), oe = n?.thumbnails?.all ?? ie, { toggle: se, mode: ce, burnedIn: le } = Re(_, y), ue = We(n?.media ?? null, n?.pictureInPicture), Y = J((e) => e.setSourceState), de = n ? !!n.media : o !== void 0;
|
|
3195
|
+
x(() => {
|
|
3196
|
+
Y({
|
|
3113
3197
|
title: i,
|
|
3114
3198
|
size: o,
|
|
3115
3199
|
downloadedRanges: s,
|
|
3116
|
-
hasMedia:
|
|
3200
|
+
hasMedia: de
|
|
3117
3201
|
});
|
|
3118
3202
|
}, [
|
|
3119
|
-
|
|
3203
|
+
Y,
|
|
3120
3204
|
i,
|
|
3121
3205
|
o,
|
|
3122
3206
|
s,
|
|
3123
|
-
|
|
3207
|
+
de
|
|
3124
3208
|
]);
|
|
3125
|
-
let
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
thumbnails:
|
|
3129
|
-
thumbnailAt:
|
|
3130
|
-
requestThumbnail:
|
|
3131
|
-
togglePictureInPicture:
|
|
3132
|
-
pictureInPictureMode:
|
|
3133
|
-
burnedInSubtitles:
|
|
3209
|
+
let fe = n?.thumbnails?.at;
|
|
3210
|
+
x(() => {
|
|
3211
|
+
Y({
|
|
3212
|
+
thumbnails: oe,
|
|
3213
|
+
thumbnailAt: fe,
|
|
3214
|
+
requestThumbnail: ae,
|
|
3215
|
+
togglePictureInPicture: se,
|
|
3216
|
+
pictureInPictureMode: ce,
|
|
3217
|
+
burnedInSubtitles: le
|
|
3134
3218
|
});
|
|
3135
3219
|
}, [
|
|
3136
|
-
|
|
3137
|
-
ae,
|
|
3138
|
-
de,
|
|
3139
|
-
ie,
|
|
3220
|
+
Y,
|
|
3140
3221
|
oe,
|
|
3222
|
+
fe,
|
|
3223
|
+
ae,
|
|
3141
3224
|
se,
|
|
3142
|
-
ce
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3225
|
+
ce,
|
|
3226
|
+
le
|
|
3227
|
+
]), x(() => {
|
|
3228
|
+
Y({ volumeNormalizer: re });
|
|
3229
|
+
}, [Y, re]), x(() => {
|
|
3230
|
+
Y({ passThroughPictureInPicture: ue });
|
|
3231
|
+
}, [Y, ue]);
|
|
3232
|
+
let X = n?.subtitles?.selection, Z = n?.audioTracks?.selection, pe = C({
|
|
3149
3233
|
audio: e.onPreferredAudioLanguageChange,
|
|
3150
3234
|
subtitles: e.onPreferredSubtitleLanguageChange
|
|
3151
3235
|
});
|
|
3152
3236
|
pe.current = {
|
|
3153
3237
|
audio: e.onPreferredAudioLanguageChange,
|
|
3154
3238
|
subtitles: e.onPreferredSubtitleLanguageChange
|
|
3155
|
-
},
|
|
3156
|
-
|
|
3157
|
-
subtitleTracks:
|
|
3239
|
+
}, x(() => {
|
|
3240
|
+
X && Y({
|
|
3241
|
+
subtitleTracks: X.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3158
3242
|
id: e,
|
|
3159
3243
|
label: t,
|
|
3160
3244
|
disabled: n
|
|
3161
3245
|
})),
|
|
3162
|
-
selectedSubtitleTrack:
|
|
3246
|
+
selectedSubtitleTrack: X.selectedId ?? void 0,
|
|
3163
3247
|
selectSubtitleTrack: (e) => {
|
|
3164
|
-
let t = e == null ? null : String(e), n = t === null ? void 0 :
|
|
3165
|
-
return
|
|
3166
|
-
let e = t === null ? null :
|
|
3248
|
+
let t = e == null ? null : String(e), n = t === null ? void 0 : bn(X, t), r = X.selectedId === null;
|
|
3249
|
+
return xn(X.select(t), () => {
|
|
3250
|
+
let e = t === null ? null : u(n) ?? (r ? n?.title : void 0);
|
|
3167
3251
|
e !== void 0 && pe.current.subtitles?.(e);
|
|
3168
3252
|
});
|
|
3169
3253
|
},
|
|
3170
|
-
subtitleOffLabel:
|
|
3254
|
+
subtitleOffLabel: X.offLabel
|
|
3171
3255
|
});
|
|
3172
|
-
}, [
|
|
3173
|
-
|
|
3174
|
-
audioTracks:
|
|
3256
|
+
}, [Y, X]), x(() => {
|
|
3257
|
+
Z && Y({
|
|
3258
|
+
audioTracks: Z.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3175
3259
|
id: e,
|
|
3176
3260
|
label: t,
|
|
3177
3261
|
disabled: n
|
|
3178
3262
|
})),
|
|
3179
|
-
selectedAudioTrack:
|
|
3180
|
-
selectAudioTrack: (e) =>
|
|
3181
|
-
let t =
|
|
3263
|
+
selectedAudioTrack: Z.selectedId ?? void 0,
|
|
3264
|
+
selectAudioTrack: (e) => xn(Z.select(String(e)), () => {
|
|
3265
|
+
let t = u(bn(Z, String(e)));
|
|
3182
3266
|
t !== void 0 && pe.current.audio?.(t);
|
|
3183
3267
|
})
|
|
3184
3268
|
});
|
|
3185
|
-
}, [
|
|
3269
|
+
}, [Y, Z]);
|
|
3186
3270
|
let me = n?.quality?.selection ?? null;
|
|
3187
|
-
return
|
|
3188
|
-
|
|
3189
|
-
}, [
|
|
3190
|
-
a &&
|
|
3191
|
-
}, [
|
|
3271
|
+
return x(() => {
|
|
3272
|
+
Y({ quality: me });
|
|
3273
|
+
}, [Y, me]), x(() => {
|
|
3274
|
+
a && Y({ chapters: a });
|
|
3275
|
+
}, [Y, a]), /* @__PURE__ */ P(yn, {
|
|
3192
3276
|
ref: g,
|
|
3193
3277
|
onVideoRef: n ? void 0 : v,
|
|
3194
|
-
onSubtitleRef:
|
|
3278
|
+
onSubtitleRef: b,
|
|
3195
3279
|
overlay: e.overlay,
|
|
3196
3280
|
controls: e.controls,
|
|
3197
3281
|
shortcuts: e.shortcuts,
|
|
3198
|
-
fullscreen:
|
|
3282
|
+
fullscreen: z,
|
|
3199
3283
|
children: t
|
|
3200
3284
|
});
|
|
3201
|
-
},
|
|
3285
|
+
}, Cn = E`
|
|
3202
3286
|
/**
|
|
3203
3287
|
* The chrome's whole scale, in one place.
|
|
3204
3288
|
*
|
|
@@ -3268,17 +3352,20 @@ ${mt}
|
|
|
3268
3352
|
height: 100%;
|
|
3269
3353
|
width: 100%;
|
|
3270
3354
|
overflow: hidden;
|
|
3271
|
-
`,
|
|
3272
|
-
css:
|
|
3273
|
-
children: /* @__PURE__ */ P(
|
|
3274
|
-
|
|
3275
|
-
children:
|
|
3355
|
+
`, wn = (e) => /* @__PURE__ */ P("div", {
|
|
3356
|
+
css: Cn,
|
|
3357
|
+
children: /* @__PURE__ */ P(le.Provider, { children: /* @__PURE__ */ P(ve, {
|
|
3358
|
+
language: e.language,
|
|
3359
|
+
children: /* @__PURE__ */ P(Sn, {
|
|
3360
|
+
options: e,
|
|
3361
|
+
children: e.children
|
|
3362
|
+
})
|
|
3276
3363
|
}) })
|
|
3277
|
-
}),
|
|
3364
|
+
}), Tn = (e) => !!e && typeof e == "object" && "at" in e, En = (e) => !!e && typeof e == "object" && "selection" in e, Dn = ({ blob: e, name: t }) => ({
|
|
3278
3365
|
length: e.size,
|
|
3279
3366
|
name: t ?? (e instanceof File ? e.name : void 0),
|
|
3280
3367
|
read: (t, n) => e.slice(t, t + n).arrayBuffer()
|
|
3281
|
-
}),
|
|
3368
|
+
}), On = async (e, t) => {
|
|
3282
3369
|
let n = await fetch(e, {
|
|
3283
3370
|
headers: { Range: "bytes=0-1" },
|
|
3284
3371
|
credentials: t
|
|
@@ -3288,8 +3375,8 @@ ${mt}
|
|
|
3288
3375
|
if (!Number.isFinite(i) || i <= 0) throw Error("The source did not report its length");
|
|
3289
3376
|
if (!r && n.status !== 206) throw Error("The source does not support range requests");
|
|
3290
3377
|
return i;
|
|
3291
|
-
},
|
|
3292
|
-
let i = t ?? await
|
|
3378
|
+
}, kn = async ({ url: e, length: t, name: n, credentials: r }) => {
|
|
3379
|
+
let i = t ?? await On(e, r);
|
|
3293
3380
|
return {
|
|
3294
3381
|
length: i,
|
|
3295
3382
|
name: n,
|
|
@@ -3305,9 +3392,9 @@ ${mt}
|
|
|
3305
3392
|
},
|
|
3306
3393
|
readsDownload: !0
|
|
3307
3394
|
};
|
|
3308
|
-
},
|
|
3309
|
-
if ("blob" in e) return
|
|
3310
|
-
if ("url" in e) return
|
|
3395
|
+
}, An = async (e) => {
|
|
3396
|
+
if ("blob" in e) return Dn(e);
|
|
3397
|
+
if ("url" in e) return kn(e);
|
|
3311
3398
|
if ("read" in e) return {
|
|
3312
3399
|
length: e.length,
|
|
3313
3400
|
name: e.name,
|
|
@@ -3316,4 +3403,4 @@ ${mt}
|
|
|
3316
3403
|
throw Error(`Unknown source type: ${e}`);
|
|
3317
3404
|
};
|
|
3318
3405
|
//#endregion
|
|
3319
|
-
export {
|
|
3406
|
+
export { wn as MediaPlayer, wn as default, le as Player, t as SUBTITLES_OFF, c as createPictureInPicture, l as createSubtitleRenderer, o as createThumbnailGenerator, An as inputToRemuxerInput, En as isDelegatedTracks, Tn as isExternalThumbnails, ce as sourceFeature, s as startPlayback, Re as usePictureInPicture, J as usePlayer, Le as useSeekThumbnails };
|