@burdenoff/microfe-hookmovies 2026.705.2 → 2026.706.2
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/hookmovies/HookMoviesRoutes.js +26 -6
- package/dist/hookmovies/HookMoviesRoutes.js.map +1 -1
- package/dist/hookmovies/components/index.js +7 -0
- package/dist/hookmovies/hooks/index.js +1 -0
- package/dist/hookmovies/hooks/useFiles.js +97 -0
- package/dist/hookmovies/hooks/useFiles.js.map +1 -0
- package/dist/hookmovies/hooks/useHookMoviesApi.js +204 -52
- package/dist/hookmovies/hooks/useHookMoviesApi.js.map +1 -1
- package/dist/hookmovies/pages/HomePage.js +2 -2
- package/dist/hookmovies/pages/HomePage.js.map +1 -1
- package/dist/hookmovies/pages/auditions/AuditionDetailPage.js +100 -45
- package/dist/hookmovies/pages/auditions/AuditionDetailPage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/TitleDetailPage.js +1340 -266
- package/dist/hookmovies/pages/catalog/TitleDetailPage.js.map +1 -1
- package/dist/hookmovies/pages/catalog/TitlesPage.js +95 -74
- package/dist/hookmovies/pages/catalog/TitlesPage.js.map +1 -1
- package/dist/hookmovies/pages/consumer/DiscoveryPage.js +422 -0
- package/dist/hookmovies/pages/consumer/DiscoveryPage.js.map +1 -0
- package/dist/hookmovies/pages/consumer/HooksPage.js +252 -0
- package/dist/hookmovies/pages/consumer/HooksPage.js.map +1 -0
- package/dist/hookmovies/pages/consumer/PlayerPage.js +542 -0
- package/dist/hookmovies/pages/consumer/PlayerPage.js.map +1 -0
- package/dist/hookmovies/pages/consumer/TitleViewPage.js +424 -0
- package/dist/hookmovies/pages/consumer/TitleViewPage.js.map +1 -0
- package/dist/hookmovies/pages/distribution/RightsWindowsPage.js +1 -1
- package/dist/hookmovies/pages/distribution/RightsWindowsPage.js.map +1 -1
- package/dist/hookmovies/pages/library/EntitlementsPage.js +273 -75
- package/dist/hookmovies/pages/library/EntitlementsPage.js.map +1 -1
- package/dist/hookmovies/pages/library/ListsPage.js +186 -106
- package/dist/hookmovies/pages/library/ListsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import { useHookMovies as e } from "../../context/HookMoviesContext.js";
|
|
2
|
+
import { useCheckEntitlement as t, useLocalizations as n, useMyWatchProgress as r, useRecordProgress as i, useTitle as a } from "../../hooks/useHookMoviesApi.js";
|
|
3
|
+
import { useFileUrl as o } from "../../hooks/useFiles.js";
|
|
4
|
+
import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
5
|
+
import { AlertCircle as ee, ArrowLeft as te, Cast as ne, Check as f, Download as re, Film as ie, Loader2 as ae, Lock as oe, Maximize as se, Minimize as ce, Pause as le, Play as ue, RotateCw as p, Settings as de, Subtitles as fe, Volume1 as pe, Volume2 as me, VolumeX as he } from "lucide-react";
|
|
6
|
+
import { useParams as ge } from "react-router-dom";
|
|
7
|
+
import { Fragment as _e, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
+
//#region src/hookmovies/pages/consumer/PlayerPage.tsx
|
|
9
|
+
function ve(e) {
|
|
10
|
+
if (!Number.isFinite(e) || e < 0) return "--:--";
|
|
11
|
+
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60, a = (e) => e.toString().padStart(2, "0");
|
|
12
|
+
return n > 0 ? `${n}:${a(r)}:${a(i)}` : `${r}:${a(i)}`;
|
|
13
|
+
}
|
|
14
|
+
function g(e) {
|
|
15
|
+
let t = e.trim();
|
|
16
|
+
if (!t) return "Unknown";
|
|
17
|
+
try {
|
|
18
|
+
return new Intl.DisplayNames(["en"], { type: "language" }).of(t) ?? t.toUpperCase();
|
|
19
|
+
} catch {
|
|
20
|
+
return t.toUpperCase();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
var _ = 5, ye = .1, be = 1e4, xe = 15, Se = ({ localization: e }) => {
|
|
24
|
+
let { data: t } = o(e.fileId), n = e.kind === "CAPTION" ? `${g(e.language)} (CC)` : g(e.language);
|
|
25
|
+
return /* @__PURE__ */ m("track", {
|
|
26
|
+
kind: e.kind === "CAPTION" ? "captions" : "subtitles",
|
|
27
|
+
label: n,
|
|
28
|
+
srcLang: e.language,
|
|
29
|
+
src: t ?? void 0,
|
|
30
|
+
default: e.isDefault
|
|
31
|
+
});
|
|
32
|
+
}, v = () => {
|
|
33
|
+
let { titleId: f, episodeId: p } = ge(), { navigateTo: g } = e(), { data: v, isLoading: we, isError: Te, refetch: Ee } = a(f), S = t(f), C = n(f, p), w = r(f), De = i(), T = l(() => p ? v?.episodes.find((e) => e.id === p) ?? null : null, [p, v]), E = p ? void 0 : v?.videoFileId ?? void 0, D = o(E), O = o(v?.posterFileId ?? void 0), Oe = o(v?.backdropFileId ?? void 0), k = l(() => (C.data ?? []).filter((e) => e.kind === "SUBTITLE" || e.kind === "CAPTION"), [C.data]), ke = l(() => (C.data ?? []).filter((e) => e.kind === "DUB"), [C.data]), A = u(null), Ae = u(null), [j, M] = d(!1), [N, P] = d(0), [F, je] = d(0), [I, Me] = d(1), [L, Ne] = d(!1), [Pe, R] = d(!1), [z, Fe] = d(!1), [B, V] = d(!1), [Ie, Le] = d(!1), [Re, ze] = d(!0), [H, Be] = d("none"), [U, Ve] = d(-1), He = u(0), Ue = u(!1), We = u(!1), W = u(null), Ge = u(De.mutate);
|
|
34
|
+
Ge.current = De.mutate;
|
|
35
|
+
let Ke = u(j);
|
|
36
|
+
Ke.current = j;
|
|
37
|
+
let G = E ? D.data ?? null : null, qe = !!(G && G.split("?")[0]?.toLowerCase().endsWith(".m3u8")), Je = k.length > 0, Ye = !Number.isFinite(F) || F === 0, K = s((e) => {
|
|
38
|
+
let t = A.current;
|
|
39
|
+
if (!t || !f) return;
|
|
40
|
+
let n = Math.floor(t.currentTime);
|
|
41
|
+
n <= 0 && !e || (Ge.current({
|
|
42
|
+
titleId: f,
|
|
43
|
+
episodeId: p,
|
|
44
|
+
positionSeconds: n,
|
|
45
|
+
completed: e,
|
|
46
|
+
lastDevice: "web"
|
|
47
|
+
}), He.current = Date.now());
|
|
48
|
+
}, [f, p]);
|
|
49
|
+
c(() => () => {
|
|
50
|
+
Ke.current && K(!1);
|
|
51
|
+
}, [K]), c(() => {
|
|
52
|
+
let e = A.current;
|
|
53
|
+
if (!e || Ue.current || !z || w.isLoading) return;
|
|
54
|
+
Ue.current = !0;
|
|
55
|
+
let t = (w.data ?? []).find((e) => p ? e.episodeId === p : !e.episodeId);
|
|
56
|
+
t && !t.completed && t.positionSeconds > _ && Number.isFinite(e.duration) && t.positionSeconds < e.duration - _ && (e.currentTime = t.positionSeconds, P(t.positionSeconds));
|
|
57
|
+
}, [
|
|
58
|
+
z,
|
|
59
|
+
w.isLoading,
|
|
60
|
+
w.data,
|
|
61
|
+
p
|
|
62
|
+
]), c(() => {
|
|
63
|
+
We.current || k.length === 0 || (We.current = !0, Ve(k.findIndex((e) => e.isDefault)));
|
|
64
|
+
}, [k]);
|
|
65
|
+
let q = s(() => {
|
|
66
|
+
let e = A.current;
|
|
67
|
+
if (!e) return;
|
|
68
|
+
let t = e.textTracks;
|
|
69
|
+
for (let e = 0; e < t.length; e += 1) t[e].mode = e === U ? "showing" : "disabled";
|
|
70
|
+
}, [U]);
|
|
71
|
+
c(() => {
|
|
72
|
+
q();
|
|
73
|
+
}, [
|
|
74
|
+
q,
|
|
75
|
+
k.length,
|
|
76
|
+
z
|
|
77
|
+
]), c(() => {
|
|
78
|
+
let e = () => Le(!!document.fullscreenElement);
|
|
79
|
+
return document.addEventListener("fullscreenchange", e), () => document.removeEventListener("fullscreenchange", e);
|
|
80
|
+
}, []);
|
|
81
|
+
let J = s(() => {
|
|
82
|
+
ze(!0), W.current && clearTimeout(W.current), W.current = setTimeout(() => {
|
|
83
|
+
Ke.current && H === "none" && ze(!1);
|
|
84
|
+
}, 3e3);
|
|
85
|
+
}, [H]);
|
|
86
|
+
c(() => () => {
|
|
87
|
+
W.current && clearTimeout(W.current);
|
|
88
|
+
}, []);
|
|
89
|
+
let Y = s(() => {
|
|
90
|
+
let e = A.current;
|
|
91
|
+
e && (e.paused ? e.play().catch(() => V(!0)) : e.pause());
|
|
92
|
+
}, []), X = s((e) => {
|
|
93
|
+
let t = A.current;
|
|
94
|
+
!t || !Number.isFinite(t.duration) || (t.currentTime = Math.min(Math.max(t.currentTime + e, 0), t.duration), P(t.currentTime));
|
|
95
|
+
}, []), Xe = s((e) => {
|
|
96
|
+
let t = A.current;
|
|
97
|
+
t && (t.currentTime = e, P(e));
|
|
98
|
+
}, []), Z = s((e) => {
|
|
99
|
+
let t = A.current;
|
|
100
|
+
if (!t) return;
|
|
101
|
+
let n = Math.min(Math.max(e, 0), 1);
|
|
102
|
+
t.volume = n, t.muted = n === 0, Me(n), Ne(n === 0);
|
|
103
|
+
}, []), Ze = s(() => {
|
|
104
|
+
let e = A.current;
|
|
105
|
+
if (!e) return;
|
|
106
|
+
let t = !e.muted;
|
|
107
|
+
e.muted = t, Ne(t);
|
|
108
|
+
}, []), Q = s(() => {
|
|
109
|
+
let e = Ae.current;
|
|
110
|
+
e && (document.fullscreenElement ? document.exitFullscreen?.().catch(() => void 0) : e.requestFullscreen?.().catch(() => void 0));
|
|
111
|
+
}, []), Qe = s((e) => {
|
|
112
|
+
let t = e.target;
|
|
113
|
+
if (!((t.tagName === "INPUT" || t.tagName === "BUTTON") && e.key !== " " && e.key !== "k")) switch (e.key) {
|
|
114
|
+
case " ":
|
|
115
|
+
case "k":
|
|
116
|
+
e.preventDefault(), Y(), J();
|
|
117
|
+
break;
|
|
118
|
+
case "ArrowRight":
|
|
119
|
+
e.preventDefault(), X(_), J();
|
|
120
|
+
break;
|
|
121
|
+
case "ArrowLeft":
|
|
122
|
+
e.preventDefault(), X(-_), J();
|
|
123
|
+
break;
|
|
124
|
+
case "ArrowUp":
|
|
125
|
+
e.preventDefault(), Z(I + ye), J();
|
|
126
|
+
break;
|
|
127
|
+
case "ArrowDown":
|
|
128
|
+
e.preventDefault(), Z(I - ye), J();
|
|
129
|
+
break;
|
|
130
|
+
case "f":
|
|
131
|
+
case "F":
|
|
132
|
+
e.preventDefault(), Q();
|
|
133
|
+
break;
|
|
134
|
+
case "m":
|
|
135
|
+
case "M":
|
|
136
|
+
e.preventDefault(), Ze(), J();
|
|
137
|
+
break;
|
|
138
|
+
default: break;
|
|
139
|
+
}
|
|
140
|
+
}, [
|
|
141
|
+
Y,
|
|
142
|
+
X,
|
|
143
|
+
Z,
|
|
144
|
+
Q,
|
|
145
|
+
Ze,
|
|
146
|
+
J,
|
|
147
|
+
I
|
|
148
|
+
]), $e = s(() => {
|
|
149
|
+
let e = A.current;
|
|
150
|
+
e && (P(e.currentTime), !e.paused && Date.now() - He.current >= be && K(Number.isFinite(e.duration) && e.currentTime >= e.duration - xe));
|
|
151
|
+
}, [K]), et = s(() => {
|
|
152
|
+
let e = A.current;
|
|
153
|
+
e && (je(e.duration), Fe(!0), V(!1), q());
|
|
154
|
+
}, [q]), tt = s(() => {
|
|
155
|
+
M(!1), K(!0);
|
|
156
|
+
}, [K]), $ = () => g(`title/${f ?? ""}`);
|
|
157
|
+
if (we || S.isLoading) return /* @__PURE__ */ m(y, { children: /* @__PURE__ */ h("div", {
|
|
158
|
+
className: "flex flex-col items-center gap-3 text-text-inverse",
|
|
159
|
+
children: [/* @__PURE__ */ m(ae, { className: "h-8 w-8 animate-spin" }), /* @__PURE__ */ m("p", {
|
|
160
|
+
className: "text-sm opacity-80",
|
|
161
|
+
children: "Loading…"
|
|
162
|
+
})]
|
|
163
|
+
}) });
|
|
164
|
+
if (Te || !v) return /* @__PURE__ */ m(y, { children: /* @__PURE__ */ m(b, {
|
|
165
|
+
icon: /* @__PURE__ */ m(ee, { className: "h-12 w-12" }),
|
|
166
|
+
title: "Title unavailable",
|
|
167
|
+
message: "We couldn't load this title. It may have been removed or you may not have access.",
|
|
168
|
+
primary: {
|
|
169
|
+
label: "Retry",
|
|
170
|
+
onClick: () => void Ee()
|
|
171
|
+
}
|
|
172
|
+
}) });
|
|
173
|
+
if (S.isError) return /* @__PURE__ */ m(y, { children: /* @__PURE__ */ m(b, {
|
|
174
|
+
icon: /* @__PURE__ */ m(ee, { className: "h-12 w-12" }),
|
|
175
|
+
title: "Couldn't verify access",
|
|
176
|
+
message: "We couldn't check your entitlement for this title. Please try again.",
|
|
177
|
+
primary: {
|
|
178
|
+
label: "Retry",
|
|
179
|
+
onClick: () => void S.refetch()
|
|
180
|
+
},
|
|
181
|
+
secondary: {
|
|
182
|
+
label: "Back to title",
|
|
183
|
+
onClick: $
|
|
184
|
+
}
|
|
185
|
+
}) });
|
|
186
|
+
if (!S.data?.entitled) return /* @__PURE__ */ m(y, {
|
|
187
|
+
backdrop: Oe.data ?? O.data ?? null,
|
|
188
|
+
children: /* @__PURE__ */ h("div", {
|
|
189
|
+
className: "mx-auto flex max-w-md flex-col items-center gap-5 text-center text-text-inverse",
|
|
190
|
+
children: [
|
|
191
|
+
O.data ? /* @__PURE__ */ m("img", {
|
|
192
|
+
src: O.data,
|
|
193
|
+
alt: `Poster for ${v.title}`,
|
|
194
|
+
className: "h-48 w-32 rounded-lg object-cover shadow-lg"
|
|
195
|
+
}) : /* @__PURE__ */ m("div", {
|
|
196
|
+
className: "flex h-48 w-32 items-center justify-center rounded-lg bg-bg-overlay",
|
|
197
|
+
children: /* @__PURE__ */ m(ie, { className: "h-10 w-10 opacity-70" })
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ h("div", {
|
|
200
|
+
className: "flex items-center gap-2 rounded-full bg-bg-overlay px-3 py-1 text-xs font-medium",
|
|
201
|
+
children: [/* @__PURE__ */ m(oe, { className: "h-3.5 w-3.5" }), "Not available to watch yet"]
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
|
|
204
|
+
className: "text-xl font-semibold",
|
|
205
|
+
children: v.title
|
|
206
|
+
}), /* @__PURE__ */ m("p", {
|
|
207
|
+
className: "mt-2 text-sm opacity-80",
|
|
208
|
+
children: "You don't have an active entitlement for this title. Open the title page to see where and how to watch, or to acquire access."
|
|
209
|
+
})] }),
|
|
210
|
+
/* @__PURE__ */ h("div", {
|
|
211
|
+
className: "flex flex-wrap items-center justify-center gap-3",
|
|
212
|
+
children: [/* @__PURE__ */ m("button", {
|
|
213
|
+
type: "button",
|
|
214
|
+
onClick: $,
|
|
215
|
+
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 motion-safe:transition-opacity",
|
|
216
|
+
children: "Where to watch"
|
|
217
|
+
}), /* @__PURE__ */ m("button", {
|
|
218
|
+
type: "button",
|
|
219
|
+
onClick: () => g("browse"),
|
|
220
|
+
className: "inline-flex items-center gap-2 rounded-lg border border-text-inverse/30 px-4 py-2 text-sm font-medium text-text-inverse hover:bg-bg-overlay motion-safe:transition-colors",
|
|
221
|
+
children: "Browse catalog"
|
|
222
|
+
})]
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
});
|
|
227
|
+
let nt = T ? `${v.title} — E${T.number} · ${T.name}` : v.title, rt = !!E && D.isLoading, it = !E || !D.isLoading && !G, at = L || I === 0 ? he : I < .5 ? pe : me, ot = F > 0 ? Math.min(N / F * 100, 100) : 0;
|
|
228
|
+
return /* @__PURE__ */ h("div", {
|
|
229
|
+
className: "flex h-full flex-col bg-bg-inverse",
|
|
230
|
+
children: [/* @__PURE__ */ h("div", {
|
|
231
|
+
className: "flex items-center gap-3 px-4 py-3 sm:px-6",
|
|
232
|
+
children: [/* @__PURE__ */ h("button", {
|
|
233
|
+
type: "button",
|
|
234
|
+
onClick: $,
|
|
235
|
+
className: "inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-text-inverse/90 hover:bg-bg-overlay motion-safe:transition-colors",
|
|
236
|
+
"aria-label": "Back to title",
|
|
237
|
+
children: [/* @__PURE__ */ m(te, { className: "h-4 w-4" }), /* @__PURE__ */ m("span", {
|
|
238
|
+
className: "hidden sm:inline",
|
|
239
|
+
children: "Back"
|
|
240
|
+
})]
|
|
241
|
+
}), /* @__PURE__ */ m("h1", {
|
|
242
|
+
className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-inverse sm:text-base",
|
|
243
|
+
children: nt
|
|
244
|
+
})]
|
|
245
|
+
}), /* @__PURE__ */ m("div", {
|
|
246
|
+
className: "flex flex-1 items-center justify-center px-0 sm:px-6 sm:pb-6",
|
|
247
|
+
children: /* @__PURE__ */ m("div", {
|
|
248
|
+
ref: Ae,
|
|
249
|
+
className: "group relative aspect-video w-full max-w-6xl overflow-hidden bg-bg-inverse sm:rounded-xl",
|
|
250
|
+
onMouseMove: J,
|
|
251
|
+
onKeyDown: Qe,
|
|
252
|
+
onClick: (e) => {
|
|
253
|
+
e.target === A.current && Y();
|
|
254
|
+
},
|
|
255
|
+
tabIndex: 0,
|
|
256
|
+
role: "region",
|
|
257
|
+
"aria-label": `Video player for ${nt}`,
|
|
258
|
+
children: it ? /* @__PURE__ */ m("div", {
|
|
259
|
+
className: "absolute inset-0 flex items-center justify-center p-6",
|
|
260
|
+
children: /* @__PURE__ */ m(b, {
|
|
261
|
+
icon: /* @__PURE__ */ m(ie, { className: "h-12 w-12" }),
|
|
262
|
+
title: T ? "Episode video not available" : "No video attached",
|
|
263
|
+
message: T ? "This episode does not have a playable video file attached yet." : "This title does not have a playable video file attached yet.",
|
|
264
|
+
secondary: {
|
|
265
|
+
label: "Back to title",
|
|
266
|
+
onClick: $
|
|
267
|
+
}
|
|
268
|
+
})
|
|
269
|
+
}) : /* @__PURE__ */ h(_e, { children: [
|
|
270
|
+
/* @__PURE__ */ m("video", {
|
|
271
|
+
ref: A,
|
|
272
|
+
className: "h-full w-full bg-bg-inverse",
|
|
273
|
+
src: G ?? void 0,
|
|
274
|
+
poster: O.data ?? void 0,
|
|
275
|
+
crossOrigin: Je ? "anonymous" : void 0,
|
|
276
|
+
playsInline: !0,
|
|
277
|
+
preload: "metadata",
|
|
278
|
+
onLoadedMetadata: et,
|
|
279
|
+
onDurationChange: () => {
|
|
280
|
+
let e = A.current;
|
|
281
|
+
e && je(e.duration);
|
|
282
|
+
},
|
|
283
|
+
onTimeUpdate: $e,
|
|
284
|
+
onPlay: () => {
|
|
285
|
+
M(!0), J();
|
|
286
|
+
},
|
|
287
|
+
onPause: () => {
|
|
288
|
+
M(!1), ze(!0), K(!1);
|
|
289
|
+
},
|
|
290
|
+
onEnded: tt,
|
|
291
|
+
onWaiting: () => R(!0),
|
|
292
|
+
onPlaying: () => R(!1),
|
|
293
|
+
onCanPlay: () => R(!1),
|
|
294
|
+
onError: () => V(!0),
|
|
295
|
+
children: k.map((e) => /* @__PURE__ */ m(Se, { localization: e }, e.id))
|
|
296
|
+
}),
|
|
297
|
+
(Pe || rt) && !B && /* @__PURE__ */ m("div", {
|
|
298
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
299
|
+
children: /* @__PURE__ */ m(ae, { className: "h-10 w-10 animate-spin text-text-inverse" })
|
|
300
|
+
}),
|
|
301
|
+
B && /* @__PURE__ */ m("div", {
|
|
302
|
+
className: "absolute inset-0 flex items-center justify-center bg-overlay-scrim p-6",
|
|
303
|
+
children: /* @__PURE__ */ m(b, {
|
|
304
|
+
icon: /* @__PURE__ */ m(ee, { className: "h-12 w-12" }),
|
|
305
|
+
title: "Playback failed",
|
|
306
|
+
message: qe ? "This stream is HLS (.m3u8) and your browser could not play it natively. Try a browser with native HLS support." : "We could not play this video. The link may have expired — reload to try again.",
|
|
307
|
+
primary: {
|
|
308
|
+
label: "Reload",
|
|
309
|
+
onClick: () => {
|
|
310
|
+
V(!1), D.refetch();
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
secondary: {
|
|
314
|
+
label: "Back to title",
|
|
315
|
+
onClick: $
|
|
316
|
+
}
|
|
317
|
+
})
|
|
318
|
+
}),
|
|
319
|
+
!j && !Pe && !B && z && /* @__PURE__ */ m("button", {
|
|
320
|
+
type: "button",
|
|
321
|
+
onClick: Y,
|
|
322
|
+
"aria-label": "Play",
|
|
323
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
324
|
+
children: /* @__PURE__ */ m("span", {
|
|
325
|
+
className: "flex h-16 w-16 items-center justify-center rounded-full bg-action-primary-bg text-action-primary-text shadow-lg motion-safe:transition-transform group-hover:scale-105",
|
|
326
|
+
children: /* @__PURE__ */ m(ue, { className: "ml-1 h-7 w-7" })
|
|
327
|
+
})
|
|
328
|
+
}),
|
|
329
|
+
/* @__PURE__ */ h("div", {
|
|
330
|
+
className: `absolute inset-x-0 bottom-0 bg-overlay-scrim px-3 pb-3 pt-10 motion-safe:transition-opacity motion-safe:duration-300 sm:px-4 ${Re || !j ? "opacity-100" : "pointer-events-none opacity-0"}`,
|
|
331
|
+
children: [/* @__PURE__ */ h("div", {
|
|
332
|
+
className: "mb-2 flex items-center gap-3",
|
|
333
|
+
children: [
|
|
334
|
+
/* @__PURE__ */ m("span", {
|
|
335
|
+
className: "w-12 shrink-0 text-right text-xs tabular-nums text-text-inverse/90",
|
|
336
|
+
children: ve(N)
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ h("div", {
|
|
339
|
+
className: "relative flex-1",
|
|
340
|
+
children: [/* @__PURE__ */ m("div", {
|
|
341
|
+
className: "h-1.5 w-full overflow-hidden rounded-full bg-text-inverse/25",
|
|
342
|
+
children: /* @__PURE__ */ m("div", {
|
|
343
|
+
className: "h-full rounded-full bg-action-primary-bg",
|
|
344
|
+
style: { width: `${ot}%` }
|
|
345
|
+
})
|
|
346
|
+
}), /* @__PURE__ */ m("input", {
|
|
347
|
+
type: "range",
|
|
348
|
+
min: 0,
|
|
349
|
+
max: Number.isFinite(F) && F > 0 ? F : 0,
|
|
350
|
+
step: "any",
|
|
351
|
+
value: N,
|
|
352
|
+
disabled: Ye,
|
|
353
|
+
onChange: (e) => Xe(Number(e.target.value)),
|
|
354
|
+
"aria-label": "Seek",
|
|
355
|
+
className: "absolute inset-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed",
|
|
356
|
+
style: { accentColor: "var(--color-action-primary-bg)" }
|
|
357
|
+
})]
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ m("span", {
|
|
360
|
+
className: "w-12 shrink-0 text-xs tabular-nums text-text-inverse/70",
|
|
361
|
+
children: Ye ? "LIVE" : ve(F)
|
|
362
|
+
})
|
|
363
|
+
]
|
|
364
|
+
}), /* @__PURE__ */ h("div", {
|
|
365
|
+
className: "flex items-center gap-1 sm:gap-2",
|
|
366
|
+
children: [
|
|
367
|
+
/* @__PURE__ */ m(x, {
|
|
368
|
+
label: j ? "Pause" : "Play",
|
|
369
|
+
onClick: Y,
|
|
370
|
+
children: m(j ? le : ue, { className: "h-5 w-5" })
|
|
371
|
+
}),
|
|
372
|
+
/* @__PURE__ */ h("div", {
|
|
373
|
+
className: "flex items-center gap-1.5",
|
|
374
|
+
children: [/* @__PURE__ */ m(x, {
|
|
375
|
+
label: L ? "Unmute" : "Mute",
|
|
376
|
+
onClick: Ze,
|
|
377
|
+
children: /* @__PURE__ */ m(at, { className: "h-5 w-5" })
|
|
378
|
+
}), /* @__PURE__ */ m("input", {
|
|
379
|
+
type: "range",
|
|
380
|
+
min: 0,
|
|
381
|
+
max: 1,
|
|
382
|
+
step: .05,
|
|
383
|
+
value: L ? 0 : I,
|
|
384
|
+
onChange: (e) => Z(Number(e.target.value)),
|
|
385
|
+
"aria-label": "Volume",
|
|
386
|
+
className: "hidden h-1 w-20 cursor-pointer sm:block",
|
|
387
|
+
style: { accentColor: "var(--color-action-primary-bg)" }
|
|
388
|
+
})]
|
|
389
|
+
}),
|
|
390
|
+
/* @__PURE__ */ h("div", {
|
|
391
|
+
className: "ml-auto flex items-center gap-1 sm:gap-2",
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ h("div", {
|
|
394
|
+
className: "relative",
|
|
395
|
+
children: [/* @__PURE__ */ m(x, {
|
|
396
|
+
label: "Subtitles & audio",
|
|
397
|
+
onClick: () => Be((e) => e === "subtitles" ? "none" : "subtitles"),
|
|
398
|
+
active: U >= 0,
|
|
399
|
+
expanded: H === "subtitles",
|
|
400
|
+
disabled: k.length === 0 && ke.length === 0,
|
|
401
|
+
disabledHint: "No subtitle or audio tracks available for this title.",
|
|
402
|
+
children: /* @__PURE__ */ m(fe, { className: "h-5 w-5" })
|
|
403
|
+
}), H === "subtitles" && /* @__PURE__ */ m(Ce, {
|
|
404
|
+
subtitleLocs: k,
|
|
405
|
+
dubLocs: ke,
|
|
406
|
+
selectedSubIdx: U,
|
|
407
|
+
onSelectSub: (e) => {
|
|
408
|
+
Ve(e), Be("none");
|
|
409
|
+
}
|
|
410
|
+
})]
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ m(x, {
|
|
413
|
+
label: "Quality",
|
|
414
|
+
onClick: () => void 0,
|
|
415
|
+
disabled: !0,
|
|
416
|
+
disabledHint: "Adaptive quality selection isn't available for this source.",
|
|
417
|
+
children: /* @__PURE__ */ m(de, { className: "h-5 w-5" })
|
|
418
|
+
}),
|
|
419
|
+
/* @__PURE__ */ m(x, {
|
|
420
|
+
label: "Cast",
|
|
421
|
+
onClick: () => void 0,
|
|
422
|
+
disabled: !0,
|
|
423
|
+
disabledHint: "Casting to external devices isn't supported in this player.",
|
|
424
|
+
children: /* @__PURE__ */ m(ne, { className: "h-5 w-5" })
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ m(x, {
|
|
427
|
+
label: "Download for offline",
|
|
428
|
+
onClick: () => void 0,
|
|
429
|
+
disabled: !0,
|
|
430
|
+
disabledHint: "Offline downloads aren't available for this title.",
|
|
431
|
+
children: /* @__PURE__ */ m(re, { className: "h-5 w-5" })
|
|
432
|
+
}),
|
|
433
|
+
/* @__PURE__ */ m(x, {
|
|
434
|
+
label: Ie ? "Exit fullscreen" : "Fullscreen",
|
|
435
|
+
onClick: Q,
|
|
436
|
+
children: m(Ie ? ce : se, { className: "h-5 w-5" })
|
|
437
|
+
})
|
|
438
|
+
]
|
|
439
|
+
})
|
|
440
|
+
]
|
|
441
|
+
})]
|
|
442
|
+
})
|
|
443
|
+
] })
|
|
444
|
+
})
|
|
445
|
+
})]
|
|
446
|
+
});
|
|
447
|
+
}, y = ({ children: e, backdrop: t }) => /* @__PURE__ */ h("div", {
|
|
448
|
+
className: "relative flex h-full min-h-[60vh] items-center justify-center overflow-hidden bg-bg-inverse p-6",
|
|
449
|
+
children: [t && /* @__PURE__ */ h(_e, { children: [/* @__PURE__ */ m("img", {
|
|
450
|
+
src: t,
|
|
451
|
+
alt: "",
|
|
452
|
+
"aria-hidden": !0,
|
|
453
|
+
className: "absolute inset-0 h-full w-full object-cover opacity-30"
|
|
454
|
+
}), /* @__PURE__ */ m("div", { className: "absolute inset-0 bg-overlay-scrim" })] }), /* @__PURE__ */ m("div", {
|
|
455
|
+
className: "relative z-10 w-full",
|
|
456
|
+
children: e
|
|
457
|
+
})]
|
|
458
|
+
}), b = ({ icon: e, title: t, message: n, primary: r, secondary: i }) => /* @__PURE__ */ h("div", {
|
|
459
|
+
className: "mx-auto flex max-w-md flex-col items-center gap-4 text-center text-text-inverse",
|
|
460
|
+
children: [
|
|
461
|
+
/* @__PURE__ */ m("span", {
|
|
462
|
+
className: "text-text-inverse/80",
|
|
463
|
+
children: e
|
|
464
|
+
}),
|
|
465
|
+
/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
|
|
466
|
+
className: "text-lg font-semibold",
|
|
467
|
+
children: t
|
|
468
|
+
}), /* @__PURE__ */ m("p", {
|
|
469
|
+
className: "mt-1 text-sm opacity-80",
|
|
470
|
+
children: n
|
|
471
|
+
})] }),
|
|
472
|
+
(r || i) && /* @__PURE__ */ h("div", {
|
|
473
|
+
className: "flex flex-wrap items-center justify-center gap-3",
|
|
474
|
+
children: [r && /* @__PURE__ */ h("button", {
|
|
475
|
+
type: "button",
|
|
476
|
+
onClick: r.onClick,
|
|
477
|
+
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 motion-safe:transition-opacity",
|
|
478
|
+
children: [/* @__PURE__ */ m(p, { className: "h-4 w-4" }), r.label]
|
|
479
|
+
}), i && /* @__PURE__ */ m("button", {
|
|
480
|
+
type: "button",
|
|
481
|
+
onClick: i.onClick,
|
|
482
|
+
className: "inline-flex items-center gap-2 rounded-lg border border-text-inverse/30 px-4 py-2 text-sm font-medium text-text-inverse hover:bg-bg-overlay motion-safe:transition-colors",
|
|
483
|
+
children: i.label
|
|
484
|
+
})]
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
}), x = ({ label: e, onClick: t, children: n, active: r, disabled: i, disabledHint: a, expanded: o }) => /* @__PURE__ */ h("button", {
|
|
488
|
+
type: "button",
|
|
489
|
+
onClick: t,
|
|
490
|
+
disabled: i,
|
|
491
|
+
"aria-label": e,
|
|
492
|
+
"aria-pressed": r,
|
|
493
|
+
"aria-expanded": o,
|
|
494
|
+
title: i && a ? a : e,
|
|
495
|
+
className: `relative rounded-lg p-2 motion-safe:transition-colors ${i ? "cursor-not-allowed text-text-inverse/40" : "text-text-inverse hover:bg-bg-overlay"}`,
|
|
496
|
+
children: [n, r && !i && /* @__PURE__ */ m("span", { className: "absolute bottom-0.5 left-1/2 h-1 w-1 -translate-x-1/2 rounded-full bg-action-primary-bg" })]
|
|
497
|
+
}), Ce = ({ subtitleLocs: e, dubLocs: t, selectedSubIdx: n, onSelectSub: r }) => /* @__PURE__ */ h("div", {
|
|
498
|
+
role: "menu",
|
|
499
|
+
"aria-label": "Subtitles and audio",
|
|
500
|
+
className: "absolute bottom-full right-0 mb-2 max-h-72 w-56 overflow-y-auto rounded-lg border border-border-seam bg-bg-surface p-1.5 shadow-lg",
|
|
501
|
+
children: [
|
|
502
|
+
/* @__PURE__ */ m("p", {
|
|
503
|
+
className: "px-2 py-1 text-[11px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
504
|
+
children: "Subtitles"
|
|
505
|
+
}),
|
|
506
|
+
/* @__PURE__ */ m(we, {
|
|
507
|
+
label: "Off",
|
|
508
|
+
selected: n === -1,
|
|
509
|
+
onClick: () => r(-1)
|
|
510
|
+
}),
|
|
511
|
+
e.map((e, t) => /* @__PURE__ */ m(we, {
|
|
512
|
+
label: e.kind === "CAPTION" ? `${g(e.language)} (CC)` : g(e.language),
|
|
513
|
+
selected: n === t,
|
|
514
|
+
onClick: () => r(t)
|
|
515
|
+
}, e.id)),
|
|
516
|
+
t.length > 0 && /* @__PURE__ */ h(_e, { children: [/* @__PURE__ */ m("p", {
|
|
517
|
+
className: "mt-1 px-2 py-1 text-[11px] font-semibold uppercase tracking-wide text-text-secondary",
|
|
518
|
+
children: "Audio (dub)"
|
|
519
|
+
}), t.map((e) => /* @__PURE__ */ h("button", {
|
|
520
|
+
type: "button",
|
|
521
|
+
role: "menuitem",
|
|
522
|
+
disabled: !0,
|
|
523
|
+
title: "Alternate dub tracks are separate assets and can't be switched in this player.",
|
|
524
|
+
className: "flex w-full cursor-not-allowed items-center justify-between rounded-md px-2 py-1.5 text-left text-sm text-text-disabled",
|
|
525
|
+
children: [/* @__PURE__ */ m("span", { children: g(e.language) }), /* @__PURE__ */ m(oe, { className: "h-3.5 w-3.5" })]
|
|
526
|
+
}, e.id))] })
|
|
527
|
+
]
|
|
528
|
+
}), we = ({ label: e, selected: t, onClick: n }) => /* @__PURE__ */ h("button", {
|
|
529
|
+
type: "button",
|
|
530
|
+
role: "menuitemradio",
|
|
531
|
+
"aria-checked": t,
|
|
532
|
+
onClick: n,
|
|
533
|
+
className: `flex w-full items-center justify-between rounded-md px-2 py-1.5 text-left text-sm motion-safe:transition-colors ${t ? "bg-bg-sunken font-medium text-text-primary" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"}`,
|
|
534
|
+
children: [/* @__PURE__ */ m("span", {
|
|
535
|
+
className: "truncate",
|
|
536
|
+
children: e
|
|
537
|
+
}), t && /* @__PURE__ */ m(f, { className: "h-4 w-4 shrink-0 text-action-primary-bg" })]
|
|
538
|
+
});
|
|
539
|
+
//#endregion
|
|
540
|
+
export { v as PlayerPage };
|
|
541
|
+
|
|
542
|
+
//# sourceMappingURL=PlayerPage.js.map
|