playron 1.0.35 → 1.0.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/dist/playron.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as u, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as ce, useState as b, useEffect as
|
|
2
|
+
import { createContext as ce, useState as b, useEffect as x, useMemo as Ue, useContext as re, memo as kt, useRef as O, useCallback as B } from "react";
|
|
3
3
|
class St {
|
|
4
4
|
listeners = /* @__PURE__ */ new Map();
|
|
5
5
|
/**
|
|
@@ -559,8 +559,8 @@ class Tt {
|
|
|
559
559
|
const i = (n) => {
|
|
560
560
|
const o = {};
|
|
561
561
|
let l = !1;
|
|
562
|
-
e.forEach((
|
|
563
|
-
r[
|
|
562
|
+
e.forEach((c) => {
|
|
563
|
+
r[c] !== n[c] && (o[c] = n[c], l = !0);
|
|
564
564
|
}), l && t(o), r = { ...n };
|
|
565
565
|
};
|
|
566
566
|
this.subscribe(i);
|
|
@@ -709,7 +709,7 @@ class Pt {
|
|
|
709
709
|
hasDVR: !1,
|
|
710
710
|
isEngineSupported: this.preCheckCapability("hls")
|
|
711
711
|
};
|
|
712
|
-
const i = t.includes("#EXT-X-MEDIA-SEQUENCE"), n = t.includes("#EXT-X-ENDLIST"), o = t.includes("#EXT-X-PLAYLIST-TYPE:EVENT"), l = this.extractTargetDuration(t),
|
|
712
|
+
const i = t.includes("#EXT-X-MEDIA-SEQUENCE"), n = t.includes("#EXT-X-ENDLIST"), o = t.includes("#EXT-X-PLAYLIST-TYPE:EVENT"), l = this.extractTargetDuration(t), c = this.extractMediaSequence(t);
|
|
713
713
|
return i && !n ? {
|
|
714
714
|
type: "live",
|
|
715
715
|
protocol: "hls",
|
|
@@ -717,7 +717,7 @@ class Pt {
|
|
|
717
717
|
hasDVR: o,
|
|
718
718
|
// EVENT type supports DVR
|
|
719
719
|
targetDuration: l,
|
|
720
|
-
mediaSequence:
|
|
720
|
+
mediaSequence: c,
|
|
721
721
|
isEngineSupported: this.preCheckCapability("hls")
|
|
722
722
|
} : {
|
|
723
723
|
type: "vod",
|
|
@@ -913,17 +913,17 @@ async function nt(a, e, t, r, i) {
|
|
|
913
913
|
let n = new Error("License request failed");
|
|
914
914
|
for (let o = 0; o <= r; o++) {
|
|
915
915
|
if (o > 0) {
|
|
916
|
-
const
|
|
917
|
-
await new Promise((h) => setTimeout(h,
|
|
916
|
+
const d = i * Math.pow(2, o - 1);
|
|
917
|
+
await new Promise((h) => setTimeout(h, d));
|
|
918
918
|
}
|
|
919
|
-
const l = new AbortController(),
|
|
919
|
+
const l = new AbortController(), c = setTimeout(() => l.abort(), t);
|
|
920
920
|
try {
|
|
921
|
-
const
|
|
922
|
-
if (clearTimeout(
|
|
923
|
-
throw new Error(`HTTP ${
|
|
924
|
-
return await
|
|
925
|
-
} catch (
|
|
926
|
-
clearTimeout(
|
|
921
|
+
const d = await fetch(a, { ...e, signal: l.signal });
|
|
922
|
+
if (clearTimeout(c), !d.ok)
|
|
923
|
+
throw new Error(`HTTP ${d.status}: ${d.statusText}`);
|
|
924
|
+
return await d.arrayBuffer();
|
|
925
|
+
} catch (d) {
|
|
926
|
+
clearTimeout(c), d instanceof Error && d.name === "AbortError" ? n = new Error(`Request timed out after ${t}ms (attempt ${o + 1}/${r + 1})`) : n = d instanceof Error ? d : new Error(String(d));
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
throw n;
|
|
@@ -948,11 +948,11 @@ function Bt() {
|
|
|
948
948
|
}
|
|
949
949
|
async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
950
950
|
const n = i.timeout ?? _t, o = i.maxRetries ?? Vt, l = i.retryDelay ?? Nt;
|
|
951
|
-
let
|
|
952
|
-
i.prepareLicenseRequest && (
|
|
953
|
-
const
|
|
951
|
+
let c = e;
|
|
952
|
+
i.prepareLicenseRequest && (c = await i.prepareLicenseRequest(e));
|
|
953
|
+
const d = {
|
|
954
954
|
method: "POST",
|
|
955
|
-
body:
|
|
955
|
+
body: c,
|
|
956
956
|
headers: {
|
|
957
957
|
"Content-Type": "application/octet-stream",
|
|
958
958
|
...t
|
|
@@ -962,7 +962,7 @@ async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
|
962
962
|
console.debug("[LicenseManager] Acquiring license from:", a);
|
|
963
963
|
let h = await nt(
|
|
964
964
|
a,
|
|
965
|
-
|
|
965
|
+
d,
|
|
966
966
|
n,
|
|
967
967
|
o,
|
|
968
968
|
l
|
|
@@ -1371,8 +1371,8 @@ class Xt {
|
|
|
1371
1371
|
try {
|
|
1372
1372
|
const l = new o.media.MediaInfo(e, t);
|
|
1373
1373
|
l.streamType = i ? o.media.StreamType.LIVE : o.media.StreamType.BUFFERED, l.metadata = null;
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1374
|
+
const c = new o.media.LoadRequest(l);
|
|
1375
|
+
c.currentTime = r, c.autoplay = !0, await n.loadMedia(c), console.log(`[ChromecastManager] Media loaded on receiver: ${e} (t=${r}s)`);
|
|
1376
1376
|
} catch (l) {
|
|
1377
1377
|
console.error("[ChromecastManager] loadMedia error:", l);
|
|
1378
1378
|
}
|
|
@@ -2069,25 +2069,25 @@ const st = ce(null), ot = {
|
|
|
2069
2069
|
}, at = ce(ot), lt = ce(null);
|
|
2070
2070
|
function Gt({ children: a, playerInstance: e }) {
|
|
2071
2071
|
const [t, r] = b(ot);
|
|
2072
|
-
|
|
2072
|
+
x(() => {
|
|
2073
2073
|
if (!e) return;
|
|
2074
2074
|
const n = e.getStateManager();
|
|
2075
2075
|
if (!n) return;
|
|
2076
2076
|
r(n.getState());
|
|
2077
|
-
const o = (
|
|
2078
|
-
r(
|
|
2077
|
+
const o = (c) => {
|
|
2078
|
+
r(c);
|
|
2079
2079
|
};
|
|
2080
2080
|
n.subscribe(o);
|
|
2081
2081
|
const l = e.getVideoElement();
|
|
2082
2082
|
if (l) {
|
|
2083
|
-
const
|
|
2083
|
+
const c = () => {
|
|
2084
2084
|
const g = e.isLive();
|
|
2085
2085
|
n.updateState({
|
|
2086
2086
|
currentTime: l.currentTime,
|
|
2087
2087
|
duration: l.duration || 0,
|
|
2088
2088
|
isLive: g
|
|
2089
2089
|
});
|
|
2090
|
-
},
|
|
2090
|
+
}, d = () => {
|
|
2091
2091
|
n.set("isPlaying", !l.paused);
|
|
2092
2092
|
}, h = () => {
|
|
2093
2093
|
n.updateState({
|
|
@@ -2101,8 +2101,8 @@ function Gt({ children: a, playerInstance: e }) {
|
|
|
2101
2101
|
isLive: !0
|
|
2102
2102
|
});
|
|
2103
2103
|
};
|
|
2104
|
-
return e.events.on("livelatencyupdate", p), l.addEventListener(C.TIME_UPDATE,
|
|
2105
|
-
e.events.off("livelatencyupdate", p), l.removeEventListener(C.TIME_UPDATE,
|
|
2104
|
+
return e.events.on("livelatencyupdate", p), l.addEventListener(C.TIME_UPDATE, c), l.addEventListener(C.PLAY, d), l.addEventListener(C.PAUSE, d), l.addEventListener(C.VOLUME_CHANGE, h), l.addEventListener(C.LOADED_METADATA, c), () => {
|
|
2105
|
+
e.events.off("livelatencyupdate", p), l.removeEventListener(C.TIME_UPDATE, c), l.removeEventListener(C.PLAY, d), l.removeEventListener(C.PAUSE, d), l.removeEventListener(C.VOLUME_CHANGE, h), l.removeEventListener(C.LOADED_METADATA, c), n.unsubscribe(o);
|
|
2106
2106
|
};
|
|
2107
2107
|
}
|
|
2108
2108
|
return () => {
|
|
@@ -2185,7 +2185,7 @@ function Gt({ children: a, playerInstance: e }) {
|
|
|
2185
2185
|
} : null, [e]);
|
|
2186
2186
|
return /* @__PURE__ */ s(st.Provider, { value: e, children: /* @__PURE__ */ s(lt.Provider, { value: i, children: /* @__PURE__ */ s(at.Provider, { value: t, children: a }) }) });
|
|
2187
2187
|
}
|
|
2188
|
-
function
|
|
2188
|
+
function Y(a) {
|
|
2189
2189
|
const e = re(at);
|
|
2190
2190
|
if (!e)
|
|
2191
2191
|
throw new Error("usePlayerState must be used within PlayerProvider");
|
|
@@ -2262,74 +2262,74 @@ const Zt = "_overlay_3mfq6_3", Jt = "_iconContainer_3mfq6_17", er = "_loading_3m
|
|
|
2262
2262
|
customIcon: rr
|
|
2263
2263
|
};
|
|
2264
2264
|
function ir({ config: a, isAdLoading: e }) {
|
|
2265
|
-
const t =
|
|
2266
|
-
|
|
2267
|
-
console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0),
|
|
2265
|
+
const t = Y((D) => D.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [c, d] = b("play"), [h, p] = b(!1), g = O(null);
|
|
2266
|
+
x(() => {
|
|
2267
|
+
console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0), d("loading"), l(!0)) : (console.log("[VideoOverlay] ❌ Hiding ad loading icon"), p(!1), l(!1));
|
|
2268
2268
|
}, [e]);
|
|
2269
|
-
const m = a?.ui?.showOverlayIcons !== !1,
|
|
2270
|
-
|
|
2271
|
-
const
|
|
2272
|
-
if (!
|
|
2273
|
-
const
|
|
2274
|
-
if (!
|
|
2275
|
-
const
|
|
2276
|
-
p(!0),
|
|
2277
|
-
},
|
|
2269
|
+
const m = a?.ui?.showOverlayIcons !== !1, k = a?.ui?.showPlayPauseIcons !== !1, I = a?.ui?.overlayIcons?.playIcon, A = a?.ui?.overlayIcons?.pauseIcon, T = a?.ui?.overlayIcons?.iconSize || 40, E = a?.ui?.overlayIcons?.containerSize || 80;
|
|
2270
|
+
x(() => {
|
|
2271
|
+
const D = n();
|
|
2272
|
+
if (!D) return;
|
|
2273
|
+
const S = D.video || D.videoElement;
|
|
2274
|
+
if (!S) return;
|
|
2275
|
+
const _ = () => {
|
|
2276
|
+
p(!0), d("loading"), l(!0), g.current && clearTimeout(g.current);
|
|
2277
|
+
}, W = () => {
|
|
2278
2278
|
g.current = window.setTimeout(() => {
|
|
2279
2279
|
p(!1), l(!1);
|
|
2280
2280
|
}, 300);
|
|
2281
|
-
}, H = () => {
|
|
2282
|
-
p(!0), c("loading"), l(!0);
|
|
2283
2281
|
}, w = () => {
|
|
2282
|
+
p(!0), d("loading"), l(!0);
|
|
2283
|
+
}, M = () => {
|
|
2284
2284
|
h && (g.current = window.setTimeout(() => {
|
|
2285
2285
|
p(!1), l(!1);
|
|
2286
2286
|
}, 300));
|
|
2287
|
-
},
|
|
2287
|
+
}, N = () => {
|
|
2288
2288
|
h && (g.current = window.setTimeout(() => {
|
|
2289
2289
|
p(!1), l(!1);
|
|
2290
2290
|
}, 300));
|
|
2291
|
-
},
|
|
2292
|
-
p(!0),
|
|
2291
|
+
}, H = () => {
|
|
2292
|
+
p(!0), d("loading"), l(!0);
|
|
2293
2293
|
};
|
|
2294
|
-
return
|
|
2295
|
-
|
|
2294
|
+
return S.addEventListener(C.SEEKING, _), S.addEventListener(C.SEEKED, W), S.addEventListener(C.WAITING, w), S.addEventListener(C.PLAYING, M), S.addEventListener(C.CAN_PLAY, N), S.addEventListener(C.LOAD_START, H), () => {
|
|
2295
|
+
S.removeEventListener(C.SEEKING, _), S.removeEventListener(C.SEEKED, W), S.removeEventListener(C.WAITING, w), S.removeEventListener(C.PLAYING, M), S.removeEventListener(C.CAN_PLAY, N), S.removeEventListener(C.LOAD_START, H), g.current && clearTimeout(g.current);
|
|
2296
2296
|
};
|
|
2297
|
-
}, [n, h]),
|
|
2297
|
+
}, [n, h]), x(() => {
|
|
2298
2298
|
if (!h) {
|
|
2299
|
-
|
|
2300
|
-
const
|
|
2299
|
+
d(t ? "pause" : "play"), l(!0);
|
|
2300
|
+
const D = setTimeout(() => {
|
|
2301
2301
|
l(!1);
|
|
2302
2302
|
}, 600);
|
|
2303
|
-
return () => clearTimeout(
|
|
2303
|
+
return () => clearTimeout(D);
|
|
2304
2304
|
}
|
|
2305
2305
|
}, [t, h]);
|
|
2306
|
-
const
|
|
2306
|
+
const y = B(async () => {
|
|
2307
2307
|
await r();
|
|
2308
|
-
}, [r]),
|
|
2308
|
+
}, [r]), G = B(() => {
|
|
2309
2309
|
i();
|
|
2310
|
-
}, [i]),
|
|
2311
|
-
const
|
|
2312
|
-
return
|
|
2310
|
+
}, [i]), X = (D) => {
|
|
2311
|
+
const S = D === "play" ? I : A;
|
|
2312
|
+
return S ? /^https?:\/\//.test(S) || /\.(jpg|jpeg|png|svg|gif|webp)$/i.test(S) ? /* @__PURE__ */ s(
|
|
2313
2313
|
"img",
|
|
2314
2314
|
{
|
|
2315
|
-
src:
|
|
2316
|
-
alt:
|
|
2315
|
+
src: S,
|
|
2316
|
+
alt: D === "play" ? "Play" : "Pause",
|
|
2317
2317
|
className: ne.customIcon,
|
|
2318
|
-
style: { "--icon-size": `${
|
|
2318
|
+
style: { "--icon-size": `${T}px` }
|
|
2319
2319
|
}
|
|
2320
2320
|
) : /* @__PURE__ */ s(
|
|
2321
2321
|
"div",
|
|
2322
2322
|
{
|
|
2323
|
-
dangerouslySetInnerHTML: { __html:
|
|
2323
|
+
dangerouslySetInnerHTML: { __html: S },
|
|
2324
2324
|
className: ne.customIcon,
|
|
2325
|
-
style: { "--icon-size": `${
|
|
2325
|
+
style: { "--icon-size": `${T}px` }
|
|
2326
2326
|
}
|
|
2327
|
-
) :
|
|
2327
|
+
) : D === "play" ? /* @__PURE__ */ s(
|
|
2328
2328
|
"svg",
|
|
2329
2329
|
{
|
|
2330
2330
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2331
2331
|
className: ne.icon,
|
|
2332
|
-
style: { "--icon-size": `${
|
|
2332
|
+
style: { "--icon-size": `${T}px` },
|
|
2333
2333
|
viewBox: "0 0 24 24",
|
|
2334
2334
|
children: /* @__PURE__ */ s(
|
|
2335
2335
|
"path",
|
|
@@ -2345,7 +2345,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2345
2345
|
{
|
|
2346
2346
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2347
2347
|
className: ne.icon,
|
|
2348
|
-
style: { "--icon-size": `${
|
|
2348
|
+
style: { "--icon-size": `${T}px` },
|
|
2349
2349
|
viewBox: "0 0 24 24",
|
|
2350
2350
|
children: /* @__PURE__ */ s(
|
|
2351
2351
|
"path",
|
|
@@ -2364,27 +2364,27 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2364
2364
|
{
|
|
2365
2365
|
className: `${ne.iconContainer} ${ne.loading}`,
|
|
2366
2366
|
style: {
|
|
2367
|
-
"--icon-container-size": `${
|
|
2368
|
-
"--icon-size": `${
|
|
2367
|
+
"--icon-container-size": `${E}px`,
|
|
2368
|
+
"--icon-size": `${T}px`
|
|
2369
2369
|
},
|
|
2370
|
-
children: /* @__PURE__ */ s(Xe, { size:
|
|
2370
|
+
children: /* @__PURE__ */ s(Xe, { size: T })
|
|
2371
2371
|
}
|
|
2372
2372
|
) }),
|
|
2373
2373
|
/* @__PURE__ */ s(
|
|
2374
2374
|
"div",
|
|
2375
2375
|
{
|
|
2376
2376
|
className: `virtus-video-overlay ${ne.overlay}`,
|
|
2377
|
-
onClick:
|
|
2378
|
-
onDoubleClick:
|
|
2379
|
-
children: m && o && !e && /* @__PURE__ */ s(
|
|
2377
|
+
onClick: y,
|
|
2378
|
+
onDoubleClick: G,
|
|
2379
|
+
children: m && o && !e && (c === "loading" || k) && /* @__PURE__ */ s(
|
|
2380
2380
|
"div",
|
|
2381
2381
|
{
|
|
2382
2382
|
className: `${ne.iconContainer} ${h ? ne.loading : ""}`,
|
|
2383
2383
|
style: {
|
|
2384
|
-
"--icon-container-size": `${
|
|
2385
|
-
"--icon-size": `${
|
|
2384
|
+
"--icon-container-size": `${E}px`,
|
|
2385
|
+
"--icon-size": `${T}px`
|
|
2386
2386
|
},
|
|
2387
|
-
children:
|
|
2387
|
+
children: c === "loading" ? /* @__PURE__ */ s(Xe, { size: T }) : X(c)
|
|
2388
2388
|
}
|
|
2389
2389
|
)
|
|
2390
2390
|
}
|
|
@@ -2499,8 +2499,8 @@ function kr(a) {
|
|
|
2499
2499
|
}
|
|
2500
2500
|
const Sr = 12e3;
|
|
2501
2501
|
function Ar({ onRetry: a, drmConfig: e }) {
|
|
2502
|
-
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l =
|
|
2503
|
-
|
|
2502
|
+
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null), c = O(null);
|
|
2503
|
+
c.current = r, x(() => {
|
|
2504
2504
|
it().then((g) => {
|
|
2505
2505
|
o(g);
|
|
2506
2506
|
const m = Ge(e, g);
|
|
@@ -2512,50 +2512,50 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2512
2512
|
// must NOT be dismissed by play/loadedmetadata
|
|
2513
2513
|
});
|
|
2514
2514
|
}).catch(() => o(null));
|
|
2515
|
-
}, []),
|
|
2515
|
+
}, []), x(() => {
|
|
2516
2516
|
if (!n || !e?.enabled) return;
|
|
2517
2517
|
const g = Ge(e, n);
|
|
2518
|
-
g && !
|
|
2519
|
-
}, [e, n]),
|
|
2518
|
+
g && !c.current && i({ type: g, code: "DRM_NOT_SUPPORTED", rawMessage: "Browser does not support the required DRM key system.", persistent: !0 });
|
|
2519
|
+
}, [e, n]), x(() => {
|
|
2520
2520
|
if (!t || !e?.enabled) return;
|
|
2521
2521
|
const g = t.getVideoElement();
|
|
2522
2522
|
if (!g) return;
|
|
2523
2523
|
const m = () => {
|
|
2524
2524
|
g.currentTime > 0.5 || (l.current = setTimeout(() => {
|
|
2525
|
-
if (
|
|
2526
|
-
const
|
|
2525
|
+
if (c.current) return;
|
|
2526
|
+
const I = n, A = I ? I.fairplay && !I.widevine && !I.playready ? "drm_fairplay_needed" : !I.widevine && !I.fairplay && !I.playready ? "drm_browser_unsupported" : "drm_generic" : "drm_generic";
|
|
2527
2527
|
i({
|
|
2528
|
-
type:
|
|
2528
|
+
type: A,
|
|
2529
2529
|
code: "DRM_TIMEOUT",
|
|
2530
2530
|
rawMessage: "Playback stalled — possible DRM or network issue.",
|
|
2531
2531
|
persistent: !0
|
|
2532
2532
|
// don't let a late loadedmetadata dismiss this
|
|
2533
2533
|
});
|
|
2534
2534
|
}, Sr));
|
|
2535
|
-
},
|
|
2535
|
+
}, k = () => {
|
|
2536
2536
|
l.current && (clearTimeout(l.current), l.current = null);
|
|
2537
2537
|
};
|
|
2538
|
-
return g.addEventListener("waiting", m), g.addEventListener("playing",
|
|
2539
|
-
g.removeEventListener("waiting", m), g.removeEventListener("playing",
|
|
2538
|
+
return g.addEventListener("waiting", m), g.addEventListener("playing", k), g.addEventListener("timeupdate", k), () => {
|
|
2539
|
+
g.removeEventListener("waiting", m), g.removeEventListener("playing", k), g.removeEventListener("timeupdate", k), k();
|
|
2540
2540
|
};
|
|
2541
|
-
}, [t, e, n]),
|
|
2541
|
+
}, [t, e, n]), x(() => {
|
|
2542
2542
|
if (!t) return;
|
|
2543
2543
|
const g = (m) => {
|
|
2544
2544
|
console.error("[ErrorOverlay] Player error:", m);
|
|
2545
|
-
const
|
|
2546
|
-
i({ type:
|
|
2545
|
+
const k = xr(m, n);
|
|
2546
|
+
i({ type: k, code: m.code, rawMessage: m.message ?? "Unknown error" });
|
|
2547
2547
|
};
|
|
2548
2548
|
return t.events.on("error", g), () => {
|
|
2549
2549
|
t.events.off("error", g);
|
|
2550
2550
|
};
|
|
2551
|
-
}, [t, n]),
|
|
2551
|
+
}, [t, n]), x(() => {
|
|
2552
2552
|
if (!t) return;
|
|
2553
2553
|
const g = () => i((m) => m?.persistent ? m : null);
|
|
2554
2554
|
return t.events.on("play", g), t.events.on("loadedmetadata", g), () => {
|
|
2555
2555
|
t.events.off("play", g), t.events.off("loadedmetadata", g);
|
|
2556
2556
|
};
|
|
2557
2557
|
}, [t]);
|
|
2558
|
-
const
|
|
2558
|
+
const d = B(() => {
|
|
2559
2559
|
if (i(null), a) {
|
|
2560
2560
|
a();
|
|
2561
2561
|
return;
|
|
@@ -2579,7 +2579,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2579
2579
|
h.hint && /* @__PURE__ */ s("p", { className: te.errorHint, children: h.hint }),
|
|
2580
2580
|
h.browsers && /* @__PURE__ */ s("ul", { className: te.browserList, children: h.browsers.map((g) => /* @__PURE__ */ s("li", { className: te.browserItem, children: g }, g)) }),
|
|
2581
2581
|
r.code && h.variant !== "drm" && /* @__PURE__ */ s("p", { className: te.errorCode, children: r.code }),
|
|
2582
|
-
h.showRetry && /* @__PURE__ */ s("button", { onClick:
|
|
2582
|
+
h.showRetry && /* @__PURE__ */ s("button", { onClick: d, className: te.retryButton, children: "↻ Try Again" })
|
|
2583
2583
|
] }) });
|
|
2584
2584
|
}
|
|
2585
2585
|
const se = {
|
|
@@ -2633,10 +2633,10 @@ const se = {
|
|
|
2633
2633
|
{ key: "Esc", description: "Close overlays", icon: se.close }
|
|
2634
2634
|
];
|
|
2635
2635
|
function Tr({ isOpen: a, onClose: e }) {
|
|
2636
|
-
const t =
|
|
2636
|
+
const t = B((r) => {
|
|
2637
2637
|
r.key === "Escape" && e();
|
|
2638
2638
|
}, [e]);
|
|
2639
|
-
return
|
|
2639
|
+
return x(() => {
|
|
2640
2640
|
if (a)
|
|
2641
2641
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
2642
2642
|
}, [a, t]), a ? /* @__PURE__ */ u(
|
|
@@ -2796,18 +2796,18 @@ function Mr({
|
|
|
2796
2796
|
nextTitle: i,
|
|
2797
2797
|
thumbnail: n
|
|
2798
2798
|
}) {
|
|
2799
|
-
const [o, l] = b(r),
|
|
2800
|
-
|
|
2799
|
+
const [o, l] = b(r), c = O(null), d = B(() => {
|
|
2800
|
+
c.current && (clearInterval(c.current), c.current = null);
|
|
2801
2801
|
}, []);
|
|
2802
|
-
if (
|
|
2802
|
+
if (x(() => {
|
|
2803
2803
|
if (!a) {
|
|
2804
|
-
|
|
2804
|
+
d(), l(r);
|
|
2805
2805
|
return;
|
|
2806
2806
|
}
|
|
2807
|
-
return l(r),
|
|
2808
|
-
l((m) => m <= 1 ? (
|
|
2809
|
-
}, 1e3),
|
|
2810
|
-
}, [a, r, e,
|
|
2807
|
+
return l(r), c.current = setInterval(() => {
|
|
2808
|
+
l((m) => m <= 1 ? (d(), e(), 0) : m - 1);
|
|
2809
|
+
}, 1e3), d;
|
|
2810
|
+
}, [a, r, e, d]), !a) return null;
|
|
2811
2811
|
const h = 16, p = 2 * Math.PI * h, g = (r - o) / r * p;
|
|
2812
2812
|
return /* @__PURE__ */ u(
|
|
2813
2813
|
"div",
|
|
@@ -3034,28 +3034,28 @@ function Pr({ type: a, value: e }) {
|
|
|
3034
3034
|
);
|
|
3035
3035
|
}
|
|
3036
3036
|
function Lr({ player: a, skipSec: e = 10 }) {
|
|
3037
|
-
const [t, r] = b(null), i =
|
|
3037
|
+
const [t, r] = b(null), i = O(null), n = B((p) => {
|
|
3038
3038
|
r(p), i.current && clearTimeout(i.current), i.current = setTimeout(() => r(null), 900);
|
|
3039
|
-
}, []), o =
|
|
3039
|
+
}, []), o = O(null), l = 300, c = B((p) => {
|
|
3040
3040
|
if (!a) return;
|
|
3041
|
-
const g = p.touches[0], m = Date.now(),
|
|
3042
|
-
if (
|
|
3043
|
-
const
|
|
3044
|
-
if (g.clientX -
|
|
3045
|
-
const
|
|
3046
|
-
|
|
3041
|
+
const g = p.touches[0], m = Date.now(), k = o.current;
|
|
3042
|
+
if (k && m - k.time < l) {
|
|
3043
|
+
const A = p.currentTarget.getBoundingClientRect();
|
|
3044
|
+
if (g.clientX - A.left > A.width / 2) {
|
|
3045
|
+
const E = a.getVideoElement();
|
|
3046
|
+
E && a.seekTo(Math.min(E.duration || 0, E.currentTime + e)), n({ type: "seek-forward", value: `+${e}s` });
|
|
3047
3047
|
} else {
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3048
|
+
const E = a.getVideoElement();
|
|
3049
|
+
E && a.seekTo(Math.max(0, E.currentTime - e)), n({ type: "seek-backward", value: `-${e}s` });
|
|
3050
3050
|
}
|
|
3051
3051
|
o.current = null;
|
|
3052
3052
|
return;
|
|
3053
3053
|
}
|
|
3054
3054
|
o.current = { time: m, x: g.clientX };
|
|
3055
|
-
}, [a, e, n]),
|
|
3056
|
-
}, []), h =
|
|
3055
|
+
}, [a, e, n]), d = B((p) => {
|
|
3056
|
+
}, []), h = B(() => {
|
|
3057
3057
|
}, []);
|
|
3058
|
-
return { onTouchStart:
|
|
3058
|
+
return { onTouchStart: c, onTouchMove: d, onTouchEnd: h, gestureHint: t };
|
|
3059
3059
|
}
|
|
3060
3060
|
function Rr(a, e) {
|
|
3061
3061
|
let t;
|
|
@@ -3067,12 +3067,12 @@ function Dr({
|
|
|
3067
3067
|
timeout: a = 3e3,
|
|
3068
3068
|
initialVisible: e = !0
|
|
3069
3069
|
} = {}) {
|
|
3070
|
-
const [t, r] = b(e), i =
|
|
3070
|
+
const [t, r] = b(e), i = O(null), n = B(() => {
|
|
3071
3071
|
i.current && clearTimeout(i.current), r(!0), i.current = window.setTimeout(() => {
|
|
3072
3072
|
r(!1);
|
|
3073
3073
|
}, a);
|
|
3074
3074
|
}, [a]);
|
|
3075
|
-
return
|
|
3075
|
+
return x(() => {
|
|
3076
3076
|
const o = Rr(() => {
|
|
3077
3077
|
n();
|
|
3078
3078
|
}, 100), l = () => {
|
|
@@ -3089,7 +3089,7 @@ function Ir({
|
|
|
3089
3089
|
enabled: t = !0,
|
|
3090
3090
|
onShowShortcuts: r
|
|
3091
3091
|
}) {
|
|
3092
|
-
|
|
3092
|
+
x(() => {
|
|
3093
3093
|
if (!a || !t) return;
|
|
3094
3094
|
const i = (n) => {
|
|
3095
3095
|
const o = n.target;
|
|
@@ -3103,16 +3103,16 @@ function Ir({
|
|
|
3103
3103
|
break;
|
|
3104
3104
|
case "ArrowLeft":
|
|
3105
3105
|
n.preventDefault();
|
|
3106
|
-
const
|
|
3107
|
-
a.seekTo(
|
|
3106
|
+
const c = Math.max(0, l.currentTime - e);
|
|
3107
|
+
a.seekTo(c);
|
|
3108
3108
|
break;
|
|
3109
3109
|
case "ArrowRight":
|
|
3110
3110
|
n.preventDefault();
|
|
3111
|
-
const
|
|
3111
|
+
const d = Math.min(
|
|
3112
3112
|
l.duration,
|
|
3113
3113
|
l.currentTime + e
|
|
3114
3114
|
);
|
|
3115
|
-
a.seekTo(
|
|
3115
|
+
a.seekTo(d);
|
|
3116
3116
|
break;
|
|
3117
3117
|
case "ArrowUp":
|
|
3118
3118
|
n.preventDefault();
|
|
@@ -3155,10 +3155,10 @@ class _r {
|
|
|
3155
3155
|
try {
|
|
3156
3156
|
const n = await this.fetchVAST(e), o = this.parseXML(n), l = o.querySelector("Wrapper");
|
|
3157
3157
|
if (l) {
|
|
3158
|
-
const
|
|
3159
|
-
if (!
|
|
3158
|
+
const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3159
|
+
if (!c)
|
|
3160
3160
|
throw new Error("Wrapper missing VASTAdTagURI");
|
|
3161
|
-
return this.parse(
|
|
3161
|
+
return this.parse(c, t + 1, r);
|
|
3162
3162
|
}
|
|
3163
3163
|
return this.parseInline(o);
|
|
3164
3164
|
} catch (n) {
|
|
@@ -3218,14 +3218,14 @@ class _r {
|
|
|
3218
3218
|
try {
|
|
3219
3219
|
const l = o.querySelector("Wrapper");
|
|
3220
3220
|
if (l) {
|
|
3221
|
-
const
|
|
3222
|
-
if (
|
|
3223
|
-
const
|
|
3224
|
-
n.push(
|
|
3221
|
+
const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3222
|
+
if (c) {
|
|
3223
|
+
const d = await this.parse(c, 1);
|
|
3224
|
+
n.push(d);
|
|
3225
3225
|
}
|
|
3226
3226
|
} else {
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3227
|
+
const c = this.parseAdElement(o, r);
|
|
3228
|
+
c && n.push(c);
|
|
3229
3229
|
}
|
|
3230
3230
|
} catch (l) {
|
|
3231
3231
|
console.warn("[VASTParser] Failed to parse Ad in pod, skipping:", l);
|
|
@@ -3251,21 +3251,21 @@ class _r {
|
|
|
3251
3251
|
parseAdElement(e, t) {
|
|
3252
3252
|
const r = e.getAttribute("sequence"), i = r !== null ? parseInt(r, 10) : void 0, n = e.querySelector("InLine") ?? e.querySelector("Inline") ?? e.querySelector("inline") ?? t.querySelector("InLine") ?? t.querySelector("Inline");
|
|
3253
3253
|
if (!n) {
|
|
3254
|
-
const
|
|
3255
|
-
throw
|
|
3254
|
+
const T = Array.from(e.children).map((E) => E.tagName);
|
|
3255
|
+
throw T.length === 0 ? new Error("VAST Ad element is empty (no ads available)") : new Error(`VAST InLine not found. Found: ${T.join(", ")}`);
|
|
3256
3256
|
}
|
|
3257
|
-
const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(),
|
|
3257
|
+
const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(), c = n.querySelector("Duration")?.textContent?.trim(), d = this.parseDuration(c || "00:00:00"), { mediaFile: h, isVpaid: p, vpaidUrl: g } = this.getMediaFileInfo(n);
|
|
3258
3258
|
if (!h) throw new Error("VAST MediaFile not found");
|
|
3259
|
-
const m = n.querySelector("ClickThrough")?.textContent?.trim(),
|
|
3259
|
+
const m = n.querySelector("ClickThrough")?.textContent?.trim(), k = this.parseTrackingEvents(n, t), I = this.getErrorUrls(t), A = this.parseCompanions(n);
|
|
3260
3260
|
return {
|
|
3261
3261
|
id: o,
|
|
3262
3262
|
title: l,
|
|
3263
|
-
duration:
|
|
3263
|
+
duration: d,
|
|
3264
3264
|
mediaFile: h,
|
|
3265
3265
|
clickThrough: m,
|
|
3266
|
-
trackingEvents:
|
|
3267
|
-
errorUrls:
|
|
3268
|
-
companions:
|
|
3266
|
+
trackingEvents: k,
|
|
3267
|
+
errorUrls: I,
|
|
3268
|
+
companions: A.length > 0 ? A : void 0,
|
|
3269
3269
|
isVpaid: p,
|
|
3270
3270
|
vpaidUrl: g,
|
|
3271
3271
|
podSequence: i
|
|
@@ -3275,10 +3275,10 @@ class _r {
|
|
|
3275
3275
|
parseCompanions(e) {
|
|
3276
3276
|
const t = [];
|
|
3277
3277
|
return e.querySelectorAll("CompanionAds > Companion").forEach((i) => {
|
|
3278
|
-
const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0,
|
|
3279
|
-
i.querySelectorAll('TrackingEvents > Tracking[event="creativeView"]').forEach((
|
|
3280
|
-
const y =
|
|
3281
|
-
y &&
|
|
3278
|
+
const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0, c = i.querySelector("StaticResource"), d = i.querySelector("HTMLResource"), h = i.querySelector("IFrameResource"), p = c?.textContent?.trim() ?? void 0, g = d?.textContent?.trim() ?? void 0, m = h?.textContent?.trim() ?? void 0, k = c?.getAttribute("creativeType") ?? void 0, I = i.querySelector("CompanionClickThrough")?.textContent?.trim() ?? void 0, A = i.querySelector("AltText")?.textContent?.trim() ?? void 0, T = [];
|
|
3279
|
+
i.querySelectorAll('TrackingEvents > Tracking[event="creativeView"]').forEach((E) => {
|
|
3280
|
+
const y = E.textContent?.trim();
|
|
3281
|
+
y && T.push(y);
|
|
3282
3282
|
}), (p || g || m) && t.push({
|
|
3283
3283
|
id: l,
|
|
3284
3284
|
width: n,
|
|
@@ -3286,10 +3286,10 @@ class _r {
|
|
|
3286
3286
|
staticResource: p,
|
|
3287
3287
|
htmlResource: g,
|
|
3288
3288
|
iFrameResource: m,
|
|
3289
|
-
type:
|
|
3290
|
-
clickThrough:
|
|
3291
|
-
altText:
|
|
3292
|
-
viewTrackingUrls:
|
|
3289
|
+
type: k,
|
|
3290
|
+
clickThrough: I,
|
|
3291
|
+
altText: A,
|
|
3292
|
+
viewTrackingUrls: T.length > 0 ? T : void 0
|
|
3293
3293
|
});
|
|
3294
3294
|
}), t;
|
|
3295
3295
|
}
|
|
@@ -3331,8 +3331,8 @@ class _r {
|
|
|
3331
3331
|
i.length > 0 && (r.impression = Array.from(i).map((o) => o.textContent?.trim()).filter(Boolean));
|
|
3332
3332
|
const n = ["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "skip", "pause", "resume"];
|
|
3333
3333
|
return e.querySelectorAll("Tracking").forEach((o) => {
|
|
3334
|
-
const l = o.getAttribute("event"),
|
|
3335
|
-
!l || !
|
|
3334
|
+
const l = o.getAttribute("event"), c = o.textContent?.trim();
|
|
3335
|
+
!l || !c || !n.includes(l) || (r[l] || (r[l] = []), r[l].push(c));
|
|
3336
3336
|
}), r;
|
|
3337
3337
|
}
|
|
3338
3338
|
/**
|
|
@@ -3358,12 +3358,12 @@ class Vr {
|
|
|
3358
3358
|
const t = await this.fetchVMAP(e), r = this.parseXML(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3359
3359
|
let n = r.querySelector("vmap\\:VMAP, VMAP");
|
|
3360
3360
|
if (!n) {
|
|
3361
|
-
const
|
|
3362
|
-
if (
|
|
3363
|
-
n =
|
|
3361
|
+
const c = r.getElementsByTagNameNS(i, "VMAP");
|
|
3362
|
+
if (c.length > 0)
|
|
3363
|
+
n = c[0];
|
|
3364
3364
|
else {
|
|
3365
|
-
const
|
|
3366
|
-
|
|
3365
|
+
const d = r.getElementsByTagName("VMAP");
|
|
3366
|
+
d.length > 0 && (n = d[0]);
|
|
3367
3367
|
}
|
|
3368
3368
|
}
|
|
3369
3369
|
if (!n)
|
|
@@ -3442,9 +3442,9 @@ class Vr {
|
|
|
3442
3442
|
const r = this.parseTimeOffset(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3443
3443
|
let n = e.querySelector("vmap\\:AdSource, AdSource");
|
|
3444
3444
|
if (!n) {
|
|
3445
|
-
const
|
|
3446
|
-
if (
|
|
3447
|
-
n =
|
|
3445
|
+
const d = e.getElementsByTagNameNS(i, "AdSource");
|
|
3446
|
+
if (d.length > 0)
|
|
3447
|
+
n = d[0];
|
|
3448
3448
|
else {
|
|
3449
3449
|
const h = e.getElementsByTagName("AdSource");
|
|
3450
3450
|
h.length > 0 && (n = h[0]);
|
|
@@ -3454,22 +3454,22 @@ class Vr {
|
|
|
3454
3454
|
return console.warn("[VMAPParser] AdBreak missing AdSource, skipping"), null;
|
|
3455
3455
|
let o = n.querySelector("vmap\\:AdTagURI, AdTagURI");
|
|
3456
3456
|
if (!o) {
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3459
|
-
o =
|
|
3457
|
+
const d = n.getElementsByTagNameNS(i, "AdTagURI");
|
|
3458
|
+
if (d.length > 0)
|
|
3459
|
+
o = d[0];
|
|
3460
3460
|
else {
|
|
3461
3461
|
const h = n.getElementsByTagName("AdTagURI");
|
|
3462
3462
|
h.length > 0 && (o = h[0]);
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
3465
3465
|
if (!o)
|
|
3466
|
-
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((
|
|
3466
|
+
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((d) => d.tagName)), null;
|
|
3467
3467
|
let l = o.textContent?.trim() || o.innerHTML?.trim();
|
|
3468
3468
|
if (!l)
|
|
3469
3469
|
return console.warn("[VMAPParser] AdTagURI is empty, skipping"), null;
|
|
3470
3470
|
l = l.replace(/<!\\[CDATA\\[(.*?)\\]\\]>/g, "$1").trim();
|
|
3471
|
-
const
|
|
3472
|
-
return
|
|
3471
|
+
const c = document.createElement("textarea");
|
|
3472
|
+
return c.innerHTML = l, l = c.value, console.log("[VMAPParser] AdBreak parsed:", {
|
|
3473
3473
|
timeOffset: r,
|
|
3474
3474
|
timeOffsetStr: t,
|
|
3475
3475
|
vastUrl: l.substring(0, 100) + (l.length > 100 ? "..." : "")
|
|
@@ -3694,20 +3694,20 @@ class $r {
|
|
|
3694
3694
|
window.getVPAIDAd = function() { return typeof window.VPAIDCreative !== 'undefined' ? new window.VPAIDCreative() : null; };
|
|
3695
3695
|
<\/script>
|
|
3696
3696
|
</body></html>`), l.close(), this.vpaidIframe.onload = () => {
|
|
3697
|
-
const
|
|
3698
|
-
if (!
|
|
3697
|
+
const d = this.vpaidIframe?.contentWindow?.getVPAIDAd?.() ?? null;
|
|
3698
|
+
if (!d) {
|
|
3699
3699
|
console.warn("[AdPlayer] VPAID creative not found in iframe, skipping"), this.hideLoadingCallback && this.hideLoadingCallback(), t();
|
|
3700
3700
|
return;
|
|
3701
3701
|
}
|
|
3702
|
-
this.vpaidCreative =
|
|
3702
|
+
this.vpaidCreative = d, d.handshakeVersion("2.0"), d.subscribe(t, "AdStopped"), d.subscribe(t, "AdVideoComplete"), d.subscribe(t, "AdSkipped"), d.subscribe(() => {
|
|
3703
3703
|
this.hideLoadingCallback && this.hideLoadingCallback(), this.tracker.trackStart(e);
|
|
3704
|
-
}, "AdStarted"),
|
|
3704
|
+
}, "AdStarted"), d.subscribe(() => {
|
|
3705
3705
|
r(new Error("VPAID AdError"));
|
|
3706
|
-
}, "AdError"),
|
|
3706
|
+
}, "AdError"), d.initAd(n, o, "normal", -1, { AdParameters: "" }, {
|
|
3707
3707
|
slot: i,
|
|
3708
3708
|
videoSlot: this.adVideo,
|
|
3709
3709
|
videoSlotCanAutoPlay: !0
|
|
3710
|
-
}),
|
|
3710
|
+
}), d.startAd();
|
|
3711
3711
|
};
|
|
3712
3712
|
});
|
|
3713
3713
|
}
|
|
@@ -3796,12 +3796,12 @@ class $r {
|
|
|
3796
3796
|
const i = this.adVideo;
|
|
3797
3797
|
let n = !1;
|
|
3798
3798
|
const o = () => {
|
|
3799
|
-
i.play().catch((
|
|
3800
|
-
n || (m(), r(
|
|
3799
|
+
i.play().catch((k) => {
|
|
3800
|
+
n || (m(), r(k));
|
|
3801
3801
|
});
|
|
3802
|
-
}, l = () => this.tracker.trackStart(e),
|
|
3802
|
+
}, l = () => this.tracker.trackStart(e), c = () => {
|
|
3803
3803
|
console.log("[AdPlayer] Ad video playing, hiding loading..."), this.hideLoadingCallback && this.hideLoadingCallback();
|
|
3804
|
-
},
|
|
3804
|
+
}, d = () => this.updateUI(e), h = () => {
|
|
3805
3805
|
n || (m(), t());
|
|
3806
3806
|
};
|
|
3807
3807
|
let p = !1;
|
|
@@ -3811,22 +3811,22 @@ class $r {
|
|
|
3811
3811
|
t();
|
|
3812
3812
|
return;
|
|
3813
3813
|
}
|
|
3814
|
-
const
|
|
3815
|
-
if (
|
|
3814
|
+
const k = i.error?.code;
|
|
3815
|
+
if (k === 4) {
|
|
3816
3816
|
m(), t();
|
|
3817
3817
|
return;
|
|
3818
3818
|
}
|
|
3819
|
-
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${
|
|
3819
|
+
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${k})`));
|
|
3820
3820
|
}, m = () => {
|
|
3821
3821
|
if (!n) {
|
|
3822
3822
|
n = !0;
|
|
3823
3823
|
try {
|
|
3824
|
-
i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing",
|
|
3824
|
+
i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing", c), i.removeEventListener("timeupdate", d), i.removeEventListener("ended", h), i.removeEventListener("error", g), i.pause(), i.parentNode && i.parentNode.removeChild(i);
|
|
3825
3825
|
} catch {
|
|
3826
3826
|
}
|
|
3827
3827
|
}
|
|
3828
3828
|
};
|
|
3829
|
-
i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing",
|
|
3829
|
+
i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing", c), i.addEventListener("timeupdate", d), i.addEventListener("ended", h), i.addEventListener("error", g), i.src = e.mediaFile, i.load(), setTimeout(() => {
|
|
3830
3830
|
this.state.isPlaying && this.state.currentTime === 0 && !n && (m(), r(new Error("Ad video timeout")));
|
|
3831
3831
|
}, this.config.timeout || 1e4);
|
|
3832
3832
|
});
|
|
@@ -4212,11 +4212,11 @@ function ut() {
|
|
|
4212
4212
|
return re(dt);
|
|
4213
4213
|
}
|
|
4214
4214
|
function Ur({ videoElement: a }) {
|
|
4215
|
-
const { style: e } = ut(), [t, r] = b([]), i =
|
|
4216
|
-
return
|
|
4215
|
+
const { style: e } = ut(), [t, r] = b([]), i = O(""), n = O(0);
|
|
4216
|
+
return x(() => {
|
|
4217
4217
|
if (!a) return;
|
|
4218
4218
|
const o = () => {
|
|
4219
|
-
const l = a.textTracks,
|
|
4219
|
+
const l = a.textTracks, c = [];
|
|
4220
4220
|
for (let h = 0; h < l.length; h++) {
|
|
4221
4221
|
const p = l[h];
|
|
4222
4222
|
if (p.kind !== "subtitles" && p.kind !== "captions" || p.mode === "disabled") continue;
|
|
@@ -4224,12 +4224,12 @@ function Ur({ videoElement: a }) {
|
|
|
4224
4224
|
const g = p.activeCues;
|
|
4225
4225
|
if (g)
|
|
4226
4226
|
for (let m = 0; m < g.length; m++) {
|
|
4227
|
-
const
|
|
4228
|
-
|
|
4227
|
+
const k = g[m];
|
|
4228
|
+
k.text && c.push(k.text);
|
|
4229
4229
|
}
|
|
4230
4230
|
}
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4231
|
+
const d = c.join("\0");
|
|
4232
|
+
d !== i.current && (i.current = d, r(c)), n.current = requestAnimationFrame(o);
|
|
4233
4233
|
};
|
|
4234
4234
|
return n.current = requestAnimationFrame(o), () => {
|
|
4235
4235
|
cancelAnimationFrame(n.current);
|
|
@@ -4284,27 +4284,27 @@ function Ei({
|
|
|
4284
4284
|
className: n,
|
|
4285
4285
|
children: o,
|
|
4286
4286
|
config: l,
|
|
4287
|
-
onAdLoading:
|
|
4288
|
-
onNextEpisode:
|
|
4287
|
+
onAdLoading: c,
|
|
4288
|
+
onNextEpisode: d,
|
|
4289
4289
|
nextEpisodeTitle: h,
|
|
4290
4290
|
nextEpisodeThumbnail: p,
|
|
4291
4291
|
endCardCountdown: g = 5,
|
|
4292
4292
|
crossOrigin: m
|
|
4293
4293
|
}) {
|
|
4294
|
-
const
|
|
4295
|
-
player:
|
|
4294
|
+
const k = O(null), I = O(null), [A, T] = b(null), E = O(null), [y, G] = b(!1), [X, D] = b(!1), S = B(() => D(!0), []), _ = B(() => D(!1), []), [W, w] = b(!1), { onTouchStart: M, onTouchMove: N, onTouchEnd: H, gestureHint: Q } = Lr({
|
|
4295
|
+
player: A,
|
|
4296
4296
|
skipSec: 10
|
|
4297
|
-
}), { isActive:
|
|
4297
|
+
}), { isActive: L } = Dr({
|
|
4298
4298
|
timeout: 3e3,
|
|
4299
4299
|
initialVisible: !0
|
|
4300
4300
|
});
|
|
4301
4301
|
Ir({
|
|
4302
|
-
player:
|
|
4302
|
+
player: A,
|
|
4303
4303
|
seekStep: 10,
|
|
4304
4304
|
enabled: !0,
|
|
4305
|
-
onShowShortcuts:
|
|
4305
|
+
onShowShortcuts: S
|
|
4306
4306
|
});
|
|
4307
|
-
const
|
|
4307
|
+
const $ = Ue(() => !l?.ads?.enabled || !l.ads.vastUrl && !l.ads.vmapUrl ? null : {
|
|
4308
4308
|
enabled: !0,
|
|
4309
4309
|
vastUrl: l.ads.vastUrl,
|
|
4310
4310
|
vmapUrl: l.ads.vmapUrl,
|
|
@@ -4319,56 +4319,56 @@ function Ei({
|
|
|
4319
4319
|
l?.ads?.timeout,
|
|
4320
4320
|
l?.ads?.maxWrapperDepth
|
|
4321
4321
|
]);
|
|
4322
|
-
|
|
4323
|
-
if (!
|
|
4322
|
+
x(() => {
|
|
4323
|
+
if (!I.current || !k.current) return;
|
|
4324
4324
|
console.log("[Player] Initializing PlayerCore");
|
|
4325
|
-
const
|
|
4326
|
-
return fe.preloadEngines(),
|
|
4327
|
-
console.log("[Player] Cleanup called - destroying PlayerCore"),
|
|
4325
|
+
const F = new fe(I.current);
|
|
4326
|
+
return fe.preloadEngines(), F.container = k.current, T(F), () => {
|
|
4327
|
+
console.log("[Player] Cleanup called - destroying PlayerCore"), E.current && (console.log("[Player] Destroying AdManager"), E.current.destroy(), E.current = null), F.destroy(), T(null);
|
|
4328
4328
|
};
|
|
4329
|
-
}, []),
|
|
4330
|
-
if (!
|
|
4329
|
+
}, []), x(() => {
|
|
4330
|
+
if (!A || !$) return;
|
|
4331
4331
|
console.log("[Player] Setting up ads");
|
|
4332
|
-
const
|
|
4333
|
-
G(J),
|
|
4334
|
-
}, Z = new Br(
|
|
4335
|
-
return
|
|
4332
|
+
const F = (J) => {
|
|
4333
|
+
G(J), c?.(J);
|
|
4334
|
+
}, Z = new Br(A, $, F);
|
|
4335
|
+
return E.current = Z, Z.setup().catch((J) => {
|
|
4336
4336
|
console.error("[Player] Failed to setup ads:", J);
|
|
4337
4337
|
}), () => {
|
|
4338
|
-
|
|
4338
|
+
E.current && (console.log("[Player] Cleaning up ads"), E.current.destroy(), E.current = null);
|
|
4339
4339
|
};
|
|
4340
|
-
}, [
|
|
4341
|
-
!
|
|
4342
|
-
}, [
|
|
4343
|
-
const
|
|
4344
|
-
return
|
|
4345
|
-
!
|
|
4346
|
-
}, [
|
|
4347
|
-
|
|
4348
|
-
console.error("[Player] setSource failed:",
|
|
4340
|
+
}, [A, $]), x(() => {
|
|
4341
|
+
!A || !l || A.setConfig(l);
|
|
4342
|
+
}, [A, l]);
|
|
4343
|
+
const P = Ue(() => l?.drm ?? null, [l?.drm]);
|
|
4344
|
+
return x(() => {
|
|
4345
|
+
!A || !P?.enabled || A.setupDrm(P);
|
|
4346
|
+
}, [A, P]), x(() => {
|
|
4347
|
+
A && a && (console.log("[Player] Setting source:", a), A.setSource(a).catch((F) => {
|
|
4348
|
+
console.error("[Player] setSource failed:", F);
|
|
4349
4349
|
}));
|
|
4350
|
-
}, [
|
|
4351
|
-
if (!
|
|
4352
|
-
const
|
|
4353
|
-
if (!
|
|
4350
|
+
}, [A, a]), x(() => {
|
|
4351
|
+
if (!A || !d) return;
|
|
4352
|
+
const F = A.getVideoElement();
|
|
4353
|
+
if (!F) return;
|
|
4354
4354
|
const Z = () => w(!0);
|
|
4355
|
-
return
|
|
4356
|
-
}, [
|
|
4355
|
+
return F.addEventListener("ended", Z), () => F.removeEventListener("ended", Z);
|
|
4356
|
+
}, [A, d]), /* @__PURE__ */ u(Fr, { children: [
|
|
4357
4357
|
/* @__PURE__ */ u(
|
|
4358
4358
|
"div",
|
|
4359
4359
|
{
|
|
4360
|
-
ref:
|
|
4360
|
+
ref: k,
|
|
4361
4361
|
role: "region",
|
|
4362
4362
|
"aria-label": "Video Player",
|
|
4363
4363
|
className: `playron-wrapper ${n || ""}`,
|
|
4364
|
-
onTouchStart:
|
|
4365
|
-
onTouchMove:
|
|
4366
|
-
onTouchEnd:
|
|
4364
|
+
onTouchStart: M,
|
|
4365
|
+
onTouchMove: N,
|
|
4366
|
+
onTouchEnd: H,
|
|
4367
4367
|
style: {
|
|
4368
4368
|
position: "relative",
|
|
4369
4369
|
backgroundColor: "#000",
|
|
4370
4370
|
overflow: "hidden",
|
|
4371
|
-
cursor:
|
|
4371
|
+
cursor: L ? "default" : "none"
|
|
4372
4372
|
},
|
|
4373
4373
|
children: [
|
|
4374
4374
|
/* @__PURE__ */ s(
|
|
@@ -4392,7 +4392,7 @@ function Ei({
|
|
|
4392
4392
|
/* @__PURE__ */ s(
|
|
4393
4393
|
"video",
|
|
4394
4394
|
{
|
|
4395
|
-
ref:
|
|
4395
|
+
ref: I,
|
|
4396
4396
|
className: `virtus-video-element ${n || ""}`,
|
|
4397
4397
|
style: {
|
|
4398
4398
|
width: "100%",
|
|
@@ -4411,18 +4411,18 @@ function Ei({
|
|
|
4411
4411
|
tabIndex: e ? 0 : -1
|
|
4412
4412
|
}
|
|
4413
4413
|
),
|
|
4414
|
-
|
|
4415
|
-
/* @__PURE__ */ s(Ur, { videoElement:
|
|
4414
|
+
A ? /* @__PURE__ */ s(Gt, { playerInstance: A, children: /* @__PURE__ */ u(He.Provider, { value: L, children: [
|
|
4415
|
+
/* @__PURE__ */ s(Ur, { videoElement: I.current }),
|
|
4416
4416
|
/* @__PURE__ */ s(nr, { config: l, isAdLoading: y }),
|
|
4417
4417
|
/* @__PURE__ */ s(Pr, { type: Q?.type ?? null, value: Q?.value ?? "" }),
|
|
4418
4418
|
/* @__PURE__ */ s(Ar, { drmConfig: l?.drm }),
|
|
4419
|
-
/* @__PURE__ */ s(Tr, { isOpen:
|
|
4420
|
-
|
|
4419
|
+
/* @__PURE__ */ s(Tr, { isOpen: X, onClose: _ }),
|
|
4420
|
+
d && /* @__PURE__ */ s(
|
|
4421
4421
|
Mr,
|
|
4422
4422
|
{
|
|
4423
|
-
isVisible:
|
|
4423
|
+
isVisible: W,
|
|
4424
4424
|
onNextEpisode: () => {
|
|
4425
|
-
w(!1),
|
|
4425
|
+
w(!1), d();
|
|
4426
4426
|
},
|
|
4427
4427
|
onDismiss: () => w(!1),
|
|
4428
4428
|
countdownSec: g,
|
|
@@ -4483,9 +4483,9 @@ function zr({
|
|
|
4483
4483
|
style: o,
|
|
4484
4484
|
...l
|
|
4485
4485
|
}) {
|
|
4486
|
-
const
|
|
4486
|
+
const c = Y((g) => g.isPlaying), { togglePlay: d } = q(), h = async (g) => {
|
|
4487
4487
|
try {
|
|
4488
|
-
await
|
|
4488
|
+
await d();
|
|
4489
4489
|
} catch (m) {
|
|
4490
4490
|
console.error("Play/Pause error:", m);
|
|
4491
4491
|
}
|
|
@@ -4495,14 +4495,14 @@ function zr({
|
|
|
4495
4495
|
"button",
|
|
4496
4496
|
{
|
|
4497
4497
|
className: `virtus-btn virtus-play-button ${Hr.playButton} ${a || ""}`,
|
|
4498
|
-
"aria-label":
|
|
4498
|
+
"aria-label": c ? "Pause" : "Play",
|
|
4499
4499
|
onClick: h,
|
|
4500
4500
|
style: {
|
|
4501
4501
|
...p !== void 0 ? { "--btn-hover-bg": p } : {},
|
|
4502
4502
|
...o
|
|
4503
4503
|
},
|
|
4504
4504
|
...l,
|
|
4505
|
-
children:
|
|
4505
|
+
children: c ? i ?? /* @__PURE__ */ s(
|
|
4506
4506
|
"svg",
|
|
4507
4507
|
{
|
|
4508
4508
|
"aria-hidden": "true",
|
|
@@ -4546,7 +4546,7 @@ const qr = "_controlButton_14cpd_3", be = {
|
|
|
4546
4546
|
controlButton: qr
|
|
4547
4547
|
};
|
|
4548
4548
|
function xi({ className: a, onClick: e, ...t }) {
|
|
4549
|
-
const r =
|
|
4549
|
+
const r = Y((o) => o.isMuted), { toggleMute: i } = q(), n = (o) => {
|
|
4550
4550
|
i(), e?.(o);
|
|
4551
4551
|
};
|
|
4552
4552
|
return /* @__PURE__ */ s(
|
|
@@ -4601,8 +4601,8 @@ function jr({
|
|
|
4601
4601
|
style: o,
|
|
4602
4602
|
...l
|
|
4603
4603
|
}) {
|
|
4604
|
-
const { toggleFullscreen:
|
|
4605
|
-
|
|
4604
|
+
const { toggleFullscreen: c } = q(), [d, h] = b(!1);
|
|
4605
|
+
x(() => {
|
|
4606
4606
|
const m = () => {
|
|
4607
4607
|
h(!!document.fullscreenElement);
|
|
4608
4608
|
};
|
|
@@ -4611,20 +4611,20 @@ function jr({
|
|
|
4611
4611
|
};
|
|
4612
4612
|
}, []);
|
|
4613
4613
|
const p = (m) => {
|
|
4614
|
-
|
|
4614
|
+
c(), e?.(m);
|
|
4615
4615
|
}, g = typeof r == "string" ? r : r === !1 ? "transparent" : void 0;
|
|
4616
4616
|
return /* @__PURE__ */ s(
|
|
4617
4617
|
"button",
|
|
4618
4618
|
{
|
|
4619
4619
|
className: `virtus-btn virtus-fullscreen-button ${be.controlButton} ${a || ""}`,
|
|
4620
|
-
"aria-label":
|
|
4620
|
+
"aria-label": d ? "Exit Fullscreen" : "Fullscreen",
|
|
4621
4621
|
onClick: p,
|
|
4622
4622
|
style: {
|
|
4623
4623
|
...g !== void 0 ? { "--btn-hover-bg": g } : {},
|
|
4624
4624
|
...o
|
|
4625
4625
|
},
|
|
4626
4626
|
...l,
|
|
4627
|
-
children:
|
|
4627
|
+
children: d ? n ?? /* @__PURE__ */ s(
|
|
4628
4628
|
"svg",
|
|
4629
4629
|
{
|
|
4630
4630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4654,7 +4654,7 @@ function jr({
|
|
|
4654
4654
|
}
|
|
4655
4655
|
function Kr({ className: a, onClick: e, ...t }) {
|
|
4656
4656
|
const { togglePip: r } = q(), [i, n] = b(!1);
|
|
4657
|
-
|
|
4657
|
+
x(() => {
|
|
4658
4658
|
const l = () => {
|
|
4659
4659
|
n(!!document.pictureInPictureElement);
|
|
4660
4660
|
};
|
|
@@ -4665,8 +4665,8 @@ function Kr({ className: a, onClick: e, ...t }) {
|
|
|
4665
4665
|
const o = async (l) => {
|
|
4666
4666
|
try {
|
|
4667
4667
|
await r();
|
|
4668
|
-
} catch (
|
|
4669
|
-
console.error("PiP toggle error:",
|
|
4668
|
+
} catch (c) {
|
|
4669
|
+
console.error("PiP toggle error:", c);
|
|
4670
4670
|
}
|
|
4671
4671
|
e?.(l);
|
|
4672
4672
|
};
|
|
@@ -4700,7 +4700,7 @@ function ki() {
|
|
|
4700
4700
|
const { toggleTheaterMode: a, isTheaterMode: e } = q(), [t, r] = b(e()), i = () => {
|
|
4701
4701
|
a(), r(!t);
|
|
4702
4702
|
};
|
|
4703
|
-
return
|
|
4703
|
+
return x(() => {
|
|
4704
4704
|
const n = (o) => {
|
|
4705
4705
|
r(o.detail.isTheaterMode);
|
|
4706
4706
|
};
|
|
@@ -4771,7 +4771,7 @@ function ki() {
|
|
|
4771
4771
|
);
|
|
4772
4772
|
}
|
|
4773
4773
|
function Yr(a, e, t = !0) {
|
|
4774
|
-
|
|
4774
|
+
x(() => {
|
|
4775
4775
|
if (!t) return;
|
|
4776
4776
|
const r = (n) => {
|
|
4777
4777
|
a.current && !a.current.contains(n.target) && e();
|
|
@@ -4793,7 +4793,7 @@ const Te = ce({
|
|
|
4793
4793
|
}
|
|
4794
4794
|
});
|
|
4795
4795
|
function ht({ children: a }) {
|
|
4796
|
-
const [e, t] = b(!1), r =
|
|
4796
|
+
const [e, t] = b(!1), r = O(null), i = () => t((c) => !c), n = () => t(!1), o = () => t(!0);
|
|
4797
4797
|
Yr(r, n, e);
|
|
4798
4798
|
const l = {
|
|
4799
4799
|
isOpen: e,
|
|
@@ -4998,15 +4998,15 @@ function We({
|
|
|
4998
4998
|
);
|
|
4999
4999
|
}
|
|
5000
5000
|
function Si() {
|
|
5001
|
-
const a = q(), e =
|
|
5002
|
-
|
|
5001
|
+
const a = q(), e = Y(), [t, r] = b(1), [i, n] = b(!1), o = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
5002
|
+
x(() => {
|
|
5003
5003
|
e?.playbackRate !== void 0 && r(e.playbackRate);
|
|
5004
5004
|
}, [e?.playbackRate]);
|
|
5005
|
-
const l = (
|
|
5006
|
-
a.setPlaybackRate(
|
|
5007
|
-
},
|
|
5008
|
-
const
|
|
5009
|
-
n(
|
|
5005
|
+
const l = (d) => {
|
|
5006
|
+
a.setPlaybackRate(d), r(d);
|
|
5007
|
+
}, c = () => {
|
|
5008
|
+
const d = !i;
|
|
5009
|
+
n(d), a.setLoop(d);
|
|
5010
5010
|
};
|
|
5011
5011
|
return /* @__PURE__ */ u(ht, { children: [
|
|
5012
5012
|
/* @__PURE__ */ s(pt, { children: /* @__PURE__ */ s(
|
|
@@ -5026,11 +5026,11 @@ function Si() {
|
|
|
5026
5026
|
cursor: "pointer",
|
|
5027
5027
|
transition: "all 0.2s ease"
|
|
5028
5028
|
},
|
|
5029
|
-
onMouseEnter: (
|
|
5030
|
-
|
|
5029
|
+
onMouseEnter: (d) => {
|
|
5030
|
+
d.currentTarget.style.background = "rgba(255, 255, 255, 0.2)", d.currentTarget.style.transform = "scale(1.05)";
|
|
5031
5031
|
},
|
|
5032
|
-
onMouseLeave: (
|
|
5033
|
-
|
|
5032
|
+
onMouseLeave: (d) => {
|
|
5033
|
+
d.currentTarget.style.background = "rgba(255, 255, 255, 0.1)", d.currentTarget.style.transform = "scale(1)";
|
|
5034
5034
|
},
|
|
5035
5035
|
children: /* @__PURE__ */ u(
|
|
5036
5036
|
"svg",
|
|
@@ -5052,20 +5052,20 @@ function Si() {
|
|
|
5052
5052
|
) }),
|
|
5053
5053
|
/* @__PURE__ */ u(gt, { title: "Settings", placement: "top-right", children: [
|
|
5054
5054
|
/* @__PURE__ */ s("div", { style: { padding: "8px 16px 4px", color: "rgba(255, 255, 255, 0.6)", fontSize: "12px", fontWeight: 600 }, children: "Playback Speed" }),
|
|
5055
|
-
o.map((
|
|
5055
|
+
o.map((d) => /* @__PURE__ */ u(
|
|
5056
5056
|
We,
|
|
5057
5057
|
{
|
|
5058
|
-
selected: t ===
|
|
5059
|
-
onClick: () => l(
|
|
5058
|
+
selected: t === d,
|
|
5059
|
+
onClick: () => l(d),
|
|
5060
5060
|
children: [
|
|
5061
|
-
|
|
5061
|
+
d,
|
|
5062
5062
|
"x"
|
|
5063
5063
|
]
|
|
5064
5064
|
},
|
|
5065
|
-
|
|
5065
|
+
d
|
|
5066
5066
|
)),
|
|
5067
5067
|
/* @__PURE__ */ s("div", { style: { height: "1px", background: "rgba(255, 255, 255, 0.1)", margin: "8px 0" } }),
|
|
5068
|
-
/* @__PURE__ */ u(We, { selected: i, onClick:
|
|
5068
|
+
/* @__PURE__ */ u(We, { selected: i, onClick: c, children: [
|
|
5069
5069
|
"Loop ",
|
|
5070
5070
|
i ? "On" : "Off"
|
|
5071
5071
|
] })
|
|
@@ -5083,7 +5083,7 @@ const Xr = "_timeDisplay_1wupc_3", Gr = "_currentTime_1wupc_16", Qr = "_separato
|
|
|
5083
5083
|
return e > 0 ? `${e}:${t.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${t}:${r.toString().padStart(2, "0")}`;
|
|
5084
5084
|
};
|
|
5085
5085
|
function Jr({ className: a, ...e }) {
|
|
5086
|
-
const { currentTime: t, duration: r, isLive: i } =
|
|
5086
|
+
const { currentTime: t, duration: r, isLive: i } = Y();
|
|
5087
5087
|
return i ? /* @__PURE__ */ s("div", { className: `virtus-time-display ${pe.timeDisplay} ${a || ""}`, ...e, children: /* @__PURE__ */ s(
|
|
5088
5088
|
"span",
|
|
5089
5089
|
{
|
|
@@ -5098,7 +5098,7 @@ function Jr({ className: a, ...e }) {
|
|
|
5098
5098
|
] });
|
|
5099
5099
|
}
|
|
5100
5100
|
function ei() {
|
|
5101
|
-
const { isLive: a, isAtLiveEdge: e } =
|
|
5101
|
+
const { isLive: a, isAtLiveEdge: e } = Y(), { seekToLiveEdge: t } = q();
|
|
5102
5102
|
return !a || e ? null : /* @__PURE__ */ u(
|
|
5103
5103
|
"button",
|
|
5104
5104
|
{
|
|
@@ -5147,7 +5147,7 @@ function ei() {
|
|
|
5147
5147
|
);
|
|
5148
5148
|
}
|
|
5149
5149
|
function ti() {
|
|
5150
|
-
const { isLive: a, isAtLiveEdge: e, liveLatency: t } =
|
|
5150
|
+
const { isLive: a, isAtLiveEdge: e, liveLatency: t } = Y();
|
|
5151
5151
|
if (!a || e || !t || t < 1) return null;
|
|
5152
5152
|
const r = Math.round(t);
|
|
5153
5153
|
return /* @__PURE__ */ u(
|
|
@@ -5174,22 +5174,22 @@ const ri = "_container_6dw0q_3", ii = "_skipButton_6dw0q_11", Fe = {
|
|
|
5174
5174
|
skipButton: ii
|
|
5175
5175
|
};
|
|
5176
5176
|
function Ai({ introOutro: a }) {
|
|
5177
|
-
const { currentTime: e } =
|
|
5178
|
-
|
|
5177
|
+
const { currentTime: e } = Y(), { seekTo: t } = q(), [r, i] = b(!1), [n, o] = b(!1);
|
|
5178
|
+
x(() => {
|
|
5179
5179
|
if (a) {
|
|
5180
5180
|
if (a.intro) {
|
|
5181
|
-
const
|
|
5182
|
-
i(
|
|
5181
|
+
const d = e >= a.intro.start && e < a.intro.end;
|
|
5182
|
+
i(d);
|
|
5183
5183
|
}
|
|
5184
5184
|
if (a.outro) {
|
|
5185
|
-
const
|
|
5186
|
-
o(
|
|
5185
|
+
const d = e >= a.outro.start && e < a.outro.end;
|
|
5186
|
+
o(d);
|
|
5187
5187
|
}
|
|
5188
5188
|
}
|
|
5189
5189
|
}, [e, a]);
|
|
5190
|
-
const l =
|
|
5190
|
+
const l = B(() => {
|
|
5191
5191
|
a?.intro && (t(a.intro.end), i(!1));
|
|
5192
|
-
}, [a, t]),
|
|
5192
|
+
}, [a, t]), c = B(() => {
|
|
5193
5193
|
a?.outro && (t(a.outro.end), o(!1));
|
|
5194
5194
|
}, [a, t]);
|
|
5195
5195
|
return !r && !n ? null : /* @__PURE__ */ u("div", { className: Fe.container, children: [
|
|
@@ -5206,7 +5206,7 @@ function Ai({ introOutro: a }) {
|
|
|
5206
5206
|
}
|
|
5207
5207
|
)
|
|
5208
5208
|
] }),
|
|
5209
|
-
n && /* @__PURE__ */ u("button", { onClick:
|
|
5209
|
+
n && /* @__PURE__ */ u("button", { onClick: c, className: Fe.skipButton, children: [
|
|
5210
5210
|
/* @__PURE__ */ s("span", { children: "Skip Outro" }),
|
|
5211
5211
|
/* @__PURE__ */ s(
|
|
5212
5212
|
"svg",
|
|
@@ -5253,7 +5253,7 @@ function ni({
|
|
|
5253
5253
|
showTooltip: r = !0,
|
|
5254
5254
|
onClick: i
|
|
5255
5255
|
}) {
|
|
5256
|
-
const [n, o] = b(!1), l = Qe[a.type] || Qe.event,
|
|
5256
|
+
const [n, o] = b(!1), l = Qe[a.type] || Qe.event, c = a.icon || l.icon, d = a.color || l.color, h = (p) => {
|
|
5257
5257
|
p.stopPropagation(), i && i(a.time);
|
|
5258
5258
|
};
|
|
5259
5259
|
return /* @__PURE__ */ u(
|
|
@@ -5283,7 +5283,7 @@ function ni({
|
|
|
5283
5283
|
display: "flex",
|
|
5284
5284
|
alignItems: "center",
|
|
5285
5285
|
justifyContent: "center",
|
|
5286
|
-
backgroundColor:
|
|
5286
|
+
backgroundColor: d,
|
|
5287
5287
|
border: "2px solid rgba(255, 255, 255, 0.9)",
|
|
5288
5288
|
boxShadow: n ? "0 4px 16px rgba(0, 0, 0, 0.4)" : "0 2px 8px rgba(0, 0, 0, 0.4)",
|
|
5289
5289
|
transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -5299,7 +5299,7 @@ function ni({
|
|
|
5299
5299
|
display: "inline-block",
|
|
5300
5300
|
transform: "translateY(-1px)"
|
|
5301
5301
|
},
|
|
5302
|
-
children:
|
|
5302
|
+
children: c
|
|
5303
5303
|
}
|
|
5304
5304
|
)
|
|
5305
5305
|
}
|
|
@@ -5375,16 +5375,16 @@ class si {
|
|
|
5375
5375
|
for (; n < i.length; ) {
|
|
5376
5376
|
const o = i[n].trim();
|
|
5377
5377
|
if (o.includes("-->")) {
|
|
5378
|
-
const [l,
|
|
5378
|
+
const [l, c] = o.split("-->").map((m) => m.trim()), d = this.parseTime(l), h = this.parseTime(c);
|
|
5379
5379
|
n++;
|
|
5380
5380
|
const p = [];
|
|
5381
5381
|
for (; n < i.length && i[n].trim() !== "" && !i[n].includes("-->"); )
|
|
5382
5382
|
p.push(i[n].trim()), n++;
|
|
5383
5383
|
const g = p.join(`
|
|
5384
5384
|
`).trim();
|
|
5385
|
-
if (g &&
|
|
5385
|
+
if (g && d >= 0 && h > d) {
|
|
5386
5386
|
const m = this.parseCueLine(g, t);
|
|
5387
|
-
m && r.push({ startTime:
|
|
5387
|
+
m && r.push({ startTime: d, endTime: h, ...m });
|
|
5388
5388
|
}
|
|
5389
5389
|
} else
|
|
5390
5390
|
n++;
|
|
@@ -5393,15 +5393,15 @@ class si {
|
|
|
5393
5393
|
}
|
|
5394
5394
|
parseCueLine(e, t) {
|
|
5395
5395
|
const r = e.lastIndexOf("#xywh=");
|
|
5396
|
-
let i, n = 0, o = 0, l = 0,
|
|
5396
|
+
let i, n = 0, o = 0, l = 0, c = 0;
|
|
5397
5397
|
if (r !== -1) {
|
|
5398
5398
|
i = e.slice(0, r);
|
|
5399
5399
|
const h = e.slice(r + 6).split(",").map(Number);
|
|
5400
|
-
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l,
|
|
5400
|
+
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l, c] = h);
|
|
5401
5401
|
} else
|
|
5402
5402
|
i = e;
|
|
5403
|
-
const
|
|
5404
|
-
return
|
|
5403
|
+
const d = this.resolveUrl(i.trim(), t);
|
|
5404
|
+
return d ? { url: d, x: n, y: o, w: l, h: c } : null;
|
|
5405
5405
|
}
|
|
5406
5406
|
resolveUrl(e, t) {
|
|
5407
5407
|
if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//"))
|
|
@@ -5427,75 +5427,75 @@ function ai({
|
|
|
5427
5427
|
thumbnailsVttUrl: n,
|
|
5428
5428
|
seekBarStyle: o
|
|
5429
5429
|
}) {
|
|
5430
|
-
const l = re(He),
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
}, [
|
|
5434
|
-
const Q =
|
|
5435
|
-
if (
|
|
5436
|
-
const { time: v, ts: R } =
|
|
5437
|
-
|
|
5430
|
+
const l = re(He), c = O(null), [d, h] = b(!1), [p, g] = b(null), [m, k] = b(null), [I, A] = b([]), T = O(null), { currentTime: E, duration: y, isLive: G, isPlaying: X, playbackRate: D } = Y(), { seekTo: S, getDVRRange: _, getBufferedRanges: W } = q(), [w, M] = b(E), N = O(null), H = O({ time: E, ts: performance.now() });
|
|
5431
|
+
x(() => {
|
|
5432
|
+
H.current = { time: E, ts: performance.now() }, M(E);
|
|
5433
|
+
}, [E]);
|
|
5434
|
+
const Q = B(() => {
|
|
5435
|
+
if (X) {
|
|
5436
|
+
const { time: v, ts: R } = H.current, V = D ?? 1, U = (performance.now() - R) / 1e3, ee = Math.min(y || 1 / 0, v + U * V);
|
|
5437
|
+
M(ee);
|
|
5438
5438
|
}
|
|
5439
|
-
|
|
5440
|
-
}, [
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
}), [Q]),
|
|
5439
|
+
N.current = requestAnimationFrame(Q);
|
|
5440
|
+
}, [X, D, y]);
|
|
5441
|
+
x(() => (N.current = requestAnimationFrame(Q), () => {
|
|
5442
|
+
N.current !== null && cancelAnimationFrame(N.current);
|
|
5443
|
+
}), [Q]), x(() => {
|
|
5444
5444
|
if (!n) return;
|
|
5445
5445
|
const v = new si();
|
|
5446
|
-
return
|
|
5447
|
-
v.destroy(),
|
|
5446
|
+
return T.current = v, v.load(n), () => {
|
|
5447
|
+
v.destroy(), T.current = null;
|
|
5448
5448
|
};
|
|
5449
|
-
}, [n]),
|
|
5449
|
+
}, [n]), x(() => {
|
|
5450
5450
|
const v = setInterval(() => {
|
|
5451
|
-
|
|
5451
|
+
A(W());
|
|
5452
5452
|
}, 500);
|
|
5453
5453
|
return () => clearInterval(v);
|
|
5454
|
-
}, [
|
|
5455
|
-
const
|
|
5454
|
+
}, [W]);
|
|
5455
|
+
const L = a === "live" || !!G, $ = L ? _() : null, P = $ !== null && $.end - $.start > 5, F = P ? $.end - $.start : 0, Z = P && F > 0 ? (w - $.start) / F * 100 : 0, J = L ? Math.min(100, Math.max(0, Z)) : y > 0 ? w / y * 100 : 0, we = o?.trackColor ?? "rgba(255, 255, 255, 0.3)", ae = o?.progressColor ?? (L ? "#ff2020" : "#6366f1"), de = o?.bufferedColor ?? "rgba(255, 255, 255, 0.25)", j = o?.handleColor ?? "#ffffff", Me = o?.height ?? 4, ue = o?.borderRadius ?? 2, me = o?.showHandle !== !1, Pe = o?.showTooltip !== !1, ye = o?.paddingX ?? 20, Le = o?.paddingY ?? 0, Re = o?.bottom ?? 64, le = (v) => {
|
|
5456
5456
|
if (!isFinite(v) || isNaN(v)) return "0:00";
|
|
5457
|
-
const R = Math.floor(v / 3600),
|
|
5458
|
-
return R > 0 ? `${R}:${
|
|
5457
|
+
const R = Math.floor(v / 3600), V = Math.floor(v % 3600 / 60), U = Math.floor(v % 60);
|
|
5458
|
+
return R > 0 ? `${R}:${V.toString().padStart(2, "0")}:${U.toString().padStart(2, "0")}` : `${V}:${U.toString().padStart(2, "0")}`;
|
|
5459
5459
|
}, ve = (v) => {
|
|
5460
|
-
if (!
|
|
5461
|
-
const R =
|
|
5462
|
-
return Math.max(0, Math.min(1,
|
|
5460
|
+
if (!c.current) return 0;
|
|
5461
|
+
const R = c.current.getBoundingClientRect(), V = (v.clientX - R.left) / R.width;
|
|
5462
|
+
return Math.max(0, Math.min(1, V));
|
|
5463
5463
|
}, Ee = (v) => {
|
|
5464
|
-
if (!(
|
|
5465
|
-
if (
|
|
5466
|
-
|
|
5464
|
+
if (!(L && !P)) {
|
|
5465
|
+
if (L && P) {
|
|
5466
|
+
S($.start + v * F);
|
|
5467
5467
|
return;
|
|
5468
5468
|
}
|
|
5469
|
-
y !== 0 &&
|
|
5469
|
+
y !== 0 && S(v * y);
|
|
5470
5470
|
}
|
|
5471
5471
|
}, De = (v) => {
|
|
5472
|
-
if (
|
|
5472
|
+
if (L && !P) return;
|
|
5473
5473
|
v.preventDefault(), h(!0);
|
|
5474
5474
|
const R = ve(v);
|
|
5475
5475
|
Ee(R);
|
|
5476
5476
|
}, Ie = (v) => {
|
|
5477
|
-
if (!
|
|
5477
|
+
if (!c.current) return;
|
|
5478
5478
|
const R = ve(v);
|
|
5479
|
-
if (g(R),
|
|
5480
|
-
const
|
|
5481
|
-
|
|
5479
|
+
if (g(R), T.current) {
|
|
5480
|
+
const V = P ? $.start + R * F : R * y;
|
|
5481
|
+
k(T.current.getThumbnailAt(V));
|
|
5482
5482
|
}
|
|
5483
5483
|
}, _e = () => {
|
|
5484
|
-
g(null),
|
|
5484
|
+
g(null), k(null);
|
|
5485
5485
|
};
|
|
5486
|
-
return
|
|
5487
|
-
if (!
|
|
5488
|
-
const v = (
|
|
5489
|
-
if (!
|
|
5490
|
-
const
|
|
5491
|
-
g(
|
|
5486
|
+
return x(() => {
|
|
5487
|
+
if (!d) return;
|
|
5488
|
+
const v = (V) => {
|
|
5489
|
+
if (!c.current) return;
|
|
5490
|
+
const U = ve(V);
|
|
5491
|
+
g(U), Ee(U);
|
|
5492
5492
|
}, R = () => {
|
|
5493
5493
|
h(!1);
|
|
5494
5494
|
};
|
|
5495
5495
|
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", R), () => {
|
|
5496
5496
|
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", R);
|
|
5497
5497
|
};
|
|
5498
|
-
}, [
|
|
5498
|
+
}, [d, y]), /* @__PURE__ */ u(
|
|
5499
5499
|
"div",
|
|
5500
5500
|
{
|
|
5501
5501
|
style: {
|
|
@@ -5511,7 +5511,7 @@ function ai({
|
|
|
5511
5511
|
pointerEvents: l ? "auto" : "none"
|
|
5512
5512
|
},
|
|
5513
5513
|
children: [
|
|
5514
|
-
|
|
5514
|
+
L && !P && /* @__PURE__ */ u(
|
|
5515
5515
|
"div",
|
|
5516
5516
|
{
|
|
5517
5517
|
style: {
|
|
@@ -5550,7 +5550,7 @@ function ai({
|
|
|
5550
5550
|
]
|
|
5551
5551
|
}
|
|
5552
5552
|
),
|
|
5553
|
-
|
|
5553
|
+
L && P && /* @__PURE__ */ u(
|
|
5554
5554
|
"div",
|
|
5555
5555
|
{
|
|
5556
5556
|
style: {
|
|
@@ -5596,42 +5596,42 @@ function ai({
|
|
|
5596
5596
|
/* @__PURE__ */ u(
|
|
5597
5597
|
"div",
|
|
5598
5598
|
{
|
|
5599
|
-
ref:
|
|
5600
|
-
role:
|
|
5601
|
-
tabIndex:
|
|
5602
|
-
"aria-label":
|
|
5603
|
-
"aria-valuemin":
|
|
5604
|
-
"aria-valuemax":
|
|
5605
|
-
"aria-valuenow":
|
|
5606
|
-
"aria-valuetext":
|
|
5607
|
-
"aria-disabled":
|
|
5599
|
+
ref: c,
|
|
5600
|
+
role: L && !P ? void 0 : "slider",
|
|
5601
|
+
tabIndex: L && !P ? void 0 : 0,
|
|
5602
|
+
"aria-label": L ? "DVR seek" : "Seek",
|
|
5603
|
+
"aria-valuemin": L && !P ? void 0 : P ? Math.floor($.start) : 0,
|
|
5604
|
+
"aria-valuemax": L && !P ? void 0 : P ? Math.floor($.end) : Math.floor(y) || 0,
|
|
5605
|
+
"aria-valuenow": L && !P ? void 0 : Math.floor(E),
|
|
5606
|
+
"aria-valuetext": L && !P ? "LIVE" : P ? `${le(E)} (DVR)` : `${le(E)} of ${le(y)}`,
|
|
5607
|
+
"aria-disabled": L && !P ? !0 : void 0,
|
|
5608
5608
|
onMouseDown: De,
|
|
5609
5609
|
onMouseMove: Ie,
|
|
5610
5610
|
onMouseLeave: _e,
|
|
5611
5611
|
onKeyDown: (v) => {
|
|
5612
|
-
if (
|
|
5613
|
-
const R = 5,
|
|
5612
|
+
if (L && !P) return;
|
|
5613
|
+
const R = 5, V = 30, U = P ? $.start : 0, ee = P ? $.end : y;
|
|
5614
5614
|
if (ee !== 0)
|
|
5615
5615
|
switch (v.key) {
|
|
5616
5616
|
case "ArrowLeft":
|
|
5617
5617
|
case "ArrowDown":
|
|
5618
|
-
v.preventDefault(),
|
|
5618
|
+
v.preventDefault(), S(Math.max(U, E - R));
|
|
5619
5619
|
break;
|
|
5620
5620
|
case "ArrowRight":
|
|
5621
5621
|
case "ArrowUp":
|
|
5622
|
-
v.preventDefault(),
|
|
5622
|
+
v.preventDefault(), S(Math.min(ee, E + R));
|
|
5623
5623
|
break;
|
|
5624
5624
|
case "PageDown":
|
|
5625
|
-
v.preventDefault(),
|
|
5625
|
+
v.preventDefault(), S(Math.max(U, E - V));
|
|
5626
5626
|
break;
|
|
5627
5627
|
case "PageUp":
|
|
5628
|
-
v.preventDefault(),
|
|
5628
|
+
v.preventDefault(), S(Math.min(ee, E + V));
|
|
5629
5629
|
break;
|
|
5630
5630
|
case "Home":
|
|
5631
|
-
v.preventDefault(),
|
|
5631
|
+
v.preventDefault(), S(U);
|
|
5632
5632
|
break;
|
|
5633
5633
|
case "End":
|
|
5634
|
-
v.preventDefault(),
|
|
5634
|
+
v.preventDefault(), S(ee);
|
|
5635
5635
|
break;
|
|
5636
5636
|
}
|
|
5637
5637
|
},
|
|
@@ -5640,7 +5640,7 @@ function ai({
|
|
|
5640
5640
|
height: "32px",
|
|
5641
5641
|
display: "flex",
|
|
5642
5642
|
alignItems: "center",
|
|
5643
|
-
cursor:
|
|
5643
|
+
cursor: L && !P ? "default" : "pointer",
|
|
5644
5644
|
position: "relative",
|
|
5645
5645
|
outline: "none"
|
|
5646
5646
|
},
|
|
@@ -5657,18 +5657,18 @@ function ai({
|
|
|
5657
5657
|
borderRadius: `${ue}px`
|
|
5658
5658
|
},
|
|
5659
5659
|
children: [
|
|
5660
|
-
!
|
|
5660
|
+
!L && I.map((v, R) => {
|
|
5661
5661
|
if (y <= 0) return null;
|
|
5662
|
-
const
|
|
5662
|
+
const V = v.start / y * 100, U = (v.end - v.start) / y * 100;
|
|
5663
5663
|
return /* @__PURE__ */ s(
|
|
5664
5664
|
"div",
|
|
5665
5665
|
{
|
|
5666
5666
|
style: {
|
|
5667
5667
|
position: "absolute",
|
|
5668
|
-
left: `${
|
|
5668
|
+
left: `${V}%`,
|
|
5669
5669
|
top: 0,
|
|
5670
5670
|
height: "100%",
|
|
5671
|
-
width: `${
|
|
5671
|
+
width: `${U}%`,
|
|
5672
5672
|
backgroundColor: de,
|
|
5673
5673
|
borderRadius: `${ue}px`,
|
|
5674
5674
|
pointerEvents: "none"
|
|
@@ -5692,7 +5692,7 @@ function ai({
|
|
|
5692
5692
|
}
|
|
5693
5693
|
}
|
|
5694
5694
|
),
|
|
5695
|
-
!
|
|
5695
|
+
!L && e.map((v) => {
|
|
5696
5696
|
const R = y > 0 ? v.startTime / y * 100 : 0;
|
|
5697
5697
|
return /* @__PURE__ */ s(
|
|
5698
5698
|
"div",
|
|
@@ -5712,21 +5712,21 @@ function ai({
|
|
|
5712
5712
|
v.id
|
|
5713
5713
|
);
|
|
5714
5714
|
}),
|
|
5715
|
-
r && !
|
|
5716
|
-
const
|
|
5717
|
-
return
|
|
5715
|
+
r && !L && y > 0 && t.map((v, R) => {
|
|
5716
|
+
const V = v.time / y * 100;
|
|
5717
|
+
return V < 0 || V > 100 ? null : /* @__PURE__ */ s(
|
|
5718
5718
|
ni,
|
|
5719
5719
|
{
|
|
5720
5720
|
event: v,
|
|
5721
|
-
position:
|
|
5721
|
+
position: V,
|
|
5722
5722
|
size: i,
|
|
5723
5723
|
showTooltip: !0,
|
|
5724
|
-
onClick: (
|
|
5724
|
+
onClick: (U) => S(U)
|
|
5725
5725
|
},
|
|
5726
5726
|
`timeline-${R}-${v.time}`
|
|
5727
5727
|
);
|
|
5728
5728
|
}),
|
|
5729
|
-
|
|
5729
|
+
P && /* @__PURE__ */ s(
|
|
5730
5730
|
"div",
|
|
5731
5731
|
{
|
|
5732
5732
|
style: {
|
|
@@ -5745,7 +5745,7 @@ function ai({
|
|
|
5745
5745
|
title: "Live edge"
|
|
5746
5746
|
}
|
|
5747
5747
|
),
|
|
5748
|
-
me && (!
|
|
5748
|
+
me && (!L || P) && p !== null && /* @__PURE__ */ s(
|
|
5749
5749
|
"div",
|
|
5750
5750
|
{
|
|
5751
5751
|
style: {
|
|
@@ -5755,7 +5755,7 @@ function ai({
|
|
|
5755
5755
|
transform: "translate(-50%, -50%)",
|
|
5756
5756
|
width: "14px",
|
|
5757
5757
|
height: "14px",
|
|
5758
|
-
backgroundColor:
|
|
5758
|
+
backgroundColor: j,
|
|
5759
5759
|
borderRadius: "50%",
|
|
5760
5760
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
5761
5761
|
pointerEvents: "none",
|
|
@@ -5763,7 +5763,7 @@ function ai({
|
|
|
5763
5763
|
}
|
|
5764
5764
|
}
|
|
5765
5765
|
),
|
|
5766
|
-
me && (!
|
|
5766
|
+
me && (!L || P) && /* @__PURE__ */ s(
|
|
5767
5767
|
"div",
|
|
5768
5768
|
{
|
|
5769
5769
|
style: {
|
|
@@ -5771,32 +5771,32 @@ function ai({
|
|
|
5771
5771
|
left: `${J}%`,
|
|
5772
5772
|
top: "50%",
|
|
5773
5773
|
transform: "translate(-50%, -50%)",
|
|
5774
|
-
width:
|
|
5775
|
-
height:
|
|
5776
|
-
backgroundColor:
|
|
5774
|
+
width: d ? "16px" : "14px",
|
|
5775
|
+
height: d ? "16px" : "14px",
|
|
5776
|
+
backgroundColor: j,
|
|
5777
5777
|
borderRadius: "50%",
|
|
5778
5778
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
5779
5779
|
pointerEvents: "none",
|
|
5780
5780
|
zIndex: 1e3,
|
|
5781
|
-
opacity:
|
|
5782
|
-
transition:
|
|
5781
|
+
opacity: d || p !== null ? 1 : 0,
|
|
5782
|
+
transition: d ? "none" : "all 0.15s ease"
|
|
5783
5783
|
}
|
|
5784
5784
|
}
|
|
5785
5785
|
)
|
|
5786
5786
|
]
|
|
5787
5787
|
}
|
|
5788
5788
|
),
|
|
5789
|
-
Pe && (!
|
|
5790
|
-
const v =
|
|
5789
|
+
Pe && (!L || P) && p !== null && (() => {
|
|
5790
|
+
const v = P ? $.start + p * F : p * y, R = c.current?.offsetWidth ?? 0, V = p * 100, U = p * R, ee = Ze / 2;
|
|
5791
5791
|
let he = "-50%";
|
|
5792
|
-
return
|
|
5792
|
+
return U < ee ? he = "0%" : R - U < ee && (he = "-100%"), m ? (
|
|
5793
5793
|
/* Thumbnail card */
|
|
5794
5794
|
/* @__PURE__ */ u(
|
|
5795
5795
|
"div",
|
|
5796
5796
|
{
|
|
5797
5797
|
style: {
|
|
5798
5798
|
position: "absolute",
|
|
5799
|
-
left: `${
|
|
5799
|
+
left: `${V}%`,
|
|
5800
5800
|
bottom: "24px",
|
|
5801
5801
|
transform: `translateX(${he})`,
|
|
5802
5802
|
pointerEvents: "none",
|
|
@@ -5850,7 +5850,7 @@ function ai({
|
|
|
5850
5850
|
{
|
|
5851
5851
|
style: {
|
|
5852
5852
|
position: "absolute",
|
|
5853
|
-
left: `${
|
|
5853
|
+
left: `${V}%`,
|
|
5854
5854
|
bottom: "20px",
|
|
5855
5855
|
transform: `translateX(${he})`,
|
|
5856
5856
|
padding: "4px 8px",
|
|
@@ -5891,7 +5891,7 @@ function li({
|
|
|
5891
5891
|
hoverBackground: t,
|
|
5892
5892
|
icon: r
|
|
5893
5893
|
}) {
|
|
5894
|
-
const { skipBackward: i } = q(), { isLive: n } =
|
|
5894
|
+
const { skipBackward: i } = q(), { isLive: n } = Y();
|
|
5895
5895
|
if (n) return null;
|
|
5896
5896
|
const o = typeof t == "string" ? t : t === !1 ? "transparent" : void 0;
|
|
5897
5897
|
return /* @__PURE__ */ s(
|
|
@@ -5955,7 +5955,7 @@ function ci({
|
|
|
5955
5955
|
hoverBackground: t,
|
|
5956
5956
|
icon: r
|
|
5957
5957
|
}) {
|
|
5958
|
-
const { skipForward: i } = q(), { isLive: n } =
|
|
5958
|
+
const { skipForward: i } = q(), { isLive: n } = Y();
|
|
5959
5959
|
if (n) return null;
|
|
5960
5960
|
const o = typeof t == "string" ? t : t === !1 ? "transparent" : void 0;
|
|
5961
5961
|
return /* @__PURE__ */ s(
|
|
@@ -6023,25 +6023,25 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6023
6023
|
trackColor: e?.trackColor ?? "rgba(255,255,255,0.3)",
|
|
6024
6024
|
fillColor: e?.fillColor ?? "#3b82f6",
|
|
6025
6025
|
handleColor: e?.handleColor ?? "#fff"
|
|
6026
|
-
}, { isMuted: n, volume: o } =
|
|
6026
|
+
}, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume: c } = q(), [d, h] = b(!1), [p, g] = b(!1), m = O(null), k = a === "top" || a === "bottom", I = B((w, M) => {
|
|
6027
6027
|
if (!m.current) return;
|
|
6028
|
-
const
|
|
6029
|
-
|
|
6030
|
-
}, [
|
|
6031
|
-
g(!0), n && l(),
|
|
6032
|
-
}, [
|
|
6033
|
-
|
|
6028
|
+
const N = m.current.getBoundingClientRect(), H = k ? Math.max(0, Math.min(1, 1 - (M - N.top) / N.height)) : Math.max(0, Math.min(1, (w - N.left) / N.width));
|
|
6029
|
+
c(H);
|
|
6030
|
+
}, [c, k]), A = B((w) => {
|
|
6031
|
+
g(!0), n && l(), I(w.clientX, w.clientY);
|
|
6032
|
+
}, [I, n, l]);
|
|
6033
|
+
x(() => {
|
|
6034
6034
|
if (!p) return;
|
|
6035
|
-
const w = (
|
|
6036
|
-
return window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
|
6037
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
|
6035
|
+
const w = (N) => I(N.clientX, N.clientY), M = () => g(!1);
|
|
6036
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", M), () => {
|
|
6037
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", M);
|
|
6038
6038
|
};
|
|
6039
|
-
}, [p,
|
|
6040
|
-
const
|
|
6039
|
+
}, [p, I]);
|
|
6040
|
+
const T = p ? o : n ? 0 : o, E = d || p, y = {
|
|
6041
6041
|
position: "absolute",
|
|
6042
|
-
opacity:
|
|
6042
|
+
opacity: E ? 1 : 0,
|
|
6043
6043
|
transition: "all 0.25s ease",
|
|
6044
|
-
pointerEvents:
|
|
6044
|
+
pointerEvents: E ? "auto" : "none",
|
|
6045
6045
|
zIndex: 10,
|
|
6046
6046
|
background: i.sliderBackground,
|
|
6047
6047
|
backdropFilter: "blur(12px)",
|
|
@@ -6055,7 +6055,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6055
6055
|
...y,
|
|
6056
6056
|
right: "40px",
|
|
6057
6057
|
top: "0",
|
|
6058
|
-
width:
|
|
6058
|
+
width: E ? "118px" : "0px",
|
|
6059
6059
|
height: "40px",
|
|
6060
6060
|
paddingRight: "8px",
|
|
6061
6061
|
borderRadius: "8px 0 0 8px",
|
|
@@ -6068,7 +6068,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6068
6068
|
bottom: "40px",
|
|
6069
6069
|
left: "0",
|
|
6070
6070
|
width: "40px",
|
|
6071
|
-
height:
|
|
6071
|
+
height: E ? "118px" : "0px",
|
|
6072
6072
|
paddingBottom: "8px",
|
|
6073
6073
|
borderRadius: "8px 8px 0 0",
|
|
6074
6074
|
border: w,
|
|
@@ -6080,7 +6080,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6080
6080
|
top: "40px",
|
|
6081
6081
|
left: "0",
|
|
6082
6082
|
width: "40px",
|
|
6083
|
-
height:
|
|
6083
|
+
height: E ? "118px" : "0px",
|
|
6084
6084
|
paddingTop: "8px",
|
|
6085
6085
|
borderRadius: "0 0 8px 8px",
|
|
6086
6086
|
border: w,
|
|
@@ -6091,7 +6091,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6091
6091
|
...y,
|
|
6092
6092
|
left: "40px",
|
|
6093
6093
|
top: "0",
|
|
6094
|
-
width:
|
|
6094
|
+
width: E ? "118px" : "0px",
|
|
6095
6095
|
height: "40px",
|
|
6096
6096
|
paddingLeft: "8px",
|
|
6097
6097
|
borderRadius: "0 8px 8px 0",
|
|
@@ -6099,12 +6099,12 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6099
6099
|
borderLeft: "none"
|
|
6100
6100
|
};
|
|
6101
6101
|
}
|
|
6102
|
-
})(),
|
|
6102
|
+
})(), X = k ? { width: "40px", height: "110px", display: "flex", justifyContent: "center", alignItems: "center", cursor: "pointer", position: "relative", outline: "none" } : { width: "110px", height: "40px", display: "flex", alignItems: "center", cursor: "pointer", position: "relative", paddingRight: "8px", outline: "none" }, D = k ? { width: "4px", height: "100%", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" } : { width: "100%", height: "4px", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" }, S = k ? {
|
|
6103
6103
|
position: "absolute",
|
|
6104
6104
|
bottom: 0,
|
|
6105
6105
|
left: 0,
|
|
6106
6106
|
right: 0,
|
|
6107
|
-
height: `${
|
|
6107
|
+
height: `${T * 100}%`,
|
|
6108
6108
|
backgroundColor: i.fillColor,
|
|
6109
6109
|
borderRadius: "2px",
|
|
6110
6110
|
transition: p ? "none" : "height 0.1s ease"
|
|
@@ -6113,28 +6113,28 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6113
6113
|
left: 0,
|
|
6114
6114
|
top: 0,
|
|
6115
6115
|
bottom: 0,
|
|
6116
|
-
width: `${
|
|
6116
|
+
width: `${T * 100}%`,
|
|
6117
6117
|
backgroundColor: i.fillColor,
|
|
6118
6118
|
borderRadius: "2px",
|
|
6119
6119
|
transition: p ? "none" : "width 0.1s ease"
|
|
6120
|
-
},
|
|
6120
|
+
}, _ = p ? 14 : 12, W = k ? {
|
|
6121
6121
|
position: "absolute",
|
|
6122
|
-
bottom: `calc(${
|
|
6122
|
+
bottom: `calc(${T * 100}% - ${T * _}px)`,
|
|
6123
6123
|
left: "50%",
|
|
6124
6124
|
transform: "translateX(-50%)",
|
|
6125
|
-
width: `${
|
|
6126
|
-
height: `${
|
|
6125
|
+
width: `${_}px`,
|
|
6126
|
+
height: `${_}px`,
|
|
6127
6127
|
backgroundColor: i.handleColor,
|
|
6128
6128
|
borderRadius: "50%",
|
|
6129
6129
|
boxShadow: "0 2px 4px rgba(0,0,0,0.3)",
|
|
6130
6130
|
transition: p ? "none" : "all 0.2s ease"
|
|
6131
6131
|
} : {
|
|
6132
6132
|
position: "absolute",
|
|
6133
|
-
left: `calc(${
|
|
6133
|
+
left: `calc(${T * 100}% - ${T * _}px)`,
|
|
6134
6134
|
top: "50%",
|
|
6135
6135
|
transform: "translateY(-50%)",
|
|
6136
|
-
width: `${
|
|
6137
|
-
height: `${
|
|
6136
|
+
width: `${_}px`,
|
|
6137
|
+
height: `${_}px`,
|
|
6138
6138
|
backgroundColor: i.handleColor,
|
|
6139
6139
|
borderRadius: "50%",
|
|
6140
6140
|
boxShadow: "0 2px 4px rgba(0,0,0,0.3)",
|
|
@@ -6200,31 +6200,31 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6200
6200
|
"aria-label": "Volume",
|
|
6201
6201
|
"aria-valuemin": 0,
|
|
6202
6202
|
"aria-valuemax": 100,
|
|
6203
|
-
"aria-valuenow": Math.round(
|
|
6204
|
-
"aria-valuetext": n ? "Muted" : `${Math.round(
|
|
6205
|
-
onMouseDown:
|
|
6203
|
+
"aria-valuenow": Math.round(T * 100),
|
|
6204
|
+
"aria-valuetext": n ? "Muted" : `${Math.round(T * 100)}%`,
|
|
6205
|
+
onMouseDown: A,
|
|
6206
6206
|
onKeyDown: (w) => {
|
|
6207
|
-
const
|
|
6207
|
+
const H = n ? 0 : o;
|
|
6208
6208
|
switch (w.key) {
|
|
6209
6209
|
case "ArrowRight":
|
|
6210
6210
|
case "ArrowUp":
|
|
6211
|
-
w.preventDefault(),
|
|
6211
|
+
w.preventDefault(), c(Math.min(1, H + 0.05));
|
|
6212
6212
|
break;
|
|
6213
6213
|
case "ArrowLeft":
|
|
6214
6214
|
case "ArrowDown":
|
|
6215
|
-
w.preventDefault(),
|
|
6215
|
+
w.preventDefault(), c(Math.max(0, H - 0.05));
|
|
6216
6216
|
break;
|
|
6217
6217
|
case "PageUp":
|
|
6218
|
-
w.preventDefault(),
|
|
6218
|
+
w.preventDefault(), c(Math.min(1, H + 0.2));
|
|
6219
6219
|
break;
|
|
6220
6220
|
case "PageDown":
|
|
6221
|
-
w.preventDefault(),
|
|
6221
|
+
w.preventDefault(), c(Math.max(0, H - 0.2));
|
|
6222
6222
|
break;
|
|
6223
6223
|
case "Home":
|
|
6224
|
-
w.preventDefault(),
|
|
6224
|
+
w.preventDefault(), c(0);
|
|
6225
6225
|
break;
|
|
6226
6226
|
case "End":
|
|
6227
|
-
w.preventDefault(),
|
|
6227
|
+
w.preventDefault(), c(1);
|
|
6228
6228
|
break;
|
|
6229
6229
|
case "m":
|
|
6230
6230
|
case "M":
|
|
@@ -6232,10 +6232,10 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6232
6232
|
break;
|
|
6233
6233
|
}
|
|
6234
6234
|
},
|
|
6235
|
-
style:
|
|
6236
|
-
children: /* @__PURE__ */ u("div", { style:
|
|
6237
|
-
/* @__PURE__ */ s("div", { style:
|
|
6238
|
-
/* @__PURE__ */ s("div", { style:
|
|
6235
|
+
style: X,
|
|
6236
|
+
children: /* @__PURE__ */ u("div", { style: D, children: [
|
|
6237
|
+
/* @__PURE__ */ s("div", { style: S }),
|
|
6238
|
+
/* @__PURE__ */ s("div", { style: W })
|
|
6239
6239
|
] })
|
|
6240
6240
|
}
|
|
6241
6241
|
)
|
|
@@ -6247,7 +6247,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6247
6247
|
}
|
|
6248
6248
|
const ui = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
6249
6249
|
function Ci() {
|
|
6250
|
-
const { setPlaybackRate: a } = q(), [e, t] = b(1), r =
|
|
6250
|
+
const { setPlaybackRate: a } = q(), [e, t] = b(1), r = B(
|
|
6251
6251
|
(n) => {
|
|
6252
6252
|
a(n), t(n);
|
|
6253
6253
|
},
|
|
@@ -6376,16 +6376,16 @@ function et({ values: a, color: e, gradId: t }) {
|
|
|
6376
6376
|
const n = Math.max(...a, 1e-3), o = a.map((h, p) => [
|
|
6377
6377
|
p / (hi - 1) * 292,
|
|
6378
6378
|
48 - h / n * 42
|
|
6379
|
-
]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "),
|
|
6379
|
+
]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "), c = l + ` L${292 .toFixed(1)},52 L0,52 Z`, d = o[o.length - 1];
|
|
6380
6380
|
return /* @__PURE__ */ u("svg", { width: 292, height: 52, style: { display: "block", overflow: "visible" }, children: [
|
|
6381
6381
|
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ u("linearGradient", { id: t, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6382
6382
|
/* @__PURE__ */ s("stop", { offset: "0%", stopColor: e, stopOpacity: 0.4 }),
|
|
6383
6383
|
/* @__PURE__ */ s("stop", { offset: "100%", stopColor: e, stopOpacity: 0.02 })
|
|
6384
6384
|
] }) }),
|
|
6385
|
-
/* @__PURE__ */ s("path", { d, fill: `url(#${t})` }),
|
|
6385
|
+
/* @__PURE__ */ s("path", { d: c, fill: `url(#${t})` }),
|
|
6386
6386
|
/* @__PURE__ */ s("path", { d: l, fill: "none", stroke: e, strokeWidth: 1.8, strokeLinejoin: "round", strokeLinecap: "round" }),
|
|
6387
|
-
/* @__PURE__ */ s("circle", { cx:
|
|
6388
|
-
/* @__PURE__ */ s("circle", { cx:
|
|
6387
|
+
/* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 3.5, fill: e }),
|
|
6388
|
+
/* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 6, fill: e, fillOpacity: 0.25 })
|
|
6389
6389
|
] });
|
|
6390
6390
|
}
|
|
6391
6391
|
function z({
|
|
@@ -6396,7 +6396,7 @@ function z({
|
|
|
6396
6396
|
selected: i = !1,
|
|
6397
6397
|
isBack: n = !1
|
|
6398
6398
|
}) {
|
|
6399
|
-
const [o, l] = b(!1), { textColor:
|
|
6399
|
+
const [o, l] = b(!1), { textColor: c, accentColor: d, accentAlpha15: h, accentAlpha30: p, fontSize: g } = re(ze);
|
|
6400
6400
|
return /* @__PURE__ */ u(
|
|
6401
6401
|
"button",
|
|
6402
6402
|
{
|
|
@@ -6407,7 +6407,7 @@ function z({
|
|
|
6407
6407
|
onMouseLeave: () => l(!1),
|
|
6408
6408
|
style: {
|
|
6409
6409
|
...mi,
|
|
6410
|
-
color:
|
|
6410
|
+
color: c,
|
|
6411
6411
|
fontSize: g,
|
|
6412
6412
|
background: o ? "rgba(255,255,255,0.07)" : i ? h : "transparent",
|
|
6413
6413
|
fontWeight: i ? 600 : 400,
|
|
@@ -6424,9 +6424,9 @@ function z({
|
|
|
6424
6424
|
alignItems: "center",
|
|
6425
6425
|
justifyContent: "center",
|
|
6426
6426
|
flexShrink: 0,
|
|
6427
|
-
color: i ?
|
|
6427
|
+
color: i ? d : "rgba(255,255,255,0.65)",
|
|
6428
6428
|
transition: "background 0.15s, color 0.15s"
|
|
6429
|
-
}, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
6429
|
+
}, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: d, strokeWidth: "3", style: { flexShrink: 0 }, children: /* @__PURE__ */ s("polyline", { points: "20 6 9 17 4 12" }) }) : /* @__PURE__ */ s("span", { style: { display: "inline-block", width: "14px", flexShrink: 0 } }),
|
|
6430
6430
|
/* @__PURE__ */ s("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
|
|
6431
6431
|
] }),
|
|
6432
6432
|
e !== void 0 && /* @__PURE__ */ u("span", { style: { display: "flex", alignItems: "center", gap: "4px", flexShrink: 0 }, children: [
|
|
@@ -6448,71 +6448,71 @@ function yi({
|
|
|
6448
6448
|
hoverBackground: r,
|
|
6449
6449
|
gearIcon: i
|
|
6450
6450
|
} = {}) {
|
|
6451
|
-
const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)",
|
|
6451
|
+
const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)", c = a?.borderColor ?? "rgba(255,255,255,0.1)", d = a?.fontSize ?? "13.5px", h = {
|
|
6452
6452
|
textColor: o,
|
|
6453
6453
|
accentColor: n,
|
|
6454
6454
|
accentAlpha15: n.startsWith("#") ? Je(n, 0.15) : "rgba(99,102,241,0.15)",
|
|
6455
6455
|
accentAlpha30: n.startsWith("#") ? Je(n, 0.3) : "rgba(99,102,241,0.3)",
|
|
6456
|
-
borderColor:
|
|
6457
|
-
fontSize:
|
|
6456
|
+
borderColor: c.replace("0.1)", "0.07)"),
|
|
6457
|
+
fontSize: d
|
|
6458
6458
|
}, p = {
|
|
6459
6459
|
...fi,
|
|
6460
6460
|
color: o,
|
|
6461
|
-
fontSize:
|
|
6462
|
-
borderBottom: `1px solid ${
|
|
6461
|
+
fontSize: d,
|
|
6462
|
+
borderBottom: `1px solid ${c.replace("0.1)", "0.08)")}`
|
|
6463
6463
|
}, g = e?.vertical ?? "top", m = e?.horizontal ?? "right", {
|
|
6464
|
-
setQuality:
|
|
6465
|
-
setAudioTrack:
|
|
6466
|
-
setPlaybackRate:
|
|
6467
|
-
setSubtitleTrack:
|
|
6468
|
-
getPlayerStats:
|
|
6469
|
-
} = q(), y = Ce(), { playbackRate: G = 1, isLive:
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
}, [
|
|
6473
|
-
const [
|
|
6474
|
-
|
|
6464
|
+
setQuality: k,
|
|
6465
|
+
setAudioTrack: I,
|
|
6466
|
+
setPlaybackRate: A,
|
|
6467
|
+
setSubtitleTrack: T,
|
|
6468
|
+
getPlayerStats: E
|
|
6469
|
+
} = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle: S } = ut(), [_, W] = b(!1), [w, M] = b("root");
|
|
6470
|
+
x(() => {
|
|
6471
|
+
X && w === "speed" && M("root");
|
|
6472
|
+
}, [X, w]);
|
|
6473
|
+
const [N, H] = b([]), [Q, L] = b(null), [$, P] = b([]), [F, Z] = b(""), [J, we] = b([]), [ae, de] = b(null), [j, Me] = b(null), [ue, me] = b([]);
|
|
6474
|
+
x(() => {
|
|
6475
6475
|
const f = () => {
|
|
6476
|
-
|
|
6476
|
+
H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), we(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage());
|
|
6477
6477
|
};
|
|
6478
6478
|
y.events.on("tracksready", f), y.events.on("streamTypeDetected", f), y.events.on("qualitychange", f), y.events.on("loadedmetadata", f), f();
|
|
6479
|
-
const
|
|
6479
|
+
const K = setTimeout(f, 100);
|
|
6480
6480
|
return () => {
|
|
6481
|
-
y.events.off("tracksready", f), y.events.off("streamTypeDetected", f), y.events.off("qualitychange", f), y.events.off("loadedmetadata", f), clearTimeout(
|
|
6481
|
+
y.events.off("tracksready", f), y.events.off("streamTypeDetected", f), y.events.off("qualitychange", f), y.events.off("loadedmetadata", f), clearTimeout(K);
|
|
6482
6482
|
};
|
|
6483
|
-
}, [y]),
|
|
6484
|
-
|
|
6485
|
-
}, [
|
|
6486
|
-
const Pe =
|
|
6487
|
-
|
|
6483
|
+
}, [y]), x(() => {
|
|
6484
|
+
_ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), we(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage()));
|
|
6485
|
+
}, [_, y]);
|
|
6486
|
+
const Pe = $.length > 1;
|
|
6487
|
+
x(() => {
|
|
6488
6488
|
if (w !== "statistics") return;
|
|
6489
6489
|
const f = () => {
|
|
6490
|
-
const xe =
|
|
6490
|
+
const xe = E();
|
|
6491
6491
|
Me(xe), me((Ve) => [...Ve.slice(-59), xe]);
|
|
6492
6492
|
};
|
|
6493
6493
|
f();
|
|
6494
|
-
const
|
|
6494
|
+
const K = setInterval(f, 1e3);
|
|
6495
6495
|
return () => {
|
|
6496
|
-
clearInterval(
|
|
6496
|
+
clearInterval(K), me([]);
|
|
6497
6497
|
};
|
|
6498
|
-
}, [w,
|
|
6499
|
-
const ye =
|
|
6500
|
-
|
|
6501
|
-
if (!
|
|
6502
|
-
const f = (
|
|
6503
|
-
ye.current && !ye.current.contains(
|
|
6498
|
+
}, [w, E]);
|
|
6499
|
+
const ye = O(null);
|
|
6500
|
+
x(() => {
|
|
6501
|
+
if (!_) return;
|
|
6502
|
+
const f = (K) => {
|
|
6503
|
+
ye.current && !ye.current.contains(K.target) && (W(!1), M("root"));
|
|
6504
6504
|
};
|
|
6505
6505
|
return document.addEventListener("pointerdown", f), () => document.removeEventListener("pointerdown", f);
|
|
6506
|
-
}, [
|
|
6507
|
-
if (!
|
|
6508
|
-
const f = (
|
|
6509
|
-
|
|
6506
|
+
}, [_]), x(() => {
|
|
6507
|
+
if (!_) return;
|
|
6508
|
+
const f = (K) => {
|
|
6509
|
+
K.key === "Escape" && (W(!1), M("root")), K.key === "Backspace" && w !== "root" && M("root");
|
|
6510
6510
|
};
|
|
6511
6511
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
6512
|
-
}, [
|
|
6513
|
-
const Le =
|
|
6514
|
-
|
|
6515
|
-
}, []), Re = Q ? Q.id === "auto" ? "Auto" : Q.label : "Auto", le = G === 1 ? "1×" : `${G}×`, ve =
|
|
6512
|
+
}, [_, w]);
|
|
6513
|
+
const Le = B(() => {
|
|
6514
|
+
W((f) => (f && M("root"), !f));
|
|
6515
|
+
}, []), Re = Q ? Q.id === "auto" ? "Auto" : Q.label : "Auto", le = G === 1 ? "1×" : `${G}×`, ve = $.find((f) => f.id === F)?.label ?? "Auto", Ee = ae === null ? "Off" : J.find((f) => f.language === ae)?.label ?? ae, De = /* @__PURE__ */ u("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6516
6516
|
/* @__PURE__ */ s("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
6517
6517
|
/* @__PURE__ */ s("path", { d: "M8 21h8M12 17v4" }),
|
|
6518
6518
|
/* @__PURE__ */ s("path", { d: "m7 8 2 2 4-4 2 2" })
|
|
@@ -6531,11 +6531,11 @@ function yi({
|
|
|
6531
6531
|
/* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" }),
|
|
6532
6532
|
/* @__PURE__ */ s("path", { d: "M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3" }),
|
|
6533
6533
|
/* @__PURE__ */ s("polyline", { points: "16 16 12 20 8 16" })
|
|
6534
|
-
] }),
|
|
6534
|
+
] }), V = /* @__PURE__ */ u("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6535
6535
|
/* @__PURE__ */ s("line", { x1: "18", y1: "20", x2: "18", y2: "10" }),
|
|
6536
6536
|
/* @__PURE__ */ s("line", { x1: "12", y1: "20", x2: "12", y2: "4" }),
|
|
6537
6537
|
/* @__PURE__ */ s("line", { x1: "6", y1: "20", x2: "6", y2: "14" })
|
|
6538
|
-
] }),
|
|
6538
|
+
] }), U = () => /* @__PURE__ */ u(oe, { children: [
|
|
6539
6539
|
/* @__PURE__ */ u("div", { style: p, children: [
|
|
6540
6540
|
/* @__PURE__ */ u("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.6)", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
6541
6541
|
/* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" }),
|
|
@@ -6544,59 +6544,59 @@ function yi({
|
|
|
6544
6544
|
"Settings"
|
|
6545
6545
|
] }),
|
|
6546
6546
|
/* @__PURE__ */ u("div", { style: { padding: "4px 0" }, children: [
|
|
6547
|
-
/* @__PURE__ */ s(z, { icon: De, label: "Quality", value: Re, onClick: () =>
|
|
6548
|
-
!
|
|
6549
|
-
Pe && /* @__PURE__ */ s(z, { icon: _e, label: "Audio Track", value: ve, onClick: () =>
|
|
6547
|
+
/* @__PURE__ */ s(z, { icon: De, label: "Quality", value: Re, onClick: () => M("quality") }),
|
|
6548
|
+
!X && /* @__PURE__ */ s(z, { icon: Ie, label: "Speed", value: le, onClick: () => M("speed") }),
|
|
6549
|
+
Pe && /* @__PURE__ */ s(z, { icon: _e, label: "Audio Track", value: ve, onClick: () => M("audio") }),
|
|
6550
6550
|
/* @__PURE__ */ s(tt, {}),
|
|
6551
|
-
/* @__PURE__ */ s(z, { icon: v, label: "Subtitles", value: Ee, onClick: () =>
|
|
6552
|
-
/* @__PURE__ */ s(z, { icon: R, label: "Subtitle Style", value: `${
|
|
6551
|
+
/* @__PURE__ */ s(z, { icon: v, label: "Subtitles", value: Ee, onClick: () => M("subtitles") }),
|
|
6552
|
+
/* @__PURE__ */ s(z, { icon: R, label: "Subtitle Style", value: `${D.fontSize}px`, onClick: () => M("subtitleStyle") }),
|
|
6553
6553
|
/* @__PURE__ */ s(tt, {}),
|
|
6554
|
-
/* @__PURE__ */ s(z, { icon:
|
|
6554
|
+
/* @__PURE__ */ s(z, { icon: V, label: "Statistics", onClick: () => M("statistics") })
|
|
6555
6555
|
] })
|
|
6556
6556
|
] }), ee = () => /* @__PURE__ */ u(oe, { children: [
|
|
6557
|
-
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Quality", isBack: !0, onClick: () =>
|
|
6557
|
+
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Quality", isBack: !0, onClick: () => M("root") }) }),
|
|
6558
6558
|
/* @__PURE__ */ u("div", { style: { padding: "4px 0", maxHeight: "280px", overflowY: "auto" }, children: [
|
|
6559
|
-
|
|
6559
|
+
N.map((f) => /* @__PURE__ */ s(
|
|
6560
6560
|
z,
|
|
6561
6561
|
{
|
|
6562
6562
|
label: f.id === "auto" ? "Auto" : f.label,
|
|
6563
6563
|
selected: Q?.id === f.id,
|
|
6564
6564
|
onClick: () => {
|
|
6565
|
-
|
|
6565
|
+
k(f.id), L(f), W(!1), M("root");
|
|
6566
6566
|
}
|
|
6567
6567
|
},
|
|
6568
6568
|
f.id
|
|
6569
6569
|
)),
|
|
6570
|
-
|
|
6570
|
+
N.length === 0 && /* @__PURE__ */ s("div", { style: { padding: "10px 14px", color: "rgba(255,255,255,0.4)", fontSize: "13px" }, children: "No quality levels available" })
|
|
6571
6571
|
] })
|
|
6572
6572
|
] }), he = () => /* @__PURE__ */ u(oe, { children: [
|
|
6573
|
-
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Speed", isBack: !0, onClick: () =>
|
|
6573
|
+
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Speed", isBack: !0, onClick: () => M("root") }) }),
|
|
6574
6574
|
/* @__PURE__ */ s("div", { style: { padding: "4px 0" }, children: pi.map((f) => /* @__PURE__ */ s(
|
|
6575
6575
|
z,
|
|
6576
6576
|
{
|
|
6577
6577
|
label: f === 1 ? "1× (Normal)" : `${f}×`,
|
|
6578
6578
|
selected: G === f,
|
|
6579
6579
|
onClick: () => {
|
|
6580
|
-
|
|
6580
|
+
A(f), W(!1), M("root");
|
|
6581
6581
|
}
|
|
6582
6582
|
},
|
|
6583
6583
|
f
|
|
6584
6584
|
)) })
|
|
6585
6585
|
] }), ft = () => /* @__PURE__ */ u(oe, { children: [
|
|
6586
|
-
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Audio Track", isBack: !0, onClick: () =>
|
|
6587
|
-
/* @__PURE__ */ s("div", { style: { padding: "4px 0" }, children:
|
|
6586
|
+
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Audio Track", isBack: !0, onClick: () => M("root") }) }),
|
|
6587
|
+
/* @__PURE__ */ s("div", { style: { padding: "4px 0" }, children: $.map((f) => /* @__PURE__ */ s(
|
|
6588
6588
|
z,
|
|
6589
6589
|
{
|
|
6590
6590
|
label: f.label || f.language || f.id,
|
|
6591
|
-
selected:
|
|
6591
|
+
selected: F === f.id,
|
|
6592
6592
|
onClick: () => {
|
|
6593
|
-
|
|
6593
|
+
I(f.id), Z(f.id), W(!1), M("root");
|
|
6594
6594
|
}
|
|
6595
6595
|
},
|
|
6596
6596
|
f.id
|
|
6597
6597
|
)) })
|
|
6598
6598
|
] }), mt = () => /* @__PURE__ */ u(oe, { children: [
|
|
6599
|
-
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Subtitles", isBack: !0, onClick: () =>
|
|
6599
|
+
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Subtitles", isBack: !0, onClick: () => M("root") }) }),
|
|
6600
6600
|
/* @__PURE__ */ u("div", { style: { padding: "4px 0" }, children: [
|
|
6601
6601
|
/* @__PURE__ */ s(
|
|
6602
6602
|
z,
|
|
@@ -6604,32 +6604,32 @@ function yi({
|
|
|
6604
6604
|
label: "Off",
|
|
6605
6605
|
selected: ae === null,
|
|
6606
6606
|
onClick: () => {
|
|
6607
|
-
|
|
6607
|
+
T(null), de(null), W(!1), M("root");
|
|
6608
6608
|
}
|
|
6609
6609
|
},
|
|
6610
6610
|
"off"
|
|
6611
6611
|
),
|
|
6612
|
-
J.map((f,
|
|
6612
|
+
J.map((f, K) => /* @__PURE__ */ s(
|
|
6613
6613
|
z,
|
|
6614
6614
|
{
|
|
6615
6615
|
label: f.label || f.language,
|
|
6616
6616
|
selected: ae === f.language,
|
|
6617
6617
|
onClick: () => {
|
|
6618
|
-
|
|
6618
|
+
T(f.language), de(f.language), W(!1), M("root");
|
|
6619
6619
|
}
|
|
6620
6620
|
},
|
|
6621
|
-
f.url || `${f.language}-${
|
|
6621
|
+
f.url || `${f.language}-${K}`
|
|
6622
6622
|
)),
|
|
6623
6623
|
J.length === 0 && /* @__PURE__ */ s("div", { style: { padding: "10px 14px", color: "rgba(255,255,255,0.4)", fontSize: "13px" }, children: "No subtitle tracks available" })
|
|
6624
6624
|
] })
|
|
6625
6625
|
] }), yt = () => /* @__PURE__ */ u(oe, { children: [
|
|
6626
|
-
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Subtitle Style", isBack: !0, onClick: () =>
|
|
6626
|
+
/* @__PURE__ */ s("div", { style: p, children: /* @__PURE__ */ s(z, { label: "Subtitle Style", isBack: !0, onClick: () => M("root") }) }),
|
|
6627
6627
|
/* @__PURE__ */ u("div", { style: { padding: "8px 14px 12px", display: "flex", flexDirection: "column", gap: "14px" }, children: [
|
|
6628
6628
|
/* @__PURE__ */ u("div", { children: [
|
|
6629
6629
|
/* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "6px" }, children: [
|
|
6630
6630
|
/* @__PURE__ */ s("span", { style: { fontSize: "13px", color: "rgba(255,255,255,0.8)" }, children: "Position" }),
|
|
6631
6631
|
/* @__PURE__ */ u("span", { style: { fontSize: "12px", color: "rgba(255,255,255,0.5)" }, children: [
|
|
6632
|
-
|
|
6632
|
+
D.bottomOffset,
|
|
6633
6633
|
"px from bottom"
|
|
6634
6634
|
] })
|
|
6635
6635
|
] }),
|
|
@@ -6640,8 +6640,8 @@ function yi({
|
|
|
6640
6640
|
min: 10,
|
|
6641
6641
|
max: 200,
|
|
6642
6642
|
step: 5,
|
|
6643
|
-
value:
|
|
6644
|
-
onChange: (f) =>
|
|
6643
|
+
value: D.bottomOffset,
|
|
6644
|
+
onChange: (f) => S({ bottomOffset: Number(f.target.value) }),
|
|
6645
6645
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6646
6646
|
}
|
|
6647
6647
|
)
|
|
@@ -6650,7 +6650,7 @@ function yi({
|
|
|
6650
6650
|
/* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "6px" }, children: [
|
|
6651
6651
|
/* @__PURE__ */ s("span", { style: { fontSize: "13px", color: "rgba(255,255,255,0.8)" }, children: "Font Size" }),
|
|
6652
6652
|
/* @__PURE__ */ u("span", { style: { fontSize: "12px", color: "rgba(255,255,255,0.5)" }, children: [
|
|
6653
|
-
|
|
6653
|
+
D.fontSize,
|
|
6654
6654
|
"px"
|
|
6655
6655
|
] })
|
|
6656
6656
|
] }),
|
|
@@ -6661,8 +6661,8 @@ function yi({
|
|
|
6661
6661
|
min: 12,
|
|
6662
6662
|
max: 40,
|
|
6663
6663
|
step: 1,
|
|
6664
|
-
value:
|
|
6665
|
-
onChange: (f) =>
|
|
6664
|
+
value: D.fontSize,
|
|
6665
|
+
onChange: (f) => S({ fontSize: Number(f.target.value) }),
|
|
6666
6666
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6667
6667
|
}
|
|
6668
6668
|
)
|
|
@@ -6672,17 +6672,17 @@ function yi({
|
|
|
6672
6672
|
/* @__PURE__ */ s(
|
|
6673
6673
|
"button",
|
|
6674
6674
|
{
|
|
6675
|
-
onClick: () =>
|
|
6675
|
+
onClick: () => S({ background: D.background ? "" : "rgba(0,0,0,0.75)" }),
|
|
6676
6676
|
style: {
|
|
6677
6677
|
padding: "4px 12px",
|
|
6678
6678
|
borderRadius: "6px",
|
|
6679
6679
|
border: "1px solid rgba(255,255,255,0.2)",
|
|
6680
|
-
background:
|
|
6680
|
+
background: D.background ? "#3b82f6" : "transparent",
|
|
6681
6681
|
color: "#fff",
|
|
6682
6682
|
fontSize: "12px",
|
|
6683
6683
|
cursor: "pointer"
|
|
6684
6684
|
},
|
|
6685
|
-
children:
|
|
6685
|
+
children: D.background ? "On" : "Off"
|
|
6686
6686
|
}
|
|
6687
6687
|
)
|
|
6688
6688
|
] }),
|
|
@@ -6691,14 +6691,14 @@ function yi({
|
|
|
6691
6691
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: "6px" }, children: ["#ffffff", "#ffff00", "#00ff00", "#00cfff"].map((f) => /* @__PURE__ */ s(
|
|
6692
6692
|
"button",
|
|
6693
6693
|
{
|
|
6694
|
-
onClick: () =>
|
|
6694
|
+
onClick: () => S({ color: f }),
|
|
6695
6695
|
title: f,
|
|
6696
6696
|
style: {
|
|
6697
6697
|
width: "22px",
|
|
6698
6698
|
height: "22px",
|
|
6699
6699
|
borderRadius: "50%",
|
|
6700
6700
|
background: f,
|
|
6701
|
-
border:
|
|
6701
|
+
border: D.color === f ? "2px solid #3b82f6" : "2px solid transparent",
|
|
6702
6702
|
cursor: "pointer",
|
|
6703
6703
|
outline: "none",
|
|
6704
6704
|
padding: 0,
|
|
@@ -6710,7 +6710,7 @@ function yi({
|
|
|
6710
6710
|
] })
|
|
6711
6711
|
] })
|
|
6712
6712
|
] }), vt = () => {
|
|
6713
|
-
const f = ue.map((ie) => ie.bandwidth),
|
|
6713
|
+
const f = ue.map((ie) => ie.bandwidth), K = ue.map((ie) => ie.bufferHealth), xe = j?.bandwidth ?? 0, Ve = j?.bufferHealth ?? 0, wt = (ie) => ie >= 1e3 ? `${(ie / 1e3).toFixed(2)} Mbps` : `${ie.toFixed(0)} kbps`, ke = (ie, xt) => /* @__PURE__ */ u("div", { style: {
|
|
6714
6714
|
background: "rgba(255,255,255,0.04)",
|
|
6715
6715
|
borderRadius: "8px",
|
|
6716
6716
|
padding: "7px 10px",
|
|
@@ -6719,10 +6719,10 @@ function yi({
|
|
|
6719
6719
|
}, children: [
|
|
6720
6720
|
/* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: ie }),
|
|
6721
6721
|
/* @__PURE__ */ s("div", { style: { fontSize: "12px", color: "#fff", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: xt })
|
|
6722
|
-
] }), Se =
|
|
6722
|
+
] }), Se = j?.segmentUrl ?? "", Et = Se.length > 36 ? "…" + Se.slice(-36) : Se || "—";
|
|
6723
6723
|
return /* @__PURE__ */ u(oe, { children: [
|
|
6724
6724
|
/* @__PURE__ */ u("div", { style: { ...p, justifyContent: "space-between" }, children: [
|
|
6725
|
-
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ s(z, { label: "Statistics", isBack: !0, onClick: () =>
|
|
6725
|
+
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ s(z, { label: "Statistics", isBack: !0, onClick: () => M("root") }) }),
|
|
6726
6726
|
/* @__PURE__ */ u("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingRight: "14px", flexShrink: 0 }, children: [
|
|
6727
6727
|
/* @__PURE__ */ s("span", { style: {
|
|
6728
6728
|
width: "7px",
|
|
@@ -6740,25 +6740,25 @@ function yi({
|
|
|
6740
6740
|
/* @__PURE__ */ u("div", { style: { marginTop: "12px" }, children: [
|
|
6741
6741
|
/* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: "6px" }, children: [
|
|
6742
6742
|
/* @__PURE__ */ s("span", { style: { fontSize: "11px", color: "rgba(255,255,255,0.45)", textTransform: "uppercase", letterSpacing: "0.07em" }, children: "Connection Speed" }),
|
|
6743
|
-
/* @__PURE__ */ s("span", { style: { fontSize: "16px", fontWeight: 600, color: "#4ade80", fontFamily: "monospace" }, children:
|
|
6743
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "16px", fontWeight: 600, color: "#4ade80", fontFamily: "monospace" }, children: j ? wt(xe) : "—" })
|
|
6744
6744
|
] }),
|
|
6745
6745
|
/* @__PURE__ */ s("div", { style: { background: "rgba(0,0,0,0.3)", borderRadius: "8px", padding: "6px 8px" }, children: /* @__PURE__ */ s(et, { values: f, color: "#4ade80", gradId: "bw-grad" }) })
|
|
6746
6746
|
] }),
|
|
6747
6747
|
/* @__PURE__ */ u("div", { style: { marginTop: "14px" }, children: [
|
|
6748
6748
|
/* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: "6px" }, children: [
|
|
6749
6749
|
/* @__PURE__ */ s("span", { style: { fontSize: "11px", color: "rgba(255,255,255,0.45)", textTransform: "uppercase", letterSpacing: "0.07em" }, children: "Buffer Health" }),
|
|
6750
|
-
/* @__PURE__ */ s("span", { style: { fontSize: "16px", fontWeight: 600, color: "#60a5fa", fontFamily: "monospace" }, children:
|
|
6750
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "16px", fontWeight: 600, color: "#60a5fa", fontFamily: "monospace" }, children: j ? `${Ve.toFixed(1)} s` : "—" })
|
|
6751
6751
|
] }),
|
|
6752
|
-
/* @__PURE__ */ s("div", { style: { background: "rgba(0,0,0,0.3)", borderRadius: "8px", padding: "6px 8px" }, children: /* @__PURE__ */ s(et, { values:
|
|
6752
|
+
/* @__PURE__ */ s("div", { style: { background: "rgba(0,0,0,0.3)", borderRadius: "8px", padding: "6px 8px" }, children: /* @__PURE__ */ s(et, { values: K, color: "#60a5fa", gradId: "buf-grad" }) })
|
|
6753
6753
|
] }),
|
|
6754
6754
|
/* @__PURE__ */ s("div", { style: { height: "1px", background: "rgba(255,255,255,0.07)", margin: "14px 0 12px" } }),
|
|
6755
6755
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "6px" }, children: [
|
|
6756
|
-
ke("Codec",
|
|
6757
|
-
ke("Resolution",
|
|
6758
|
-
ke("Dropped",
|
|
6756
|
+
ke("Codec", j?.codec || "—"),
|
|
6757
|
+
ke("Resolution", j?.resolution || "—"),
|
|
6758
|
+
ke("Dropped", j ? `${j.droppedFrames}/${j.totalFrames}` : "—")
|
|
6759
6759
|
] }),
|
|
6760
6760
|
/* @__PURE__ */ u("div", { style: { display: "flex", gap: "6px", marginTop: "6px" }, children: [
|
|
6761
|
-
ke("Stream",
|
|
6761
|
+
ke("Stream", j?.streamType || "—"),
|
|
6762
6762
|
/* @__PURE__ */ u("div", { style: {
|
|
6763
6763
|
background: "rgba(255,255,255,0.04)",
|
|
6764
6764
|
borderRadius: "8px",
|
|
@@ -6793,7 +6793,7 @@ function yi({
|
|
|
6793
6793
|
case "statistics":
|
|
6794
6794
|
return vt();
|
|
6795
6795
|
default:
|
|
6796
|
-
return
|
|
6796
|
+
return U();
|
|
6797
6797
|
}
|
|
6798
6798
|
};
|
|
6799
6799
|
return /* @__PURE__ */ u("div", { ref: ye, style: { position: "relative", display: "inline-block" }, children: [
|
|
@@ -6803,10 +6803,10 @@ function yi({
|
|
|
6803
6803
|
className: "virtus-settings-btn",
|
|
6804
6804
|
"aria-label": "Settings",
|
|
6805
6805
|
"aria-haspopup": "menu",
|
|
6806
|
-
"aria-expanded":
|
|
6806
|
+
"aria-expanded": _,
|
|
6807
6807
|
onClick: Le,
|
|
6808
6808
|
style: {
|
|
6809
|
-
background:
|
|
6809
|
+
background: _ ? "rgba(255,255,255,0.18)" : "transparent",
|
|
6810
6810
|
border: "none",
|
|
6811
6811
|
color: "white",
|
|
6812
6812
|
cursor: "pointer",
|
|
@@ -6820,11 +6820,11 @@ function yi({
|
|
|
6820
6820
|
transition: "all 0.2s ease"
|
|
6821
6821
|
},
|
|
6822
6822
|
onMouseEnter: (f) => {
|
|
6823
|
-
const
|
|
6824
|
-
f.currentTarget.style.background =
|
|
6823
|
+
const K = typeof r == "string" ? r : r === !1 ? "transparent" : "rgba(255,255,255,0.15)";
|
|
6824
|
+
f.currentTarget.style.background = K, f.currentTarget.style.transform = "scale(1.05)";
|
|
6825
6825
|
},
|
|
6826
6826
|
onMouseLeave: (f) => {
|
|
6827
|
-
f.currentTarget.style.background =
|
|
6827
|
+
f.currentTarget.style.background = _ ? "rgba(255,255,255,0.18)" : "transparent", f.currentTarget.style.transform = "scale(1)";
|
|
6828
6828
|
},
|
|
6829
6829
|
title: "Settings",
|
|
6830
6830
|
children: i ?? /* @__PURE__ */ u(
|
|
@@ -6840,7 +6840,7 @@ function yi({
|
|
|
6840
6840
|
strokeLinejoin: "round",
|
|
6841
6841
|
style: {
|
|
6842
6842
|
transition: "transform 0.3s ease",
|
|
6843
|
-
transform:
|
|
6843
|
+
transform: _ ? "rotate(45deg)" : "rotate(0deg)"
|
|
6844
6844
|
},
|
|
6845
6845
|
children: [
|
|
6846
6846
|
/* @__PURE__ */ s("circle", { cx: "12", cy: "12", r: "3" }),
|
|
@@ -6850,7 +6850,7 @@ function yi({
|
|
|
6850
6850
|
)
|
|
6851
6851
|
}
|
|
6852
6852
|
),
|
|
6853
|
-
|
|
6853
|
+
_ && /* @__PURE__ */ s(ze.Provider, { value: h, children: /* @__PURE__ */ s(
|
|
6854
6854
|
"div",
|
|
6855
6855
|
{
|
|
6856
6856
|
role: "menu",
|
|
@@ -6858,8 +6858,8 @@ function yi({
|
|
|
6858
6858
|
style: {
|
|
6859
6859
|
...gi,
|
|
6860
6860
|
background: l,
|
|
6861
|
-
border: `1px solid ${
|
|
6862
|
-
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${
|
|
6861
|
+
border: `1px solid ${c}`,
|
|
6862
|
+
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${c.replace("0.1)", "0.08)")}`,
|
|
6863
6863
|
width: w === "statistics" ? "360px" : "320px",
|
|
6864
6864
|
...g === "bottom" ? { top: "52px" } : { bottom: "52px" },
|
|
6865
6865
|
...m === "left" ? { left: 0 } : { right: 0 }
|
|
@@ -6877,17 +6877,17 @@ function yi({
|
|
|
6877
6877
|
}
|
|
6878
6878
|
function Ti({ label: a = "AirPlay", className: e = "" }) {
|
|
6879
6879
|
const t = Ce(), [r, i] = b(!1), [n, o] = b(!1);
|
|
6880
|
-
|
|
6880
|
+
x(() => {
|
|
6881
6881
|
if (!t) return;
|
|
6882
6882
|
i(t.isAirPlayAvailable()), o(t.isAirPlayActive());
|
|
6883
|
-
const
|
|
6884
|
-
i(
|
|
6883
|
+
const c = ({ isAvailable: d, isActive: h }) => {
|
|
6884
|
+
i(d), o(h);
|
|
6885
6885
|
};
|
|
6886
|
-
return t.events.on("airplaychange",
|
|
6887
|
-
t.events.off("airplaychange",
|
|
6886
|
+
return t.events.on("airplaychange", c), () => {
|
|
6887
|
+
t.events.off("airplaychange", c);
|
|
6888
6888
|
};
|
|
6889
6889
|
}, [t]);
|
|
6890
|
-
const l =
|
|
6890
|
+
const l = B(() => {
|
|
6891
6891
|
t?.showAirPlayPicker();
|
|
6892
6892
|
}, [t]);
|
|
6893
6893
|
return r ? /* @__PURE__ */ s(
|
|
@@ -6934,20 +6934,20 @@ function Mi({
|
|
|
6934
6934
|
className: e = ""
|
|
6935
6935
|
}) {
|
|
6936
6936
|
const t = Ce(), [r, i] = b(!1), [n, o] = b(!1);
|
|
6937
|
-
|
|
6937
|
+
x(() => {
|
|
6938
6938
|
if (!t) return;
|
|
6939
6939
|
i(t.isCastAvailable()), o(t.isCastActive());
|
|
6940
|
-
const
|
|
6941
|
-
isAvailable:
|
|
6940
|
+
const c = ({
|
|
6941
|
+
isAvailable: d,
|
|
6942
6942
|
isActive: h
|
|
6943
6943
|
}) => {
|
|
6944
|
-
i(
|
|
6944
|
+
i(d), o(h);
|
|
6945
6945
|
};
|
|
6946
|
-
return t.events.on("castchange",
|
|
6947
|
-
t.events.off("castchange",
|
|
6946
|
+
return t.events.on("castchange", c), () => {
|
|
6947
|
+
t.events.off("castchange", c);
|
|
6948
6948
|
};
|
|
6949
6949
|
}, [t]);
|
|
6950
|
-
const l =
|
|
6950
|
+
const l = B(() => {
|
|
6951
6951
|
n ? t?.stopCasting() : t?.showCastPicker();
|
|
6952
6952
|
}, [t, n]);
|
|
6953
6953
|
return r ? /* @__PURE__ */ s(
|
|
@@ -7001,18 +7001,18 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7001
7001
|
hoverBackground: n?.hoverBackground ?? "rgba(255,255,255,0.07)",
|
|
7002
7002
|
iconBackground: n?.iconBackground ?? "rgba(255,255,255,0.08)",
|
|
7003
7003
|
dividerColor: n?.dividerColor ?? "rgba(255,255,255,0.07)"
|
|
7004
|
-
}, l =
|
|
7005
|
-
return
|
|
7004
|
+
}, l = O(null);
|
|
7005
|
+
return x(() => {
|
|
7006
7006
|
if (!t) return;
|
|
7007
|
-
const
|
|
7008
|
-
if ("key" in
|
|
7009
|
-
|
|
7007
|
+
const c = (d) => {
|
|
7008
|
+
if ("key" in d) {
|
|
7009
|
+
d.key === "Escape" && r();
|
|
7010
7010
|
return;
|
|
7011
7011
|
}
|
|
7012
|
-
l.current && !l.current.contains(
|
|
7012
|
+
l.current && !l.current.contains(d.target) && r();
|
|
7013
7013
|
};
|
|
7014
|
-
return document.addEventListener("mousedown",
|
|
7015
|
-
document.removeEventListener("mousedown",
|
|
7014
|
+
return document.addEventListener("mousedown", c), document.addEventListener("keydown", c), () => {
|
|
7015
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("keydown", c);
|
|
7016
7016
|
};
|
|
7017
7017
|
}, [t, r]), t ? /* @__PURE__ */ u(oe, { children: [
|
|
7018
7018
|
/* @__PURE__ */ s(
|
|
@@ -7037,13 +7037,13 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7037
7037
|
animation: "ctxFadeIn 0.14s ease-out",
|
|
7038
7038
|
overflow: "hidden"
|
|
7039
7039
|
},
|
|
7040
|
-
children: i.map((
|
|
7040
|
+
children: i.map((c, d) => /* @__PURE__ */ u("div", { children: [
|
|
7041
7041
|
/* @__PURE__ */ u(
|
|
7042
7042
|
"button",
|
|
7043
7043
|
{
|
|
7044
7044
|
role: "menuitem",
|
|
7045
7045
|
onClick: () => {
|
|
7046
|
-
|
|
7046
|
+
c.onClick(), r();
|
|
7047
7047
|
},
|
|
7048
7048
|
style: {
|
|
7049
7049
|
display: "flex",
|
|
@@ -7053,38 +7053,38 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7053
7053
|
padding: "9px 14px",
|
|
7054
7054
|
background: "transparent",
|
|
7055
7055
|
border: "none",
|
|
7056
|
-
color:
|
|
7056
|
+
color: c.danger ? o.dangerColor : o.textColor,
|
|
7057
7057
|
fontSize: "13.5px",
|
|
7058
7058
|
textAlign: "left",
|
|
7059
7059
|
cursor: "pointer",
|
|
7060
7060
|
transition: "background 0.1s"
|
|
7061
7061
|
},
|
|
7062
7062
|
onMouseEnter: (h) => {
|
|
7063
|
-
h.currentTarget.style.background =
|
|
7063
|
+
h.currentTarget.style.background = c.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
|
|
7064
7064
|
},
|
|
7065
7065
|
onMouseLeave: (h) => {
|
|
7066
7066
|
h.currentTarget.style.background = "transparent";
|
|
7067
7067
|
},
|
|
7068
7068
|
children: [
|
|
7069
|
-
|
|
7069
|
+
c.icon !== void 0 && /* @__PURE__ */ s("span", { style: {
|
|
7070
7070
|
width: "28px",
|
|
7071
7071
|
height: "28px",
|
|
7072
7072
|
borderRadius: "7px",
|
|
7073
|
-
background:
|
|
7073
|
+
background: c.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
|
|
7074
7074
|
display: "flex",
|
|
7075
7075
|
alignItems: "center",
|
|
7076
7076
|
justifyContent: "center",
|
|
7077
7077
|
flexShrink: 0,
|
|
7078
|
-
color:
|
|
7078
|
+
color: c.danger ? o.dangerColor : o.textColor,
|
|
7079
7079
|
fontSize: "13px",
|
|
7080
7080
|
lineHeight: 1
|
|
7081
|
-
}, children:
|
|
7082
|
-
/* @__PURE__ */ s("span", { style: { flex: 1 }, children:
|
|
7081
|
+
}, children: c.icon }),
|
|
7082
|
+
/* @__PURE__ */ s("span", { style: { flex: 1 }, children: c.label })
|
|
7083
7083
|
]
|
|
7084
7084
|
}
|
|
7085
7085
|
),
|
|
7086
|
-
|
|
7087
|
-
] },
|
|
7086
|
+
c.dividerAfter && /* @__PURE__ */ s("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
|
|
7087
|
+
] }, d))
|
|
7088
7088
|
}
|
|
7089
7089
|
),
|
|
7090
7090
|
/* @__PURE__ */ s("style", { children: `
|
|
@@ -7096,7 +7096,7 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7096
7096
|
] }) : null;
|
|
7097
7097
|
}
|
|
7098
7098
|
const Li = ({ mode: a }) => {
|
|
7099
|
-
const { isLive: e } =
|
|
7099
|
+
const { isLive: e } = Y(), t = a === "live" || a !== "vod" && !!e;
|
|
7100
7100
|
return /* @__PURE__ */ u(Or, { children: [
|
|
7101
7101
|
/* @__PURE__ */ s(zr, {}),
|
|
7102
7102
|
!t && /* @__PURE__ */ s(li, { seconds: 15 }),
|
|
@@ -7255,5 +7255,5 @@ export {
|
|
|
7255
7255
|
Lr as useMobileGestures,
|
|
7256
7256
|
Ce as usePlayer,
|
|
7257
7257
|
q as usePlayerMethods,
|
|
7258
|
-
|
|
7258
|
+
Y as usePlayerState
|
|
7259
7259
|
};
|