@banou/media-player 0.10.40 → 0.10.41
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 +13 -0
- package/dist/{ar-CS4Yzfxw.js → ar-CWVutin3.js} +1 -0
- package/dist/{cs-CxBZ1aTx.js → cs-CmwRGxyE.js} +1 -0
- package/dist/{de-DphEdq0O.js → de-DLdKEf3t.js} +1 -0
- package/dist/{el-BVTNfAWK.js → el-Ckj-z6DX.js} +1 -0
- package/dist/engine/index.js +1 -1
- package/dist/{engine-DFqSQyNb.js → engine-wP5Udzzj.js} +1 -0
- package/dist/{es-419-D6gsvnn8.js → es-419-zORhhU8D.js} +1 -0
- package/dist/{fr-BqAzAJX0.js → fr-BtPmNkri.js} +1 -0
- package/dist/{he-DbFw1CdO.js → he-Bu79qEth.js} +1 -0
- package/dist/{hi-rBroV7g8.js → hi-BsH3tSHa.js} +1 -0
- package/dist/{hu-m-QKaaxF.js → hu-BkYBW-YP.js} +1 -0
- package/dist/{id-BYpApdK9.js → id-nUaBCV4o.js} +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +263 -236
- package/dist/{it-NTcUh3Gr.js → it-CqPSHyFA.js} +1 -0
- package/dist/{ja-DSmX_bxj.js → ja-DTjvriHw.js} +1 -0
- package/dist/{ko-DyPzWasj.js → ko-dV8T7XOJ.js} +1 -0
- package/dist/labels.d.ts +1 -0
- package/dist/{ms-8pQbqM0D.js → ms-VZQ7BI0z.js} +1 -0
- package/dist/{nl-q7xvc3xW.js → nl-Q6iDxbDz.js} +1 -0
- package/dist/{pl-C6Ow4ra5.js → pl-BN7bK74l.js} +1 -0
- package/dist/{pt-BR-wudK3giz.js → pt-BR-CPFILeFW.js} +1 -0
- package/dist/react/player.d.ts +1 -0
- package/dist/react/source-feature.d.ts +9 -0
- package/dist/react/video-player.d.ts +9 -0
- package/dist/remote/index.d.ts +18 -0
- package/dist/remote/index.js +51 -34
- package/dist/remote/protocol.d.ts +11 -6
- package/dist/{ro-DBrd08Df.js → ro-Bwcm-i3k.js} +1 -0
- package/dist/{ru-D5kxBkik.js → ru-D1FMz751.js} +1 -0
- package/dist/{sv-DJC3tXfW.js → sv-ci9K0Lkk.js} +1 -0
- package/dist/{th-BNzU_FYo.js → th-DR-UBONQ.js} +1 -0
- package/dist/{tr-CW7R7N9k.js → tr-BqhdfT22.js} +1 -0
- package/dist/{uk-C66esN2W.js → uk-8pkZqdni.js} +1 -0
- package/dist/{vi-oOaDECwu.js → vi-3mKZ9G_M.js} +1 -0
- package/dist/{zh-Hans-IhL1Pl78.js → zh-Hans-CDgigWKY.js} +1 -0
- package/dist/{zh-Hant-C5YyFjEc.js → zh-Hant-3WSNI0ne.js} +1 -0
- package/package.json +1 -1
- package/src/lib/index.tsx +2 -1
- package/src/lib/labels.ts +1 -0
- package/src/lib/locales/ar.json +1 -0
- package/src/lib/locales/cs.json +1 -0
- package/src/lib/locales/de.json +1 -0
- package/src/lib/locales/el.json +1 -0
- package/src/lib/locales/es-419.json +1 -0
- package/src/lib/locales/fr.json +1 -0
- package/src/lib/locales/he.json +1 -0
- package/src/lib/locales/hi.json +1 -0
- package/src/lib/locales/hu.json +1 -0
- package/src/lib/locales/id.json +1 -0
- package/src/lib/locales/it.json +1 -0
- package/src/lib/locales/ja.json +1 -0
- package/src/lib/locales/ko.json +1 -0
- package/src/lib/locales/ms.json +1 -0
- package/src/lib/locales/nl.json +1 -0
- package/src/lib/locales/pl.json +1 -0
- package/src/lib/locales/pt-BR.json +1 -0
- package/src/lib/locales/ro.json +1 -0
- package/src/lib/locales/ru.json +1 -0
- package/src/lib/locales/sv.json +1 -0
- package/src/lib/locales/th.json +1 -0
- package/src/lib/locales/tr.json +1 -0
- package/src/lib/locales/uk.json +1 -0
- package/src/lib/locales/vi.json +1 -0
- package/src/lib/locales/zh-Hans.json +1 -0
- package/src/lib/locales/zh-Hant.json +1 -0
- package/src/lib/react/components/settings.tsx +19 -0
- package/src/lib/react/source-feature.ts +10 -0
- package/src/lib/react/video-player.tsx +40 -1
- package/src/lib/remote/index.ts +48 -3
- package/src/lib/remote/protocol.ts +18 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-wP5Udzzj.js";
|
|
2
2
|
import { languageOf as u, playsIn as d, startingTracks as f } from "./language/index.js";
|
|
3
3
|
import { n as p, r as m, t as h } from "./chapters-EBYXcEml.js";
|
|
4
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";
|
|
@@ -8,10 +8,10 @@ import { definePlayerFeature as M, videoFeatures as N } from "@videojs/core/dom"
|
|
|
8
8
|
import { makeRemuxer as P } from "libav-wasm";
|
|
9
9
|
import { Fragment as F, jsx as I, jsxs as L } from "@emotion/react/jsx-runtime";
|
|
10
10
|
import { createMediaElementSource as R } from "@banou/ponyfill/web-audio";
|
|
11
|
-
import { Captions as z, CaptionsOff as B, Check as V, ChevronLeft as H, ChevronRight as ee, Copy as U, Maximize as
|
|
12
|
-
import { Tooltip as
|
|
11
|
+
import { Captions as z, CaptionsOff as B, Check as V, ChevronLeft as H, ChevronRight as ee, Copy as U, Maximize as te, Minimize as ne, Pause as re, Play as W, RotateCcw as G, Settings as K, TriangleAlert as ie, Volume1 as q, 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: [],
|
|
@@ -32,13 +32,14 @@ var oe = {
|
|
|
32
32
|
pictureInPictureMode: null,
|
|
33
33
|
burnedInSubtitles: !1,
|
|
34
34
|
volumeNormalizer: null,
|
|
35
|
+
autoplayNext: null,
|
|
35
36
|
playbackError: null,
|
|
36
37
|
playbackErrors: [],
|
|
37
38
|
ready: !1,
|
|
38
39
|
setSourceState: () => {}
|
|
39
|
-
},
|
|
40
|
+
}, Y = M({
|
|
40
41
|
name: "source",
|
|
41
|
-
state: () => ({ ...
|
|
42
|
+
state: () => ({ ...se }),
|
|
42
43
|
attach({ set: e }) {
|
|
43
44
|
e({
|
|
44
45
|
setSourceState: (t) => e(t),
|
|
@@ -46,35 +47,35 @@ var oe = {
|
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
}), ce = k({
|
|
49
|
-
features: [...N,
|
|
50
|
+
features: [...N, Y],
|
|
50
51
|
displayName: "MediaPlayer"
|
|
51
52
|
}), X = ce.usePlayer, le = {
|
|
52
|
-
ar: () => import("./ar-
|
|
53
|
-
cs: () => import("./cs-
|
|
54
|
-
de: () => import("./de-
|
|
55
|
-
el: () => import("./el-
|
|
56
|
-
"es-419": () => import("./es-419-
|
|
57
|
-
fr: () => import("./fr-
|
|
58
|
-
he: () => import("./he-
|
|
59
|
-
hi: () => import("./hi-
|
|
60
|
-
hu: () => import("./hu-
|
|
61
|
-
id: () => import("./id-
|
|
62
|
-
it: () => import("./it-
|
|
63
|
-
ja: () => import("./ja-
|
|
64
|
-
ko: () => import("./ko-
|
|
65
|
-
ms: () => import("./ms-
|
|
66
|
-
nl: () => import("./nl-
|
|
67
|
-
pl: () => import("./pl-
|
|
68
|
-
"pt-BR": () => import("./pt-BR-
|
|
69
|
-
ro: () => import("./ro-
|
|
70
|
-
ru: () => import("./ru-
|
|
71
|
-
sv: () => import("./sv-
|
|
72
|
-
th: () => import("./th-
|
|
73
|
-
tr: () => import("./tr-
|
|
74
|
-
uk: () => import("./uk-
|
|
75
|
-
vi: () => import("./vi-
|
|
76
|
-
"zh-Hans": () => import("./zh-Hans-
|
|
77
|
-
"zh-Hant": () => import("./zh-Hant-
|
|
53
|
+
ar: () => import("./ar-CWVutin3.js"),
|
|
54
|
+
cs: () => import("./cs-CmwRGxyE.js"),
|
|
55
|
+
de: () => import("./de-DLdKEf3t.js"),
|
|
56
|
+
el: () => import("./el-Ckj-z6DX.js"),
|
|
57
|
+
"es-419": () => import("./es-419-zORhhU8D.js"),
|
|
58
|
+
fr: () => import("./fr-BtPmNkri.js"),
|
|
59
|
+
he: () => import("./he-Bu79qEth.js"),
|
|
60
|
+
hi: () => import("./hi-BsH3tSHa.js"),
|
|
61
|
+
hu: () => import("./hu-BkYBW-YP.js"),
|
|
62
|
+
id: () => import("./id-nUaBCV4o.js"),
|
|
63
|
+
it: () => import("./it-CqPSHyFA.js"),
|
|
64
|
+
ja: () => import("./ja-DTjvriHw.js"),
|
|
65
|
+
ko: () => import("./ko-dV8T7XOJ.js"),
|
|
66
|
+
ms: () => import("./ms-VZQ7BI0z.js"),
|
|
67
|
+
nl: () => import("./nl-Q6iDxbDz.js"),
|
|
68
|
+
pl: () => import("./pl-BN7bK74l.js"),
|
|
69
|
+
"pt-BR": () => import("./pt-BR-CPFILeFW.js"),
|
|
70
|
+
ro: () => import("./ro-Bwcm-i3k.js"),
|
|
71
|
+
ru: () => import("./ru-D1FMz751.js"),
|
|
72
|
+
sv: () => import("./sv-ci9K0Lkk.js"),
|
|
73
|
+
th: () => import("./th-DR-UBONQ.js"),
|
|
74
|
+
tr: () => import("./tr-BqhdfT22.js"),
|
|
75
|
+
uk: () => import("./uk-8pkZqdni.js"),
|
|
76
|
+
vi: () => import("./vi-3mKZ9G_M.js"),
|
|
77
|
+
"zh-Hans": () => import("./zh-Hans-CDgigWKY.js"),
|
|
78
|
+
"zh-Hant": () => import("./zh-Hant-3WSNI0ne.js")
|
|
78
79
|
}, ue = Object.keys(le), de = (e) => {
|
|
79
80
|
try {
|
|
80
81
|
let t = new Intl.Locale(e), { language: n, script: r } = t.maximize();
|
|
@@ -86,7 +87,7 @@ var oe = {
|
|
|
86
87
|
} catch {
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
|
-
},
|
|
90
|
+
}, fe = (e) => {
|
|
90
91
|
let t = de(e);
|
|
91
92
|
if (!t) return;
|
|
92
93
|
let n = ue.map((e) => ({
|
|
@@ -94,24 +95,24 @@ var oe = {
|
|
|
94
95
|
catalogue: e
|
|
95
96
|
}));
|
|
96
97
|
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;
|
|
97
|
-
},
|
|
98
|
-
let n =
|
|
98
|
+
}, pe = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map(), he = (e, t) => {
|
|
99
|
+
let n = me.get(e);
|
|
99
100
|
return n || (n = Promise.all([import("@formatjs/intl"), le[t]()]).then(([{ createIntl: t }, { default: n }]) => {
|
|
100
101
|
let r = t({
|
|
101
102
|
locale: e,
|
|
102
103
|
defaultLocale: "en",
|
|
103
104
|
messages: n
|
|
104
105
|
});
|
|
105
|
-
return
|
|
106
|
-
}), n.catch(() =>
|
|
107
|
-
},
|
|
106
|
+
return pe.set(e, r), r;
|
|
107
|
+
}), n.catch(() => me.delete(e)), me.set(e, n)), n;
|
|
108
|
+
}, ge = (e) => {
|
|
108
109
|
try {
|
|
109
110
|
return Intl.getCanonicalLocales(e)[0];
|
|
110
111
|
} catch {
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
},
|
|
114
|
-
let r = t ?
|
|
114
|
+
}, _e = (e, t) => {
|
|
115
|
+
let r = t ? ge(t) ?? "en" : void 0;
|
|
115
116
|
return {
|
|
116
117
|
format: (t, ...[r]) => e ? e.formatMessage({
|
|
117
118
|
id: t,
|
|
@@ -120,18 +121,18 @@ var oe = {
|
|
|
120
121
|
number: (e, t) => new Intl.NumberFormat(r ?? "en", t).format(e),
|
|
121
122
|
locale: r
|
|
122
123
|
};
|
|
123
|
-
},
|
|
124
|
-
let n = e ?
|
|
124
|
+
}, Z = _e(void 0, void 0), ve = v(Z), Q = () => x(ve), ye = ({ language: e, children: t }) => {
|
|
125
|
+
let n = e ? fe(e) : void 0, [, r] = T();
|
|
125
126
|
S(() => {
|
|
126
|
-
if (!e || !n ||
|
|
127
|
+
if (!e || !n || pe.has(e)) return;
|
|
127
128
|
let t = !1;
|
|
128
|
-
return
|
|
129
|
+
return he(e, n).then((e) => {
|
|
129
130
|
t || r(e);
|
|
130
131
|
}, () => {}), () => {
|
|
131
132
|
t = !0;
|
|
132
133
|
};
|
|
133
134
|
}, [e, n]);
|
|
134
|
-
let i = e && n ?
|
|
135
|
+
let i = e && n ? pe.get(e) : void 0, a = C(() => e ? _e(i, e) : Z, [i, e]);
|
|
135
136
|
return /* @__PURE__ */ I(ve.Provider, {
|
|
136
137
|
value: a,
|
|
137
138
|
children: t
|
|
@@ -201,31 +202,31 @@ var oe = {
|
|
|
201
202
|
original: n?.originalLanguage,
|
|
202
203
|
subtitles: n?.preferredSubtitleLanguage,
|
|
203
204
|
alwaysSubtitles: n?.alwaysShowSubtitles
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
let
|
|
207
|
-
|
|
208
|
-
let
|
|
209
|
-
|
|
210
|
-
let
|
|
211
|
-
|
|
212
|
-
let
|
|
213
|
-
|
|
214
|
-
let
|
|
215
|
-
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
|
|
205
|
+
}, te = w(U);
|
|
206
|
+
te.current = U;
|
|
207
|
+
let ne = w(n?.onPreferredAudioLanguageChange);
|
|
208
|
+
ne.current = n?.onPreferredAudioLanguageChange;
|
|
209
|
+
let re = w(n?.onPreferredSubtitleLanguageChange);
|
|
210
|
+
re.current = n?.onPreferredSubtitleLanguageChange;
|
|
211
|
+
let W = w(n?.onAlwaysShowSubtitlesChange);
|
|
212
|
+
W.current = n?.onAlwaysShowSubtitlesChange;
|
|
213
|
+
let G = w(n?.onSeek);
|
|
214
|
+
G.current = n?.onSeek;
|
|
215
|
+
let K = w(n?.onPlaybackError);
|
|
216
|
+
K.current = n?.onPlaybackError;
|
|
217
|
+
let ie = w(r);
|
|
218
|
+
ie.current = r;
|
|
219
|
+
let q = Q(), J = w(q);
|
|
220
|
+
J.current = q, S(() => {
|
|
220
221
|
let { audio: e, subtitles: t } = V.current;
|
|
221
|
-
t.length && a.setSourceState({ subtitleTracks: Ce(t,
|
|
222
|
-
}, [a,
|
|
223
|
-
let
|
|
222
|
+
t.length && a.setSourceState({ subtitleTracks: Ce(t, q) }), e.length && a.setSourceState({ audioTracks: Ce(e, q) });
|
|
223
|
+
}, [a, q]);
|
|
224
|
+
let ae = b((e) => {
|
|
224
225
|
let t = typeof e == "number" ? e : void 0, n = a.selectedSubtitleTrack === void 0;
|
|
225
226
|
z.current = B.current, a.setSourceState({ selectedSubtitleTrack: t }), L.current?.selectSubtitleStream(t);
|
|
226
227
|
let r = V.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 &&
|
|
228
|
-
}, [a, H]),
|
|
228
|
+
i !== void 0 && re.current?.(i), i && d(H(), i) && W.current?.(!0);
|
|
229
|
+
}, [a, H]), oe = b((e) => {
|
|
229
230
|
let t = L.current;
|
|
230
231
|
if (!t || O <= 0) {
|
|
231
232
|
a.seek(e);
|
|
@@ -249,26 +250,26 @@ var oe = {
|
|
|
249
250
|
t.prepareSeek(e).catch(() => {}).finally(() => {
|
|
250
251
|
clearTimeout(d), s();
|
|
251
252
|
});
|
|
252
|
-
}, [a, O]),
|
|
253
|
+
}, [a, O]), se = b((e) => {
|
|
253
254
|
if (typeof e != "number" || B.current === void 0) return;
|
|
254
255
|
a.setSourceState({ selectedAudioTrack: e }), j({
|
|
255
256
|
size: B.current,
|
|
256
257
|
streamIndex: e
|
|
257
258
|
});
|
|
258
259
|
let t = u(V.current.audio.find((t) => t.streamIndex === e));
|
|
259
|
-
t !== void 0 &&
|
|
260
|
-
}, [a]),
|
|
260
|
+
t !== void 0 && ne.current?.(t);
|
|
261
|
+
}, [a]), Y = X((e) => e.setSourceState);
|
|
261
262
|
S(() => {
|
|
262
|
-
|
|
263
|
-
selectSubtitleTrack:
|
|
264
|
-
selectAudioTrack:
|
|
265
|
-
requestSeek:
|
|
263
|
+
Y({
|
|
264
|
+
selectSubtitleTrack: ae,
|
|
265
|
+
selectAudioTrack: se,
|
|
266
|
+
requestSeek: oe
|
|
266
267
|
});
|
|
267
268
|
}, [
|
|
269
|
+
Y,
|
|
270
|
+
ae,
|
|
268
271
|
se,
|
|
269
|
-
|
|
270
|
-
oe,
|
|
271
|
-
ae
|
|
272
|
+
oe
|
|
272
273
|
]), S(() => {
|
|
273
274
|
if (!e || !t || !c || !o) return;
|
|
274
275
|
let n = !1;
|
|
@@ -313,7 +314,7 @@ var oe = {
|
|
|
313
314
|
}, console.warn(`the media element failed; rebuilding the pipeline${n ? ` in ${n}ms` : ""}`, e), I.current && clearTimeout(I.current), I.current = setTimeout(() => P((e) => e + 1), n);
|
|
314
315
|
return;
|
|
315
316
|
}
|
|
316
|
-
console.error("playback failed", e), a.setSourceState({ playbackError: e }),
|
|
317
|
+
console.error("playback failed", e), a.setSourceState({ playbackError: e }), K.current?.(e);
|
|
317
318
|
};
|
|
318
319
|
return (async () => {
|
|
319
320
|
try {
|
|
@@ -333,7 +334,7 @@ var oe = {
|
|
|
333
334
|
cjkFontUrl: x,
|
|
334
335
|
bufferSize: C,
|
|
335
336
|
audioStreamIndex: M,
|
|
336
|
-
chooseAudioStream: (e) => e[f(e, [],
|
|
337
|
+
chooseAudioStream: (e) => e[f(e, [], te.current).audio]?.streamIndex,
|
|
337
338
|
onReady: () => {
|
|
338
339
|
if (n) return;
|
|
339
340
|
a.setSourceState({ ready: !0 });
|
|
@@ -344,20 +345,20 @@ var oe = {
|
|
|
344
345
|
onRecovered: () => {
|
|
345
346
|
n || a.setSourceState({ playbackError: null });
|
|
346
347
|
},
|
|
347
|
-
onSeek: (e) =>
|
|
348
|
-
onOutput: (e) =>
|
|
348
|
+
onSeek: (e) => G.current?.(e),
|
|
349
|
+
onOutput: (e) => ie.current?.(e),
|
|
349
350
|
onSubtitleStreams: (e) => {
|
|
350
351
|
if (n) return;
|
|
351
352
|
V.current.subtitles = e;
|
|
352
|
-
let t = H(), r = f(t ? [t] : [], e,
|
|
353
|
+
let t = H(), r = f(t ? [t] : [], e, te.current).subtitles;
|
|
353
354
|
a.setSourceState({
|
|
354
|
-
subtitleTracks: Ce(e,
|
|
355
|
+
subtitleTracks: Ce(e, J.current),
|
|
355
356
|
...z.current === c ? {} : { selectedSubtitleTrack: r === null ? void 0 : e[Math.max(r, 0)]?.streamIndex }
|
|
356
357
|
});
|
|
357
358
|
},
|
|
358
359
|
onAudioStreams: (e, t) => {
|
|
359
360
|
n || (V.current.audio = e, a.setSourceState({
|
|
360
|
-
audioTracks: Ce(e,
|
|
361
|
+
audioTracks: Ce(e, J.current),
|
|
361
362
|
selectedAudioTrack: t
|
|
362
363
|
}));
|
|
363
364
|
}
|
|
@@ -690,7 +691,7 @@ var oe = {
|
|
|
690
691
|
}, g = 0, _ = /* @__PURE__ */ new Map(), v = (e, t) => new Promise((n) => _.set(`${e}:${t}`, n)), y = -1;
|
|
691
692
|
p.onmessage = ({ data: e }) => {
|
|
692
693
|
if (e.type === "unsupported") {
|
|
693
|
-
|
|
694
|
+
ne();
|
|
694
695
|
return;
|
|
695
696
|
}
|
|
696
697
|
e.spans && ((JSON.stringify(e.spans) !== JSON.stringify(h.spans) || e.end !== h.end) && g++, h = {
|
|
@@ -808,7 +809,7 @@ var oe = {
|
|
|
808
809
|
}
|
|
809
810
|
e(B), B = void 0;
|
|
810
811
|
}
|
|
811
|
-
}, U = () => {},
|
|
812
|
+
}, U = () => {}, te = (e, t) => {
|
|
812
813
|
let n = !1, r = (e) => {
|
|
813
814
|
n && p.postMessage({
|
|
814
815
|
type: "end",
|
|
@@ -843,7 +844,7 @@ var oe = {
|
|
|
843
844
|
}, [t]);
|
|
844
845
|
}
|
|
845
846
|
});
|
|
846
|
-
},
|
|
847
|
+
}, ne = () => {
|
|
847
848
|
if (!a) {
|
|
848
849
|
a = !0, f(!0), l(), clearInterval(C);
|
|
849
850
|
for (let e of w) n.removeEventListener(e, x);
|
|
@@ -852,13 +853,13 @@ var oe = {
|
|
|
852
853
|
_.clear();
|
|
853
854
|
}
|
|
854
855
|
};
|
|
855
|
-
return "tap" in i ?
|
|
856
|
-
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e),
|
|
856
|
+
return "tap" in i ? te(i.tap, i.audioStreamIndex) : ee(i).catch((e) => {
|
|
857
|
+
a || (console.warn("[media-player] the volume normalizer cannot analyse ahead:", e), ne());
|
|
857
858
|
}), S(), {
|
|
858
859
|
update: (e) => {
|
|
859
860
|
o = e, f(!1);
|
|
860
861
|
},
|
|
861
|
-
stop:
|
|
862
|
+
stop: ne
|
|
862
863
|
};
|
|
863
864
|
}, et = (e, t, n, r, i) => {
|
|
864
865
|
let a = w(null), [o, s] = T(!1), [c, l] = T(null);
|
|
@@ -1139,7 +1140,7 @@ var oe = {
|
|
|
1139
1140
|
"data-tooltip-delay-hide": i,
|
|
1140
1141
|
"data-tooltip-place": o,
|
|
1141
1142
|
children: n
|
|
1142
|
-
}), !s && /* @__PURE__ */ I(
|
|
1143
|
+
}), !s && /* @__PURE__ */ I(oe, {
|
|
1143
1144
|
ref: u,
|
|
1144
1145
|
css: _t(c),
|
|
1145
1146
|
id: e,
|
|
@@ -1443,7 +1444,7 @@ var oe = {
|
|
|
1443
1444
|
B.current !== "touch" && E(z(e.clientX));
|
|
1444
1445
|
}, ee = () => {
|
|
1445
1446
|
_.current && E(void 0);
|
|
1446
|
-
}, U = (e) => r ? e / r * 100 : 0,
|
|
1447
|
+
}, U = (e) => r ? e / r * 100 : 0, te = (e, t, n) => {
|
|
1447
1448
|
let r = Number((n - t).toFixed(4)), i = t * 100;
|
|
1448
1449
|
return /* @__PURE__ */ I("div", {
|
|
1449
1450
|
className: "loaded-part",
|
|
@@ -1452,10 +1453,10 @@ var oe = {
|
|
|
1452
1453
|
marginLeft: `${i}%`
|
|
1453
1454
|
}
|
|
1454
1455
|
}, e);
|
|
1455
|
-
},
|
|
1456
|
+
}, ne = C(() => i === void 0 ? r ? o.map(([e, t], n) => te(n, e / r, t / r)) : [] : a?.map((e, t) => {
|
|
1456
1457
|
if (!i || !r) return null;
|
|
1457
1458
|
let n = s.filter((t) => e.startByteOffset <= t.pos && t.pos <= e.endByteOffset), a = n.at(0), o = n.at(-1);
|
|
1458
|
-
return !a || !o ? null :
|
|
1459
|
+
return !a || !o ? null : te(t, a.timestamp / r, o.timestamp / r);
|
|
1459
1460
|
}) ?? [], [
|
|
1460
1461
|
r,
|
|
1461
1462
|
i,
|
|
@@ -1471,7 +1472,7 @@ var oe = {
|
|
|
1471
1472
|
v,
|
|
1472
1473
|
r
|
|
1473
1474
|
]);
|
|
1474
|
-
let
|
|
1475
|
+
let re = C(() => {
|
|
1475
1476
|
if (!r) return 0;
|
|
1476
1477
|
if (N && v !== void 0) return v;
|
|
1477
1478
|
let e = f ?? t;
|
|
@@ -1482,22 +1483,22 @@ var oe = {
|
|
|
1482
1483
|
N,
|
|
1483
1484
|
v,
|
|
1484
1485
|
f
|
|
1485
|
-
]),
|
|
1486
|
-
if (!
|
|
1487
|
-
let e = b / r * 100, t =
|
|
1488
|
-
return t >= 0 ? t :
|
|
1486
|
+
]), W = C(() => p(d, r), [d, r]), G = W.length > 0, K = C(() => {
|
|
1487
|
+
if (!G || b === void 0 || !r) return -1;
|
|
1488
|
+
let e = b / r * 100, t = W.findIndex((t, n) => n < W.length - 1 && e >= t && e < W[n + 1]);
|
|
1489
|
+
return t >= 0 ? t : W.length - 2;
|
|
1489
1490
|
}, [
|
|
1490
|
-
|
|
1491
|
-
|
|
1491
|
+
G,
|
|
1492
|
+
W,
|
|
1492
1493
|
b,
|
|
1493
1494
|
r
|
|
1494
|
-
]),
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
]),
|
|
1495
|
+
]), ie = C(() => G ? m(W, (e) => e !== K) : void 0, [
|
|
1496
|
+
G,
|
|
1497
|
+
W,
|
|
1498
|
+
K
|
|
1499
|
+
]), q = C(() => K >= 0 ? m(W, (e) => e === K) : void 0, [W, K]), J = C(() => {
|
|
1499
1500
|
if (b !== void 0) return d.find(({ start: e, end: t }) => e <= b && b < t);
|
|
1500
|
-
}, [d, b]),
|
|
1501
|
+
}, [d, b]), ae = C(() => {
|
|
1501
1502
|
if (b) {
|
|
1502
1503
|
if (l) return l(b);
|
|
1503
1504
|
if (c.length) return c.find(({ startTime: e, endTime: t }) => e <= b && b < t);
|
|
@@ -1506,20 +1507,20 @@ var oe = {
|
|
|
1506
1507
|
c,
|
|
1507
1508
|
l,
|
|
1508
1509
|
b
|
|
1509
|
-
]),
|
|
1510
|
+
]), oe = (e, t) => /* @__PURE__ */ L("div", {
|
|
1510
1511
|
className: e ? `track ${e}` : "track",
|
|
1511
1512
|
style: t ? { maskImage: t } : void 0,
|
|
1512
1513
|
children: [
|
|
1513
1514
|
/* @__PURE__ */ I("div", { className: "background-bar" }),
|
|
1514
1515
|
/* @__PURE__ */ I("div", {
|
|
1515
1516
|
className: "loaded",
|
|
1516
|
-
children:
|
|
1517
|
+
children: ne
|
|
1517
1518
|
}),
|
|
1518
1519
|
/* @__PURE__ */ I("div", {
|
|
1519
1520
|
className: "play-container",
|
|
1520
1521
|
children: /* @__PURE__ */ I("div", {
|
|
1521
1522
|
className: "play",
|
|
1522
|
-
style: { transform: `scaleX(${
|
|
1523
|
+
style: { transform: `scaleX(${re})` }
|
|
1523
1524
|
})
|
|
1524
1525
|
})
|
|
1525
1526
|
]
|
|
@@ -1530,31 +1531,31 @@ var oe = {
|
|
|
1530
1531
|
className: [
|
|
1531
1532
|
"progress-bar",
|
|
1532
1533
|
N ? "dragging" : "",
|
|
1533
|
-
|
|
1534
|
+
G ? "segmented" : ""
|
|
1534
1535
|
].filter(Boolean).join(" "),
|
|
1535
1536
|
onPointerDown: V,
|
|
1536
1537
|
onPointerMove: V,
|
|
1537
1538
|
onMouseMove: H,
|
|
1538
1539
|
onMouseOut: ee,
|
|
1539
1540
|
children: [
|
|
1540
|
-
|
|
1541
|
+
oe(void 0, ie),
|
|
1541
1542
|
b ? /* @__PURE__ */ L("div", {
|
|
1542
1543
|
className: "cursor-time",
|
|
1543
1544
|
style: {
|
|
1544
|
-
left:
|
|
1545
|
-
maxWidth:
|
|
1545
|
+
left: J ? `clamp(var(--thumbnail-half), ${U(b)}%, calc(100% - var(--thumbnail-half)))` : `clamp(calc(3 * var(--mp-unit)), ${U(b)}%, calc(100% - calc(3 * var(--mp-unit))))`,
|
|
1546
|
+
maxWidth: J ? "var(--thumbnail-width)" : void 0
|
|
1546
1547
|
},
|
|
1547
1548
|
children: [/* @__PURE__ */ I("span", {
|
|
1548
1549
|
className: "cursor-time-value",
|
|
1549
1550
|
children: ht(b)
|
|
1550
|
-
}),
|
|
1551
|
+
}), J ? /* @__PURE__ */ I("span", {
|
|
1551
1552
|
className: "chapter-title",
|
|
1552
|
-
children:
|
|
1553
|
+
children: J.title
|
|
1553
1554
|
}) : void 0]
|
|
1554
1555
|
}) : void 0,
|
|
1555
1556
|
/* @__PURE__ */ I("div", { className: "progress" }),
|
|
1556
1557
|
/* @__PURE__ */ I("div", { className: "hover" }),
|
|
1557
|
-
|
|
1558
|
+
q ? oe("focus", q) : void 0,
|
|
1558
1559
|
/* @__PURE__ */ I("div", { className: "scrubber" }),
|
|
1559
1560
|
/* @__PURE__ */ I("div", {
|
|
1560
1561
|
className: "padding",
|
|
@@ -1566,7 +1567,7 @@ var oe = {
|
|
|
1566
1567
|
/* @__PURE__ */ I("div", {
|
|
1567
1568
|
className: "thumbnail",
|
|
1568
1569
|
style: { left: `clamp(var(--thumbnail-half), ${U(b ?? 1)}%, calc(100% - var(--thumbnail-half)))` },
|
|
1569
|
-
children:
|
|
1570
|
+
children: ae?.url ? /* @__PURE__ */ I("img", { src: ae.url }) : void 0
|
|
1570
1571
|
})
|
|
1571
1572
|
]
|
|
1572
1573
|
});
|
|
@@ -1922,7 +1923,7 @@ ${jt}
|
|
|
1922
1923
|
onClick: i,
|
|
1923
1924
|
"aria-label": u,
|
|
1924
1925
|
"aria-expanded": r,
|
|
1925
|
-
children: /* @__PURE__ */ I(
|
|
1926
|
+
children: /* @__PURE__ */ I(ie, { className: "alert-triangle" })
|
|
1926
1927
|
}),
|
|
1927
1928
|
toolTipText: /* @__PURE__ */ I("span", { children: u })
|
|
1928
1929
|
}), r && /* @__PURE__ */ L("div", {
|
|
@@ -2083,6 +2084,7 @@ ${jt}
|
|
|
2083
2084
|
width: 28px;
|
|
2084
2085
|
height: 16px;
|
|
2085
2086
|
margin-right: 6px;
|
|
2087
|
+
margin-left: 8px;
|
|
2086
2088
|
border-radius: 8px;
|
|
2087
2089
|
background-color: rgba(255,255,255,.3);
|
|
2088
2090
|
transition: background-color 0.15s ease-in-out;
|
|
@@ -2157,48 +2159,54 @@ ${jt}
|
|
|
2157
2159
|
1.5,
|
|
2158
2160
|
2
|
|
2159
2161
|
], Wt = () => {
|
|
2160
|
-
let e = X(), { format: t, number: n } = Q(), r = X((e) => e.playbackRate), i = X((e) => e.audioTracks), o = X((e) => e.selectedAudioTrack), s = X((e) => e.selectAudioTrack), c = X((e) => e.quality), l = X((e) => e.volumeNormalizer),
|
|
2161
|
-
e.setPlaybackRate(t),
|
|
2162
|
-
}, y = (e) => {
|
|
2163
|
-
e !== void 0 && _(e, () => s(e));
|
|
2162
|
+
let e = X(), { format: t, number: n } = Q(), r = X((e) => e.playbackRate), i = X((e) => e.audioTracks), o = X((e) => e.selectedAudioTrack), s = X((e) => e.selectAudioTrack), c = X((e) => e.quality), l = X((e) => e.volumeNormalizer), u = X((e) => e.autoplayNext), [d, f] = T(0), { open: p, toggle: m, containerRef: h, pending: g, failed: _, runSelect: v } = Nt({ onReset: () => f(0) }), y = (t) => {
|
|
2163
|
+
e.setPlaybackRate(t), f(0);
|
|
2164
2164
|
}, b = (e) => {
|
|
2165
|
-
|
|
2166
|
-
}, x =
|
|
2167
|
-
|
|
2165
|
+
e !== void 0 && v(e, () => s(e));
|
|
2166
|
+
}, x = (e) => {
|
|
2167
|
+
c && v(e ?? null, () => c.select(e === void 0 ? null : String(e)));
|
|
2168
|
+
}, S = c ? c.options.length + +!!c.offLabel : 0, C = c?.selectedId == null ? c?.offLabel : c.options.find(({ id: e }) => e === c.selectedId)?.label, w = (e) => () => {
|
|
2169
|
+
f(e);
|
|
2168
2170
|
};
|
|
2169
2171
|
return /* @__PURE__ */ L("div", {
|
|
2170
2172
|
css: Ht,
|
|
2171
|
-
ref:
|
|
2173
|
+
ref: h,
|
|
2172
2174
|
children: [
|
|
2173
2175
|
/* @__PURE__ */ I(St, {
|
|
2174
2176
|
id: "settings",
|
|
2175
|
-
disabled:
|
|
2177
|
+
disabled: p,
|
|
2176
2178
|
text: /* @__PURE__ */ I("button", {
|
|
2177
2179
|
className: "settings",
|
|
2178
2180
|
type: "button",
|
|
2179
|
-
onClick:
|
|
2181
|
+
onClick: m,
|
|
2180
2182
|
"aria-label": t(a.settings),
|
|
2181
|
-
"aria-expanded":
|
|
2182
|
-
children: /* @__PURE__ */ I(
|
|
2183
|
+
"aria-expanded": p,
|
|
2184
|
+
children: /* @__PURE__ */ I(K, {})
|
|
2183
2185
|
}),
|
|
2184
2186
|
toolTipText: /* @__PURE__ */ I("span", { children: t(a.settings) })
|
|
2185
2187
|
}),
|
|
2186
|
-
|
|
2188
|
+
p && d === 0 && /* @__PURE__ */ L("div", {
|
|
2187
2189
|
className: "popover menu",
|
|
2188
2190
|
children: [
|
|
2191
|
+
u ? /* @__PURE__ */ L("div", {
|
|
2192
|
+
role: "switch",
|
|
2193
|
+
"aria-checked": u.enabled,
|
|
2194
|
+
onClick: () => u.setEnabled(!u.enabled),
|
|
2195
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.autoplayNext) }), /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I("span", { className: u.enabled ? "switch on" : "switch" }) })]
|
|
2196
|
+
}) : null,
|
|
2189
2197
|
i.length > 1 ? /* @__PURE__ */ L("div", {
|
|
2190
|
-
onClick:
|
|
2198
|
+
onClick: w(2),
|
|
2191
2199
|
children: [/* @__PURE__ */ I("div", { children: t(a.audio) }), /* @__PURE__ */ I("div", { children: /* @__PURE__ */ I(ee, {}) })]
|
|
2192
2200
|
}) : null,
|
|
2193
|
-
|
|
2194
|
-
onClick:
|
|
2195
|
-
children: [/* @__PURE__ */ I("div", { children: t(a.quality) }), /* @__PURE__ */ L("div", { children: [
|
|
2201
|
+
S > 1 ? /* @__PURE__ */ L("div", {
|
|
2202
|
+
onClick: w(3),
|
|
2203
|
+
children: [/* @__PURE__ */ I("div", { children: t(a.quality) }), /* @__PURE__ */ L("div", { children: [C ? /* @__PURE__ */ I("span", {
|
|
2196
2204
|
className: "secondary",
|
|
2197
|
-
children:
|
|
2205
|
+
children: C
|
|
2198
2206
|
}) : null, /* @__PURE__ */ I(ee, {})] })]
|
|
2199
2207
|
}) : null,
|
|
2200
2208
|
/* @__PURE__ */ L("div", {
|
|
2201
|
-
onClick:
|
|
2209
|
+
onClick: w(1),
|
|
2202
2210
|
children: [/* @__PURE__ */ I("div", { children: t(a.playbackSpeed) }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("span", {
|
|
2203
2211
|
className: "secondary",
|
|
2204
2212
|
children: r === 1 ? t(a.defaultSpeed) : n(r, {
|
|
@@ -2222,12 +2230,12 @@ ${jt}
|
|
|
2222
2230
|
}) : null
|
|
2223
2231
|
]
|
|
2224
2232
|
}),
|
|
2225
|
-
|
|
2233
|
+
p && d === 1 && /* @__PURE__ */ L("div", {
|
|
2226
2234
|
className: "popover playback-rate",
|
|
2227
2235
|
children: [
|
|
2228
2236
|
/* @__PURE__ */ L("div", {
|
|
2229
2237
|
className: "back",
|
|
2230
|
-
onClick:
|
|
2238
|
+
onClick: w(0),
|
|
2231
2239
|
children: [/* @__PURE__ */ I(H, {}), /* @__PURE__ */ I("span", { children: t(a.playbackSpeed) })]
|
|
2232
2240
|
}),
|
|
2233
2241
|
/* @__PURE__ */ I("div", {
|
|
@@ -2237,30 +2245,30 @@ ${jt}
|
|
|
2237
2245
|
/* @__PURE__ */ I("div", {
|
|
2238
2246
|
className: "options no-hover",
|
|
2239
2247
|
children: Ut.map((e) => /* @__PURE__ */ I("div", {
|
|
2240
|
-
onClick: () =>
|
|
2248
|
+
onClick: () => y(e),
|
|
2241
2249
|
children: t(a.speed, { rate: n(e) })
|
|
2242
2250
|
}, e))
|
|
2243
2251
|
})
|
|
2244
2252
|
]
|
|
2245
2253
|
}),
|
|
2246
|
-
|
|
2254
|
+
p && d === 2 && /* @__PURE__ */ I(Mt, {
|
|
2247
2255
|
title: t(a.audio),
|
|
2248
2256
|
tracks: i,
|
|
2249
2257
|
selected: o,
|
|
2250
|
-
onSelect:
|
|
2251
|
-
onBack:
|
|
2252
|
-
pending:
|
|
2253
|
-
failed:
|
|
2258
|
+
onSelect: b,
|
|
2259
|
+
onBack: w(0),
|
|
2260
|
+
pending: g,
|
|
2261
|
+
failed: _
|
|
2254
2262
|
}),
|
|
2255
|
-
|
|
2263
|
+
p && d === 3 && c && /* @__PURE__ */ I(Mt, {
|
|
2256
2264
|
title: t(a.quality),
|
|
2257
2265
|
tracks: c.options,
|
|
2258
2266
|
selected: c.selectedId ?? void 0,
|
|
2259
|
-
onSelect:
|
|
2260
|
-
onBack:
|
|
2267
|
+
onSelect: x,
|
|
2268
|
+
onBack: w(0),
|
|
2261
2269
|
offLabel: c.offLabel,
|
|
2262
|
-
pending:
|
|
2263
|
-
failed:
|
|
2270
|
+
pending: g,
|
|
2271
|
+
failed: _
|
|
2264
2272
|
})
|
|
2265
2273
|
]
|
|
2266
2274
|
});
|
|
@@ -2475,7 +2483,7 @@ ${jt}
|
|
|
2475
2483
|
ref: e,
|
|
2476
2484
|
"aria-label": n(a.mute),
|
|
2477
2485
|
"aria-pressed": i || r === 0,
|
|
2478
|
-
children: I(i || r === 0 ?
|
|
2486
|
+
children: I(i || r === 0 ? ae : r <= .5 ? q : J, {
|
|
2479
2487
|
size: 18,
|
|
2480
2488
|
color: "#fff"
|
|
2481
2489
|
})
|
|
@@ -2728,7 +2736,7 @@ ${jt}
|
|
|
2728
2736
|
type: "button",
|
|
2729
2737
|
onClick: () => r.togglePaused(),
|
|
2730
2738
|
"aria-label": i(j ? a.replay : o ? a.play : a.pause),
|
|
2731
|
-
children: I(j ?
|
|
2739
|
+
children: I(j ? G : o ? W : re, {})
|
|
2732
2740
|
}),
|
|
2733
2741
|
toolTipText: /* @__PURE__ */ I("span", { children: i(j ? a.replayKey : o ? a.playKey : a.pauseKey) })
|
|
2734
2742
|
}),
|
|
@@ -2788,7 +2796,7 @@ ${jt}
|
|
|
2788
2796
|
onClick: P,
|
|
2789
2797
|
"aria-label": i(a.fullScreen),
|
|
2790
2798
|
"aria-pressed": d,
|
|
2791
|
-
children: I(d ?
|
|
2799
|
+
children: I(d ? ne : te, {})
|
|
2792
2800
|
}),
|
|
2793
2801
|
toolTipText: /* @__PURE__ */ I("span", { children: i(d ? a.exitFullScreenKey : a.fullScreenKey) })
|
|
2794
2802
|
})
|
|
@@ -3145,21 +3153,25 @@ ${jt}
|
|
|
3145
3153
|
}, 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 }) => {
|
|
3146
3154
|
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;
|
|
3147
3155
|
S(() => (g?.(E), () => g?.(null)), [E, g]), Pe(E, n?.stepFrame);
|
|
3148
|
-
let { expose: D } = e, [O, k] = T(null), [M, N] = T(!0), [P] = T(() => Object.assign(new EventTarget(), {
|
|
3156
|
+
let { expose: D } = e, [O, k] = T(null), [M, N] = T(!0), [P, F] = T(null), [L, R] = T(e.autoplayNext), [z] = T(() => Object.assign(new EventTarget(), {
|
|
3149
3157
|
chapters: [],
|
|
3150
3158
|
endingOffered: !0,
|
|
3159
|
+
autoplayNext: null,
|
|
3151
3160
|
onHostFullscreen: k,
|
|
3152
|
-
onEndingOffered: N
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3161
|
+
onEndingOffered: N,
|
|
3162
|
+
onAutoplayNext: (e) => {
|
|
3163
|
+
F(e), e !== null && R(e);
|
|
3164
|
+
}
|
|
3165
|
+
})), B = D === !0 ? {} : D || void 0, V = w(B);
|
|
3166
|
+
V.current = B;
|
|
3167
|
+
let H = B ? B.id : void 0, ee = B ? B.origin : void 0, U = B ? B.channel : void 0;
|
|
3156
3168
|
S(() => {
|
|
3157
3169
|
if (!D || !E) return;
|
|
3158
3170
|
let e, t = !1;
|
|
3159
3171
|
return import("./remote/index.js").then(({ exposePlayer: n }) => {
|
|
3160
3172
|
t || (e = n(E, {
|
|
3161
|
-
...
|
|
3162
|
-
player:
|
|
3173
|
+
...V.current,
|
|
3174
|
+
player: z
|
|
3163
3175
|
}));
|
|
3164
3176
|
}).catch(() => {}), () => {
|
|
3165
3177
|
t = !0, e?.();
|
|
@@ -3167,142 +3179,157 @@ ${jt}
|
|
|
3167
3179
|
}, [
|
|
3168
3180
|
E,
|
|
3169
3181
|
!!D,
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3182
|
+
H,
|
|
3183
|
+
ee,
|
|
3184
|
+
U
|
|
3173
3185
|
]);
|
|
3174
|
-
let
|
|
3186
|
+
let te = X((e) => e.chapters), ne = JSON.stringify(te);
|
|
3187
|
+
S(() => {
|
|
3188
|
+
z.chapters = te, z.endingOffered = M, z.dispatchEvent(new Event("chapterschange"));
|
|
3189
|
+
}, [ne, M]);
|
|
3190
|
+
let re = e.autoplayNext;
|
|
3175
3191
|
S(() => {
|
|
3176
|
-
P
|
|
3177
|
-
}, [
|
|
3178
|
-
let
|
|
3192
|
+
P === null && R(re);
|
|
3193
|
+
}, [re, P]);
|
|
3194
|
+
let W = w(e.onAutoplayNextChange);
|
|
3195
|
+
W.current = e.onAutoplayNextChange, S(() => {
|
|
3196
|
+
z.autoplayNext = L ?? null, z.dispatchEvent(new Event("autoplaynextchange"));
|
|
3197
|
+
}, [L]);
|
|
3198
|
+
let G = e.fullscreen ?? (O === null ? void 0 : {
|
|
3179
3199
|
active: O,
|
|
3180
|
-
request: () =>
|
|
3181
|
-
}),
|
|
3182
|
-
Ae(v, b, r, h ?
|
|
3183
|
-
let
|
|
3200
|
+
request: () => z.dispatchEvent(new Event("fullscreenrequest"))
|
|
3201
|
+
}), K = C(() => tt(), [o]);
|
|
3202
|
+
Ae(v, b, r, h ? K.push : void 0);
|
|
3203
|
+
let ie = r?.normalizeVolume ?? !0, [q, J] = T(ie);
|
|
3184
3204
|
S(() => {
|
|
3185
|
-
|
|
3186
|
-
}, [
|
|
3187
|
-
let
|
|
3188
|
-
|
|
3189
|
-
let
|
|
3190
|
-
|
|
3191
|
-
let
|
|
3192
|
-
tap:
|
|
3193
|
-
audioStreamIndex:
|
|
3205
|
+
J(ie);
|
|
3206
|
+
}, [ie]);
|
|
3207
|
+
let ae = w(r?.onNormalizeVolumeChange);
|
|
3208
|
+
ae.current = r?.onNormalizeVolumeChange;
|
|
3209
|
+
let oe = r?.normalizerWorkletUrl, se = w(p ?? f);
|
|
3210
|
+
se.current = p ?? f;
|
|
3211
|
+
let Y = X((e) => e.selectedAudioTrack), ce = !!f, { refused: le } = et(v, oe, q, C(() => ce && o && c && l && typeof Y == "number" && Y >= 0 ? h ? {
|
|
3212
|
+
tap: K,
|
|
3213
|
+
audioStreamIndex: Y
|
|
3194
3214
|
} : {
|
|
3195
|
-
read: (e, t) =>
|
|
3215
|
+
read: (e, t) => se.current(e, t),
|
|
3196
3216
|
length: o,
|
|
3197
3217
|
publicPath: c,
|
|
3198
3218
|
libavWorkerUrl: l,
|
|
3199
|
-
audioStreamIndex:
|
|
3219
|
+
audioStreamIndex: Y
|
|
3200
3220
|
} : void 0, [
|
|
3201
|
-
|
|
3221
|
+
ce,
|
|
3202
3222
|
o,
|
|
3203
3223
|
c,
|
|
3204
3224
|
l,
|
|
3205
|
-
|
|
3225
|
+
Y,
|
|
3206
3226
|
h,
|
|
3207
|
-
|
|
3208
|
-
]), C(() => s?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [s?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")])),
|
|
3209
|
-
enabled:
|
|
3210
|
-
available: !
|
|
3227
|
+
K
|
|
3228
|
+
]), C(() => s?.map(({ startByteOffset: e, endByteOffset: t }) => [e, t]), [s?.map(({ startByteOffset: e, endByteOffset: t }) => `${e}-${t}`).join(",")])), ue = C(() => oe && typeof AudioWorkletNode == "function" ? {
|
|
3229
|
+
enabled: q,
|
|
3230
|
+
available: !le,
|
|
3211
3231
|
setEnabled: (e) => {
|
|
3212
|
-
|
|
3232
|
+
J(e), ae.current?.(e);
|
|
3213
3233
|
}
|
|
3214
3234
|
} : null, [
|
|
3235
|
+
oe,
|
|
3215
3236
|
q,
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
]), { thumbnails: ae, requestThumbnail: oe } = Le({
|
|
3237
|
+
le
|
|
3238
|
+
]), { thumbnails: de, requestThumbnail: fe } = Le({
|
|
3219
3239
|
publicPath: c,
|
|
3220
3240
|
workerUrl: l,
|
|
3221
3241
|
length: m === !1 ? void 0 : o,
|
|
3222
3242
|
read: p ?? f,
|
|
3223
3243
|
downloadedRanges: s
|
|
3224
|
-
}),
|
|
3244
|
+
}), pe = n?.thumbnails?.all ?? de, { toggle: me, mode: he, burnedIn: ge } = Re(v, b), _e = We(n?.media ?? null, n?.pictureInPicture), Z = X((e) => e.setSourceState), ve = n ? !!n.media : o !== void 0;
|
|
3225
3245
|
S(() => {
|
|
3226
3246
|
Z({
|
|
3227
3247
|
title: i,
|
|
3228
3248
|
size: o,
|
|
3229
3249
|
downloadedRanges: s,
|
|
3230
|
-
hasMedia:
|
|
3250
|
+
hasMedia: ve
|
|
3231
3251
|
});
|
|
3232
3252
|
}, [
|
|
3233
3253
|
Z,
|
|
3234
3254
|
i,
|
|
3235
3255
|
o,
|
|
3236
3256
|
s,
|
|
3237
|
-
|
|
3257
|
+
ve
|
|
3238
3258
|
]);
|
|
3239
|
-
let
|
|
3259
|
+
let Q = n?.thumbnails?.at;
|
|
3240
3260
|
S(() => {
|
|
3241
3261
|
Z({
|
|
3242
|
-
thumbnails:
|
|
3243
|
-
thumbnailAt:
|
|
3244
|
-
requestThumbnail:
|
|
3245
|
-
togglePictureInPicture:
|
|
3246
|
-
pictureInPictureMode:
|
|
3247
|
-
burnedInSubtitles:
|
|
3262
|
+
thumbnails: pe,
|
|
3263
|
+
thumbnailAt: Q,
|
|
3264
|
+
requestThumbnail: fe,
|
|
3265
|
+
togglePictureInPicture: me,
|
|
3266
|
+
pictureInPictureMode: he,
|
|
3267
|
+
burnedInSubtitles: ge
|
|
3248
3268
|
});
|
|
3249
3269
|
}, [
|
|
3250
3270
|
Z,
|
|
3251
|
-
se,
|
|
3252
3271
|
pe,
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3272
|
+
Q,
|
|
3273
|
+
fe,
|
|
3274
|
+
me,
|
|
3275
|
+
he,
|
|
3276
|
+
ge
|
|
3257
3277
|
]), S(() => {
|
|
3258
|
-
Z({ volumeNormalizer:
|
|
3259
|
-
}, [Z,
|
|
3260
|
-
Z({
|
|
3261
|
-
|
|
3262
|
-
|
|
3278
|
+
Z({ volumeNormalizer: ue });
|
|
3279
|
+
}, [Z, ue]), S(() => {
|
|
3280
|
+
Z({ autoplayNext: L === void 0 ? null : {
|
|
3281
|
+
enabled: L,
|
|
3282
|
+
setEnabled: (e) => {
|
|
3283
|
+
R(e), W.current?.(e);
|
|
3284
|
+
}
|
|
3285
|
+
} });
|
|
3286
|
+
}, [Z, L]), S(() => {
|
|
3287
|
+
Z({ passThroughPictureInPicture: _e });
|
|
3288
|
+
}, [Z, _e]);
|
|
3289
|
+
let ye = n?.subtitles?.selection, be = n?.audioTracks?.selection, xe = w({
|
|
3263
3290
|
options: e,
|
|
3264
|
-
audio:
|
|
3291
|
+
audio: be
|
|
3265
3292
|
});
|
|
3266
|
-
|
|
3293
|
+
xe.current = {
|
|
3267
3294
|
options: e,
|
|
3268
|
-
audio:
|
|
3295
|
+
audio: be
|
|
3269
3296
|
}, S(() => {
|
|
3270
|
-
|
|
3271
|
-
subtitleTracks:
|
|
3297
|
+
ye && Z({
|
|
3298
|
+
subtitleTracks: ye.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3272
3299
|
id: e,
|
|
3273
3300
|
label: t,
|
|
3274
3301
|
disabled: n
|
|
3275
3302
|
})),
|
|
3276
|
-
selectedSubtitleTrack:
|
|
3303
|
+
selectedSubtitleTrack: ye.selectedId ?? void 0,
|
|
3277
3304
|
selectSubtitleTrack: (e) => {
|
|
3278
|
-
let t = e == null ? null : String(e), n = t === null ? void 0 : bn(
|
|
3279
|
-
return xn(
|
|
3280
|
-
let e = t === null ? null : u(n) ?? (r ? n?.title : void 0), i =
|
|
3305
|
+
let t = e == null ? null : String(e), n = t === null ? void 0 : bn(ye, t), r = ye.selectedId === null;
|
|
3306
|
+
return xn(ye.select(t), () => {
|
|
3307
|
+
let e = t === null ? null : u(n) ?? (r ? n?.title : void 0), i = xe.current;
|
|
3281
3308
|
e !== void 0 && i.options.onPreferredSubtitleLanguageChange?.(e);
|
|
3282
3309
|
let a = i.audio && bn(i.audio, i.audio.selectedId ?? "");
|
|
3283
3310
|
e && d(a, e) && i.options.onAlwaysShowSubtitlesChange?.(!0);
|
|
3284
3311
|
});
|
|
3285
3312
|
},
|
|
3286
|
-
subtitleOffLabel:
|
|
3313
|
+
subtitleOffLabel: ye.offLabel
|
|
3287
3314
|
});
|
|
3288
|
-
}, [Z,
|
|
3289
|
-
|
|
3290
|
-
audioTracks:
|
|
3315
|
+
}, [Z, ye]), S(() => {
|
|
3316
|
+
be && Z({
|
|
3317
|
+
audioTracks: be.options.map(({ id: e, label: t, disabled: n }) => ({
|
|
3291
3318
|
id: e,
|
|
3292
3319
|
label: t,
|
|
3293
3320
|
disabled: n
|
|
3294
3321
|
})),
|
|
3295
|
-
selectedAudioTrack:
|
|
3296
|
-
selectAudioTrack: (e) => xn(
|
|
3297
|
-
let t = u(bn(
|
|
3298
|
-
t !== void 0 &&
|
|
3322
|
+
selectedAudioTrack: be.selectedId ?? void 0,
|
|
3323
|
+
selectAudioTrack: (e) => xn(be.select(String(e)), () => {
|
|
3324
|
+
let t = u(bn(be, String(e)));
|
|
3325
|
+
t !== void 0 && xe.current.options.onPreferredAudioLanguageChange?.(t);
|
|
3299
3326
|
})
|
|
3300
3327
|
});
|
|
3301
|
-
}, [Z,
|
|
3302
|
-
let
|
|
3328
|
+
}, [Z, be]);
|
|
3329
|
+
let Se = n?.quality?.selection ?? null;
|
|
3303
3330
|
return S(() => {
|
|
3304
|
-
Z({ quality:
|
|
3305
|
-
}, [Z,
|
|
3331
|
+
Z({ quality: Se });
|
|
3332
|
+
}, [Z, Se]), S(() => {
|
|
3306
3333
|
a && Z({ chapters: a });
|
|
3307
3334
|
}, [Z, a]), /* @__PURE__ */ I(yn, {
|
|
3308
3335
|
ref: _,
|
|
@@ -3311,7 +3338,7 @@ ${jt}
|
|
|
3311
3338
|
overlay: e.overlay,
|
|
3312
3339
|
controls: e.controls,
|
|
3313
3340
|
shortcuts: e.shortcuts,
|
|
3314
|
-
fullscreen:
|
|
3341
|
+
fullscreen: G,
|
|
3315
3342
|
endingOffered: M,
|
|
3316
3343
|
children: t
|
|
3317
3344
|
});
|
|
@@ -3436,4 +3463,4 @@ ${jt}
|
|
|
3436
3463
|
throw Error(`Unknown source type: ${e}`);
|
|
3437
3464
|
};
|
|
3438
3465
|
//#endregion
|
|
3439
|
-
export { wn as MediaPlayer, wn as default, ce as Player, t as SUBTITLES_OFF, c as createPictureInPicture, l as createSubtitleRenderer, o as createThumbnailGenerator, An as inputToRemuxerInput, En as isDelegatedTracks, Tn as isExternalThumbnails,
|
|
3466
|
+
export { wn as MediaPlayer, wn as default, ce as Player, t as SUBTITLES_OFF, c as createPictureInPicture, l as createSubtitleRenderer, o as createThumbnailGenerator, An as inputToRemuxerInput, En as isDelegatedTracks, Tn as isExternalThumbnails, Y as sourceFeature, s as startPlayback, Re as usePictureInPicture, X as usePlayer, Le as useSeekThumbnails };
|