@banou/media-player 0.10.34 → 0.10.36
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 -8
- package/dist/cs-CxBZ1aTx.js +52 -0
- package/dist/el-BVTNfAWK.js +52 -0
- package/dist/hi-rBroV7g8.js +52 -0
- package/dist/hu-m-QKaaxF.js +52 -0
- package/dist/id-BYpApdK9.js +52 -0
- package/dist/index.js +615 -599
- package/dist/language/index.d.ts +39 -5
- package/dist/language/index.js +53 -18
- package/dist/ms-8pQbqM0D.js +52 -0
- package/dist/nl-q7xvc3xW.js +52 -0
- package/dist/react/video-player.d.ts +18 -2
- package/dist/ro-DBrd08Df.js +52 -0
- package/dist/sv-DJC3tXfW.js +52 -0
- package/dist/th-BNzU_FYo.js +52 -0
- package/dist/uk-C66esN2W.js +52 -0
- package/dist/vi-oOaDECwu.js +52 -0
- package/package.json +1 -1
- package/src/lib/language/index.ts +94 -13
- package/src/lib/locales/cs.json +49 -0
- package/src/lib/locales/el.json +49 -0
- package/src/lib/locales/hi.json +49 -0
- package/src/lib/locales/hu.json +49 -0
- package/src/lib/locales/id.json +49 -0
- package/src/lib/locales/ms.json +49 -0
- package/src/lib/locales/nl.json +49 -0
- package/src/lib/locales/ro.json +49 -0
- package/src/lib/locales/sv.json +49 -0
- package/src/lib/locales/th.json +49 -0
- package/src/lib/locales/uk.json +49 -0
- package/src/lib/locales/vi.json +49 -0
- package/src/lib/react/hooks/use-playback.ts +20 -19
- package/src/lib/react/labels.tsx +12 -0
- package/src/lib/react/video-player.tsx +26 -7
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
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-BZDbaSfM.js";
|
|
2
|
-
import { languageOf as u,
|
|
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 { Fragment as
|
|
10
|
-
import { createMediaElementSource as
|
|
11
|
-
import { Captions as
|
|
12
|
-
import { Tooltip as
|
|
2
|
+
import { languageOf as u, playsIn as d, startingTracks as f } from "./language/index.js";
|
|
3
|
+
import { n as p, r as m, t as h } from "./chapters-EBYXcEml.js";
|
|
4
|
+
import { Children as g, Fragment as _, createContext as v, isValidElement as y, useCallback as b, useContext as x, useEffect as S, useMemo as C, useRef as w, useState as T, useSyncExternalStore as E } from "react";
|
|
5
|
+
import { css as D, keyframes as O } from "@emotion/react";
|
|
6
|
+
import { createPlayer as k, useContainerAttach as A, useMediaAttach as j } from "@videojs/react";
|
|
7
|
+
import { definePlayerFeature as M, videoFeatures as N } from "@videojs/core/dom";
|
|
8
|
+
import { makeRemuxer as P } from "libav-wasm";
|
|
9
|
+
import { Fragment as F, jsx as I, jsxs as L } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { createMediaElementSource as R } from "@banou/ponyfill/web-audio";
|
|
11
|
+
import { Captions as z, CaptionsOff as B, Check as V, ChevronLeft as ee, ChevronRight as te, Copy as H, Maximize as ne, Minimize as U, Pause as re, Play as W, RotateCcw as G, Settings as K, TriangleAlert as q, Volume1 as ie, Volume2 as J, 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,34 +36,46 @@ var oe = {
|
|
|
36
36
|
playbackErrors: [],
|
|
37
37
|
ready: !1,
|
|
38
38
|
setSourceState: () => {}
|
|
39
|
-
},
|
|
39
|
+
}, ce = M({
|
|
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 = k({
|
|
49
|
+
features: [...N, ce],
|
|
50
50
|
displayName: "MediaPlayer"
|
|
51
|
-
}), Y =
|
|
51
|
+
}), Y = le.usePlayer, ue = {
|
|
52
52
|
ar: () => import("./ar-CS4Yzfxw.js"),
|
|
53
|
+
cs: () => import("./cs-CxBZ1aTx.js"),
|
|
53
54
|
de: () => import("./de-DphEdq0O.js"),
|
|
55
|
+
el: () => import("./el-BVTNfAWK.js"),
|
|
54
56
|
"es-419": () => import("./es-419-D6gsvnn8.js"),
|
|
55
57
|
fr: () => import("./fr-BqAzAJX0.js"),
|
|
56
58
|
he: () => import("./he-DbFw1CdO.js"),
|
|
59
|
+
hi: () => import("./hi-rBroV7g8.js"),
|
|
60
|
+
hu: () => import("./hu-m-QKaaxF.js"),
|
|
61
|
+
id: () => import("./id-BYpApdK9.js"),
|
|
57
62
|
it: () => import("./it-NTcUh3Gr.js"),
|
|
58
63
|
ja: () => import("./ja-DSmX_bxj.js"),
|
|
59
64
|
ko: () => import("./ko-DyPzWasj.js"),
|
|
65
|
+
ms: () => import("./ms-8pQbqM0D.js"),
|
|
66
|
+
nl: () => import("./nl-q7xvc3xW.js"),
|
|
60
67
|
pl: () => import("./pl-C6Ow4ra5.js"),
|
|
61
68
|
"pt-BR": () => import("./pt-BR-wudK3giz.js"),
|
|
69
|
+
ro: () => import("./ro-DBrd08Df.js"),
|
|
62
70
|
ru: () => import("./ru-D5kxBkik.js"),
|
|
71
|
+
sv: () => import("./sv-DJC3tXfW.js"),
|
|
72
|
+
th: () => import("./th-BNzU_FYo.js"),
|
|
63
73
|
tr: () => import("./tr-CW7R7N9k.js"),
|
|
74
|
+
uk: () => import("./uk-C66esN2W.js"),
|
|
75
|
+
vi: () => import("./vi-oOaDECwu.js"),
|
|
64
76
|
"zh-Hans": () => import("./zh-Hans-IhL1Pl78.js"),
|
|
65
77
|
"zh-Hant": () => import("./zh-Hant-C5YyFjEc.js")
|
|
66
|
-
},
|
|
78
|
+
}, de = Object.keys(ue), fe = (e) => {
|
|
67
79
|
try {
|
|
68
80
|
let t = new Intl.Locale(e), { language: n, script: r } = t.maximize();
|
|
69
81
|
return {
|
|
@@ -75,31 +87,31 @@ var oe = {
|
|
|
75
87
|
return;
|
|
76
88
|
}
|
|
77
89
|
}, X = (e) => {
|
|
78
|
-
let t =
|
|
90
|
+
let t = fe(e);
|
|
79
91
|
if (!t) return;
|
|
80
|
-
let n =
|
|
81
|
-
...
|
|
92
|
+
let n = de.map((e) => ({
|
|
93
|
+
...fe(e),
|
|
82
94
|
catalogue: e
|
|
83
95
|
}));
|
|
84
96
|
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;
|
|
85
|
-
},
|
|
86
|
-
let n =
|
|
87
|
-
return n || (n = Promise.all([import("@formatjs/intl"),
|
|
97
|
+
}, pe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), Z = (e, t) => {
|
|
98
|
+
let n = me.get(e);
|
|
99
|
+
return n || (n = Promise.all([import("@formatjs/intl"), ue[t]()]).then(([{ createIntl: t }, { default: n }]) => {
|
|
88
100
|
let r = t({
|
|
89
101
|
locale: e,
|
|
90
102
|
defaultLocale: "en",
|
|
91
103
|
messages: n
|
|
92
104
|
});
|
|
93
|
-
return
|
|
94
|
-
}), n.catch(() =>
|
|
95
|
-
},
|
|
105
|
+
return pe.set(e, r), r;
|
|
106
|
+
}), n.catch(() => me.delete(e)), me.set(e, n)), n;
|
|
107
|
+
}, he = (e) => {
|
|
96
108
|
try {
|
|
97
109
|
return Intl.getCanonicalLocales(e)[0];
|
|
98
110
|
} catch {
|
|
99
111
|
return;
|
|
100
112
|
}
|
|
101
|
-
},
|
|
102
|
-
let r = t ?
|
|
113
|
+
}, ge = (e, t) => {
|
|
114
|
+
let r = t ? he(t) ?? "en" : void 0;
|
|
103
115
|
return {
|
|
104
116
|
format: (t, ...[r]) => e ? e.formatMessage({
|
|
105
117
|
id: t,
|
|
@@ -108,10 +120,10 @@ var oe = {
|
|
|
108
120
|
number: (e, t) => new Intl.NumberFormat(r ?? "en", t).format(e),
|
|
109
121
|
locale: r
|
|
110
122
|
};
|
|
111
|
-
},
|
|
112
|
-
let n = e ? X(e) : void 0, [, r] =
|
|
113
|
-
|
|
114
|
-
if (!e || !n ||
|
|
123
|
+
}, _e = ge(void 0, void 0), ve = v(_e), Q = () => x(ve), ye = ({ language: e, children: t }) => {
|
|
124
|
+
let n = e ? X(e) : void 0, [, r] = T();
|
|
125
|
+
S(() => {
|
|
126
|
+
if (!e || !n || pe.has(e)) return;
|
|
115
127
|
let t = !1;
|
|
116
128
|
return Z(e, n).then((e) => {
|
|
117
129
|
t || r(e);
|
|
@@ -119,12 +131,12 @@ var oe = {
|
|
|
119
131
|
t = !0;
|
|
120
132
|
};
|
|
121
133
|
}, [e, n]);
|
|
122
|
-
let i = e && n ?
|
|
123
|
-
return /* @__PURE__ */
|
|
134
|
+
let i = e && n ? pe.get(e) : void 0, a = C(() => e ? ge(i, e) : _e, [i, e]);
|
|
135
|
+
return /* @__PURE__ */ I(ve.Provider, {
|
|
124
136
|
value: a,
|
|
125
137
|
children: t
|
|
126
138
|
});
|
|
127
|
-
},
|
|
139
|
+
}, be = (e, t) => {
|
|
128
140
|
if (e && e !== "und") try {
|
|
129
141
|
return new Intl.DisplayNames([t ?? (navigator.language || "en")], {
|
|
130
142
|
type: "language",
|
|
@@ -133,32 +145,28 @@ var oe = {
|
|
|
133
145
|
} catch {
|
|
134
146
|
return;
|
|
135
147
|
}
|
|
136
|
-
},
|
|
137
|
-
let r = (e) => t ? t.format(a.track, { number: e }) : n(a.track, { number: e }), i = e.map((e) =>
|
|
148
|
+
}, xe = (e) => e?.replace(/_/g, " ").trim() || void 0, Se = (e, t) => {
|
|
149
|
+
let r = (e) => t ? t.format(a.track, { number: e }) : n(a.track, { number: e }), i = e.map((e) => be(e.language, t?.locale) ?? xe(e.title) ?? r(e.streamIndex)), o = i.reduce((e, t) => ({
|
|
138
150
|
...e,
|
|
139
151
|
[t]: (e[t] ?? 0) + 1
|
|
140
152
|
}), {});
|
|
141
153
|
return e.map((e, t) => {
|
|
142
|
-
let n = i[t], r =
|
|
154
|
+
let n = i[t], r = xe(e.title);
|
|
143
155
|
return {
|
|
144
156
|
track: e,
|
|
145
157
|
label: (o[n] ?? 0) > 1 && r && r !== n ? `${n} (${r})` : n
|
|
146
158
|
};
|
|
147
159
|
});
|
|
148
|
-
},
|
|
160
|
+
}, Ce = (e, t) => Se(e, t).map(({ track: e, label: t }) => ({
|
|
149
161
|
id: e.streamIndex,
|
|
150
162
|
label: t
|
|
151
|
-
})),
|
|
163
|
+
})), we = [
|
|
152
164
|
0,
|
|
153
165
|
250,
|
|
154
166
|
1e3,
|
|
155
167
|
3e3,
|
|
156
168
|
1e4
|
|
157
|
-
],
|
|
158
|
-
if (e === null) return;
|
|
159
|
-
let n = e === void 0 ? 0 : d(e, t);
|
|
160
|
-
return t[Math.max(n, 0)]?.streamIndex;
|
|
161
|
-
}, Oe = (e) => e instanceof Error ? e.message : String(e), ke = (e) => {
|
|
169
|
+
], Te = 6e4, Ee = 500, De = 15e3, Oe = (e) => e instanceof Error ? e.message : String(e), ke = (e) => {
|
|
162
170
|
let t = [], n = e?.cause;
|
|
163
171
|
for (let e = 0; n != null && e < 8; e++) {
|
|
164
172
|
if (typeof MediaError < "u" && n instanceof MediaError) {
|
|
@@ -169,52 +177,57 @@ var oe = {
|
|
|
169
177
|
}
|
|
170
178
|
return t.length ? t.join("\n") : void 0;
|
|
171
179
|
}, Ae = (e, t, n, r) => {
|
|
172
|
-
let a = Y(), { read: o, size: c, publicPath: l = "", libavWorkerUrl:
|
|
173
|
-
|
|
174
|
-
let [
|
|
180
|
+
let a = Y(), { read: o, size: c, publicPath: l = "", libavWorkerUrl: p = "", jassubWorkerUrl: m = "", jassubWasmUrl: h = "", jassubLegacyWasmUrl: g, defaultFontUrl: _, cjkFontUrl: v, bufferSize: y, autoplay: x = !1, chapters: C, seekPrepareBudgetMs: E = Ee } = n ?? {}, D = w(C);
|
|
181
|
+
D.current = C;
|
|
182
|
+
let [O, k] = T(), A = O && O.size === c ? O.streamIndex : void 0, [j, M] = T(0), N = w({
|
|
175
183
|
count: 0,
|
|
176
184
|
at: 0
|
|
177
|
-
}),
|
|
178
|
-
|
|
185
|
+
}), P = w(void 0);
|
|
186
|
+
S(() => (N.current = {
|
|
179
187
|
count: 0,
|
|
180
188
|
at: 0
|
|
181
189
|
}, a.setSourceState({ playbackErrors: [] }), () => {
|
|
182
|
-
|
|
190
|
+
P.current && clearTimeout(P.current);
|
|
183
191
|
}), [c]);
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
let
|
|
192
|
+
let F = w(null), I = w(null), L = w(void 0), R = w(c);
|
|
193
|
+
R.current = c;
|
|
194
|
+
let z = w({
|
|
187
195
|
audio: [],
|
|
188
196
|
subtitles: []
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
U
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
let
|
|
197
|
+
}), B = b(() => z.current.audio.find((e) => e.streamIndex === a.selectedAudioTrack), [a]), V = w(o);
|
|
198
|
+
V.current = o;
|
|
199
|
+
let ee = {
|
|
200
|
+
audio: n?.preferredAudioLanguage,
|
|
201
|
+
original: n?.originalLanguage,
|
|
202
|
+
subtitles: n?.preferredSubtitleLanguage,
|
|
203
|
+
alwaysSubtitles: n?.alwaysShowSubtitles
|
|
204
|
+
}, te = w(ee);
|
|
205
|
+
te.current = ee;
|
|
206
|
+
let H = w(n?.onPreferredAudioLanguageChange);
|
|
207
|
+
H.current = n?.onPreferredAudioLanguageChange;
|
|
208
|
+
let ne = w(n?.onPreferredSubtitleLanguageChange);
|
|
209
|
+
ne.current = n?.onPreferredSubtitleLanguageChange;
|
|
210
|
+
let U = w(n?.onAlwaysShowSubtitlesChange);
|
|
211
|
+
U.current = n?.onAlwaysShowSubtitlesChange;
|
|
212
|
+
let re = w(n?.onSeek);
|
|
213
|
+
re.current = n?.onSeek;
|
|
214
|
+
let W = w(n?.onPlaybackError);
|
|
215
|
+
W.current = n?.onPlaybackError;
|
|
216
|
+
let G = w(r);
|
|
217
|
+
G.current = r;
|
|
218
|
+
let K = Q(), q = w(K);
|
|
219
|
+
q.current = K, S(() => {
|
|
220
|
+
let { audio: e, subtitles: t } = z.current;
|
|
221
|
+
t.length && a.setSourceState({ subtitleTracks: Ce(t, K) }), e.length && a.setSourceState({ audioTracks: Ce(e, K) });
|
|
222
|
+
}, [a, K]);
|
|
223
|
+
let ie = b((e) => {
|
|
211
224
|
let t = typeof e == "number" ? e : void 0, n = a.selectedSubtitleTrack === void 0;
|
|
212
|
-
|
|
213
|
-
let r =
|
|
214
|
-
i !== void 0 &&
|
|
215
|
-
}, [a]), J =
|
|
216
|
-
let t =
|
|
217
|
-
if (!t ||
|
|
225
|
+
L.current = R.current, a.setSourceState({ selectedSubtitleTrack: t }), F.current?.selectSubtitleStream(t);
|
|
226
|
+
let r = z.current.subtitles.find((e) => e.streamIndex === t), i = t === void 0 ? null : u(r) ?? (n ? r?.title?.trim() || "und" : void 0);
|
|
227
|
+
i !== void 0 && ne.current?.(i), i && d(B(), i) && U.current?.(!0);
|
|
228
|
+
}, [a, B]), J = b((e) => {
|
|
229
|
+
let t = F.current;
|
|
230
|
+
if (!t || E <= 0) {
|
|
218
231
|
a.seek(e);
|
|
219
232
|
return;
|
|
220
233
|
}
|
|
@@ -228,35 +241,35 @@ var oe = {
|
|
|
228
241
|
a.setSourceState({ seekingTo: e });
|
|
229
242
|
let c = t.videoElement, l = () => {
|
|
230
243
|
c?.removeEventListener("seeked", l), clearTimeout(u), a.setSourceState({ seekingTo: void 0 });
|
|
231
|
-
}, u = setTimeout(l,
|
|
244
|
+
}, u = setTimeout(l, De);
|
|
232
245
|
c?.addEventListener("seeked", l);
|
|
233
246
|
let d = setTimeout(() => {
|
|
234
247
|
o = "deadline", s();
|
|
235
|
-
},
|
|
248
|
+
}, E);
|
|
236
249
|
t.prepareSeek(e).catch(() => {}).finally(() => {
|
|
237
250
|
clearTimeout(d), s();
|
|
238
251
|
});
|
|
239
|
-
}, [a,
|
|
240
|
-
if (typeof e != "number" ||
|
|
241
|
-
a.setSourceState({ selectedAudioTrack: e }),
|
|
242
|
-
size:
|
|
252
|
+
}, [a, E]), ae = b((e) => {
|
|
253
|
+
if (typeof e != "number" || R.current === void 0) return;
|
|
254
|
+
a.setSourceState({ selectedAudioTrack: e }), k({
|
|
255
|
+
size: R.current,
|
|
243
256
|
streamIndex: e
|
|
244
257
|
});
|
|
245
|
-
let t = u(
|
|
246
|
-
t !== void 0 &&
|
|
247
|
-
}, [a]),
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
selectSubtitleTrack:
|
|
251
|
-
selectAudioTrack:
|
|
258
|
+
let t = u(z.current.audio.find((t) => t.streamIndex === e));
|
|
259
|
+
t !== void 0 && H.current?.(t);
|
|
260
|
+
}, [a]), oe = Y((e) => e.setSourceState);
|
|
261
|
+
S(() => {
|
|
262
|
+
oe({
|
|
263
|
+
selectSubtitleTrack: ie,
|
|
264
|
+
selectAudioTrack: ae,
|
|
252
265
|
requestSeek: J
|
|
253
266
|
});
|
|
254
267
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
268
|
+
oe,
|
|
269
|
+
ie,
|
|
270
|
+
ae,
|
|
258
271
|
J
|
|
259
|
-
]),
|
|
272
|
+
]), S(() => {
|
|
260
273
|
if (!e || !t || !c || !o) return;
|
|
261
274
|
let n = !1;
|
|
262
275
|
a.setSourceState({
|
|
@@ -289,60 +302,60 @@ var oe = {
|
|
|
289
302
|
let t = i(e);
|
|
290
303
|
if (r(e, t), t) {
|
|
291
304
|
let t = performance.now();
|
|
292
|
-
t -
|
|
305
|
+
t - N.current.at > Te && (N.current = {
|
|
293
306
|
count: 0,
|
|
294
307
|
at: t
|
|
295
308
|
});
|
|
296
|
-
let n =
|
|
297
|
-
|
|
298
|
-
count:
|
|
309
|
+
let n = we[Math.min(N.current.count, we.length - 1)];
|
|
310
|
+
N.current = {
|
|
311
|
+
count: N.current.count + 1,
|
|
299
312
|
at: t
|
|
300
|
-
}, console.warn(`the media element failed; rebuilding the pipeline${n ? ` in ${n}ms` : ""}`, e),
|
|
313
|
+
}, console.warn(`the media element failed; rebuilding the pipeline${n ? ` in ${n}ms` : ""}`, e), P.current && clearTimeout(P.current), P.current = setTimeout(() => M((e) => e + 1), n);
|
|
301
314
|
return;
|
|
302
315
|
}
|
|
303
|
-
console.error("playback failed", e), a.setSourceState({ playbackError: e }),
|
|
316
|
+
console.error("playback failed", e), a.setSourceState({ playbackError: e }), W.current?.(e);
|
|
304
317
|
};
|
|
305
318
|
return (async () => {
|
|
306
319
|
try {
|
|
307
320
|
let r = await s({
|
|
308
321
|
videoElement: e,
|
|
309
322
|
subtitleContainer: t,
|
|
310
|
-
read: (e, t) =>
|
|
323
|
+
read: (e, t) => V.current(e, t),
|
|
311
324
|
length: c,
|
|
312
325
|
publicPath: l,
|
|
313
|
-
libavWorkerUrl:
|
|
314
|
-
jassubWorkerUrl:
|
|
315
|
-
jassubWasmUrl:
|
|
316
|
-
jassubLegacyWasmUrl:
|
|
317
|
-
defaultFontUrl:
|
|
318
|
-
cjkFontUrl:
|
|
319
|
-
bufferSize:
|
|
320
|
-
audioStreamIndex:
|
|
321
|
-
chooseAudioStream: (e) =>
|
|
322
|
-
let t = z.current;
|
|
323
|
-
return t === void 0 ? void 0 : e[d(t, e)]?.streamIndex;
|
|
324
|
-
},
|
|
326
|
+
libavWorkerUrl: p,
|
|
327
|
+
jassubWorkerUrl: m,
|
|
328
|
+
jassubWasmUrl: h,
|
|
329
|
+
jassubLegacyWasmUrl: g,
|
|
330
|
+
defaultFontUrl: _,
|
|
331
|
+
cjkFontUrl: v,
|
|
332
|
+
bufferSize: y,
|
|
333
|
+
audioStreamIndex: A,
|
|
334
|
+
chooseAudioStream: (e) => e[f(e, [], te.current).audio]?.streamIndex,
|
|
325
335
|
onReady: () => {
|
|
326
336
|
if (n) return;
|
|
327
337
|
a.setSourceState({ ready: !0 });
|
|
328
|
-
let t =
|
|
329
|
-
|
|
338
|
+
let t = I.current;
|
|
339
|
+
I.current = null, t && t.size === c && t.time > 0 && (e.currentTime = t.time), x && e.play().catch(() => {});
|
|
330
340
|
},
|
|
331
341
|
onError: u,
|
|
332
342
|
onRecovered: () => {
|
|
333
343
|
n || a.setSourceState({ playbackError: null });
|
|
334
344
|
},
|
|
335
|
-
onSeek: (e) =>
|
|
336
|
-
onOutput: (e) =>
|
|
345
|
+
onSeek: (e) => re.current?.(e),
|
|
346
|
+
onOutput: (e) => G.current?.(e),
|
|
337
347
|
onSubtitleStreams: (e) => {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
348
|
+
if (n) return;
|
|
349
|
+
z.current.subtitles = e;
|
|
350
|
+
let t = B(), r = f(t ? [t] : [], e, te.current).subtitles;
|
|
351
|
+
a.setSourceState({
|
|
352
|
+
subtitleTracks: Ce(e, q.current),
|
|
353
|
+
...L.current === c ? {} : { selectedSubtitleTrack: r === null ? void 0 : e[Math.max(r, 0)]?.streamIndex }
|
|
354
|
+
});
|
|
342
355
|
},
|
|
343
356
|
onAudioStreams: (e, t) => {
|
|
344
|
-
n || (
|
|
345
|
-
audioTracks:
|
|
357
|
+
n || (z.current.audio = e, a.setSourceState({
|
|
358
|
+
audioTracks: Ce(e, q.current),
|
|
346
359
|
selectedAudioTrack: t
|
|
347
360
|
}));
|
|
348
361
|
}
|
|
@@ -351,9 +364,9 @@ var oe = {
|
|
|
351
364
|
r.destroy();
|
|
352
365
|
return;
|
|
353
366
|
}
|
|
354
|
-
|
|
367
|
+
F.current = r, a.setSourceState({
|
|
355
368
|
indexes: r.indexes,
|
|
356
|
-
chapters:
|
|
369
|
+
chapters: D.current ?? r.chapters
|
|
357
370
|
});
|
|
358
371
|
let i = a.selectedSubtitleTrack;
|
|
359
372
|
r.selectSubtitleStream(typeof i == "number" ? i : void 0);
|
|
@@ -361,27 +374,28 @@ var oe = {
|
|
|
361
374
|
u(e);
|
|
362
375
|
}
|
|
363
376
|
})(), () => {
|
|
364
|
-
n = !0,
|
|
377
|
+
n = !0, I.current = {
|
|
365
378
|
time: e.currentTime,
|
|
366
379
|
size: c
|
|
367
|
-
},
|
|
380
|
+
}, F.current?.destroy(), F.current = null, a.setSourceState({ ready: !1 });
|
|
368
381
|
};
|
|
369
382
|
}, [
|
|
370
383
|
a,
|
|
384
|
+
B,
|
|
371
385
|
e,
|
|
372
386
|
t,
|
|
373
387
|
c,
|
|
374
388
|
l,
|
|
375
|
-
f,
|
|
376
389
|
p,
|
|
377
390
|
m,
|
|
378
391
|
h,
|
|
379
392
|
g,
|
|
380
393
|
_,
|
|
381
394
|
v,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
395
|
+
y,
|
|
396
|
+
A,
|
|
397
|
+
x,
|
|
398
|
+
j
|
|
385
399
|
]);
|
|
386
400
|
}, je = 1001 / 24e3, Me = (e, t) => new Promise((n) => {
|
|
387
401
|
let r = setTimeout(n, t);
|
|
@@ -405,10 +419,10 @@ var oe = {
|
|
|
405
419
|
};
|
|
406
420
|
return r;
|
|
407
421
|
}, Pe = (e, t) => {
|
|
408
|
-
let n = Y(), r = Y((e) => e.setSourceState), i =
|
|
422
|
+
let n = Y(), r = Y((e) => e.setSourceState), i = w(t);
|
|
409
423
|
i.current = t;
|
|
410
424
|
let a = !!t;
|
|
411
|
-
|
|
425
|
+
S(() => {
|
|
412
426
|
let t = e;
|
|
413
427
|
if (!t) return;
|
|
414
428
|
if (typeof t.requestVideoFrameCallback != "function") return a ? (r({ stepFrame: Ne(async (e) => {
|
|
@@ -453,10 +467,10 @@ var oe = {
|
|
|
453
467
|
r
|
|
454
468
|
]);
|
|
455
469
|
}, Fe = 5e3, Ie = 6e4, Le = ({ publicPath: e, workerUrl: t, length: n, read: r, downloadedRanges: i }) => {
|
|
456
|
-
let [a, s] =
|
|
470
|
+
let [a, s] = T([]), c = w(null), l = w(r);
|
|
457
471
|
l.current = r;
|
|
458
|
-
let u =
|
|
459
|
-
return d.current = u,
|
|
472
|
+
let u = C(() => i?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [i?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")]), d = w(u);
|
|
473
|
+
return d.current = u, S(() => {
|
|
460
474
|
if (!n || !r || !e || !t) return;
|
|
461
475
|
let i = !1, a = null, u, f = Fe, p = () => {
|
|
462
476
|
o({
|
|
@@ -484,17 +498,17 @@ var oe = {
|
|
|
484
498
|
n,
|
|
485
499
|
e,
|
|
486
500
|
t
|
|
487
|
-
]),
|
|
501
|
+
]), S(() => {
|
|
488
502
|
c.current?.update(u);
|
|
489
503
|
}, [u]), {
|
|
490
504
|
thumbnails: a,
|
|
491
|
-
requestThumbnail:
|
|
505
|
+
requestThumbnail: b((e) => {
|
|
492
506
|
c.current?.prioritize(e);
|
|
493
507
|
}, [])
|
|
494
508
|
};
|
|
495
509
|
}, Re = (e, t) => {
|
|
496
|
-
let n =
|
|
497
|
-
|
|
510
|
+
let n = w(null), [i, a] = T(!1), [o] = T(() => r());
|
|
511
|
+
S(() => {
|
|
498
512
|
if (!e || !t || !o) return;
|
|
499
513
|
let r = c({
|
|
500
514
|
video: e,
|
|
@@ -510,7 +524,7 @@ var oe = {
|
|
|
510
524
|
t,
|
|
511
525
|
o
|
|
512
526
|
]);
|
|
513
|
-
let s =
|
|
527
|
+
let s = b(() => {
|
|
514
528
|
n.current?.toggle().catch((e) => {
|
|
515
529
|
console.warn("picture in picture was refused", e);
|
|
516
530
|
});
|
|
@@ -524,16 +538,16 @@ var oe = {
|
|
|
524
538
|
let t = Be();
|
|
525
539
|
return t?.addEventListener("change", e), () => t?.removeEventListener("change", e);
|
|
526
540
|
}, He = () => !!Be()?.matches, Ue = () => !1, We = (e, t) => {
|
|
527
|
-
let [n, r] =
|
|
541
|
+
let [n, r] = T(!1), [i, a] = T(), o = w(t);
|
|
528
542
|
t && (o.current = t);
|
|
529
|
-
let s =
|
|
543
|
+
let s = w(!1), c = b((e) => {
|
|
530
544
|
s.current !== e && (s.current = e, o.current?.onArmedChange(e));
|
|
531
|
-
}, []), l =
|
|
545
|
+
}, []), l = b((t) => {
|
|
532
546
|
!e || e.readyState < 1 || e.error || (a(t), c(!0));
|
|
533
|
-
}, [e, c]), u =
|
|
547
|
+
}, [e, c]), u = b(() => {
|
|
534
548
|
a(void 0), c(!1);
|
|
535
549
|
}, [c]), d = !!t && !!e;
|
|
536
|
-
|
|
550
|
+
S(() => {
|
|
537
551
|
if (!d || !e) return;
|
|
538
552
|
let t = () => {
|
|
539
553
|
r(!0), u();
|
|
@@ -546,8 +560,8 @@ var oe = {
|
|
|
546
560
|
d,
|
|
547
561
|
u
|
|
548
562
|
]);
|
|
549
|
-
let f =
|
|
550
|
-
|
|
563
|
+
let f = E(Ve, He, Ue), [p, m] = T(!1);
|
|
564
|
+
S(() => {
|
|
551
565
|
if (!d) return;
|
|
552
566
|
let e = (e) => {
|
|
553
567
|
e.pointerType === "touch" && m(!0);
|
|
@@ -565,15 +579,15 @@ var oe = {
|
|
|
565
579
|
};
|
|
566
580
|
}, [d]);
|
|
567
581
|
let h = d && f && !p;
|
|
568
|
-
|
|
582
|
+
S(() => {
|
|
569
583
|
h || u();
|
|
570
584
|
}, [h, u]);
|
|
571
|
-
let g =
|
|
585
|
+
let g = b(() => {
|
|
572
586
|
Promise.resolve(e?.exitPictureInPicture?.()).catch((e) => {
|
|
573
587
|
console.warn("leaving picture in picture was refused", e);
|
|
574
588
|
});
|
|
575
589
|
}, [e]);
|
|
576
|
-
return
|
|
590
|
+
return C(() => h ? {
|
|
577
591
|
active: n,
|
|
578
592
|
armed: i,
|
|
579
593
|
arm: l,
|
|
@@ -618,7 +632,7 @@ var oe = {
|
|
|
618
632
|
inputGainDb: c()
|
|
619
633
|
});
|
|
620
634
|
await qe(i);
|
|
621
|
-
let s =
|
|
635
|
+
let s = R(i, e);
|
|
622
636
|
return r.port.postMessage({
|
|
623
637
|
enabled: a,
|
|
624
638
|
inputGainDb: c()
|
|
@@ -672,7 +686,7 @@ var oe = {
|
|
|
672
686
|
}, g = 0, _ = /* @__PURE__ */ new Map(), v = (e, t) => new Promise((n) => _.set(`${e}:${t}`, n)), y = -1;
|
|
673
687
|
p.onmessage = ({ data: e }) => {
|
|
674
688
|
if (e.type === "unsupported") {
|
|
675
|
-
|
|
689
|
+
U();
|
|
676
690
|
return;
|
|
677
691
|
}
|
|
678
692
|
e.spans && ((JSON.stringify(e.spans) !== JSON.stringify(h.spans) || e.end !== h.end) && g++, h = {
|
|
@@ -699,25 +713,25 @@ var oe = {
|
|
|
699
713
|
"ended"
|
|
700
714
|
];
|
|
701
715
|
for (let e of w) n.addEventListener(e, x);
|
|
702
|
-
let T = Infinity, E = !1, D = 0, O = !1, k = 0,
|
|
716
|
+
let T = Infinity, E = !1, D = 0, O = !1, k = 0, A = 0, j = /* @__PURE__ */ new Map(), M = (e) => {
|
|
703
717
|
let t = e;
|
|
704
718
|
for (let [e, n] of h.spans) e <= t && t < n && (t = n);
|
|
705
719
|
return t >= (h.end ?? T) - .05 ? null : t;
|
|
706
|
-
}, N = (e) =>
|
|
707
|
-
let e = n.currentTime, t =
|
|
708
|
-
if (t !== null && t < e + Ye) return r && k <= t + 1 && t <=
|
|
720
|
+
}, N = (e) => j.get(Math.round(e * 10)) === g ? "idle" : e, F = () => {
|
|
721
|
+
let e = n.currentTime, t = M(e), r = O && y !== D;
|
|
722
|
+
if (t !== null && t < e + Ye) return r && k <= t + 1 && t <= A + Xe ? "read" : N(t);
|
|
709
723
|
if (r) return "read";
|
|
710
|
-
let i = t ??
|
|
724
|
+
let i = t ?? M(0);
|
|
711
725
|
return i === null ? "done" : N(i);
|
|
712
|
-
},
|
|
713
|
-
|
|
714
|
-
})])),
|
|
715
|
-
S(), E && s.size && typeof
|
|
716
|
-
},
|
|
726
|
+
}, I = () => {}, L = (e) => (e.catch(() => {}), Promise.race([e, new Promise((e) => {
|
|
727
|
+
I = () => e(void 0);
|
|
728
|
+
})])), R = () => {
|
|
729
|
+
S(), E && s.size && typeof F() == "number" && I(), l();
|
|
730
|
+
}, z = () => {
|
|
717
731
|
S(), l();
|
|
718
732
|
};
|
|
719
|
-
n.addEventListener("seeking",
|
|
720
|
-
let
|
|
733
|
+
n.addEventListener("seeking", R), n.addEventListener("seeked", z), n.addEventListener("timeupdate", z);
|
|
734
|
+
let B, V = async (e) => {
|
|
721
735
|
if (!O) return;
|
|
722
736
|
O = !1;
|
|
723
737
|
let t = v("ended", D);
|
|
@@ -726,8 +740,8 @@ var oe = {
|
|
|
726
740
|
run: D,
|
|
727
741
|
finished: e
|
|
728
742
|
}), await t;
|
|
729
|
-
},
|
|
730
|
-
if (
|
|
743
|
+
}, ee = async (e) => {
|
|
744
|
+
if (A = e.pts + e.duration, !e.data.byteLength) return;
|
|
731
745
|
let t = v("ack", D);
|
|
732
746
|
p.postMessage({
|
|
733
747
|
type: "fragment",
|
|
@@ -735,15 +749,15 @@ var oe = {
|
|
|
735
749
|
data: e.data
|
|
736
750
|
}, [e.data]), await t;
|
|
737
751
|
}, te = async (t) => {
|
|
738
|
-
if (
|
|
752
|
+
if (B = await P({
|
|
739
753
|
publicPath: t.publicPath,
|
|
740
754
|
workerUrl: t.libavWorkerUrl,
|
|
741
755
|
workerOptions: { type: "module" },
|
|
742
756
|
length: t.length,
|
|
743
757
|
read: (e, n) => d(t, e, n),
|
|
744
758
|
audioStreamIndex: t.audioStreamIndex
|
|
745
|
-
}), a) return e(
|
|
746
|
-
let n = await
|
|
759
|
+
}), a) return e(B);
|
|
760
|
+
let n = await B.init();
|
|
747
761
|
if (!a) {
|
|
748
762
|
for (T = n.info.input.duration || Infinity, p.postMessage({
|
|
749
763
|
type: "init",
|
|
@@ -756,7 +770,7 @@ var oe = {
|
|
|
756
770
|
from: 0,
|
|
757
771
|
start: !0
|
|
758
772
|
}); !a;) {
|
|
759
|
-
let e =
|
|
773
|
+
let e = F();
|
|
760
774
|
if (e === "done") break;
|
|
761
775
|
if (e === "idle") {
|
|
762
776
|
await u();
|
|
@@ -764,15 +778,15 @@ var oe = {
|
|
|
764
778
|
}
|
|
765
779
|
try {
|
|
766
780
|
if (e === "read") {
|
|
767
|
-
let e = await
|
|
781
|
+
let e = await L(B.read());
|
|
768
782
|
if (a) return;
|
|
769
783
|
if (!e) continue;
|
|
770
|
-
await
|
|
784
|
+
await ee(e), e.finished && await V(!0);
|
|
771
785
|
} else {
|
|
772
|
-
await
|
|
773
|
-
let t =
|
|
786
|
+
await V(!1), j.set(Math.round(e * 10), g);
|
|
787
|
+
let t = B.seek(Math.max(0, e - Ze));
|
|
774
788
|
f(!0);
|
|
775
|
-
let r = await
|
|
789
|
+
let r = await L(t);
|
|
776
790
|
if (a) return;
|
|
777
791
|
if (!r) continue;
|
|
778
792
|
D++, O = !0, k = r.pts, p.postMessage({
|
|
@@ -781,16 +795,16 @@ var oe = {
|
|
|
781
795
|
pts: n.timestampOffset,
|
|
782
796
|
from: r.pts,
|
|
783
797
|
start: r.pts <= 0
|
|
784
|
-
}), await
|
|
798
|
+
}), await ee(r), r.finished && await V(!0);
|
|
785
799
|
}
|
|
786
800
|
} catch {
|
|
787
801
|
if (a) return;
|
|
788
|
-
await
|
|
802
|
+
await V(!1), typeof F() != "number" && await u();
|
|
789
803
|
}
|
|
790
804
|
}
|
|
791
|
-
e(
|
|
805
|
+
e(B), B = void 0;
|
|
792
806
|
}
|
|
793
|
-
}, H = () => {},
|
|
807
|
+
}, H = () => {}, ne = (e, t) => {
|
|
794
808
|
let n = !1, r = (e) => {
|
|
795
809
|
n && p.postMessage({
|
|
796
810
|
type: "end",
|
|
@@ -825,26 +839,26 @@ var oe = {
|
|
|
825
839
|
}, [t]);
|
|
826
840
|
}
|
|
827
841
|
});
|
|
828
|
-
},
|
|
842
|
+
}, U = () => {
|
|
829
843
|
if (!a) {
|
|
830
844
|
a = !0, f(!0), l(), clearInterval(C);
|
|
831
845
|
for (let e of w) n.removeEventListener(e, x);
|
|
832
|
-
n.removeEventListener("seeking",
|
|
846
|
+
n.removeEventListener("seeking", R), n.removeEventListener("seeked", z), n.removeEventListener("timeupdate", z), H(), B && e(B), p.terminate(), t.port.postMessage({ analysis: null });
|
|
833
847
|
for (let e of _.values()) e(h);
|
|
834
848
|
_.clear();
|
|
835
849
|
}
|
|
836
850
|
};
|
|
837
|
-
return "tap" in i ?
|
|
838
|
-
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e),
|
|
851
|
+
return "tap" in i ? ne(i.tap, i.audioStreamIndex) : te(i).catch((e) => {
|
|
852
|
+
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e), U());
|
|
839
853
|
}), S(), {
|
|
840
854
|
update: (e) => {
|
|
841
855
|
o = e, f(!1);
|
|
842
856
|
},
|
|
843
|
-
stop:
|
|
857
|
+
stop: U
|
|
844
858
|
};
|
|
845
859
|
}, et = (e, t, n, r, i) => {
|
|
846
|
-
let a =
|
|
847
|
-
|
|
860
|
+
let a = w(null), [o, s] = T(!1), [c, l] = T(null);
|
|
861
|
+
S(() => {
|
|
848
862
|
if (e && t) {
|
|
849
863
|
if (n && !a.current) {
|
|
850
864
|
let r = Je(e, t, { enabled: n });
|
|
@@ -860,15 +874,15 @@ var oe = {
|
|
|
860
874
|
e,
|
|
861
875
|
t,
|
|
862
876
|
n
|
|
863
|
-
]),
|
|
877
|
+
]), S(() => () => {
|
|
864
878
|
a.current?.release(), a.current = null, l(null);
|
|
865
879
|
}, [e]);
|
|
866
|
-
let u =
|
|
880
|
+
let u = w(i);
|
|
867
881
|
u.current = i;
|
|
868
|
-
let d =
|
|
882
|
+
let d = w(null), f = w(r);
|
|
869
883
|
f.current = r;
|
|
870
884
|
let { length: p, publicPath: m, libavWorkerUrl: h } = r && "read" in r ? r : {}, g = r && "tap" in r ? r.tap : void 0, _ = r?.audioStreamIndex;
|
|
871
|
-
return
|
|
885
|
+
return S(() => {
|
|
872
886
|
let r = f.current;
|
|
873
887
|
if (!c || !e || !t || !n || !r) return;
|
|
874
888
|
let i = $e({
|
|
@@ -890,7 +904,7 @@ var oe = {
|
|
|
890
904
|
h,
|
|
891
905
|
_,
|
|
892
906
|
g
|
|
893
|
-
]),
|
|
907
|
+
]), S(() => {
|
|
894
908
|
d.current?.update(i);
|
|
895
909
|
}, [i]), { refused: o };
|
|
896
910
|
}, tt = () => {
|
|
@@ -939,7 +953,7 @@ var oe = {
|
|
|
939
953
|
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 ",
|
|
940
954
|
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 "
|
|
941
955
|
}
|
|
942
|
-
}, nt =
|
|
956
|
+
}, nt = D`
|
|
943
957
|
display: flex;
|
|
944
958
|
justify-content: center;
|
|
945
959
|
align-items: center;
|
|
@@ -952,7 +966,7 @@ var oe = {
|
|
|
952
966
|
margin: auto;
|
|
953
967
|
pointer-events: none;
|
|
954
968
|
}
|
|
955
|
-
`, rt =
|
|
969
|
+
`, rt = D`
|
|
956
970
|
position: absolute;
|
|
957
971
|
top: 0;
|
|
958
972
|
left: 0;
|
|
@@ -981,9 +995,9 @@ var oe = {
|
|
|
981
995
|
|
|
982
996
|
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%);
|
|
983
997
|
transition: opacity 0.1s cubic-bezier(.4,0,1,1);
|
|
984
|
-
`, it =
|
|
998
|
+
`, it = O`
|
|
985
999
|
to { transform: rotate(360deg); }
|
|
986
|
-
`, at =
|
|
1000
|
+
`, at = D`
|
|
987
1001
|
position: absolute;
|
|
988
1002
|
inset: 0;
|
|
989
1003
|
z-index: 2;
|
|
@@ -1001,7 +1015,7 @@ var oe = {
|
|
|
1001
1015
|
border-top-color: #fff;
|
|
1002
1016
|
animation: ${it} 0.8s linear infinite;
|
|
1003
1017
|
}
|
|
1004
|
-
`, ot =
|
|
1018
|
+
`, ot = D`
|
|
1005
1019
|
position: absolute;
|
|
1006
1020
|
inset: auto 0 20%;
|
|
1007
1021
|
z-index: 3;
|
|
@@ -1013,8 +1027,8 @@ var oe = {
|
|
|
1013
1027
|
pointer-events: none;
|
|
1014
1028
|
`, 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 }) => {
|
|
1015
1029
|
let t = Q(), n = Y((e) => e.title), r = Y((e) => e.hideUI), i = Y((e) => e.playbackError), a = Y((e) => e.ready), o = Y((e) => e.size), s = Y((e) => e.waiting), c = Y((e) => e.seekingTo);
|
|
1016
|
-
return /* @__PURE__ */ F
|
|
1017
|
-
n ? /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ L(F, { children: [
|
|
1031
|
+
n ? /* @__PURE__ */ I("div", {
|
|
1018
1032
|
className: "title",
|
|
1019
1033
|
dir: "auto",
|
|
1020
1034
|
css: rt,
|
|
@@ -1024,13 +1038,13 @@ var oe = {
|
|
|
1024
1038
|
} : {} },
|
|
1025
1039
|
children: n
|
|
1026
1040
|
}) : void 0,
|
|
1027
|
-
((o ? !a : s) || c !== void 0) && !i ? /* @__PURE__ */
|
|
1028
|
-
i ? /* @__PURE__ */
|
|
1041
|
+
((o ? !a : s) || c !== void 0) && !i ? /* @__PURE__ */ I("div", { css: at }) : void 0,
|
|
1042
|
+
i ? /* @__PURE__ */ I("div", {
|
|
1029
1043
|
css: ot,
|
|
1030
1044
|
dir: "auto",
|
|
1031
1045
|
children: lt(i, t)
|
|
1032
1046
|
}) : void 0,
|
|
1033
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ I("div", {
|
|
1034
1048
|
className: "subtitles",
|
|
1035
1049
|
ref: e,
|
|
1036
1050
|
css: nt
|
|
@@ -1040,7 +1054,7 @@ var oe = {
|
|
|
1040
1054
|
if (e === void 0) return "0:00";
|
|
1041
1055
|
let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.floor(e % 60);
|
|
1042
1056
|
return t > 0 ? `${t}:${n < 10 ? "0" : ""}${n}:${r < 10 ? "0" : ""}${r}` : `${n}:${r < 10 ? "0" : ""}${r}`;
|
|
1043
|
-
}, gt = (e, t) => `${ht(e)} / ${ht(t)}`, _t = (e) =>
|
|
1057
|
+
}, gt = (e, t) => `${ht(e)} / ${ht(t)}`, _t = (e) => D`
|
|
1044
1058
|
display: flex;
|
|
1045
1059
|
justify-content: flex-start;
|
|
1046
1060
|
|
|
@@ -1077,13 +1091,13 @@ var oe = {
|
|
|
1077
1091
|
unicode-bidi: plaintext;
|
|
1078
1092
|
}
|
|
1079
1093
|
|
|
1080
|
-
${e === "sm" &&
|
|
1094
|
+
${e === "sm" && D`
|
|
1081
1095
|
padding: calc(0.4 * var(--mp-unit))!important;
|
|
1082
1096
|
`}
|
|
1083
|
-
${e === "md" &&
|
|
1097
|
+
${e === "md" && D`
|
|
1084
1098
|
padding: calc(0.6 * var(--mp-unit))!important;
|
|
1085
1099
|
`}
|
|
1086
|
-
${e === "lg" &&
|
|
1100
|
+
${e === "lg" && D`
|
|
1087
1101
|
padding: calc(1.2 * var(--mp-unit))!important;
|
|
1088
1102
|
`}
|
|
1089
1103
|
`, vt = {
|
|
@@ -1097,9 +1111,9 @@ var oe = {
|
|
|
1097
1111
|
passive: !0
|
|
1098
1112
|
}), () => {
|
|
1099
1113
|
--vt.anchors === 0 && window.removeEventListener("pointermove", yt, { capture: !0 });
|
|
1100
|
-
}), xt =
|
|
1101
|
-
let l =
|
|
1102
|
-
return
|
|
1114
|
+
}), xt = v(!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" }) => {
|
|
1115
|
+
let l = w(null), u = w(null), d = x(xt);
|
|
1116
|
+
return S(() => {
|
|
1103
1117
|
let e = bt(), t = () => {
|
|
1104
1118
|
let e = l.current;
|
|
1105
1119
|
if (!e) return;
|
|
@@ -1112,7 +1126,7 @@ var oe = {
|
|
|
1112
1126
|
for (let e of n) document.removeEventListener(e, t);
|
|
1113
1127
|
window.removeEventListener("resize", t);
|
|
1114
1128
|
};
|
|
1115
|
-
}, [d]), /* @__PURE__ */ F
|
|
1129
|
+
}, [d]), /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("div", {
|
|
1116
1130
|
ref: l,
|
|
1117
1131
|
"data-tooltip-id": e,
|
|
1118
1132
|
"data-open": !0,
|
|
@@ -1121,7 +1135,7 @@ var oe = {
|
|
|
1121
1135
|
"data-tooltip-delay-hide": i,
|
|
1122
1136
|
"data-tooltip-place": o,
|
|
1123
1137
|
children: n
|
|
1124
|
-
}), !s && /* @__PURE__ */
|
|
1138
|
+
}), !s && /* @__PURE__ */ I(oe, {
|
|
1125
1139
|
ref: u,
|
|
1126
1140
|
css: _t(c),
|
|
1127
1141
|
id: e,
|
|
@@ -1129,14 +1143,14 @@ var oe = {
|
|
|
1129
1143
|
children: t
|
|
1130
1144
|
})] });
|
|
1131
1145
|
}, Ct = ({ ref: e, onChange: t, orientation: n = "horizontal", disabled: r = !1 }) => {
|
|
1132
|
-
let [i, a] =
|
|
1146
|
+
let [i, a] = T(!1), o = w(t);
|
|
1133
1147
|
o.current = t;
|
|
1134
|
-
let s =
|
|
1148
|
+
let s = w(null), c = b((t, r) => {
|
|
1135
1149
|
let i = e.current;
|
|
1136
1150
|
if (!i) return 0;
|
|
1137
1151
|
let { left: a, right: o, top: s, bottom: c } = i.getBoundingClientRect(), l = n === "horizontal" ? (t - a) / (o - a) : (c - r) / (c - s);
|
|
1138
1152
|
return Math.min(Math.max(l, 0), 1);
|
|
1139
|
-
}, [e, n]), l =
|
|
1153
|
+
}, [e, n]), l = b((e) => {
|
|
1140
1154
|
if (!(r || e.button > 0)) {
|
|
1141
1155
|
s.current = e.pointerId;
|
|
1142
1156
|
try {
|
|
@@ -1144,9 +1158,9 @@ var oe = {
|
|
|
1144
1158
|
} catch {}
|
|
1145
1159
|
a(!0), o.current(c(e.clientX, e.clientY));
|
|
1146
1160
|
}
|
|
1147
|
-
}, [r, c]), u =
|
|
1161
|
+
}, [r, c]), u = b((e) => {
|
|
1148
1162
|
s.current === e.pointerId && o.current(c(e.clientX, e.clientY));
|
|
1149
|
-
}, [c]), d =
|
|
1163
|
+
}, [c]), d = b((e) => {
|
|
1150
1164
|
if (s.current === e.pointerId) {
|
|
1151
1165
|
s.current = null;
|
|
1152
1166
|
try {
|
|
@@ -1155,7 +1169,7 @@ var oe = {
|
|
|
1155
1169
|
a(!1);
|
|
1156
1170
|
}
|
|
1157
1171
|
}, []);
|
|
1158
|
-
return
|
|
1172
|
+
return S(() => {
|
|
1159
1173
|
r && (s.current = null, a(!1));
|
|
1160
1174
|
}, [r]), {
|
|
1161
1175
|
dragging: i,
|
|
@@ -1167,7 +1181,7 @@ var oe = {
|
|
|
1167
1181
|
style: { touchAction: "none" }
|
|
1168
1182
|
}
|
|
1169
1183
|
};
|
|
1170
|
-
}, wt =
|
|
1184
|
+
}, wt = D`
|
|
1171
1185
|
position: relative;
|
|
1172
1186
|
height: calc(.4 * var(--mp-unit));
|
|
1173
1187
|
|
|
@@ -1387,57 +1401,57 @@ var oe = {
|
|
|
1387
1401
|
--thumbnail-half: calc(9 * var(--mp-unit));
|
|
1388
1402
|
}
|
|
1389
1403
|
`, Tt = 4, Et = () => {
|
|
1390
|
-
let e = Y(), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.duration), i = Y((e) => e.size), a = Y((e) => e.downloadedRanges), o = Y((e) => e.buffered), s = Y((e) => e.indexes), c = Y((e) => e.thumbnails), l = Y((e) => e.thumbnailAt), u = Y((e) => e.requestThumbnail), d = Y((e) => e.chapters),
|
|
1391
|
-
|
|
1404
|
+
let e = Y(), t = Y((e) => e.currentTime), n = Y((e) => e.requestSeek), r = Y((e) => e.duration), i = Y((e) => e.size), a = Y((e) => e.downloadedRanges), o = Y((e) => e.buffered), s = Y((e) => e.indexes), c = Y((e) => e.thumbnails), l = Y((e) => e.thumbnailAt), u = Y((e) => e.requestThumbnail), d = Y((e) => e.chapters), f = Y((e) => e.seekingTo), h = Y((e) => e.setSourceState), g = Y((e) => e.hideUI), _ = w(null), [v, y] = T(void 0), [b, x] = T(void 0), E = (e) => {
|
|
1405
|
+
x(e), u(e);
|
|
1392
1406
|
}, D = !!b;
|
|
1393
|
-
|
|
1407
|
+
S(() => {
|
|
1394
1408
|
if (D) return h({ seekPreview: !0 }), () => h({ seekPreview: !1 });
|
|
1395
|
-
}, [h, D]),
|
|
1409
|
+
}, [h, D]), S(() => {
|
|
1396
1410
|
g && E(void 0);
|
|
1397
1411
|
}, [g]);
|
|
1398
|
-
let O =
|
|
1412
|
+
let O = w(void 0), k = w(0), A = w(void 0), j = w(void 0), M = w(!1), { dragging: N, handlers: P } = Ct({
|
|
1399
1413
|
ref: _,
|
|
1400
1414
|
onChange: (e) => {
|
|
1401
|
-
if (k.current += 1,
|
|
1402
|
-
else if (!
|
|
1415
|
+
if (k.current += 1, A.current = e, j.current === void 0) j.current = e;
|
|
1416
|
+
else if (!M.current) {
|
|
1403
1417
|
let t = _.current?.getBoundingClientRect().width ?? 0;
|
|
1404
|
-
Math.abs(e -
|
|
1418
|
+
Math.abs(e - j.current) * t > Tt && (M.current = !0);
|
|
1405
1419
|
}
|
|
1406
1420
|
y(e), O.current !== "mouse" && E(e * r);
|
|
1407
1421
|
}
|
|
1408
|
-
}),
|
|
1409
|
-
O.current = e.pointerType, k.current = 0,
|
|
1410
|
-
},
|
|
1411
|
-
|
|
1412
|
-
let i = k.current > 0 ?
|
|
1422
|
+
}), F = (e) => {
|
|
1423
|
+
O.current = e.pointerType, k.current = 0, j.current = void 0, M.current = !1, P.onPointerDown(e);
|
|
1424
|
+
}, R = (t) => {
|
|
1425
|
+
P.onPointerUp(t);
|
|
1426
|
+
let i = k.current > 0 ? A.current : void 0;
|
|
1413
1427
|
if (i !== void 0 && r) {
|
|
1414
1428
|
let t = i * r;
|
|
1415
1429
|
n ? n(t) : e.seek(t);
|
|
1416
1430
|
}
|
|
1417
|
-
k.current = 0,
|
|
1418
|
-
},
|
|
1431
|
+
k.current = 0, M.current = !1, j.current = void 0, t.pointerType !== "mouse" && E(void 0);
|
|
1432
|
+
}, z = (e) => {
|
|
1419
1433
|
if (!_.current) return;
|
|
1420
1434
|
let { left: t, right: n } = _.current.getBoundingClientRect();
|
|
1421
1435
|
return Math.min(Math.max((e - t) / (n - t), 0), 1) * r;
|
|
1422
|
-
},
|
|
1423
|
-
|
|
1424
|
-
},
|
|
1425
|
-
|
|
1436
|
+
}, B = w("mouse"), V = (e) => {
|
|
1437
|
+
B.current = e.pointerType;
|
|
1438
|
+
}, ee = (e) => {
|
|
1439
|
+
B.current !== "touch" && E(z(e.clientX));
|
|
1426
1440
|
}, te = () => {
|
|
1427
1441
|
_.current && E(void 0);
|
|
1428
|
-
}, H = (e) => r ? e / r * 100 : 0,
|
|
1442
|
+
}, H = (e) => r ? e / r * 100 : 0, ne = (e, t, n) => {
|
|
1429
1443
|
let r = Number((n - t).toFixed(4)), i = t * 100;
|
|
1430
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ I("div", {
|
|
1431
1445
|
className: "loaded-part",
|
|
1432
1446
|
style: {
|
|
1433
1447
|
transform: `scaleX(${r})`,
|
|
1434
1448
|
marginLeft: `${i}%`
|
|
1435
1449
|
}
|
|
1436
1450
|
}, e);
|
|
1437
|
-
},
|
|
1451
|
+
}, U = C(() => i === void 0 ? r ? o.map(([e, t], n) => ne(n, e / r, t / r)) : [] : a?.map((e, t) => {
|
|
1438
1452
|
if (!i || !r) return null;
|
|
1439
1453
|
let n = s.filter((t) => e.startByteOffset <= t.pos && t.pos <= e.endByteOffset), a = n.at(0), o = n.at(-1);
|
|
1440
|
-
return !a || !o ? null :
|
|
1454
|
+
return !a || !o ? null : ne(t, a.timestamp / r, o.timestamp / r);
|
|
1441
1455
|
}) ?? [], [
|
|
1442
1456
|
r,
|
|
1443
1457
|
i,
|
|
@@ -1445,41 +1459,41 @@ var oe = {
|
|
|
1445
1459
|
s.length,
|
|
1446
1460
|
a?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}/${t}`).join(",")
|
|
1447
1461
|
]);
|
|
1448
|
-
|
|
1449
|
-
v !== void 0 && r &&
|
|
1462
|
+
S(() => {
|
|
1463
|
+
v !== void 0 && r && N && M.current && e.seek(v * r);
|
|
1450
1464
|
}, [
|
|
1451
1465
|
e,
|
|
1452
|
-
|
|
1466
|
+
N,
|
|
1453
1467
|
v,
|
|
1454
1468
|
r
|
|
1455
1469
|
]);
|
|
1456
|
-
let
|
|
1470
|
+
let re = C(() => {
|
|
1457
1471
|
if (!r) return 0;
|
|
1458
|
-
if (
|
|
1459
|
-
let e =
|
|
1472
|
+
if (N && v !== void 0) return v;
|
|
1473
|
+
let e = f ?? t;
|
|
1460
1474
|
return typeof e == "number" ? e / r : 0;
|
|
1461
1475
|
}, [
|
|
1462
1476
|
r,
|
|
1463
1477
|
t,
|
|
1464
|
-
|
|
1478
|
+
N,
|
|
1465
1479
|
v,
|
|
1466
|
-
|
|
1467
|
-
]),
|
|
1468
|
-
if (!
|
|
1469
|
-
let e = b / r * 100, t =
|
|
1470
|
-
return t >= 0 ? t :
|
|
1480
|
+
f
|
|
1481
|
+
]), W = C(() => p(d, r), [d, r]), G = W.length > 0, K = C(() => {
|
|
1482
|
+
if (!G || b === void 0 || !r) return -1;
|
|
1483
|
+
let e = b / r * 100, t = W.findIndex((t, n) => n < W.length - 1 && e >= t && e < W[n + 1]);
|
|
1484
|
+
return t >= 0 ? t : W.length - 2;
|
|
1471
1485
|
}, [
|
|
1472
|
-
|
|
1473
|
-
|
|
1486
|
+
G,
|
|
1487
|
+
W,
|
|
1474
1488
|
b,
|
|
1475
1489
|
r
|
|
1476
|
-
]),
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
]),
|
|
1490
|
+
]), q = C(() => G ? m(W, (e) => e !== K) : void 0, [
|
|
1491
|
+
G,
|
|
1492
|
+
W,
|
|
1493
|
+
K
|
|
1494
|
+
]), ie = C(() => K >= 0 ? m(W, (e) => e === K) : void 0, [W, K]), J = C(() => {
|
|
1481
1495
|
if (b !== void 0) return d.find(({ start: e, end: t }) => e <= b && b < t);
|
|
1482
|
-
}, [d, b]), ae =
|
|
1496
|
+
}, [d, b]), ae = C(() => {
|
|
1483
1497
|
if (b) {
|
|
1484
1498
|
if (l) return l(b);
|
|
1485
1499
|
if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= b && b < t);
|
|
@@ -1488,67 +1502,67 @@ var oe = {
|
|
|
1488
1502
|
c,
|
|
1489
1503
|
l,
|
|
1490
1504
|
b
|
|
1491
|
-
]), oe = (e, t) => /* @__PURE__ */
|
|
1505
|
+
]), oe = (e, t) => /* @__PURE__ */ L("div", {
|
|
1492
1506
|
className: e ? `track ${e}` : "track",
|
|
1493
1507
|
style: t ? { maskImage: t } : void 0,
|
|
1494
1508
|
children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ I("div", { className: "background-bar" }),
|
|
1510
|
+
/* @__PURE__ */ I("div", {
|
|
1497
1511
|
className: "loaded",
|
|
1498
|
-
children:
|
|
1512
|
+
children: U
|
|
1499
1513
|
}),
|
|
1500
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ I("div", {
|
|
1501
1515
|
className: "play-container",
|
|
1502
|
-
children: /* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ I("div", {
|
|
1503
1517
|
className: "play",
|
|
1504
|
-
style: { transform: `scaleX(${
|
|
1518
|
+
style: { transform: `scaleX(${re})` }
|
|
1505
1519
|
})
|
|
1506
1520
|
})
|
|
1507
1521
|
]
|
|
1508
1522
|
});
|
|
1509
|
-
return /* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ L("div", {
|
|
1510
1524
|
css: wt,
|
|
1511
1525
|
ref: _,
|
|
1512
1526
|
className: [
|
|
1513
1527
|
"progress-bar",
|
|
1514
|
-
|
|
1515
|
-
|
|
1528
|
+
N ? "dragging" : "",
|
|
1529
|
+
G ? "segmented" : ""
|
|
1516
1530
|
].filter(Boolean).join(" "),
|
|
1517
|
-
onPointerDown:
|
|
1518
|
-
onPointerMove:
|
|
1519
|
-
onMouseMove:
|
|
1531
|
+
onPointerDown: V,
|
|
1532
|
+
onPointerMove: V,
|
|
1533
|
+
onMouseMove: ee,
|
|
1520
1534
|
onMouseOut: te,
|
|
1521
1535
|
children: [
|
|
1522
|
-
oe(void 0,
|
|
1523
|
-
b ? /* @__PURE__ */
|
|
1536
|
+
oe(void 0, q),
|
|
1537
|
+
b ? /* @__PURE__ */ L("div", {
|
|
1524
1538
|
className: "cursor-time",
|
|
1525
1539
|
style: {
|
|
1526
|
-
left:
|
|
1527
|
-
maxWidth:
|
|
1540
|
+
left: J ? `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))))`,
|
|
1541
|
+
maxWidth: J ? "var(--thumbnail-width)" : void 0
|
|
1528
1542
|
},
|
|
1529
|
-
children: [/* @__PURE__ */
|
|
1543
|
+
children: [/* @__PURE__ */ I("span", {
|
|
1530
1544
|
className: "cursor-time-value",
|
|
1531
1545
|
children: ht(b)
|
|
1532
|
-
}),
|
|
1546
|
+
}), J ? /* @__PURE__ */ I("span", {
|
|
1533
1547
|
className: "chapter-title",
|
|
1534
|
-
children:
|
|
1548
|
+
children: J.title
|
|
1535
1549
|
}) : void 0]
|
|
1536
1550
|
}) : void 0,
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ I("div", { className: "progress" }),
|
|
1552
|
+
/* @__PURE__ */ I("div", { className: "hover" }),
|
|
1553
|
+
ie ? oe("focus", ie) : void 0,
|
|
1554
|
+
/* @__PURE__ */ I("div", { className: "scrubber" }),
|
|
1555
|
+
/* @__PURE__ */ I("div", {
|
|
1542
1556
|
className: "padding",
|
|
1543
|
-
...
|
|
1544
|
-
onPointerDown:
|
|
1545
|
-
onPointerUp:
|
|
1546
|
-
onPointerCancel:
|
|
1557
|
+
...P,
|
|
1558
|
+
onPointerDown: F,
|
|
1559
|
+
onPointerUp: R,
|
|
1560
|
+
onPointerCancel: R
|
|
1547
1561
|
}),
|
|
1548
|
-
/* @__PURE__ */
|
|
1562
|
+
/* @__PURE__ */ I("div", {
|
|
1549
1563
|
className: "thumbnail",
|
|
1550
1564
|
style: { left: `clamp(var(--thumbnail-half), ${H(b ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
|
|
1551
|
-
children: ae?.url ? /* @__PURE__ */
|
|
1565
|
+
children: ae?.url ? /* @__PURE__ */ I("img", { src: ae.url }) : void 0
|
|
1552
1566
|
})
|
|
1553
1567
|
]
|
|
1554
1568
|
});
|
|
@@ -1562,12 +1576,12 @@ var oe = {
|
|
|
1562
1576
|
strokeWidth: 2,
|
|
1563
1577
|
strokeLinecap: "round",
|
|
1564
1578
|
strokeLinejoin: "round"
|
|
1565
|
-
}, kt = (e) => /* @__PURE__ */
|
|
1579
|
+
}, kt = (e) => /* @__PURE__ */ L("svg", {
|
|
1566
1580
|
...Ot,
|
|
1567
1581
|
...e,
|
|
1568
1582
|
children: [
|
|
1569
|
-
/* @__PURE__ */
|
|
1570
|
-
/* @__PURE__ */
|
|
1583
|
+
/* @__PURE__ */ I("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
1584
|
+
/* @__PURE__ */ I("rect", {
|
|
1571
1585
|
x: "12",
|
|
1572
1586
|
y: "13",
|
|
1573
1587
|
width: "10",
|
|
@@ -1575,14 +1589,14 @@ var oe = {
|
|
|
1575
1589
|
rx: "1",
|
|
1576
1590
|
ry: "1"
|
|
1577
1591
|
}),
|
|
1578
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ I("path", { d: "M14.5 18.5h2m2 0h1" })
|
|
1579
1593
|
]
|
|
1580
|
-
}), At = (e) => /* @__PURE__ */
|
|
1594
|
+
}), At = (e) => /* @__PURE__ */ L("svg", {
|
|
1581
1595
|
...Ot,
|
|
1582
1596
|
...e,
|
|
1583
1597
|
children: [
|
|
1584
|
-
/* @__PURE__ */
|
|
1585
|
-
/* @__PURE__ */
|
|
1598
|
+
/* @__PURE__ */ I("path", { d: "M21 11V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h5" }),
|
|
1599
|
+
/* @__PURE__ */ I("rect", {
|
|
1586
1600
|
x: "12",
|
|
1587
1601
|
y: "13",
|
|
1588
1602
|
width: "10",
|
|
@@ -1590,9 +1604,9 @@ var oe = {
|
|
|
1590
1604
|
rx: "1",
|
|
1591
1605
|
ry: "1"
|
|
1592
1606
|
}),
|
|
1593
|
-
/* @__PURE__ */
|
|
1607
|
+
/* @__PURE__ */ I("path", { d: "M6 9h3m2 0h2" })
|
|
1594
1608
|
]
|
|
1595
|
-
}), jt =
|
|
1609
|
+
}), jt = D`
|
|
1596
1610
|
.popover {
|
|
1597
1611
|
position: absolute;
|
|
1598
1612
|
/* Anchored to the PLAYER's right edge, never to the gear. The gear is not the last control in the
|
|
@@ -1723,23 +1737,23 @@ var oe = {
|
|
|
1723
1737
|
`, Mt = ({ title: e, tracks: t, selected: n, onSelect: r, onBack: i, offLabel: o, pending: s, failed: c }) => {
|
|
1724
1738
|
let { format: l } = Q(), u = s !== void 0, d = (e, i, a) => {
|
|
1725
1739
|
let o = u && s === e, c = u || t.find((t) => t.id === e)?.disabled;
|
|
1726
|
-
return /* @__PURE__ */
|
|
1740
|
+
return /* @__PURE__ */ L("div", {
|
|
1727
1741
|
onClick: () => {
|
|
1728
1742
|
c || r(e ?? void 0);
|
|
1729
1743
|
},
|
|
1730
1744
|
className: [a, c ? "unavailable" : null].filter(Boolean).join(" ") || void 0,
|
|
1731
|
-
children: [/* @__PURE__ */
|
|
1745
|
+
children: [/* @__PURE__ */ I("span", { children: i }), /* @__PURE__ */ I("span", { children: o ? "…" : (n ?? null) === e ? "✓" : "" })]
|
|
1732
1746
|
}, e ?? "__off__");
|
|
1733
1747
|
};
|
|
1734
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ L("div", {
|
|
1735
1749
|
className: "popover track-list",
|
|
1736
1750
|
children: [
|
|
1737
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ L("div", {
|
|
1738
1752
|
className: i ? "back" : "back no-hover",
|
|
1739
1753
|
onClick: i,
|
|
1740
|
-
children: [i ? /* @__PURE__ */
|
|
1754
|
+
children: [i ? /* @__PURE__ */ I(ee, {}) : null, /* @__PURE__ */ I("span", { children: e })]
|
|
1741
1755
|
}),
|
|
1742
|
-
c ? /* @__PURE__ */
|
|
1756
|
+
c ? /* @__PURE__ */ I("div", {
|
|
1743
1757
|
className: "no-hover failed",
|
|
1744
1758
|
dir: "auto",
|
|
1745
1759
|
children: l(a.switchFailed)
|
|
@@ -1749,12 +1763,12 @@ var oe = {
|
|
|
1749
1763
|
]
|
|
1750
1764
|
});
|
|
1751
1765
|
}, Nt = ({ onReset: e } = {}) => {
|
|
1752
|
-
let t =
|
|
1766
|
+
let t = w(null), [n, r] = T(!1), [i, a] = T(void 0), [o, s] = T(!1), c = w(e);
|
|
1753
1767
|
c.current = e;
|
|
1754
1768
|
let l = () => {
|
|
1755
1769
|
r(!1), c.current?.();
|
|
1756
1770
|
};
|
|
1757
|
-
return
|
|
1771
|
+
return S(() => {
|
|
1758
1772
|
let e = (e) => {
|
|
1759
1773
|
n && t.current && !t.current.contains(e.target) && l();
|
|
1760
1774
|
};
|
|
@@ -1789,7 +1803,7 @@ var oe = {
|
|
|
1789
1803
|
});
|
|
1790
1804
|
}
|
|
1791
1805
|
};
|
|
1792
|
-
}, Pt =
|
|
1806
|
+
}, Pt = D`
|
|
1793
1807
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
1794
1808
|
which is the width of the player box, so it can be clamped to it. */
|
|
1795
1809
|
position: static;
|
|
@@ -1885,43 +1899,43 @@ ${jt}
|
|
|
1885
1899
|
e.detail
|
|
1886
1900
|
].filter(Boolean).join("\n");
|
|
1887
1901
|
}).join("\n\n"), zt = () => {
|
|
1888
|
-
let e = Y((e) => e.playbackErrors), { format: t, locale: n } = Q(), { open: r, toggle: i, containerRef: o } = Nt(), [s, c] =
|
|
1902
|
+
let e = Y((e) => e.playbackErrors), { format: t, locale: n } = Q(), { open: r, toggle: i, containerRef: o } = Nt(), [s, c] = T(!1);
|
|
1889
1903
|
if (e.length === 0) return null;
|
|
1890
1904
|
let l = () => {
|
|
1891
1905
|
navigator.clipboard?.writeText(Rt(e)).then(() => {
|
|
1892
1906
|
c(!0), setTimeout(() => c(!1), 2e3);
|
|
1893
1907
|
}, (e) => console.warn("[media-player] could not copy the errors:", e));
|
|
1894
1908
|
}, u = t(a.errors, { count: Lt(e) });
|
|
1895
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ L("div", {
|
|
1896
1910
|
css: Pt,
|
|
1897
1911
|
ref: o,
|
|
1898
|
-
children: [/* @__PURE__ */
|
|
1912
|
+
children: [/* @__PURE__ */ I(St, {
|
|
1899
1913
|
id: "errors",
|
|
1900
1914
|
disabled: r,
|
|
1901
|
-
text: /* @__PURE__ */
|
|
1915
|
+
text: /* @__PURE__ */ I("button", {
|
|
1902
1916
|
className: "errors",
|
|
1903
1917
|
type: "button",
|
|
1904
1918
|
onClick: i,
|
|
1905
1919
|
"aria-label": u,
|
|
1906
1920
|
"aria-expanded": r,
|
|
1907
|
-
children: /* @__PURE__ */
|
|
1921
|
+
children: /* @__PURE__ */ I(q, { className: "alert-triangle" })
|
|
1908
1922
|
}),
|
|
1909
|
-
toolTipText: /* @__PURE__ */
|
|
1910
|
-
}), r && /* @__PURE__ */
|
|
1923
|
+
toolTipText: /* @__PURE__ */ I("span", { children: u })
|
|
1924
|
+
}), r && /* @__PURE__ */ L("div", {
|
|
1911
1925
|
className: "popover error-list",
|
|
1912
|
-
children: [/* @__PURE__ */
|
|
1926
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1913
1927
|
className: "back no-hover",
|
|
1914
|
-
children: [/* @__PURE__ */
|
|
1928
|
+
children: [/* @__PURE__ */ I("span", { children: u }), /* @__PURE__ */ L("button", {
|
|
1915
1929
|
className: "copy",
|
|
1916
1930
|
type: "button",
|
|
1917
1931
|
onClick: l,
|
|
1918
1932
|
"aria-label": t(a.copyErrors),
|
|
1919
|
-
children: [
|
|
1933
|
+
children: [I(s ? V : H, {}), /* @__PURE__ */ I("span", { children: t(s ? a.copied : a.copy) })]
|
|
1920
1934
|
})]
|
|
1921
|
-
}), e.map((e, r) => /* @__PURE__ */
|
|
1935
|
+
}), e.map((e, r) => /* @__PURE__ */ L("div", {
|
|
1922
1936
|
className: "entry no-hover",
|
|
1923
1937
|
children: [
|
|
1924
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ L("span", {
|
|
1925
1939
|
className: "when",
|
|
1926
1940
|
children: [
|
|
1927
1941
|
e.count > 1 ? t(a.errorSpan, {
|
|
@@ -1930,17 +1944,17 @@ ${jt}
|
|
|
1930
1944
|
}) : Ft(e.at, n),
|
|
1931
1945
|
It(e.atMediaTime) ? ` ${t(a.errorAt, { time: It(e.atMediaTime) })}` : "",
|
|
1932
1946
|
e.recovered ? ` ${t(a.recovered)}` : "",
|
|
1933
|
-
e.count > 1 ? /* @__PURE__ */
|
|
1947
|
+
e.count > 1 ? /* @__PURE__ */ I("span", {
|
|
1934
1948
|
className: "count",
|
|
1935
1949
|
children: `×${e.count}`
|
|
1936
1950
|
}) : null
|
|
1937
1951
|
]
|
|
1938
1952
|
}),
|
|
1939
|
-
/* @__PURE__ */
|
|
1953
|
+
/* @__PURE__ */ I("span", {
|
|
1940
1954
|
className: "what",
|
|
1941
1955
|
children: e.message
|
|
1942
1956
|
}),
|
|
1943
|
-
e.detail ? /* @__PURE__ */
|
|
1957
|
+
e.detail ? /* @__PURE__ */ I("span", {
|
|
1944
1958
|
className: "cause",
|
|
1945
1959
|
children: e.detail
|
|
1946
1960
|
}) : null
|
|
@@ -1948,7 +1962,7 @@ ${jt}
|
|
|
1948
1962
|
}, `${e.at}-${r}`))]
|
|
1949
1963
|
})]
|
|
1950
1964
|
});
|
|
1951
|
-
}, Bt =
|
|
1965
|
+
}, Bt = D`
|
|
1952
1966
|
display: flex;
|
|
1953
1967
|
align-items: center;
|
|
1954
1968
|
justify-content: center;
|
|
@@ -2002,7 +2016,7 @@ width: 100%;
|
|
|
2002
2016
|
}
|
|
2003
2017
|
}
|
|
2004
2018
|
`, Vt = () => {
|
|
2005
|
-
let e = Y(), { format: t, number: n } = Q(), r = Y((e) => e.playbackRate), i =
|
|
2019
|
+
let e = Y(), { format: t, number: n } = Q(), r = Y((e) => e.playbackRate), i = w(null), o = w(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({
|
|
2006
2020
|
ref: o,
|
|
2007
2021
|
onChange: (t) => e.setPlaybackRate(f(t))
|
|
2008
2022
|
}), m = (t) => {
|
|
@@ -2010,36 +2024,36 @@ width: 100%;
|
|
|
2010
2024
|
let n = .05, r = u;
|
|
2011
2025
|
r = t.deltaY < 0 ? Math.min(3, r + n) : Math.max(s, r - n), e.setPlaybackRate(r);
|
|
2012
2026
|
};
|
|
2013
|
-
|
|
2027
|
+
S(() => {
|
|
2014
2028
|
let e = i.current;
|
|
2015
2029
|
return e && e.addEventListener("wheel", m, { passive: !1 }), () => {
|
|
2016
2030
|
e && e.removeEventListener("wheel", m);
|
|
2017
2031
|
};
|
|
2018
2032
|
}, [r]);
|
|
2019
2033
|
let h = d(u);
|
|
2020
|
-
return /* @__PURE__ */
|
|
2034
|
+
return /* @__PURE__ */ L("div", {
|
|
2021
2035
|
css: Bt,
|
|
2022
|
-
children: [/* @__PURE__ */
|
|
2036
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.speed, { rate: n(u, {
|
|
2023
2037
|
minimumFractionDigits: 2,
|
|
2024
2038
|
maximumFractionDigits: 2
|
|
2025
|
-
}) }) }), /* @__PURE__ */
|
|
2039
|
+
}) }) }), /* @__PURE__ */ I("div", {
|
|
2026
2040
|
className: "playback-slider",
|
|
2027
2041
|
ref: i,
|
|
2028
2042
|
...p,
|
|
2029
|
-
children: /* @__PURE__ */
|
|
2043
|
+
children: /* @__PURE__ */ I("div", {
|
|
2030
2044
|
ref: o,
|
|
2031
2045
|
style: { background: `linear-gradient(to right,
|
|
2032
2046
|
#fff 0% ${h}%,
|
|
2033
2047
|
#3A3A3A ${h}% 100%
|
|
2034
2048
|
)` },
|
|
2035
|
-
children: /* @__PURE__ */
|
|
2049
|
+
children: /* @__PURE__ */ I("div", {
|
|
2036
2050
|
className: "playback-handle",
|
|
2037
2051
|
style: { left: `${h}%` }
|
|
2038
2052
|
})
|
|
2039
2053
|
})
|
|
2040
2054
|
})]
|
|
2041
2055
|
});
|
|
2042
|
-
}, Ht =
|
|
2056
|
+
}, Ht = D`
|
|
2043
2057
|
/* Deliberately NOT a containing block. The menu anchors to the control bar instead, which is exactly
|
|
2044
2058
|
as wide as the player box and can therefore be clamped to it. The outside-click check uses
|
|
2045
2059
|
\`contains\` on the ref, which is DOM containment and needs no position, and the bar's other
|
|
@@ -2139,7 +2153,7 @@ ${jt}
|
|
|
2139
2153
|
1.5,
|
|
2140
2154
|
2
|
|
2141
2155
|
], Wt = () => {
|
|
2142
|
-
let e = Y(), { format: t, number: n } = Q(), r = Y((e) => e.playbackRate), i = Y((e) => e.audioTracks), o = Y((e) => e.selectedAudioTrack), s = Y((e) => e.selectAudioTrack), c = Y((e) => e.quality), l = Y((e) => e.volumeNormalizer), [u, d] =
|
|
2156
|
+
let e = Y(), { format: t, number: n } = Q(), r = Y((e) => e.playbackRate), i = Y((e) => e.audioTracks), o = Y((e) => e.selectedAudioTrack), s = Y((e) => e.selectAudioTrack), c = Y((e) => e.quality), l = Y((e) => e.volumeNormalizer), [u, d] = T(0), { open: f, toggle: p, containerRef: m, pending: h, failed: g, runSelect: _ } = Nt({ onReset: () => d(0) }), v = (t) => {
|
|
2143
2157
|
e.setPlaybackRate(t), d(0);
|
|
2144
2158
|
}, y = (e) => {
|
|
2145
2159
|
e !== void 0 && _(e, () => s(e));
|
|
@@ -2148,48 +2162,48 @@ ${jt}
|
|
|
2148
2162
|
}, 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) => () => {
|
|
2149
2163
|
d(e);
|
|
2150
2164
|
};
|
|
2151
|
-
return /* @__PURE__ */
|
|
2165
|
+
return /* @__PURE__ */ L("div", {
|
|
2152
2166
|
css: Ht,
|
|
2153
2167
|
ref: m,
|
|
2154
2168
|
children: [
|
|
2155
|
-
/* @__PURE__ */
|
|
2169
|
+
/* @__PURE__ */ I(St, {
|
|
2156
2170
|
id: "settings",
|
|
2157
2171
|
disabled: f,
|
|
2158
|
-
text: /* @__PURE__ */
|
|
2172
|
+
text: /* @__PURE__ */ I("button", {
|
|
2159
2173
|
className: "settings",
|
|
2160
2174
|
type: "button",
|
|
2161
2175
|
onClick: p,
|
|
2162
2176
|
"aria-label": t(a.settings),
|
|
2163
2177
|
"aria-expanded": f,
|
|
2164
|
-
children: /* @__PURE__ */
|
|
2178
|
+
children: /* @__PURE__ */ I(K, {})
|
|
2165
2179
|
}),
|
|
2166
|
-
toolTipText: /* @__PURE__ */
|
|
2180
|
+
toolTipText: /* @__PURE__ */ I("span", { children: t(a.settings) })
|
|
2167
2181
|
}),
|
|
2168
|
-
f && u === 0 && /* @__PURE__ */
|
|
2182
|
+
f && u === 0 && /* @__PURE__ */ L("div", {
|
|
2169
2183
|
className: "popover menu",
|
|
2170
2184
|
children: [
|
|
2171
|
-
i.length > 1 ? /* @__PURE__ */
|
|
2185
|
+
i.length > 1 ? /* @__PURE__ */ L("div", {
|
|
2172
2186
|
onClick: C(2),
|
|
2173
|
-
children: [/* @__PURE__ */
|
|
2187
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.audio) }), /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(te, {}) })]
|
|
2174
2188
|
}) : null,
|
|
2175
|
-
x > 1 ? /* @__PURE__ */
|
|
2189
|
+
x > 1 ? /* @__PURE__ */ L("div", {
|
|
2176
2190
|
onClick: C(3),
|
|
2177
|
-
children: [/* @__PURE__ */
|
|
2191
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.quality) }), /* @__PURE__ */ L("div", { children: [S ? /* @__PURE__ */ I("span", {
|
|
2178
2192
|
className: "secondary",
|
|
2179
2193
|
children: S
|
|
2180
|
-
}) : null, /* @__PURE__ */
|
|
2194
|
+
}) : null, /* @__PURE__ */ I(te, {})] })]
|
|
2181
2195
|
}) : null,
|
|
2182
|
-
/* @__PURE__ */
|
|
2196
|
+
/* @__PURE__ */ L("div", {
|
|
2183
2197
|
onClick: C(1),
|
|
2184
|
-
children: [/* @__PURE__ */
|
|
2198
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.playbackSpeed) }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("span", {
|
|
2185
2199
|
className: "secondary",
|
|
2186
2200
|
children: r === 1 ? t(a.defaultSpeed) : n(r, {
|
|
2187
2201
|
minimumFractionDigits: 2,
|
|
2188
2202
|
maximumFractionDigits: 2
|
|
2189
2203
|
})
|
|
2190
|
-
}), /* @__PURE__ */
|
|
2204
|
+
}), /* @__PURE__ */ I(te, {})] })]
|
|
2191
2205
|
}),
|
|
2192
|
-
l ? /* @__PURE__ */
|
|
2206
|
+
l ? /* @__PURE__ */ L("div", {
|
|
2193
2207
|
role: "switch",
|
|
2194
2208
|
"aria-checked": l.available && l.enabled,
|
|
2195
2209
|
"aria-disabled": !l.available,
|
|
@@ -2197,35 +2211,35 @@ ${jt}
|
|
|
2197
2211
|
onClick: () => {
|
|
2198
2212
|
l.available && l.setEnabled(!l.enabled);
|
|
2199
2213
|
},
|
|
2200
|
-
children: [/* @__PURE__ */
|
|
2214
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.normalizeVolume) }), /* @__PURE__ */ I("div", { children: l.available ? /* @__PURE__ */ I("span", { className: l.enabled ? "switch on" : "switch" }) : /* @__PURE__ */ I("span", {
|
|
2201
2215
|
className: "secondary",
|
|
2202
2216
|
children: t(a.unavailable)
|
|
2203
2217
|
}) })]
|
|
2204
2218
|
}) : null
|
|
2205
2219
|
]
|
|
2206
2220
|
}),
|
|
2207
|
-
f && u === 1 && /* @__PURE__ */
|
|
2221
|
+
f && u === 1 && /* @__PURE__ */ L("div", {
|
|
2208
2222
|
className: "popover playback-rate",
|
|
2209
2223
|
children: [
|
|
2210
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ L("div", {
|
|
2211
2225
|
className: "back",
|
|
2212
2226
|
onClick: C(0),
|
|
2213
|
-
children: [/* @__PURE__ */
|
|
2227
|
+
children: [/* @__PURE__ */ I(ee, {}), /* @__PURE__ */ I("span", { children: t(a.playbackSpeed) })]
|
|
2214
2228
|
}),
|
|
2215
|
-
/* @__PURE__ */
|
|
2229
|
+
/* @__PURE__ */ I("div", {
|
|
2216
2230
|
className: "slider no-hover",
|
|
2217
|
-
children: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ I(Vt, {})
|
|
2218
2232
|
}),
|
|
2219
|
-
/* @__PURE__ */
|
|
2233
|
+
/* @__PURE__ */ I("div", {
|
|
2220
2234
|
className: "options no-hover",
|
|
2221
|
-
children: Ut.map((e) => /* @__PURE__ */
|
|
2235
|
+
children: Ut.map((e) => /* @__PURE__ */ I("div", {
|
|
2222
2236
|
onClick: () => v(e),
|
|
2223
2237
|
children: t(a.speed, { rate: n(e) })
|
|
2224
2238
|
}, e))
|
|
2225
2239
|
})
|
|
2226
2240
|
]
|
|
2227
2241
|
}),
|
|
2228
|
-
f && u === 2 && /* @__PURE__ */
|
|
2242
|
+
f && u === 2 && /* @__PURE__ */ I(Mt, {
|
|
2229
2243
|
title: t(a.audio),
|
|
2230
2244
|
tracks: i,
|
|
2231
2245
|
selected: o,
|
|
@@ -2234,7 +2248,7 @@ ${jt}
|
|
|
2234
2248
|
pending: h,
|
|
2235
2249
|
failed: g
|
|
2236
2250
|
}),
|
|
2237
|
-
f && u === 3 && c && /* @__PURE__ */
|
|
2251
|
+
f && u === 3 && c && /* @__PURE__ */ I(Mt, {
|
|
2238
2252
|
title: t(a.quality),
|
|
2239
2253
|
tracks: c.options,
|
|
2240
2254
|
selected: c.selectedId ?? void 0,
|
|
@@ -2246,7 +2260,7 @@ ${jt}
|
|
|
2246
2260
|
})
|
|
2247
2261
|
]
|
|
2248
2262
|
});
|
|
2249
|
-
}, Gt =
|
|
2263
|
+
}, Gt = D`
|
|
2250
2264
|
/* Not a containing block, for the reason given on popoverStyle: the menu anchors to the control bar,
|
|
2251
2265
|
which is the width of the player box, so it can be clamped to it. */
|
|
2252
2266
|
position: static;
|
|
@@ -2267,23 +2281,23 @@ ${jt}
|
|
|
2267
2281
|
let { format: e } = Q(), t = Y((e) => e.subtitleTracks), n = Y((e) => e.selectedSubtitleTrack), r = Y((e) => e.selectSubtitleTrack), i = Y((e) => e.subtitleOffLabel), { open: o, toggle: s, containerRef: c, pending: l, failed: u, runSelect: d } = Nt();
|
|
2268
2282
|
if (t.length === 0) return null;
|
|
2269
2283
|
let f = n !== void 0;
|
|
2270
|
-
return /* @__PURE__ */
|
|
2284
|
+
return /* @__PURE__ */ L("div", {
|
|
2271
2285
|
css: Gt,
|
|
2272
2286
|
ref: c,
|
|
2273
|
-
children: [/* @__PURE__ */
|
|
2287
|
+
children: [/* @__PURE__ */ I(St, {
|
|
2274
2288
|
id: "subtitles",
|
|
2275
2289
|
disabled: o,
|
|
2276
|
-
text: /* @__PURE__ */
|
|
2290
|
+
text: /* @__PURE__ */ I("button", {
|
|
2277
2291
|
className: "subtitles",
|
|
2278
2292
|
type: "button",
|
|
2279
2293
|
onClick: s,
|
|
2280
2294
|
"aria-label": e(a.subtitles),
|
|
2281
2295
|
"aria-expanded": o,
|
|
2282
2296
|
"aria-pressed": f,
|
|
2283
|
-
children: f ? /* @__PURE__ */
|
|
2297
|
+
children: f ? /* @__PURE__ */ I(z, { className: "captions" }) : /* @__PURE__ */ I(B, { className: "captions-off" })
|
|
2284
2298
|
}),
|
|
2285
|
-
toolTipText: /* @__PURE__ */
|
|
2286
|
-
}), o && /* @__PURE__ */
|
|
2299
|
+
toolTipText: /* @__PURE__ */ I("span", { children: e(a.subtitles) })
|
|
2300
|
+
}), o && /* @__PURE__ */ I(Mt, {
|
|
2287
2301
|
title: e(a.subtitles),
|
|
2288
2302
|
tracks: t,
|
|
2289
2303
|
selected: n,
|
|
@@ -2299,7 +2313,7 @@ ${jt}
|
|
|
2299
2313
|
hover: "rgba(255, 255, 255, 0.13)",
|
|
2300
2314
|
borderPrimary: "#384F70",
|
|
2301
2315
|
backgroundTooltip: "#222222"
|
|
2302
|
-
}, Jt =
|
|
2316
|
+
}, Jt = D`
|
|
2303
2317
|
display: flex;
|
|
2304
2318
|
align-items: center;
|
|
2305
2319
|
|
|
@@ -2343,7 +2357,7 @@ ${jt}
|
|
|
2343
2357
|
height: 10px;
|
|
2344
2358
|
}
|
|
2345
2359
|
`, Yt = ({ value: e, onChange: t }) => {
|
|
2346
|
-
let { number: n } = Q(), r = Y((e) => e.volume), i = Y((e) => e.muted), a =
|
|
2360
|
+
let { number: n } = Q(), r = Y((e) => e.volume), i = Y((e) => e.muted), a = w(null), o = w(null), { handlers: s } = Ct({
|
|
2347
2361
|
ref: o,
|
|
2348
2362
|
onChange: t
|
|
2349
2363
|
}), c = (n) => {
|
|
@@ -2351,37 +2365,37 @@ ${jt}
|
|
|
2351
2365
|
let r = .05, i = e;
|
|
2352
2366
|
i = n.deltaY < 0 ? Math.min(1, i + r) : Math.max(0, i - r), t(i);
|
|
2353
2367
|
};
|
|
2354
|
-
|
|
2368
|
+
S(() => {
|
|
2355
2369
|
let e = a.current;
|
|
2356
2370
|
return e && e.addEventListener("wheel", c, { passive: !1 }), () => {
|
|
2357
2371
|
e && e.removeEventListener("wheel", c);
|
|
2358
2372
|
};
|
|
2359
2373
|
}, [e]);
|
|
2360
|
-
let l = e * 100, u =
|
|
2361
|
-
return /* @__PURE__ */
|
|
2374
|
+
let l = e * 100, u = C(() => Math.round(i ? 0 : mt(r) * 100), [r, i]);
|
|
2375
|
+
return /* @__PURE__ */ I(St, {
|
|
2362
2376
|
id: "volume-slider",
|
|
2363
|
-
text: /* @__PURE__ */
|
|
2377
|
+
text: /* @__PURE__ */ I("div", {
|
|
2364
2378
|
ref: a,
|
|
2365
2379
|
css: Jt,
|
|
2366
2380
|
...s,
|
|
2367
|
-
children: /* @__PURE__ */
|
|
2381
|
+
children: /* @__PURE__ */ I("div", {
|
|
2368
2382
|
ref: o,
|
|
2369
2383
|
style: { background: `linear-gradient(to right,
|
|
2370
2384
|
#fff 0% ${l}%,
|
|
2371
2385
|
#3A3A3A ${l}% 100%
|
|
2372
2386
|
)` },
|
|
2373
|
-
children: /* @__PURE__ */
|
|
2387
|
+
children: /* @__PURE__ */ I("div", {
|
|
2374
2388
|
className: "volume-handle",
|
|
2375
2389
|
style: { left: `${e * 100}%` }
|
|
2376
2390
|
})
|
|
2377
2391
|
})
|
|
2378
2392
|
}),
|
|
2379
|
-
toolTipText: /* @__PURE__ */
|
|
2393
|
+
toolTipText: /* @__PURE__ */ I("div", {
|
|
2380
2394
|
className: "volume-value",
|
|
2381
2395
|
children: n(u / 100, { style: "percent" })
|
|
2382
2396
|
})
|
|
2383
2397
|
});
|
|
2384
|
-
}, Xt =
|
|
2398
|
+
}, Xt = D`
|
|
2385
2399
|
position: relative;
|
|
2386
2400
|
display: flex;
|
|
2387
2401
|
align-items: center;
|
|
@@ -2445,29 +2459,29 @@ ${jt}
|
|
|
2445
2459
|
}
|
|
2446
2460
|
|
|
2447
2461
|
`, Zt = ({ ref: e }) => {
|
|
2448
|
-
let t = Y(), { format: n } = Q(), r = Y((e) => e.volume), i = Y((e) => e.muted), o =
|
|
2449
|
-
return /* @__PURE__ */
|
|
2462
|
+
let t = Y(), { format: n } = Q(), r = Y((e) => e.volume), i = Y((e) => e.muted), o = C(() => mt(r), [r]);
|
|
2463
|
+
return /* @__PURE__ */ L("div", {
|
|
2450
2464
|
css: Xt,
|
|
2451
|
-
children: [/* @__PURE__ */
|
|
2465
|
+
children: [/* @__PURE__ */ I(St, {
|
|
2452
2466
|
id: "sound",
|
|
2453
|
-
text: /* @__PURE__ */
|
|
2467
|
+
text: /* @__PURE__ */ I("button", {
|
|
2454
2468
|
className: "sound",
|
|
2455
2469
|
type: "button",
|
|
2456
2470
|
onClick: () => t.toggleMuted(),
|
|
2457
2471
|
ref: e,
|
|
2458
2472
|
"aria-label": n(a.mute),
|
|
2459
2473
|
"aria-pressed": i || r === 0,
|
|
2460
|
-
children:
|
|
2474
|
+
children: I(i || r === 0 ? ae : r <= .5 ? ie : J, {
|
|
2461
2475
|
size: 18,
|
|
2462
2476
|
color: "#fff"
|
|
2463
2477
|
})
|
|
2464
2478
|
}),
|
|
2465
|
-
toolTipText: /* @__PURE__ */
|
|
2466
|
-
}), /* @__PURE__ */
|
|
2479
|
+
toolTipText: /* @__PURE__ */ I("span", { children: n(i ? a.unmuteKey : a.muteKey) })
|
|
2480
|
+
}), /* @__PURE__ */ I("div", {
|
|
2467
2481
|
className: "volume-slider-container",
|
|
2468
|
-
children: /* @__PURE__ */
|
|
2482
|
+
children: /* @__PURE__ */ I("div", {
|
|
2469
2483
|
className: "volume-slider-background",
|
|
2470
|
-
children: /* @__PURE__ */
|
|
2484
|
+
children: /* @__PURE__ */ I(Yt, {
|
|
2471
2485
|
value: i ? 0 : o,
|
|
2472
2486
|
onChange: (e) => {
|
|
2473
2487
|
t.setVolume(pt(e));
|
|
@@ -2476,7 +2490,7 @@ ${jt}
|
|
|
2476
2490
|
})
|
|
2477
2491
|
})]
|
|
2478
2492
|
});
|
|
2479
|
-
}, Qt = .05, $t = 5, en = 50, tn = 1e3, nn =
|
|
2493
|
+
}, Qt = .05, $t = 5, en = 50, tn = 1e3, nn = D`
|
|
2480
2494
|
position: absolute;
|
|
2481
2495
|
bottom: 0;
|
|
2482
2496
|
width: 100%;
|
|
@@ -2607,39 +2621,39 @@ ${jt}
|
|
|
2607
2621
|
}
|
|
2608
2622
|
}
|
|
2609
2623
|
`, rn = ({ shortcuts: e = "window", root: t, fullscreen: n }) => {
|
|
2610
|
-
let r = Y(), { format: i } = Q(), o = Y((e) => e.paused), s = Y((e) => e.currentTime), c = Y((e) => e.duration), l = Y((e) => e.seekingTo), u = Y((e) => e.fullscreen), d = n ? n.active : u, f =
|
|
2624
|
+
let r = Y(), { format: i } = Q(), o = Y((e) => e.paused), s = Y((e) => e.currentTime), c = Y((e) => e.duration), l = Y((e) => e.seekingTo), u = Y((e) => e.fullscreen), d = n ? n.active : u, f = w(n);
|
|
2611
2625
|
f.current = n;
|
|
2612
|
-
let p = Y((e) => e.hideUI), m = Y((e) => e.togglePictureInPicture), h = Y((e) => e.pictureInPictureMode), g = Y((e) => e.burnedInSubtitles), _ = Y((e) => e.passThroughPictureInPicture), v = Y((e) => e.subtitleTracks),
|
|
2626
|
+
let p = Y((e) => e.hideUI), m = Y((e) => e.togglePictureInPicture), h = Y((e) => e.pictureInPictureMode), g = Y((e) => e.burnedInSubtitles), _ = Y((e) => e.passThroughPictureInPicture), v = Y((e) => e.subtitleTracks), y = Y((e) => e.requestSeek), x = Y((e) => e.stepFrame), [C, E] = T(null), D = w(null), O = w(void 0), k = h === "burn-in", A = v.length > 0, j = c > 0 && s === c, M = b(({ direction: e, stepSize: t }) => {
|
|
2613
2627
|
let n = mt(r.volume), i = e === "up" ? t : -t, a = Math.max(0, Math.min(1, n + i)), o = r.muted;
|
|
2614
2628
|
r.setVolume(pt(a)), o && !r.muted && r.toggleMuted();
|
|
2615
|
-
}, [r]),
|
|
2629
|
+
}, [r]), N = w(!1), P = b(() => {
|
|
2616
2630
|
f.current ? f.current.request() : r.toggleFullscreen();
|
|
2617
2631
|
}, [r]);
|
|
2618
|
-
|
|
2619
|
-
let n = (e) =>
|
|
2620
|
-
|
|
2632
|
+
S(() => {
|
|
2633
|
+
let n = (e) => y ? y(e) : r.seek(e), i = (e) => e.composedPath()[0], a = (e) => {
|
|
2634
|
+
N.current = !!t.current?.contains(i(e) ?? null);
|
|
2621
2635
|
}, o = (a) => {
|
|
2622
2636
|
let o = i(a);
|
|
2623
2637
|
if (o?.isContentEditable || /^(input|textarea|select)$/i.test(o?.tagName ?? "") || (a.ctrlKey || a.metaKey || a.altKey) && !a.getModifierState("AltGraph")) return;
|
|
2624
|
-
let s = t.current?.contains(o ?? null) || o === document.body &&
|
|
2638
|
+
let s = t.current?.contains(o ?? null) || o === document.body && N.current, c = f.current ? f.current.active : r.fullscreen;
|
|
2625
2639
|
if (e === "player" && !c && !s) return;
|
|
2626
2640
|
let l = !0;
|
|
2627
|
-
if (a.key === "f")
|
|
2641
|
+
if (a.key === "f") P();
|
|
2628
2642
|
else if (a.key === "k") r.togglePaused();
|
|
2629
2643
|
else if (a.key === " ") r.togglePaused();
|
|
2630
2644
|
else if (a.key === "m") r.toggleMuted();
|
|
2631
|
-
else if (a.key === "ArrowUp")
|
|
2645
|
+
else if (a.key === "ArrowUp") M({
|
|
2632
2646
|
direction: "up",
|
|
2633
2647
|
stepSize: Qt
|
|
2634
2648
|
});
|
|
2635
|
-
else if (a.key === "ArrowDown")
|
|
2649
|
+
else if (a.key === "ArrowDown") M({
|
|
2636
2650
|
direction: "down",
|
|
2637
2651
|
stepSize: Qt
|
|
2638
2652
|
});
|
|
2639
2653
|
else if (a.key === "ArrowRight") {
|
|
2640
2654
|
if (!r.duration) return;
|
|
2641
2655
|
n(Math.min(r.currentTime + $t, r.duration));
|
|
2642
|
-
} else a.key === "ArrowLeft" ? n(Math.max(r.currentTime - $t, 0)) : (a.key === "<" || a.key === ">") &&
|
|
2656
|
+
} else a.key === "ArrowLeft" ? n(Math.max(r.currentTime - $t, 0)) : (a.key === "<" || a.key === ">") && x ? x(a.key === ">" ? 1 : -1) : l = !1;
|
|
2643
2657
|
l && a.preventDefault();
|
|
2644
2658
|
};
|
|
2645
2659
|
return window.addEventListener("keydown", o), window.addEventListener("pointerdown", a, !0), window.addEventListener("focusin", a, !0), () => {
|
|
@@ -2647,26 +2661,26 @@ ${jt}
|
|
|
2647
2661
|
};
|
|
2648
2662
|
}, [
|
|
2649
2663
|
r,
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2664
|
+
M,
|
|
2665
|
+
y,
|
|
2666
|
+
x,
|
|
2653
2667
|
e,
|
|
2654
2668
|
t,
|
|
2655
|
-
|
|
2669
|
+
P
|
|
2656
2670
|
]);
|
|
2657
|
-
let
|
|
2658
|
-
e.preventDefault(), e.deltaY < 0 ?
|
|
2671
|
+
let F = b((e) => {
|
|
2672
|
+
e.preventDefault(), e.deltaY < 0 ? M({
|
|
2659
2673
|
direction: "up",
|
|
2660
2674
|
stepSize: Qt
|
|
2661
|
-
}) :
|
|
2675
|
+
}) : M({
|
|
2662
2676
|
direction: "down",
|
|
2663
2677
|
stepSize: Qt
|
|
2664
2678
|
});
|
|
2665
|
-
}, [
|
|
2666
|
-
|
|
2667
|
-
if (
|
|
2668
|
-
}, [
|
|
2669
|
-
let
|
|
2679
|
+
}, [M]);
|
|
2680
|
+
S(() => {
|
|
2681
|
+
if (C) return C.addEventListener("wheel", F, { passive: !1 }), () => C.removeEventListener("wheel", F);
|
|
2682
|
+
}, [C, F]);
|
|
2683
|
+
let R = (e) => {
|
|
2670
2684
|
if (!_ || _.active || _.armed || e.pointerType === "touch") return;
|
|
2671
2685
|
let { left: t, top: n, width: r, height: i } = e.currentTarget.getBoundingClientRect();
|
|
2672
2686
|
_.arm({
|
|
@@ -2675,9 +2689,9 @@ ${jt}
|
|
|
2675
2689
|
width: r,
|
|
2676
2690
|
height: i
|
|
2677
2691
|
});
|
|
2678
|
-
},
|
|
2679
|
-
return
|
|
2680
|
-
if (!
|
|
2692
|
+
}, z = !!_?.armed;
|
|
2693
|
+
return S(() => {
|
|
2694
|
+
if (!z) return;
|
|
2681
2695
|
clearInterval(O.current);
|
|
2682
2696
|
let e = Infinity, t = setInterval(() => {
|
|
2683
2697
|
if (Date.now() > e) {
|
|
@@ -2690,95 +2704,95 @@ ${jt}
|
|
|
2690
2704
|
return O.current = t, () => {
|
|
2691
2705
|
e = Date.now() + tn;
|
|
2692
2706
|
};
|
|
2693
|
-
}, [
|
|
2707
|
+
}, [z]), S(() => () => clearInterval(O.current), []), /* @__PURE__ */ L("div", {
|
|
2694
2708
|
className: "control-bar",
|
|
2695
2709
|
css: nn,
|
|
2696
2710
|
style: { ...p ? {
|
|
2697
2711
|
opacity: "0",
|
|
2698
2712
|
pointerEvents: "none"
|
|
2699
|
-
} :
|
|
2700
|
-
children: [/* @__PURE__ */
|
|
2713
|
+
} : z ? { pointerEvents: "none" } : {} },
|
|
2714
|
+
children: [/* @__PURE__ */ I(Et, {}), /* @__PURE__ */ L("div", {
|
|
2701
2715
|
className: "actions",
|
|
2702
|
-
children: [/* @__PURE__ */
|
|
2716
|
+
children: [/* @__PURE__ */ L("div", {
|
|
2703
2717
|
className: "left",
|
|
2704
2718
|
children: [
|
|
2705
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ I(St, {
|
|
2706
2720
|
id: "play",
|
|
2707
2721
|
tooltipPlace: "top-start",
|
|
2708
|
-
text: /* @__PURE__ */
|
|
2722
|
+
text: /* @__PURE__ */ I("button", {
|
|
2709
2723
|
className: "play",
|
|
2710
2724
|
type: "button",
|
|
2711
2725
|
onClick: () => r.togglePaused(),
|
|
2712
|
-
"aria-label": i(
|
|
2713
|
-
children:
|
|
2726
|
+
"aria-label": i(j ? a.replay : o ? a.play : a.pause),
|
|
2727
|
+
children: I(j ? G : o ? W : re, {})
|
|
2714
2728
|
}),
|
|
2715
|
-
toolTipText: /* @__PURE__ */
|
|
2729
|
+
toolTipText: /* @__PURE__ */ I("span", { children: i(j ? a.replayKey : o ? a.playKey : a.pauseKey) })
|
|
2716
2730
|
}),
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ I(Zt, { ref: E }),
|
|
2732
|
+
/* @__PURE__ */ I("div", {
|
|
2719
2733
|
className: "time",
|
|
2720
2734
|
children: gt(l ?? s, c)
|
|
2721
2735
|
})
|
|
2722
2736
|
]
|
|
2723
|
-
}), /* @__PURE__ */
|
|
2737
|
+
}), /* @__PURE__ */ L("div", {
|
|
2724
2738
|
className: "right",
|
|
2725
2739
|
children: [
|
|
2726
|
-
/* @__PURE__ */
|
|
2727
|
-
/* @__PURE__ */
|
|
2728
|
-
/* @__PURE__ */
|
|
2729
|
-
_ ? /* @__PURE__ */
|
|
2740
|
+
/* @__PURE__ */ I(zt, {}),
|
|
2741
|
+
/* @__PURE__ */ I(Kt, {}),
|
|
2742
|
+
/* @__PURE__ */ I(Wt, {}),
|
|
2743
|
+
_ ? /* @__PURE__ */ I(St, {
|
|
2730
2744
|
id: "picture-in-picture",
|
|
2731
2745
|
tooltipPlace: "top-end",
|
|
2732
|
-
text: /* @__PURE__ */
|
|
2746
|
+
text: /* @__PURE__ */ I("button", {
|
|
2733
2747
|
ref: D,
|
|
2734
2748
|
className: _.armed ? "picture-in-picture armed" : "picture-in-picture",
|
|
2735
2749
|
type: "button",
|
|
2736
|
-
onPointerEnter:
|
|
2737
|
-
onPointerMove:
|
|
2750
|
+
onPointerEnter: R,
|
|
2751
|
+
onPointerMove: R,
|
|
2738
2752
|
onClick: _.active ? _.exit : void 0,
|
|
2739
2753
|
"aria-label": i(a.pictureInPicture),
|
|
2740
2754
|
"aria-pressed": _.active,
|
|
2741
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ I("img", {
|
|
2742
2756
|
src: Dt,
|
|
2743
2757
|
alt: ""
|
|
2744
2758
|
})
|
|
2745
2759
|
}),
|
|
2746
|
-
toolTipText: /* @__PURE__ */
|
|
2747
|
-
}) : m ? /* @__PURE__ */
|
|
2760
|
+
toolTipText: /* @__PURE__ */ I("span", { children: i(_.active ? a.exitPictureInPicture : a.pictureInPicture) })
|
|
2761
|
+
}) : m ? /* @__PURE__ */ I(St, {
|
|
2748
2762
|
id: "picture-in-picture",
|
|
2749
2763
|
tooltipPlace: "top-end",
|
|
2750
|
-
text: /* @__PURE__ */
|
|
2764
|
+
text: /* @__PURE__ */ I("button", {
|
|
2751
2765
|
className: "picture-in-picture",
|
|
2752
2766
|
type: "button",
|
|
2753
2767
|
onClick: m,
|
|
2754
|
-
disabled: k && !
|
|
2768
|
+
disabled: k && !A,
|
|
2755
2769
|
"aria-label": i(k ? a.burnIn : a.pictureInPicture),
|
|
2756
2770
|
"aria-pressed": k ? g : void 0,
|
|
2757
|
-
children: k ?
|
|
2771
|
+
children: k ? I(g ? kt : At, {}) : /* @__PURE__ */ I("img", {
|
|
2758
2772
|
src: Dt,
|
|
2759
2773
|
alt: ""
|
|
2760
2774
|
})
|
|
2761
2775
|
}),
|
|
2762
|
-
toolTipText: /* @__PURE__ */
|
|
2776
|
+
toolTipText: /* @__PURE__ */ I("span", { children: i(k ? A ? g ? a.burnedIn : a.burnInOffer : a.noSubtitles : a.pictureInPicture) })
|
|
2763
2777
|
}) : null,
|
|
2764
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ I(St, {
|
|
2765
2779
|
id: "full-screen",
|
|
2766
2780
|
tooltipPlace: "top-end",
|
|
2767
|
-
text: /* @__PURE__ */
|
|
2781
|
+
text: /* @__PURE__ */ I("button", {
|
|
2768
2782
|
className: "full-screen",
|
|
2769
2783
|
type: "button",
|
|
2770
|
-
onClick:
|
|
2784
|
+
onClick: P,
|
|
2771
2785
|
"aria-label": i(a.fullScreen),
|
|
2772
2786
|
"aria-pressed": d,
|
|
2773
|
-
children:
|
|
2787
|
+
children: I(d ? U : ne, {})
|
|
2774
2788
|
}),
|
|
2775
|
-
toolTipText: /* @__PURE__ */
|
|
2789
|
+
toolTipText: /* @__PURE__ */ I("span", { children: i(d ? a.exitFullScreenKey : a.fullScreenKey) })
|
|
2776
2790
|
})
|
|
2777
2791
|
]
|
|
2778
2792
|
})]
|
|
2779
2793
|
})]
|
|
2780
2794
|
});
|
|
2781
|
-
}, an = 9e3, on =
|
|
2795
|
+
}, an = 9e3, on = D`
|
|
2782
2796
|
position: absolute;
|
|
2783
2797
|
inset: 0;
|
|
2784
2798
|
z-index: 2;
|
|
@@ -2822,8 +2836,8 @@ ${jt}
|
|
|
2822
2836
|
color: #fff;
|
|
2823
2837
|
}
|
|
2824
2838
|
`, sn = () => {
|
|
2825
|
-
let { format: e } = Q(), t = Y((e) => e.burnedInSubtitles), n = Y((e) => e.pictureInPictureMode), [r, i] =
|
|
2826
|
-
return
|
|
2839
|
+
let { format: e } = Q(), t = Y((e) => e.burnedInSubtitles), n = Y((e) => e.pictureInPictureMode), [r, i] = T(!1);
|
|
2840
|
+
return S(() => {
|
|
2827
2841
|
if (n !== "burn-in" || !t) {
|
|
2828
2842
|
i(!1);
|
|
2829
2843
|
return;
|
|
@@ -2831,16 +2845,16 @@ ${jt}
|
|
|
2831
2845
|
i(!0);
|
|
2832
2846
|
let e = setTimeout(() => i(!1), an);
|
|
2833
2847
|
return () => clearTimeout(e);
|
|
2834
|
-
}, [n, t]), n !== "burn-in" || !t ? null : /* @__PURE__ */
|
|
2848
|
+
}, [n, t]), n !== "burn-in" || !t ? null : /* @__PURE__ */ I("div", {
|
|
2835
2849
|
css: on,
|
|
2836
2850
|
className: r ? "show" : "",
|
|
2837
2851
|
role: "status",
|
|
2838
|
-
children: /* @__PURE__ */
|
|
2852
|
+
children: /* @__PURE__ */ L("div", {
|
|
2839
2853
|
className: "card",
|
|
2840
|
-
children: [/* @__PURE__ */
|
|
2854
|
+
children: [/* @__PURE__ */ I("div", {
|
|
2841
2855
|
className: "text",
|
|
2842
2856
|
children: e(a.burnInHint)
|
|
2843
|
-
}), /* @__PURE__ */
|
|
2857
|
+
}), /* @__PURE__ */ I("div", {
|
|
2844
2858
|
className: "arrow",
|
|
2845
2859
|
"aria-hidden": "true",
|
|
2846
2860
|
children: "→"
|
|
@@ -2850,7 +2864,7 @@ ${jt}
|
|
|
2850
2864
|
}, cn = 1, ln = 6e3, un = 1, dn = {
|
|
2851
2865
|
opening: a.skipOpening,
|
|
2852
2866
|
ending: a.skipEnding
|
|
2853
|
-
}, fn =
|
|
2867
|
+
}, fn = D`
|
|
2854
2868
|
position: absolute;
|
|
2855
2869
|
inset: 0;
|
|
2856
2870
|
z-index: 2;
|
|
@@ -2902,10 +2916,10 @@ ${jt}
|
|
|
2902
2916
|
}
|
|
2903
2917
|
}
|
|
2904
2918
|
`, pn = ({ endingOffered: e }) => {
|
|
2905
|
-
let t = Y((e) => e.chapters), n = Y((e) => e.currentTime), r = Y((e) => e.requestSeek), i = Y((e) => e.seekPreview), a = Y(), { format: o } = Q(), s =
|
|
2906
|
-
let n =
|
|
2919
|
+
let t = Y((e) => e.chapters), n = Y((e) => e.currentTime), r = Y((e) => e.requestSeek), i = Y((e) => e.seekPreview), a = Y(), { format: o } = Q(), s = C(() => {
|
|
2920
|
+
let n = h(t), r = e ? -1 : n.lastIndexOf("ending");
|
|
2907
2921
|
return n.map((e, t) => t === r ? void 0 : e);
|
|
2908
|
-
}, [t, e]), c =
|
|
2922
|
+
}, [t, e]), c = C(() => {
|
|
2909
2923
|
if (typeof n != "number") return;
|
|
2910
2924
|
let e = t.findIndex((e, t) => s[t] !== void 0 && e.start - cn <= n && n < e.end), r = e >= 0 ? s[e] : void 0;
|
|
2911
2925
|
return r ? {
|
|
@@ -2916,26 +2930,26 @@ ${jt}
|
|
|
2916
2930
|
t,
|
|
2917
2931
|
s,
|
|
2918
2932
|
n
|
|
2919
|
-
]), l =
|
|
2920
|
-
|
|
2933
|
+
]), l = w(0), [u, d] = T(0);
|
|
2934
|
+
S(() => {
|
|
2921
2935
|
let e = typeof n == "number" ? n : 0, t = l.current;
|
|
2922
2936
|
l.current = e, e < t - un && d((e) => e + 1);
|
|
2923
2937
|
}, [n]);
|
|
2924
|
-
let [f, p] =
|
|
2925
|
-
return
|
|
2926
|
-
if (!
|
|
2938
|
+
let [f, p] = T(!1), m = c ? `${c.kind}@${c.end}` : "";
|
|
2939
|
+
return S(() => {
|
|
2940
|
+
if (!m) {
|
|
2927
2941
|
p(!1);
|
|
2928
2942
|
return;
|
|
2929
2943
|
}
|
|
2930
2944
|
p(!0);
|
|
2931
2945
|
let e = setTimeout(() => p(!1), ln);
|
|
2932
2946
|
return () => clearTimeout(e);
|
|
2933
|
-
}, [
|
|
2947
|
+
}, [m, u]), S(() => {
|
|
2934
2948
|
c || p(!1);
|
|
2935
|
-
}, [c]), c ? /* @__PURE__ */
|
|
2949
|
+
}, [c]), c ? /* @__PURE__ */ I("div", {
|
|
2936
2950
|
css: fn,
|
|
2937
2951
|
className: f && !i ? "show" : "",
|
|
2938
|
-
children: /* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ I("button", {
|
|
2939
2953
|
type: "button",
|
|
2940
2954
|
className: "skip-chapter",
|
|
2941
2955
|
onClick: () => {
|
|
@@ -2944,7 +2958,7 @@ ${jt}
|
|
|
2944
2958
|
children: o(dn[c.kind])
|
|
2945
2959
|
})
|
|
2946
2960
|
}) : null;
|
|
2947
|
-
}, mn = 3e3, hn =
|
|
2961
|
+
}, mn = 3e3, hn = D`
|
|
2948
2962
|
position: absolute;
|
|
2949
2963
|
inset: 0;
|
|
2950
2964
|
z-index: 2;
|
|
@@ -2958,7 +2972,7 @@ ${jt}
|
|
|
2958
2972
|
`, gn = (e, t) => {
|
|
2959
2973
|
let n = e.left - t.left, r = e.top - t.top;
|
|
2960
2974
|
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')`;
|
|
2961
|
-
}, _n =
|
|
2975
|
+
}, _n = D`
|
|
2962
2976
|
position: relative;
|
|
2963
2977
|
background-color: black;
|
|
2964
2978
|
display: flex;
|
|
@@ -3015,44 +3029,44 @@ ${jt}
|
|
|
3015
3029
|
&.hide {
|
|
3016
3030
|
cursor: none;
|
|
3017
3031
|
}
|
|
3018
|
-
`, vn = (e, t = "") =>
|
|
3019
|
-
let r = `${t}${
|
|
3020
|
-
return
|
|
3032
|
+
`, vn = (e, t = "") => g.toArray(e).flatMap((e, n) => {
|
|
3033
|
+
let r = `${t}${y(e) && e.key != null ? e.key : n}`;
|
|
3034
|
+
return y(e) && e.type === _ ? vn(e.props.children, `${r}/`) : [{
|
|
3021
3035
|
key: r,
|
|
3022
3036
|
item: e
|
|
3023
3037
|
}];
|
|
3024
3038
|
}), yn = ({ ref: e, onVideoRef: t, onSubtitleRef: n, overlay: r, controls: i, shortcuts: a, fullscreen: o, endingOffered: s, children: c }) => {
|
|
3025
|
-
let l = Y(), u = Y((e) => e.hideUI), d = Y((e) => e.setHideUI), f = Y((e) => e.hasMedia), p = Y((e) => e.passThroughPictureInPicture), m =
|
|
3039
|
+
let l = Y(), u = Y((e) => e.hideUI), d = Y((e) => e.setHideUI), f = Y((e) => e.hasMedia), p = Y((e) => e.passThroughPictureInPicture), m = w(void 0), h = w("mouse"), g = w({
|
|
3026
3040
|
x: -1,
|
|
3027
3041
|
y: -1
|
|
3028
|
-
}), _ =
|
|
3029
|
-
|
|
3042
|
+
}), _ = w(!1), v = w(null);
|
|
3043
|
+
S(() => () => clearTimeout(m.current), []), S(() => {
|
|
3030
3044
|
let e = v.current;
|
|
3031
3045
|
if (!e) return;
|
|
3032
3046
|
let t = new ResizeObserver(([t]) => e.style.setProperty("--mp-height", `${t.contentRect.height}px`));
|
|
3033
3047
|
return t.observe(e), () => t.disconnect();
|
|
3034
|
-
}, []),
|
|
3048
|
+
}, []), S(() => {
|
|
3035
3049
|
f || (clearTimeout(m.current), d(!1));
|
|
3036
3050
|
}, [f, d]);
|
|
3037
3051
|
let y = () => {
|
|
3038
3052
|
f && d(!0);
|
|
3039
3053
|
}, b = (t) => {
|
|
3040
3054
|
v.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
|
|
3041
|
-
},
|
|
3055
|
+
}, x = () => {
|
|
3042
3056
|
if (l.passThroughPictureInPicture?.armed) return !0;
|
|
3043
3057
|
if (h.current !== "mouse") return !1;
|
|
3044
3058
|
let { x: e, y: t } = g.current;
|
|
3045
3059
|
if (!v.current || e < 0) return !1;
|
|
3046
3060
|
let n = document.elementFromPoint(e, t);
|
|
3047
3061
|
return !n || !v.current.contains(n) || n.closest(".video") ? !1 : !n.closest(".control-bar") || _.current || !!v.current.querySelector(".control-bar [aria-expanded=\"true\"]");
|
|
3048
|
-
},
|
|
3049
|
-
if (
|
|
3050
|
-
m.current = setTimeout(
|
|
3062
|
+
}, C = () => {
|
|
3063
|
+
if (x()) {
|
|
3064
|
+
m.current = setTimeout(C, mn);
|
|
3051
3065
|
return;
|
|
3052
3066
|
}
|
|
3053
3067
|
y();
|
|
3054
3068
|
}, T = () => {
|
|
3055
|
-
d(!1), clearTimeout(m.current), m.current = setTimeout(
|
|
3069
|
+
d(!1), clearTimeout(m.current), m.current = setTimeout(C, mn);
|
|
3056
3070
|
}, E = (e) => {
|
|
3057
3071
|
h.current = e.pointerType, e.pointerType === "mouse" && (g.current = {
|
|
3058
3072
|
x: e.clientX,
|
|
@@ -3062,8 +3076,8 @@ ${jt}
|
|
|
3062
3076
|
h.current = e.pointerType, _.current = !0;
|
|
3063
3077
|
}, O = () => {
|
|
3064
3078
|
_.current = !1;
|
|
3065
|
-
}, k =
|
|
3066
|
-
return /* @__PURE__ */
|
|
3079
|
+
}, k = w(!0);
|
|
3080
|
+
return /* @__PURE__ */ L("div", {
|
|
3067
3081
|
css: _n,
|
|
3068
3082
|
ref: b,
|
|
3069
3083
|
onPointerMove: E,
|
|
@@ -3079,8 +3093,8 @@ ${jt}
|
|
|
3079
3093
|
className: u ? "hide" : "",
|
|
3080
3094
|
tabIndex: a === "player" ? -1 : void 0,
|
|
3081
3095
|
children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
vn(r).map(({ key: e, item: t }) => /* @__PURE__ */
|
|
3096
|
+
/* @__PURE__ */ I(ut, { onSubtitleRef: n }),
|
|
3097
|
+
vn(r).map(({ key: e, item: t }) => /* @__PURE__ */ I("div", {
|
|
3084
3098
|
css: hn,
|
|
3085
3099
|
style: { ...u ? {
|
|
3086
3100
|
opacity: "0",
|
|
@@ -3089,22 +3103,22 @@ ${jt}
|
|
|
3089
3103
|
} : {} },
|
|
3090
3104
|
children: t
|
|
3091
3105
|
}, e)),
|
|
3092
|
-
i === !1 ? null : /* @__PURE__ */
|
|
3106
|
+
i === !1 ? null : /* @__PURE__ */ I(xt, {
|
|
3093
3107
|
value: !!o,
|
|
3094
|
-
children: /* @__PURE__ */
|
|
3108
|
+
children: /* @__PURE__ */ I(rn, {
|
|
3095
3109
|
shortcuts: a,
|
|
3096
3110
|
root: v,
|
|
3097
3111
|
fullscreen: o
|
|
3098
3112
|
})
|
|
3099
3113
|
}),
|
|
3100
|
-
/* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
p?.armed && v.current ? /* @__PURE__ */
|
|
3114
|
+
/* @__PURE__ */ I(sn, {}),
|
|
3115
|
+
/* @__PURE__ */ I(pn, { endingOffered: s }),
|
|
3116
|
+
p?.armed && v.current ? /* @__PURE__ */ I("div", {
|
|
3103
3117
|
className: "pass-through",
|
|
3104
3118
|
style: { clipPath: gn(p.armed, v.current.getBoundingClientRect()) },
|
|
3105
3119
|
onPointerOver: p.disarm
|
|
3106
3120
|
}) : null,
|
|
3107
|
-
/* @__PURE__ */
|
|
3121
|
+
/* @__PURE__ */ L("div", {
|
|
3108
3122
|
className: "video",
|
|
3109
3123
|
onClick: (e) => {
|
|
3110
3124
|
if (h.current === "mouse") {
|
|
@@ -3117,7 +3131,7 @@ ${jt}
|
|
|
3117
3131
|
onDoubleClick: () => {
|
|
3118
3132
|
h.current === "mouse" && (k.current ? l.pause() : l.play().catch(() => {}), o ? o.request() : l.toggleFullscreen());
|
|
3119
3133
|
},
|
|
3120
|
-
children: [t ? /* @__PURE__ */
|
|
3134
|
+
children: [t ? /* @__PURE__ */ I("video", {
|
|
3121
3135
|
ref: t,
|
|
3122
3136
|
playsInline: !0
|
|
3123
3137
|
}) : null, c]
|
|
@@ -3125,130 +3139,130 @@ ${jt}
|
|
|
3125
3139
|
]
|
|
3126
3140
|
});
|
|
3127
3141
|
}, 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 }) => {
|
|
3128
|
-
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:
|
|
3129
|
-
|
|
3130
|
-
let { expose:
|
|
3142
|
+
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: f, thumbnailRead: p, thumbnailsEnabled: m, readsDownload: h } = r ?? {}, g = j(), _ = A(), [v, y] = T(null), [b, x] = T(null), E = n?.media ?? v;
|
|
3143
|
+
S(() => (g?.(E), () => g?.(null)), [E, g]), Pe(E, n?.stepFrame);
|
|
3144
|
+
let { expose: D } = e, [O, k] = T(null), [M, N] = T(!0), [P] = T(() => Object.assign(new EventTarget(), {
|
|
3131
3145
|
chapters: [],
|
|
3132
3146
|
endingOffered: !0,
|
|
3133
|
-
onHostFullscreen:
|
|
3134
|
-
onEndingOffered:
|
|
3135
|
-
})),
|
|
3136
|
-
|
|
3137
|
-
let
|
|
3138
|
-
|
|
3139
|
-
if (!
|
|
3147
|
+
onHostFullscreen: k,
|
|
3148
|
+
onEndingOffered: N
|
|
3149
|
+
})), F = D === !0 ? {} : D || void 0, L = w(F);
|
|
3150
|
+
L.current = F;
|
|
3151
|
+
let R = F ? F.id : void 0, z = F ? F.origin : void 0, B = F ? F.channel : void 0;
|
|
3152
|
+
S(() => {
|
|
3153
|
+
if (!D || !E) return;
|
|
3140
3154
|
let e, t = !1;
|
|
3141
3155
|
return import("./remote/index.js").then(({ exposePlayer: n }) => {
|
|
3142
|
-
t || (e = n(
|
|
3143
|
-
...
|
|
3144
|
-
player:
|
|
3156
|
+
t || (e = n(E, {
|
|
3157
|
+
...L.current,
|
|
3158
|
+
player: P
|
|
3145
3159
|
}));
|
|
3146
3160
|
}).catch(() => {}), () => {
|
|
3147
3161
|
t = !0, e?.();
|
|
3148
3162
|
};
|
|
3149
3163
|
}, [
|
|
3150
|
-
|
|
3151
|
-
!!
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3164
|
+
E,
|
|
3165
|
+
!!D,
|
|
3166
|
+
R,
|
|
3167
|
+
z,
|
|
3168
|
+
B
|
|
3155
3169
|
]);
|
|
3156
|
-
let
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
}, [
|
|
3160
|
-
let
|
|
3161
|
-
active:
|
|
3162
|
-
request: () =>
|
|
3163
|
-
}),
|
|
3164
|
-
Ae(
|
|
3165
|
-
let
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
}, [
|
|
3169
|
-
let
|
|
3170
|
-
|
|
3171
|
-
let
|
|
3172
|
-
|
|
3173
|
-
let
|
|
3174
|
-
tap:
|
|
3175
|
-
audioStreamIndex:
|
|
3170
|
+
let V = Y((e) => e.chapters), ee = JSON.stringify(V);
|
|
3171
|
+
S(() => {
|
|
3172
|
+
P.chapters = V, P.endingOffered = M, P.dispatchEvent(new Event("chapterschange"));
|
|
3173
|
+
}, [ee, M]);
|
|
3174
|
+
let te = e.fullscreen ?? (O === null ? void 0 : {
|
|
3175
|
+
active: O,
|
|
3176
|
+
request: () => P.dispatchEvent(new Event("fullscreenrequest"))
|
|
3177
|
+
}), H = C(() => tt(), [o]);
|
|
3178
|
+
Ae(v, b, r, h ? H.push : void 0);
|
|
3179
|
+
let ne = r?.normalizeVolume ?? !0, [U, re] = T(ne);
|
|
3180
|
+
S(() => {
|
|
3181
|
+
re(ne);
|
|
3182
|
+
}, [ne]);
|
|
3183
|
+
let W = w(r?.onNormalizeVolumeChange);
|
|
3184
|
+
W.current = r?.onNormalizeVolumeChange;
|
|
3185
|
+
let G = r?.normalizerWorkletUrl, K = w(p ?? f);
|
|
3186
|
+
K.current = p ?? f;
|
|
3187
|
+
let q = Y((e) => e.selectedAudioTrack), ie = !!f, { refused: J } = et(v, G, U, C(() => ie && o && c && l && typeof q == "number" && q >= 0 ? h ? {
|
|
3188
|
+
tap: H,
|
|
3189
|
+
audioStreamIndex: q
|
|
3176
3190
|
} : {
|
|
3177
|
-
read: (e, t) =>
|
|
3191
|
+
read: (e, t) => K.current(e, t),
|
|
3178
3192
|
length: o,
|
|
3179
3193
|
publicPath: c,
|
|
3180
3194
|
libavWorkerUrl: l,
|
|
3181
|
-
audioStreamIndex:
|
|
3195
|
+
audioStreamIndex: q
|
|
3182
3196
|
} : void 0, [
|
|
3183
|
-
|
|
3197
|
+
ie,
|
|
3184
3198
|
o,
|
|
3185
3199
|
c,
|
|
3186
3200
|
l,
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
]),
|
|
3201
|
+
q,
|
|
3202
|
+
h,
|
|
3203
|
+
H
|
|
3204
|
+
]), C(() => s?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [s?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")])), ae = C(() => G && typeof AudioWorkletNode == "function" ? {
|
|
3191
3205
|
enabled: U,
|
|
3192
|
-
available: !
|
|
3206
|
+
available: !J,
|
|
3193
3207
|
setEnabled: (e) => {
|
|
3194
|
-
|
|
3208
|
+
re(e), W.current?.(e);
|
|
3195
3209
|
}
|
|
3196
3210
|
} : null, [
|
|
3197
|
-
|
|
3211
|
+
G,
|
|
3198
3212
|
U,
|
|
3199
|
-
|
|
3200
|
-
]), { thumbnails:
|
|
3213
|
+
J
|
|
3214
|
+
]), { thumbnails: oe, requestThumbnail: se } = Le({
|
|
3201
3215
|
publicPath: c,
|
|
3202
3216
|
workerUrl: l,
|
|
3203
|
-
length:
|
|
3204
|
-
read:
|
|
3217
|
+
length: m === !1 ? void 0 : o,
|
|
3218
|
+
read: p ?? f,
|
|
3205
3219
|
downloadedRanges: s
|
|
3206
|
-
}),
|
|
3207
|
-
|
|
3220
|
+
}), ce = n?.thumbnails?.all ?? oe, { toggle: le, mode: ue, burnedIn: de } = Re(v, b), fe = We(n?.media ?? null, n?.pictureInPicture), X = Y((e) => e.setSourceState), pe = n ? !!n.media : o !== void 0;
|
|
3221
|
+
S(() => {
|
|
3208
3222
|
X({
|
|
3209
3223
|
title: i,
|
|
3210
3224
|
size: o,
|
|
3211
3225
|
downloadedRanges: s,
|
|
3212
|
-
hasMedia:
|
|
3226
|
+
hasMedia: pe
|
|
3213
3227
|
});
|
|
3214
3228
|
}, [
|
|
3215
3229
|
X,
|
|
3216
3230
|
i,
|
|
3217
3231
|
o,
|
|
3218
3232
|
s,
|
|
3219
|
-
|
|
3233
|
+
pe
|
|
3220
3234
|
]);
|
|
3221
|
-
let
|
|
3222
|
-
|
|
3235
|
+
let me = n?.thumbnails?.at;
|
|
3236
|
+
S(() => {
|
|
3223
3237
|
X({
|
|
3224
|
-
thumbnails:
|
|
3225
|
-
thumbnailAt:
|
|
3226
|
-
requestThumbnail:
|
|
3227
|
-
togglePictureInPicture:
|
|
3228
|
-
pictureInPictureMode:
|
|
3229
|
-
burnedInSubtitles:
|
|
3238
|
+
thumbnails: ce,
|
|
3239
|
+
thumbnailAt: me,
|
|
3240
|
+
requestThumbnail: se,
|
|
3241
|
+
togglePictureInPicture: le,
|
|
3242
|
+
pictureInPictureMode: ue,
|
|
3243
|
+
burnedInSubtitles: de
|
|
3230
3244
|
});
|
|
3231
3245
|
}, [
|
|
3232
3246
|
X,
|
|
3233
|
-
se,
|
|
3234
|
-
pe,
|
|
3235
|
-
oe,
|
|
3236
3247
|
ce,
|
|
3248
|
+
me,
|
|
3249
|
+
se,
|
|
3237
3250
|
le,
|
|
3238
|
-
ue
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3251
|
+
ue,
|
|
3252
|
+
de
|
|
3253
|
+
]), S(() => {
|
|
3254
|
+
X({ volumeNormalizer: ae });
|
|
3255
|
+
}, [X, ae]), S(() => {
|
|
3256
|
+
X({ passThroughPictureInPicture: fe });
|
|
3257
|
+
}, [X, fe]);
|
|
3258
|
+
let Z = n?.subtitles?.selection, he = n?.audioTracks?.selection, ge = w({
|
|
3259
|
+
options: e,
|
|
3260
|
+
audio: he
|
|
3247
3261
|
});
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
},
|
|
3262
|
+
ge.current = {
|
|
3263
|
+
options: e,
|
|
3264
|
+
audio: he
|
|
3265
|
+
}, S(() => {
|
|
3252
3266
|
Z && X({
|
|
3253
3267
|
subtitleTracks: Z.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3254
3268
|
id: e,
|
|
@@ -3259,43 +3273,45 @@ ${jt}
|
|
|
3259
3273
|
selectSubtitleTrack: (e) => {
|
|
3260
3274
|
let t = e == null ? null : String(e), n = t === null ? void 0 : bn(Z, t), r = Z.selectedId === null;
|
|
3261
3275
|
return xn(Z.select(t), () => {
|
|
3262
|
-
let e = t === null ? null : u(n) ?? (r ? n?.title : void 0);
|
|
3263
|
-
e !== void 0 &&
|
|
3276
|
+
let e = t === null ? null : u(n) ?? (r ? n?.title : void 0), i = ge.current;
|
|
3277
|
+
e !== void 0 && i.options.onPreferredSubtitleLanguageChange?.(e);
|
|
3278
|
+
let a = i.audio && bn(i.audio, i.audio.selectedId ?? "");
|
|
3279
|
+
e && d(a, e) && i.options.onAlwaysShowSubtitlesChange?.(!0);
|
|
3264
3280
|
});
|
|
3265
3281
|
},
|
|
3266
3282
|
subtitleOffLabel: Z.offLabel
|
|
3267
3283
|
});
|
|
3268
|
-
}, [X, Z]),
|
|
3269
|
-
|
|
3270
|
-
audioTracks:
|
|
3284
|
+
}, [X, Z]), S(() => {
|
|
3285
|
+
he && X({
|
|
3286
|
+
audioTracks: he.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3271
3287
|
id: e,
|
|
3272
3288
|
label: t,
|
|
3273
3289
|
disabled: n
|
|
3274
3290
|
})),
|
|
3275
|
-
selectedAudioTrack:
|
|
3276
|
-
selectAudioTrack: (e) => xn(
|
|
3277
|
-
let t = u(bn(
|
|
3278
|
-
t !== void 0 &&
|
|
3291
|
+
selectedAudioTrack: he.selectedId ?? void 0,
|
|
3292
|
+
selectAudioTrack: (e) => xn(he.select(String(e)), () => {
|
|
3293
|
+
let t = u(bn(he, String(e)));
|
|
3294
|
+
t !== void 0 && ge.current.options.onPreferredAudioLanguageChange?.(t);
|
|
3279
3295
|
})
|
|
3280
3296
|
});
|
|
3281
|
-
}, [X,
|
|
3282
|
-
let
|
|
3283
|
-
return
|
|
3284
|
-
X({ quality:
|
|
3285
|
-
}, [X,
|
|
3297
|
+
}, [X, he]);
|
|
3298
|
+
let _e = n?.quality?.selection ?? null;
|
|
3299
|
+
return S(() => {
|
|
3300
|
+
X({ quality: _e });
|
|
3301
|
+
}, [X, _e]), S(() => {
|
|
3286
3302
|
a && X({ chapters: a });
|
|
3287
|
-
}, [X, a]), /* @__PURE__ */
|
|
3288
|
-
ref:
|
|
3289
|
-
onVideoRef: n ? void 0 :
|
|
3290
|
-
onSubtitleRef:
|
|
3303
|
+
}, [X, a]), /* @__PURE__ */ I(yn, {
|
|
3304
|
+
ref: _,
|
|
3305
|
+
onVideoRef: n ? void 0 : y,
|
|
3306
|
+
onSubtitleRef: x,
|
|
3291
3307
|
overlay: e.overlay,
|
|
3292
3308
|
controls: e.controls,
|
|
3293
3309
|
shortcuts: e.shortcuts,
|
|
3294
|
-
fullscreen:
|
|
3295
|
-
endingOffered:
|
|
3310
|
+
fullscreen: te,
|
|
3311
|
+
endingOffered: M,
|
|
3296
3312
|
children: t
|
|
3297
3313
|
});
|
|
3298
|
-
}, Cn =
|
|
3314
|
+
}, Cn = D`
|
|
3299
3315
|
/**
|
|
3300
3316
|
* The chrome's whole scale, in one place.
|
|
3301
3317
|
*
|
|
@@ -3365,11 +3381,11 @@ ${jt}
|
|
|
3365
3381
|
height: 100%;
|
|
3366
3382
|
width: 100%;
|
|
3367
3383
|
overflow: hidden;
|
|
3368
|
-
`, wn = (e) => /* @__PURE__ */
|
|
3384
|
+
`, wn = (e) => /* @__PURE__ */ I("div", {
|
|
3369
3385
|
css: Cn,
|
|
3370
|
-
children: /* @__PURE__ */
|
|
3386
|
+
children: /* @__PURE__ */ I(le.Provider, { children: /* @__PURE__ */ I(ye, {
|
|
3371
3387
|
language: e.language,
|
|
3372
|
-
children: /* @__PURE__ */
|
|
3388
|
+
children: /* @__PURE__ */ I(Sn, {
|
|
3373
3389
|
options: e,
|
|
3374
3390
|
children: e.children
|
|
3375
3391
|
})
|
|
@@ -3416,4 +3432,4 @@ ${jt}
|
|
|
3416
3432
|
throw Error(`Unknown source type: ${e}`);
|
|
3417
3433
|
};
|
|
3418
3434
|
//#endregion
|
|
3419
|
-
export { wn as MediaPlayer, wn as default,
|
|
3435
|
+
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, Y as usePlayer, Le as useSeekThumbnails };
|