@therealtinhtute/baroiplayer 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/context/media.js +1 -2
- package/dist/context/media.mjs +3 -15
- package/dist/context/store.js +1 -2
- package/dist/context/store.mjs +3 -5
- package/dist/context-Bzd5QCKM.cjs +7 -0
- package/dist/context-Bzd5QCKM.cjs.map +1 -0
- package/dist/context-DD_SH4tT.js +1053 -0
- package/dist/context-DD_SH4tT.js.map +1 -0
- package/dist/core-events-BRnLMB7s.cjs +2 -0
- package/dist/core-events-BRnLMB7s.cjs.map +1 -0
- package/dist/core-events-v_mKdj5p.js +417 -0
- package/dist/core-events-v_mKdj5p.js.map +1 -0
- package/dist/core-plugins-CMBv-yVh.cjs +2 -0
- package/dist/core-plugins-CMBv-yVh.cjs.map +1 -0
- package/dist/core-plugins-CqCxLkbd.js +754 -0
- package/dist/core-plugins-CqCxLkbd.js.map +1 -0
- package/dist/core.js +7 -29
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +947 -1220
- package/dist/core.mjs.map +1 -1
- package/dist/enhanced-components-BwjBqSA1.js +2858 -0
- package/dist/enhanced-components-BwjBqSA1.js.map +1 -0
- package/dist/enhanced-components-C-ka-XLp.cjs +2 -0
- package/dist/enhanced-components-C-ka-XLp.cjs.map +1 -0
- package/dist/hooks-B-IIWPJr.js +1842 -0
- package/dist/hooks-B-IIWPJr.js.map +1 -0
- package/dist/hooks-DcHzmBwA.cjs +4 -0
- package/dist/hooks-DcHzmBwA.cjs.map +1 -0
- package/dist/index.js +27 -97
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5613 -6210
- package/dist/index.mjs.map +1 -1
- package/dist/minimal-components-BYsMQde5.js +1610 -0
- package/dist/minimal-components-BYsMQde5.js.map +1 -0
- package/dist/minimal-components-CsxQbDp7.cjs +2 -0
- package/dist/minimal-components-CsxQbDp7.cjs.map +1 -0
- package/dist/performance-monitor-DCSijLJg.js +312 -0
- package/dist/performance-monitor-DCSijLJg.js.map +1 -0
- package/dist/performance-monitor-wNFKmqMr.cjs +2 -0
- package/dist/performance-monitor-wNFKmqMr.cjs.map +1 -0
- package/dist/rolldown-runtime-BmowowmI.js +14 -0
- package/dist/rolldown-runtime-mLOUI7ql.cjs +1 -0
- package/dist/utils-D2gQ7c2R.js +64 -0
- package/dist/utils-D2gQ7c2R.js.map +1 -0
- package/dist/utils-DJaAwiZ9.cjs +2 -0
- package/dist/utils-DJaAwiZ9.cjs.map +1 -0
- package/dist/utils.js +1 -2
- package/dist/utils.mjs +3 -11
- package/package.json +28 -22
- package/src/components/AnimateLoading.tsx +14 -10
- package/src/components/accessibility/keyboard-help-overlay.tsx +2 -0
- package/src/components/enhanced/debug-panel.tsx +1 -1
- package/src/components/enhanced/enhanced-media-player.tsx +68 -25
- package/src/components/examples/loading-states-demo.tsx +1 -2
- package/src/components/examples/react-19-demo.tsx +6 -10
- package/src/components/examples/volume-orientation-demo.tsx +1 -2
- package/src/components/legacy.tsx +6 -6
- package/src/components/media-player-video.tsx +5 -12
- package/src/components/media-player.tsx +2 -2
- package/src/components/ui/blur-poster.tsx +18 -15
- package/src/components/ui/enhanced-seek-bar.tsx +2 -2
- package/src/components/ui/media-resource-preloader.tsx +21 -23
- package/src/components/unified/base-media-player.tsx +22 -10
- package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +58 -38
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +6 -6
- package/src/components/variants/minimal/components/VideoElement.tsx +3 -1
- package/src/core/optimization/bundle-optimizer.tsx +26 -27
- package/src/core/performance/media-loading-optimizer.ts +2 -1
- package/src/core/plugins/__tests__/registry.test.ts +1 -1
- package/src/core/plugins/enhanced-plugin-system.ts +26 -8
- package/src/core/plugins/registry.ts +319 -92
- package/src/core/plugins/types.ts +21 -3
- package/src/core/providers/enhanced-hls-provider.ts +11 -40
- package/src/core/providers/lazy-provider.tsx +5 -42
- package/src/features/media-session/media-session-manager.ts +4 -26
- package/src/features/picture-in-picture/pip-manager.ts +2 -2
- package/src/features/playlist/playlist-manager.ts +26 -18
- package/src/features/subtitles/subtitle-manager.ts +1 -1
- package/src/features/subtitles/subtitle-parser.ts +19 -16
- package/src/features/thumbnails/thumbnail-generator.ts +12 -5
- package/src/hooks/__tests__/currentTime-fix.test.ts +149 -0
- package/src/hooks/accessibility/use-accessibility-preferences.ts +1 -1
- package/src/hooks/accessibility/use-focus-management.ts +2 -2
- package/src/hooks/accessibility/use-keyboard-shortcuts.ts +2 -2
- package/src/hooks/accessibility/use-screen-reader.ts +1 -1
- package/src/hooks/core/index.ts +1 -1
- package/src/hooks/use-buffer-health.ts +1 -1
- package/src/hooks/use-enhanced-media-player.ts +107 -9
- package/src/hooks/use-focus-trap.tsx +2 -2
- package/src/hooks/use-intelligent-preloading.ts +23 -3
- package/src/hooks/use-keyboard-shortcuts.ts +2 -2
- package/src/hooks/use-media-player.ts +74 -43
- package/src/hooks/use-memory-optimization.ts +15 -15
- package/src/hooks/use-smart-preload.ts +1 -2
- package/src/hooks/useKeyboardShortcuts.ts +34 -2
- package/src/hooks/useScreenshot.ts +60 -44
- package/src/hooks/useVideoPlayer.ts +50 -4
- package/src/index-legacy.ts +3 -5
- package/src/test/accessibility-utils.ts +7 -7
- package/src/test/media-mocks.ts +41 -28
- package/src/test/setup.ts +22 -4
- package/src/types/assets.d.ts +29 -0
- package/src/types/index.ts +13 -0
- package/dist/context/media.js.map +0 -1
- package/dist/context/media.mjs.map +0 -1
- package/dist/context/store.js.map +0 -1
- package/dist/context/store.mjs.map +0 -1
- package/dist/context-BYwDoSRX.js +0 -1172
- package/dist/context-BYwDoSRX.js.map +0 -1
- package/dist/context-eNS62_ac.cjs +0 -23
- package/dist/context-eNS62_ac.cjs.map +0 -1
- package/dist/core-events-B1iM2F46.cjs +0 -2
- package/dist/core-events-B1iM2F46.cjs.map +0 -1
- package/dist/core-events-DunPHKRE.js +0 -484
- package/dist/core-events-DunPHKRE.js.map +0 -1
- package/dist/core-plugins-CROGvQUy.js +0 -686
- package/dist/core-plugins-CROGvQUy.js.map +0 -1
- package/dist/core-plugins-DtsHBOtF.cjs +0 -2
- package/dist/core-plugins-DtsHBOtF.cjs.map +0 -1
- package/dist/enhanced-components-DUw2KrmQ.js +0 -1142
- package/dist/enhanced-components-DUw2KrmQ.js.map +0 -1
- package/dist/enhanced-components-DXBCHU0v.cjs +0 -2
- package/dist/enhanced-components-DXBCHU0v.cjs.map +0 -1
- package/dist/hooks-BW-JjVgP.cjs +0 -4
- package/dist/hooks-BW-JjVgP.cjs.map +0 -1
- package/dist/hooks-CyX6De5M.js +0 -1693
- package/dist/hooks-CyX6De5M.js.map +0 -1
- package/dist/minimal-components-Bdcpxav5.cjs +0 -2
- package/dist/minimal-components-Bdcpxav5.cjs.map +0 -1
- package/dist/minimal-components-DlRK7Qu_.js +0 -1927
- package/dist/minimal-components-DlRK7Qu_.js.map +0 -1
- package/dist/performance-monitor-C5k6FDXw.js +0 -301
- package/dist/performance-monitor-C5k6FDXw.js.map +0 -1
- package/dist/performance-monitor-lJmuUjQQ.cjs +0 -2
- package/dist/performance-monitor-lJmuUjQQ.cjs.map +0 -1
- package/dist/utils-CFOue_9K.cjs +0 -9
- package/dist/utils-CFOue_9K.cjs.map +0 -1
- package/dist/utils-Dzpl2ArK.js +0 -2844
- package/dist/utils-Dzpl2ArK.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs.map +0 -1
|
@@ -1,1142 +0,0 @@
|
|
|
1
|
-
import { u as K, a as L, b, j as e, M as p } from "./context-BYwDoSRX.js";
|
|
2
|
-
import r, { useMemo as U } from "react";
|
|
3
|
-
import { c as m, f as D } from "./utils-Dzpl2ArK.js";
|
|
4
|
-
function $(...d) {
|
|
5
|
-
return (l) => {
|
|
6
|
-
d.forEach((s) => {
|
|
7
|
-
typeof s == "function" ? s(l) : s && (s.current = l);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function X(d, l, s, n) {
|
|
12
|
-
const [t, o] = r.useState(!0), [a, i] = r.useState(!1), [c, x] = r.useState(!1), u = r.useRef(null), w = r.useCallback(() => {
|
|
13
|
-
u.current && clearTimeout(u.current), d && (u.current = setTimeout(() => {
|
|
14
|
-
!a && !c && o(!1);
|
|
15
|
-
}, l));
|
|
16
|
-
}, [d, l, a, c]), C = r.useCallback(() => {
|
|
17
|
-
o(!0), w();
|
|
18
|
-
}, [w]);
|
|
19
|
-
r.useEffect(() => (d ? w() : o(!0), () => {
|
|
20
|
-
u.current && clearTimeout(u.current);
|
|
21
|
-
}), [d, w]);
|
|
22
|
-
const g = r.useCallback(() => {
|
|
23
|
-
s && (i(!0), o(!0));
|
|
24
|
-
}, [s]), y = r.useCallback(() => {
|
|
25
|
-
s && (i(!1), w());
|
|
26
|
-
}, [s, w]), h = r.useCallback(() => {
|
|
27
|
-
n && (x(!0), C());
|
|
28
|
-
}, [n, C]), N = r.useCallback(() => {
|
|
29
|
-
n && (x(!1), w());
|
|
30
|
-
}, [n, w]);
|
|
31
|
-
return {
|
|
32
|
-
showControls: t,
|
|
33
|
-
showControlsTemporarily: C,
|
|
34
|
-
handleMouseEnter: g,
|
|
35
|
-
handleMouseLeave: y,
|
|
36
|
-
handleTouchStart: h,
|
|
37
|
-
handleTouchEnd: N
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function G(d) {
|
|
41
|
-
const l = L(), s = b((g) => g.isPlaying), n = b((g) => g.currentTime), t = b((g) => g.duration), o = b((g) => g.volume), [a, i] = r.useState(
|
|
42
|
-
null
|
|
43
|
-
), [c, x] = r.useState(!1), u = r.useCallback(
|
|
44
|
-
(g) => {
|
|
45
|
-
if (!d) return;
|
|
46
|
-
const y = g.touches[0];
|
|
47
|
-
if (!y) return;
|
|
48
|
-
const h = Date.now();
|
|
49
|
-
a && h - a.time < 300 ? (x(!0), l({
|
|
50
|
-
type: s ? p.PAUSE : p.PLAY
|
|
51
|
-
})) : (i({
|
|
52
|
-
x: y.clientX,
|
|
53
|
-
y: y.clientY,
|
|
54
|
-
time: h
|
|
55
|
-
}), x(!1));
|
|
56
|
-
},
|
|
57
|
-
[d, a, s, l]
|
|
58
|
-
), w = r.useCallback(
|
|
59
|
-
(g) => {
|
|
60
|
-
if (!d || !a || c) return;
|
|
61
|
-
const y = g.touches[0];
|
|
62
|
-
if (!y) return;
|
|
63
|
-
const h = y.clientX - a.x, N = y.clientY - a.y;
|
|
64
|
-
if (Math.abs(h) > Math.abs(N) && Math.abs(h) > 50) {
|
|
65
|
-
const E = h / window.innerWidth * 30, T = Math.max(0, Math.min(t, n + E));
|
|
66
|
-
l({
|
|
67
|
-
type: p.SEEK,
|
|
68
|
-
detail: T
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
if (Math.abs(N) > Math.abs(h) && Math.abs(N) > 50 && a.x > window.innerWidth / 2) {
|
|
72
|
-
const E = -(N / window.innerHeight) * 1, T = Math.max(0, Math.min(1, o + E));
|
|
73
|
-
l({
|
|
74
|
-
type: p.SET_VOLUME,
|
|
75
|
-
detail: T
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[d, a, c, t, n, o, l]
|
|
80
|
-
), C = r.useCallback(() => {
|
|
81
|
-
d && setTimeout(() => {
|
|
82
|
-
i(null), x(!1);
|
|
83
|
-
}, 300);
|
|
84
|
-
}, [d]);
|
|
85
|
-
return {
|
|
86
|
-
handleTouchStart: u,
|
|
87
|
-
handleTouchMove: w,
|
|
88
|
-
handleTouchEnd: C
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const Y = function({
|
|
92
|
-
children: l,
|
|
93
|
-
className: s,
|
|
94
|
-
autoHide: n = !0,
|
|
95
|
-
autoHideDelay: t = 3e3,
|
|
96
|
-
showControlsOnHover: o = !0,
|
|
97
|
-
showControlsOnTouch: a = !0,
|
|
98
|
-
enableKeyboardControls: i = !0,
|
|
99
|
-
enableTouchGestures: c = !0,
|
|
100
|
-
onPlay: x,
|
|
101
|
-
onPause: u,
|
|
102
|
-
onTimeUpdate: w,
|
|
103
|
-
onVolumeChange: C,
|
|
104
|
-
onFullscreenChange: g
|
|
105
|
-
}) {
|
|
106
|
-
const y = K(), h = L(), N = b(r.useCallback((k) => k.isPlaying, [])), E = b(r.useCallback((k) => k.isFullscreen, [])), T = b(r.useCallback((k) => k.currentTime, [])), S = b(r.useCallback((k) => k.volume, [])), f = b(r.useCallback((k) => k.error, [])), {
|
|
107
|
-
showControls: v,
|
|
108
|
-
showControlsTemporarily: B,
|
|
109
|
-
handleMouseEnter: z,
|
|
110
|
-
handleMouseLeave: A,
|
|
111
|
-
handleTouchStart: j,
|
|
112
|
-
handleTouchEnd: M
|
|
113
|
-
} = X(n, t, o, a), {
|
|
114
|
-
handleTouchStart: F,
|
|
115
|
-
handleTouchMove: V,
|
|
116
|
-
handleTouchEnd: R
|
|
117
|
-
} = G(c), I = r.useCallback(
|
|
118
|
-
(k) => {
|
|
119
|
-
j(), F(k);
|
|
120
|
-
},
|
|
121
|
-
[j, F]
|
|
122
|
-
), H = r.useCallback(() => {
|
|
123
|
-
M(), R();
|
|
124
|
-
}, [M, R]), O = r.useCallback(() => {
|
|
125
|
-
B();
|
|
126
|
-
}, [B]);
|
|
127
|
-
return r.useEffect(() => {
|
|
128
|
-
if (!i) return;
|
|
129
|
-
const k = (P) => {
|
|
130
|
-
if (!(P.target instanceof HTMLInputElement || P.target instanceof HTMLTextAreaElement))
|
|
131
|
-
switch (P.code) {
|
|
132
|
-
case "Space":
|
|
133
|
-
case "KeyK":
|
|
134
|
-
P.preventDefault(), h({
|
|
135
|
-
type: N ? p.PAUSE : p.PLAY
|
|
136
|
-
});
|
|
137
|
-
break;
|
|
138
|
-
case "KeyF":
|
|
139
|
-
P.preventDefault(), h({
|
|
140
|
-
type: E ? p.EXIT_FULLSCREEN : p.ENTER_FULLSCREEN
|
|
141
|
-
});
|
|
142
|
-
break;
|
|
143
|
-
case "KeyM":
|
|
144
|
-
P.preventDefault(), h({ type: p.TOGGLE_MUTE });
|
|
145
|
-
break;
|
|
146
|
-
case "ArrowLeft":
|
|
147
|
-
P.preventDefault(), h({
|
|
148
|
-
type: p.SEEK,
|
|
149
|
-
detail: Math.max(0, T - 10)
|
|
150
|
-
});
|
|
151
|
-
break;
|
|
152
|
-
case "ArrowRight":
|
|
153
|
-
P.preventDefault(), h({
|
|
154
|
-
type: p.SEEK,
|
|
155
|
-
detail: T + 10
|
|
156
|
-
});
|
|
157
|
-
break;
|
|
158
|
-
case "ArrowUp":
|
|
159
|
-
P.preventDefault(), h({
|
|
160
|
-
type: p.SET_VOLUME,
|
|
161
|
-
detail: Math.min(1, S + 0.1)
|
|
162
|
-
});
|
|
163
|
-
break;
|
|
164
|
-
case "ArrowDown":
|
|
165
|
-
P.preventDefault(), h({
|
|
166
|
-
type: p.SET_VOLUME,
|
|
167
|
-
detail: Math.max(0, S - 0.1)
|
|
168
|
-
});
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
return document.addEventListener("keydown", k), () => document.removeEventListener("keydown", k);
|
|
173
|
-
}, [i, h, N, E, T, S]), r.useEffect(() => {
|
|
174
|
-
N ? x?.() : u?.();
|
|
175
|
-
}, [N, x, u]), r.useEffect(() => {
|
|
176
|
-
w?.(T);
|
|
177
|
-
}, [T, w]), r.useEffect(() => {
|
|
178
|
-
C?.(S);
|
|
179
|
-
}, [S, C]), r.useEffect(() => {
|
|
180
|
-
g?.(E);
|
|
181
|
-
}, [E, g]), /* @__PURE__ */ e.jsx(
|
|
182
|
-
"div",
|
|
183
|
-
{
|
|
184
|
-
ref: $(y.rootRef),
|
|
185
|
-
className: m(
|
|
186
|
-
"relative isolate flex flex-col overflow-hidden rounded-lg bg-black outline-none",
|
|
187
|
-
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
188
|
-
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
189
|
-
E && "fixed inset-0 z-50 rounded-none",
|
|
190
|
-
s
|
|
191
|
-
),
|
|
192
|
-
"data-state": E ? "fullscreen" : "inline",
|
|
193
|
-
"data-disabled": f ? "" : void 0,
|
|
194
|
-
"data-controls-visible": v ? "" : void 0,
|
|
195
|
-
tabIndex: 0,
|
|
196
|
-
onMouseEnter: z,
|
|
197
|
-
onMouseLeave: A,
|
|
198
|
-
onTouchStart: I,
|
|
199
|
-
onTouchMove: V,
|
|
200
|
-
onTouchEnd: H,
|
|
201
|
-
onClick: O,
|
|
202
|
-
children: l
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
Y.displayName = "EnhancedMediaPlayer";
|
|
207
|
-
const W = function({
|
|
208
|
-
qualities: l,
|
|
209
|
-
currentQuality: s,
|
|
210
|
-
onQualityChange: n,
|
|
211
|
-
className: t
|
|
212
|
-
}) {
|
|
213
|
-
const [o, a] = r.useState(!1), i = r.useMemo(() => l.find((c) => c.id === s)?.label || "Auto", [l, s]);
|
|
214
|
-
return /* @__PURE__ */ e.jsxs("div", { className: m("relative", t), children: [
|
|
215
|
-
/* @__PURE__ */ e.jsxs(
|
|
216
|
-
"button",
|
|
217
|
-
{
|
|
218
|
-
type: "button",
|
|
219
|
-
onClick: () => a(!o),
|
|
220
|
-
className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
|
|
221
|
-
"aria-label": "Select quality",
|
|
222
|
-
children: [
|
|
223
|
-
/* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }),
|
|
224
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: i }),
|
|
225
|
-
/* @__PURE__ */ e.jsx(
|
|
226
|
-
"svg",
|
|
227
|
-
{
|
|
228
|
-
viewBox: "0 0 24 24",
|
|
229
|
-
fill: "currentColor",
|
|
230
|
-
className: m("h-4 w-4 transition-transform", o && "rotate-180"),
|
|
231
|
-
children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
|
|
232
|
-
}
|
|
233
|
-
)
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
),
|
|
237
|
-
o && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-full mb-2 min-w-32 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: l.map((c) => /* @__PURE__ */ e.jsxs(
|
|
238
|
-
"button",
|
|
239
|
-
{
|
|
240
|
-
onClick: () => {
|
|
241
|
-
n(c.id), a(!1);
|
|
242
|
-
},
|
|
243
|
-
className: m(
|
|
244
|
-
"w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
|
|
245
|
-
c.id === s && "bg-primary/20 text-primary"
|
|
246
|
-
),
|
|
247
|
-
children: [
|
|
248
|
-
c.label,
|
|
249
|
-
c.bitrate && /* @__PURE__ */ e.jsxs("span", { className: "ml-2 text-white/60 text-xs", children: [
|
|
250
|
-
"(",
|
|
251
|
-
Math.round(c.bitrate / 1e3),
|
|
252
|
-
"k)"
|
|
253
|
-
] })
|
|
254
|
-
]
|
|
255
|
-
},
|
|
256
|
-
c.id
|
|
257
|
-
)) })
|
|
258
|
-
] });
|
|
259
|
-
}, Q = function({
|
|
260
|
-
subtitles: l,
|
|
261
|
-
currentSubtitle: s,
|
|
262
|
-
onSubtitleChange: n,
|
|
263
|
-
className: t
|
|
264
|
-
}) {
|
|
265
|
-
const [o, a] = r.useState(!1), i = r.useMemo(() => s && l.find((c) => c.id === s)?.label || "Off", [l, s]);
|
|
266
|
-
return /* @__PURE__ */ e.jsxs("div", { className: m("relative", t), children: [
|
|
267
|
-
/* @__PURE__ */ e.jsxs(
|
|
268
|
-
"button",
|
|
269
|
-
{
|
|
270
|
-
type: "button",
|
|
271
|
-
onClick: () => a(!o),
|
|
272
|
-
className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
|
|
273
|
-
"aria-label": "Select subtitles",
|
|
274
|
-
children: [
|
|
275
|
-
/* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM4 12h4v2H4v-2zm10 6H4v-2h10v2zm6 0h-4v-2h4v2zm0-4H10v-2h10v2z" }) }),
|
|
276
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm", children: i }),
|
|
277
|
-
/* @__PURE__ */ e.jsx(
|
|
278
|
-
"svg",
|
|
279
|
-
{
|
|
280
|
-
viewBox: "0 0 24 24",
|
|
281
|
-
fill: "currentColor",
|
|
282
|
-
className: m("h-4 w-4 transition-transform", o && "rotate-180"),
|
|
283
|
-
children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
|
|
284
|
-
}
|
|
285
|
-
)
|
|
286
|
-
]
|
|
287
|
-
}
|
|
288
|
-
),
|
|
289
|
-
o && /* @__PURE__ */ e.jsxs("div", { className: "absolute right-0 bottom-full mb-2 min-w-32 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: [
|
|
290
|
-
/* @__PURE__ */ e.jsx(
|
|
291
|
-
"button",
|
|
292
|
-
{
|
|
293
|
-
onClick: () => {
|
|
294
|
-
n(null), a(!1);
|
|
295
|
-
},
|
|
296
|
-
className: m(
|
|
297
|
-
"w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
|
|
298
|
-
!s && "bg-primary/20 text-primary"
|
|
299
|
-
),
|
|
300
|
-
children: "Off"
|
|
301
|
-
}
|
|
302
|
-
),
|
|
303
|
-
l.map((c) => /* @__PURE__ */ e.jsx(
|
|
304
|
-
"button",
|
|
305
|
-
{
|
|
306
|
-
onClick: () => {
|
|
307
|
-
n(c.id), a(!1);
|
|
308
|
-
},
|
|
309
|
-
className: m(
|
|
310
|
-
"w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
|
|
311
|
-
c.id === s && "bg-primary/20 text-primary"
|
|
312
|
-
),
|
|
313
|
-
children: c.label
|
|
314
|
-
},
|
|
315
|
-
c.id
|
|
316
|
-
))
|
|
317
|
-
] })
|
|
318
|
-
] });
|
|
319
|
-
}, J = function({
|
|
320
|
-
className: l
|
|
321
|
-
}) {
|
|
322
|
-
const s = L(), n = b((c) => c.playbackRate), [t, o] = r.useState(!1), a = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2], i = r.useCallback(
|
|
323
|
-
(c) => {
|
|
324
|
-
s({ type: p.SET_PLAYBACK_RATE, detail: c }), o(!1);
|
|
325
|
-
},
|
|
326
|
-
[s]
|
|
327
|
-
);
|
|
328
|
-
return /* @__PURE__ */ e.jsxs("div", { className: m("relative", l), children: [
|
|
329
|
-
/* @__PURE__ */ e.jsxs(
|
|
330
|
-
"button",
|
|
331
|
-
{
|
|
332
|
-
type: "button",
|
|
333
|
-
onClick: () => o(!t),
|
|
334
|
-
className: "flex items-center gap-2 rounded-lg bg-black/50 px-3 py-2 text-white transition-colors hover:bg-black/70",
|
|
335
|
-
"aria-label": "Select playback speed",
|
|
336
|
-
children: [
|
|
337
|
-
/* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-4 w-4", children: /* @__PURE__ */ e.jsx("path", { d: "M13,8A4,4 0 0,0 9,12A4,4 0 0,0 13,16A4,4 0 0,0 17,12A4,4 0 0,0 13,8M13,14A2,2 0 0,1 11,12A2,2 0 0,1 13,10A2,2 0 0,1 15,12A2,2 0 0,1 13,14M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4Z" }) }),
|
|
338
|
-
/* @__PURE__ */ e.jsxs("span", { className: "text-sm", children: [
|
|
339
|
-
n,
|
|
340
|
-
"x"
|
|
341
|
-
] }),
|
|
342
|
-
/* @__PURE__ */ e.jsx(
|
|
343
|
-
"svg",
|
|
344
|
-
{
|
|
345
|
-
viewBox: "0 0 24 24",
|
|
346
|
-
fill: "currentColor",
|
|
347
|
-
className: m("h-4 w-4 transition-transform", t && "rotate-180"),
|
|
348
|
-
children: /* @__PURE__ */ e.jsx("path", { d: "M7 10l5 5 5-5z" })
|
|
349
|
-
}
|
|
350
|
-
)
|
|
351
|
-
]
|
|
352
|
-
}
|
|
353
|
-
),
|
|
354
|
-
t && /* @__PURE__ */ e.jsx("div", { className: "absolute right-0 bottom-full mb-2 min-w-20 rounded-lg border border-white/20 bg-black/90 py-2 backdrop-blur-sm", children: a.map((c) => /* @__PURE__ */ e.jsxs(
|
|
355
|
-
"button",
|
|
356
|
-
{
|
|
357
|
-
onClick: () => i(c),
|
|
358
|
-
className: m(
|
|
359
|
-
"w-full px-4 py-2 text-left text-sm text-white transition-colors hover:bg-white/10",
|
|
360
|
-
c === n && "bg-primary/20 text-primary"
|
|
361
|
-
),
|
|
362
|
-
children: [
|
|
363
|
-
c,
|
|
364
|
-
"x"
|
|
365
|
-
]
|
|
366
|
-
},
|
|
367
|
-
c
|
|
368
|
-
)) })
|
|
369
|
-
] });
|
|
370
|
-
}, Z = function({
|
|
371
|
-
chapters: l,
|
|
372
|
-
onChapterSelect: s,
|
|
373
|
-
className: n
|
|
374
|
-
}) {
|
|
375
|
-
const t = b((a) => a.currentTime), o = r.useMemo(() => l.find(
|
|
376
|
-
(a) => t >= a.startTime && t < a.endTime
|
|
377
|
-
), [l, t]);
|
|
378
|
-
return /* @__PURE__ */ e.jsxs(
|
|
379
|
-
"div",
|
|
380
|
-
{
|
|
381
|
-
className: m(
|
|
382
|
-
"rounded-lg border border-white/20 bg-black/90 p-4 backdrop-blur-sm",
|
|
383
|
-
n
|
|
384
|
-
),
|
|
385
|
-
children: [
|
|
386
|
-
/* @__PURE__ */ e.jsx("h3", { className: "mb-3 font-semibold text-white", children: "Chapters" }),
|
|
387
|
-
/* @__PURE__ */ e.jsx("div", { className: "max-h-64 space-y-2 overflow-y-auto", children: l.map((a) => /* @__PURE__ */ e.jsxs(
|
|
388
|
-
"button",
|
|
389
|
-
{
|
|
390
|
-
onClick: () => s(a),
|
|
391
|
-
className: m(
|
|
392
|
-
"flex w-full items-center gap-3 rounded-lg p-3 text-left transition-colors",
|
|
393
|
-
"hover:bg-white/10",
|
|
394
|
-
a.id === o?.id && "border border-primary/30 bg-primary/20"
|
|
395
|
-
),
|
|
396
|
-
children: [
|
|
397
|
-
a.thumbnail && /* @__PURE__ */ e.jsx(
|
|
398
|
-
"img",
|
|
399
|
-
{
|
|
400
|
-
src: a.thumbnail,
|
|
401
|
-
alt: a.title,
|
|
402
|
-
className: "h-9 w-16 rounded object-cover"
|
|
403
|
-
}
|
|
404
|
-
),
|
|
405
|
-
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
406
|
-
/* @__PURE__ */ e.jsx("div", { className: "truncate font-medium text-white", children: a.title }),
|
|
407
|
-
/* @__PURE__ */ e.jsxs("div", { className: "text-sm text-white/60", children: [
|
|
408
|
-
D(a.startTime),
|
|
409
|
-
" - ",
|
|
410
|
-
D(a.endTime)
|
|
411
|
-
] })
|
|
412
|
-
] })
|
|
413
|
-
]
|
|
414
|
-
},
|
|
415
|
-
a.id
|
|
416
|
-
)) })
|
|
417
|
-
]
|
|
418
|
-
}
|
|
419
|
-
);
|
|
420
|
-
}, q = function({
|
|
421
|
-
className: l
|
|
422
|
-
}) {
|
|
423
|
-
const s = L(), n = b((o) => o.isPictureInPicture), t = r.useCallback(() => {
|
|
424
|
-
s({
|
|
425
|
-
type: n ? p.EXIT_PIP : p.ENTER_PIP
|
|
426
|
-
});
|
|
427
|
-
}, [s, n]);
|
|
428
|
-
return /* @__PURE__ */ e.jsx(
|
|
429
|
-
"button",
|
|
430
|
-
{
|
|
431
|
-
type: "button",
|
|
432
|
-
onClick: t,
|
|
433
|
-
className: m(
|
|
434
|
-
"flex h-10 w-10 items-center justify-center rounded-full text-white",
|
|
435
|
-
"transition-colors hover:bg-white/10",
|
|
436
|
-
l
|
|
437
|
-
),
|
|
438
|
-
"aria-label": n ? "Exit Picture-in-Picture" : "Enter Picture-in-Picture",
|
|
439
|
-
children: /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M19 7h-8v6h8V7zm2-4H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h18v14z" }) })
|
|
440
|
-
}
|
|
441
|
-
);
|
|
442
|
-
}, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
443
|
-
__proto__: null,
|
|
444
|
-
ChaptersPanel: Z,
|
|
445
|
-
PictureInPictureButton: q,
|
|
446
|
-
PlaybackSpeedSelector: J,
|
|
447
|
-
QualitySelector: W,
|
|
448
|
-
SubtitleSelector: Q
|
|
449
|
-
}, Symbol.toStringTag, { value: "Module" })), ee = function({
|
|
450
|
-
className: l,
|
|
451
|
-
size: s = "md"
|
|
452
|
-
}) {
|
|
453
|
-
const n = L(), t = b((x) => x.isPlaying), o = b((x) => x.isLoading), a = {
|
|
454
|
-
sm: "h-8 w-8",
|
|
455
|
-
md: "h-10 w-10",
|
|
456
|
-
lg: "h-12 w-12",
|
|
457
|
-
xl: "h-16 w-16"
|
|
458
|
-
}, i = {
|
|
459
|
-
sm: "h-4 w-4",
|
|
460
|
-
md: "h-5 w-5",
|
|
461
|
-
lg: "h-6 w-6",
|
|
462
|
-
xl: "h-8 w-8"
|
|
463
|
-
}, c = r.useCallback(() => {
|
|
464
|
-
n({
|
|
465
|
-
type: t ? p.PAUSE : p.PLAY
|
|
466
|
-
});
|
|
467
|
-
}, [n, t]);
|
|
468
|
-
return /* @__PURE__ */ e.jsx(
|
|
469
|
-
"button",
|
|
470
|
-
{
|
|
471
|
-
type: "button",
|
|
472
|
-
onClick: c,
|
|
473
|
-
disabled: o,
|
|
474
|
-
className: m(
|
|
475
|
-
"group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
|
|
476
|
-
"border border-white/20 text-white transition-all duration-200",
|
|
477
|
-
"hover:scale-105 hover:bg-white/20 active:scale-95",
|
|
478
|
-
"focus:outline-none focus:ring-2 focus:ring-white/50",
|
|
479
|
-
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
480
|
-
a[s],
|
|
481
|
-
l
|
|
482
|
-
),
|
|
483
|
-
"aria-label": t ? "Pause" : "Play",
|
|
484
|
-
children: o ? /* @__PURE__ */ e.jsx(
|
|
485
|
-
"div",
|
|
486
|
-
{
|
|
487
|
-
className: m(
|
|
488
|
-
"animate-spin rounded-full border-2 border-white/30 border-t-white",
|
|
489
|
-
i[s]
|
|
490
|
-
)
|
|
491
|
-
}
|
|
492
|
-
) : /* @__PURE__ */ e.jsx("div", { className: m("transition-transform duration-200", i[s]), children: t ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: /* @__PURE__ */ e.jsx("path", { d: "M6 4h4v16H6V4zm8 0h4v16h-4V4z" }) }) : /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "ml-0.5 h-full w-full", children: /* @__PURE__ */ e.jsx("path", { d: "M8 5v14l11-7z" }) }) })
|
|
493
|
-
}
|
|
494
|
-
);
|
|
495
|
-
}, se = function({
|
|
496
|
-
className: l
|
|
497
|
-
}) {
|
|
498
|
-
const s = L(), n = b((f) => f.currentTime), t = b((f) => f.duration), o = b((f) => f.buffered), a = b((f) => f.previewTime), [i, c] = r.useState(!1), [x, u] = r.useState(null), w = r.useRef(null), C = t > 0 ? n / t * 100 : 0, g = t > 0 && a !== null ? a / t * 100 : null, y = r.useMemo(() => {
|
|
499
|
-
if (!o || t === 0) return [];
|
|
500
|
-
const f = [];
|
|
501
|
-
for (let v = 0; v < o.length; v++)
|
|
502
|
-
f.push({
|
|
503
|
-
start: o.start(v) / t * 100,
|
|
504
|
-
end: o.end(v) / t * 100
|
|
505
|
-
});
|
|
506
|
-
return f;
|
|
507
|
-
}, [o, t]), h = r.useCallback(
|
|
508
|
-
(f) => {
|
|
509
|
-
if (!w.current) return 0;
|
|
510
|
-
const v = w.current.getBoundingClientRect();
|
|
511
|
-
return Math.max(0, Math.min(1, (f - v.left) / v.width)) * t;
|
|
512
|
-
},
|
|
513
|
-
[t]
|
|
514
|
-
), N = r.useCallback(
|
|
515
|
-
(f) => {
|
|
516
|
-
if (!i) {
|
|
517
|
-
const v = h(f.clientX);
|
|
518
|
-
u(v), s({ type: p.PREVIEW_TIME, detail: v });
|
|
519
|
-
}
|
|
520
|
-
},
|
|
521
|
-
[i, h, s]
|
|
522
|
-
), E = r.useCallback(() => {
|
|
523
|
-
i || (u(null), s({ type: p.CLEAR_PREVIEW }));
|
|
524
|
-
}, [i, s]), T = r.useCallback(
|
|
525
|
-
(f) => {
|
|
526
|
-
c(!0);
|
|
527
|
-
const v = h(f.clientX);
|
|
528
|
-
s({ type: p.SEEK, detail: v });
|
|
529
|
-
},
|
|
530
|
-
[h, s]
|
|
531
|
-
), S = r.useCallback(
|
|
532
|
-
(f) => {
|
|
533
|
-
c(!0);
|
|
534
|
-
const v = h(f.touches[0]?.clientX || 0);
|
|
535
|
-
s({ type: p.SEEK, detail: v });
|
|
536
|
-
},
|
|
537
|
-
[h, s]
|
|
538
|
-
);
|
|
539
|
-
return r.useEffect(() => {
|
|
540
|
-
const f = (z) => {
|
|
541
|
-
if (i) {
|
|
542
|
-
const A = h(z.clientX);
|
|
543
|
-
s({ type: p.SEEK, detail: A });
|
|
544
|
-
}
|
|
545
|
-
}, v = () => {
|
|
546
|
-
c(!1), u(null), s({ type: p.CLEAR_PREVIEW });
|
|
547
|
-
}, B = (z) => {
|
|
548
|
-
if (i) {
|
|
549
|
-
const A = h(z.touches[0]?.clientX || 0);
|
|
550
|
-
s({ type: p.SEEK, detail: A });
|
|
551
|
-
}
|
|
552
|
-
};
|
|
553
|
-
return i && (document.addEventListener("mousemove", f), document.addEventListener("mouseup", v), document.addEventListener("touchmove", B), document.addEventListener("touchend", v)), () => {
|
|
554
|
-
document.removeEventListener("mousemove", f), document.removeEventListener("mouseup", v), document.removeEventListener("touchmove", B), document.removeEventListener("touchend", v);
|
|
555
|
-
};
|
|
556
|
-
}, [i, h, s]), /* @__PURE__ */ e.jsxs("div", { className: m("group relative flex items-center", l), children: [
|
|
557
|
-
(x !== null || a !== null) && /* @__PURE__ */ e.jsx(
|
|
558
|
-
"div",
|
|
559
|
-
{
|
|
560
|
-
className: "pointer-events-none absolute bottom-full mb-2 rounded bg-black/80 px-2 py-1 text-white text-xs",
|
|
561
|
-
style: {
|
|
562
|
-
left: `${g || (x || 0) / t * 100}%`,
|
|
563
|
-
transform: "translateX(-50%)"
|
|
564
|
-
},
|
|
565
|
-
children: D(x || a || 0)
|
|
566
|
-
}
|
|
567
|
-
),
|
|
568
|
-
/* @__PURE__ */ e.jsxs(
|
|
569
|
-
"div",
|
|
570
|
-
{
|
|
571
|
-
ref: w,
|
|
572
|
-
className: "relative h-2 w-full cursor-pointer rounded-full bg-white/20 transition-all duration-200 group-hover:h-3",
|
|
573
|
-
onMouseMove: N,
|
|
574
|
-
onMouseLeave: E,
|
|
575
|
-
onMouseDown: T,
|
|
576
|
-
onTouchStart: S,
|
|
577
|
-
children: [
|
|
578
|
-
y.map((f, v) => /* @__PURE__ */ e.jsx(
|
|
579
|
-
"div",
|
|
580
|
-
{
|
|
581
|
-
className: "absolute top-0 h-full rounded-full bg-white/30",
|
|
582
|
-
style: {
|
|
583
|
-
left: `${f.start}%`,
|
|
584
|
-
width: `${f.end - f.start}%`
|
|
585
|
-
}
|
|
586
|
-
},
|
|
587
|
-
v
|
|
588
|
-
)),
|
|
589
|
-
/* @__PURE__ */ e.jsx(
|
|
590
|
-
"div",
|
|
591
|
-
{
|
|
592
|
-
className: "absolute top-0 h-full rounded-full bg-primary transition-all duration-100",
|
|
593
|
-
style: { width: `${C}%` }
|
|
594
|
-
}
|
|
595
|
-
),
|
|
596
|
-
g !== null && /* @__PURE__ */ e.jsx(
|
|
597
|
-
"div",
|
|
598
|
-
{
|
|
599
|
-
className: "absolute top-0 h-full w-1 rounded-full bg-white/80",
|
|
600
|
-
style: { left: `${g}%` }
|
|
601
|
-
}
|
|
602
|
-
),
|
|
603
|
-
/* @__PURE__ */ e.jsx(
|
|
604
|
-
"div",
|
|
605
|
-
{
|
|
606
|
-
className: "-translate-y-1/2 absolute top-1/2 h-4 w-4 rounded-full border-2 border-white bg-primary opacity-0 shadow-lg transition-all duration-200 group-hover:opacity-100",
|
|
607
|
-
style: { left: `${C}%`, transform: "translateX(-50%) translateY(-50%)" }
|
|
608
|
-
}
|
|
609
|
-
)
|
|
610
|
-
]
|
|
611
|
-
}
|
|
612
|
-
)
|
|
613
|
-
] });
|
|
614
|
-
}, te = function({
|
|
615
|
-
className: l
|
|
616
|
-
}) {
|
|
617
|
-
const s = L(), n = b((u) => u.volume), t = b((u) => u.isMuted), [o, a] = r.useState(!1), i = r.useCallback(() => {
|
|
618
|
-
s({ type: p.TOGGLE_MUTE });
|
|
619
|
-
}, [s]), c = r.useCallback(
|
|
620
|
-
(u) => {
|
|
621
|
-
s({ type: p.SET_VOLUME, detail: u });
|
|
622
|
-
},
|
|
623
|
-
[s]
|
|
624
|
-
), x = r.useMemo(() => t || n === 0 ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z" }) }) : n < 0.5 ? /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z" }) }) : /* @__PURE__ */ e.jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-5 w-5", children: /* @__PURE__ */ e.jsx("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z" }) }), [t, n]);
|
|
625
|
-
return /* @__PURE__ */ e.jsxs(
|
|
626
|
-
"div",
|
|
627
|
-
{
|
|
628
|
-
className: m("relative flex items-center", l),
|
|
629
|
-
onMouseEnter: () => a(!0),
|
|
630
|
-
onMouseLeave: () => a(!1),
|
|
631
|
-
children: [
|
|
632
|
-
/* @__PURE__ */ e.jsx(
|
|
633
|
-
"button",
|
|
634
|
-
{
|
|
635
|
-
type: "button",
|
|
636
|
-
onClick: i,
|
|
637
|
-
className: "flex h-10 w-10 items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
|
|
638
|
-
"aria-label": t ? "Unmute" : "Mute",
|
|
639
|
-
children: x
|
|
640
|
-
}
|
|
641
|
-
),
|
|
642
|
-
/* @__PURE__ */ e.jsx(
|
|
643
|
-
"div",
|
|
644
|
-
{
|
|
645
|
-
className: m(
|
|
646
|
-
"absolute left-full ml-2 flex items-center transition-all duration-200",
|
|
647
|
-
o ? "translate-x-0 opacity-100" : "-translate-x-2 pointer-events-none opacity-0"
|
|
648
|
-
),
|
|
649
|
-
children: /* @__PURE__ */ e.jsx(
|
|
650
|
-
"input",
|
|
651
|
-
{
|
|
652
|
-
type: "range",
|
|
653
|
-
min: "0",
|
|
654
|
-
max: "1",
|
|
655
|
-
step: "0.01",
|
|
656
|
-
value: t ? 0 : n,
|
|
657
|
-
onChange: (u) => c(parseFloat(u.target.value)),
|
|
658
|
-
className: "slider h-1 w-20 cursor-pointer appearance-none rounded-lg bg-white/20"
|
|
659
|
-
}
|
|
660
|
-
)
|
|
661
|
-
}
|
|
662
|
-
)
|
|
663
|
-
]
|
|
664
|
-
}
|
|
665
|
-
);
|
|
666
|
-
}, ne = function({
|
|
667
|
-
className: l,
|
|
668
|
-
size: s = "md",
|
|
669
|
-
skipTime: n = 10
|
|
670
|
-
}) {
|
|
671
|
-
const t = L(), o = b((x) => x.currentTime), a = {
|
|
672
|
-
sm: "h-8 w-8",
|
|
673
|
-
md: "h-10 w-10",
|
|
674
|
-
lg: "h-12 w-12"
|
|
675
|
-
}, i = {
|
|
676
|
-
sm: "h-4 w-4",
|
|
677
|
-
md: "h-5 w-5",
|
|
678
|
-
lg: "h-6 w-6"
|
|
679
|
-
}, c = r.useCallback(() => {
|
|
680
|
-
const x = Math.max(0, o - n);
|
|
681
|
-
t({ type: p.SEEK, detail: x });
|
|
682
|
-
}, [t, o, n]);
|
|
683
|
-
return /* @__PURE__ */ e.jsx(
|
|
684
|
-
"button",
|
|
685
|
-
{
|
|
686
|
-
type: "button",
|
|
687
|
-
onClick: c,
|
|
688
|
-
className: m(
|
|
689
|
-
"group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
|
|
690
|
-
"border border-white/20 text-white transition-all duration-200",
|
|
691
|
-
"hover:scale-105 hover:bg-white/20 active:scale-95",
|
|
692
|
-
"focus:outline-none focus:ring-2 focus:ring-white/50",
|
|
693
|
-
a[s],
|
|
694
|
-
l
|
|
695
|
-
),
|
|
696
|
-
"aria-label": `Backward ${n} seconds`,
|
|
697
|
-
title: `Backward ${n}s`,
|
|
698
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center transition-transform duration-200", i[s]), children: [
|
|
699
|
-
/* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: [
|
|
700
|
-
/* @__PURE__ */ e.jsx("path", { d: "M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zM15.5 7.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-9z" }),
|
|
701
|
-
/* @__PURE__ */ e.jsx("path", { d: "M5.5 12l7-4.5v9l-7-4.5z", opacity: "0.8" })
|
|
702
|
-
] }),
|
|
703
|
-
n && /* @__PURE__ */ e.jsx("span", { className: "-bottom-1 absolute font-bold text-[10px]", children: n })
|
|
704
|
-
] })
|
|
705
|
-
}
|
|
706
|
-
);
|
|
707
|
-
}, ae = function({
|
|
708
|
-
className: l,
|
|
709
|
-
size: s = "md",
|
|
710
|
-
skipTime: n = 10
|
|
711
|
-
}) {
|
|
712
|
-
const t = L(), o = b((u) => u.currentTime), a = b((u) => u.duration), i = {
|
|
713
|
-
sm: "h-8 w-8",
|
|
714
|
-
md: "h-10 w-10",
|
|
715
|
-
lg: "h-12 w-12"
|
|
716
|
-
}, c = {
|
|
717
|
-
sm: "h-4 w-4",
|
|
718
|
-
md: "h-5 w-5",
|
|
719
|
-
lg: "h-6 w-6"
|
|
720
|
-
}, x = r.useCallback(() => {
|
|
721
|
-
const u = Math.min(a, o + n);
|
|
722
|
-
t({ type: p.SEEK, detail: u });
|
|
723
|
-
}, [t, o, a, n]);
|
|
724
|
-
return /* @__PURE__ */ e.jsx(
|
|
725
|
-
"button",
|
|
726
|
-
{
|
|
727
|
-
type: "button",
|
|
728
|
-
onClick: x,
|
|
729
|
-
className: m(
|
|
730
|
-
"group relative flex items-center justify-center rounded-full bg-white/10 backdrop-blur-sm",
|
|
731
|
-
"border border-white/20 text-white transition-all duration-200",
|
|
732
|
-
"hover:scale-105 hover:bg-white/20 active:scale-95",
|
|
733
|
-
"focus:outline-none focus:ring-2 focus:ring-white/50",
|
|
734
|
-
i[s],
|
|
735
|
-
l
|
|
736
|
-
),
|
|
737
|
-
"aria-label": `Forward ${n} seconds`,
|
|
738
|
-
title: `Forward ${n}s`,
|
|
739
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center transition-transform duration-200", c[s]), children: [
|
|
740
|
-
/* @__PURE__ */ e.jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", className: "h-full w-full", children: [
|
|
741
|
-
/* @__PURE__ */ e.jsx("path", { d: "M17 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zM8.5 7.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5v-9z" }),
|
|
742
|
-
/* @__PURE__ */ e.jsx("path", { d: "M18.5 12l-7-4.5v9l7-4.5z", opacity: "0.8" })
|
|
743
|
-
] }),
|
|
744
|
-
n && /* @__PURE__ */ e.jsx("span", { className: "-bottom-1 absolute font-bold text-[10px]", children: n })
|
|
745
|
-
] })
|
|
746
|
-
}
|
|
747
|
-
);
|
|
748
|
-
}, _ = function({
|
|
749
|
-
variant: l = "current",
|
|
750
|
-
className: s
|
|
751
|
-
}) {
|
|
752
|
-
const n = b((a) => a.currentTime), t = b((a) => a.duration), o = r.useMemo(() => {
|
|
753
|
-
switch (l) {
|
|
754
|
-
case "current":
|
|
755
|
-
return D(n);
|
|
756
|
-
case "duration":
|
|
757
|
-
return D(t);
|
|
758
|
-
case "remaining":
|
|
759
|
-
return `-${D(t - n)}`;
|
|
760
|
-
default:
|
|
761
|
-
return D(n);
|
|
762
|
-
}
|
|
763
|
-
}, [l, n, t]);
|
|
764
|
-
return /* @__PURE__ */ e.jsx("div", { className: m("font-mono text-sm text-white tabular-nums", s), children: o });
|
|
765
|
-
}, le = function({
|
|
766
|
-
metrics: l,
|
|
767
|
-
className: s
|
|
768
|
-
}) {
|
|
769
|
-
if (!l || process.env.NODE_ENV !== "development")
|
|
770
|
-
return null;
|
|
771
|
-
const n = (o) => o >= 50 ? "text-green-400" : o >= 30 ? "text-yellow-400" : "text-red-400", t = (o) => o >= 5 ? "text-green-400" : o >= 2 ? "text-yellow-400" : "text-red-400";
|
|
772
|
-
return /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center gap-3 font-mono text-xs", s), children: [
|
|
773
|
-
l.fps !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center gap-1", n(l.fps)), children: [
|
|
774
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
|
|
775
|
-
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
776
|
-
l.fps,
|
|
777
|
-
" FPS"
|
|
778
|
-
] })
|
|
779
|
-
] }),
|
|
780
|
-
l.bufferHealth !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: m("flex items-center gap-1", t(l.bufferHealth)), children: [
|
|
781
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
|
|
782
|
-
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
783
|
-
l.bufferHealth.toFixed(1),
|
|
784
|
-
"s"
|
|
785
|
-
] })
|
|
786
|
-
] }),
|
|
787
|
-
l.quality !== void 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 text-blue-400", children: [
|
|
788
|
-
/* @__PURE__ */ e.jsx("div", { className: "h-2 w-2 rounded-full bg-current" }),
|
|
789
|
-
/* @__PURE__ */ e.jsxs("span", { children: [
|
|
790
|
-
l.quality,
|
|
791
|
-
"p"
|
|
792
|
-
] })
|
|
793
|
-
] })
|
|
794
|
-
] });
|
|
795
|
-
}, de = function({
|
|
796
|
-
className: l,
|
|
797
|
-
showSkipButtons: s = !0,
|
|
798
|
-
showVolumeControl: n = !0,
|
|
799
|
-
showTimeDisplay: t = !0,
|
|
800
|
-
playButtonSize: o = "xl",
|
|
801
|
-
skipButtonSize: a = "md",
|
|
802
|
-
skipTime: i = 10,
|
|
803
|
-
showPerformanceIndicators: c = process.env.NODE_ENV === "development",
|
|
804
|
-
performanceMetrics: x
|
|
805
|
-
}) {
|
|
806
|
-
return /* @__PURE__ */ e.jsxs(
|
|
807
|
-
"div",
|
|
808
|
-
{
|
|
809
|
-
className: m(
|
|
810
|
-
"flex flex-col gap-4 bg-gradient-to-t from-black/80 to-transparent p-4",
|
|
811
|
-
l
|
|
812
|
-
),
|
|
813
|
-
children: [
|
|
814
|
-
/* @__PURE__ */ e.jsx(se, { className: "w-full" }),
|
|
815
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
816
|
-
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
817
|
-
s && /* @__PURE__ */ e.jsx(
|
|
818
|
-
ne,
|
|
819
|
-
{
|
|
820
|
-
size: a,
|
|
821
|
-
skipTime: i,
|
|
822
|
-
className: "shrink-0"
|
|
823
|
-
}
|
|
824
|
-
),
|
|
825
|
-
/* @__PURE__ */ e.jsx(ee, { size: o, className: "shrink-0" }),
|
|
826
|
-
s && /* @__PURE__ */ e.jsx(ae, { size: a, skipTime: i, className: "shrink-0" }),
|
|
827
|
-
n && /* @__PURE__ */ e.jsx(te, { className: "shrink-0" }),
|
|
828
|
-
t && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 font-mono text-sm", children: [
|
|
829
|
-
/* @__PURE__ */ e.jsx(_, { variant: "current" }),
|
|
830
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-white/60", children: "/" }),
|
|
831
|
-
/* @__PURE__ */ e.jsx(_, { variant: "duration" })
|
|
832
|
-
] })
|
|
833
|
-
] }),
|
|
834
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: c && /* @__PURE__ */ e.jsx(le, { metrics: x, className: "text-white/80" }) })
|
|
835
|
-
] })
|
|
836
|
-
]
|
|
837
|
-
}
|
|
838
|
-
);
|
|
839
|
-
}, ue = ({
|
|
840
|
-
performanceMetrics: d = {},
|
|
841
|
-
preloadingStats: l = {},
|
|
842
|
-
playbackState: s = {},
|
|
843
|
-
hlsMetrics: n = {},
|
|
844
|
-
pluginInfo: t = {},
|
|
845
|
-
debugInfo: o = {},
|
|
846
|
-
className: a,
|
|
847
|
-
position: i = "top-right",
|
|
848
|
-
defaultCollapsed: c = !1,
|
|
849
|
-
title: x = "BaroiPlayer Debug Panel"
|
|
850
|
-
}) => {
|
|
851
|
-
const [u, w] = r.useState(c), [C, g] = r.useState(
|
|
852
|
-
"performance"
|
|
853
|
-
), y = U(() => {
|
|
854
|
-
switch (i) {
|
|
855
|
-
case "top-left":
|
|
856
|
-
return "top-4 left-4";
|
|
857
|
-
case "top-right":
|
|
858
|
-
return "top-4 right-4";
|
|
859
|
-
case "bottom-left":
|
|
860
|
-
return "bottom-4 left-4";
|
|
861
|
-
case "bottom-right":
|
|
862
|
-
return "bottom-4 right-4";
|
|
863
|
-
default:
|
|
864
|
-
return "top-4 right-4";
|
|
865
|
-
}
|
|
866
|
-
}, [i]), h = (j) => {
|
|
867
|
-
if (j === 0) return "0 B";
|
|
868
|
-
const M = 1024, F = ["B", "KB", "MB", "GB"], V = Math.floor(Math.log(j) / Math.log(M));
|
|
869
|
-
return parseFloat((j / Math.pow(M, V)).toFixed(2)) + " " + F[V];
|
|
870
|
-
}, N = (j) => {
|
|
871
|
-
const M = Math.floor(j / 60), F = Math.floor(j % 60);
|
|
872
|
-
return `${M}:${F.toString().padStart(2, "0")}`;
|
|
873
|
-
}, E = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
874
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
875
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "FPS:" }),
|
|
876
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: d.fps || 0 })
|
|
877
|
-
] }),
|
|
878
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
879
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Memory:" }),
|
|
880
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
881
|
-
((d.memoryUsage || 0) / 1024 / 1024).toFixed(1),
|
|
882
|
-
" MB"
|
|
883
|
-
] })
|
|
884
|
-
] }),
|
|
885
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
886
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Buffer:" }),
|
|
887
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
888
|
-
(d.bufferHealth || 0).toFixed(2),
|
|
889
|
-
"s"
|
|
890
|
-
] })
|
|
891
|
-
] }),
|
|
892
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
893
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Bandwidth:" }),
|
|
894
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
895
|
-
h(d.networkBandwidth || 0),
|
|
896
|
-
"/s"
|
|
897
|
-
] })
|
|
898
|
-
] }),
|
|
899
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
900
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Dropped:" }),
|
|
901
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
902
|
-
d.droppedFrames || 0,
|
|
903
|
-
" frames"
|
|
904
|
-
] })
|
|
905
|
-
] }),
|
|
906
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
907
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-cyan-400", children: "Decoded:" }),
|
|
908
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
909
|
-
d.decodedFrames || 0,
|
|
910
|
-
" frames"
|
|
911
|
-
] })
|
|
912
|
-
] })
|
|
913
|
-
] }) }), T = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
914
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
915
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Status:" }),
|
|
916
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: s.isPlaying ? /* @__PURE__ */ e.jsx("span", { className: "text-green-300", children: "Playing" }) : /* @__PURE__ */ e.jsx("span", { className: "text-red-300", children: "Paused" }) })
|
|
917
|
-
] }),
|
|
918
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
919
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Time:" }),
|
|
920
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
921
|
-
N(s.currentTime || 0),
|
|
922
|
-
" / ",
|
|
923
|
-
N(s.duration || 0)
|
|
924
|
-
] })
|
|
925
|
-
] }),
|
|
926
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
927
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Volume:" }),
|
|
928
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
929
|
-
Math.round((s.volume || 0) * 100),
|
|
930
|
-
"%"
|
|
931
|
-
] })
|
|
932
|
-
] }),
|
|
933
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
934
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Quality:" }),
|
|
935
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
936
|
-
s.quality || 0,
|
|
937
|
-
"p"
|
|
938
|
-
] })
|
|
939
|
-
] }),
|
|
940
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
941
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Buffering:" }),
|
|
942
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: s.isBuffering ? /* @__PURE__ */ e.jsx("span", { className: "text-yellow-300", children: "Yes" }) : /* @__PURE__ */ e.jsx("span", { className: "text-green-300", children: "No" }) })
|
|
943
|
-
] }),
|
|
944
|
-
s.error && /* @__PURE__ */ e.jsxs("div", { className: "col-span-2", children: [
|
|
945
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Error:" }),
|
|
946
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 break-all font-mono text-red-300 text-xs", children: s.error })
|
|
947
|
-
] })
|
|
948
|
-
] }) }), S = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
949
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
950
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Preloaded:" }),
|
|
951
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
952
|
-
l.preloadedItems || 0,
|
|
953
|
-
" items"
|
|
954
|
-
] })
|
|
955
|
-
] }),
|
|
956
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
957
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Engagement:" }),
|
|
958
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
959
|
-
(l.engagementScore || 0).toFixed(1),
|
|
960
|
-
"%"
|
|
961
|
-
] })
|
|
962
|
-
] }),
|
|
963
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
964
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Queue:" }),
|
|
965
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
966
|
-
l.queueLength || 0,
|
|
967
|
-
" items"
|
|
968
|
-
] })
|
|
969
|
-
] }),
|
|
970
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
971
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-purple-400", children: "Hit Rate:" }),
|
|
972
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
973
|
-
(l.hitRate || 0).toFixed(1),
|
|
974
|
-
"%"
|
|
975
|
-
] })
|
|
976
|
-
] }),
|
|
977
|
-
/* @__PURE__ */ e.jsxs("div", { className: "col-span-2", children: [
|
|
978
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-cyan-400", children: "Saved:" }),
|
|
979
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 font-mono", children: h(l.totalSaved || 0) })
|
|
980
|
-
] })
|
|
981
|
-
] }) }), f = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
982
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
983
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Level:" }),
|
|
984
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
985
|
-
n.currentLevel || 0,
|
|
986
|
-
" / ",
|
|
987
|
-
n.availableLevels || 0
|
|
988
|
-
] })
|
|
989
|
-
] }),
|
|
990
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
991
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Bandwidth:" }),
|
|
992
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
993
|
-
h(n.bandwidthEstimate || 0),
|
|
994
|
-
"/s"
|
|
995
|
-
] })
|
|
996
|
-
] }),
|
|
997
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
998
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-red-400", children: "Dropped:" }),
|
|
999
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
1000
|
-
n.droppedFrames || 0,
|
|
1001
|
-
" frames"
|
|
1002
|
-
] })
|
|
1003
|
-
] })
|
|
1004
|
-
] }) }), v = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsxs("div", { className: "text-xs", children: [
|
|
1005
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1006
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "Total:" }),
|
|
1007
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-2 font-mono", children: [
|
|
1008
|
-
t.pluginCount || 0,
|
|
1009
|
-
" plugins"
|
|
1010
|
-
] })
|
|
1011
|
-
] }),
|
|
1012
|
-
/* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
|
|
1013
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Active:" }),
|
|
1014
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 space-y-1 font-mono text-xs", children: t.activePlugins?.map((j, M) => /* @__PURE__ */ e.jsxs("div", { className: "text-green-300", children: [
|
|
1015
|
-
"• ",
|
|
1016
|
-
j
|
|
1017
|
-
] }, M)) || /* @__PURE__ */ e.jsx("div", { className: "text-gray-400", children: "None" }) })
|
|
1018
|
-
] }),
|
|
1019
|
-
t.loadedPlugins && t.loadedPlugins.length > t.activePlugins?.length && /* @__PURE__ */ e.jsxs("div", { className: "mt-2", children: [
|
|
1020
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-yellow-400", children: "Loaded (inactive):" }),
|
|
1021
|
-
/* @__PURE__ */ e.jsx("div", { className: "ml-2 space-y-1 font-mono text-xs", children: t.loadedPlugins.filter((j) => !t.activePlugins?.includes(j)).map((j, M) => /* @__PURE__ */ e.jsxs("div", { className: "text-yellow-300", children: [
|
|
1022
|
-
"• ",
|
|
1023
|
-
j
|
|
1024
|
-
] }, M)) })
|
|
1025
|
-
] })
|
|
1026
|
-
] }) }), B = () => /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-1 font-mono text-xs", children: Object.entries(o).map(([j, M]) => /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1027
|
-
/* @__PURE__ */ e.jsxs("span", { className: "text-yellow-400", children: [
|
|
1028
|
-
j,
|
|
1029
|
-
":"
|
|
1030
|
-
] }),
|
|
1031
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-2 text-gray-300", children: typeof M == "object" ? JSON.stringify(M, null, 2) : String(M) })
|
|
1032
|
-
] }, j)) }) }), z = () => /* @__PURE__ */ e.jsx("div", { className: "flex space-x-1 border-gray-600 border-b", children: [
|
|
1033
|
-
{ id: "performance", label: "Performance" },
|
|
1034
|
-
{ id: "hls", label: "HLS" },
|
|
1035
|
-
{ id: "plugins", label: "Plugins" },
|
|
1036
|
-
{ id: "debug", label: "Debug" }
|
|
1037
|
-
].map((j) => /* @__PURE__ */ e.jsx(
|
|
1038
|
-
"button",
|
|
1039
|
-
{
|
|
1040
|
-
onClick: () => g(j.id),
|
|
1041
|
-
className: m(
|
|
1042
|
-
"px-2 py-1 font-medium text-xs transition-colors",
|
|
1043
|
-
C === j.id ? "border-blue-400 border-b text-blue-400" : "text-gray-400 hover:text-white"
|
|
1044
|
-
),
|
|
1045
|
-
children: j.label
|
|
1046
|
-
},
|
|
1047
|
-
j.id
|
|
1048
|
-
)) }), A = () => {
|
|
1049
|
-
switch (C) {
|
|
1050
|
-
case "performance":
|
|
1051
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-3", children: [
|
|
1052
|
-
E(),
|
|
1053
|
-
/* @__PURE__ */ e.jsx("hr", { className: "border-gray-600" }),
|
|
1054
|
-
T(),
|
|
1055
|
-
/* @__PURE__ */ e.jsx("hr", { className: "border-gray-600" }),
|
|
1056
|
-
S()
|
|
1057
|
-
] });
|
|
1058
|
-
case "hls":
|
|
1059
|
-
return f();
|
|
1060
|
-
case "plugins":
|
|
1061
|
-
return v();
|
|
1062
|
-
case "debug":
|
|
1063
|
-
return B();
|
|
1064
|
-
default:
|
|
1065
|
-
return E();
|
|
1066
|
-
}
|
|
1067
|
-
};
|
|
1068
|
-
return process.env.NODE_ENV !== "development" ? null : /* @__PURE__ */ e.jsxs(
|
|
1069
|
-
"div",
|
|
1070
|
-
{
|
|
1071
|
-
className: m(
|
|
1072
|
-
"fixed z-50 min-w-80 max-w-96 rounded-lg border border-gray-700 bg-black/90 p-3 font-mono text-white text-xs backdrop-blur-sm",
|
|
1073
|
-
y,
|
|
1074
|
-
a
|
|
1075
|
-
),
|
|
1076
|
-
children: [
|
|
1077
|
-
/* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
1078
|
-
/* @__PURE__ */ e.jsx("h3", { className: "font-bold text-blue-400 text-sm", children: x }),
|
|
1079
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-2", children: /* @__PURE__ */ e.jsx(
|
|
1080
|
-
"button",
|
|
1081
|
-
{
|
|
1082
|
-
onClick: () => w(!u),
|
|
1083
|
-
className: "text-gray-400 transition-colors hover:text-white",
|
|
1084
|
-
"aria-label": u ? "Expand" : "Collapse",
|
|
1085
|
-
children: u ? /* @__PURE__ */ e.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e.jsx(
|
|
1086
|
-
"path",
|
|
1087
|
-
{
|
|
1088
|
-
d: "M3 4.5L6 7.5L9 4.5",
|
|
1089
|
-
stroke: "currentColor",
|
|
1090
|
-
strokeWidth: "1.5",
|
|
1091
|
-
strokeLinecap: "round",
|
|
1092
|
-
strokeLinejoin: "round"
|
|
1093
|
-
}
|
|
1094
|
-
) }) : /* @__PURE__ */ e.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e.jsx(
|
|
1095
|
-
"path",
|
|
1096
|
-
{
|
|
1097
|
-
d: "M3 7.5L6 4.5L9 7.5",
|
|
1098
|
-
stroke: "currentColor",
|
|
1099
|
-
strokeWidth: "1.5",
|
|
1100
|
-
strokeLinecap: "round",
|
|
1101
|
-
strokeLinejoin: "round"
|
|
1102
|
-
}
|
|
1103
|
-
) })
|
|
1104
|
-
}
|
|
1105
|
-
) })
|
|
1106
|
-
] }),
|
|
1107
|
-
u ? /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
1108
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1109
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-green-400", children: "FPS:" }),
|
|
1110
|
-
/* @__PURE__ */ e.jsx("span", { className: "ml-1 font-mono", children: d.fps || 0 })
|
|
1111
|
-
] }),
|
|
1112
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1113
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-blue-400", children: "Memory:" }),
|
|
1114
|
-
/* @__PURE__ */ e.jsxs("span", { className: "ml-1 font-mono", children: [
|
|
1115
|
-
((d.memoryUsage || 0) / 1024 / 1024).toFixed(1),
|
|
1116
|
-
"MB"
|
|
1117
|
-
] })
|
|
1118
|
-
] })
|
|
1119
|
-
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1120
|
-
z(),
|
|
1121
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-3 max-h-64 overflow-y-auto", children: A() })
|
|
1122
|
-
] })
|
|
1123
|
-
]
|
|
1124
|
-
}
|
|
1125
|
-
);
|
|
1126
|
-
};
|
|
1127
|
-
export {
|
|
1128
|
-
Z as C,
|
|
1129
|
-
ue as D,
|
|
1130
|
-
Y as E,
|
|
1131
|
-
q as P,
|
|
1132
|
-
W as Q,
|
|
1133
|
-
Q as S,
|
|
1134
|
-
J as a,
|
|
1135
|
-
ee as b,
|
|
1136
|
-
se as c,
|
|
1137
|
-
_ as d,
|
|
1138
|
-
te as e,
|
|
1139
|
-
de as f,
|
|
1140
|
-
ie as g
|
|
1141
|
-
};
|
|
1142
|
-
//# sourceMappingURL=enhanced-components-DUw2KrmQ.js.map
|