playron 1.0.37 → 1.0.38
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/core/PlayerCore.d.ts.map +1 -1
- package/dist/playron.cjs.js +1 -1
- package/dist/playron.es.js +316 -312
- package/package.json +1 -1
package/dist/playron.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s, jsxs as u, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
class
|
|
2
|
+
import { createContext as ce, useState as b, useEffect as k, useMemo as Ue, useContext as re, memo as kt, useRef as O, useCallback as $ } from "react";
|
|
3
|
+
class At {
|
|
4
4
|
listeners = /* @__PURE__ */ new Map();
|
|
5
5
|
/**
|
|
6
6
|
* Event dinleyicisi ekle
|
|
@@ -47,7 +47,7 @@ class St {
|
|
|
47
47
|
return this.listeners.get(e)?.size || 0;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const ge = new
|
|
50
|
+
const ge = new At(), x = {
|
|
51
51
|
// Playback events
|
|
52
52
|
PLAY: "play",
|
|
53
53
|
PAUSE: "pause",
|
|
@@ -78,7 +78,7 @@ const ge = new St(), x = {
|
|
|
78
78
|
EMPTIED: "emptied",
|
|
79
79
|
// Other events
|
|
80
80
|
RESIZE: "resize"
|
|
81
|
-
},
|
|
81
|
+
}, Se = {
|
|
82
82
|
MEDIA_ERR_ABORTED: 1,
|
|
83
83
|
// Fetching process aborted by user
|
|
84
84
|
MEDIA_ERR_NETWORK: 2,
|
|
@@ -91,7 +91,7 @@ const ge = new St(), x = {
|
|
|
91
91
|
function Ei(a) {
|
|
92
92
|
return Object.values(x).includes(a);
|
|
93
93
|
}
|
|
94
|
-
class
|
|
94
|
+
class St {
|
|
95
95
|
videoElement = null;
|
|
96
96
|
isPlaying = !1;
|
|
97
97
|
isMuted = !1;
|
|
@@ -122,10 +122,10 @@ class At {
|
|
|
122
122
|
console.error("Video error:", e), this.videoElement?.error && console.error("Video error details:", {
|
|
123
123
|
code: this.videoElement.error.code,
|
|
124
124
|
message: this.videoElement.error.message,
|
|
125
|
-
MEDIA_ERR_ABORTED: this.videoElement.error.code ===
|
|
126
|
-
MEDIA_ERR_NETWORK: this.videoElement.error.code ===
|
|
127
|
-
MEDIA_ERR_DECODE: this.videoElement.error.code ===
|
|
128
|
-
MEDIA_ERR_SRC_NOT_SUPPORTED: this.videoElement.error.code ===
|
|
125
|
+
MEDIA_ERR_ABORTED: this.videoElement.error.code === Se.MEDIA_ERR_ABORTED,
|
|
126
|
+
MEDIA_ERR_NETWORK: this.videoElement.error.code === Se.MEDIA_ERR_NETWORK,
|
|
127
|
+
MEDIA_ERR_DECODE: this.videoElement.error.code === Se.MEDIA_ERR_DECODE,
|
|
128
|
+
MEDIA_ERR_SRC_NOT_SUPPORTED: this.videoElement.error.code === Se.MEDIA_ERR_SRC_NOT_SUPPORTED
|
|
129
129
|
});
|
|
130
130
|
}));
|
|
131
131
|
}
|
|
@@ -560,8 +560,8 @@ class Tt {
|
|
|
560
560
|
const i = (n) => {
|
|
561
561
|
const o = {};
|
|
562
562
|
let l = !1;
|
|
563
|
-
e.forEach((
|
|
564
|
-
r[
|
|
563
|
+
e.forEach((c) => {
|
|
564
|
+
r[c] !== n[c] && (o[c] = n[c], l = !0);
|
|
565
565
|
}), l && t(o), r = { ...n };
|
|
566
566
|
};
|
|
567
567
|
this.subscribe(i);
|
|
@@ -710,7 +710,7 @@ class Pt {
|
|
|
710
710
|
hasDVR: !1,
|
|
711
711
|
isEngineSupported: this.preCheckCapability("hls")
|
|
712
712
|
};
|
|
713
|
-
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),
|
|
713
|
+
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);
|
|
714
714
|
return i && !n ? {
|
|
715
715
|
type: "live",
|
|
716
716
|
protocol: "hls",
|
|
@@ -718,7 +718,7 @@ class Pt {
|
|
|
718
718
|
hasDVR: o,
|
|
719
719
|
// EVENT type supports DVR
|
|
720
720
|
targetDuration: l,
|
|
721
|
-
mediaSequence:
|
|
721
|
+
mediaSequence: c,
|
|
722
722
|
isEngineSupported: this.preCheckCapability("hls")
|
|
723
723
|
} : {
|
|
724
724
|
type: "vod",
|
|
@@ -914,17 +914,17 @@ async function nt(a, e, t, r, i) {
|
|
|
914
914
|
let n = new Error("License request failed");
|
|
915
915
|
for (let o = 0; o <= r; o++) {
|
|
916
916
|
if (o > 0) {
|
|
917
|
-
const
|
|
918
|
-
await new Promise((h) => setTimeout(h,
|
|
917
|
+
const d = i * Math.pow(2, o - 1);
|
|
918
|
+
await new Promise((h) => setTimeout(h, d));
|
|
919
919
|
}
|
|
920
|
-
const l = new AbortController(),
|
|
920
|
+
const l = new AbortController(), c = setTimeout(() => l.abort(), t);
|
|
921
921
|
try {
|
|
922
|
-
const
|
|
923
|
-
if (clearTimeout(
|
|
924
|
-
throw new Error(`HTTP ${
|
|
925
|
-
return await
|
|
926
|
-
} catch (
|
|
927
|
-
clearTimeout(
|
|
922
|
+
const d = await fetch(a, { ...e, signal: l.signal });
|
|
923
|
+
if (clearTimeout(c), !d.ok)
|
|
924
|
+
throw new Error(`HTTP ${d.status}: ${d.statusText}`);
|
|
925
|
+
return await d.arrayBuffer();
|
|
926
|
+
} catch (d) {
|
|
927
|
+
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));
|
|
928
928
|
}
|
|
929
929
|
}
|
|
930
930
|
throw n;
|
|
@@ -949,11 +949,11 @@ function $t() {
|
|
|
949
949
|
}
|
|
950
950
|
async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
951
951
|
const n = i.timeout ?? _t, o = i.maxRetries ?? Vt, l = i.retryDelay ?? Nt;
|
|
952
|
-
let
|
|
953
|
-
i.prepareLicenseRequest && (
|
|
954
|
-
const
|
|
952
|
+
let c = e;
|
|
953
|
+
i.prepareLicenseRequest && (c = await i.prepareLicenseRequest(e));
|
|
954
|
+
const d = {
|
|
955
955
|
method: "POST",
|
|
956
|
-
body:
|
|
956
|
+
body: c,
|
|
957
957
|
headers: {
|
|
958
958
|
"Content-Type": "application/octet-stream",
|
|
959
959
|
...t
|
|
@@ -963,7 +963,7 @@ async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
|
963
963
|
console.debug("[LicenseManager] Acquiring license from:", a);
|
|
964
964
|
let h = await nt(
|
|
965
965
|
a,
|
|
966
|
-
|
|
966
|
+
d,
|
|
967
967
|
n,
|
|
968
968
|
o,
|
|
969
969
|
l
|
|
@@ -1372,8 +1372,8 @@ class Xt {
|
|
|
1372
1372
|
try {
|
|
1373
1373
|
const l = new o.media.MediaInfo(e, t);
|
|
1374
1374
|
l.streamType = i ? o.media.StreamType.LIVE : o.media.StreamType.BUFFERED, l.metadata = null;
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1375
|
+
const c = new o.media.LoadRequest(l);
|
|
1376
|
+
c.currentTime = r, c.autoplay = !0, await n.loadMedia(c), console.log(`[ChromecastManager] Media loaded on receiver: ${e} (t=${r}s)`);
|
|
1377
1377
|
} catch (l) {
|
|
1378
1378
|
console.error("[ChromecastManager] loadMedia error:", l);
|
|
1379
1379
|
}
|
|
@@ -1500,7 +1500,7 @@ class fe {
|
|
|
1500
1500
|
*/
|
|
1501
1501
|
initialize() {
|
|
1502
1502
|
if (!this.videoElement) return;
|
|
1503
|
-
this.videoEngine = new
|
|
1503
|
+
this.videoEngine = new St(this.videoElement);
|
|
1504
1504
|
const e = this.loadPersistedVolume();
|
|
1505
1505
|
e !== null && (this.videoElement.volume = e), this.stateManager = new Tt({
|
|
1506
1506
|
isPlaying: !1,
|
|
@@ -1791,7 +1791,9 @@ class fe {
|
|
|
1791
1791
|
const r = this.streamInfo?.isDynamic ?? !1, i = t.protocol === "hls" ? "application/x-mpegURL" : t.protocol === "dash" ? "application/dash+xml" : "video/mp4";
|
|
1792
1792
|
this.castManager.loadMedia(e, i, 0, r);
|
|
1793
1793
|
}
|
|
1794
|
-
this.startStallDetector()
|
|
1794
|
+
this.startStallDetector(), this.videoElement?.autoplay && this.videoElement.play().catch((r) => {
|
|
1795
|
+
r instanceof DOMException && (r.name === "AbortError" || r.name === "NotAllowedError") || console.warn("[PlayerCore] Autoplay failed:", r);
|
|
1796
|
+
});
|
|
1795
1797
|
}
|
|
1796
1798
|
/**
|
|
1797
1799
|
* Aktif streaming engine'i temizle
|
|
@@ -1805,7 +1807,9 @@ class fe {
|
|
|
1805
1807
|
async fallbackToNative(e, t) {
|
|
1806
1808
|
if (!(!this.videoElement || !this.videoEngine))
|
|
1807
1809
|
try {
|
|
1808
|
-
console.log(`[PlayerCore] Attempting native fallback for ${t} stream`), this.videoEngine.setSource(e), this.
|
|
1810
|
+
console.log(`[PlayerCore] Attempting native fallback for ${t} stream`), this.videoEngine.setSource(e), this.videoElement?.autoplay && this.videoElement.play().catch((r) => {
|
|
1811
|
+
r instanceof DOMException && (r.name === "AbortError" || r.name);
|
|
1812
|
+
}), this.streamType = "vod", this.streamInfo = {
|
|
1809
1813
|
type: "vod",
|
|
1810
1814
|
protocol: "progressive",
|
|
1811
1815
|
isDynamic: !1,
|
|
@@ -2068,7 +2072,7 @@ class fe {
|
|
|
2068
2072
|
this.stallDetector?.destroy(), this.stallDetector = null, this.destroyAirPlay(), this.destroyChromecast(), this.destroyStreamingEngines(), this.videoEngine && (this.videoEngine.destroy(), this.videoEngine = null), this.stateManager && (this.stateManager.reset(), this.stateManager = null), this.configManager && (this.configManager.reset(), this.configManager = null), this.videoElement = null, this.container = null;
|
|
2069
2073
|
}
|
|
2070
2074
|
}
|
|
2071
|
-
const st =
|
|
2075
|
+
const st = ce(null), ot = {
|
|
2072
2076
|
isPlaying: !1,
|
|
2073
2077
|
isMuted: !1,
|
|
2074
2078
|
volume: 1,
|
|
@@ -2077,7 +2081,7 @@ const st = de(null), ot = {
|
|
|
2077
2081
|
isLive: !1,
|
|
2078
2082
|
isAtLiveEdge: !1,
|
|
2079
2083
|
liveLatency: 0
|
|
2080
|
-
}, at =
|
|
2084
|
+
}, at = ce(ot), lt = ce(null);
|
|
2081
2085
|
function Gt({ children: a, playerInstance: e }) {
|
|
2082
2086
|
const [t, r] = b(ot);
|
|
2083
2087
|
k(() => {
|
|
@@ -2085,20 +2089,20 @@ function Gt({ children: a, playerInstance: e }) {
|
|
|
2085
2089
|
const n = e.getStateManager();
|
|
2086
2090
|
if (!n) return;
|
|
2087
2091
|
r(n.getState());
|
|
2088
|
-
const o = (
|
|
2089
|
-
r(
|
|
2092
|
+
const o = (c) => {
|
|
2093
|
+
r(c);
|
|
2090
2094
|
};
|
|
2091
2095
|
n.subscribe(o);
|
|
2092
2096
|
const l = e.getVideoElement();
|
|
2093
2097
|
if (l) {
|
|
2094
|
-
const
|
|
2098
|
+
const c = () => {
|
|
2095
2099
|
const g = e.isLive();
|
|
2096
2100
|
n.updateState({
|
|
2097
2101
|
currentTime: l.currentTime,
|
|
2098
2102
|
duration: l.duration || 0,
|
|
2099
2103
|
isLive: g
|
|
2100
2104
|
});
|
|
2101
|
-
},
|
|
2105
|
+
}, d = () => {
|
|
2102
2106
|
n.set("isPlaying", !l.paused);
|
|
2103
2107
|
}, h = () => {
|
|
2104
2108
|
n.updateState({
|
|
@@ -2112,8 +2116,8 @@ function Gt({ children: a, playerInstance: e }) {
|
|
|
2112
2116
|
isLive: !0
|
|
2113
2117
|
});
|
|
2114
2118
|
};
|
|
2115
|
-
return e.events.on("livelatencyupdate", p), l.addEventListener(x.TIME_UPDATE,
|
|
2116
|
-
e.events.off("livelatencyupdate", p), l.removeEventListener(x.TIME_UPDATE,
|
|
2119
|
+
return e.events.on("livelatencyupdate", p), l.addEventListener(x.TIME_UPDATE, c), l.addEventListener(x.PLAY, d), l.addEventListener(x.PAUSE, d), l.addEventListener(x.VOLUME_CHANGE, h), l.addEventListener(x.LOADED_METADATA, c), () => {
|
|
2120
|
+
e.events.off("livelatencyupdate", p), l.removeEventListener(x.TIME_UPDATE, c), l.removeEventListener(x.PLAY, d), l.removeEventListener(x.PAUSE, d), l.removeEventListener(x.VOLUME_CHANGE, h), l.removeEventListener(x.LOADED_METADATA, c), n.unsubscribe(o);
|
|
2117
2121
|
};
|
|
2118
2122
|
}
|
|
2119
2123
|
return () => {
|
|
@@ -2273,24 +2277,24 @@ const Zt = "_overlay_3mfq6_3", Jt = "_iconContainer_3mfq6_17", er = "_loading_3m
|
|
|
2273
2277
|
customIcon: rr
|
|
2274
2278
|
};
|
|
2275
2279
|
function ir({ config: a, isAdLoading: e }) {
|
|
2276
|
-
const t = Y((D) => D.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [
|
|
2280
|
+
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);
|
|
2277
2281
|
k(() => {
|
|
2278
|
-
console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0),
|
|
2282
|
+
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));
|
|
2279
2283
|
}, [e]);
|
|
2280
|
-
const m = a?.ui?.showOverlayIcons !== !1,
|
|
2284
|
+
const m = a?.ui?.showOverlayIcons !== !1, A = a?.ui?.showPlayPauseIcons !== !1, I = a?.ui?.overlayIcons?.playIcon, C = a?.ui?.overlayIcons?.pauseIcon, T = a?.ui?.overlayIcons?.iconSize || 40, w = a?.ui?.overlayIcons?.containerSize || 80;
|
|
2281
2285
|
k(() => {
|
|
2282
2286
|
const D = n();
|
|
2283
2287
|
if (!D) return;
|
|
2284
|
-
const
|
|
2285
|
-
if (!
|
|
2288
|
+
const S = D.video || D.videoElement;
|
|
2289
|
+
if (!S) return;
|
|
2286
2290
|
const _ = () => {
|
|
2287
|
-
p(!0),
|
|
2291
|
+
p(!0), d("loading"), l(!0), g.current && clearTimeout(g.current);
|
|
2288
2292
|
}, W = () => {
|
|
2289
2293
|
g.current = window.setTimeout(() => {
|
|
2290
2294
|
p(!1), l(!1);
|
|
2291
2295
|
}, 300);
|
|
2292
2296
|
}, E = () => {
|
|
2293
|
-
p(!0),
|
|
2297
|
+
p(!0), d("loading"), l(!0);
|
|
2294
2298
|
}, M = () => {
|
|
2295
2299
|
h && (g.current = window.setTimeout(() => {
|
|
2296
2300
|
p(!1), l(!1);
|
|
@@ -2300,14 +2304,14 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2300
2304
|
p(!1), l(!1);
|
|
2301
2305
|
}, 300));
|
|
2302
2306
|
}, H = () => {
|
|
2303
|
-
p(!0),
|
|
2307
|
+
p(!0), d("loading"), l(!0);
|
|
2304
2308
|
};
|
|
2305
|
-
return
|
|
2306
|
-
|
|
2309
|
+
return S.addEventListener(x.SEEKING, _), S.addEventListener(x.SEEKED, W), S.addEventListener(x.WAITING, E), S.addEventListener(x.PLAYING, M), S.addEventListener(x.CAN_PLAY, N), S.addEventListener(x.LOAD_START, H), () => {
|
|
2310
|
+
S.removeEventListener(x.SEEKING, _), S.removeEventListener(x.SEEKED, W), S.removeEventListener(x.WAITING, E), S.removeEventListener(x.PLAYING, M), S.removeEventListener(x.CAN_PLAY, N), S.removeEventListener(x.LOAD_START, H), g.current && clearTimeout(g.current);
|
|
2307
2311
|
};
|
|
2308
2312
|
}, [n, h]), k(() => {
|
|
2309
2313
|
if (!h) {
|
|
2310
|
-
|
|
2314
|
+
d(t ? "pause" : "play"), l(!0);
|
|
2311
2315
|
const D = setTimeout(() => {
|
|
2312
2316
|
l(!1);
|
|
2313
2317
|
}, 600);
|
|
@@ -2319,11 +2323,11 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2319
2323
|
}, [r]), G = $(() => {
|
|
2320
2324
|
i();
|
|
2321
2325
|
}, [i]), X = (D) => {
|
|
2322
|
-
const
|
|
2323
|
-
return
|
|
2326
|
+
const S = D === "play" ? I : C;
|
|
2327
|
+
return S ? /^https?:\/\//.test(S) || /\.(jpg|jpeg|png|svg|gif|webp)$/i.test(S) ? /* @__PURE__ */ s(
|
|
2324
2328
|
"img",
|
|
2325
2329
|
{
|
|
2326
|
-
src:
|
|
2330
|
+
src: S,
|
|
2327
2331
|
alt: D === "play" ? "Play" : "Pause",
|
|
2328
2332
|
className: ne.customIcon,
|
|
2329
2333
|
style: { "--icon-size": `${T}px` }
|
|
@@ -2331,7 +2335,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2331
2335
|
) : /* @__PURE__ */ s(
|
|
2332
2336
|
"div",
|
|
2333
2337
|
{
|
|
2334
|
-
dangerouslySetInnerHTML: { __html:
|
|
2338
|
+
dangerouslySetInnerHTML: { __html: S },
|
|
2335
2339
|
className: ne.customIcon,
|
|
2336
2340
|
style: { "--icon-size": `${T}px` }
|
|
2337
2341
|
}
|
|
@@ -2387,7 +2391,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2387
2391
|
className: `virtus-video-overlay ${ne.overlay}`,
|
|
2388
2392
|
onClick: y,
|
|
2389
2393
|
onDoubleClick: G,
|
|
2390
|
-
children: m && o && !e && (
|
|
2394
|
+
children: m && o && !e && (c === "loading" || A) && /* @__PURE__ */ s(
|
|
2391
2395
|
"div",
|
|
2392
2396
|
{
|
|
2393
2397
|
className: `${ne.iconContainer} ${h ? ne.loading : ""}`,
|
|
@@ -2395,7 +2399,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2395
2399
|
"--icon-container-size": `${w}px`,
|
|
2396
2400
|
"--icon-size": `${T}px`
|
|
2397
2401
|
},
|
|
2398
|
-
children:
|
|
2402
|
+
children: c === "loading" ? /* @__PURE__ */ s(Xe, { size: T }) : X(c)
|
|
2399
2403
|
}
|
|
2400
2404
|
)
|
|
2401
2405
|
}
|
|
@@ -2409,13 +2413,13 @@ function Ce() {
|
|
|
2409
2413
|
throw new Error("usePlayer must be used within PlayerProvider");
|
|
2410
2414
|
return a;
|
|
2411
2415
|
}
|
|
2412
|
-
const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27",
|
|
2416
|
+
const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27", cr = "_variant_generic_4djr8_31", dr = "_errorContent_4djr8_37", ur = "_errorIcon_4djr8_51", hr = "_iconPulse_4djr8_1", pr = "_drmGlow_4djr8_1", gr = "_netGlow_4djr8_1", fr = "_errorTitle_4djr8_86", mr = "_errorMessage_4djr8_100", yr = "_errorHint_4djr8_109", vr = "_browserList_4djr8_117", br = "_browserItem_4djr8_126", Er = "_errorCode_4djr8_142", wr = "_retryButton_4djr8_152", te = {
|
|
2413
2417
|
errorOverlay: sr,
|
|
2414
2418
|
variant_drm: or,
|
|
2415
2419
|
variant_network: ar,
|
|
2416
2420
|
variant_decode: lr,
|
|
2417
|
-
variant_generic:
|
|
2418
|
-
errorContent:
|
|
2421
|
+
variant_generic: cr,
|
|
2422
|
+
errorContent: dr,
|
|
2419
2423
|
errorIcon: ur,
|
|
2420
2424
|
iconPulse: hr,
|
|
2421
2425
|
drmGlow: pr,
|
|
@@ -2508,10 +2512,10 @@ function kr(a) {
|
|
|
2508
2512
|
};
|
|
2509
2513
|
}
|
|
2510
2514
|
}
|
|
2511
|
-
const
|
|
2512
|
-
function
|
|
2513
|
-
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null),
|
|
2514
|
-
|
|
2515
|
+
const Ar = 12e3;
|
|
2516
|
+
function Sr({ onRetry: a, drmConfig: e }) {
|
|
2517
|
+
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null), c = O(null);
|
|
2518
|
+
c.current = r, k(() => {
|
|
2515
2519
|
it().then((g) => {
|
|
2516
2520
|
o(g);
|
|
2517
2521
|
const m = Ge(e, g);
|
|
@@ -2526,14 +2530,14 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2526
2530
|
}, []), k(() => {
|
|
2527
2531
|
if (!n || !e?.enabled) return;
|
|
2528
2532
|
const g = Ge(e, n);
|
|
2529
|
-
g && !
|
|
2533
|
+
g && !c.current && i({ type: g, code: "DRM_NOT_SUPPORTED", rawMessage: "Browser does not support the required DRM key system.", persistent: !0 });
|
|
2530
2534
|
}, [e, n]), k(() => {
|
|
2531
2535
|
if (!t || !e?.enabled) return;
|
|
2532
2536
|
const g = t.getVideoElement();
|
|
2533
2537
|
if (!g) return;
|
|
2534
2538
|
const m = () => {
|
|
2535
2539
|
g.currentTime > 0.5 || (l.current = setTimeout(() => {
|
|
2536
|
-
if (
|
|
2540
|
+
if (c.current) return;
|
|
2537
2541
|
const I = n, C = I ? I.fairplay && !I.widevine && !I.playready ? "drm_fairplay_needed" : !I.widevine && !I.fairplay && !I.playready ? "drm_browser_unsupported" : "drm_generic" : "drm_generic";
|
|
2538
2542
|
i({
|
|
2539
2543
|
type: C,
|
|
@@ -2542,19 +2546,19 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2542
2546
|
persistent: !0
|
|
2543
2547
|
// don't let a late loadedmetadata dismiss this
|
|
2544
2548
|
});
|
|
2545
|
-
},
|
|
2546
|
-
},
|
|
2549
|
+
}, Ar));
|
|
2550
|
+
}, A = () => {
|
|
2547
2551
|
l.current && (clearTimeout(l.current), l.current = null);
|
|
2548
2552
|
};
|
|
2549
|
-
return g.addEventListener("waiting", m), g.addEventListener("playing",
|
|
2550
|
-
g.removeEventListener("waiting", m), g.removeEventListener("playing",
|
|
2553
|
+
return g.addEventListener("waiting", m), g.addEventListener("playing", A), g.addEventListener("timeupdate", A), () => {
|
|
2554
|
+
g.removeEventListener("waiting", m), g.removeEventListener("playing", A), g.removeEventListener("timeupdate", A), A();
|
|
2551
2555
|
};
|
|
2552
2556
|
}, [t, e, n]), k(() => {
|
|
2553
2557
|
if (!t) return;
|
|
2554
2558
|
const g = (m) => {
|
|
2555
2559
|
console.error("[ErrorOverlay] Player error:", m);
|
|
2556
|
-
const
|
|
2557
|
-
i({ type:
|
|
2560
|
+
const A = xr(m, n);
|
|
2561
|
+
i({ type: A, code: m.code, rawMessage: m.message ?? "Unknown error" });
|
|
2558
2562
|
};
|
|
2559
2563
|
return t.events.on("error", g), () => {
|
|
2560
2564
|
t.events.off("error", g);
|
|
@@ -2566,7 +2570,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2566
2570
|
t.events.off("play", g), t.events.off("loadedmetadata", g);
|
|
2567
2571
|
};
|
|
2568
2572
|
}, [t]);
|
|
2569
|
-
const
|
|
2573
|
+
const d = $(() => {
|
|
2570
2574
|
if (i(null), a) {
|
|
2571
2575
|
a();
|
|
2572
2576
|
return;
|
|
@@ -2590,7 +2594,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2590
2594
|
h.hint && /* @__PURE__ */ s("p", { className: te.errorHint, children: h.hint }),
|
|
2591
2595
|
h.browsers && /* @__PURE__ */ s("ul", { className: te.browserList, children: h.browsers.map((g) => /* @__PURE__ */ s("li", { className: te.browserItem, children: g }, g)) }),
|
|
2592
2596
|
r.code && h.variant !== "drm" && /* @__PURE__ */ s("p", { className: te.errorCode, children: r.code }),
|
|
2593
|
-
h.showRetry && /* @__PURE__ */ s("button", { onClick:
|
|
2597
|
+
h.showRetry && /* @__PURE__ */ s("button", { onClick: d, className: te.retryButton, children: "↻ Try Again" })
|
|
2594
2598
|
] }) });
|
|
2595
2599
|
}
|
|
2596
2600
|
const se = {
|
|
@@ -2807,18 +2811,18 @@ function Mr({
|
|
|
2807
2811
|
nextTitle: i,
|
|
2808
2812
|
thumbnail: n
|
|
2809
2813
|
}) {
|
|
2810
|
-
const [o, l] = b(r),
|
|
2811
|
-
|
|
2814
|
+
const [o, l] = b(r), c = O(null), d = $(() => {
|
|
2815
|
+
c.current && (clearInterval(c.current), c.current = null);
|
|
2812
2816
|
}, []);
|
|
2813
2817
|
if (k(() => {
|
|
2814
2818
|
if (!a) {
|
|
2815
|
-
|
|
2819
|
+
d(), l(r);
|
|
2816
2820
|
return;
|
|
2817
2821
|
}
|
|
2818
|
-
return l(r),
|
|
2819
|
-
l((m) => m <= 1 ? (
|
|
2820
|
-
}, 1e3),
|
|
2821
|
-
}, [a, r, e,
|
|
2822
|
+
return l(r), c.current = setInterval(() => {
|
|
2823
|
+
l((m) => m <= 1 ? (d(), e(), 0) : m - 1);
|
|
2824
|
+
}, 1e3), d;
|
|
2825
|
+
}, [a, r, e, d]), !a) return null;
|
|
2822
2826
|
const h = 16, p = 2 * Math.PI * h, g = (r - o) / r * p;
|
|
2823
2827
|
return /* @__PURE__ */ u(
|
|
2824
2828
|
"div",
|
|
@@ -3047,10 +3051,10 @@ function Pr({ type: a, value: e }) {
|
|
|
3047
3051
|
function Lr({ player: a, skipSec: e = 10 }) {
|
|
3048
3052
|
const [t, r] = b(null), i = O(null), n = $((p) => {
|
|
3049
3053
|
r(p), i.current && clearTimeout(i.current), i.current = setTimeout(() => r(null), 900);
|
|
3050
|
-
}, []), o = O(null), l = 300,
|
|
3054
|
+
}, []), o = O(null), l = 300, c = $((p) => {
|
|
3051
3055
|
if (!a) return;
|
|
3052
|
-
const g = p.touches[0], m = Date.now(),
|
|
3053
|
-
if (
|
|
3056
|
+
const g = p.touches[0], m = Date.now(), A = o.current;
|
|
3057
|
+
if (A && m - A.time < l) {
|
|
3054
3058
|
const C = p.currentTarget.getBoundingClientRect();
|
|
3055
3059
|
if (g.clientX - C.left > C.width / 2) {
|
|
3056
3060
|
const w = a.getVideoElement();
|
|
@@ -3063,10 +3067,10 @@ function Lr({ player: a, skipSec: e = 10 }) {
|
|
|
3063
3067
|
return;
|
|
3064
3068
|
}
|
|
3065
3069
|
o.current = { time: m, x: g.clientX };
|
|
3066
|
-
}, [a, e, n]),
|
|
3070
|
+
}, [a, e, n]), d = $((p) => {
|
|
3067
3071
|
}, []), h = $(() => {
|
|
3068
3072
|
}, []);
|
|
3069
|
-
return { onTouchStart:
|
|
3073
|
+
return { onTouchStart: c, onTouchMove: d, onTouchEnd: h, gestureHint: t };
|
|
3070
3074
|
}
|
|
3071
3075
|
function Rr(a, e) {
|
|
3072
3076
|
let t;
|
|
@@ -3114,16 +3118,16 @@ function Ir({
|
|
|
3114
3118
|
break;
|
|
3115
3119
|
case "ArrowLeft":
|
|
3116
3120
|
n.preventDefault();
|
|
3117
|
-
const
|
|
3118
|
-
a.seekTo(
|
|
3121
|
+
const c = Math.max(0, l.currentTime - e);
|
|
3122
|
+
a.seekTo(c);
|
|
3119
3123
|
break;
|
|
3120
3124
|
case "ArrowRight":
|
|
3121
3125
|
n.preventDefault();
|
|
3122
|
-
const
|
|
3126
|
+
const d = Math.min(
|
|
3123
3127
|
l.duration,
|
|
3124
3128
|
l.currentTime + e
|
|
3125
3129
|
);
|
|
3126
|
-
a.seekTo(
|
|
3130
|
+
a.seekTo(d);
|
|
3127
3131
|
break;
|
|
3128
3132
|
case "ArrowUp":
|
|
3129
3133
|
n.preventDefault();
|
|
@@ -3166,10 +3170,10 @@ class _r {
|
|
|
3166
3170
|
try {
|
|
3167
3171
|
const n = await this.fetchVAST(e), o = this.parseXML(n), l = o.querySelector("Wrapper");
|
|
3168
3172
|
if (l) {
|
|
3169
|
-
const
|
|
3170
|
-
if (!
|
|
3173
|
+
const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3174
|
+
if (!c)
|
|
3171
3175
|
throw new Error("Wrapper missing VASTAdTagURI");
|
|
3172
|
-
return this.parse(
|
|
3176
|
+
return this.parse(c, t + 1, r);
|
|
3173
3177
|
}
|
|
3174
3178
|
return this.parseInline(o);
|
|
3175
3179
|
} catch (n) {
|
|
@@ -3229,14 +3233,14 @@ class _r {
|
|
|
3229
3233
|
try {
|
|
3230
3234
|
const l = o.querySelector("Wrapper");
|
|
3231
3235
|
if (l) {
|
|
3232
|
-
const
|
|
3233
|
-
if (
|
|
3234
|
-
const
|
|
3235
|
-
n.push(
|
|
3236
|
+
const c = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3237
|
+
if (c) {
|
|
3238
|
+
const d = await this.parse(c, 1);
|
|
3239
|
+
n.push(d);
|
|
3236
3240
|
}
|
|
3237
3241
|
} else {
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3242
|
+
const c = this.parseAdElement(o, r);
|
|
3243
|
+
c && n.push(c);
|
|
3240
3244
|
}
|
|
3241
3245
|
} catch (l) {
|
|
3242
3246
|
console.warn("[VASTParser] Failed to parse Ad in pod, skipping:", l);
|
|
@@ -3265,16 +3269,16 @@ class _r {
|
|
|
3265
3269
|
const T = Array.from(e.children).map((w) => w.tagName);
|
|
3266
3270
|
throw T.length === 0 ? new Error("VAST Ad element is empty (no ads available)") : new Error(`VAST InLine not found. Found: ${T.join(", ")}`);
|
|
3267
3271
|
}
|
|
3268
|
-
const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(),
|
|
3272
|
+
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);
|
|
3269
3273
|
if (!h) throw new Error("VAST MediaFile not found");
|
|
3270
|
-
const m = n.querySelector("ClickThrough")?.textContent?.trim(),
|
|
3274
|
+
const m = n.querySelector("ClickThrough")?.textContent?.trim(), A = this.parseTrackingEvents(n, t), I = this.getErrorUrls(t), C = this.parseCompanions(n);
|
|
3271
3275
|
return {
|
|
3272
3276
|
id: o,
|
|
3273
3277
|
title: l,
|
|
3274
|
-
duration:
|
|
3278
|
+
duration: d,
|
|
3275
3279
|
mediaFile: h,
|
|
3276
3280
|
clickThrough: m,
|
|
3277
|
-
trackingEvents:
|
|
3281
|
+
trackingEvents: A,
|
|
3278
3282
|
errorUrls: I,
|
|
3279
3283
|
companions: C.length > 0 ? C : void 0,
|
|
3280
3284
|
isVpaid: p,
|
|
@@ -3286,7 +3290,7 @@ class _r {
|
|
|
3286
3290
|
parseCompanions(e) {
|
|
3287
3291
|
const t = [];
|
|
3288
3292
|
return e.querySelectorAll("CompanionAds > Companion").forEach((i) => {
|
|
3289
|
-
const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0,
|
|
3293
|
+
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, A = c?.getAttribute("creativeType") ?? void 0, I = i.querySelector("CompanionClickThrough")?.textContent?.trim() ?? void 0, C = i.querySelector("AltText")?.textContent?.trim() ?? void 0, T = [];
|
|
3290
3294
|
i.querySelectorAll('TrackingEvents > Tracking[event="creativeView"]').forEach((w) => {
|
|
3291
3295
|
const y = w.textContent?.trim();
|
|
3292
3296
|
y && T.push(y);
|
|
@@ -3297,7 +3301,7 @@ class _r {
|
|
|
3297
3301
|
staticResource: p,
|
|
3298
3302
|
htmlResource: g,
|
|
3299
3303
|
iFrameResource: m,
|
|
3300
|
-
type:
|
|
3304
|
+
type: A,
|
|
3301
3305
|
clickThrough: I,
|
|
3302
3306
|
altText: C,
|
|
3303
3307
|
viewTrackingUrls: T.length > 0 ? T : void 0
|
|
@@ -3342,8 +3346,8 @@ class _r {
|
|
|
3342
3346
|
i.length > 0 && (r.impression = Array.from(i).map((o) => o.textContent?.trim()).filter(Boolean));
|
|
3343
3347
|
const n = ["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "skip", "pause", "resume"];
|
|
3344
3348
|
return e.querySelectorAll("Tracking").forEach((o) => {
|
|
3345
|
-
const l = o.getAttribute("event"),
|
|
3346
|
-
!l || !
|
|
3349
|
+
const l = o.getAttribute("event"), c = o.textContent?.trim();
|
|
3350
|
+
!l || !c || !n.includes(l) || (r[l] || (r[l] = []), r[l].push(c));
|
|
3347
3351
|
}), r;
|
|
3348
3352
|
}
|
|
3349
3353
|
/**
|
|
@@ -3369,12 +3373,12 @@ class Vr {
|
|
|
3369
3373
|
const t = await this.fetchVMAP(e), r = this.parseXML(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3370
3374
|
let n = r.querySelector("vmap\\:VMAP, VMAP");
|
|
3371
3375
|
if (!n) {
|
|
3372
|
-
const
|
|
3373
|
-
if (
|
|
3374
|
-
n =
|
|
3376
|
+
const c = r.getElementsByTagNameNS(i, "VMAP");
|
|
3377
|
+
if (c.length > 0)
|
|
3378
|
+
n = c[0];
|
|
3375
3379
|
else {
|
|
3376
|
-
const
|
|
3377
|
-
|
|
3380
|
+
const d = r.getElementsByTagName("VMAP");
|
|
3381
|
+
d.length > 0 && (n = d[0]);
|
|
3378
3382
|
}
|
|
3379
3383
|
}
|
|
3380
3384
|
if (!n)
|
|
@@ -3453,9 +3457,9 @@ class Vr {
|
|
|
3453
3457
|
const r = this.parseTimeOffset(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3454
3458
|
let n = e.querySelector("vmap\\:AdSource, AdSource");
|
|
3455
3459
|
if (!n) {
|
|
3456
|
-
const
|
|
3457
|
-
if (
|
|
3458
|
-
n =
|
|
3460
|
+
const d = e.getElementsByTagNameNS(i, "AdSource");
|
|
3461
|
+
if (d.length > 0)
|
|
3462
|
+
n = d[0];
|
|
3459
3463
|
else {
|
|
3460
3464
|
const h = e.getElementsByTagName("AdSource");
|
|
3461
3465
|
h.length > 0 && (n = h[0]);
|
|
@@ -3465,22 +3469,22 @@ class Vr {
|
|
|
3465
3469
|
return console.warn("[VMAPParser] AdBreak missing AdSource, skipping"), null;
|
|
3466
3470
|
let o = n.querySelector("vmap\\:AdTagURI, AdTagURI");
|
|
3467
3471
|
if (!o) {
|
|
3468
|
-
const
|
|
3469
|
-
if (
|
|
3470
|
-
o =
|
|
3472
|
+
const d = n.getElementsByTagNameNS(i, "AdTagURI");
|
|
3473
|
+
if (d.length > 0)
|
|
3474
|
+
o = d[0];
|
|
3471
3475
|
else {
|
|
3472
3476
|
const h = n.getElementsByTagName("AdTagURI");
|
|
3473
3477
|
h.length > 0 && (o = h[0]);
|
|
3474
3478
|
}
|
|
3475
3479
|
}
|
|
3476
3480
|
if (!o)
|
|
3477
|
-
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((
|
|
3481
|
+
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((d) => d.tagName)), null;
|
|
3478
3482
|
let l = o.textContent?.trim() || o.innerHTML?.trim();
|
|
3479
3483
|
if (!l)
|
|
3480
3484
|
return console.warn("[VMAPParser] AdTagURI is empty, skipping"), null;
|
|
3481
3485
|
l = l.replace(/<!\\[CDATA\\[(.*?)\\]\\]>/g, "$1").trim();
|
|
3482
|
-
const
|
|
3483
|
-
return
|
|
3486
|
+
const c = document.createElement("textarea");
|
|
3487
|
+
return c.innerHTML = l, l = c.value, console.log("[VMAPParser] AdBreak parsed:", {
|
|
3484
3488
|
timeOffset: r,
|
|
3485
3489
|
timeOffsetStr: t,
|
|
3486
3490
|
vastUrl: l.substring(0, 100) + (l.length > 100 ? "..." : "")
|
|
@@ -3705,20 +3709,20 @@ class Br {
|
|
|
3705
3709
|
window.getVPAIDAd = function() { return typeof window.VPAIDCreative !== 'undefined' ? new window.VPAIDCreative() : null; };
|
|
3706
3710
|
<\/script>
|
|
3707
3711
|
</body></html>`), l.close(), this.vpaidIframe.onload = () => {
|
|
3708
|
-
const
|
|
3709
|
-
if (!
|
|
3712
|
+
const d = this.vpaidIframe?.contentWindow?.getVPAIDAd?.() ?? null;
|
|
3713
|
+
if (!d) {
|
|
3710
3714
|
console.warn("[AdPlayer] VPAID creative not found in iframe, skipping"), this.hideLoadingCallback && this.hideLoadingCallback(), t();
|
|
3711
3715
|
return;
|
|
3712
3716
|
}
|
|
3713
|
-
this.vpaidCreative =
|
|
3717
|
+
this.vpaidCreative = d, d.handshakeVersion("2.0"), d.subscribe(t, "AdStopped"), d.subscribe(t, "AdVideoComplete"), d.subscribe(t, "AdSkipped"), d.subscribe(() => {
|
|
3714
3718
|
this.hideLoadingCallback && this.hideLoadingCallback(), this.tracker.trackStart(e);
|
|
3715
|
-
}, "AdStarted"),
|
|
3719
|
+
}, "AdStarted"), d.subscribe(() => {
|
|
3716
3720
|
r(new Error("VPAID AdError"));
|
|
3717
|
-
}, "AdError"),
|
|
3721
|
+
}, "AdError"), d.initAd(n, o, "normal", -1, { AdParameters: "" }, {
|
|
3718
3722
|
slot: i,
|
|
3719
3723
|
videoSlot: this.adVideo,
|
|
3720
3724
|
videoSlotCanAutoPlay: !0
|
|
3721
|
-
}),
|
|
3725
|
+
}), d.startAd();
|
|
3722
3726
|
};
|
|
3723
3727
|
});
|
|
3724
3728
|
}
|
|
@@ -3807,12 +3811,12 @@ class Br {
|
|
|
3807
3811
|
const i = this.adVideo;
|
|
3808
3812
|
let n = !1;
|
|
3809
3813
|
const o = () => {
|
|
3810
|
-
i.play().catch((
|
|
3811
|
-
n || (m(), r(
|
|
3814
|
+
i.play().catch((A) => {
|
|
3815
|
+
n || (m(), r(A));
|
|
3812
3816
|
});
|
|
3813
|
-
}, l = () => this.tracker.trackStart(e),
|
|
3817
|
+
}, l = () => this.tracker.trackStart(e), c = () => {
|
|
3814
3818
|
console.log("[AdPlayer] Ad video playing, hiding loading..."), this.hideLoadingCallback && this.hideLoadingCallback();
|
|
3815
|
-
},
|
|
3819
|
+
}, d = () => this.updateUI(e), h = () => {
|
|
3816
3820
|
n || (m(), t());
|
|
3817
3821
|
};
|
|
3818
3822
|
let p = !1;
|
|
@@ -3822,22 +3826,22 @@ class Br {
|
|
|
3822
3826
|
t();
|
|
3823
3827
|
return;
|
|
3824
3828
|
}
|
|
3825
|
-
const
|
|
3826
|
-
if (
|
|
3829
|
+
const A = i.error?.code;
|
|
3830
|
+
if (A === 4) {
|
|
3827
3831
|
m(), t();
|
|
3828
3832
|
return;
|
|
3829
3833
|
}
|
|
3830
|
-
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${
|
|
3834
|
+
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${A})`));
|
|
3831
3835
|
}, m = () => {
|
|
3832
3836
|
if (!n) {
|
|
3833
3837
|
n = !0;
|
|
3834
3838
|
try {
|
|
3835
|
-
i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing",
|
|
3839
|
+
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);
|
|
3836
3840
|
} catch {
|
|
3837
3841
|
}
|
|
3838
3842
|
}
|
|
3839
3843
|
};
|
|
3840
|
-
i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing",
|
|
3844
|
+
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(() => {
|
|
3841
3845
|
this.state.isPlaying && this.state.currentTime === 0 && !n && (m(), r(new Error("Ad video timeout")));
|
|
3842
3846
|
}, this.config.timeout || 1e4);
|
|
3843
3847
|
});
|
|
@@ -4205,29 +4209,29 @@ class $r {
|
|
|
4205
4209
|
this.hideAdLoading(), this.adPlayer.destroy(), this.preRollPlayed = !1, this.midRollsPlayed.clear(), this.postRollPlayed = !1, this.vmapData = null, console.log("[AdManager] Destroyed");
|
|
4206
4210
|
}
|
|
4207
4211
|
}
|
|
4208
|
-
const
|
|
4212
|
+
const ct = {
|
|
4209
4213
|
bottomOffset: 110,
|
|
4210
4214
|
fontSize: 18,
|
|
4211
4215
|
color: "#ffffff",
|
|
4212
4216
|
background: "rgba(0,0,0,0.75)"
|
|
4213
|
-
},
|
|
4214
|
-
style:
|
|
4217
|
+
}, dt = ce({
|
|
4218
|
+
style: ct,
|
|
4215
4219
|
setStyle: () => {
|
|
4216
4220
|
}
|
|
4217
4221
|
});
|
|
4218
4222
|
function Fr({ children: a }) {
|
|
4219
|
-
const [e, t] = b(
|
|
4220
|
-
return /* @__PURE__ */ s(
|
|
4223
|
+
const [e, t] = b(ct), r = (i) => t((n) => ({ ...n, ...i }));
|
|
4224
|
+
return /* @__PURE__ */ s(dt.Provider, { value: { style: e, setStyle: r }, children: a });
|
|
4221
4225
|
}
|
|
4222
4226
|
function ut() {
|
|
4223
|
-
return re(
|
|
4227
|
+
return re(dt);
|
|
4224
4228
|
}
|
|
4225
4229
|
function Ur({ videoElement: a }) {
|
|
4226
4230
|
const { style: e } = ut(), [t, r] = b([]), i = O(""), n = O(0);
|
|
4227
4231
|
return k(() => {
|
|
4228
4232
|
if (!a) return;
|
|
4229
4233
|
const o = () => {
|
|
4230
|
-
const l = a.textTracks,
|
|
4234
|
+
const l = a.textTracks, c = [];
|
|
4231
4235
|
for (let h = 0; h < l.length; h++) {
|
|
4232
4236
|
const p = l[h];
|
|
4233
4237
|
if (p.kind !== "subtitles" && p.kind !== "captions" || p.mode === "disabled") continue;
|
|
@@ -4235,12 +4239,12 @@ function Ur({ videoElement: a }) {
|
|
|
4235
4239
|
const g = p.activeCues;
|
|
4236
4240
|
if (g)
|
|
4237
4241
|
for (let m = 0; m < g.length; m++) {
|
|
4238
|
-
const
|
|
4239
|
-
|
|
4242
|
+
const A = g[m];
|
|
4243
|
+
A.text && c.push(A.text);
|
|
4240
4244
|
}
|
|
4241
4245
|
}
|
|
4242
|
-
const
|
|
4243
|
-
|
|
4246
|
+
const d = c.join("\0");
|
|
4247
|
+
d !== i.current && (i.current = d, r(c)), n.current = requestAnimationFrame(o);
|
|
4244
4248
|
};
|
|
4245
4249
|
return n.current = requestAnimationFrame(o), () => {
|
|
4246
4250
|
cancelAnimationFrame(n.current);
|
|
@@ -4285,7 +4289,7 @@ function Ur({ videoElement: a }) {
|
|
|
4285
4289
|
}
|
|
4286
4290
|
);
|
|
4287
4291
|
}
|
|
4288
|
-
const He =
|
|
4292
|
+
const He = ce(!0);
|
|
4289
4293
|
function wi({
|
|
4290
4294
|
src: a = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
|
4291
4295
|
defaultControls: e = !1,
|
|
@@ -4295,14 +4299,14 @@ function wi({
|
|
|
4295
4299
|
className: n,
|
|
4296
4300
|
children: o,
|
|
4297
4301
|
config: l,
|
|
4298
|
-
onAdLoading:
|
|
4299
|
-
onNextEpisode:
|
|
4302
|
+
onAdLoading: c,
|
|
4303
|
+
onNextEpisode: d,
|
|
4300
4304
|
nextEpisodeTitle: h,
|
|
4301
4305
|
nextEpisodeThumbnail: p,
|
|
4302
4306
|
endCardCountdown: g = 5,
|
|
4303
4307
|
crossOrigin: m
|
|
4304
4308
|
}) {
|
|
4305
|
-
const
|
|
4309
|
+
const A = O(null), I = O(null), [C, T] = b(null), w = O(null), [y, G] = b(!1), [X, D] = b(!1), S = $(() => D(!0), []), _ = $(() => D(!1), []), [W, E] = b(!1), { onTouchStart: M, onTouchMove: N, onTouchEnd: H, gestureHint: Q } = Lr({
|
|
4306
4310
|
player: C,
|
|
4307
4311
|
skipSec: 10
|
|
4308
4312
|
}), { isActive: L } = Dr({
|
|
@@ -4313,7 +4317,7 @@ function wi({
|
|
|
4313
4317
|
player: C,
|
|
4314
4318
|
seekStep: 10,
|
|
4315
4319
|
enabled: !0,
|
|
4316
|
-
onShowShortcuts:
|
|
4320
|
+
onShowShortcuts: S
|
|
4317
4321
|
});
|
|
4318
4322
|
const B = Ue(() => !l?.ads?.enabled || !l.ads.vastUrl && !l.ads.vmapUrl ? null : {
|
|
4319
4323
|
enabled: !0,
|
|
@@ -4331,17 +4335,17 @@ function wi({
|
|
|
4331
4335
|
l?.ads?.maxWrapperDepth
|
|
4332
4336
|
]);
|
|
4333
4337
|
k(() => {
|
|
4334
|
-
if (!I.current || !
|
|
4338
|
+
if (!I.current || !A.current) return;
|
|
4335
4339
|
console.log("[Player] Initializing PlayerCore");
|
|
4336
4340
|
const F = new fe(I.current);
|
|
4337
|
-
return fe.preloadEngines(), F.container =
|
|
4341
|
+
return fe.preloadEngines(), F.container = A.current, T(F), () => {
|
|
4338
4342
|
console.log("[Player] Cleanup called - destroying PlayerCore"), w.current && (console.log("[Player] Destroying AdManager"), w.current.destroy(), w.current = null), F.destroy(), T(null);
|
|
4339
4343
|
};
|
|
4340
4344
|
}, []), k(() => {
|
|
4341
4345
|
if (!C || !B) return;
|
|
4342
4346
|
console.log("[Player] Setting up ads");
|
|
4343
4347
|
const F = (J) => {
|
|
4344
|
-
G(J),
|
|
4348
|
+
G(J), c?.(J);
|
|
4345
4349
|
}, Z = new $r(C, B, F);
|
|
4346
4350
|
return w.current = Z, Z.setup().catch((J) => {
|
|
4347
4351
|
console.error("[Player] Failed to setup ads:", J);
|
|
@@ -4359,16 +4363,16 @@ function wi({
|
|
|
4359
4363
|
console.error("[Player] setSource failed:", F);
|
|
4360
4364
|
}));
|
|
4361
4365
|
}, [C, a]), k(() => {
|
|
4362
|
-
if (!C || !
|
|
4366
|
+
if (!C || !d) return;
|
|
4363
4367
|
const F = C.getVideoElement();
|
|
4364
4368
|
if (!F) return;
|
|
4365
4369
|
const Z = () => E(!0);
|
|
4366
4370
|
return F.addEventListener("ended", Z), () => F.removeEventListener("ended", Z);
|
|
4367
|
-
}, [C,
|
|
4371
|
+
}, [C, d]), /* @__PURE__ */ u(Fr, { children: [
|
|
4368
4372
|
/* @__PURE__ */ u(
|
|
4369
4373
|
"div",
|
|
4370
4374
|
{
|
|
4371
|
-
ref:
|
|
4375
|
+
ref: A,
|
|
4372
4376
|
role: "region",
|
|
4373
4377
|
"aria-label": "Video Player",
|
|
4374
4378
|
className: `playron-wrapper ${n || ""}`,
|
|
@@ -4426,14 +4430,14 @@ function wi({
|
|
|
4426
4430
|
/* @__PURE__ */ s(Ur, { videoElement: I.current }),
|
|
4427
4431
|
/* @__PURE__ */ s(nr, { config: l, isAdLoading: y }),
|
|
4428
4432
|
/* @__PURE__ */ s(Pr, { type: Q?.type ?? null, value: Q?.value ?? "" }),
|
|
4429
|
-
/* @__PURE__ */ s(
|
|
4433
|
+
/* @__PURE__ */ s(Sr, { drmConfig: l?.drm }),
|
|
4430
4434
|
/* @__PURE__ */ s(Tr, { isOpen: X, onClose: _ }),
|
|
4431
|
-
|
|
4435
|
+
d && /* @__PURE__ */ s(
|
|
4432
4436
|
Mr,
|
|
4433
4437
|
{
|
|
4434
4438
|
isVisible: W,
|
|
4435
4439
|
onNextEpisode: () => {
|
|
4436
|
-
E(!1),
|
|
4440
|
+
E(!1), d();
|
|
4437
4441
|
},
|
|
4438
4442
|
onDismiss: () => E(!1),
|
|
4439
4443
|
countdownSec: g,
|
|
@@ -4494,9 +4498,9 @@ function zr({
|
|
|
4494
4498
|
style: o,
|
|
4495
4499
|
...l
|
|
4496
4500
|
}) {
|
|
4497
|
-
const
|
|
4501
|
+
const c = Y((g) => g.isPlaying), { togglePlay: d } = q(), h = async (g) => {
|
|
4498
4502
|
try {
|
|
4499
|
-
await
|
|
4503
|
+
await d();
|
|
4500
4504
|
} catch (m) {
|
|
4501
4505
|
console.error("Play/Pause error:", m);
|
|
4502
4506
|
}
|
|
@@ -4506,14 +4510,14 @@ function zr({
|
|
|
4506
4510
|
"button",
|
|
4507
4511
|
{
|
|
4508
4512
|
className: `virtus-btn virtus-play-button ${Hr.playButton} ${a || ""}`,
|
|
4509
|
-
"aria-label":
|
|
4513
|
+
"aria-label": c ? "Pause" : "Play",
|
|
4510
4514
|
onClick: h,
|
|
4511
4515
|
style: {
|
|
4512
4516
|
...p !== void 0 ? { "--btn-hover-bg": p } : {},
|
|
4513
4517
|
...o
|
|
4514
4518
|
},
|
|
4515
4519
|
...l,
|
|
4516
|
-
children:
|
|
4520
|
+
children: c ? i ?? /* @__PURE__ */ s(
|
|
4517
4521
|
"svg",
|
|
4518
4522
|
{
|
|
4519
4523
|
"aria-hidden": "true",
|
|
@@ -4612,7 +4616,7 @@ function jr({
|
|
|
4612
4616
|
style: o,
|
|
4613
4617
|
...l
|
|
4614
4618
|
}) {
|
|
4615
|
-
const { toggleFullscreen:
|
|
4619
|
+
const { toggleFullscreen: c } = q(), [d, h] = b(!1);
|
|
4616
4620
|
k(() => {
|
|
4617
4621
|
const m = () => {
|
|
4618
4622
|
h(!!document.fullscreenElement);
|
|
@@ -4622,20 +4626,20 @@ function jr({
|
|
|
4622
4626
|
};
|
|
4623
4627
|
}, []);
|
|
4624
4628
|
const p = (m) => {
|
|
4625
|
-
|
|
4629
|
+
c(), e?.(m);
|
|
4626
4630
|
}, g = typeof r == "string" ? r : r === !1 ? "transparent" : void 0;
|
|
4627
4631
|
return /* @__PURE__ */ s(
|
|
4628
4632
|
"button",
|
|
4629
4633
|
{
|
|
4630
4634
|
className: `virtus-btn virtus-fullscreen-button ${be.controlButton} ${a || ""}`,
|
|
4631
|
-
"aria-label":
|
|
4635
|
+
"aria-label": d ? "Exit Fullscreen" : "Fullscreen",
|
|
4632
4636
|
onClick: p,
|
|
4633
4637
|
style: {
|
|
4634
4638
|
...g !== void 0 ? { "--btn-hover-bg": g } : {},
|
|
4635
4639
|
...o
|
|
4636
4640
|
},
|
|
4637
4641
|
...l,
|
|
4638
|
-
children:
|
|
4642
|
+
children: d ? n ?? /* @__PURE__ */ s(
|
|
4639
4643
|
"svg",
|
|
4640
4644
|
{
|
|
4641
4645
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4676,8 +4680,8 @@ function Kr({ className: a, onClick: e, ...t }) {
|
|
|
4676
4680
|
const o = async (l) => {
|
|
4677
4681
|
try {
|
|
4678
4682
|
await r();
|
|
4679
|
-
} catch (
|
|
4680
|
-
console.error("PiP toggle error:",
|
|
4683
|
+
} catch (c) {
|
|
4684
|
+
console.error("PiP toggle error:", c);
|
|
4681
4685
|
}
|
|
4682
4686
|
e?.(l);
|
|
4683
4687
|
};
|
|
@@ -4794,7 +4798,7 @@ function Yr(a, e, t = !0) {
|
|
|
4794
4798
|
};
|
|
4795
4799
|
}, [a, e, t]);
|
|
4796
4800
|
}
|
|
4797
|
-
const Te =
|
|
4801
|
+
const Te = ce({
|
|
4798
4802
|
isOpen: !1,
|
|
4799
4803
|
toggle: () => {
|
|
4800
4804
|
},
|
|
@@ -4804,7 +4808,7 @@ const Te = de({
|
|
|
4804
4808
|
}
|
|
4805
4809
|
});
|
|
4806
4810
|
function ht({ children: a }) {
|
|
4807
|
-
const [e, t] = b(!1), r = O(null), i = () => t((
|
|
4811
|
+
const [e, t] = b(!1), r = O(null), i = () => t((c) => !c), n = () => t(!1), o = () => t(!0);
|
|
4808
4812
|
Yr(r, n, e);
|
|
4809
4813
|
const l = {
|
|
4810
4814
|
isOpen: e,
|
|
@@ -5008,16 +5012,16 @@ function We({
|
|
|
5008
5012
|
}
|
|
5009
5013
|
);
|
|
5010
5014
|
}
|
|
5011
|
-
function
|
|
5015
|
+
function Ai() {
|
|
5012
5016
|
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];
|
|
5013
5017
|
k(() => {
|
|
5014
5018
|
e?.playbackRate !== void 0 && r(e.playbackRate);
|
|
5015
5019
|
}, [e?.playbackRate]);
|
|
5016
|
-
const l = (
|
|
5017
|
-
a.setPlaybackRate(
|
|
5018
|
-
},
|
|
5019
|
-
const
|
|
5020
|
-
n(
|
|
5020
|
+
const l = (d) => {
|
|
5021
|
+
a.setPlaybackRate(d), r(d);
|
|
5022
|
+
}, c = () => {
|
|
5023
|
+
const d = !i;
|
|
5024
|
+
n(d), a.setLoop(d);
|
|
5021
5025
|
};
|
|
5022
5026
|
return /* @__PURE__ */ u(ht, { children: [
|
|
5023
5027
|
/* @__PURE__ */ s(pt, { children: /* @__PURE__ */ s(
|
|
@@ -5037,11 +5041,11 @@ function Si() {
|
|
|
5037
5041
|
cursor: "pointer",
|
|
5038
5042
|
transition: "all 0.2s ease"
|
|
5039
5043
|
},
|
|
5040
|
-
onMouseEnter: (
|
|
5041
|
-
|
|
5044
|
+
onMouseEnter: (d) => {
|
|
5045
|
+
d.currentTarget.style.background = "rgba(255, 255, 255, 0.2)", d.currentTarget.style.transform = "scale(1.05)";
|
|
5042
5046
|
},
|
|
5043
|
-
onMouseLeave: (
|
|
5044
|
-
|
|
5047
|
+
onMouseLeave: (d) => {
|
|
5048
|
+
d.currentTarget.style.background = "rgba(255, 255, 255, 0.1)", d.currentTarget.style.transform = "scale(1)";
|
|
5045
5049
|
},
|
|
5046
5050
|
children: /* @__PURE__ */ u(
|
|
5047
5051
|
"svg",
|
|
@@ -5063,20 +5067,20 @@ function Si() {
|
|
|
5063
5067
|
) }),
|
|
5064
5068
|
/* @__PURE__ */ u(gt, { title: "Settings", placement: "top-right", children: [
|
|
5065
5069
|
/* @__PURE__ */ s("div", { style: { padding: "8px 16px 4px", color: "rgba(255, 255, 255, 0.6)", fontSize: "12px", fontWeight: 600 }, children: "Playback Speed" }),
|
|
5066
|
-
o.map((
|
|
5070
|
+
o.map((d) => /* @__PURE__ */ u(
|
|
5067
5071
|
We,
|
|
5068
5072
|
{
|
|
5069
|
-
selected: t ===
|
|
5070
|
-
onClick: () => l(
|
|
5073
|
+
selected: t === d,
|
|
5074
|
+
onClick: () => l(d),
|
|
5071
5075
|
children: [
|
|
5072
|
-
|
|
5076
|
+
d,
|
|
5073
5077
|
"x"
|
|
5074
5078
|
]
|
|
5075
5079
|
},
|
|
5076
|
-
|
|
5080
|
+
d
|
|
5077
5081
|
)),
|
|
5078
5082
|
/* @__PURE__ */ s("div", { style: { height: "1px", background: "rgba(255, 255, 255, 0.1)", margin: "8px 0" } }),
|
|
5079
|
-
/* @__PURE__ */ u(We, { selected: i, onClick:
|
|
5083
|
+
/* @__PURE__ */ u(We, { selected: i, onClick: c, children: [
|
|
5080
5084
|
"Loop ",
|
|
5081
5085
|
i ? "On" : "Off"
|
|
5082
5086
|
] })
|
|
@@ -5184,23 +5188,23 @@ const ri = "_container_6dw0q_3", ii = "_skipButton_6dw0q_11", Fe = {
|
|
|
5184
5188
|
container: ri,
|
|
5185
5189
|
skipButton: ii
|
|
5186
5190
|
};
|
|
5187
|
-
function
|
|
5191
|
+
function Si({ introOutro: a }) {
|
|
5188
5192
|
const { currentTime: e } = Y(), { seekTo: t } = q(), [r, i] = b(!1), [n, o] = b(!1);
|
|
5189
5193
|
k(() => {
|
|
5190
5194
|
if (a) {
|
|
5191
5195
|
if (a.intro) {
|
|
5192
|
-
const
|
|
5193
|
-
i(
|
|
5196
|
+
const d = e >= a.intro.start && e < a.intro.end;
|
|
5197
|
+
i(d);
|
|
5194
5198
|
}
|
|
5195
5199
|
if (a.outro) {
|
|
5196
|
-
const
|
|
5197
|
-
o(
|
|
5200
|
+
const d = e >= a.outro.start && e < a.outro.end;
|
|
5201
|
+
o(d);
|
|
5198
5202
|
}
|
|
5199
5203
|
}
|
|
5200
5204
|
}, [e, a]);
|
|
5201
5205
|
const l = $(() => {
|
|
5202
5206
|
a?.intro && (t(a.intro.end), i(!1));
|
|
5203
|
-
}, [a, t]),
|
|
5207
|
+
}, [a, t]), c = $(() => {
|
|
5204
5208
|
a?.outro && (t(a.outro.end), o(!1));
|
|
5205
5209
|
}, [a, t]);
|
|
5206
5210
|
return !r && !n ? null : /* @__PURE__ */ u("div", { className: Fe.container, children: [
|
|
@@ -5217,7 +5221,7 @@ function Ai({ introOutro: a }) {
|
|
|
5217
5221
|
}
|
|
5218
5222
|
)
|
|
5219
5223
|
] }),
|
|
5220
|
-
n && /* @__PURE__ */ u("button", { onClick:
|
|
5224
|
+
n && /* @__PURE__ */ u("button", { onClick: c, className: Fe.skipButton, children: [
|
|
5221
5225
|
/* @__PURE__ */ s("span", { children: "Skip Outro" }),
|
|
5222
5226
|
/* @__PURE__ */ s(
|
|
5223
5227
|
"svg",
|
|
@@ -5264,7 +5268,7 @@ function ni({
|
|
|
5264
5268
|
showTooltip: r = !0,
|
|
5265
5269
|
onClick: i
|
|
5266
5270
|
}) {
|
|
5267
|
-
const [n, o] = b(!1), l = Qe[a.type] || Qe.event,
|
|
5271
|
+
const [n, o] = b(!1), l = Qe[a.type] || Qe.event, c = a.icon || l.icon, d = a.color || l.color, h = (p) => {
|
|
5268
5272
|
p.stopPropagation(), i && i(a.time);
|
|
5269
5273
|
};
|
|
5270
5274
|
return /* @__PURE__ */ u(
|
|
@@ -5294,7 +5298,7 @@ function ni({
|
|
|
5294
5298
|
display: "flex",
|
|
5295
5299
|
alignItems: "center",
|
|
5296
5300
|
justifyContent: "center",
|
|
5297
|
-
backgroundColor:
|
|
5301
|
+
backgroundColor: d,
|
|
5298
5302
|
border: "2px solid rgba(255, 255, 255, 0.9)",
|
|
5299
5303
|
boxShadow: n ? "0 4px 16px rgba(0, 0, 0, 0.4)" : "0 2px 8px rgba(0, 0, 0, 0.4)",
|
|
5300
5304
|
transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -5310,7 +5314,7 @@ function ni({
|
|
|
5310
5314
|
display: "inline-block",
|
|
5311
5315
|
transform: "translateY(-1px)"
|
|
5312
5316
|
},
|
|
5313
|
-
children:
|
|
5317
|
+
children: c
|
|
5314
5318
|
}
|
|
5315
5319
|
)
|
|
5316
5320
|
}
|
|
@@ -5386,16 +5390,16 @@ class si {
|
|
|
5386
5390
|
for (; n < i.length; ) {
|
|
5387
5391
|
const o = i[n].trim();
|
|
5388
5392
|
if (o.includes("-->")) {
|
|
5389
|
-
const [l,
|
|
5393
|
+
const [l, c] = o.split("-->").map((m) => m.trim()), d = this.parseTime(l), h = this.parseTime(c);
|
|
5390
5394
|
n++;
|
|
5391
5395
|
const p = [];
|
|
5392
5396
|
for (; n < i.length && i[n].trim() !== "" && !i[n].includes("-->"); )
|
|
5393
5397
|
p.push(i[n].trim()), n++;
|
|
5394
5398
|
const g = p.join(`
|
|
5395
5399
|
`).trim();
|
|
5396
|
-
if (g &&
|
|
5400
|
+
if (g && d >= 0 && h > d) {
|
|
5397
5401
|
const m = this.parseCueLine(g, t);
|
|
5398
|
-
m && r.push({ startTime:
|
|
5402
|
+
m && r.push({ startTime: d, endTime: h, ...m });
|
|
5399
5403
|
}
|
|
5400
5404
|
} else
|
|
5401
5405
|
n++;
|
|
@@ -5404,15 +5408,15 @@ class si {
|
|
|
5404
5408
|
}
|
|
5405
5409
|
parseCueLine(e, t) {
|
|
5406
5410
|
const r = e.lastIndexOf("#xywh=");
|
|
5407
|
-
let i, n = 0, o = 0, l = 0,
|
|
5411
|
+
let i, n = 0, o = 0, l = 0, c = 0;
|
|
5408
5412
|
if (r !== -1) {
|
|
5409
5413
|
i = e.slice(0, r);
|
|
5410
5414
|
const h = e.slice(r + 6).split(",").map(Number);
|
|
5411
|
-
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l,
|
|
5415
|
+
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l, c] = h);
|
|
5412
5416
|
} else
|
|
5413
5417
|
i = e;
|
|
5414
|
-
const
|
|
5415
|
-
return
|
|
5418
|
+
const d = this.resolveUrl(i.trim(), t);
|
|
5419
|
+
return d ? { url: d, x: n, y: o, w: l, h: c } : null;
|
|
5416
5420
|
}
|
|
5417
5421
|
resolveUrl(e, t) {
|
|
5418
5422
|
if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//"))
|
|
@@ -5438,7 +5442,7 @@ function ai({
|
|
|
5438
5442
|
thumbnailsVttUrl: n,
|
|
5439
5443
|
seekBarStyle: o
|
|
5440
5444
|
}) {
|
|
5441
|
-
const l = re(He),
|
|
5445
|
+
const l = re(He), c = O(null), [d, h] = b(!1), [p, g] = b(null), [m, A] = b(null), [I, C] = b([]), T = O(null), { currentTime: w, duration: y, isLive: G, isPlaying: X, playbackRate: D } = Y(), { seekTo: S, getDVRRange: _, getBufferedRanges: W } = q(), [E, M] = b(w), N = O(null), H = O({ time: w, ts: performance.now() });
|
|
5442
5446
|
k(() => {
|
|
5443
5447
|
H.current = { time: w, ts: performance.now() }, M(w);
|
|
5444
5448
|
}, [w]);
|
|
@@ -5463,21 +5467,21 @@ function ai({
|
|
|
5463
5467
|
}, 500);
|
|
5464
5468
|
return () => clearInterval(v);
|
|
5465
5469
|
}, [W]);
|
|
5466
|
-
const L = a === "live" || !!G, B = L ? _() : null, P = B !== null && B.end - B.start > 5, F = P ? B.end - B.start : 0, Z = P && F > 0 ? (E - B.start) / F * 100 : 0, J = L ? Math.min(100, Math.max(0, Z)) : y > 0 ? E / y * 100 : 0, Ee = o?.trackColor ?? "rgba(255, 255, 255, 0.3)", ae = o?.progressColor ?? (L ? "#ff2020" : "#6366f1"),
|
|
5470
|
+
const L = a === "live" || !!G, B = L ? _() : null, P = B !== null && B.end - B.start > 5, F = P ? B.end - B.start : 0, Z = P && F > 0 ? (E - B.start) / F * 100 : 0, J = L ? Math.min(100, Math.max(0, Z)) : y > 0 ? E / y * 100 : 0, Ee = 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) => {
|
|
5467
5471
|
if (!isFinite(v) || isNaN(v)) return "0:00";
|
|
5468
5472
|
const R = Math.floor(v / 3600), V = Math.floor(v % 3600 / 60), U = Math.floor(v % 60);
|
|
5469
5473
|
return R > 0 ? `${R}:${V.toString().padStart(2, "0")}:${U.toString().padStart(2, "0")}` : `${V}:${U.toString().padStart(2, "0")}`;
|
|
5470
5474
|
}, ve = (v) => {
|
|
5471
|
-
if (!
|
|
5472
|
-
const R =
|
|
5475
|
+
if (!c.current) return 0;
|
|
5476
|
+
const R = c.current.getBoundingClientRect(), V = (v.clientX - R.left) / R.width;
|
|
5473
5477
|
return Math.max(0, Math.min(1, V));
|
|
5474
5478
|
}, we = (v) => {
|
|
5475
5479
|
if (!(L && !P)) {
|
|
5476
5480
|
if (L && P) {
|
|
5477
|
-
|
|
5481
|
+
S(B.start + v * F);
|
|
5478
5482
|
return;
|
|
5479
5483
|
}
|
|
5480
|
-
y !== 0 &&
|
|
5484
|
+
y !== 0 && S(v * y);
|
|
5481
5485
|
}
|
|
5482
5486
|
}, De = (v) => {
|
|
5483
5487
|
if (L && !P) return;
|
|
@@ -5485,19 +5489,19 @@ function ai({
|
|
|
5485
5489
|
const R = ve(v);
|
|
5486
5490
|
we(R);
|
|
5487
5491
|
}, Ie = (v) => {
|
|
5488
|
-
if (!
|
|
5492
|
+
if (!c.current) return;
|
|
5489
5493
|
const R = ve(v);
|
|
5490
5494
|
if (g(R), T.current) {
|
|
5491
5495
|
const V = P ? B.start + R * F : R * y;
|
|
5492
|
-
|
|
5496
|
+
A(T.current.getThumbnailAt(V));
|
|
5493
5497
|
}
|
|
5494
5498
|
}, _e = () => {
|
|
5495
|
-
g(null),
|
|
5499
|
+
g(null), A(null);
|
|
5496
5500
|
};
|
|
5497
5501
|
return k(() => {
|
|
5498
|
-
if (!
|
|
5502
|
+
if (!d) return;
|
|
5499
5503
|
const v = (V) => {
|
|
5500
|
-
if (!
|
|
5504
|
+
if (!c.current) return;
|
|
5501
5505
|
const U = ve(V);
|
|
5502
5506
|
g(U), we(U);
|
|
5503
5507
|
}, R = () => {
|
|
@@ -5506,7 +5510,7 @@ function ai({
|
|
|
5506
5510
|
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", R), () => {
|
|
5507
5511
|
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", R);
|
|
5508
5512
|
};
|
|
5509
|
-
}, [
|
|
5513
|
+
}, [d, y]), /* @__PURE__ */ u(
|
|
5510
5514
|
"div",
|
|
5511
5515
|
{
|
|
5512
5516
|
style: {
|
|
@@ -5607,7 +5611,7 @@ function ai({
|
|
|
5607
5611
|
/* @__PURE__ */ u(
|
|
5608
5612
|
"div",
|
|
5609
5613
|
{
|
|
5610
|
-
ref:
|
|
5614
|
+
ref: c,
|
|
5611
5615
|
role: L && !P ? void 0 : "slider",
|
|
5612
5616
|
tabIndex: L && !P ? void 0 : 0,
|
|
5613
5617
|
"aria-label": L ? "DVR seek" : "Seek",
|
|
@@ -5626,23 +5630,23 @@ function ai({
|
|
|
5626
5630
|
switch (v.key) {
|
|
5627
5631
|
case "ArrowLeft":
|
|
5628
5632
|
case "ArrowDown":
|
|
5629
|
-
v.preventDefault(),
|
|
5633
|
+
v.preventDefault(), S(Math.max(U, w - R));
|
|
5630
5634
|
break;
|
|
5631
5635
|
case "ArrowRight":
|
|
5632
5636
|
case "ArrowUp":
|
|
5633
|
-
v.preventDefault(),
|
|
5637
|
+
v.preventDefault(), S(Math.min(ee, w + R));
|
|
5634
5638
|
break;
|
|
5635
5639
|
case "PageDown":
|
|
5636
|
-
v.preventDefault(),
|
|
5640
|
+
v.preventDefault(), S(Math.max(U, w - V));
|
|
5637
5641
|
break;
|
|
5638
5642
|
case "PageUp":
|
|
5639
|
-
v.preventDefault(),
|
|
5643
|
+
v.preventDefault(), S(Math.min(ee, w + V));
|
|
5640
5644
|
break;
|
|
5641
5645
|
case "Home":
|
|
5642
|
-
v.preventDefault(),
|
|
5646
|
+
v.preventDefault(), S(U);
|
|
5643
5647
|
break;
|
|
5644
5648
|
case "End":
|
|
5645
|
-
v.preventDefault(),
|
|
5649
|
+
v.preventDefault(), S(ee);
|
|
5646
5650
|
break;
|
|
5647
5651
|
}
|
|
5648
5652
|
},
|
|
@@ -5680,7 +5684,7 @@ function ai({
|
|
|
5680
5684
|
top: 0,
|
|
5681
5685
|
height: "100%",
|
|
5682
5686
|
width: `${U}%`,
|
|
5683
|
-
backgroundColor:
|
|
5687
|
+
backgroundColor: de,
|
|
5684
5688
|
borderRadius: `${ue}px`,
|
|
5685
5689
|
pointerEvents: "none"
|
|
5686
5690
|
}
|
|
@@ -5732,7 +5736,7 @@ function ai({
|
|
|
5732
5736
|
position: V,
|
|
5733
5737
|
size: i,
|
|
5734
5738
|
showTooltip: !0,
|
|
5735
|
-
onClick: (U) =>
|
|
5739
|
+
onClick: (U) => S(U)
|
|
5736
5740
|
},
|
|
5737
5741
|
`timeline-${R}-${v.time}`
|
|
5738
5742
|
);
|
|
@@ -5782,15 +5786,15 @@ function ai({
|
|
|
5782
5786
|
left: `${J}%`,
|
|
5783
5787
|
top: "50%",
|
|
5784
5788
|
transform: "translate(-50%, -50%)",
|
|
5785
|
-
width:
|
|
5786
|
-
height:
|
|
5789
|
+
width: d ? "16px" : "14px",
|
|
5790
|
+
height: d ? "16px" : "14px",
|
|
5787
5791
|
backgroundColor: j,
|
|
5788
5792
|
borderRadius: "50%",
|
|
5789
5793
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
5790
5794
|
pointerEvents: "none",
|
|
5791
5795
|
zIndex: 1e3,
|
|
5792
|
-
opacity:
|
|
5793
|
-
transition:
|
|
5796
|
+
opacity: d || p !== null ? 1 : 0,
|
|
5797
|
+
transition: d ? "none" : "all 0.15s ease"
|
|
5794
5798
|
}
|
|
5795
5799
|
}
|
|
5796
5800
|
)
|
|
@@ -5798,7 +5802,7 @@ function ai({
|
|
|
5798
5802
|
}
|
|
5799
5803
|
),
|
|
5800
5804
|
Pe && (!L || P) && p !== null && (() => {
|
|
5801
|
-
const v = P ? B.start + p * F : p * y, R =
|
|
5805
|
+
const v = P ? B.start + p * F : p * y, R = c.current?.offsetWidth ?? 0, V = p * 100, U = p * R, ee = Ze / 2;
|
|
5802
5806
|
let he = "-50%";
|
|
5803
5807
|
return U < ee ? he = "0%" : R - U < ee && (he = "-100%"), m ? (
|
|
5804
5808
|
/* Thumbnail card */
|
|
@@ -5960,7 +5964,7 @@ function li({
|
|
|
5960
5964
|
}
|
|
5961
5965
|
);
|
|
5962
5966
|
}
|
|
5963
|
-
function
|
|
5967
|
+
function ci({
|
|
5964
5968
|
seconds: a = 15,
|
|
5965
5969
|
iconSize: e = 24,
|
|
5966
5970
|
hoverBackground: t,
|
|
@@ -6024,7 +6028,7 @@ function di({
|
|
|
6024
6028
|
}
|
|
6025
6029
|
);
|
|
6026
6030
|
}
|
|
6027
|
-
function
|
|
6031
|
+
function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBackground: r }) {
|
|
6028
6032
|
const i = {
|
|
6029
6033
|
sliderBackground: e?.sliderBackground ?? "rgba(10, 10, 20, 0.88)",
|
|
6030
6034
|
borderColor: e?.borderColor ?? "rgba(255,255,255,0.1)",
|
|
@@ -6034,11 +6038,11 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6034
6038
|
trackColor: e?.trackColor ?? "rgba(255,255,255,0.3)",
|
|
6035
6039
|
fillColor: e?.fillColor ?? "#3b82f6",
|
|
6036
6040
|
handleColor: e?.handleColor ?? "#fff"
|
|
6037
|
-
}, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume:
|
|
6041
|
+
}, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume: c } = q(), [d, h] = b(!1), [p, g] = b(!1), m = O(null), A = a === "top" || a === "bottom", I = $((E, M) => {
|
|
6038
6042
|
if (!m.current) return;
|
|
6039
|
-
const N = m.current.getBoundingClientRect(), H =
|
|
6040
|
-
|
|
6041
|
-
}, [
|
|
6043
|
+
const N = m.current.getBoundingClientRect(), H = A ? Math.max(0, Math.min(1, 1 - (M - N.top) / N.height)) : Math.max(0, Math.min(1, (E - N.left) / N.width));
|
|
6044
|
+
c(H);
|
|
6045
|
+
}, [c, A]), C = $((E) => {
|
|
6042
6046
|
g(!0), n && l(), I(E.clientX, E.clientY);
|
|
6043
6047
|
}, [I, n, l]);
|
|
6044
6048
|
k(() => {
|
|
@@ -6048,7 +6052,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6048
6052
|
window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", M);
|
|
6049
6053
|
};
|
|
6050
6054
|
}, [p, I]);
|
|
6051
|
-
const T = p ? o : n ? 0 : o, w =
|
|
6055
|
+
const T = p ? o : n ? 0 : o, w = d || p, y = {
|
|
6052
6056
|
position: "absolute",
|
|
6053
6057
|
opacity: w ? 1 : 0,
|
|
6054
6058
|
transition: "all 0.25s ease",
|
|
@@ -6110,7 +6114,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6110
6114
|
borderLeft: "none"
|
|
6111
6115
|
};
|
|
6112
6116
|
}
|
|
6113
|
-
})(), X =
|
|
6117
|
+
})(), X = A ? { 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 = A ? { width: "4px", height: "100%", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" } : { width: "100%", height: "4px", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" }, S = A ? {
|
|
6114
6118
|
position: "absolute",
|
|
6115
6119
|
bottom: 0,
|
|
6116
6120
|
left: 0,
|
|
@@ -6128,7 +6132,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6128
6132
|
backgroundColor: i.fillColor,
|
|
6129
6133
|
borderRadius: "2px",
|
|
6130
6134
|
transition: p ? "none" : "width 0.1s ease"
|
|
6131
|
-
}, _ = p ? 14 : 12, W =
|
|
6135
|
+
}, _ = p ? 14 : 12, W = A ? {
|
|
6132
6136
|
position: "absolute",
|
|
6133
6137
|
bottom: `calc(${T * 100}% - ${T * _}px)`,
|
|
6134
6138
|
left: "50%",
|
|
@@ -6219,23 +6223,23 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6219
6223
|
switch (E.key) {
|
|
6220
6224
|
case "ArrowRight":
|
|
6221
6225
|
case "ArrowUp":
|
|
6222
|
-
E.preventDefault(),
|
|
6226
|
+
E.preventDefault(), c(Math.min(1, H + 0.05));
|
|
6223
6227
|
break;
|
|
6224
6228
|
case "ArrowLeft":
|
|
6225
6229
|
case "ArrowDown":
|
|
6226
|
-
E.preventDefault(),
|
|
6230
|
+
E.preventDefault(), c(Math.max(0, H - 0.05));
|
|
6227
6231
|
break;
|
|
6228
6232
|
case "PageUp":
|
|
6229
|
-
E.preventDefault(),
|
|
6233
|
+
E.preventDefault(), c(Math.min(1, H + 0.2));
|
|
6230
6234
|
break;
|
|
6231
6235
|
case "PageDown":
|
|
6232
|
-
E.preventDefault(),
|
|
6236
|
+
E.preventDefault(), c(Math.max(0, H - 0.2));
|
|
6233
6237
|
break;
|
|
6234
6238
|
case "Home":
|
|
6235
|
-
E.preventDefault(),
|
|
6239
|
+
E.preventDefault(), c(0);
|
|
6236
6240
|
break;
|
|
6237
6241
|
case "End":
|
|
6238
|
-
E.preventDefault(),
|
|
6242
|
+
E.preventDefault(), c(1);
|
|
6239
6243
|
break;
|
|
6240
6244
|
case "m":
|
|
6241
6245
|
case "M":
|
|
@@ -6245,7 +6249,7 @@ function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6245
6249
|
},
|
|
6246
6250
|
style: X,
|
|
6247
6251
|
children: /* @__PURE__ */ u("div", { style: D, children: [
|
|
6248
|
-
/* @__PURE__ */ s("div", { style:
|
|
6252
|
+
/* @__PURE__ */ s("div", { style: S }),
|
|
6249
6253
|
/* @__PURE__ */ s("div", { style: W })
|
|
6250
6254
|
] })
|
|
6251
6255
|
}
|
|
@@ -6338,7 +6342,7 @@ function Ci() {
|
|
|
6338
6342
|
] }) })
|
|
6339
6343
|
] });
|
|
6340
6344
|
}
|
|
6341
|
-
const ze =
|
|
6345
|
+
const ze = ce({
|
|
6342
6346
|
textColor: "#fff",
|
|
6343
6347
|
accentColor: "#6366f1",
|
|
6344
6348
|
accentAlpha15: "rgba(99,102,241,0.15)",
|
|
@@ -6387,16 +6391,16 @@ function et({ values: a, color: e, gradId: t }) {
|
|
|
6387
6391
|
const n = Math.max(...a, 1e-3), o = a.map((h, p) => [
|
|
6388
6392
|
p / (hi - 1) * 292,
|
|
6389
6393
|
48 - h / n * 42
|
|
6390
|
-
]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "),
|
|
6394
|
+
]), 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];
|
|
6391
6395
|
return /* @__PURE__ */ u("svg", { width: 292, height: 52, style: { display: "block", overflow: "visible" }, children: [
|
|
6392
6396
|
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ u("linearGradient", { id: t, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6393
6397
|
/* @__PURE__ */ s("stop", { offset: "0%", stopColor: e, stopOpacity: 0.4 }),
|
|
6394
6398
|
/* @__PURE__ */ s("stop", { offset: "100%", stopColor: e, stopOpacity: 0.02 })
|
|
6395
6399
|
] }) }),
|
|
6396
|
-
/* @__PURE__ */ s("path", { d, fill: `url(#${t})` }),
|
|
6400
|
+
/* @__PURE__ */ s("path", { d: c, fill: `url(#${t})` }),
|
|
6397
6401
|
/* @__PURE__ */ s("path", { d: l, fill: "none", stroke: e, strokeWidth: 1.8, strokeLinejoin: "round", strokeLinecap: "round" }),
|
|
6398
|
-
/* @__PURE__ */ s("circle", { cx:
|
|
6399
|
-
/* @__PURE__ */ s("circle", { cx:
|
|
6402
|
+
/* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 3.5, fill: e }),
|
|
6403
|
+
/* @__PURE__ */ s("circle", { cx: d[0], cy: d[1], r: 6, fill: e, fillOpacity: 0.25 })
|
|
6400
6404
|
] });
|
|
6401
6405
|
}
|
|
6402
6406
|
function z({
|
|
@@ -6407,7 +6411,7 @@ function z({
|
|
|
6407
6411
|
selected: i = !1,
|
|
6408
6412
|
isBack: n = !1
|
|
6409
6413
|
}) {
|
|
6410
|
-
const [o, l] = b(!1), { textColor:
|
|
6414
|
+
const [o, l] = b(!1), { textColor: c, accentColor: d, accentAlpha15: h, accentAlpha30: p, fontSize: g } = re(ze);
|
|
6411
6415
|
return /* @__PURE__ */ u(
|
|
6412
6416
|
"button",
|
|
6413
6417
|
{
|
|
@@ -6418,7 +6422,7 @@ function z({
|
|
|
6418
6422
|
onMouseLeave: () => l(!1),
|
|
6419
6423
|
style: {
|
|
6420
6424
|
...mi,
|
|
6421
|
-
color:
|
|
6425
|
+
color: c,
|
|
6422
6426
|
fontSize: g,
|
|
6423
6427
|
background: o ? "rgba(255,255,255,0.07)" : i ? h : "transparent",
|
|
6424
6428
|
fontWeight: i ? 600 : 400,
|
|
@@ -6435,9 +6439,9 @@ function z({
|
|
|
6435
6439
|
alignItems: "center",
|
|
6436
6440
|
justifyContent: "center",
|
|
6437
6441
|
flexShrink: 0,
|
|
6438
|
-
color: i ?
|
|
6442
|
+
color: i ? d : "rgba(255,255,255,0.65)",
|
|
6439
6443
|
transition: "background 0.15s, color 0.15s"
|
|
6440
|
-
}, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke:
|
|
6444
|
+
}, 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 } }),
|
|
6441
6445
|
/* @__PURE__ */ s("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
|
|
6442
6446
|
] }),
|
|
6443
6447
|
e !== void 0 && /* @__PURE__ */ u("span", { style: { display: "flex", alignItems: "center", gap: "4px", flexShrink: 0 }, children: [
|
|
@@ -6459,32 +6463,32 @@ function yi({
|
|
|
6459
6463
|
hoverBackground: r,
|
|
6460
6464
|
gearIcon: i
|
|
6461
6465
|
} = {}) {
|
|
6462
|
-
const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)",
|
|
6466
|
+
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 = {
|
|
6463
6467
|
textColor: o,
|
|
6464
6468
|
accentColor: n,
|
|
6465
6469
|
accentAlpha15: n.startsWith("#") ? Je(n, 0.15) : "rgba(99,102,241,0.15)",
|
|
6466
6470
|
accentAlpha30: n.startsWith("#") ? Je(n, 0.3) : "rgba(99,102,241,0.3)",
|
|
6467
|
-
borderColor:
|
|
6468
|
-
fontSize:
|
|
6471
|
+
borderColor: c.replace("0.1)", "0.07)"),
|
|
6472
|
+
fontSize: d
|
|
6469
6473
|
}, p = {
|
|
6470
6474
|
...fi,
|
|
6471
6475
|
color: o,
|
|
6472
|
-
fontSize:
|
|
6473
|
-
borderBottom: `1px solid ${
|
|
6476
|
+
fontSize: d,
|
|
6477
|
+
borderBottom: `1px solid ${c.replace("0.1)", "0.08)")}`
|
|
6474
6478
|
}, g = e?.vertical ?? "top", m = e?.horizontal ?? "right", {
|
|
6475
|
-
setQuality:
|
|
6479
|
+
setQuality: A,
|
|
6476
6480
|
setAudioTrack: I,
|
|
6477
6481
|
setPlaybackRate: C,
|
|
6478
6482
|
setSubtitleTrack: T,
|
|
6479
6483
|
getPlayerStats: w
|
|
6480
|
-
} = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle:
|
|
6484
|
+
} = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle: S } = ut(), [_, W] = b(!1), [E, M] = b("root");
|
|
6481
6485
|
k(() => {
|
|
6482
6486
|
X && E === "speed" && M("root");
|
|
6483
6487
|
}, [X, E]);
|
|
6484
|
-
const [N, H] = b([]), [Q, L] = b(null), [B, P] = b([]), [F, Z] = b(""), [J, Ee] = b([]), [ae,
|
|
6488
|
+
const [N, H] = b([]), [Q, L] = b(null), [B, P] = b([]), [F, Z] = b(""), [J, Ee] = b([]), [ae, de] = b(null), [j, Me] = b(null), [ue, me] = b([]);
|
|
6485
6489
|
k(() => {
|
|
6486
6490
|
const f = () => {
|
|
6487
|
-
H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()),
|
|
6491
|
+
H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage());
|
|
6488
6492
|
};
|
|
6489
6493
|
y.events.on("tracksready", f), y.events.on("streamTypeDetected", f), y.events.on("qualitychange", f), y.events.on("loadedmetadata", f), f();
|
|
6490
6494
|
const K = setTimeout(f, 100);
|
|
@@ -6492,7 +6496,7 @@ function yi({
|
|
|
6492
6496
|
y.events.off("tracksready", f), y.events.off("streamTypeDetected", f), y.events.off("qualitychange", f), y.events.off("loadedmetadata", f), clearTimeout(K);
|
|
6493
6497
|
};
|
|
6494
6498
|
}, [y]), k(() => {
|
|
6495
|
-
_ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()),
|
|
6499
|
+
_ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), de(y.getActiveSubtitleLanguage()));
|
|
6496
6500
|
}, [_, y]);
|
|
6497
6501
|
const Pe = B.length > 1;
|
|
6498
6502
|
k(() => {
|
|
@@ -6573,7 +6577,7 @@ function yi({
|
|
|
6573
6577
|
label: f.id === "auto" ? "Auto" : f.label,
|
|
6574
6578
|
selected: Q?.id === f.id,
|
|
6575
6579
|
onClick: () => {
|
|
6576
|
-
|
|
6580
|
+
A(f.id), L(f), W(!1), M("root");
|
|
6577
6581
|
}
|
|
6578
6582
|
},
|
|
6579
6583
|
f.id
|
|
@@ -6615,7 +6619,7 @@ function yi({
|
|
|
6615
6619
|
label: "Off",
|
|
6616
6620
|
selected: ae === null,
|
|
6617
6621
|
onClick: () => {
|
|
6618
|
-
T(null),
|
|
6622
|
+
T(null), de(null), W(!1), M("root");
|
|
6619
6623
|
}
|
|
6620
6624
|
},
|
|
6621
6625
|
"off"
|
|
@@ -6626,7 +6630,7 @@ function yi({
|
|
|
6626
6630
|
label: f.label || f.language,
|
|
6627
6631
|
selected: ae === f.language,
|
|
6628
6632
|
onClick: () => {
|
|
6629
|
-
T(f.language),
|
|
6633
|
+
T(f.language), de(f.language), W(!1), M("root");
|
|
6630
6634
|
}
|
|
6631
6635
|
},
|
|
6632
6636
|
f.url || `${f.language}-${K}`
|
|
@@ -6652,7 +6656,7 @@ function yi({
|
|
|
6652
6656
|
max: 200,
|
|
6653
6657
|
step: 5,
|
|
6654
6658
|
value: D.bottomOffset,
|
|
6655
|
-
onChange: (f) =>
|
|
6659
|
+
onChange: (f) => S({ bottomOffset: Number(f.target.value) }),
|
|
6656
6660
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6657
6661
|
}
|
|
6658
6662
|
)
|
|
@@ -6673,7 +6677,7 @@ function yi({
|
|
|
6673
6677
|
max: 40,
|
|
6674
6678
|
step: 1,
|
|
6675
6679
|
value: D.fontSize,
|
|
6676
|
-
onChange: (f) =>
|
|
6680
|
+
onChange: (f) => S({ fontSize: Number(f.target.value) }),
|
|
6677
6681
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6678
6682
|
}
|
|
6679
6683
|
)
|
|
@@ -6683,7 +6687,7 @@ function yi({
|
|
|
6683
6687
|
/* @__PURE__ */ s(
|
|
6684
6688
|
"button",
|
|
6685
6689
|
{
|
|
6686
|
-
onClick: () =>
|
|
6690
|
+
onClick: () => S({ background: D.background ? "" : "rgba(0,0,0,0.75)" }),
|
|
6687
6691
|
style: {
|
|
6688
6692
|
padding: "4px 12px",
|
|
6689
6693
|
borderRadius: "6px",
|
|
@@ -6702,7 +6706,7 @@ function yi({
|
|
|
6702
6706
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: "6px" }, children: ["#ffffff", "#ffff00", "#00ff00", "#00cfff"].map((f) => /* @__PURE__ */ s(
|
|
6703
6707
|
"button",
|
|
6704
6708
|
{
|
|
6705
|
-
onClick: () =>
|
|
6709
|
+
onClick: () => S({ color: f }),
|
|
6706
6710
|
title: f,
|
|
6707
6711
|
style: {
|
|
6708
6712
|
width: "22px",
|
|
@@ -6730,7 +6734,7 @@ function yi({
|
|
|
6730
6734
|
}, children: [
|
|
6731
6735
|
/* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: ie }),
|
|
6732
6736
|
/* @__PURE__ */ s("div", { style: { fontSize: "12px", color: "#fff", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: xt })
|
|
6733
|
-
] }),
|
|
6737
|
+
] }), Ae = j?.segmentUrl ?? "", wt = Ae.length > 36 ? "…" + Ae.slice(-36) : Ae || "—";
|
|
6734
6738
|
return /* @__PURE__ */ u(oe, { children: [
|
|
6735
6739
|
/* @__PURE__ */ u("div", { style: { ...p, justifyContent: "space-between" }, children: [
|
|
6736
6740
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ s(z, { label: "Statistics", isBack: !0, onClick: () => M("root") }) }),
|
|
@@ -6778,7 +6782,7 @@ function yi({
|
|
|
6778
6782
|
minWidth: 0
|
|
6779
6783
|
}, children: [
|
|
6780
6784
|
/* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: "Segment" }),
|
|
6781
|
-
/* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title:
|
|
6785
|
+
/* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: Ae, children: wt })
|
|
6782
6786
|
] })
|
|
6783
6787
|
] })
|
|
6784
6788
|
] }),
|
|
@@ -6869,8 +6873,8 @@ function yi({
|
|
|
6869
6873
|
style: {
|
|
6870
6874
|
...gi,
|
|
6871
6875
|
background: l,
|
|
6872
|
-
border: `1px solid ${
|
|
6873
|
-
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${
|
|
6876
|
+
border: `1px solid ${c}`,
|
|
6877
|
+
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${c.replace("0.1)", "0.08)")}`,
|
|
6874
6878
|
width: E === "statistics" ? "360px" : "320px",
|
|
6875
6879
|
...g === "bottom" ? { top: "52px" } : { bottom: "52px" },
|
|
6876
6880
|
...m === "left" ? { left: 0 } : { right: 0 }
|
|
@@ -6891,11 +6895,11 @@ function Ti({ label: a = "AirPlay", className: e = "" }) {
|
|
|
6891
6895
|
k(() => {
|
|
6892
6896
|
if (!t) return;
|
|
6893
6897
|
i(t.isAirPlayAvailable()), o(t.isAirPlayActive());
|
|
6894
|
-
const
|
|
6895
|
-
i(
|
|
6898
|
+
const c = ({ isAvailable: d, isActive: h }) => {
|
|
6899
|
+
i(d), o(h);
|
|
6896
6900
|
};
|
|
6897
|
-
return t.events.on("airplaychange",
|
|
6898
|
-
t.events.off("airplaychange",
|
|
6901
|
+
return t.events.on("airplaychange", c), () => {
|
|
6902
|
+
t.events.off("airplaychange", c);
|
|
6899
6903
|
};
|
|
6900
6904
|
}, [t]);
|
|
6901
6905
|
const l = $(() => {
|
|
@@ -6948,14 +6952,14 @@ function Mi({
|
|
|
6948
6952
|
k(() => {
|
|
6949
6953
|
if (!t) return;
|
|
6950
6954
|
i(t.isCastAvailable()), o(t.isCastActive());
|
|
6951
|
-
const
|
|
6952
|
-
isAvailable:
|
|
6955
|
+
const c = ({
|
|
6956
|
+
isAvailable: d,
|
|
6953
6957
|
isActive: h
|
|
6954
6958
|
}) => {
|
|
6955
|
-
i(
|
|
6959
|
+
i(d), o(h);
|
|
6956
6960
|
};
|
|
6957
|
-
return t.events.on("castchange",
|
|
6958
|
-
t.events.off("castchange",
|
|
6961
|
+
return t.events.on("castchange", c), () => {
|
|
6962
|
+
t.events.off("castchange", c);
|
|
6959
6963
|
};
|
|
6960
6964
|
}, [t]);
|
|
6961
6965
|
const l = $(() => {
|
|
@@ -7015,15 +7019,15 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7015
7019
|
}, l = O(null);
|
|
7016
7020
|
return k(() => {
|
|
7017
7021
|
if (!t) return;
|
|
7018
|
-
const
|
|
7019
|
-
if ("key" in
|
|
7020
|
-
|
|
7022
|
+
const c = (d) => {
|
|
7023
|
+
if ("key" in d) {
|
|
7024
|
+
d.key === "Escape" && r();
|
|
7021
7025
|
return;
|
|
7022
7026
|
}
|
|
7023
|
-
l.current && !l.current.contains(
|
|
7027
|
+
l.current && !l.current.contains(d.target) && r();
|
|
7024
7028
|
};
|
|
7025
|
-
return document.addEventListener("mousedown",
|
|
7026
|
-
document.removeEventListener("mousedown",
|
|
7029
|
+
return document.addEventListener("mousedown", c), document.addEventListener("keydown", c), () => {
|
|
7030
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("keydown", c);
|
|
7027
7031
|
};
|
|
7028
7032
|
}, [t, r]), t ? /* @__PURE__ */ u(oe, { children: [
|
|
7029
7033
|
/* @__PURE__ */ s(
|
|
@@ -7048,13 +7052,13 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7048
7052
|
animation: "ctxFadeIn 0.14s ease-out",
|
|
7049
7053
|
overflow: "hidden"
|
|
7050
7054
|
},
|
|
7051
|
-
children: i.map((
|
|
7055
|
+
children: i.map((c, d) => /* @__PURE__ */ u("div", { children: [
|
|
7052
7056
|
/* @__PURE__ */ u(
|
|
7053
7057
|
"button",
|
|
7054
7058
|
{
|
|
7055
7059
|
role: "menuitem",
|
|
7056
7060
|
onClick: () => {
|
|
7057
|
-
|
|
7061
|
+
c.onClick(), r();
|
|
7058
7062
|
},
|
|
7059
7063
|
style: {
|
|
7060
7064
|
display: "flex",
|
|
@@ -7064,38 +7068,38 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7064
7068
|
padding: "9px 14px",
|
|
7065
7069
|
background: "transparent",
|
|
7066
7070
|
border: "none",
|
|
7067
|
-
color:
|
|
7071
|
+
color: c.danger ? o.dangerColor : o.textColor,
|
|
7068
7072
|
fontSize: "13.5px",
|
|
7069
7073
|
textAlign: "left",
|
|
7070
7074
|
cursor: "pointer",
|
|
7071
7075
|
transition: "background 0.1s"
|
|
7072
7076
|
},
|
|
7073
7077
|
onMouseEnter: (h) => {
|
|
7074
|
-
h.currentTarget.style.background =
|
|
7078
|
+
h.currentTarget.style.background = c.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
|
|
7075
7079
|
},
|
|
7076
7080
|
onMouseLeave: (h) => {
|
|
7077
7081
|
h.currentTarget.style.background = "transparent";
|
|
7078
7082
|
},
|
|
7079
7083
|
children: [
|
|
7080
|
-
|
|
7084
|
+
c.icon !== void 0 && /* @__PURE__ */ s("span", { style: {
|
|
7081
7085
|
width: "28px",
|
|
7082
7086
|
height: "28px",
|
|
7083
7087
|
borderRadius: "7px",
|
|
7084
|
-
background:
|
|
7088
|
+
background: c.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
|
|
7085
7089
|
display: "flex",
|
|
7086
7090
|
alignItems: "center",
|
|
7087
7091
|
justifyContent: "center",
|
|
7088
7092
|
flexShrink: 0,
|
|
7089
|
-
color:
|
|
7093
|
+
color: c.danger ? o.dangerColor : o.textColor,
|
|
7090
7094
|
fontSize: "13px",
|
|
7091
7095
|
lineHeight: 1
|
|
7092
|
-
}, children:
|
|
7093
|
-
/* @__PURE__ */ s("span", { style: { flex: 1 }, children:
|
|
7096
|
+
}, children: c.icon }),
|
|
7097
|
+
/* @__PURE__ */ s("span", { style: { flex: 1 }, children: c.label })
|
|
7094
7098
|
]
|
|
7095
7099
|
}
|
|
7096
7100
|
),
|
|
7097
|
-
|
|
7098
|
-
] },
|
|
7101
|
+
c.dividerAfter && /* @__PURE__ */ s("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
|
|
7102
|
+
] }, d))
|
|
7099
7103
|
}
|
|
7100
7104
|
),
|
|
7101
7105
|
/* @__PURE__ */ s("style", { children: `
|
|
@@ -7111,8 +7115,8 @@ const Li = ({ mode: a }) => {
|
|
|
7111
7115
|
return /* @__PURE__ */ u(Or, { children: [
|
|
7112
7116
|
/* @__PURE__ */ s(zr, {}),
|
|
7113
7117
|
!t && /* @__PURE__ */ s(li, { seconds: 15 }),
|
|
7114
|
-
!t && /* @__PURE__ */ s(
|
|
7115
|
-
/* @__PURE__ */ s(
|
|
7118
|
+
!t && /* @__PURE__ */ s(ci, { seconds: 15 }),
|
|
7119
|
+
/* @__PURE__ */ s(di, { sliderDirection: "top" }),
|
|
7116
7120
|
!t && /* @__PURE__ */ s(Jr, {}),
|
|
7117
7121
|
/* @__PURE__ */ s("div", { style: { flex: 1 } }),
|
|
7118
7122
|
/* @__PURE__ */ s(yi, { theme: { background: "#fb0000" } }),
|
|
@@ -7229,13 +7233,13 @@ export {
|
|
|
7229
7233
|
Li as ControlsContainer,
|
|
7230
7234
|
He as ControlsVisibilityContext,
|
|
7231
7235
|
Mr as EndCard,
|
|
7232
|
-
|
|
7236
|
+
At as EventBus,
|
|
7233
7237
|
jr as FullscreenButton,
|
|
7234
7238
|
Pr as GestureHintOverlay,
|
|
7235
7239
|
ei as JumpToLiveButton,
|
|
7236
7240
|
Tr as KeyboardShortcutsOverlay,
|
|
7237
7241
|
ti as LiveLatencyDisplay,
|
|
7238
|
-
|
|
7242
|
+
Se as MediaErrorCode,
|
|
7239
7243
|
xi as MuteButton,
|
|
7240
7244
|
Kr as PipButton,
|
|
7241
7245
|
zr as PlayButton,
|
|
@@ -7247,18 +7251,18 @@ export {
|
|
|
7247
7251
|
Mt as PlayronEventEmitter,
|
|
7248
7252
|
ai as SeekBar,
|
|
7249
7253
|
Ri as SeekBarContainer,
|
|
7250
|
-
|
|
7254
|
+
Ai as SettingsButton,
|
|
7251
7255
|
yi as SettingsPanel,
|
|
7252
7256
|
li as SkipBackwardButton,
|
|
7253
|
-
|
|
7254
|
-
|
|
7257
|
+
ci as SkipForwardButton,
|
|
7258
|
+
Si as SkipIntroButton,
|
|
7255
7259
|
Rt as StallDetector,
|
|
7256
7260
|
Pt as StreamDetector,
|
|
7257
7261
|
ki as TheaterModeButton,
|
|
7258
7262
|
si as ThumbnailManager,
|
|
7259
7263
|
Jr as TimeDisplay,
|
|
7260
7264
|
x as VideoEventType,
|
|
7261
|
-
|
|
7265
|
+
di as VolumeControl,
|
|
7262
7266
|
wi as default,
|
|
7263
7267
|
ge as eventBus,
|
|
7264
7268
|
Ei as isVideoEventType,
|