playron 1.0.36 → 1.0.37
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/core/StateManager.d.ts.map +1 -1
- package/dist/playron.cjs.js +10 -10
- package/dist/playron.es.js +480 -469
- package/dist/types/config.d.ts +2 -0
- package/dist/types/config.d.ts.map +1 -1
- package/package.json +1 -1
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
|
|
2
|
+
import { createContext as de, useState as b, useEffect as k, useMemo as Ue, useContext as re, memo as kt, useRef as O, useCallback as $ } from "react";
|
|
3
3
|
class St {
|
|
4
4
|
listeners = /* @__PURE__ */ new Map();
|
|
5
5
|
/**
|
|
@@ -47,7 +47,7 @@ class St {
|
|
|
47
47
|
return this.listeners.get(e)?.size || 0;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
const ge = new St(),
|
|
50
|
+
const ge = new St(), x = {
|
|
51
51
|
// Playback events
|
|
52
52
|
PLAY: "play",
|
|
53
53
|
PAUSE: "pause",
|
|
@@ -88,8 +88,8 @@ const ge = new St(), C = {
|
|
|
88
88
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4
|
|
89
89
|
// Source format not supported
|
|
90
90
|
};
|
|
91
|
-
function
|
|
92
|
-
return Object.values(
|
|
91
|
+
function Ei(a) {
|
|
92
|
+
return Object.values(x).includes(a);
|
|
93
93
|
}
|
|
94
94
|
class At {
|
|
95
95
|
videoElement = null;
|
|
@@ -106,19 +106,19 @@ class At {
|
|
|
106
106
|
* Video element'inin native event'lerini dinle
|
|
107
107
|
*/
|
|
108
108
|
setupEventListeners() {
|
|
109
|
-
this.videoElement && (this.videoElement.addEventListener(
|
|
109
|
+
this.videoElement && (this.videoElement.addEventListener(x.PLAY, () => {
|
|
110
110
|
this.isPlaying = !0, this.emitPlayEvent();
|
|
111
|
-
}), this.videoElement.addEventListener(
|
|
111
|
+
}), this.videoElement.addEventListener(x.PAUSE, () => {
|
|
112
112
|
this.isPlaying = !1, this.emitPauseEvent();
|
|
113
|
-
}), this.videoElement.addEventListener(
|
|
113
|
+
}), this.videoElement.addEventListener(x.VOLUME_CHANGE, () => {
|
|
114
114
|
this.videoElement && (this.volume = this.videoElement.volume, this.isMuted = this.videoElement.muted, this.emitVolumeChangeEvent());
|
|
115
|
-
}), this.videoElement.addEventListener(
|
|
115
|
+
}), this.videoElement.addEventListener(x.TIME_UPDATE, () => {
|
|
116
116
|
this.videoElement && (this.currentTime = this.videoElement.currentTime);
|
|
117
|
-
}), this.videoElement.addEventListener(
|
|
117
|
+
}), this.videoElement.addEventListener(x.LOADED_METADATA, () => {
|
|
118
118
|
this.videoElement && (this.duration = this.videoElement.duration);
|
|
119
|
-
}), this.videoElement.addEventListener(
|
|
119
|
+
}), this.videoElement.addEventListener(x.RATE_CHANGE, () => {
|
|
120
120
|
this.videoElement && (this.playbackRate = this.videoElement.playbackRate);
|
|
121
|
-
}), this.videoElement.addEventListener(
|
|
121
|
+
}), this.videoElement.addEventListener(x.ERROR, (e) => {
|
|
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,
|
|
@@ -451,8 +451,9 @@ class Tt {
|
|
|
451
451
|
volume: 1,
|
|
452
452
|
currentTime: 0,
|
|
453
453
|
duration: 0,
|
|
454
|
-
playbackRate: 1
|
|
455
|
-
|
|
454
|
+
playbackRate: 1,
|
|
455
|
+
isBuffering: !1,
|
|
456
|
+
isSeeking: !1
|
|
456
457
|
}, ...e };
|
|
457
458
|
}
|
|
458
459
|
/**
|
|
@@ -559,8 +560,8 @@ class Tt {
|
|
|
559
560
|
const i = (n) => {
|
|
560
561
|
const o = {};
|
|
561
562
|
let l = !1;
|
|
562
|
-
e.forEach((
|
|
563
|
-
r[
|
|
563
|
+
e.forEach((d) => {
|
|
564
|
+
r[d] !== n[d] && (o[d] = n[d], l = !0);
|
|
564
565
|
}), l && t(o), r = { ...n };
|
|
565
566
|
};
|
|
566
567
|
this.subscribe(i);
|
|
@@ -709,7 +710,7 @@ class Pt {
|
|
|
709
710
|
hasDVR: !1,
|
|
710
711
|
isEngineSupported: this.preCheckCapability("hls")
|
|
711
712
|
};
|
|
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),
|
|
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), d = this.extractMediaSequence(t);
|
|
713
714
|
return i && !n ? {
|
|
714
715
|
type: "live",
|
|
715
716
|
protocol: "hls",
|
|
@@ -717,7 +718,7 @@ class Pt {
|
|
|
717
718
|
hasDVR: o,
|
|
718
719
|
// EVENT type supports DVR
|
|
719
720
|
targetDuration: l,
|
|
720
|
-
mediaSequence:
|
|
721
|
+
mediaSequence: d,
|
|
721
722
|
isEngineSupported: this.preCheckCapability("hls")
|
|
722
723
|
} : {
|
|
723
724
|
type: "vod",
|
|
@@ -913,22 +914,22 @@ async function nt(a, e, t, r, i) {
|
|
|
913
914
|
let n = new Error("License request failed");
|
|
914
915
|
for (let o = 0; o <= r; o++) {
|
|
915
916
|
if (o > 0) {
|
|
916
|
-
const
|
|
917
|
-
await new Promise((h) => setTimeout(h,
|
|
917
|
+
const c = i * Math.pow(2, o - 1);
|
|
918
|
+
await new Promise((h) => setTimeout(h, c));
|
|
918
919
|
}
|
|
919
|
-
const l = new AbortController(),
|
|
920
|
+
const l = new AbortController(), d = setTimeout(() => l.abort(), t);
|
|
920
921
|
try {
|
|
921
|
-
const
|
|
922
|
-
if (clearTimeout(
|
|
923
|
-
throw new Error(`HTTP ${
|
|
924
|
-
return await
|
|
925
|
-
} catch (
|
|
926
|
-
clearTimeout(
|
|
922
|
+
const c = await fetch(a, { ...e, signal: l.signal });
|
|
923
|
+
if (clearTimeout(d), !c.ok)
|
|
924
|
+
throw new Error(`HTTP ${c.status}: ${c.statusText}`);
|
|
925
|
+
return await c.arrayBuffer();
|
|
926
|
+
} catch (c) {
|
|
927
|
+
clearTimeout(d), c instanceof Error && c.name === "AbortError" ? n = new Error(`Request timed out after ${t}ms (attempt ${o + 1}/${r + 1})`) : n = c instanceof Error ? c : new Error(String(c));
|
|
927
928
|
}
|
|
928
929
|
}
|
|
929
930
|
throw n;
|
|
930
931
|
}
|
|
931
|
-
async function
|
|
932
|
+
async function Bt(a, e = {}) {
|
|
932
933
|
const t = Oe.get(a);
|
|
933
934
|
if (t)
|
|
934
935
|
return console.debug("[LicenseManager] Using cached FairPlay certificate:", a), t;
|
|
@@ -943,16 +944,16 @@ async function $t(a, e = {}) {
|
|
|
943
944
|
);
|
|
944
945
|
return Oe.set(a, r), r;
|
|
945
946
|
}
|
|
946
|
-
function
|
|
947
|
+
function $t() {
|
|
947
948
|
Oe.clear();
|
|
948
949
|
}
|
|
949
950
|
async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
950
951
|
const n = i.timeout ?? _t, o = i.maxRetries ?? Vt, l = i.retryDelay ?? Nt;
|
|
951
|
-
let
|
|
952
|
-
i.prepareLicenseRequest && (
|
|
953
|
-
const
|
|
952
|
+
let d = e;
|
|
953
|
+
i.prepareLicenseRequest && (d = await i.prepareLicenseRequest(e));
|
|
954
|
+
const c = {
|
|
954
955
|
method: "POST",
|
|
955
|
-
body:
|
|
956
|
+
body: d,
|
|
956
957
|
headers: {
|
|
957
958
|
"Content-Type": "application/octet-stream",
|
|
958
959
|
...t
|
|
@@ -962,7 +963,7 @@ async function Ft(a, e, t = {}, r = !1, i = {}) {
|
|
|
962
963
|
console.debug("[LicenseManager] Acquiring license from:", a);
|
|
963
964
|
let h = await nt(
|
|
964
965
|
a,
|
|
965
|
-
|
|
966
|
+
c,
|
|
966
967
|
n,
|
|
967
968
|
o,
|
|
968
969
|
l
|
|
@@ -1016,7 +1017,7 @@ class Ot {
|
|
|
1016
1017
|
this.mediaKeys = await t.createMediaKeys();
|
|
1017
1018
|
let r;
|
|
1018
1019
|
try {
|
|
1019
|
-
r = await
|
|
1020
|
+
r = await Bt(this.config.certificateUrl, this.config.headers);
|
|
1020
1021
|
} catch (i) {
|
|
1021
1022
|
throw new Error(
|
|
1022
1023
|
`FairPlay: Failed to fetch server certificate from ${this.config.certificateUrl}: ` + (i instanceof Error ? i.message : String(i))
|
|
@@ -1153,7 +1154,7 @@ class Ht {
|
|
|
1153
1154
|
this.destroyed = !0, console.debug("[WidevineAdapter] Destroyed");
|
|
1154
1155
|
}
|
|
1155
1156
|
}
|
|
1156
|
-
const
|
|
1157
|
+
const Be = "com.microsoft.playready", Ke = "com.microsoft.playready.hardware", zt = [
|
|
1157
1158
|
{
|
|
1158
1159
|
initDataTypes: ["cenc"],
|
|
1159
1160
|
videoCapabilities: [
|
|
@@ -1170,7 +1171,7 @@ class qt {
|
|
|
1170
1171
|
config;
|
|
1171
1172
|
destroyed = !1;
|
|
1172
1173
|
constructor(e) {
|
|
1173
|
-
this.config = e, this.keySystem = e.preferHardware ? Ke :
|
|
1174
|
+
this.config = e, this.keySystem = e.preferHardware ? Ke : Be;
|
|
1174
1175
|
}
|
|
1175
1176
|
/**
|
|
1176
1177
|
* Probe PlayReady support and signal readiness.
|
|
@@ -1178,7 +1179,7 @@ class qt {
|
|
|
1178
1179
|
*/
|
|
1179
1180
|
async initialize(e) {
|
|
1180
1181
|
if (this.destroyed) return;
|
|
1181
|
-
const t = this.config.preferHardware ? [Ke,
|
|
1182
|
+
const t = this.config.preferHardware ? [Ke, Be] : [Be];
|
|
1182
1183
|
let r = !1;
|
|
1183
1184
|
for (const i of t)
|
|
1184
1185
|
try {
|
|
@@ -1256,7 +1257,7 @@ class Kt {
|
|
|
1256
1257
|
}
|
|
1257
1258
|
/** Destroy the adapter and release all resources. */
|
|
1258
1259
|
destroy() {
|
|
1259
|
-
this.destroyed || (this.destroyed = !0, this.adapter?.destroy(), this.adapter = null, this.selectedKeySystem = null,
|
|
1260
|
+
this.destroyed || (this.destroyed = !0, this.adapter?.destroy(), this.adapter = null, this.selectedKeySystem = null, $t(), console.debug("[DrmManager] Destroyed"));
|
|
1260
1261
|
}
|
|
1261
1262
|
// ── Private ────────────────────────────────────────────────────────────────
|
|
1262
1263
|
createAdapter(e) {
|
|
@@ -1371,8 +1372,8 @@ class Xt {
|
|
|
1371
1372
|
try {
|
|
1372
1373
|
const l = new o.media.MediaInfo(e, t);
|
|
1373
1374
|
l.streamType = i ? o.media.StreamType.LIVE : o.media.StreamType.BUFFERED, l.metadata = null;
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1375
|
+
const d = new o.media.LoadRequest(l);
|
|
1376
|
+
d.currentTime = r, d.autoplay = !0, await n.loadMedia(d), console.log(`[ChromecastManager] Media loaded on receiver: ${e} (t=${r}s)`);
|
|
1376
1377
|
} catch (l) {
|
|
1377
1378
|
console.error("[ChromecastManager] loadMedia error:", l);
|
|
1378
1379
|
}
|
|
@@ -1514,27 +1515,37 @@ class fe {
|
|
|
1514
1515
|
* State değişikliklerini dinle
|
|
1515
1516
|
*/
|
|
1516
1517
|
setupStateListeners() {
|
|
1517
|
-
!this.stateManager || !this.videoElement || (this.videoElement.addEventListener(
|
|
1518
|
+
!this.stateManager || !this.videoElement || (this.videoElement.addEventListener(x.PLAY, () => {
|
|
1518
1519
|
this.events.emit("play", { timestamp: Date.now() });
|
|
1519
|
-
}), this.videoElement.addEventListener(
|
|
1520
|
+
}), this.videoElement.addEventListener(x.PAUSE, () => {
|
|
1520
1521
|
this.events.emit("pause", { timestamp: Date.now() });
|
|
1521
|
-
}), this.videoElement.addEventListener(
|
|
1522
|
+
}), this.videoElement.addEventListener(x.TIME_UPDATE, () => {
|
|
1522
1523
|
this.events.emit("timeupdate", {
|
|
1523
1524
|
currentTime: this.videoElement?.currentTime || 0,
|
|
1524
1525
|
duration: this.videoElement?.duration || 0
|
|
1525
1526
|
});
|
|
1526
|
-
}), this.videoElement.addEventListener(
|
|
1527
|
+
}), this.videoElement.addEventListener(x.ENDED, () => {
|
|
1527
1528
|
this.events.emit("ended", { timestamp: Date.now() });
|
|
1528
|
-
}), this.videoElement.addEventListener(
|
|
1529
|
+
}), this.videoElement.addEventListener(x.LOADED_METADATA, () => {
|
|
1529
1530
|
this.events.emit("loadedmetadata", {
|
|
1530
1531
|
duration: this.videoElement?.duration || 0,
|
|
1531
1532
|
videoWidth: this.videoElement?.videoWidth || 0,
|
|
1532
1533
|
videoHeight: this.videoElement?.videoHeight || 0
|
|
1533
1534
|
});
|
|
1534
|
-
}), this.videoElement.addEventListener(
|
|
1535
|
+
}), this.videoElement.addEventListener(x.RATE_CHANGE, () => {
|
|
1535
1536
|
const e = this.videoElement?.playbackRate || 1;
|
|
1536
1537
|
this.stateManager?.set("playbackRate", e), this.events.emit("ratechange", { playbackRate: e });
|
|
1537
|
-
}), this.videoElement.addEventListener(
|
|
1538
|
+
}), this.videoElement.addEventListener(x.SEEKING, () => {
|
|
1539
|
+
this.stateManager?.set("isSeeking", !0), this.stateManager?.set("isBuffering", !0), this.events.emit("seeking", { targetTime: this.videoElement?.currentTime ?? 0 }), this.events.emit("buffering", { isBuffering: !0 });
|
|
1540
|
+
}), this.videoElement.addEventListener(x.SEEKED, () => {
|
|
1541
|
+
this.stateManager?.set("isSeeking", !1), this.events.emit("seeked", { currentTime: this.videoElement?.currentTime ?? 0 });
|
|
1542
|
+
}), this.videoElement.addEventListener(x.WAITING, () => {
|
|
1543
|
+
this.stateManager?.set("isBuffering", !0), this.events.emit("buffering", { isBuffering: !0 });
|
|
1544
|
+
}), this.videoElement.addEventListener(x.PLAYING, () => {
|
|
1545
|
+
this.stateManager?.set("isBuffering", !1), this.stateManager?.set("isSeeking", !1), this.events.emit("buffering", { isBuffering: !1 });
|
|
1546
|
+
}), this.videoElement.addEventListener(x.CAN_PLAY, () => {
|
|
1547
|
+
this.stateManager?.set("isBuffering", !1), this.events.emit("buffering", { isBuffering: !1 });
|
|
1548
|
+
}), this.videoElement.addEventListener(x.ERROR, () => {
|
|
1538
1549
|
const e = this.videoElement?.error;
|
|
1539
1550
|
if (e) {
|
|
1540
1551
|
const t = `MEDIA_ERR_${e.code === 1 ? "ABORTED" : e.code === 2 ? "NETWORK" : e.code === 3 ? "DECODE" : e.code === 4 ? "SRC_NOT_SUPPORTED" : "UNKNOWN"}`;
|
|
@@ -2057,7 +2068,7 @@ class fe {
|
|
|
2057
2068
|
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;
|
|
2058
2069
|
}
|
|
2059
2070
|
}
|
|
2060
|
-
const st =
|
|
2071
|
+
const st = de(null), ot = {
|
|
2061
2072
|
isPlaying: !1,
|
|
2062
2073
|
isMuted: !1,
|
|
2063
2074
|
volume: 1,
|
|
@@ -2066,28 +2077,28 @@ const st = ce(null), ot = {
|
|
|
2066
2077
|
isLive: !1,
|
|
2067
2078
|
isAtLiveEdge: !1,
|
|
2068
2079
|
liveLatency: 0
|
|
2069
|
-
}, at =
|
|
2080
|
+
}, at = de(ot), lt = de(null);
|
|
2070
2081
|
function Gt({ children: a, playerInstance: e }) {
|
|
2071
2082
|
const [t, r] = b(ot);
|
|
2072
|
-
|
|
2083
|
+
k(() => {
|
|
2073
2084
|
if (!e) return;
|
|
2074
2085
|
const n = e.getStateManager();
|
|
2075
2086
|
if (!n) return;
|
|
2076
2087
|
r(n.getState());
|
|
2077
|
-
const o = (
|
|
2078
|
-
r(
|
|
2088
|
+
const o = (d) => {
|
|
2089
|
+
r(d);
|
|
2079
2090
|
};
|
|
2080
2091
|
n.subscribe(o);
|
|
2081
2092
|
const l = e.getVideoElement();
|
|
2082
2093
|
if (l) {
|
|
2083
|
-
const
|
|
2094
|
+
const d = () => {
|
|
2084
2095
|
const g = e.isLive();
|
|
2085
2096
|
n.updateState({
|
|
2086
2097
|
currentTime: l.currentTime,
|
|
2087
2098
|
duration: l.duration || 0,
|
|
2088
2099
|
isLive: g
|
|
2089
2100
|
});
|
|
2090
|
-
},
|
|
2101
|
+
}, c = () => {
|
|
2091
2102
|
n.set("isPlaying", !l.paused);
|
|
2092
2103
|
}, h = () => {
|
|
2093
2104
|
n.updateState({
|
|
@@ -2101,8 +2112,8 @@ function Gt({ children: a, playerInstance: e }) {
|
|
|
2101
2112
|
isLive: !0
|
|
2102
2113
|
});
|
|
2103
2114
|
};
|
|
2104
|
-
return e.events.on("livelatencyupdate", p), l.addEventListener(
|
|
2105
|
-
e.events.off("livelatencyupdate", p), l.removeEventListener(
|
|
2115
|
+
return e.events.on("livelatencyupdate", p), l.addEventListener(x.TIME_UPDATE, d), l.addEventListener(x.PLAY, c), l.addEventListener(x.PAUSE, c), l.addEventListener(x.VOLUME_CHANGE, h), l.addEventListener(x.LOADED_METADATA, d), () => {
|
|
2116
|
+
e.events.off("livelatencyupdate", p), l.removeEventListener(x.TIME_UPDATE, d), l.removeEventListener(x.PLAY, c), l.removeEventListener(x.PAUSE, c), l.removeEventListener(x.VOLUME_CHANGE, h), l.removeEventListener(x.LOADED_METADATA, d), n.unsubscribe(o);
|
|
2106
2117
|
};
|
|
2107
2118
|
}
|
|
2108
2119
|
return () => {
|
|
@@ -2262,24 +2273,24 @@ const Zt = "_overlay_3mfq6_3", Jt = "_iconContainer_3mfq6_17", er = "_loading_3m
|
|
|
2262
2273
|
customIcon: rr
|
|
2263
2274
|
};
|
|
2264
2275
|
function ir({ config: a, isAdLoading: e }) {
|
|
2265
|
-
const t = Y((D) => D.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [
|
|
2266
|
-
|
|
2267
|
-
console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0),
|
|
2276
|
+
const t = Y((D) => D.isPlaying), { togglePlay: r, toggleFullscreen: i, getPlayer: n } = q(), [o, l] = b(!1), [d, c] = b("play"), [h, p] = b(!1), g = O(null);
|
|
2277
|
+
k(() => {
|
|
2278
|
+
console.log("[VideoOverlay] isAdLoading changed:", e), e ? (console.log("[VideoOverlay] ✅ Showing ad loading icon"), p(!0), c("loading"), l(!0)) : (console.log("[VideoOverlay] ❌ Hiding ad loading icon"), p(!1), l(!1));
|
|
2268
2279
|
}, [e]);
|
|
2269
|
-
const m = a?.ui?.showOverlayIcons !== !1,
|
|
2270
|
-
|
|
2280
|
+
const m = a?.ui?.showOverlayIcons !== !1, S = 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
|
+
k(() => {
|
|
2271
2282
|
const D = n();
|
|
2272
2283
|
if (!D) return;
|
|
2273
|
-
const
|
|
2274
|
-
if (!
|
|
2284
|
+
const A = D.video || D.videoElement;
|
|
2285
|
+
if (!A) return;
|
|
2275
2286
|
const _ = () => {
|
|
2276
|
-
p(!0),
|
|
2287
|
+
p(!0), c("loading"), l(!0), g.current && clearTimeout(g.current);
|
|
2277
2288
|
}, W = () => {
|
|
2278
2289
|
g.current = window.setTimeout(() => {
|
|
2279
2290
|
p(!1), l(!1);
|
|
2280
2291
|
}, 300);
|
|
2281
|
-
},
|
|
2282
|
-
p(!0),
|
|
2292
|
+
}, E = () => {
|
|
2293
|
+
p(!0), c("loading"), l(!0);
|
|
2283
2294
|
}, M = () => {
|
|
2284
2295
|
h && (g.current = window.setTimeout(() => {
|
|
2285
2296
|
p(!1), l(!1);
|
|
@@ -2289,30 +2300,30 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2289
2300
|
p(!1), l(!1);
|
|
2290
2301
|
}, 300));
|
|
2291
2302
|
}, H = () => {
|
|
2292
|
-
p(!0),
|
|
2303
|
+
p(!0), c("loading"), l(!0);
|
|
2293
2304
|
};
|
|
2294
|
-
return
|
|
2295
|
-
|
|
2305
|
+
return A.addEventListener(x.SEEKING, _), A.addEventListener(x.SEEKED, W), A.addEventListener(x.WAITING, E), A.addEventListener(x.PLAYING, M), A.addEventListener(x.CAN_PLAY, N), A.addEventListener(x.LOAD_START, H), () => {
|
|
2306
|
+
A.removeEventListener(x.SEEKING, _), A.removeEventListener(x.SEEKED, W), A.removeEventListener(x.WAITING, E), A.removeEventListener(x.PLAYING, M), A.removeEventListener(x.CAN_PLAY, N), A.removeEventListener(x.LOAD_START, H), g.current && clearTimeout(g.current);
|
|
2296
2307
|
};
|
|
2297
|
-
}, [n, h]),
|
|
2308
|
+
}, [n, h]), k(() => {
|
|
2298
2309
|
if (!h) {
|
|
2299
|
-
|
|
2310
|
+
c(t ? "pause" : "play"), l(!0);
|
|
2300
2311
|
const D = setTimeout(() => {
|
|
2301
2312
|
l(!1);
|
|
2302
2313
|
}, 600);
|
|
2303
2314
|
return () => clearTimeout(D);
|
|
2304
2315
|
}
|
|
2305
2316
|
}, [t, h]);
|
|
2306
|
-
const y =
|
|
2317
|
+
const y = $(async () => {
|
|
2307
2318
|
await r();
|
|
2308
|
-
}, [r]), G =
|
|
2319
|
+
}, [r]), G = $(() => {
|
|
2309
2320
|
i();
|
|
2310
2321
|
}, [i]), X = (D) => {
|
|
2311
|
-
const
|
|
2312
|
-
return
|
|
2322
|
+
const A = D === "play" ? I : C;
|
|
2323
|
+
return A ? /^https?:\/\//.test(A) || /\.(jpg|jpeg|png|svg|gif|webp)$/i.test(A) ? /* @__PURE__ */ s(
|
|
2313
2324
|
"img",
|
|
2314
2325
|
{
|
|
2315
|
-
src:
|
|
2326
|
+
src: A,
|
|
2316
2327
|
alt: D === "play" ? "Play" : "Pause",
|
|
2317
2328
|
className: ne.customIcon,
|
|
2318
2329
|
style: { "--icon-size": `${T}px` }
|
|
@@ -2320,7 +2331,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2320
2331
|
) : /* @__PURE__ */ s(
|
|
2321
2332
|
"div",
|
|
2322
2333
|
{
|
|
2323
|
-
dangerouslySetInnerHTML: { __html:
|
|
2334
|
+
dangerouslySetInnerHTML: { __html: A },
|
|
2324
2335
|
className: ne.customIcon,
|
|
2325
2336
|
style: { "--icon-size": `${T}px` }
|
|
2326
2337
|
}
|
|
@@ -2364,7 +2375,7 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2364
2375
|
{
|
|
2365
2376
|
className: `${ne.iconContainer} ${ne.loading}`,
|
|
2366
2377
|
style: {
|
|
2367
|
-
"--icon-container-size": `${
|
|
2378
|
+
"--icon-container-size": `${w}px`,
|
|
2368
2379
|
"--icon-size": `${T}px`
|
|
2369
2380
|
},
|
|
2370
2381
|
children: /* @__PURE__ */ s(Xe, { size: T })
|
|
@@ -2376,15 +2387,15 @@ function ir({ config: a, isAdLoading: e }) {
|
|
|
2376
2387
|
className: `virtus-video-overlay ${ne.overlay}`,
|
|
2377
2388
|
onClick: y,
|
|
2378
2389
|
onDoubleClick: G,
|
|
2379
|
-
children: m && o && !e && (
|
|
2390
|
+
children: m && o && !e && (d === "loading" || S) && /* @__PURE__ */ s(
|
|
2380
2391
|
"div",
|
|
2381
2392
|
{
|
|
2382
2393
|
className: `${ne.iconContainer} ${h ? ne.loading : ""}`,
|
|
2383
2394
|
style: {
|
|
2384
|
-
"--icon-container-size": `${
|
|
2395
|
+
"--icon-container-size": `${w}px`,
|
|
2385
2396
|
"--icon-size": `${T}px`
|
|
2386
2397
|
},
|
|
2387
|
-
children:
|
|
2398
|
+
children: d === "loading" ? /* @__PURE__ */ s(Xe, { size: T }) : X(d)
|
|
2388
2399
|
}
|
|
2389
2400
|
)
|
|
2390
2401
|
}
|
|
@@ -2398,13 +2409,13 @@ function Ce() {
|
|
|
2398
2409
|
throw new Error("usePlayer must be used within PlayerProvider");
|
|
2399
2410
|
return a;
|
|
2400
2411
|
}
|
|
2401
|
-
const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27",
|
|
2412
|
+
const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant_network_4djr8_23", lr = "_variant_decode_4djr8_27", dr = "_variant_generic_4djr8_31", cr = "_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 = {
|
|
2402
2413
|
errorOverlay: sr,
|
|
2403
2414
|
variant_drm: or,
|
|
2404
2415
|
variant_network: ar,
|
|
2405
2416
|
variant_decode: lr,
|
|
2406
|
-
variant_generic:
|
|
2407
|
-
errorContent:
|
|
2417
|
+
variant_generic: dr,
|
|
2418
|
+
errorContent: cr,
|
|
2408
2419
|
errorIcon: ur,
|
|
2409
2420
|
iconPulse: hr,
|
|
2410
2421
|
drmGlow: pr,
|
|
@@ -2414,8 +2425,8 @@ const sr = "_errorOverlay_4djr8_5", or = "_variant_drm_4djr8_19", ar = "_variant
|
|
|
2414
2425
|
errorHint: yr,
|
|
2415
2426
|
browserList: vr,
|
|
2416
2427
|
browserItem: br,
|
|
2417
|
-
errorCode:
|
|
2418
|
-
retryButton:
|
|
2428
|
+
errorCode: Er,
|
|
2429
|
+
retryButton: wr
|
|
2419
2430
|
};
|
|
2420
2431
|
function xr(a, e) {
|
|
2421
2432
|
const t = a.code.toUpperCase(), r = (a.message ?? "").toUpperCase();
|
|
@@ -2499,8 +2510,8 @@ function kr(a) {
|
|
|
2499
2510
|
}
|
|
2500
2511
|
const Sr = 12e3;
|
|
2501
2512
|
function Ar({ onRetry: a, drmConfig: e }) {
|
|
2502
|
-
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null),
|
|
2503
|
-
|
|
2513
|
+
const t = Ce(), [r, i] = b(null), [n, o] = b(null), l = O(null), d = O(null);
|
|
2514
|
+
d.current = r, k(() => {
|
|
2504
2515
|
it().then((g) => {
|
|
2505
2516
|
o(g);
|
|
2506
2517
|
const m = Ge(e, g);
|
|
@@ -2512,50 +2523,50 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2512
2523
|
// must NOT be dismissed by play/loadedmetadata
|
|
2513
2524
|
});
|
|
2514
2525
|
}).catch(() => o(null));
|
|
2515
|
-
}, []),
|
|
2526
|
+
}, []), k(() => {
|
|
2516
2527
|
if (!n || !e?.enabled) return;
|
|
2517
2528
|
const g = Ge(e, n);
|
|
2518
|
-
g && !
|
|
2519
|
-
}, [e, n]),
|
|
2529
|
+
g && !d.current && i({ type: g, code: "DRM_NOT_SUPPORTED", rawMessage: "Browser does not support the required DRM key system.", persistent: !0 });
|
|
2530
|
+
}, [e, n]), k(() => {
|
|
2520
2531
|
if (!t || !e?.enabled) return;
|
|
2521
2532
|
const g = t.getVideoElement();
|
|
2522
2533
|
if (!g) return;
|
|
2523
2534
|
const m = () => {
|
|
2524
2535
|
g.currentTime > 0.5 || (l.current = setTimeout(() => {
|
|
2525
|
-
if (
|
|
2526
|
-
const I = n,
|
|
2536
|
+
if (d.current) return;
|
|
2537
|
+
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";
|
|
2527
2538
|
i({
|
|
2528
|
-
type:
|
|
2539
|
+
type: C,
|
|
2529
2540
|
code: "DRM_TIMEOUT",
|
|
2530
2541
|
rawMessage: "Playback stalled — possible DRM or network issue.",
|
|
2531
2542
|
persistent: !0
|
|
2532
2543
|
// don't let a late loadedmetadata dismiss this
|
|
2533
2544
|
});
|
|
2534
2545
|
}, Sr));
|
|
2535
|
-
},
|
|
2546
|
+
}, S = () => {
|
|
2536
2547
|
l.current && (clearTimeout(l.current), l.current = null);
|
|
2537
2548
|
};
|
|
2538
|
-
return g.addEventListener("waiting", m), g.addEventListener("playing",
|
|
2539
|
-
g.removeEventListener("waiting", m), g.removeEventListener("playing",
|
|
2549
|
+
return g.addEventListener("waiting", m), g.addEventListener("playing", S), g.addEventListener("timeupdate", S), () => {
|
|
2550
|
+
g.removeEventListener("waiting", m), g.removeEventListener("playing", S), g.removeEventListener("timeupdate", S), S();
|
|
2540
2551
|
};
|
|
2541
|
-
}, [t, e, n]),
|
|
2552
|
+
}, [t, e, n]), k(() => {
|
|
2542
2553
|
if (!t) return;
|
|
2543
2554
|
const g = (m) => {
|
|
2544
2555
|
console.error("[ErrorOverlay] Player error:", m);
|
|
2545
|
-
const
|
|
2546
|
-
i({ type:
|
|
2556
|
+
const S = xr(m, n);
|
|
2557
|
+
i({ type: S, code: m.code, rawMessage: m.message ?? "Unknown error" });
|
|
2547
2558
|
};
|
|
2548
2559
|
return t.events.on("error", g), () => {
|
|
2549
2560
|
t.events.off("error", g);
|
|
2550
2561
|
};
|
|
2551
|
-
}, [t, n]),
|
|
2562
|
+
}, [t, n]), k(() => {
|
|
2552
2563
|
if (!t) return;
|
|
2553
2564
|
const g = () => i((m) => m?.persistent ? m : null);
|
|
2554
2565
|
return t.events.on("play", g), t.events.on("loadedmetadata", g), () => {
|
|
2555
2566
|
t.events.off("play", g), t.events.off("loadedmetadata", g);
|
|
2556
2567
|
};
|
|
2557
2568
|
}, [t]);
|
|
2558
|
-
const
|
|
2569
|
+
const c = $(() => {
|
|
2559
2570
|
if (i(null), a) {
|
|
2560
2571
|
a();
|
|
2561
2572
|
return;
|
|
@@ -2579,7 +2590,7 @@ function Ar({ onRetry: a, drmConfig: e }) {
|
|
|
2579
2590
|
h.hint && /* @__PURE__ */ s("p", { className: te.errorHint, children: h.hint }),
|
|
2580
2591
|
h.browsers && /* @__PURE__ */ s("ul", { className: te.browserList, children: h.browsers.map((g) => /* @__PURE__ */ s("li", { className: te.browserItem, children: g }, g)) }),
|
|
2581
2592
|
r.code && h.variant !== "drm" && /* @__PURE__ */ s("p", { className: te.errorCode, children: r.code }),
|
|
2582
|
-
h.showRetry && /* @__PURE__ */ s("button", { onClick:
|
|
2593
|
+
h.showRetry && /* @__PURE__ */ s("button", { onClick: c, className: te.retryButton, children: "↻ Try Again" })
|
|
2583
2594
|
] }) });
|
|
2584
2595
|
}
|
|
2585
2596
|
const se = {
|
|
@@ -2633,10 +2644,10 @@ const se = {
|
|
|
2633
2644
|
{ key: "Esc", description: "Close overlays", icon: se.close }
|
|
2634
2645
|
];
|
|
2635
2646
|
function Tr({ isOpen: a, onClose: e }) {
|
|
2636
|
-
const t =
|
|
2647
|
+
const t = $((r) => {
|
|
2637
2648
|
r.key === "Escape" && e();
|
|
2638
2649
|
}, [e]);
|
|
2639
|
-
return
|
|
2650
|
+
return k(() => {
|
|
2640
2651
|
if (a)
|
|
2641
2652
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
2642
2653
|
}, [a, t]), a ? /* @__PURE__ */ u(
|
|
@@ -2796,18 +2807,18 @@ function Mr({
|
|
|
2796
2807
|
nextTitle: i,
|
|
2797
2808
|
thumbnail: n
|
|
2798
2809
|
}) {
|
|
2799
|
-
const [o, l] = b(r),
|
|
2800
|
-
|
|
2810
|
+
const [o, l] = b(r), d = O(null), c = $(() => {
|
|
2811
|
+
d.current && (clearInterval(d.current), d.current = null);
|
|
2801
2812
|
}, []);
|
|
2802
|
-
if (
|
|
2813
|
+
if (k(() => {
|
|
2803
2814
|
if (!a) {
|
|
2804
|
-
|
|
2815
|
+
c(), l(r);
|
|
2805
2816
|
return;
|
|
2806
2817
|
}
|
|
2807
|
-
return l(r),
|
|
2808
|
-
l((m) => m <= 1 ? (
|
|
2809
|
-
}, 1e3),
|
|
2810
|
-
}, [a, r, e,
|
|
2818
|
+
return l(r), d.current = setInterval(() => {
|
|
2819
|
+
l((m) => m <= 1 ? (c(), e(), 0) : m - 1);
|
|
2820
|
+
}, 1e3), c;
|
|
2821
|
+
}, [a, r, e, c]), !a) return null;
|
|
2811
2822
|
const h = 16, p = 2 * Math.PI * h, g = (r - o) / r * p;
|
|
2812
2823
|
return /* @__PURE__ */ u(
|
|
2813
2824
|
"div",
|
|
@@ -3034,28 +3045,28 @@ function Pr({ type: a, value: e }) {
|
|
|
3034
3045
|
);
|
|
3035
3046
|
}
|
|
3036
3047
|
function Lr({ player: a, skipSec: e = 10 }) {
|
|
3037
|
-
const [t, r] = b(null), i = O(null), n =
|
|
3048
|
+
const [t, r] = b(null), i = O(null), n = $((p) => {
|
|
3038
3049
|
r(p), i.current && clearTimeout(i.current), i.current = setTimeout(() => r(null), 900);
|
|
3039
|
-
}, []), o = O(null), l = 300,
|
|
3050
|
+
}, []), o = O(null), l = 300, d = $((p) => {
|
|
3040
3051
|
if (!a) return;
|
|
3041
|
-
const g = p.touches[0], m = Date.now(),
|
|
3042
|
-
if (
|
|
3043
|
-
const
|
|
3044
|
-
if (g.clientX -
|
|
3045
|
-
const
|
|
3046
|
-
|
|
3052
|
+
const g = p.touches[0], m = Date.now(), S = o.current;
|
|
3053
|
+
if (S && m - S.time < l) {
|
|
3054
|
+
const C = p.currentTarget.getBoundingClientRect();
|
|
3055
|
+
if (g.clientX - C.left > C.width / 2) {
|
|
3056
|
+
const w = a.getVideoElement();
|
|
3057
|
+
w && a.seekTo(Math.min(w.duration || 0, w.currentTime + e)), n({ type: "seek-forward", value: `+${e}s` });
|
|
3047
3058
|
} else {
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3059
|
+
const w = a.getVideoElement();
|
|
3060
|
+
w && a.seekTo(Math.max(0, w.currentTime - e)), n({ type: "seek-backward", value: `-${e}s` });
|
|
3050
3061
|
}
|
|
3051
3062
|
o.current = null;
|
|
3052
3063
|
return;
|
|
3053
3064
|
}
|
|
3054
3065
|
o.current = { time: m, x: g.clientX };
|
|
3055
|
-
}, [a, e, n]),
|
|
3056
|
-
}, []), h =
|
|
3066
|
+
}, [a, e, n]), c = $((p) => {
|
|
3067
|
+
}, []), h = $(() => {
|
|
3057
3068
|
}, []);
|
|
3058
|
-
return { onTouchStart:
|
|
3069
|
+
return { onTouchStart: d, onTouchMove: c, onTouchEnd: h, gestureHint: t };
|
|
3059
3070
|
}
|
|
3060
3071
|
function Rr(a, e) {
|
|
3061
3072
|
let t;
|
|
@@ -3067,12 +3078,12 @@ function Dr({
|
|
|
3067
3078
|
timeout: a = 3e3,
|
|
3068
3079
|
initialVisible: e = !0
|
|
3069
3080
|
} = {}) {
|
|
3070
|
-
const [t, r] = b(e), i = O(null), n =
|
|
3081
|
+
const [t, r] = b(e), i = O(null), n = $(() => {
|
|
3071
3082
|
i.current && clearTimeout(i.current), r(!0), i.current = window.setTimeout(() => {
|
|
3072
3083
|
r(!1);
|
|
3073
3084
|
}, a);
|
|
3074
3085
|
}, [a]);
|
|
3075
|
-
return
|
|
3086
|
+
return k(() => {
|
|
3076
3087
|
const o = Rr(() => {
|
|
3077
3088
|
n();
|
|
3078
3089
|
}, 100), l = () => {
|
|
@@ -3089,7 +3100,7 @@ function Ir({
|
|
|
3089
3100
|
enabled: t = !0,
|
|
3090
3101
|
onShowShortcuts: r
|
|
3091
3102
|
}) {
|
|
3092
|
-
|
|
3103
|
+
k(() => {
|
|
3093
3104
|
if (!a || !t) return;
|
|
3094
3105
|
const i = (n) => {
|
|
3095
3106
|
const o = n.target;
|
|
@@ -3103,16 +3114,16 @@ function Ir({
|
|
|
3103
3114
|
break;
|
|
3104
3115
|
case "ArrowLeft":
|
|
3105
3116
|
n.preventDefault();
|
|
3106
|
-
const
|
|
3107
|
-
a.seekTo(
|
|
3117
|
+
const d = Math.max(0, l.currentTime - e);
|
|
3118
|
+
a.seekTo(d);
|
|
3108
3119
|
break;
|
|
3109
3120
|
case "ArrowRight":
|
|
3110
3121
|
n.preventDefault();
|
|
3111
|
-
const
|
|
3122
|
+
const c = Math.min(
|
|
3112
3123
|
l.duration,
|
|
3113
3124
|
l.currentTime + e
|
|
3114
3125
|
);
|
|
3115
|
-
a.seekTo(
|
|
3126
|
+
a.seekTo(c);
|
|
3116
3127
|
break;
|
|
3117
3128
|
case "ArrowUp":
|
|
3118
3129
|
n.preventDefault();
|
|
@@ -3155,10 +3166,10 @@ class _r {
|
|
|
3155
3166
|
try {
|
|
3156
3167
|
const n = await this.fetchVAST(e), o = this.parseXML(n), l = o.querySelector("Wrapper");
|
|
3157
3168
|
if (l) {
|
|
3158
|
-
const
|
|
3159
|
-
if (!
|
|
3169
|
+
const d = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3170
|
+
if (!d)
|
|
3160
3171
|
throw new Error("Wrapper missing VASTAdTagURI");
|
|
3161
|
-
return this.parse(
|
|
3172
|
+
return this.parse(d, t + 1, r);
|
|
3162
3173
|
}
|
|
3163
3174
|
return this.parseInline(o);
|
|
3164
3175
|
} catch (n) {
|
|
@@ -3218,14 +3229,14 @@ class _r {
|
|
|
3218
3229
|
try {
|
|
3219
3230
|
const l = o.querySelector("Wrapper");
|
|
3220
3231
|
if (l) {
|
|
3221
|
-
const
|
|
3222
|
-
if (
|
|
3223
|
-
const
|
|
3224
|
-
n.push(
|
|
3232
|
+
const d = l.querySelector("VASTAdTagURI")?.textContent?.trim();
|
|
3233
|
+
if (d) {
|
|
3234
|
+
const c = await this.parse(d, 1);
|
|
3235
|
+
n.push(c);
|
|
3225
3236
|
}
|
|
3226
3237
|
} else {
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3238
|
+
const d = this.parseAdElement(o, r);
|
|
3239
|
+
d && n.push(d);
|
|
3229
3240
|
}
|
|
3230
3241
|
} catch (l) {
|
|
3231
3242
|
console.warn("[VASTParser] Failed to parse Ad in pod, skipping:", l);
|
|
@@ -3251,21 +3262,21 @@ class _r {
|
|
|
3251
3262
|
parseAdElement(e, t) {
|
|
3252
3263
|
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
3264
|
if (!n) {
|
|
3254
|
-
const T = Array.from(e.children).map((
|
|
3265
|
+
const T = Array.from(e.children).map((w) => w.tagName);
|
|
3255
3266
|
throw T.length === 0 ? new Error("VAST Ad element is empty (no ads available)") : new Error(`VAST InLine not found. Found: ${T.join(", ")}`);
|
|
3256
3267
|
}
|
|
3257
|
-
const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(),
|
|
3268
|
+
const o = e.getAttribute("id") || `ad-${Date.now()}`, l = n.querySelector("AdTitle")?.textContent?.trim(), d = n.querySelector("Duration")?.textContent?.trim(), c = this.parseDuration(d || "00:00:00"), { mediaFile: h, isVpaid: p, vpaidUrl: g } = this.getMediaFileInfo(n);
|
|
3258
3269
|
if (!h) throw new Error("VAST MediaFile not found");
|
|
3259
|
-
const m = n.querySelector("ClickThrough")?.textContent?.trim(),
|
|
3270
|
+
const m = n.querySelector("ClickThrough")?.textContent?.trim(), S = this.parseTrackingEvents(n, t), I = this.getErrorUrls(t), C = this.parseCompanions(n);
|
|
3260
3271
|
return {
|
|
3261
3272
|
id: o,
|
|
3262
3273
|
title: l,
|
|
3263
|
-
duration:
|
|
3274
|
+
duration: c,
|
|
3264
3275
|
mediaFile: h,
|
|
3265
3276
|
clickThrough: m,
|
|
3266
|
-
trackingEvents:
|
|
3277
|
+
trackingEvents: S,
|
|
3267
3278
|
errorUrls: I,
|
|
3268
|
-
companions:
|
|
3279
|
+
companions: C.length > 0 ? C : void 0,
|
|
3269
3280
|
isVpaid: p,
|
|
3270
3281
|
vpaidUrl: g,
|
|
3271
3282
|
podSequence: i
|
|
@@ -3275,9 +3286,9 @@ class _r {
|
|
|
3275
3286
|
parseCompanions(e) {
|
|
3276
3287
|
const t = [];
|
|
3277
3288
|
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 =
|
|
3289
|
+
const n = parseInt(i.getAttribute("width") || "0", 10), o = parseInt(i.getAttribute("height") || "0", 10), l = i.getAttribute("id") ?? void 0, d = i.querySelector("StaticResource"), c = i.querySelector("HTMLResource"), h = i.querySelector("IFrameResource"), p = d?.textContent?.trim() ?? void 0, g = c?.textContent?.trim() ?? void 0, m = h?.textContent?.trim() ?? void 0, S = d?.getAttribute("creativeType") ?? void 0, I = i.querySelector("CompanionClickThrough")?.textContent?.trim() ?? void 0, C = i.querySelector("AltText")?.textContent?.trim() ?? void 0, T = [];
|
|
3290
|
+
i.querySelectorAll('TrackingEvents > Tracking[event="creativeView"]').forEach((w) => {
|
|
3291
|
+
const y = w.textContent?.trim();
|
|
3281
3292
|
y && T.push(y);
|
|
3282
3293
|
}), (p || g || m) && t.push({
|
|
3283
3294
|
id: l,
|
|
@@ -3286,9 +3297,9 @@ class _r {
|
|
|
3286
3297
|
staticResource: p,
|
|
3287
3298
|
htmlResource: g,
|
|
3288
3299
|
iFrameResource: m,
|
|
3289
|
-
type:
|
|
3300
|
+
type: S,
|
|
3290
3301
|
clickThrough: I,
|
|
3291
|
-
altText:
|
|
3302
|
+
altText: C,
|
|
3292
3303
|
viewTrackingUrls: T.length > 0 ? T : void 0
|
|
3293
3304
|
});
|
|
3294
3305
|
}), t;
|
|
@@ -3331,8 +3342,8 @@ class _r {
|
|
|
3331
3342
|
i.length > 0 && (r.impression = Array.from(i).map((o) => o.textContent?.trim()).filter(Boolean));
|
|
3332
3343
|
const n = ["start", "firstQuartile", "midpoint", "thirdQuartile", "complete", "skip", "pause", "resume"];
|
|
3333
3344
|
return e.querySelectorAll("Tracking").forEach((o) => {
|
|
3334
|
-
const l = o.getAttribute("event"),
|
|
3335
|
-
!l || !
|
|
3345
|
+
const l = o.getAttribute("event"), d = o.textContent?.trim();
|
|
3346
|
+
!l || !d || !n.includes(l) || (r[l] || (r[l] = []), r[l].push(d));
|
|
3336
3347
|
}), r;
|
|
3337
3348
|
}
|
|
3338
3349
|
/**
|
|
@@ -3358,12 +3369,12 @@ class Vr {
|
|
|
3358
3369
|
const t = await this.fetchVMAP(e), r = this.parseXML(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3359
3370
|
let n = r.querySelector("vmap\\:VMAP, VMAP");
|
|
3360
3371
|
if (!n) {
|
|
3361
|
-
const
|
|
3362
|
-
if (
|
|
3363
|
-
n =
|
|
3372
|
+
const d = r.getElementsByTagNameNS(i, "VMAP");
|
|
3373
|
+
if (d.length > 0)
|
|
3374
|
+
n = d[0];
|
|
3364
3375
|
else {
|
|
3365
|
-
const
|
|
3366
|
-
|
|
3376
|
+
const c = r.getElementsByTagName("VMAP");
|
|
3377
|
+
c.length > 0 && (n = c[0]);
|
|
3367
3378
|
}
|
|
3368
3379
|
}
|
|
3369
3380
|
if (!n)
|
|
@@ -3442,9 +3453,9 @@ class Vr {
|
|
|
3442
3453
|
const r = this.parseTimeOffset(t), i = "http://www.iab.net/videosuite/vmap";
|
|
3443
3454
|
let n = e.querySelector("vmap\\:AdSource, AdSource");
|
|
3444
3455
|
if (!n) {
|
|
3445
|
-
const
|
|
3446
|
-
if (
|
|
3447
|
-
n =
|
|
3456
|
+
const c = e.getElementsByTagNameNS(i, "AdSource");
|
|
3457
|
+
if (c.length > 0)
|
|
3458
|
+
n = c[0];
|
|
3448
3459
|
else {
|
|
3449
3460
|
const h = e.getElementsByTagName("AdSource");
|
|
3450
3461
|
h.length > 0 && (n = h[0]);
|
|
@@ -3454,22 +3465,22 @@ class Vr {
|
|
|
3454
3465
|
return console.warn("[VMAPParser] AdBreak missing AdSource, skipping"), null;
|
|
3455
3466
|
let o = n.querySelector("vmap\\:AdTagURI, AdTagURI");
|
|
3456
3467
|
if (!o) {
|
|
3457
|
-
const
|
|
3458
|
-
if (
|
|
3459
|
-
o =
|
|
3468
|
+
const c = n.getElementsByTagNameNS(i, "AdTagURI");
|
|
3469
|
+
if (c.length > 0)
|
|
3470
|
+
o = c[0];
|
|
3460
3471
|
else {
|
|
3461
3472
|
const h = n.getElementsByTagName("AdTagURI");
|
|
3462
3473
|
h.length > 0 && (o = h[0]);
|
|
3463
3474
|
}
|
|
3464
3475
|
}
|
|
3465
3476
|
if (!o)
|
|
3466
|
-
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((
|
|
3477
|
+
return console.warn("[VMAPParser] AdSource missing AdTagURI, skipping"), console.warn("[VMAPParser] AdSource children:", Array.from(n.children).map((c) => c.tagName)), null;
|
|
3467
3478
|
let l = o.textContent?.trim() || o.innerHTML?.trim();
|
|
3468
3479
|
if (!l)
|
|
3469
3480
|
return console.warn("[VMAPParser] AdTagURI is empty, skipping"), null;
|
|
3470
3481
|
l = l.replace(/<!\\[CDATA\\[(.*?)\\]\\]>/g, "$1").trim();
|
|
3471
|
-
const
|
|
3472
|
-
return
|
|
3482
|
+
const d = document.createElement("textarea");
|
|
3483
|
+
return d.innerHTML = l, l = d.value, console.log("[VMAPParser] AdBreak parsed:", {
|
|
3473
3484
|
timeOffset: r,
|
|
3474
3485
|
timeOffsetStr: t,
|
|
3475
3486
|
vastUrl: l.substring(0, 100) + (l.length > 100 ? "..." : "")
|
|
@@ -3565,7 +3576,7 @@ class Nr {
|
|
|
3565
3576
|
reset() {
|
|
3566
3577
|
}
|
|
3567
3578
|
}
|
|
3568
|
-
class
|
|
3579
|
+
class Br {
|
|
3569
3580
|
player;
|
|
3570
3581
|
config;
|
|
3571
3582
|
tracker;
|
|
@@ -3694,20 +3705,20 @@ class $r {
|
|
|
3694
3705
|
window.getVPAIDAd = function() { return typeof window.VPAIDCreative !== 'undefined' ? new window.VPAIDCreative() : null; };
|
|
3695
3706
|
<\/script>
|
|
3696
3707
|
</body></html>`), l.close(), this.vpaidIframe.onload = () => {
|
|
3697
|
-
const
|
|
3698
|
-
if (!
|
|
3708
|
+
const c = this.vpaidIframe?.contentWindow?.getVPAIDAd?.() ?? null;
|
|
3709
|
+
if (!c) {
|
|
3699
3710
|
console.warn("[AdPlayer] VPAID creative not found in iframe, skipping"), this.hideLoadingCallback && this.hideLoadingCallback(), t();
|
|
3700
3711
|
return;
|
|
3701
3712
|
}
|
|
3702
|
-
this.vpaidCreative =
|
|
3713
|
+
this.vpaidCreative = c, c.handshakeVersion("2.0"), c.subscribe(t, "AdStopped"), c.subscribe(t, "AdVideoComplete"), c.subscribe(t, "AdSkipped"), c.subscribe(() => {
|
|
3703
3714
|
this.hideLoadingCallback && this.hideLoadingCallback(), this.tracker.trackStart(e);
|
|
3704
|
-
}, "AdStarted"),
|
|
3715
|
+
}, "AdStarted"), c.subscribe(() => {
|
|
3705
3716
|
r(new Error("VPAID AdError"));
|
|
3706
|
-
}, "AdError"),
|
|
3717
|
+
}, "AdError"), c.initAd(n, o, "normal", -1, { AdParameters: "" }, {
|
|
3707
3718
|
slot: i,
|
|
3708
3719
|
videoSlot: this.adVideo,
|
|
3709
3720
|
videoSlotCanAutoPlay: !0
|
|
3710
|
-
}),
|
|
3721
|
+
}), c.startAd();
|
|
3711
3722
|
};
|
|
3712
3723
|
});
|
|
3713
3724
|
}
|
|
@@ -3796,12 +3807,12 @@ class $r {
|
|
|
3796
3807
|
const i = this.adVideo;
|
|
3797
3808
|
let n = !1;
|
|
3798
3809
|
const o = () => {
|
|
3799
|
-
i.play().catch((
|
|
3800
|
-
n || (m(), r(
|
|
3810
|
+
i.play().catch((S) => {
|
|
3811
|
+
n || (m(), r(S));
|
|
3801
3812
|
});
|
|
3802
|
-
}, l = () => this.tracker.trackStart(e),
|
|
3813
|
+
}, l = () => this.tracker.trackStart(e), d = () => {
|
|
3803
3814
|
console.log("[AdPlayer] Ad video playing, hiding loading..."), this.hideLoadingCallback && this.hideLoadingCallback();
|
|
3804
|
-
},
|
|
3815
|
+
}, c = () => this.updateUI(e), h = () => {
|
|
3805
3816
|
n || (m(), t());
|
|
3806
3817
|
};
|
|
3807
3818
|
let p = !1;
|
|
@@ -3811,22 +3822,22 @@ class $r {
|
|
|
3811
3822
|
t();
|
|
3812
3823
|
return;
|
|
3813
3824
|
}
|
|
3814
|
-
const
|
|
3815
|
-
if (
|
|
3825
|
+
const S = i.error?.code;
|
|
3826
|
+
if (S === 4) {
|
|
3816
3827
|
m(), t();
|
|
3817
3828
|
return;
|
|
3818
3829
|
}
|
|
3819
|
-
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${
|
|
3830
|
+
m(), r(new Error(`Ad video playback error: ${i.error?.message ?? "Unknown"} (code: ${S})`));
|
|
3820
3831
|
}, m = () => {
|
|
3821
3832
|
if (!n) {
|
|
3822
3833
|
n = !0;
|
|
3823
3834
|
try {
|
|
3824
|
-
i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing",
|
|
3835
|
+
i.removeEventListener("canplay", o), i.removeEventListener("play", l), i.removeEventListener("playing", d), i.removeEventListener("timeupdate", c), i.removeEventListener("ended", h), i.removeEventListener("error", g), i.pause(), i.parentNode && i.parentNode.removeChild(i);
|
|
3825
3836
|
} catch {
|
|
3826
3837
|
}
|
|
3827
3838
|
}
|
|
3828
3839
|
};
|
|
3829
|
-
i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing",
|
|
3840
|
+
i.addEventListener("canplay", o), i.addEventListener("play", l), i.addEventListener("playing", d), i.addEventListener("timeupdate", c), i.addEventListener("ended", h), i.addEventListener("error", g), i.src = e.mediaFile, i.load(), setTimeout(() => {
|
|
3830
3841
|
this.state.isPlaying && this.state.currentTime === 0 && !n && (m(), r(new Error("Ad video timeout")));
|
|
3831
3842
|
}, this.config.timeout || 1e4);
|
|
3832
3843
|
});
|
|
@@ -3900,7 +3911,7 @@ class $r {
|
|
|
3900
3911
|
};
|
|
3901
3912
|
}
|
|
3902
3913
|
}
|
|
3903
|
-
class
|
|
3914
|
+
class $r {
|
|
3904
3915
|
player;
|
|
3905
3916
|
config;
|
|
3906
3917
|
vastParser;
|
|
@@ -3917,7 +3928,7 @@ class Br {
|
|
|
3917
3928
|
this.player = e, this.config = t, this.onLoadingChange = r, this.vastParser = new _r(
|
|
3918
3929
|
t.timeout || 5e3,
|
|
3919
3930
|
t.maxWrapperDepth || 5
|
|
3920
|
-
), this.vmapParser = new Vr(t.timeout || 5e3), this.adPlayer = new
|
|
3931
|
+
), this.vmapParser = new Vr(t.timeout || 5e3), this.adPlayer = new Br(e, t, () => this.hideAdLoading()), console.log("[AdManager] Initialized with config:", t);
|
|
3921
3932
|
}
|
|
3922
3933
|
/**
|
|
3923
3934
|
* Wait for video element to be ready (with retry logic)
|
|
@@ -4194,29 +4205,29 @@ class Br {
|
|
|
4194
4205
|
this.hideAdLoading(), this.adPlayer.destroy(), this.preRollPlayed = !1, this.midRollsPlayed.clear(), this.postRollPlayed = !1, this.vmapData = null, console.log("[AdManager] Destroyed");
|
|
4195
4206
|
}
|
|
4196
4207
|
}
|
|
4197
|
-
const
|
|
4208
|
+
const dt = {
|
|
4198
4209
|
bottomOffset: 110,
|
|
4199
4210
|
fontSize: 18,
|
|
4200
4211
|
color: "#ffffff",
|
|
4201
4212
|
background: "rgba(0,0,0,0.75)"
|
|
4202
|
-
},
|
|
4203
|
-
style:
|
|
4213
|
+
}, ct = de({
|
|
4214
|
+
style: dt,
|
|
4204
4215
|
setStyle: () => {
|
|
4205
4216
|
}
|
|
4206
4217
|
});
|
|
4207
4218
|
function Fr({ children: a }) {
|
|
4208
|
-
const [e, t] = b(
|
|
4209
|
-
return /* @__PURE__ */ s(
|
|
4219
|
+
const [e, t] = b(dt), r = (i) => t((n) => ({ ...n, ...i }));
|
|
4220
|
+
return /* @__PURE__ */ s(ct.Provider, { value: { style: e, setStyle: r }, children: a });
|
|
4210
4221
|
}
|
|
4211
4222
|
function ut() {
|
|
4212
|
-
return re(
|
|
4223
|
+
return re(ct);
|
|
4213
4224
|
}
|
|
4214
4225
|
function Ur({ videoElement: a }) {
|
|
4215
4226
|
const { style: e } = ut(), [t, r] = b([]), i = O(""), n = O(0);
|
|
4216
|
-
return
|
|
4227
|
+
return k(() => {
|
|
4217
4228
|
if (!a) return;
|
|
4218
4229
|
const o = () => {
|
|
4219
|
-
const l = a.textTracks,
|
|
4230
|
+
const l = a.textTracks, d = [];
|
|
4220
4231
|
for (let h = 0; h < l.length; h++) {
|
|
4221
4232
|
const p = l[h];
|
|
4222
4233
|
if (p.kind !== "subtitles" && p.kind !== "captions" || p.mode === "disabled") continue;
|
|
@@ -4224,12 +4235,12 @@ function Ur({ videoElement: a }) {
|
|
|
4224
4235
|
const g = p.activeCues;
|
|
4225
4236
|
if (g)
|
|
4226
4237
|
for (let m = 0; m < g.length; m++) {
|
|
4227
|
-
const
|
|
4228
|
-
|
|
4238
|
+
const S = g[m];
|
|
4239
|
+
S.text && d.push(S.text);
|
|
4229
4240
|
}
|
|
4230
4241
|
}
|
|
4231
|
-
const
|
|
4232
|
-
|
|
4242
|
+
const c = d.join("\0");
|
|
4243
|
+
c !== i.current && (i.current = c, r(d)), n.current = requestAnimationFrame(o);
|
|
4233
4244
|
};
|
|
4234
4245
|
return n.current = requestAnimationFrame(o), () => {
|
|
4235
4246
|
cancelAnimationFrame(n.current);
|
|
@@ -4274,8 +4285,8 @@ function Ur({ videoElement: a }) {
|
|
|
4274
4285
|
}
|
|
4275
4286
|
);
|
|
4276
4287
|
}
|
|
4277
|
-
const He =
|
|
4278
|
-
function
|
|
4288
|
+
const He = de(!0);
|
|
4289
|
+
function wi({
|
|
4279
4290
|
src: a = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
|
|
4280
4291
|
defaultControls: e = !1,
|
|
4281
4292
|
autoplay: t = !1,
|
|
@@ -4284,27 +4295,27 @@ function Ei({
|
|
|
4284
4295
|
className: n,
|
|
4285
4296
|
children: o,
|
|
4286
4297
|
config: l,
|
|
4287
|
-
onAdLoading:
|
|
4288
|
-
onNextEpisode:
|
|
4298
|
+
onAdLoading: d,
|
|
4299
|
+
onNextEpisode: c,
|
|
4289
4300
|
nextEpisodeTitle: h,
|
|
4290
4301
|
nextEpisodeThumbnail: p,
|
|
4291
4302
|
endCardCountdown: g = 5,
|
|
4292
4303
|
crossOrigin: m
|
|
4293
4304
|
}) {
|
|
4294
|
-
const
|
|
4295
|
-
player:
|
|
4305
|
+
const S = O(null), I = O(null), [C, T] = b(null), w = O(null), [y, G] = b(!1), [X, D] = b(!1), A = $(() => D(!0), []), _ = $(() => D(!1), []), [W, E] = b(!1), { onTouchStart: M, onTouchMove: N, onTouchEnd: H, gestureHint: Q } = Lr({
|
|
4306
|
+
player: C,
|
|
4296
4307
|
skipSec: 10
|
|
4297
4308
|
}), { isActive: L } = Dr({
|
|
4298
4309
|
timeout: 3e3,
|
|
4299
4310
|
initialVisible: !0
|
|
4300
4311
|
});
|
|
4301
4312
|
Ir({
|
|
4302
|
-
player:
|
|
4313
|
+
player: C,
|
|
4303
4314
|
seekStep: 10,
|
|
4304
4315
|
enabled: !0,
|
|
4305
|
-
onShowShortcuts:
|
|
4316
|
+
onShowShortcuts: A
|
|
4306
4317
|
});
|
|
4307
|
-
const
|
|
4318
|
+
const B = Ue(() => !l?.ads?.enabled || !l.ads.vastUrl && !l.ads.vmapUrl ? null : {
|
|
4308
4319
|
enabled: !0,
|
|
4309
4320
|
vastUrl: l.ads.vastUrl,
|
|
4310
4321
|
vmapUrl: l.ads.vmapUrl,
|
|
@@ -4319,45 +4330,45 @@ function Ei({
|
|
|
4319
4330
|
l?.ads?.timeout,
|
|
4320
4331
|
l?.ads?.maxWrapperDepth
|
|
4321
4332
|
]);
|
|
4322
|
-
|
|
4323
|
-
if (!I.current || !
|
|
4333
|
+
k(() => {
|
|
4334
|
+
if (!I.current || !S.current) return;
|
|
4324
4335
|
console.log("[Player] Initializing PlayerCore");
|
|
4325
4336
|
const F = new fe(I.current);
|
|
4326
|
-
return fe.preloadEngines(), F.container =
|
|
4327
|
-
console.log("[Player] Cleanup called - destroying PlayerCore"),
|
|
4337
|
+
return fe.preloadEngines(), F.container = S.current, T(F), () => {
|
|
4338
|
+
console.log("[Player] Cleanup called - destroying PlayerCore"), w.current && (console.log("[Player] Destroying AdManager"), w.current.destroy(), w.current = null), F.destroy(), T(null);
|
|
4328
4339
|
};
|
|
4329
|
-
}, []),
|
|
4330
|
-
if (!
|
|
4340
|
+
}, []), k(() => {
|
|
4341
|
+
if (!C || !B) return;
|
|
4331
4342
|
console.log("[Player] Setting up ads");
|
|
4332
4343
|
const F = (J) => {
|
|
4333
|
-
G(J),
|
|
4334
|
-
}, Z = new
|
|
4335
|
-
return
|
|
4344
|
+
G(J), d?.(J);
|
|
4345
|
+
}, Z = new $r(C, B, F);
|
|
4346
|
+
return w.current = Z, Z.setup().catch((J) => {
|
|
4336
4347
|
console.error("[Player] Failed to setup ads:", J);
|
|
4337
4348
|
}), () => {
|
|
4338
|
-
|
|
4349
|
+
w.current && (console.log("[Player] Cleaning up ads"), w.current.destroy(), w.current = null);
|
|
4339
4350
|
};
|
|
4340
|
-
}, [
|
|
4341
|
-
!
|
|
4342
|
-
}, [
|
|
4351
|
+
}, [C, B]), k(() => {
|
|
4352
|
+
!C || !l || C.setConfig(l);
|
|
4353
|
+
}, [C, l]);
|
|
4343
4354
|
const P = Ue(() => l?.drm ?? null, [l?.drm]);
|
|
4344
|
-
return
|
|
4345
|
-
!
|
|
4346
|
-
}, [
|
|
4347
|
-
|
|
4355
|
+
return k(() => {
|
|
4356
|
+
!C || !P?.enabled || C.setupDrm(P);
|
|
4357
|
+
}, [C, P]), k(() => {
|
|
4358
|
+
C && a && (console.log("[Player] Setting source:", a), C.setSource(a).catch((F) => {
|
|
4348
4359
|
console.error("[Player] setSource failed:", F);
|
|
4349
4360
|
}));
|
|
4350
|
-
}, [
|
|
4351
|
-
if (!
|
|
4352
|
-
const F =
|
|
4361
|
+
}, [C, a]), k(() => {
|
|
4362
|
+
if (!C || !c) return;
|
|
4363
|
+
const F = C.getVideoElement();
|
|
4353
4364
|
if (!F) return;
|
|
4354
|
-
const Z = () =>
|
|
4365
|
+
const Z = () => E(!0);
|
|
4355
4366
|
return F.addEventListener("ended", Z), () => F.removeEventListener("ended", Z);
|
|
4356
|
-
}, [
|
|
4367
|
+
}, [C, c]), /* @__PURE__ */ u(Fr, { children: [
|
|
4357
4368
|
/* @__PURE__ */ u(
|
|
4358
4369
|
"div",
|
|
4359
4370
|
{
|
|
4360
|
-
ref:
|
|
4371
|
+
ref: S,
|
|
4361
4372
|
role: "region",
|
|
4362
4373
|
"aria-label": "Video Player",
|
|
4363
4374
|
className: `playron-wrapper ${n || ""}`,
|
|
@@ -4411,20 +4422,20 @@ function Ei({
|
|
|
4411
4422
|
tabIndex: e ? 0 : -1
|
|
4412
4423
|
}
|
|
4413
4424
|
),
|
|
4414
|
-
|
|
4425
|
+
C ? /* @__PURE__ */ s(Gt, { playerInstance: C, children: /* @__PURE__ */ u(He.Provider, { value: L, children: [
|
|
4415
4426
|
/* @__PURE__ */ s(Ur, { videoElement: I.current }),
|
|
4416
4427
|
/* @__PURE__ */ s(nr, { config: l, isAdLoading: y }),
|
|
4417
4428
|
/* @__PURE__ */ s(Pr, { type: Q?.type ?? null, value: Q?.value ?? "" }),
|
|
4418
4429
|
/* @__PURE__ */ s(Ar, { drmConfig: l?.drm }),
|
|
4419
4430
|
/* @__PURE__ */ s(Tr, { isOpen: X, onClose: _ }),
|
|
4420
|
-
|
|
4431
|
+
c && /* @__PURE__ */ s(
|
|
4421
4432
|
Mr,
|
|
4422
4433
|
{
|
|
4423
4434
|
isVisible: W,
|
|
4424
4435
|
onNextEpisode: () => {
|
|
4425
|
-
|
|
4436
|
+
E(!1), c();
|
|
4426
4437
|
},
|
|
4427
|
-
onDismiss: () =>
|
|
4438
|
+
onDismiss: () => E(!1),
|
|
4428
4439
|
countdownSec: g,
|
|
4429
4440
|
nextTitle: h,
|
|
4430
4441
|
thumbnail: p
|
|
@@ -4483,9 +4494,9 @@ function zr({
|
|
|
4483
4494
|
style: o,
|
|
4484
4495
|
...l
|
|
4485
4496
|
}) {
|
|
4486
|
-
const
|
|
4497
|
+
const d = Y((g) => g.isPlaying), { togglePlay: c } = q(), h = async (g) => {
|
|
4487
4498
|
try {
|
|
4488
|
-
await
|
|
4499
|
+
await c();
|
|
4489
4500
|
} catch (m) {
|
|
4490
4501
|
console.error("Play/Pause error:", m);
|
|
4491
4502
|
}
|
|
@@ -4495,14 +4506,14 @@ function zr({
|
|
|
4495
4506
|
"button",
|
|
4496
4507
|
{
|
|
4497
4508
|
className: `virtus-btn virtus-play-button ${Hr.playButton} ${a || ""}`,
|
|
4498
|
-
"aria-label":
|
|
4509
|
+
"aria-label": d ? "Pause" : "Play",
|
|
4499
4510
|
onClick: h,
|
|
4500
4511
|
style: {
|
|
4501
4512
|
...p !== void 0 ? { "--btn-hover-bg": p } : {},
|
|
4502
4513
|
...o
|
|
4503
4514
|
},
|
|
4504
4515
|
...l,
|
|
4505
|
-
children:
|
|
4516
|
+
children: d ? i ?? /* @__PURE__ */ s(
|
|
4506
4517
|
"svg",
|
|
4507
4518
|
{
|
|
4508
4519
|
"aria-hidden": "true",
|
|
@@ -4601,8 +4612,8 @@ function jr({
|
|
|
4601
4612
|
style: o,
|
|
4602
4613
|
...l
|
|
4603
4614
|
}) {
|
|
4604
|
-
const { toggleFullscreen:
|
|
4605
|
-
|
|
4615
|
+
const { toggleFullscreen: d } = q(), [c, h] = b(!1);
|
|
4616
|
+
k(() => {
|
|
4606
4617
|
const m = () => {
|
|
4607
4618
|
h(!!document.fullscreenElement);
|
|
4608
4619
|
};
|
|
@@ -4611,20 +4622,20 @@ function jr({
|
|
|
4611
4622
|
};
|
|
4612
4623
|
}, []);
|
|
4613
4624
|
const p = (m) => {
|
|
4614
|
-
|
|
4625
|
+
d(), e?.(m);
|
|
4615
4626
|
}, g = typeof r == "string" ? r : r === !1 ? "transparent" : void 0;
|
|
4616
4627
|
return /* @__PURE__ */ s(
|
|
4617
4628
|
"button",
|
|
4618
4629
|
{
|
|
4619
4630
|
className: `virtus-btn virtus-fullscreen-button ${be.controlButton} ${a || ""}`,
|
|
4620
|
-
"aria-label":
|
|
4631
|
+
"aria-label": c ? "Exit Fullscreen" : "Fullscreen",
|
|
4621
4632
|
onClick: p,
|
|
4622
4633
|
style: {
|
|
4623
4634
|
...g !== void 0 ? { "--btn-hover-bg": g } : {},
|
|
4624
4635
|
...o
|
|
4625
4636
|
},
|
|
4626
4637
|
...l,
|
|
4627
|
-
children:
|
|
4638
|
+
children: c ? n ?? /* @__PURE__ */ s(
|
|
4628
4639
|
"svg",
|
|
4629
4640
|
{
|
|
4630
4641
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4654,7 +4665,7 @@ function jr({
|
|
|
4654
4665
|
}
|
|
4655
4666
|
function Kr({ className: a, onClick: e, ...t }) {
|
|
4656
4667
|
const { togglePip: r } = q(), [i, n] = b(!1);
|
|
4657
|
-
|
|
4668
|
+
k(() => {
|
|
4658
4669
|
const l = () => {
|
|
4659
4670
|
n(!!document.pictureInPictureElement);
|
|
4660
4671
|
};
|
|
@@ -4665,8 +4676,8 @@ function Kr({ className: a, onClick: e, ...t }) {
|
|
|
4665
4676
|
const o = async (l) => {
|
|
4666
4677
|
try {
|
|
4667
4678
|
await r();
|
|
4668
|
-
} catch (
|
|
4669
|
-
console.error("PiP toggle error:",
|
|
4679
|
+
} catch (d) {
|
|
4680
|
+
console.error("PiP toggle error:", d);
|
|
4670
4681
|
}
|
|
4671
4682
|
e?.(l);
|
|
4672
4683
|
};
|
|
@@ -4700,7 +4711,7 @@ function ki() {
|
|
|
4700
4711
|
const { toggleTheaterMode: a, isTheaterMode: e } = q(), [t, r] = b(e()), i = () => {
|
|
4701
4712
|
a(), r(!t);
|
|
4702
4713
|
};
|
|
4703
|
-
return
|
|
4714
|
+
return k(() => {
|
|
4704
4715
|
const n = (o) => {
|
|
4705
4716
|
r(o.detail.isTheaterMode);
|
|
4706
4717
|
};
|
|
@@ -4771,7 +4782,7 @@ function ki() {
|
|
|
4771
4782
|
);
|
|
4772
4783
|
}
|
|
4773
4784
|
function Yr(a, e, t = !0) {
|
|
4774
|
-
|
|
4785
|
+
k(() => {
|
|
4775
4786
|
if (!t) return;
|
|
4776
4787
|
const r = (n) => {
|
|
4777
4788
|
a.current && !a.current.contains(n.target) && e();
|
|
@@ -4783,7 +4794,7 @@ function Yr(a, e, t = !0) {
|
|
|
4783
4794
|
};
|
|
4784
4795
|
}, [a, e, t]);
|
|
4785
4796
|
}
|
|
4786
|
-
const Te =
|
|
4797
|
+
const Te = de({
|
|
4787
4798
|
isOpen: !1,
|
|
4788
4799
|
toggle: () => {
|
|
4789
4800
|
},
|
|
@@ -4793,7 +4804,7 @@ const Te = ce({
|
|
|
4793
4804
|
}
|
|
4794
4805
|
});
|
|
4795
4806
|
function ht({ children: a }) {
|
|
4796
|
-
const [e, t] = b(!1), r = O(null), i = () => t((
|
|
4807
|
+
const [e, t] = b(!1), r = O(null), i = () => t((d) => !d), n = () => t(!1), o = () => t(!0);
|
|
4797
4808
|
Yr(r, n, e);
|
|
4798
4809
|
const l = {
|
|
4799
4810
|
isOpen: e,
|
|
@@ -4999,14 +5010,14 @@ function We({
|
|
|
4999
5010
|
}
|
|
5000
5011
|
function Si() {
|
|
5001
5012
|
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
|
-
|
|
5013
|
+
k(() => {
|
|
5003
5014
|
e?.playbackRate !== void 0 && r(e.playbackRate);
|
|
5004
5015
|
}, [e?.playbackRate]);
|
|
5005
|
-
const l = (
|
|
5006
|
-
a.setPlaybackRate(
|
|
5007
|
-
},
|
|
5008
|
-
const
|
|
5009
|
-
n(
|
|
5016
|
+
const l = (c) => {
|
|
5017
|
+
a.setPlaybackRate(c), r(c);
|
|
5018
|
+
}, d = () => {
|
|
5019
|
+
const c = !i;
|
|
5020
|
+
n(c), a.setLoop(c);
|
|
5010
5021
|
};
|
|
5011
5022
|
return /* @__PURE__ */ u(ht, { children: [
|
|
5012
5023
|
/* @__PURE__ */ s(pt, { children: /* @__PURE__ */ s(
|
|
@@ -5026,11 +5037,11 @@ function Si() {
|
|
|
5026
5037
|
cursor: "pointer",
|
|
5027
5038
|
transition: "all 0.2s ease"
|
|
5028
5039
|
},
|
|
5029
|
-
onMouseEnter: (
|
|
5030
|
-
|
|
5040
|
+
onMouseEnter: (c) => {
|
|
5041
|
+
c.currentTarget.style.background = "rgba(255, 255, 255, 0.2)", c.currentTarget.style.transform = "scale(1.05)";
|
|
5031
5042
|
},
|
|
5032
|
-
onMouseLeave: (
|
|
5033
|
-
|
|
5043
|
+
onMouseLeave: (c) => {
|
|
5044
|
+
c.currentTarget.style.background = "rgba(255, 255, 255, 0.1)", c.currentTarget.style.transform = "scale(1)";
|
|
5034
5045
|
},
|
|
5035
5046
|
children: /* @__PURE__ */ u(
|
|
5036
5047
|
"svg",
|
|
@@ -5052,20 +5063,20 @@ function Si() {
|
|
|
5052
5063
|
) }),
|
|
5053
5064
|
/* @__PURE__ */ u(gt, { title: "Settings", placement: "top-right", children: [
|
|
5054
5065
|
/* @__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((
|
|
5066
|
+
o.map((c) => /* @__PURE__ */ u(
|
|
5056
5067
|
We,
|
|
5057
5068
|
{
|
|
5058
|
-
selected: t ===
|
|
5059
|
-
onClick: () => l(
|
|
5069
|
+
selected: t === c,
|
|
5070
|
+
onClick: () => l(c),
|
|
5060
5071
|
children: [
|
|
5061
|
-
|
|
5072
|
+
c,
|
|
5062
5073
|
"x"
|
|
5063
5074
|
]
|
|
5064
5075
|
},
|
|
5065
|
-
|
|
5076
|
+
c
|
|
5066
5077
|
)),
|
|
5067
5078
|
/* @__PURE__ */ s("div", { style: { height: "1px", background: "rgba(255, 255, 255, 0.1)", margin: "8px 0" } }),
|
|
5068
|
-
/* @__PURE__ */ u(We, { selected: i, onClick:
|
|
5079
|
+
/* @__PURE__ */ u(We, { selected: i, onClick: d, children: [
|
|
5069
5080
|
"Loop ",
|
|
5070
5081
|
i ? "On" : "Off"
|
|
5071
5082
|
] })
|
|
@@ -5077,7 +5088,7 @@ const Xr = "_timeDisplay_1wupc_3", Gr = "_currentTime_1wupc_16", Qr = "_separato
|
|
|
5077
5088
|
currentTime: Gr,
|
|
5078
5089
|
separator: Qr,
|
|
5079
5090
|
duration: Zr
|
|
5080
|
-
},
|
|
5091
|
+
}, $e = (a) => {
|
|
5081
5092
|
if (!isFinite(a) || isNaN(a)) return "0:00";
|
|
5082
5093
|
const e = Math.floor(a / 3600), t = Math.floor(a % 3600 / 60), r = Math.floor(a % 60);
|
|
5083
5094
|
return e > 0 ? `${e}:${t.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}` : `${t}:${r.toString().padStart(2, "0")}`;
|
|
@@ -5089,12 +5100,12 @@ function Jr({ className: a, ...e }) {
|
|
|
5089
5100
|
{
|
|
5090
5101
|
className: pe.currentTime,
|
|
5091
5102
|
style: { color: "rgba(255, 255, 255, 0.7)", fontSize: "12px" },
|
|
5092
|
-
children:
|
|
5103
|
+
children: $e(t)
|
|
5093
5104
|
}
|
|
5094
5105
|
) }) : /* @__PURE__ */ u("div", { className: `virtus-time-display ${pe.timeDisplay} ${a || ""}`, ...e, children: [
|
|
5095
|
-
/* @__PURE__ */ s("span", { className: pe.currentTime, children:
|
|
5106
|
+
/* @__PURE__ */ s("span", { className: pe.currentTime, children: $e(t) }),
|
|
5096
5107
|
/* @__PURE__ */ s("span", { className: pe.separator, children: "/" }),
|
|
5097
|
-
/* @__PURE__ */ s("span", { className: pe.duration, children:
|
|
5108
|
+
/* @__PURE__ */ s("span", { className: pe.duration, children: $e(r) })
|
|
5098
5109
|
] });
|
|
5099
5110
|
}
|
|
5100
5111
|
function ei() {
|
|
@@ -5175,21 +5186,21 @@ const ri = "_container_6dw0q_3", ii = "_skipButton_6dw0q_11", Fe = {
|
|
|
5175
5186
|
};
|
|
5176
5187
|
function Ai({ introOutro: a }) {
|
|
5177
5188
|
const { currentTime: e } = Y(), { seekTo: t } = q(), [r, i] = b(!1), [n, o] = b(!1);
|
|
5178
|
-
|
|
5189
|
+
k(() => {
|
|
5179
5190
|
if (a) {
|
|
5180
5191
|
if (a.intro) {
|
|
5181
|
-
const
|
|
5182
|
-
i(
|
|
5192
|
+
const c = e >= a.intro.start && e < a.intro.end;
|
|
5193
|
+
i(c);
|
|
5183
5194
|
}
|
|
5184
5195
|
if (a.outro) {
|
|
5185
|
-
const
|
|
5186
|
-
o(
|
|
5196
|
+
const c = e >= a.outro.start && e < a.outro.end;
|
|
5197
|
+
o(c);
|
|
5187
5198
|
}
|
|
5188
5199
|
}
|
|
5189
5200
|
}, [e, a]);
|
|
5190
|
-
const l =
|
|
5201
|
+
const l = $(() => {
|
|
5191
5202
|
a?.intro && (t(a.intro.end), i(!1));
|
|
5192
|
-
}, [a, t]),
|
|
5203
|
+
}, [a, t]), d = $(() => {
|
|
5193
5204
|
a?.outro && (t(a.outro.end), o(!1));
|
|
5194
5205
|
}, [a, t]);
|
|
5195
5206
|
return !r && !n ? null : /* @__PURE__ */ u("div", { className: Fe.container, children: [
|
|
@@ -5206,7 +5217,7 @@ function Ai({ introOutro: a }) {
|
|
|
5206
5217
|
}
|
|
5207
5218
|
)
|
|
5208
5219
|
] }),
|
|
5209
|
-
n && /* @__PURE__ */ u("button", { onClick:
|
|
5220
|
+
n && /* @__PURE__ */ u("button", { onClick: d, className: Fe.skipButton, children: [
|
|
5210
5221
|
/* @__PURE__ */ s("span", { children: "Skip Outro" }),
|
|
5211
5222
|
/* @__PURE__ */ s(
|
|
5212
5223
|
"svg",
|
|
@@ -5253,7 +5264,7 @@ function ni({
|
|
|
5253
5264
|
showTooltip: r = !0,
|
|
5254
5265
|
onClick: i
|
|
5255
5266
|
}) {
|
|
5256
|
-
const [n, o] = b(!1), l = Qe[a.type] || Qe.event,
|
|
5267
|
+
const [n, o] = b(!1), l = Qe[a.type] || Qe.event, d = a.icon || l.icon, c = a.color || l.color, h = (p) => {
|
|
5257
5268
|
p.stopPropagation(), i && i(a.time);
|
|
5258
5269
|
};
|
|
5259
5270
|
return /* @__PURE__ */ u(
|
|
@@ -5283,7 +5294,7 @@ function ni({
|
|
|
5283
5294
|
display: "flex",
|
|
5284
5295
|
alignItems: "center",
|
|
5285
5296
|
justifyContent: "center",
|
|
5286
|
-
backgroundColor:
|
|
5297
|
+
backgroundColor: c,
|
|
5287
5298
|
border: "2px solid rgba(255, 255, 255, 0.9)",
|
|
5288
5299
|
boxShadow: n ? "0 4px 16px rgba(0, 0, 0, 0.4)" : "0 2px 8px rgba(0, 0, 0, 0.4)",
|
|
5289
5300
|
transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -5299,7 +5310,7 @@ function ni({
|
|
|
5299
5310
|
display: "inline-block",
|
|
5300
5311
|
transform: "translateY(-1px)"
|
|
5301
5312
|
},
|
|
5302
|
-
children:
|
|
5313
|
+
children: d
|
|
5303
5314
|
}
|
|
5304
5315
|
)
|
|
5305
5316
|
}
|
|
@@ -5375,16 +5386,16 @@ class si {
|
|
|
5375
5386
|
for (; n < i.length; ) {
|
|
5376
5387
|
const o = i[n].trim();
|
|
5377
5388
|
if (o.includes("-->")) {
|
|
5378
|
-
const [l,
|
|
5389
|
+
const [l, d] = o.split("-->").map((m) => m.trim()), c = this.parseTime(l), h = this.parseTime(d);
|
|
5379
5390
|
n++;
|
|
5380
5391
|
const p = [];
|
|
5381
5392
|
for (; n < i.length && i[n].trim() !== "" && !i[n].includes("-->"); )
|
|
5382
5393
|
p.push(i[n].trim()), n++;
|
|
5383
5394
|
const g = p.join(`
|
|
5384
5395
|
`).trim();
|
|
5385
|
-
if (g &&
|
|
5396
|
+
if (g && c >= 0 && h > c) {
|
|
5386
5397
|
const m = this.parseCueLine(g, t);
|
|
5387
|
-
m && r.push({ startTime:
|
|
5398
|
+
m && r.push({ startTime: c, endTime: h, ...m });
|
|
5388
5399
|
}
|
|
5389
5400
|
} else
|
|
5390
5401
|
n++;
|
|
@@ -5393,15 +5404,15 @@ class si {
|
|
|
5393
5404
|
}
|
|
5394
5405
|
parseCueLine(e, t) {
|
|
5395
5406
|
const r = e.lastIndexOf("#xywh=");
|
|
5396
|
-
let i, n = 0, o = 0, l = 0,
|
|
5407
|
+
let i, n = 0, o = 0, l = 0, d = 0;
|
|
5397
5408
|
if (r !== -1) {
|
|
5398
5409
|
i = e.slice(0, r);
|
|
5399
5410
|
const h = e.slice(r + 6).split(",").map(Number);
|
|
5400
|
-
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l,
|
|
5411
|
+
h.length === 4 && h.every((p) => !isNaN(p)) && ([n, o, l, d] = h);
|
|
5401
5412
|
} else
|
|
5402
5413
|
i = e;
|
|
5403
|
-
const
|
|
5404
|
-
return
|
|
5414
|
+
const c = this.resolveUrl(i.trim(), t);
|
|
5415
|
+
return c ? { url: c, x: n, y: o, w: l, h: d } : null;
|
|
5405
5416
|
}
|
|
5406
5417
|
resolveUrl(e, t) {
|
|
5407
5418
|
if (e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//"))
|
|
@@ -5427,75 +5438,75 @@ function ai({
|
|
|
5427
5438
|
thumbnailsVttUrl: n,
|
|
5428
5439
|
seekBarStyle: o
|
|
5429
5440
|
}) {
|
|
5430
|
-
const l = re(He),
|
|
5431
|
-
|
|
5432
|
-
H.current = { time:
|
|
5433
|
-
}, [
|
|
5434
|
-
const Q =
|
|
5441
|
+
const l = re(He), d = O(null), [c, h] = b(!1), [p, g] = b(null), [m, S] = b(null), [I, C] = b([]), T = O(null), { currentTime: w, duration: y, isLive: G, isPlaying: X, playbackRate: D } = Y(), { seekTo: A, getDVRRange: _, getBufferedRanges: W } = q(), [E, M] = b(w), N = O(null), H = O({ time: w, ts: performance.now() });
|
|
5442
|
+
k(() => {
|
|
5443
|
+
H.current = { time: w, ts: performance.now() }, M(w);
|
|
5444
|
+
}, [w]);
|
|
5445
|
+
const Q = $(() => {
|
|
5435
5446
|
if (X) {
|
|
5436
5447
|
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
5448
|
M(ee);
|
|
5438
5449
|
}
|
|
5439
5450
|
N.current = requestAnimationFrame(Q);
|
|
5440
5451
|
}, [X, D, y]);
|
|
5441
|
-
|
|
5452
|
+
k(() => (N.current = requestAnimationFrame(Q), () => {
|
|
5442
5453
|
N.current !== null && cancelAnimationFrame(N.current);
|
|
5443
|
-
}), [Q]),
|
|
5454
|
+
}), [Q]), k(() => {
|
|
5444
5455
|
if (!n) return;
|
|
5445
5456
|
const v = new si();
|
|
5446
5457
|
return T.current = v, v.load(n), () => {
|
|
5447
5458
|
v.destroy(), T.current = null;
|
|
5448
5459
|
};
|
|
5449
|
-
}, [n]),
|
|
5460
|
+
}, [n]), k(() => {
|
|
5450
5461
|
const v = setInterval(() => {
|
|
5451
|
-
|
|
5462
|
+
C(W());
|
|
5452
5463
|
}, 500);
|
|
5453
5464
|
return () => clearInterval(v);
|
|
5454
5465
|
}, [W]);
|
|
5455
|
-
const L = a === "live" || !!G,
|
|
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"), ce = 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
5467
|
if (!isFinite(v) || isNaN(v)) return "0:00";
|
|
5457
5468
|
const R = Math.floor(v / 3600), V = Math.floor(v % 3600 / 60), U = Math.floor(v % 60);
|
|
5458
5469
|
return R > 0 ? `${R}:${V.toString().padStart(2, "0")}:${U.toString().padStart(2, "0")}` : `${V}:${U.toString().padStart(2, "0")}`;
|
|
5459
5470
|
}, ve = (v) => {
|
|
5460
|
-
if (!
|
|
5461
|
-
const R =
|
|
5471
|
+
if (!d.current) return 0;
|
|
5472
|
+
const R = d.current.getBoundingClientRect(), V = (v.clientX - R.left) / R.width;
|
|
5462
5473
|
return Math.max(0, Math.min(1, V));
|
|
5463
|
-
},
|
|
5474
|
+
}, we = (v) => {
|
|
5464
5475
|
if (!(L && !P)) {
|
|
5465
5476
|
if (L && P) {
|
|
5466
|
-
|
|
5477
|
+
A(B.start + v * F);
|
|
5467
5478
|
return;
|
|
5468
5479
|
}
|
|
5469
|
-
y !== 0 &&
|
|
5480
|
+
y !== 0 && A(v * y);
|
|
5470
5481
|
}
|
|
5471
5482
|
}, De = (v) => {
|
|
5472
5483
|
if (L && !P) return;
|
|
5473
5484
|
v.preventDefault(), h(!0);
|
|
5474
5485
|
const R = ve(v);
|
|
5475
|
-
|
|
5486
|
+
we(R);
|
|
5476
5487
|
}, Ie = (v) => {
|
|
5477
|
-
if (!
|
|
5488
|
+
if (!d.current) return;
|
|
5478
5489
|
const R = ve(v);
|
|
5479
5490
|
if (g(R), T.current) {
|
|
5480
|
-
const V = P ?
|
|
5481
|
-
|
|
5491
|
+
const V = P ? B.start + R * F : R * y;
|
|
5492
|
+
S(T.current.getThumbnailAt(V));
|
|
5482
5493
|
}
|
|
5483
5494
|
}, _e = () => {
|
|
5484
|
-
g(null),
|
|
5495
|
+
g(null), S(null);
|
|
5485
5496
|
};
|
|
5486
|
-
return
|
|
5487
|
-
if (!
|
|
5497
|
+
return k(() => {
|
|
5498
|
+
if (!c) return;
|
|
5488
5499
|
const v = (V) => {
|
|
5489
|
-
if (!
|
|
5500
|
+
if (!d.current) return;
|
|
5490
5501
|
const U = ve(V);
|
|
5491
|
-
g(U),
|
|
5502
|
+
g(U), we(U);
|
|
5492
5503
|
}, R = () => {
|
|
5493
5504
|
h(!1);
|
|
5494
5505
|
};
|
|
5495
5506
|
return window.addEventListener("mousemove", v), window.addEventListener("mouseup", R), () => {
|
|
5496
5507
|
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", R);
|
|
5497
5508
|
};
|
|
5498
|
-
}, [
|
|
5509
|
+
}, [c, y]), /* @__PURE__ */ u(
|
|
5499
5510
|
"div",
|
|
5500
5511
|
{
|
|
5501
5512
|
style: {
|
|
@@ -5596,42 +5607,42 @@ function ai({
|
|
|
5596
5607
|
/* @__PURE__ */ u(
|
|
5597
5608
|
"div",
|
|
5598
5609
|
{
|
|
5599
|
-
ref:
|
|
5610
|
+
ref: d,
|
|
5600
5611
|
role: L && !P ? void 0 : "slider",
|
|
5601
5612
|
tabIndex: L && !P ? void 0 : 0,
|
|
5602
5613
|
"aria-label": L ? "DVR seek" : "Seek",
|
|
5603
|
-
"aria-valuemin": L && !P ? void 0 : P ? Math.floor(
|
|
5604
|
-
"aria-valuemax": L && !P ? void 0 : P ? Math.floor(
|
|
5605
|
-
"aria-valuenow": L && !P ? void 0 : Math.floor(
|
|
5606
|
-
"aria-valuetext": L && !P ? "LIVE" : P ? `${le(
|
|
5614
|
+
"aria-valuemin": L && !P ? void 0 : P ? Math.floor(B.start) : 0,
|
|
5615
|
+
"aria-valuemax": L && !P ? void 0 : P ? Math.floor(B.end) : Math.floor(y) || 0,
|
|
5616
|
+
"aria-valuenow": L && !P ? void 0 : Math.floor(w),
|
|
5617
|
+
"aria-valuetext": L && !P ? "LIVE" : P ? `${le(w)} (DVR)` : `${le(w)} of ${le(y)}`,
|
|
5607
5618
|
"aria-disabled": L && !P ? !0 : void 0,
|
|
5608
5619
|
onMouseDown: De,
|
|
5609
5620
|
onMouseMove: Ie,
|
|
5610
5621
|
onMouseLeave: _e,
|
|
5611
5622
|
onKeyDown: (v) => {
|
|
5612
5623
|
if (L && !P) return;
|
|
5613
|
-
const R = 5, V = 30, U = P ?
|
|
5624
|
+
const R = 5, V = 30, U = P ? B.start : 0, ee = P ? B.end : y;
|
|
5614
5625
|
if (ee !== 0)
|
|
5615
5626
|
switch (v.key) {
|
|
5616
5627
|
case "ArrowLeft":
|
|
5617
5628
|
case "ArrowDown":
|
|
5618
|
-
v.preventDefault(),
|
|
5629
|
+
v.preventDefault(), A(Math.max(U, w - R));
|
|
5619
5630
|
break;
|
|
5620
5631
|
case "ArrowRight":
|
|
5621
5632
|
case "ArrowUp":
|
|
5622
|
-
v.preventDefault(),
|
|
5633
|
+
v.preventDefault(), A(Math.min(ee, w + R));
|
|
5623
5634
|
break;
|
|
5624
5635
|
case "PageDown":
|
|
5625
|
-
v.preventDefault(),
|
|
5636
|
+
v.preventDefault(), A(Math.max(U, w - V));
|
|
5626
5637
|
break;
|
|
5627
5638
|
case "PageUp":
|
|
5628
|
-
v.preventDefault(),
|
|
5639
|
+
v.preventDefault(), A(Math.min(ee, w + V));
|
|
5629
5640
|
break;
|
|
5630
5641
|
case "Home":
|
|
5631
|
-
v.preventDefault(),
|
|
5642
|
+
v.preventDefault(), A(U);
|
|
5632
5643
|
break;
|
|
5633
5644
|
case "End":
|
|
5634
|
-
v.preventDefault(),
|
|
5645
|
+
v.preventDefault(), A(ee);
|
|
5635
5646
|
break;
|
|
5636
5647
|
}
|
|
5637
5648
|
},
|
|
@@ -5653,7 +5664,7 @@ function ai({
|
|
|
5653
5664
|
left: 0,
|
|
5654
5665
|
right: 0,
|
|
5655
5666
|
height: `${Me}px`,
|
|
5656
|
-
backgroundColor:
|
|
5667
|
+
backgroundColor: Ee,
|
|
5657
5668
|
borderRadius: `${ue}px`
|
|
5658
5669
|
},
|
|
5659
5670
|
children: [
|
|
@@ -5669,7 +5680,7 @@ function ai({
|
|
|
5669
5680
|
top: 0,
|
|
5670
5681
|
height: "100%",
|
|
5671
5682
|
width: `${U}%`,
|
|
5672
|
-
backgroundColor:
|
|
5683
|
+
backgroundColor: ce,
|
|
5673
5684
|
borderRadius: `${ue}px`,
|
|
5674
5685
|
pointerEvents: "none"
|
|
5675
5686
|
}
|
|
@@ -5721,7 +5732,7 @@ function ai({
|
|
|
5721
5732
|
position: V,
|
|
5722
5733
|
size: i,
|
|
5723
5734
|
showTooltip: !0,
|
|
5724
|
-
onClick: (U) =>
|
|
5735
|
+
onClick: (U) => A(U)
|
|
5725
5736
|
},
|
|
5726
5737
|
`timeline-${R}-${v.time}`
|
|
5727
5738
|
);
|
|
@@ -5771,15 +5782,15 @@ function ai({
|
|
|
5771
5782
|
left: `${J}%`,
|
|
5772
5783
|
top: "50%",
|
|
5773
5784
|
transform: "translate(-50%, -50%)",
|
|
5774
|
-
width:
|
|
5775
|
-
height:
|
|
5785
|
+
width: c ? "16px" : "14px",
|
|
5786
|
+
height: c ? "16px" : "14px",
|
|
5776
5787
|
backgroundColor: j,
|
|
5777
5788
|
borderRadius: "50%",
|
|
5778
5789
|
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.3)",
|
|
5779
5790
|
pointerEvents: "none",
|
|
5780
5791
|
zIndex: 1e3,
|
|
5781
|
-
opacity:
|
|
5782
|
-
transition:
|
|
5792
|
+
opacity: c || p !== null ? 1 : 0,
|
|
5793
|
+
transition: c ? "none" : "all 0.15s ease"
|
|
5783
5794
|
}
|
|
5784
5795
|
}
|
|
5785
5796
|
)
|
|
@@ -5787,7 +5798,7 @@ function ai({
|
|
|
5787
5798
|
}
|
|
5788
5799
|
),
|
|
5789
5800
|
Pe && (!L || P) && p !== null && (() => {
|
|
5790
|
-
const v = P ?
|
|
5801
|
+
const v = P ? B.start + p * F : p * y, R = d.current?.offsetWidth ?? 0, V = p * 100, U = p * R, ee = Ze / 2;
|
|
5791
5802
|
let he = "-50%";
|
|
5792
5803
|
return U < ee ? he = "0%" : R - U < ee && (he = "-100%"), m ? (
|
|
5793
5804
|
/* Thumbnail card */
|
|
@@ -5949,7 +5960,7 @@ function li({
|
|
|
5949
5960
|
}
|
|
5950
5961
|
);
|
|
5951
5962
|
}
|
|
5952
|
-
function
|
|
5963
|
+
function di({
|
|
5953
5964
|
seconds: a = 15,
|
|
5954
5965
|
iconSize: e = 24,
|
|
5955
5966
|
hoverBackground: t,
|
|
@@ -6013,7 +6024,7 @@ function ci({
|
|
|
6013
6024
|
}
|
|
6014
6025
|
);
|
|
6015
6026
|
}
|
|
6016
|
-
function
|
|
6027
|
+
function ci({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBackground: r }) {
|
|
6017
6028
|
const i = {
|
|
6018
6029
|
sliderBackground: e?.sliderBackground ?? "rgba(10, 10, 20, 0.88)",
|
|
6019
6030
|
borderColor: e?.borderColor ?? "rgba(255,255,255,0.1)",
|
|
@@ -6023,43 +6034,43 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6023
6034
|
trackColor: e?.trackColor ?? "rgba(255,255,255,0.3)",
|
|
6024
6035
|
fillColor: e?.fillColor ?? "#3b82f6",
|
|
6025
6036
|
handleColor: e?.handleColor ?? "#fff"
|
|
6026
|
-
}, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume:
|
|
6037
|
+
}, { isMuted: n, volume: o } = Y(), { toggleMute: l, setVolume: d } = q(), [c, h] = b(!1), [p, g] = b(!1), m = O(null), S = a === "top" || a === "bottom", I = $((E, M) => {
|
|
6027
6038
|
if (!m.current) return;
|
|
6028
|
-
const N = m.current.getBoundingClientRect(), H =
|
|
6029
|
-
|
|
6030
|
-
}, [
|
|
6031
|
-
g(!0), n && l(), I(
|
|
6039
|
+
const N = m.current.getBoundingClientRect(), H = S ? Math.max(0, Math.min(1, 1 - (M - N.top) / N.height)) : Math.max(0, Math.min(1, (E - N.left) / N.width));
|
|
6040
|
+
d(H);
|
|
6041
|
+
}, [d, S]), C = $((E) => {
|
|
6042
|
+
g(!0), n && l(), I(E.clientX, E.clientY);
|
|
6032
6043
|
}, [I, n, l]);
|
|
6033
|
-
|
|
6044
|
+
k(() => {
|
|
6034
6045
|
if (!p) return;
|
|
6035
|
-
const
|
|
6036
|
-
return window.addEventListener("mousemove",
|
|
6037
|
-
window.removeEventListener("mousemove",
|
|
6046
|
+
const E = (N) => I(N.clientX, N.clientY), M = () => g(!1);
|
|
6047
|
+
return window.addEventListener("mousemove", E), window.addEventListener("mouseup", M), () => {
|
|
6048
|
+
window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", M);
|
|
6038
6049
|
};
|
|
6039
6050
|
}, [p, I]);
|
|
6040
|
-
const T = p ? o : n ? 0 : o,
|
|
6051
|
+
const T = p ? o : n ? 0 : o, w = c || p, y = {
|
|
6041
6052
|
position: "absolute",
|
|
6042
|
-
opacity:
|
|
6053
|
+
opacity: w ? 1 : 0,
|
|
6043
6054
|
transition: "all 0.25s ease",
|
|
6044
|
-
pointerEvents:
|
|
6055
|
+
pointerEvents: w ? "auto" : "none",
|
|
6045
6056
|
zIndex: 10,
|
|
6046
6057
|
background: i.sliderBackground,
|
|
6047
6058
|
backdropFilter: "blur(12px)",
|
|
6048
6059
|
boxShadow: "4px 0 16px rgba(0,0,0,0.5)",
|
|
6049
6060
|
overflow: "hidden"
|
|
6050
6061
|
}, G = (() => {
|
|
6051
|
-
const
|
|
6062
|
+
const E = `1px solid ${i.borderColor}`;
|
|
6052
6063
|
switch (a) {
|
|
6053
6064
|
case "left":
|
|
6054
6065
|
return {
|
|
6055
6066
|
...y,
|
|
6056
6067
|
right: "40px",
|
|
6057
6068
|
top: "0",
|
|
6058
|
-
width:
|
|
6069
|
+
width: w ? "118px" : "0px",
|
|
6059
6070
|
height: "40px",
|
|
6060
6071
|
paddingRight: "8px",
|
|
6061
6072
|
borderRadius: "8px 0 0 8px",
|
|
6062
|
-
border:
|
|
6073
|
+
border: E,
|
|
6063
6074
|
borderRight: "none"
|
|
6064
6075
|
};
|
|
6065
6076
|
case "top":
|
|
@@ -6068,10 +6079,10 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6068
6079
|
bottom: "40px",
|
|
6069
6080
|
left: "0",
|
|
6070
6081
|
width: "40px",
|
|
6071
|
-
height:
|
|
6082
|
+
height: w ? "118px" : "0px",
|
|
6072
6083
|
paddingBottom: "8px",
|
|
6073
6084
|
borderRadius: "8px 8px 0 0",
|
|
6074
|
-
border:
|
|
6085
|
+
border: E,
|
|
6075
6086
|
borderBottom: "none"
|
|
6076
6087
|
};
|
|
6077
6088
|
case "bottom":
|
|
@@ -6080,10 +6091,10 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6080
6091
|
top: "40px",
|
|
6081
6092
|
left: "0",
|
|
6082
6093
|
width: "40px",
|
|
6083
|
-
height:
|
|
6094
|
+
height: w ? "118px" : "0px",
|
|
6084
6095
|
paddingTop: "8px",
|
|
6085
6096
|
borderRadius: "0 0 8px 8px",
|
|
6086
|
-
border:
|
|
6097
|
+
border: E,
|
|
6087
6098
|
borderTop: "none"
|
|
6088
6099
|
};
|
|
6089
6100
|
default:
|
|
@@ -6091,15 +6102,15 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6091
6102
|
...y,
|
|
6092
6103
|
left: "40px",
|
|
6093
6104
|
top: "0",
|
|
6094
|
-
width:
|
|
6105
|
+
width: w ? "118px" : "0px",
|
|
6095
6106
|
height: "40px",
|
|
6096
6107
|
paddingLeft: "8px",
|
|
6097
6108
|
borderRadius: "0 8px 8px 0",
|
|
6098
|
-
border:
|
|
6109
|
+
border: E,
|
|
6099
6110
|
borderLeft: "none"
|
|
6100
6111
|
};
|
|
6101
6112
|
}
|
|
6102
|
-
})(), X =
|
|
6113
|
+
})(), X = S ? { 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 = S ? { width: "4px", height: "100%", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" } : { width: "100%", height: "4px", backgroundColor: i.trackColor, borderRadius: "2px", position: "relative" }, A = S ? {
|
|
6103
6114
|
position: "absolute",
|
|
6104
6115
|
bottom: 0,
|
|
6105
6116
|
left: 0,
|
|
@@ -6117,7 +6128,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6117
6128
|
backgroundColor: i.fillColor,
|
|
6118
6129
|
borderRadius: "2px",
|
|
6119
6130
|
transition: p ? "none" : "width 0.1s ease"
|
|
6120
|
-
}, _ = p ? 14 : 12, W =
|
|
6131
|
+
}, _ = p ? 14 : 12, W = S ? {
|
|
6121
6132
|
position: "absolute",
|
|
6122
6133
|
bottom: `calc(${T * 100}% - ${T * _}px)`,
|
|
6123
6134
|
left: "50%",
|
|
@@ -6170,11 +6181,11 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6170
6181
|
position: "relative",
|
|
6171
6182
|
zIndex: 1
|
|
6172
6183
|
},
|
|
6173
|
-
onMouseEnter: (
|
|
6174
|
-
h(!0),
|
|
6184
|
+
onMouseEnter: (E) => {
|
|
6185
|
+
h(!0), E.currentTarget.style.background = typeof r == "string" ? r : r === !1 ? "transparent" : i.buttonHoverBackground, E.currentTarget.style.transform = "scale(1.05)";
|
|
6175
6186
|
},
|
|
6176
|
-
onMouseLeave: (
|
|
6177
|
-
|
|
6187
|
+
onMouseLeave: (E) => {
|
|
6188
|
+
E.currentTarget.style.background = r === !1 ? "transparent" : i.buttonBackground, E.currentTarget.style.transform = "scale(1)";
|
|
6178
6189
|
},
|
|
6179
6190
|
children: n || o === 0 ? (
|
|
6180
6191
|
// Heroicons SpeakerXMarkIcon (solid)
|
|
@@ -6202,39 +6213,39 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6202
6213
|
"aria-valuemax": 100,
|
|
6203
6214
|
"aria-valuenow": Math.round(T * 100),
|
|
6204
6215
|
"aria-valuetext": n ? "Muted" : `${Math.round(T * 100)}%`,
|
|
6205
|
-
onMouseDown:
|
|
6206
|
-
onKeyDown: (
|
|
6216
|
+
onMouseDown: C,
|
|
6217
|
+
onKeyDown: (E) => {
|
|
6207
6218
|
const H = n ? 0 : o;
|
|
6208
|
-
switch (
|
|
6219
|
+
switch (E.key) {
|
|
6209
6220
|
case "ArrowRight":
|
|
6210
6221
|
case "ArrowUp":
|
|
6211
|
-
|
|
6222
|
+
E.preventDefault(), d(Math.min(1, H + 0.05));
|
|
6212
6223
|
break;
|
|
6213
6224
|
case "ArrowLeft":
|
|
6214
6225
|
case "ArrowDown":
|
|
6215
|
-
|
|
6226
|
+
E.preventDefault(), d(Math.max(0, H - 0.05));
|
|
6216
6227
|
break;
|
|
6217
6228
|
case "PageUp":
|
|
6218
|
-
|
|
6229
|
+
E.preventDefault(), d(Math.min(1, H + 0.2));
|
|
6219
6230
|
break;
|
|
6220
6231
|
case "PageDown":
|
|
6221
|
-
|
|
6232
|
+
E.preventDefault(), d(Math.max(0, H - 0.2));
|
|
6222
6233
|
break;
|
|
6223
6234
|
case "Home":
|
|
6224
|
-
|
|
6235
|
+
E.preventDefault(), d(0);
|
|
6225
6236
|
break;
|
|
6226
6237
|
case "End":
|
|
6227
|
-
|
|
6238
|
+
E.preventDefault(), d(1);
|
|
6228
6239
|
break;
|
|
6229
6240
|
case "m":
|
|
6230
6241
|
case "M":
|
|
6231
|
-
|
|
6242
|
+
E.preventDefault(), l();
|
|
6232
6243
|
break;
|
|
6233
6244
|
}
|
|
6234
6245
|
},
|
|
6235
6246
|
style: X,
|
|
6236
6247
|
children: /* @__PURE__ */ u("div", { style: D, children: [
|
|
6237
|
-
/* @__PURE__ */ s("div", { style:
|
|
6248
|
+
/* @__PURE__ */ s("div", { style: A }),
|
|
6238
6249
|
/* @__PURE__ */ s("div", { style: W })
|
|
6239
6250
|
] })
|
|
6240
6251
|
}
|
|
@@ -6247,7 +6258,7 @@ function di({ sliderDirection: a = "right", theme: e, iconSize: t = 20, hoverBac
|
|
|
6247
6258
|
}
|
|
6248
6259
|
const ui = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
6249
6260
|
function Ci() {
|
|
6250
|
-
const { setPlaybackRate: a } = q(), [e, t] = b(1), r =
|
|
6261
|
+
const { setPlaybackRate: a } = q(), [e, t] = b(1), r = $(
|
|
6251
6262
|
(n) => {
|
|
6252
6263
|
a(n), t(n);
|
|
6253
6264
|
},
|
|
@@ -6327,7 +6338,7 @@ function Ci() {
|
|
|
6327
6338
|
] }) })
|
|
6328
6339
|
] });
|
|
6329
6340
|
}
|
|
6330
|
-
const ze =
|
|
6341
|
+
const ze = de({
|
|
6331
6342
|
textColor: "#fff",
|
|
6332
6343
|
accentColor: "#6366f1",
|
|
6333
6344
|
accentAlpha15: "rgba(99,102,241,0.15)",
|
|
@@ -6376,16 +6387,16 @@ function et({ values: a, color: e, gradId: t }) {
|
|
|
6376
6387
|
const n = Math.max(...a, 1e-3), o = a.map((h, p) => [
|
|
6377
6388
|
p / (hi - 1) * 292,
|
|
6378
6389
|
48 - h / n * 42
|
|
6379
|
-
]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "),
|
|
6390
|
+
]), l = o.map(([h, p], g) => `${g === 0 ? "M" : "L"}${h.toFixed(1)},${p.toFixed(1)}`).join(" "), d = l + ` L${292 .toFixed(1)},52 L0,52 Z`, c = o[o.length - 1];
|
|
6380
6391
|
return /* @__PURE__ */ u("svg", { width: 292, height: 52, style: { display: "block", overflow: "visible" }, children: [
|
|
6381
6392
|
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ u("linearGradient", { id: t, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
6382
6393
|
/* @__PURE__ */ s("stop", { offset: "0%", stopColor: e, stopOpacity: 0.4 }),
|
|
6383
6394
|
/* @__PURE__ */ s("stop", { offset: "100%", stopColor: e, stopOpacity: 0.02 })
|
|
6384
6395
|
] }) }),
|
|
6385
|
-
/* @__PURE__ */ s("path", { d
|
|
6396
|
+
/* @__PURE__ */ s("path", { d, fill: `url(#${t})` }),
|
|
6386
6397
|
/* @__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:
|
|
6398
|
+
/* @__PURE__ */ s("circle", { cx: c[0], cy: c[1], r: 3.5, fill: e }),
|
|
6399
|
+
/* @__PURE__ */ s("circle", { cx: c[0], cy: c[1], r: 6, fill: e, fillOpacity: 0.25 })
|
|
6389
6400
|
] });
|
|
6390
6401
|
}
|
|
6391
6402
|
function z({
|
|
@@ -6396,7 +6407,7 @@ function z({
|
|
|
6396
6407
|
selected: i = !1,
|
|
6397
6408
|
isBack: n = !1
|
|
6398
6409
|
}) {
|
|
6399
|
-
const [o, l] = b(!1), { textColor:
|
|
6410
|
+
const [o, l] = b(!1), { textColor: d, accentColor: c, accentAlpha15: h, accentAlpha30: p, fontSize: g } = re(ze);
|
|
6400
6411
|
return /* @__PURE__ */ u(
|
|
6401
6412
|
"button",
|
|
6402
6413
|
{
|
|
@@ -6407,7 +6418,7 @@ function z({
|
|
|
6407
6418
|
onMouseLeave: () => l(!1),
|
|
6408
6419
|
style: {
|
|
6409
6420
|
...mi,
|
|
6410
|
-
color:
|
|
6421
|
+
color: d,
|
|
6411
6422
|
fontSize: g,
|
|
6412
6423
|
background: o ? "rgba(255,255,255,0.07)" : i ? h : "transparent",
|
|
6413
6424
|
fontWeight: i ? 600 : 400,
|
|
@@ -6424,9 +6435,9 @@ function z({
|
|
|
6424
6435
|
alignItems: "center",
|
|
6425
6436
|
justifyContent: "center",
|
|
6426
6437
|
flexShrink: 0,
|
|
6427
|
-
color: i ?
|
|
6438
|
+
color: i ? c : "rgba(255,255,255,0.65)",
|
|
6428
6439
|
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:
|
|
6440
|
+
}, children: t }) : i ? /* @__PURE__ */ s("svg", { "aria-hidden": "true", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: c, 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
6441
|
/* @__PURE__ */ s("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: a })
|
|
6431
6442
|
] }),
|
|
6432
6443
|
e !== void 0 && /* @__PURE__ */ u("span", { style: { display: "flex", alignItems: "center", gap: "4px", flexShrink: 0 }, children: [
|
|
@@ -6448,46 +6459,46 @@ function yi({
|
|
|
6448
6459
|
hoverBackground: r,
|
|
6449
6460
|
gearIcon: i
|
|
6450
6461
|
} = {}) {
|
|
6451
|
-
const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)",
|
|
6462
|
+
const n = a?.accentColor ?? "#6366f1", o = a?.textColor ?? "#fff", l = a?.background ?? "rgba(12, 12, 20, 0.97)", d = a?.borderColor ?? "rgba(255,255,255,0.1)", c = a?.fontSize ?? "13.5px", h = {
|
|
6452
6463
|
textColor: o,
|
|
6453
6464
|
accentColor: n,
|
|
6454
6465
|
accentAlpha15: n.startsWith("#") ? Je(n, 0.15) : "rgba(99,102,241,0.15)",
|
|
6455
6466
|
accentAlpha30: n.startsWith("#") ? Je(n, 0.3) : "rgba(99,102,241,0.3)",
|
|
6456
|
-
borderColor:
|
|
6457
|
-
fontSize:
|
|
6467
|
+
borderColor: d.replace("0.1)", "0.07)"),
|
|
6468
|
+
fontSize: c
|
|
6458
6469
|
}, p = {
|
|
6459
6470
|
...fi,
|
|
6460
6471
|
color: o,
|
|
6461
|
-
fontSize:
|
|
6462
|
-
borderBottom: `1px solid ${
|
|
6472
|
+
fontSize: c,
|
|
6473
|
+
borderBottom: `1px solid ${d.replace("0.1)", "0.08)")}`
|
|
6463
6474
|
}, g = e?.vertical ?? "top", m = e?.horizontal ?? "right", {
|
|
6464
|
-
setQuality:
|
|
6475
|
+
setQuality: S,
|
|
6465
6476
|
setAudioTrack: I,
|
|
6466
|
-
setPlaybackRate:
|
|
6477
|
+
setPlaybackRate: C,
|
|
6467
6478
|
setSubtitleTrack: T,
|
|
6468
|
-
getPlayerStats:
|
|
6469
|
-
} = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle:
|
|
6470
|
-
|
|
6471
|
-
X &&
|
|
6472
|
-
}, [X,
|
|
6473
|
-
const [N, H] = b([]), [Q, L] = b(null), [
|
|
6474
|
-
|
|
6479
|
+
getPlayerStats: w
|
|
6480
|
+
} = q(), y = Ce(), { playbackRate: G = 1, isLive: X } = Y(), { style: D, setStyle: A } = ut(), [_, W] = b(!1), [E, M] = b("root");
|
|
6481
|
+
k(() => {
|
|
6482
|
+
X && E === "speed" && M("root");
|
|
6483
|
+
}, [X, E]);
|
|
6484
|
+
const [N, H] = b([]), [Q, L] = b(null), [B, P] = b([]), [F, Z] = b(""), [J, Ee] = b([]), [ae, ce] = b(null), [j, Me] = b(null), [ue, me] = b([]);
|
|
6485
|
+
k(() => {
|
|
6475
6486
|
const f = () => {
|
|
6476
|
-
H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()),
|
|
6487
|
+
H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), ce(y.getActiveSubtitleLanguage());
|
|
6477
6488
|
};
|
|
6478
6489
|
y.events.on("tracksready", f), y.events.on("streamTypeDetected", f), y.events.on("qualitychange", f), y.events.on("loadedmetadata", f), f();
|
|
6479
6490
|
const K = setTimeout(f, 100);
|
|
6480
6491
|
return () => {
|
|
6481
6492
|
y.events.off("tracksready", f), y.events.off("streamTypeDetected", f), y.events.off("qualitychange", f), y.events.off("loadedmetadata", f), clearTimeout(K);
|
|
6482
6493
|
};
|
|
6483
|
-
}, [y]),
|
|
6484
|
-
_ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()),
|
|
6494
|
+
}, [y]), k(() => {
|
|
6495
|
+
_ && (H(y.getAvailableQualities()), L(y.getQuality()), P(y.getAvailableAudioTracks()), Z(y.getAudioTrack()), Ee(y.getSubtitleTracks()), ce(y.getActiveSubtitleLanguage()));
|
|
6485
6496
|
}, [_, y]);
|
|
6486
|
-
const Pe =
|
|
6487
|
-
|
|
6488
|
-
if (
|
|
6497
|
+
const Pe = B.length > 1;
|
|
6498
|
+
k(() => {
|
|
6499
|
+
if (E !== "statistics") return;
|
|
6489
6500
|
const f = () => {
|
|
6490
|
-
const xe =
|
|
6501
|
+
const xe = w();
|
|
6491
6502
|
Me(xe), me((Ve) => [...Ve.slice(-59), xe]);
|
|
6492
6503
|
};
|
|
6493
6504
|
f();
|
|
@@ -6495,24 +6506,24 @@ function yi({
|
|
|
6495
6506
|
return () => {
|
|
6496
6507
|
clearInterval(K), me([]);
|
|
6497
6508
|
};
|
|
6498
|
-
}, [
|
|
6509
|
+
}, [E, w]);
|
|
6499
6510
|
const ye = O(null);
|
|
6500
|
-
|
|
6511
|
+
k(() => {
|
|
6501
6512
|
if (!_) return;
|
|
6502
6513
|
const f = (K) => {
|
|
6503
6514
|
ye.current && !ye.current.contains(K.target) && (W(!1), M("root"));
|
|
6504
6515
|
};
|
|
6505
6516
|
return document.addEventListener("pointerdown", f), () => document.removeEventListener("pointerdown", f);
|
|
6506
|
-
}, [_]),
|
|
6517
|
+
}, [_]), k(() => {
|
|
6507
6518
|
if (!_) return;
|
|
6508
6519
|
const f = (K) => {
|
|
6509
|
-
K.key === "Escape" && (W(!1), M("root")), K.key === "Backspace" &&
|
|
6520
|
+
K.key === "Escape" && (W(!1), M("root")), K.key === "Backspace" && E !== "root" && M("root");
|
|
6510
6521
|
};
|
|
6511
6522
|
return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
|
|
6512
|
-
}, [_,
|
|
6513
|
-
const Le =
|
|
6523
|
+
}, [_, E]);
|
|
6524
|
+
const Le = $(() => {
|
|
6514
6525
|
W((f) => (f && M("root"), !f));
|
|
6515
|
-
}, []), Re = Q ? Q.id === "auto" ? "Auto" : Q.label : "Auto", le = G === 1 ? "1×" : `${G}×`, ve =
|
|
6526
|
+
}, []), Re = Q ? Q.id === "auto" ? "Auto" : Q.label : "Auto", le = G === 1 ? "1×" : `${G}×`, ve = B.find((f) => f.id === F)?.label ?? "Auto", we = 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
6527
|
/* @__PURE__ */ s("rect", { x: "2", y: "3", width: "20", height: "14", rx: "2" }),
|
|
6517
6528
|
/* @__PURE__ */ s("path", { d: "M8 21h8M12 17v4" }),
|
|
6518
6529
|
/* @__PURE__ */ s("path", { d: "m7 8 2 2 4-4 2 2" })
|
|
@@ -6548,7 +6559,7 @@ function yi({
|
|
|
6548
6559
|
!X && /* @__PURE__ */ s(z, { icon: Ie, label: "Speed", value: le, onClick: () => M("speed") }),
|
|
6549
6560
|
Pe && /* @__PURE__ */ s(z, { icon: _e, label: "Audio Track", value: ve, onClick: () => M("audio") }),
|
|
6550
6561
|
/* @__PURE__ */ s(tt, {}),
|
|
6551
|
-
/* @__PURE__ */ s(z, { icon: v, label: "Subtitles", value:
|
|
6562
|
+
/* @__PURE__ */ s(z, { icon: v, label: "Subtitles", value: we, onClick: () => M("subtitles") }),
|
|
6552
6563
|
/* @__PURE__ */ s(z, { icon: R, label: "Subtitle Style", value: `${D.fontSize}px`, onClick: () => M("subtitleStyle") }),
|
|
6553
6564
|
/* @__PURE__ */ s(tt, {}),
|
|
6554
6565
|
/* @__PURE__ */ s(z, { icon: V, label: "Statistics", onClick: () => M("statistics") })
|
|
@@ -6562,7 +6573,7 @@ function yi({
|
|
|
6562
6573
|
label: f.id === "auto" ? "Auto" : f.label,
|
|
6563
6574
|
selected: Q?.id === f.id,
|
|
6564
6575
|
onClick: () => {
|
|
6565
|
-
|
|
6576
|
+
S(f.id), L(f), W(!1), M("root");
|
|
6566
6577
|
}
|
|
6567
6578
|
},
|
|
6568
6579
|
f.id
|
|
@@ -6577,14 +6588,14 @@ function yi({
|
|
|
6577
6588
|
label: f === 1 ? "1× (Normal)" : `${f}×`,
|
|
6578
6589
|
selected: G === f,
|
|
6579
6590
|
onClick: () => {
|
|
6580
|
-
|
|
6591
|
+
C(f), W(!1), M("root");
|
|
6581
6592
|
}
|
|
6582
6593
|
},
|
|
6583
6594
|
f
|
|
6584
6595
|
)) })
|
|
6585
6596
|
] }), ft = () => /* @__PURE__ */ u(oe, { children: [
|
|
6586
6597
|
/* @__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:
|
|
6598
|
+
/* @__PURE__ */ s("div", { style: { padding: "4px 0" }, children: B.map((f) => /* @__PURE__ */ s(
|
|
6588
6599
|
z,
|
|
6589
6600
|
{
|
|
6590
6601
|
label: f.label || f.language || f.id,
|
|
@@ -6604,7 +6615,7 @@ function yi({
|
|
|
6604
6615
|
label: "Off",
|
|
6605
6616
|
selected: ae === null,
|
|
6606
6617
|
onClick: () => {
|
|
6607
|
-
T(null),
|
|
6618
|
+
T(null), ce(null), W(!1), M("root");
|
|
6608
6619
|
}
|
|
6609
6620
|
},
|
|
6610
6621
|
"off"
|
|
@@ -6615,7 +6626,7 @@ function yi({
|
|
|
6615
6626
|
label: f.label || f.language,
|
|
6616
6627
|
selected: ae === f.language,
|
|
6617
6628
|
onClick: () => {
|
|
6618
|
-
T(f.language),
|
|
6629
|
+
T(f.language), ce(f.language), W(!1), M("root");
|
|
6619
6630
|
}
|
|
6620
6631
|
},
|
|
6621
6632
|
f.url || `${f.language}-${K}`
|
|
@@ -6641,7 +6652,7 @@ function yi({
|
|
|
6641
6652
|
max: 200,
|
|
6642
6653
|
step: 5,
|
|
6643
6654
|
value: D.bottomOffset,
|
|
6644
|
-
onChange: (f) =>
|
|
6655
|
+
onChange: (f) => A({ bottomOffset: Number(f.target.value) }),
|
|
6645
6656
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6646
6657
|
}
|
|
6647
6658
|
)
|
|
@@ -6662,7 +6673,7 @@ function yi({
|
|
|
6662
6673
|
max: 40,
|
|
6663
6674
|
step: 1,
|
|
6664
6675
|
value: D.fontSize,
|
|
6665
|
-
onChange: (f) =>
|
|
6676
|
+
onChange: (f) => A({ fontSize: Number(f.target.value) }),
|
|
6666
6677
|
style: { width: "100%", accentColor: "#3b82f6", cursor: "pointer" }
|
|
6667
6678
|
}
|
|
6668
6679
|
)
|
|
@@ -6672,7 +6683,7 @@ function yi({
|
|
|
6672
6683
|
/* @__PURE__ */ s(
|
|
6673
6684
|
"button",
|
|
6674
6685
|
{
|
|
6675
|
-
onClick: () =>
|
|
6686
|
+
onClick: () => A({ background: D.background ? "" : "rgba(0,0,0,0.75)" }),
|
|
6676
6687
|
style: {
|
|
6677
6688
|
padding: "4px 12px",
|
|
6678
6689
|
borderRadius: "6px",
|
|
@@ -6691,7 +6702,7 @@ function yi({
|
|
|
6691
6702
|
/* @__PURE__ */ s("div", { style: { display: "flex", gap: "6px" }, children: ["#ffffff", "#ffff00", "#00ff00", "#00cfff"].map((f) => /* @__PURE__ */ s(
|
|
6692
6703
|
"button",
|
|
6693
6704
|
{
|
|
6694
|
-
onClick: () =>
|
|
6705
|
+
onClick: () => A({ color: f }),
|
|
6695
6706
|
title: f,
|
|
6696
6707
|
style: {
|
|
6697
6708
|
width: "22px",
|
|
@@ -6710,7 +6721,7 @@ function yi({
|
|
|
6710
6721
|
] })
|
|
6711
6722
|
] })
|
|
6712
6723
|
] }), vt = () => {
|
|
6713
|
-
const f = ue.map((ie) => ie.bandwidth), K = ue.map((ie) => ie.bufferHealth), xe = j?.bandwidth ?? 0, Ve = j?.bufferHealth ?? 0,
|
|
6724
|
+
const f = ue.map((ie) => ie.bandwidth), K = ue.map((ie) => ie.bufferHealth), xe = j?.bandwidth ?? 0, Ve = j?.bufferHealth ?? 0, Et = (ie) => ie >= 1e3 ? `${(ie / 1e3).toFixed(2)} Mbps` : `${ie.toFixed(0)} kbps`, ke = (ie, xt) => /* @__PURE__ */ u("div", { style: {
|
|
6714
6725
|
background: "rgba(255,255,255,0.04)",
|
|
6715
6726
|
borderRadius: "8px",
|
|
6716
6727
|
padding: "7px 10px",
|
|
@@ -6719,7 +6730,7 @@ function yi({
|
|
|
6719
6730
|
}, children: [
|
|
6720
6731
|
/* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: ie }),
|
|
6721
6732
|
/* @__PURE__ */ s("div", { style: { fontSize: "12px", color: "#fff", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: xt })
|
|
6722
|
-
] }), Se = j?.segmentUrl ?? "",
|
|
6733
|
+
] }), Se = j?.segmentUrl ?? "", wt = Se.length > 36 ? "…" + Se.slice(-36) : Se || "—";
|
|
6723
6734
|
return /* @__PURE__ */ u(oe, { children: [
|
|
6724
6735
|
/* @__PURE__ */ u("div", { style: { ...p, justifyContent: "space-between" }, children: [
|
|
6725
6736
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ s(z, { label: "Statistics", isBack: !0, onClick: () => M("root") }) }),
|
|
@@ -6740,7 +6751,7 @@ function yi({
|
|
|
6740
6751
|
/* @__PURE__ */ u("div", { style: { marginTop: "12px" }, children: [
|
|
6741
6752
|
/* @__PURE__ */ u("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: "6px" }, children: [
|
|
6742
6753
|
/* @__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: j ?
|
|
6754
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "16px", fontWeight: 600, color: "#4ade80", fontFamily: "monospace" }, children: j ? Et(xe) : "—" })
|
|
6744
6755
|
] }),
|
|
6745
6756
|
/* @__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
6757
|
] }),
|
|
@@ -6767,7 +6778,7 @@ function yi({
|
|
|
6767
6778
|
minWidth: 0
|
|
6768
6779
|
}, children: [
|
|
6769
6780
|
/* @__PURE__ */ s("div", { style: { fontSize: "10px", color: "rgba(255,255,255,0.4)", textTransform: "uppercase", letterSpacing: "0.06em", marginBottom: "3px" }, children: "Segment" }),
|
|
6770
|
-
/* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: Se, children:
|
|
6781
|
+
/* @__PURE__ */ s("div", { style: { fontSize: "11px", color: "rgba(255,255,255,0.7)", fontFamily: "monospace", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, title: Se, children: wt })
|
|
6771
6782
|
] })
|
|
6772
6783
|
] })
|
|
6773
6784
|
] }),
|
|
@@ -6779,7 +6790,7 @@ function yi({
|
|
|
6779
6790
|
` })
|
|
6780
6791
|
] });
|
|
6781
6792
|
}, bt = () => {
|
|
6782
|
-
switch (
|
|
6793
|
+
switch (E) {
|
|
6783
6794
|
case "quality":
|
|
6784
6795
|
return ee();
|
|
6785
6796
|
case "speed":
|
|
@@ -6858,9 +6869,9 @@ function yi({
|
|
|
6858
6869
|
style: {
|
|
6859
6870
|
...gi,
|
|
6860
6871
|
background: l,
|
|
6861
|
-
border: `1px solid ${
|
|
6862
|
-
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${
|
|
6863
|
-
width:
|
|
6872
|
+
border: `1px solid ${d}`,
|
|
6873
|
+
boxShadow: `0 12px 48px rgba(0,0,0,0.7), 0 0 0 1px ${d.replace("0.1)", "0.08)")}`,
|
|
6874
|
+
width: E === "statistics" ? "360px" : "320px",
|
|
6864
6875
|
...g === "bottom" ? { top: "52px" } : { bottom: "52px" },
|
|
6865
6876
|
...m === "left" ? { left: 0 } : { right: 0 }
|
|
6866
6877
|
},
|
|
@@ -6877,17 +6888,17 @@ function yi({
|
|
|
6877
6888
|
}
|
|
6878
6889
|
function Ti({ label: a = "AirPlay", className: e = "" }) {
|
|
6879
6890
|
const t = Ce(), [r, i] = b(!1), [n, o] = b(!1);
|
|
6880
|
-
|
|
6891
|
+
k(() => {
|
|
6881
6892
|
if (!t) return;
|
|
6882
6893
|
i(t.isAirPlayAvailable()), o(t.isAirPlayActive());
|
|
6883
|
-
const
|
|
6884
|
-
i(
|
|
6894
|
+
const d = ({ isAvailable: c, isActive: h }) => {
|
|
6895
|
+
i(c), o(h);
|
|
6885
6896
|
};
|
|
6886
|
-
return t.events.on("airplaychange",
|
|
6887
|
-
t.events.off("airplaychange",
|
|
6897
|
+
return t.events.on("airplaychange", d), () => {
|
|
6898
|
+
t.events.off("airplaychange", d);
|
|
6888
6899
|
};
|
|
6889
6900
|
}, [t]);
|
|
6890
|
-
const l =
|
|
6901
|
+
const l = $(() => {
|
|
6891
6902
|
t?.showAirPlayPicker();
|
|
6892
6903
|
}, [t]);
|
|
6893
6904
|
return r ? /* @__PURE__ */ s(
|
|
@@ -6934,20 +6945,20 @@ function Mi({
|
|
|
6934
6945
|
className: e = ""
|
|
6935
6946
|
}) {
|
|
6936
6947
|
const t = Ce(), [r, i] = b(!1), [n, o] = b(!1);
|
|
6937
|
-
|
|
6948
|
+
k(() => {
|
|
6938
6949
|
if (!t) return;
|
|
6939
6950
|
i(t.isCastAvailable()), o(t.isCastActive());
|
|
6940
|
-
const
|
|
6941
|
-
isAvailable:
|
|
6951
|
+
const d = ({
|
|
6952
|
+
isAvailable: c,
|
|
6942
6953
|
isActive: h
|
|
6943
6954
|
}) => {
|
|
6944
|
-
i(
|
|
6955
|
+
i(c), o(h);
|
|
6945
6956
|
};
|
|
6946
|
-
return t.events.on("castchange",
|
|
6947
|
-
t.events.off("castchange",
|
|
6957
|
+
return t.events.on("castchange", d), () => {
|
|
6958
|
+
t.events.off("castchange", d);
|
|
6948
6959
|
};
|
|
6949
6960
|
}, [t]);
|
|
6950
|
-
const l =
|
|
6961
|
+
const l = $(() => {
|
|
6951
6962
|
n ? t?.stopCasting() : t?.showCastPicker();
|
|
6952
6963
|
}, [t, n]);
|
|
6953
6964
|
return r ? /* @__PURE__ */ s(
|
|
@@ -7002,17 +7013,17 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7002
7013
|
iconBackground: n?.iconBackground ?? "rgba(255,255,255,0.08)",
|
|
7003
7014
|
dividerColor: n?.dividerColor ?? "rgba(255,255,255,0.07)"
|
|
7004
7015
|
}, l = O(null);
|
|
7005
|
-
return
|
|
7016
|
+
return k(() => {
|
|
7006
7017
|
if (!t) return;
|
|
7007
|
-
const
|
|
7008
|
-
if ("key" in
|
|
7009
|
-
|
|
7018
|
+
const d = (c) => {
|
|
7019
|
+
if ("key" in c) {
|
|
7020
|
+
c.key === "Escape" && r();
|
|
7010
7021
|
return;
|
|
7011
7022
|
}
|
|
7012
|
-
l.current && !l.current.contains(
|
|
7023
|
+
l.current && !l.current.contains(c.target) && r();
|
|
7013
7024
|
};
|
|
7014
|
-
return document.addEventListener("mousedown",
|
|
7015
|
-
document.removeEventListener("mousedown",
|
|
7025
|
+
return document.addEventListener("mousedown", d), document.addEventListener("keydown", d), () => {
|
|
7026
|
+
document.removeEventListener("mousedown", d), document.removeEventListener("keydown", d);
|
|
7016
7027
|
};
|
|
7017
7028
|
}, [t, r]), t ? /* @__PURE__ */ u(oe, { children: [
|
|
7018
7029
|
/* @__PURE__ */ s(
|
|
@@ -7037,13 +7048,13 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7037
7048
|
animation: "ctxFadeIn 0.14s ease-out",
|
|
7038
7049
|
overflow: "hidden"
|
|
7039
7050
|
},
|
|
7040
|
-
children: i.map((
|
|
7051
|
+
children: i.map((d, c) => /* @__PURE__ */ u("div", { children: [
|
|
7041
7052
|
/* @__PURE__ */ u(
|
|
7042
7053
|
"button",
|
|
7043
7054
|
{
|
|
7044
7055
|
role: "menuitem",
|
|
7045
7056
|
onClick: () => {
|
|
7046
|
-
|
|
7057
|
+
d.onClick(), r();
|
|
7047
7058
|
},
|
|
7048
7059
|
style: {
|
|
7049
7060
|
display: "flex",
|
|
@@ -7053,38 +7064,38 @@ function Pi({ x: a, y: e, isOpen: t, onClose: r, actions: i, theme: n }) {
|
|
|
7053
7064
|
padding: "9px 14px",
|
|
7054
7065
|
background: "transparent",
|
|
7055
7066
|
border: "none",
|
|
7056
|
-
color:
|
|
7067
|
+
color: d.danger ? o.dangerColor : o.textColor,
|
|
7057
7068
|
fontSize: "13.5px",
|
|
7058
7069
|
textAlign: "left",
|
|
7059
7070
|
cursor: "pointer",
|
|
7060
7071
|
transition: "background 0.1s"
|
|
7061
7072
|
},
|
|
7062
7073
|
onMouseEnter: (h) => {
|
|
7063
|
-
h.currentTarget.style.background =
|
|
7074
|
+
h.currentTarget.style.background = d.danger ? "rgba(239,68,68,0.12)" : o.hoverBackground;
|
|
7064
7075
|
},
|
|
7065
7076
|
onMouseLeave: (h) => {
|
|
7066
7077
|
h.currentTarget.style.background = "transparent";
|
|
7067
7078
|
},
|
|
7068
7079
|
children: [
|
|
7069
|
-
|
|
7080
|
+
d.icon !== void 0 && /* @__PURE__ */ s("span", { style: {
|
|
7070
7081
|
width: "28px",
|
|
7071
7082
|
height: "28px",
|
|
7072
7083
|
borderRadius: "7px",
|
|
7073
|
-
background:
|
|
7084
|
+
background: d.danger ? "rgba(239,68,68,0.15)" : o.iconBackground,
|
|
7074
7085
|
display: "flex",
|
|
7075
7086
|
alignItems: "center",
|
|
7076
7087
|
justifyContent: "center",
|
|
7077
7088
|
flexShrink: 0,
|
|
7078
|
-
color:
|
|
7089
|
+
color: d.danger ? o.dangerColor : o.textColor,
|
|
7079
7090
|
fontSize: "13px",
|
|
7080
7091
|
lineHeight: 1
|
|
7081
|
-
}, children:
|
|
7082
|
-
/* @__PURE__ */ s("span", { style: { flex: 1 }, children:
|
|
7092
|
+
}, children: d.icon }),
|
|
7093
|
+
/* @__PURE__ */ s("span", { style: { flex: 1 }, children: d.label })
|
|
7083
7094
|
]
|
|
7084
7095
|
}
|
|
7085
7096
|
),
|
|
7086
|
-
|
|
7087
|
-
] },
|
|
7097
|
+
d.dividerAfter && /* @__PURE__ */ s("div", { style: { height: "1px", background: o.dividerColor, margin: "3px 0" } })
|
|
7098
|
+
] }, c))
|
|
7088
7099
|
}
|
|
7089
7100
|
),
|
|
7090
7101
|
/* @__PURE__ */ s("style", { children: `
|
|
@@ -7100,8 +7111,8 @@ const Li = ({ mode: a }) => {
|
|
|
7100
7111
|
return /* @__PURE__ */ u(Or, { children: [
|
|
7101
7112
|
/* @__PURE__ */ s(zr, {}),
|
|
7102
7113
|
!t && /* @__PURE__ */ s(li, { seconds: 15 }),
|
|
7103
|
-
!t && /* @__PURE__ */ s(
|
|
7104
|
-
/* @__PURE__ */ s(
|
|
7114
|
+
!t && /* @__PURE__ */ s(di, { seconds: 15 }),
|
|
7115
|
+
/* @__PURE__ */ s(ci, { sliderDirection: "top" }),
|
|
7105
7116
|
!t && /* @__PURE__ */ s(Jr, {}),
|
|
7106
7117
|
/* @__PURE__ */ s("div", { style: { flex: 1 } }),
|
|
7107
7118
|
/* @__PURE__ */ s(yi, { theme: { background: "#fb0000" } }),
|
|
@@ -7229,7 +7240,7 @@ export {
|
|
|
7229
7240
|
Kr as PipButton,
|
|
7230
7241
|
zr as PlayButton,
|
|
7231
7242
|
Ci as PlaybackSpeedSelector,
|
|
7232
|
-
|
|
7243
|
+
wi as Player,
|
|
7233
7244
|
fe as PlayerCore,
|
|
7234
7245
|
Gt as PlayerProvider,
|
|
7235
7246
|
Di as Playron,
|
|
@@ -7239,18 +7250,18 @@ export {
|
|
|
7239
7250
|
Si as SettingsButton,
|
|
7240
7251
|
yi as SettingsPanel,
|
|
7241
7252
|
li as SkipBackwardButton,
|
|
7242
|
-
|
|
7253
|
+
di as SkipForwardButton,
|
|
7243
7254
|
Ai as SkipIntroButton,
|
|
7244
7255
|
Rt as StallDetector,
|
|
7245
7256
|
Pt as StreamDetector,
|
|
7246
7257
|
ki as TheaterModeButton,
|
|
7247
7258
|
si as ThumbnailManager,
|
|
7248
7259
|
Jr as TimeDisplay,
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7260
|
+
x as VideoEventType,
|
|
7261
|
+
ci as VolumeControl,
|
|
7262
|
+
wi as default,
|
|
7252
7263
|
ge as eventBus,
|
|
7253
|
-
|
|
7264
|
+
Ei as isVideoEventType,
|
|
7254
7265
|
Lt as streamDetector,
|
|
7255
7266
|
Lr as useMobileGestures,
|
|
7256
7267
|
Ce as usePlayer,
|