@openrails/contentkit-ui 0.83.0 → 0.86.0
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 +18 -7
- package/dist/client/beacons.d.ts +18 -6
- package/dist/client/beacons.js +26 -11
- package/dist/client/beacons.js.map +1 -1
- package/dist/client/client.d.ts +3 -0
- package/dist/client/client.js +29 -27
- package/dist/client/client.js.map +1 -1
- package/dist/client/codes.d.ts +6 -1
- package/dist/client/codes.js +4 -1
- package/dist/client/codes.js.map +1 -1
- package/dist/client/content/moderation.d.ts +14 -2
- package/dist/client/content/moderation.js +34 -0
- package/dist/client/content/moderation.js.map +1 -1
- package/dist/client/content/types.d.ts +13 -0
- package/dist/client/content/types.js.map +1 -1
- package/dist/client/discovery.d.ts +6 -0
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/generated/error-codes.d.ts +1 -1
- package/dist/client/generated/error-codes.js +9 -1
- package/dist/client/generated/error-codes.js.map +1 -1
- package/dist/client/generated/routes.d.ts +91 -13
- package/dist/client/generated/routes.js +123 -2
- package/dist/client/generated/routes.js.map +1 -1
- package/dist/client/generated/wire.d.ts +81 -0
- package/dist/client/generated/wire.js.map +1 -1
- package/dist/client/index.d.ts +4 -2
- package/dist/client/media/queue.d.ts +4 -2
- package/dist/client/media/queue.js +18 -12
- package/dist/client/media/queue.js.map +1 -1
- package/dist/client/media/rules.d.ts +7 -1
- package/dist/client/media/rules.js +27 -21
- package/dist/client/media/rules.js.map +1 -1
- package/dist/client/reader-meta.d.ts +27 -0
- package/dist/client/reader-meta.js +99 -0
- package/dist/client/reader-meta.js.map +1 -0
- package/dist/client/stats.d.ts +32 -0
- package/dist/client/stats.js +35 -0
- package/dist/client/stats.js.map +1 -0
- package/dist/client/versions.d.ts +1 -1
- package/dist/client/versions.js +7 -2
- package/dist/client/versions.js.map +1 -1
- package/dist/client.js +30 -28
- package/dist/components/admin/content-manager.js +206 -206
- package/dist/components/admin/content-manager.js.map +1 -1
- package/dist/components/admin/group-manager.js +71 -70
- package/dist/components/admin/group-manager.js.map +1 -1
- package/dist/components/admin/media-item-panel.d.ts +24 -7
- package/dist/components/admin/media-item-panel.js +209 -197
- package/dist/components/admin/media-item-panel.js.map +1 -1
- package/dist/components/admin/poll-manager.js +25 -25
- package/dist/components/admin/reader-manifest.d.ts +18 -0
- package/dist/components/admin/reader-manifest.js +490 -0
- package/dist/components/admin/reader-manifest.js.map +1 -0
- package/dist/components/admin/stats-dashboard.d.ts +22 -0
- package/dist/components/admin/stats-dashboard.js +257 -0
- package/dist/components/admin/stats-dashboard.js.map +1 -0
- package/dist/components/content/card.js +43 -43
- package/dist/components/content/card.js.map +1 -1
- package/dist/components/content/editors.d.ts +2 -1
- package/dist/components/content/editors.js +479 -416
- package/dist/components/content/editors.js.map +1 -1
- package/dist/components/content/grid.js +47 -47
- package/dist/components/content/index.d.ts +2 -1
- package/dist/components/content/listing.js +34 -34
- package/dist/components/content/listing.js.map +1 -1
- package/dist/components/content/paywall.d.ts +17 -5
- package/dist/components/content/paywall.js +115 -100
- package/dist/components/content/paywall.js.map +1 -1
- package/dist/components/content/reader-stats.d.ts +12 -0
- package/dist/components/content/reader-stats.js +47 -0
- package/dist/components/content/reader-stats.js.map +1 -0
- package/dist/components/groups/banner.d.ts +1 -1
- package/dist/components/groups/banner.js +34 -34
- package/dist/components/groups/banner.js.map +1 -1
- package/dist/components/groups/directory.js +11 -11
- package/dist/components/groups/editor.js +294 -294
- package/dist/components/groups/editor.js.map +1 -1
- package/dist/components/groups/header.js +27 -27
- package/dist/components/groups/header.js.map +1 -1
- package/dist/components/groups/memberships.js +180 -180
- package/dist/components/groups/parts.d.ts +2 -4
- package/dist/components/groups/parts.js +69 -88
- package/dist/components/groups/parts.js.map +1 -1
- package/dist/components/media-folder-editor.js +239 -189
- package/dist/components/media-folder-editor.js.map +1 -1
- package/dist/components/notifications.js +17 -17
- package/dist/components/slot-upload.d.ts +2 -2
- package/dist/components/slot-upload.js +84 -79
- package/dist/components/slot-upload.js.map +1 -1
- package/dist/components/social/bans.js +34 -34
- package/dist/components/social/comments.js +59 -45
- package/dist/components/social/comments.js.map +1 -1
- package/dist/components/social/index.d.ts +1 -0
- package/dist/components/social/moderation.d.ts +5 -4
- package/dist/components/social/moderation.js +177 -160
- package/dist/components/social/moderation.js.map +1 -1
- package/dist/components/social/parts.js +22 -14
- package/dist/components/social/parts.js.map +1 -1
- package/dist/components/social/rules.d.ts +23 -0
- package/dist/components/social/rules.js +261 -0
- package/dist/components/social/rules.js.map +1 -0
- package/dist/components/video-player.d.ts +2 -0
- package/dist/components/video-player.js +318 -314
- package/dist/components/video-player.js.map +1 -1
- package/dist/i18n/context.d.ts +2 -0
- package/dist/i18n/context.js +23 -5
- package/dist/i18n/context.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +28 -24
- package/dist/locales/admin/de.js +105 -0
- package/dist/locales/admin/de.js.map +1 -1
- package/dist/locales/admin/en.d.ts +105 -0
- package/dist/locales/admin/en.js +105 -0
- package/dist/locales/admin/en.js.map +1 -1
- package/dist/locales/admin/es.js +105 -0
- package/dist/locales/admin/es.js.map +1 -1
- package/dist/locales/admin/ja.js +105 -0
- package/dist/locales/admin/ja.js.map +1 -1
- package/dist/locales/admin/ko.js +105 -0
- package/dist/locales/admin/ko.js.map +1 -1
- package/dist/locales/admin/zh.js +105 -0
- package/dist/locales/admin/zh.js.map +1 -1
- package/dist/locales/content/de.js +6 -0
- package/dist/locales/content/de.js.map +1 -1
- package/dist/locales/content/en.d.ts +6 -0
- package/dist/locales/content/en.js +6 -0
- package/dist/locales/content/en.js.map +1 -1
- package/dist/locales/content/es.js +6 -0
- package/dist/locales/content/es.js.map +1 -1
- package/dist/locales/content/ja.js +6 -0
- package/dist/locales/content/ja.js.map +1 -1
- package/dist/locales/content/ko.js +6 -0
- package/dist/locales/content/ko.js.map +1 -1
- package/dist/locales/content/zh.js +6 -0
- package/dist/locales/content/zh.js.map +1 -1
- package/dist/locales/de.js +4 -1
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/discovery/de.js +1 -0
- package/dist/locales/discovery/de.js.map +1 -1
- package/dist/locales/discovery/en.d.ts +1 -0
- package/dist/locales/discovery/en.js +1 -0
- package/dist/locales/discovery/en.js.map +1 -1
- package/dist/locales/discovery/es.js +1 -0
- package/dist/locales/discovery/es.js.map +1 -1
- package/dist/locales/discovery/ja.js +1 -0
- package/dist/locales/discovery/ja.js.map +1 -1
- package/dist/locales/discovery/ko.js +1 -0
- package/dist/locales/discovery/ko.js.map +1 -1
- package/dist/locales/discovery/zh.js +1 -0
- package/dist/locales/discovery/zh.js.map +1 -1
- package/dist/locales/en.d.ts +118 -0
- package/dist/locales/en.js +4 -1
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es.js +4 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/ja.js +4 -1
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.js +4 -1
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/social/de.js +3 -0
- package/dist/locales/social/de.js.map +1 -1
- package/dist/locales/social/en.d.ts +3 -0
- package/dist/locales/social/en.js +3 -0
- package/dist/locales/social/en.js.map +1 -1
- package/dist/locales/social/es.js +3 -0
- package/dist/locales/social/es.js.map +1 -1
- package/dist/locales/social/ja.js +3 -0
- package/dist/locales/social/ja.js.map +1 -1
- package/dist/locales/social/ko.js +3 -0
- package/dist/locales/social/ko.js.map +1 -1
- package/dist/locales/social/zh.js +3 -0
- package/dist/locales/social/zh.js.map +1 -1
- package/dist/locales/zh.js +4 -1
- package/dist/locales/zh.js.map +1 -1
- package/dist/react/admin.d.ts +1 -1
- package/dist/react/admin.js +24 -23
- package/dist/react/admin.js.map +1 -1
- package/dist/react/canonical.d.ts +4 -3
- package/dist/react/canonical.js +34 -33
- package/dist/react/canonical.js.map +1 -1
- package/dist/react/comments.d.ts +29 -1
- package/dist/react/comments.js +30 -2
- package/dist/react/comments.js.map +1 -1
- package/dist/react/contents.js +144 -144
- package/dist/react/contents.js.map +1 -1
- package/dist/react/context.d.ts +1 -1
- package/dist/react/context.js.map +1 -1
- package/dist/react/detail.d.ts +12 -6
- package/dist/react/detail.js +31 -24
- package/dist/react/detail.js.map +1 -1
- package/dist/react/discovery.js +1 -1
- package/dist/react/discovery.js.map +1 -1
- package/dist/react/folder.d.ts +7 -2
- package/dist/react/folder.js +165 -147
- package/dist/react/folder.js.map +1 -1
- package/dist/react/groups.d.ts +0 -1
- package/dist/react/groups.js +13 -12
- package/dist/react/groups.js.map +1 -1
- package/dist/react/index.d.ts +5 -3
- package/dist/react/location.d.ts +11 -0
- package/dist/react/location.js +18 -0
- package/dist/react/location.js.map +1 -0
- package/dist/react/public.d.ts +8 -0
- package/dist/react/public.js +32 -27
- package/dist/react/public.js.map +1 -1
- package/dist/react/resources.js +6 -0
- package/dist/react/resources.js.map +1 -1
- package/dist/react/stats.d.ts +24 -0
- package/dist/react/stats.js +28 -0
- package/dist/react/stats.js.map +1 -0
- package/dist/react/use-resource.js +8 -7
- package/dist/react/use-resource.js.map +1 -1
- package/dist/react/versions.js +20 -20
- package/dist/react.js +26 -24
- package/dist/styles.css +1 -1
- package/dist/urls/index.d.ts +35 -10
- package/dist/urls.js +100 -70
- package/dist/urls.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { useInlinePreview as e } from "../react/inline-preview.js";
|
|
2
2
|
import { RenditionImg as t } from "./rendition-img.js";
|
|
3
3
|
import { publicRenditions as n } from "../client/public.js";
|
|
4
|
-
import {
|
|
5
|
-
import { ContentKitUiRoot as
|
|
6
|
-
import { EncodeProgress as
|
|
4
|
+
import { useLanguageName as r, useMessages as i } from "../i18n/context.js";
|
|
5
|
+
import { ContentKitUiRoot as a } from "../scope.js";
|
|
6
|
+
import { EncodeProgress as ee } from "./encode-progress.js";
|
|
7
7
|
import { Button as o } from "../ui/button.js";
|
|
8
|
-
import { formatDuration as
|
|
9
|
-
import { PLAYBACK_SPEEDS as
|
|
10
|
-
import { useHlsPlayer as
|
|
11
|
-
import { useActiveCues as
|
|
12
|
-
import { Captions as
|
|
8
|
+
import { formatDuration as te } from "../client/gallery.js";
|
|
9
|
+
import { PLAYBACK_SPEEDS as ne, PLAYER_VOLUME_KEY as re, nextSpeed as ie, playerKeyAction as ae, resumeAt as oe, writeVolume as se } from "../client/player.js";
|
|
10
|
+
import { useHlsPlayer as ce } from "../react/gallery.js";
|
|
11
|
+
import { useActiveCues as le, useFullscreen as ue, useMediaState as de, usePictureInPicture as fe, useProgressReports as pe, useSprite as me } from "../react/player.js";
|
|
12
|
+
import { Captions as he, ControlButton as s, SeekBar as ge, SeekFlash as _e, SettingsMenu as ve, Spinner as ye, VolumeControl as be, clock as xe } from "./player-controls.js";
|
|
13
13
|
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
14
|
-
import { Fragment as
|
|
14
|
+
import { Fragment as Se, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
15
15
|
import { cn as m } from "cn";
|
|
16
|
-
import { AlertCircleIcon as h, ArrowShrink02Icon as
|
|
17
|
-
import { HugeiconsIcon as
|
|
16
|
+
import { AlertCircleIcon as h, ArrowShrink02Icon as Ce, ClosedCaptionIcon as we, FullScreenIcon as Te, PauseIcon as Ee, PictureInPicture01Icon as De, PictureInPictureExitIcon as Oe, PictureInPictureOnIcon as ke, PlayIcon as Ae, RectangularIcon as je, Refresh01Icon as Me, Settings01Icon as Ne } from "@hugeicons/core-free-icons";
|
|
17
|
+
import { HugeiconsIcon as g } from "@hugeicons/react";
|
|
18
18
|
//#region src/components/video-player.tsx
|
|
19
|
-
function
|
|
20
|
-
let i =
|
|
19
|
+
function Pe({ vtt: e, xhrSetup: t, fit: n = "contain", className: r }) {
|
|
20
|
+
let i = me(e, t), a = i?.cues[0];
|
|
21
21
|
return !i || !a ? null : /* @__PURE__ */ f("svg", {
|
|
22
22
|
"aria-hidden": !0,
|
|
23
23
|
className: m("pointer-events-none absolute inset-0 size-full", r),
|
|
@@ -31,328 +31,332 @@ function Me({ vtt: e, xhrSetup: t, fit: n = "contain", className: r }) {
|
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
var
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
var Fe = 2500, Ie = 300, Le = 700, Re = 650, _ = "textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=textbox], [role=combobox], [role=searchbox], input:not([type=range]):not([type=button]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=reset])", v = "[role=menu], [role=menuitem], [role=menuitemradio], [role=menuitemcheckbox], [role=listbox], [role=option]", y = "a, button, input, [role=button], [role=dialog], [role=alertdialog]";
|
|
35
|
+
function ze(e, t) {
|
|
36
|
+
let n = e.lang && (!e.label || e.label.toLowerCase() === e.lang.toLowerCase()) ? e.lang : void 0;
|
|
37
|
+
return n ? t(n) : e.label;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
function Be(e, t, n) {
|
|
40
|
+
return e instanceof Element ? e.closest(_) || e.closest(v) || e.closest("input[type=range], [role=slider]") && /^(Arrow|Page|Home$|End$)/.test(t) ? !1 : n.contains(e) || !e.closest(y) : !0;
|
|
41
|
+
}
|
|
42
|
+
var Ve = (e, t) => e instanceof Element && t.contains(e) && !!e.closest("button") && !e.closest(v);
|
|
43
|
+
function b({ base: o, poster: h, width: _, height: v, duration: y, pending: b, progress: Ke, failed: S, layout: qe = "frame", maxHeight: Je = "80svh", inlinePreview: Ye, previewStart: Xe, keyboard: C = "focus", onProgress: Ze, progressInterval: Qe = 1e4, onEvent: $e, theater: w, onTheaterChange: T, onMiniPlayer: E, renderDownloads: et, menuItems: tt, crossOrigin: nt, label: rt, className: it, style: at, appearance: ot, startAt: st, ...D }) {
|
|
44
|
+
let { t: O } = i(), ct = r(), k = !!o && !b && !S, lt = k ? `${o}master.m3u8` : null, A = oe(st, y), j = ce({
|
|
45
|
+
...D,
|
|
46
|
+
src: lt,
|
|
47
|
+
startAt: A
|
|
48
|
+
}), { status: M, error: N, started: P, previewing: F, audio: I, subtitles: L, quality: R } = j, [z, ut] = d(null), [B, dt] = d(null), ft = j.ref, pt = c((e) => {
|
|
49
|
+
ft(e), dt(e);
|
|
50
|
+
}, [ft]);
|
|
47
51
|
e({
|
|
48
|
-
setting:
|
|
49
|
-
available:
|
|
50
|
-
target:
|
|
51
|
-
playing:
|
|
52
|
-
start: () =>
|
|
53
|
-
stop:
|
|
52
|
+
setting: Ye,
|
|
53
|
+
available: k && !P && !N && D.active !== !1 && !D.autoPlay,
|
|
54
|
+
target: z,
|
|
55
|
+
playing: P && M === "playing",
|
|
56
|
+
start: () => j.preview(We(Xe, y)),
|
|
57
|
+
stop: j.unload
|
|
54
58
|
});
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
enabled:
|
|
58
|
-
source:
|
|
59
|
-
interval:
|
|
60
|
-
onProgress:
|
|
59
|
+
let V = de(B), H = ue(z, B), U = fe(B), mt = le(B), ht = me(P && o ? `${o}sprite.vtt` : null, D.xhrSetup), gt = !F && P;
|
|
60
|
+
pe(B, {
|
|
61
|
+
enabled: gt,
|
|
62
|
+
source: gt ? lt : null,
|
|
63
|
+
interval: Qe,
|
|
64
|
+
onProgress: Ze
|
|
61
65
|
});
|
|
62
|
-
let
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
let
|
|
67
|
-
(t ||
|
|
66
|
+
let _t = u($e);
|
|
67
|
+
_t.current = $e;
|
|
68
|
+
let vt = u(!1);
|
|
69
|
+
vt.current = !F && M !== "idle";
|
|
70
|
+
let W = c((e, t = !1) => {
|
|
71
|
+
(t || vt.current) && _t.current && _t.current({
|
|
68
72
|
...e,
|
|
69
|
-
time:
|
|
73
|
+
time: B?.currentTime ?? 0
|
|
70
74
|
});
|
|
71
|
-
}, [
|
|
75
|
+
}, [B]);
|
|
72
76
|
l(() => {
|
|
73
|
-
if (!
|
|
77
|
+
if (!B) return;
|
|
74
78
|
let e = 0, t = {
|
|
75
|
-
play: () =>
|
|
76
|
-
playing: () =>
|
|
77
|
-
pause: () => !
|
|
78
|
-
waiting: () =>
|
|
79
|
-
ended: () =>
|
|
79
|
+
play: () => W({ type: "play" }),
|
|
80
|
+
playing: () => W({ type: "playing" }),
|
|
81
|
+
pause: () => !B.ended && W({ type: "pause" }),
|
|
82
|
+
waiting: () => W({ type: "waiting" }),
|
|
83
|
+
ended: () => W({ type: "ended" }),
|
|
80
84
|
timeupdate: () => {
|
|
81
|
-
|
|
85
|
+
B.seeking || (e = B.currentTime);
|
|
82
86
|
},
|
|
83
87
|
seeked: () => {
|
|
84
|
-
|
|
88
|
+
W({
|
|
85
89
|
type: "seek",
|
|
86
90
|
from: e
|
|
87
|
-
}), e =
|
|
91
|
+
}), e = B.currentTime;
|
|
88
92
|
},
|
|
89
|
-
ratechange: () =>
|
|
93
|
+
ratechange: () => W({
|
|
90
94
|
type: "rate",
|
|
91
|
-
rate:
|
|
95
|
+
rate: B.playbackRate
|
|
92
96
|
})
|
|
93
97
|
};
|
|
94
|
-
for (let [e, n] of Object.entries(t))
|
|
98
|
+
for (let [e, n] of Object.entries(t)) B.addEventListener(e, n);
|
|
95
99
|
return () => {
|
|
96
|
-
for (let [e, n] of Object.entries(t))
|
|
100
|
+
for (let [e, n] of Object.entries(t)) B.removeEventListener(e, n);
|
|
97
101
|
};
|
|
98
|
-
}, [
|
|
99
|
-
|
|
102
|
+
}, [B, W]), l(() => {
|
|
103
|
+
N && !F && W({
|
|
100
104
|
type: "error",
|
|
101
|
-
error:
|
|
105
|
+
error: N
|
|
102
106
|
}, !0);
|
|
103
107
|
}, [
|
|
104
|
-
j,
|
|
105
108
|
N,
|
|
106
|
-
|
|
109
|
+
F,
|
|
110
|
+
W
|
|
107
111
|
]);
|
|
108
|
-
let
|
|
112
|
+
let yt = u({
|
|
109
113
|
fs: !1,
|
|
110
114
|
pip: !1
|
|
111
115
|
});
|
|
112
116
|
l(() => {
|
|
113
|
-
|
|
117
|
+
yt.current.fs !== H.active && W({
|
|
114
118
|
type: "fullscreen",
|
|
115
|
-
on:
|
|
116
|
-
}),
|
|
119
|
+
on: H.active
|
|
120
|
+
}), yt.current.pip !== U.active && W({
|
|
117
121
|
type: "pip",
|
|
118
|
-
on:
|
|
119
|
-
}),
|
|
120
|
-
fs:
|
|
121
|
-
pip:
|
|
122
|
+
on: U.active
|
|
123
|
+
}), yt.current = {
|
|
124
|
+
fs: H.active,
|
|
125
|
+
pip: U.active
|
|
122
126
|
};
|
|
123
127
|
}, [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
H.active,
|
|
129
|
+
U.active,
|
|
130
|
+
W
|
|
127
131
|
]);
|
|
128
|
-
let
|
|
132
|
+
let bt = u(A);
|
|
129
133
|
l(() => {
|
|
130
|
-
|
|
134
|
+
bt.current !== A && (bt.current = A, B && P && (B.currentTime = A));
|
|
131
135
|
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
A,
|
|
137
|
+
B,
|
|
138
|
+
P
|
|
135
139
|
]);
|
|
136
|
-
let [
|
|
137
|
-
|
|
138
|
-
}, []),
|
|
139
|
-
clearTimeout(G.current),
|
|
140
|
+
let [xt, St] = d(!1), G = u(void 0), K = c(() => {
|
|
141
|
+
St(!0), clearTimeout(G.current), G.current = setTimeout(() => St(!1), Fe);
|
|
142
|
+
}, []), Ct = c(() => {
|
|
143
|
+
clearTimeout(G.current), St(!1);
|
|
140
144
|
}, []);
|
|
141
145
|
l(() => () => clearTimeout(G.current), []), l(() => {
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
let [
|
|
146
|
+
P && K();
|
|
147
|
+
}, [P, K]);
|
|
148
|
+
let [wt, Tt] = d(!1), [Et, Dt] = d(!1), [Ot, kt] = d(!1), q = P && !N && (xt || V.paused || V.ended || wt || Et || Ot), [At, jt] = d(null), J = u(void 0), Mt = c((e, t) => {
|
|
145
149
|
let n = J.current !== void 0;
|
|
146
|
-
clearTimeout(J.current),
|
|
150
|
+
clearTimeout(J.current), jt((r) => ({
|
|
147
151
|
direction: e,
|
|
148
152
|
seconds: n && r?.direction === e ? r.seconds + t : t
|
|
149
153
|
})), J.current = setTimeout(() => {
|
|
150
|
-
|
|
151
|
-
},
|
|
154
|
+
jt(null), J.current = void 0;
|
|
155
|
+
}, Re);
|
|
152
156
|
}, []);
|
|
153
157
|
l(() => () => clearTimeout(J.current), []);
|
|
154
|
-
let
|
|
155
|
-
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
+
let Nt = D.volumeKey === void 0 ? re : D.volumeKey, Y = V.duration || y || 0, Pt = (e) => {
|
|
159
|
+
B && (B.currentTime = Math.min(Y || e, Math.max(0, e)));
|
|
160
|
+
}, Ft = (e) => {
|
|
161
|
+
B && (Pt(B.currentTime + e), Mt(e < 0 ? -1 : 1, Math.abs(e)));
|
|
158
162
|
}, X = () => {
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
volume:
|
|
163
|
-
muted:
|
|
164
|
-
}),
|
|
163
|
+
B && (!P || B.ended ? (B.ended && (B.currentTime = 0), j.play()) : B.paused ? j.play() : B.pause());
|
|
164
|
+
}, It = (e) => {
|
|
165
|
+
B && (B.volume = Math.min(1, Math.max(0, e)), B.volume > 0 && B.muted && (B.muted = !1), se(Nt, {
|
|
166
|
+
volume: B.volume,
|
|
167
|
+
muted: B.muted
|
|
168
|
+
}), W({
|
|
165
169
|
type: "volume",
|
|
166
|
-
volume:
|
|
167
|
-
muted:
|
|
170
|
+
volume: B.volume,
|
|
171
|
+
muted: B.muted
|
|
168
172
|
}));
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
volume:
|
|
172
|
-
muted:
|
|
173
|
-
}),
|
|
173
|
+
}, Lt = () => {
|
|
174
|
+
B && (B.muted = !B.muted, !B.muted && B.volume === 0 && (B.volume = 1), se(Nt, {
|
|
175
|
+
volume: B.volume,
|
|
176
|
+
muted: B.muted
|
|
177
|
+
}), W({
|
|
174
178
|
type: "volume",
|
|
175
|
-
volume:
|
|
176
|
-
muted:
|
|
179
|
+
volume: B.volume,
|
|
180
|
+
muted: B.muted
|
|
177
181
|
}));
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
let t =
|
|
181
|
-
t &&
|
|
182
|
+
}, Rt = (e) => {
|
|
183
|
+
I.select(e);
|
|
184
|
+
let t = I.list[e];
|
|
185
|
+
t && W({
|
|
182
186
|
type: "audio",
|
|
183
187
|
track: t
|
|
184
188
|
});
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
let
|
|
188
|
-
|
|
189
|
+
}, zt = u(-1);
|
|
190
|
+
L.selected >= 0 && (zt.current = L.selected);
|
|
191
|
+
let Bt = (e) => {
|
|
192
|
+
L.select(e), W({
|
|
189
193
|
type: "subtitles",
|
|
190
|
-
track:
|
|
194
|
+
track: L.list[e] ?? null
|
|
191
195
|
});
|
|
192
|
-
},
|
|
193
|
-
|
|
196
|
+
}, Vt = () => Bt(L.selected >= 0 ? -1 : zt.current >= 0 ? zt.current : 0), Ht = (e) => {
|
|
197
|
+
R.select(e), W({
|
|
194
198
|
type: "quality",
|
|
195
|
-
height:
|
|
199
|
+
height: R.levels.find((t) => t.index === e)?.height ?? null
|
|
196
200
|
});
|
|
197
|
-
},
|
|
198
|
-
|
|
201
|
+
}, Ut = () => {
|
|
202
|
+
T?.(!w), W({
|
|
199
203
|
type: "theater",
|
|
200
204
|
on: !w
|
|
201
205
|
});
|
|
202
|
-
},
|
|
203
|
-
if (!
|
|
204
|
-
let e =
|
|
206
|
+
}, Wt = () => {
|
|
207
|
+
if (!E || !o || !B) return;
|
|
208
|
+
let e = I.list[I.selected], t = L.list[L.selected], n = {
|
|
205
209
|
base: o,
|
|
206
|
-
time:
|
|
207
|
-
playing: !
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
210
|
+
time: B.currentTime,
|
|
211
|
+
playing: !B.paused && !B.ended,
|
|
212
|
+
width: _ ?? (B.videoWidth || void 0),
|
|
213
|
+
height: v ?? (B.videoHeight || void 0),
|
|
210
214
|
duration: Y || void 0,
|
|
211
215
|
poster: h,
|
|
212
216
|
audioLanguage: e?.lang,
|
|
213
217
|
subtitleLanguage: t?.lang ?? null
|
|
214
218
|
};
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
if (!
|
|
219
|
+
B.pause(), H.active && H.toggle(), E(n);
|
|
220
|
+
}, Gt = (e) => {
|
|
221
|
+
if (!B || !P && e.type !== "toggle") return !1;
|
|
218
222
|
switch (e.type) {
|
|
219
223
|
case "toggle":
|
|
220
224
|
X();
|
|
221
225
|
break;
|
|
222
226
|
case "seekBy":
|
|
223
|
-
|
|
227
|
+
Ft(e.seconds);
|
|
224
228
|
break;
|
|
225
229
|
case "seekTo":
|
|
226
230
|
if (!Y) return !1;
|
|
227
|
-
|
|
231
|
+
Pt(Y * e.fraction);
|
|
228
232
|
break;
|
|
229
233
|
case "volumeBy":
|
|
230
|
-
|
|
234
|
+
It((B.muted ? 0 : B.volume) + e.delta);
|
|
231
235
|
break;
|
|
232
236
|
case "mute":
|
|
233
|
-
|
|
237
|
+
Lt();
|
|
234
238
|
break;
|
|
235
239
|
case "captions":
|
|
236
|
-
if (!
|
|
237
|
-
|
|
240
|
+
if (!L.list.length) return !1;
|
|
241
|
+
Vt();
|
|
238
242
|
break;
|
|
239
243
|
case "fullscreen":
|
|
240
|
-
if (!
|
|
241
|
-
|
|
244
|
+
if (!H.supported) return !1;
|
|
245
|
+
H.toggle();
|
|
242
246
|
break;
|
|
243
247
|
case "theater":
|
|
244
|
-
if (!
|
|
245
|
-
|
|
248
|
+
if (!T) return !1;
|
|
249
|
+
Ut();
|
|
246
250
|
break;
|
|
247
251
|
case "miniPlayer":
|
|
248
|
-
if (!
|
|
249
|
-
|
|
252
|
+
if (!E) return !1;
|
|
253
|
+
Wt();
|
|
250
254
|
break;
|
|
251
|
-
case "speed":
|
|
255
|
+
case "speed": B.playbackRate = ie(B.playbackRate, e.step);
|
|
252
256
|
}
|
|
253
|
-
return
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
let
|
|
257
|
+
return P && K(), !0;
|
|
258
|
+
}, Kt = u(Gt);
|
|
259
|
+
Kt.current = Gt;
|
|
260
|
+
let qt = D.active !== !1;
|
|
257
261
|
l(() => {
|
|
258
|
-
if (!C || !
|
|
259
|
-
let e = C === "global" ? document :
|
|
262
|
+
if (!C || !z || !qt) return;
|
|
263
|
+
let e = C === "global" ? document : z, t = (e) => {
|
|
260
264
|
let t = e;
|
|
261
265
|
if (t.defaultPrevented) return;
|
|
262
|
-
let n =
|
|
263
|
-
n &&
|
|
266
|
+
let n = ae(t);
|
|
267
|
+
n && Be(t.target, t.key, z) && Kt.current(n) && t.preventDefault();
|
|
264
268
|
}, n = (e) => {
|
|
265
269
|
let t = e;
|
|
266
|
-
t.key === " " &&
|
|
270
|
+
t.key === " " && Ve(t.target, z) && t.preventDefault();
|
|
267
271
|
};
|
|
268
272
|
return e.addEventListener("keydown", t), e.addEventListener("keyup", n), () => {
|
|
269
273
|
e.removeEventListener("keydown", t), e.removeEventListener("keyup", n);
|
|
270
274
|
};
|
|
271
275
|
}, [
|
|
272
276
|
C,
|
|
273
|
-
|
|
274
|
-
|
|
277
|
+
z,
|
|
278
|
+
qt
|
|
275
279
|
]);
|
|
276
|
-
let
|
|
277
|
-
if (
|
|
280
|
+
let Jt = u("mouse"), Yt = u(null), Z = u(0), Xt = (e) => {
|
|
281
|
+
if (Jt.current === "mouse") {
|
|
278
282
|
X(), K();
|
|
279
283
|
return;
|
|
280
284
|
}
|
|
281
|
-
let t = e.currentTarget.getBoundingClientRect(), n = t.width ? (e.clientX - t.left) / t.width : .5, r = n < .4 ? -1 : n > .6 ? 1 : null, i = Date.now(), a =
|
|
282
|
-
if (
|
|
285
|
+
let t = e.currentTarget.getBoundingClientRect(), n = t.width ? (e.clientX - t.left) / t.width : .5, r = n < .4 ? -1 : n > .6 ? 1 : null, i = Date.now(), a = Yt.current;
|
|
286
|
+
if (Yt.current = r ? {
|
|
283
287
|
at: i,
|
|
284
288
|
side: r
|
|
285
|
-
} : null, r && a?.side === r && (i < Z.current || i - a.at <=
|
|
286
|
-
Z.current = i +
|
|
289
|
+
} : null, r && a?.side === r && (i < Z.current || i - a.at <= Ie)) {
|
|
290
|
+
Z.current = i + Le, Ft(r * 10);
|
|
287
291
|
return;
|
|
288
292
|
}
|
|
289
|
-
q && !
|
|
290
|
-
},
|
|
291
|
-
Date.now() >= Z.current &&
|
|
292
|
-
},
|
|
293
|
+
q && !V.paused ? Ct() : K();
|
|
294
|
+
}, Zt = () => {
|
|
295
|
+
Date.now() >= Z.current && H.supported && H.toggle();
|
|
296
|
+
}, Qt = _ && v ? _ / v : V.aspect ?? 16 / 9, $t = H.active ? {
|
|
293
297
|
width: "100%",
|
|
294
298
|
height: "100%",
|
|
295
299
|
borderRadius: 0
|
|
296
|
-
} :
|
|
297
|
-
aspectRatio: String(
|
|
298
|
-
width: `min(100%, calc(${
|
|
300
|
+
} : qe === "frame" ? {
|
|
301
|
+
aspectRatio: String(Qt),
|
|
302
|
+
width: `min(100%, calc(${Je} * ${Qt}))`,
|
|
299
303
|
marginInline: "auto"
|
|
300
|
-
} : {},
|
|
301
|
-
function
|
|
302
|
-
let t = e
|
|
303
|
-
return e.forced ?
|
|
304
|
+
} : {}, en = typeof h == "string" ? [] : n(h), Q = !N && !F && (M === "loading" || M === "buffering"), $ = m("transition-opacity duration-300 motion-reduce:transition-none", F && M === "playing" && "opacity-0"), tn = H.active && z ? z : void 0, nn = an();
|
|
305
|
+
function rn(e) {
|
|
306
|
+
let t = ze(e, ct) || O("player.track", { number: e.index + 1 });
|
|
307
|
+
return e.forced ? O("player.forced", { label: t }) : t;
|
|
304
308
|
}
|
|
305
|
-
function
|
|
309
|
+
function an() {
|
|
306
310
|
let e = [];
|
|
307
|
-
if (
|
|
311
|
+
if (I.list.length > 1 && e.push({
|
|
308
312
|
key: "audio",
|
|
309
|
-
label:
|
|
310
|
-
value: String(
|
|
311
|
-
options:
|
|
313
|
+
label: O("player.audio"),
|
|
314
|
+
value: String(I.selected),
|
|
315
|
+
options: I.list.map((e) => ({
|
|
312
316
|
value: String(e.index),
|
|
313
|
-
label:
|
|
317
|
+
label: rn(e)
|
|
314
318
|
})),
|
|
315
|
-
onChange: (e) =>
|
|
316
|
-
}),
|
|
319
|
+
onChange: (e) => Rt(Number(e))
|
|
320
|
+
}), L.list.length && e.push({
|
|
317
321
|
key: "subtitles",
|
|
318
|
-
label:
|
|
319
|
-
value: String(
|
|
322
|
+
label: O("player.subtitles"),
|
|
323
|
+
value: String(L.selected),
|
|
320
324
|
options: [{
|
|
321
325
|
value: "-1",
|
|
322
|
-
label:
|
|
323
|
-
}, ...
|
|
326
|
+
label: O("player.subtitlesOff")
|
|
327
|
+
}, ...L.list.map((e) => ({
|
|
324
328
|
value: String(e.index),
|
|
325
|
-
label:
|
|
329
|
+
label: rn(e)
|
|
326
330
|
}))],
|
|
327
|
-
onChange: (e) =>
|
|
328
|
-
}),
|
|
329
|
-
let t =
|
|
331
|
+
onChange: (e) => Bt(Number(e))
|
|
332
|
+
}), R.levels.length > 1) {
|
|
333
|
+
let t = R.levels.find((e) => e.index === R.current);
|
|
330
334
|
e.push({
|
|
331
335
|
key: "quality",
|
|
332
|
-
label:
|
|
333
|
-
value: String(
|
|
334
|
-
options: [...[...
|
|
336
|
+
label: O("player.quality"),
|
|
337
|
+
value: String(R.selected),
|
|
338
|
+
options: [...[...R.levels].reverse().map((e) => ({
|
|
335
339
|
value: String(e.index),
|
|
336
|
-
label:
|
|
340
|
+
label: x(e.height)
|
|
337
341
|
})), {
|
|
338
342
|
value: "-1",
|
|
339
|
-
label: t &&
|
|
343
|
+
label: t && R.selected === -1 ? O("player.autoCurrent", { quality: x(t.height).split(" ")[0] }) : O("player.auto")
|
|
340
344
|
}],
|
|
341
|
-
onChange: (e) =>
|
|
345
|
+
onChange: (e) => Ht(Number(e))
|
|
342
346
|
});
|
|
343
347
|
}
|
|
344
348
|
return e.push({
|
|
345
349
|
key: "speed",
|
|
346
|
-
label:
|
|
347
|
-
value: String(
|
|
348
|
-
options:
|
|
350
|
+
label: O("player.speed"),
|
|
351
|
+
value: String(V.rate),
|
|
352
|
+
options: ne.map((e) => ({
|
|
349
353
|
value: String(e),
|
|
350
|
-
label: e === 1 ?
|
|
354
|
+
label: e === 1 ? O("player.normal") : `${e}×`
|
|
351
355
|
})),
|
|
352
356
|
onChange: (e) => {
|
|
353
|
-
|
|
357
|
+
B && (B.playbackRate = Number(e));
|
|
354
358
|
}
|
|
355
|
-
}),
|
|
359
|
+
}), tt?.forEach((t, n) => {
|
|
356
360
|
"options" in t && e.push({
|
|
357
361
|
key: `host-${n}`,
|
|
358
362
|
label: t.label,
|
|
@@ -362,189 +366,189 @@ function x({ base: o, poster: h, width: v, height: y, duration: b, pending: x, p
|
|
|
362
366
|
});
|
|
363
367
|
}), e;
|
|
364
368
|
}
|
|
365
|
-
let
|
|
366
|
-
return /* @__PURE__ */ f(
|
|
367
|
-
appearance:
|
|
368
|
-
className: m("@container relative w-full touch-manipulation overflow-hidden bg-black text-white outline-none",
|
|
369
|
+
let on = tt?.filter((e) => "onSelect" in e);
|
|
370
|
+
return /* @__PURE__ */ f(a, {
|
|
371
|
+
appearance: ot,
|
|
372
|
+
className: m("@container relative w-full touch-manipulation overflow-hidden bg-black text-white outline-none", qe === "fill" ? "size-full" : !H.active && "rounded-lg", P && !q && "cursor-none", it),
|
|
369
373
|
style: {
|
|
370
|
-
|
|
371
|
-
...
|
|
374
|
+
...$t,
|
|
375
|
+
...at
|
|
372
376
|
},
|
|
373
377
|
"data-ckui": "video-player",
|
|
374
|
-
"data-status": S ? "failed" :
|
|
375
|
-
"data-previewing":
|
|
376
|
-
"data-fullscreen":
|
|
378
|
+
"data-status": S ? "failed" : b ? "pending" : M,
|
|
379
|
+
"data-previewing": F ? "" : void 0,
|
|
380
|
+
"data-fullscreen": H.active ? "" : void 0,
|
|
377
381
|
"data-controls": q ? "" : void 0,
|
|
378
|
-
ref:
|
|
382
|
+
ref: ut,
|
|
379
383
|
role: "group",
|
|
380
|
-
"aria-label":
|
|
381
|
-
tabIndex:
|
|
382
|
-
onPointerDown: (e) =>
|
|
383
|
-
onPointerMove: (e) => e.pointerType === "mouse" &&
|
|
384
|
-
onPointerLeave: (e) => e.pointerType === "mouse" && !
|
|
385
|
-
onFocus: (e) =>
|
|
386
|
-
onBlur: () =>
|
|
387
|
-
children: S ? /* @__PURE__ */ f(
|
|
384
|
+
"aria-label": rt ?? O("player.label"),
|
|
385
|
+
tabIndex: k ? -1 : void 0,
|
|
386
|
+
onPointerDown: (e) => Jt.current = e.pointerType || "mouse",
|
|
387
|
+
onPointerMove: (e) => e.pointerType === "mouse" && P && K(),
|
|
388
|
+
onPointerLeave: (e) => e.pointerType === "mouse" && !Et && !wt && Ct(),
|
|
389
|
+
onFocus: (e) => kt(He(e.target)),
|
|
390
|
+
onBlur: () => kt(!1),
|
|
391
|
+
children: S ? /* @__PURE__ */ f(Ge, {
|
|
388
392
|
icon: !0,
|
|
389
|
-
children:
|
|
390
|
-
}) :
|
|
393
|
+
children: O("player.failed")
|
|
394
|
+
}) : b || !o ? /* @__PURE__ */ f("div", {
|
|
391
395
|
className: "absolute inset-0 flex items-center justify-center bg-muted p-6 text-foreground",
|
|
392
|
-
children: /* @__PURE__ */ f(
|
|
393
|
-
progress:
|
|
396
|
+
children: /* @__PURE__ */ f(ee, {
|
|
397
|
+
progress: Ke,
|
|
394
398
|
className: "max-w-xs"
|
|
395
399
|
})
|
|
396
|
-
}) : /* @__PURE__ */ p(
|
|
400
|
+
}) : /* @__PURE__ */ p(Se, { children: [
|
|
397
401
|
/* @__PURE__ */ f("video", {
|
|
398
|
-
ref:
|
|
402
|
+
ref: pt,
|
|
399
403
|
className: "absolute inset-0 size-full object-contain",
|
|
400
404
|
playsInline: !0,
|
|
401
405
|
preload: "none",
|
|
402
|
-
crossOrigin:
|
|
403
|
-
"aria-label":
|
|
406
|
+
crossOrigin: nt,
|
|
407
|
+
"aria-label": rt
|
|
404
408
|
}),
|
|
405
|
-
|
|
409
|
+
P && !N && /* @__PURE__ */ f("div", {
|
|
406
410
|
"data-ckui": "surface",
|
|
407
411
|
className: "absolute inset-0",
|
|
408
|
-
onClick:
|
|
409
|
-
onDoubleClick:
|
|
412
|
+
onClick: Xt,
|
|
413
|
+
onDoubleClick: Zt
|
|
410
414
|
}),
|
|
411
|
-
!
|
|
415
|
+
!P && !N && /* @__PURE__ */ p(Se, { children: [
|
|
412
416
|
typeof h == "string" ? /* @__PURE__ */ f("img", {
|
|
413
417
|
alt: "",
|
|
414
418
|
src: h,
|
|
415
419
|
decoding: "async",
|
|
416
420
|
className: m("pointer-events-none absolute inset-0 size-full object-contain", $)
|
|
417
|
-
}) :
|
|
418
|
-
outputs:
|
|
421
|
+
}) : en.length ? /* @__PURE__ */ f(t, {
|
|
422
|
+
outputs: en,
|
|
419
423
|
className: m("pointer-events-none absolute inset-0 size-full object-contain", $)
|
|
420
|
-
}) : /* @__PURE__ */ f(
|
|
424
|
+
}) : /* @__PURE__ */ f(Pe, {
|
|
421
425
|
vtt: `${o}sprite.vtt`,
|
|
422
|
-
xhrSetup:
|
|
426
|
+
xhrSetup: D.xhrSetup,
|
|
423
427
|
className: $
|
|
424
428
|
}),
|
|
425
|
-
/* @__PURE__ */ f(
|
|
426
|
-
label:
|
|
427
|
-
onClick:
|
|
429
|
+
/* @__PURE__ */ f(Ue, {
|
|
430
|
+
label: O("player.play"),
|
|
431
|
+
onClick: j.play,
|
|
428
432
|
disabled: Q,
|
|
429
433
|
className: $,
|
|
430
|
-
children: Q ? /* @__PURE__ */ f(
|
|
431
|
-
icon:
|
|
434
|
+
children: Q ? /* @__PURE__ */ f(ye, {}) : /* @__PURE__ */ f(g, {
|
|
435
|
+
icon: Ae,
|
|
432
436
|
className: "ml-1 size-7 fill-current",
|
|
433
437
|
strokeWidth: 1.5
|
|
434
438
|
})
|
|
435
439
|
}),
|
|
436
|
-
|
|
440
|
+
y ? /* @__PURE__ */ f("span", {
|
|
437
441
|
className: "pointer-events-none absolute right-2 bottom-2 rounded bg-black/65 px-1.5 py-0.5 text-xs font-medium tabular-nums",
|
|
438
|
-
children:
|
|
442
|
+
children: te(y)
|
|
439
443
|
}) : null
|
|
440
444
|
] }),
|
|
441
|
-
|
|
442
|
-
label:
|
|
445
|
+
P && !N && V.ended && /* @__PURE__ */ f(Ue, {
|
|
446
|
+
label: O("player.replay"),
|
|
443
447
|
onClick: X,
|
|
444
|
-
children: /* @__PURE__ */ f(
|
|
445
|
-
icon:
|
|
448
|
+
children: /* @__PURE__ */ f(g, {
|
|
449
|
+
icon: Me,
|
|
446
450
|
className: "size-7",
|
|
447
451
|
strokeWidth: 1.75
|
|
448
452
|
})
|
|
449
453
|
}),
|
|
450
|
-
/* @__PURE__ */ f(
|
|
451
|
-
cues:
|
|
454
|
+
/* @__PURE__ */ f(he, {
|
|
455
|
+
cues: gt ? mt : [],
|
|
452
456
|
bottom: q ? "4.75rem" : "1.25rem"
|
|
453
457
|
}),
|
|
454
|
-
|
|
458
|
+
P && Q && /* @__PURE__ */ f("div", {
|
|
455
459
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
456
460
|
children: /* @__PURE__ */ f("span", {
|
|
457
461
|
className: "flex size-14 items-center justify-center rounded-full bg-black/45",
|
|
458
|
-
children: /* @__PURE__ */ f(
|
|
462
|
+
children: /* @__PURE__ */ f(ye, {})
|
|
459
463
|
})
|
|
460
464
|
}),
|
|
461
|
-
/* @__PURE__ */ f(
|
|
462
|
-
|
|
465
|
+
/* @__PURE__ */ f(_e, { flash: At }),
|
|
466
|
+
P && !N && /* @__PURE__ */ p("div", {
|
|
463
467
|
"data-ckui": "controls",
|
|
464
468
|
"data-ckui-noswipe": "",
|
|
465
469
|
className: m("pointer-events-none absolute inset-x-0 bottom-0 z-10 flex flex-col bg-linear-to-t from-black/75 via-black/35 to-transparent px-2 pt-12 pb-1 transition-opacity duration-200 motion-reduce:transition-none", q ? "opacity-100 *:pointer-events-auto" : "opacity-0"),
|
|
466
|
-
children: [/* @__PURE__ */ f(
|
|
467
|
-
time:
|
|
470
|
+
children: [/* @__PURE__ */ f(ge, {
|
|
471
|
+
time: V.time,
|
|
468
472
|
duration: Y,
|
|
469
|
-
buffered:
|
|
470
|
-
onSeek:
|
|
471
|
-
onScrub: (e) =>
|
|
472
|
-
sprite:
|
|
473
|
+
buffered: V.buffered,
|
|
474
|
+
onSeek: Pt,
|
|
475
|
+
onScrub: (e) => Dt(e !== null),
|
|
476
|
+
sprite: ht
|
|
473
477
|
}), /* @__PURE__ */ p("div", {
|
|
474
478
|
className: "flex items-center gap-0.5",
|
|
475
479
|
children: [
|
|
476
480
|
/* @__PURE__ */ f(s, {
|
|
477
|
-
label:
|
|
481
|
+
label: V.ended ? O("player.replay") : V.paused ? O("player.resume") : O("player.pause"),
|
|
478
482
|
shortcut: "k",
|
|
479
|
-
icon:
|
|
483
|
+
icon: V.ended ? Me : V.paused ? Ae : Ee,
|
|
480
484
|
onClick: X,
|
|
481
485
|
"data-ckui": "play"
|
|
482
486
|
}),
|
|
483
|
-
/* @__PURE__ */ f(
|
|
484
|
-
volume:
|
|
485
|
-
muted:
|
|
486
|
-
onVolume:
|
|
487
|
-
onMute:
|
|
487
|
+
/* @__PURE__ */ f(be, {
|
|
488
|
+
volume: V.volume,
|
|
489
|
+
muted: V.muted,
|
|
490
|
+
onVolume: It,
|
|
491
|
+
onMute: Lt
|
|
488
492
|
}),
|
|
489
493
|
/* @__PURE__ */ p("span", {
|
|
490
494
|
className: "ml-1 shrink-0 text-xs font-medium whitespace-nowrap text-white/90 tabular-nums",
|
|
491
495
|
"data-ckui": "time",
|
|
492
496
|
children: [
|
|
493
|
-
|
|
497
|
+
xe(V.time),
|
|
494
498
|
" / ",
|
|
495
|
-
|
|
499
|
+
xe(Y)
|
|
496
500
|
]
|
|
497
501
|
}),
|
|
498
502
|
/* @__PURE__ */ f("div", { className: "min-w-0 flex-1" }),
|
|
499
|
-
|
|
500
|
-
label:
|
|
503
|
+
L.list.length > 0 && /* @__PURE__ */ f(s, {
|
|
504
|
+
label: O("player.subtitles"),
|
|
501
505
|
shortcut: "c",
|
|
502
|
-
icon:
|
|
503
|
-
"aria-pressed":
|
|
504
|
-
onClick:
|
|
506
|
+
icon: we,
|
|
507
|
+
"aria-pressed": L.selected >= 0,
|
|
508
|
+
onClick: Vt,
|
|
505
509
|
"data-ckui": "captions-toggle"
|
|
506
510
|
}),
|
|
507
|
-
|
|
508
|
-
container:
|
|
511
|
+
et?.({
|
|
512
|
+
container: tn,
|
|
509
513
|
className: "inline-flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-white outline-none transition-colors hover:bg-white/15 focus-visible:ring-2 focus-visible:ring-white/80 motion-reduce:transition-none data-popup-open:bg-white/15 [&_svg]:size-5 relative aria-pressed:after:absolute aria-pressed:after:bottom-1 aria-pressed:after:h-0.5 aria-pressed:after:w-4 aria-pressed:after:rounded-full aria-pressed:after:bg-player-accent"
|
|
510
514
|
}),
|
|
511
|
-
/* @__PURE__ */ f(
|
|
512
|
-
icon:
|
|
513
|
-
label:
|
|
514
|
-
sections:
|
|
515
|
-
actions:
|
|
516
|
-
container:
|
|
517
|
-
onOpenChange:
|
|
515
|
+
/* @__PURE__ */ f(ve, {
|
|
516
|
+
icon: Ne,
|
|
517
|
+
label: O("player.settings"),
|
|
518
|
+
sections: nn,
|
|
519
|
+
actions: on,
|
|
520
|
+
container: tn,
|
|
521
|
+
onOpenChange: Tt
|
|
518
522
|
}),
|
|
519
|
-
|
|
523
|
+
E && /* @__PURE__ */ f(s, {
|
|
520
524
|
className: "@max-sm:hidden",
|
|
521
|
-
label:
|
|
525
|
+
label: O("player.miniPlayer"),
|
|
522
526
|
shortcut: "i",
|
|
523
|
-
icon:
|
|
524
|
-
onClick:
|
|
527
|
+
icon: ke,
|
|
528
|
+
onClick: Wt,
|
|
525
529
|
"data-ckui": "mini-player-open"
|
|
526
530
|
}),
|
|
527
|
-
|
|
531
|
+
U.supported && /* @__PURE__ */ f(s, {
|
|
528
532
|
className: "@max-md:hidden",
|
|
529
|
-
label:
|
|
530
|
-
icon:
|
|
531
|
-
onClick:
|
|
533
|
+
label: U.active ? O("player.exitPip") : O("player.pip"),
|
|
534
|
+
icon: U.active ? Oe : De,
|
|
535
|
+
onClick: U.toggle,
|
|
532
536
|
"data-ckui": "pip"
|
|
533
537
|
}),
|
|
534
|
-
|
|
538
|
+
T && /* @__PURE__ */ f(s, {
|
|
535
539
|
className: "max-lg:hidden",
|
|
536
|
-
label:
|
|
540
|
+
label: O("player.theater"),
|
|
537
541
|
shortcut: "t",
|
|
538
|
-
icon:
|
|
542
|
+
icon: je,
|
|
539
543
|
"aria-pressed": !!w,
|
|
540
|
-
onClick:
|
|
544
|
+
onClick: Ut,
|
|
541
545
|
"data-ckui": "theater"
|
|
542
546
|
}),
|
|
543
|
-
|
|
544
|
-
label:
|
|
547
|
+
H.supported && /* @__PURE__ */ f(s, {
|
|
548
|
+
label: H.active ? O("player.exitFullscreen") : O("player.fullscreen"),
|
|
545
549
|
shortcut: "f",
|
|
546
|
-
icon:
|
|
547
|
-
onClick:
|
|
550
|
+
icon: H.active ? Ce : Te,
|
|
551
|
+
onClick: H.toggle,
|
|
548
552
|
"data-ckui": "fullscreen"
|
|
549
553
|
})
|
|
550
554
|
]
|
|
@@ -553,25 +557,25 @@ function x({ base: o, poster: h, width: v, height: y, duration: b, pending: x, p
|
|
|
553
557
|
/* @__PURE__ */ f("span", {
|
|
554
558
|
className: "sr-only",
|
|
555
559
|
"aria-live": "polite",
|
|
556
|
-
children: Q ?
|
|
560
|
+
children: Q ? O("player.loading") : ""
|
|
557
561
|
}),
|
|
558
|
-
|
|
562
|
+
N && /* @__PURE__ */ f(Ge, {
|
|
559
563
|
icon: !0,
|
|
560
|
-
code:
|
|
561
|
-
onRetry:
|
|
562
|
-
children:
|
|
564
|
+
code: N.code,
|
|
565
|
+
onRetry: j.retry,
|
|
566
|
+
children: O(`player.errors.${N.kind}`)
|
|
563
567
|
})
|
|
564
568
|
] })
|
|
565
569
|
});
|
|
566
570
|
}
|
|
567
|
-
function
|
|
571
|
+
function He(e) {
|
|
568
572
|
try {
|
|
569
573
|
return e instanceof Element && e.matches(":focus-visible") && !!e.closest("[data-ckui=controls]");
|
|
570
574
|
} catch {
|
|
571
575
|
return !1;
|
|
572
576
|
}
|
|
573
577
|
}
|
|
574
|
-
function
|
|
578
|
+
function Ue({ label: e, onClick: t, disabled: n, className: r, children: i }) {
|
|
575
579
|
return /* @__PURE__ */ f("button", {
|
|
576
580
|
type: "button",
|
|
577
581
|
className: "absolute inset-0 z-[7] flex items-center justify-center outline-none focus-visible:[&>span]:ring-4 focus-visible:[&>span]:ring-white/60",
|
|
@@ -584,22 +588,22 @@ function Be({ label: e, onClick: t, disabled: n, className: r, children: i }) {
|
|
|
584
588
|
})
|
|
585
589
|
});
|
|
586
590
|
}
|
|
587
|
-
function
|
|
591
|
+
function We(e, t) {
|
|
588
592
|
let n = t ?? 0, r = e ?? n * .1;
|
|
589
593
|
return Math.max(0, n > 1 ? Math.min(r, n - 1) : 0);
|
|
590
594
|
}
|
|
591
|
-
function
|
|
595
|
+
function x(e) {
|
|
592
596
|
return `${e}p${e >= 2160 ? " 4K" : e === 1080 ? " HD" : ""}`;
|
|
593
597
|
}
|
|
594
|
-
function
|
|
595
|
-
let { t: a } =
|
|
598
|
+
function Ge({ children: e, icon: t, code: n, onRetry: r }) {
|
|
599
|
+
let { t: a } = i();
|
|
596
600
|
return /* @__PURE__ */ p("div", {
|
|
597
601
|
role: "alert",
|
|
598
602
|
"data-ckui": "player-error",
|
|
599
603
|
"data-ckui-noswipe": "",
|
|
600
604
|
className: "absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-black/80 p-6 text-center",
|
|
601
605
|
children: [
|
|
602
|
-
t && /* @__PURE__ */ f(
|
|
606
|
+
t && /* @__PURE__ */ f(g, {
|
|
603
607
|
icon: h,
|
|
604
608
|
className: "size-7 text-white/80",
|
|
605
609
|
strokeWidth: 1.75
|
|
@@ -608,12 +612,12 @@ function Ue({ children: e, icon: t, code: n, onRetry: i }) {
|
|
|
608
612
|
className: "max-w-sm text-sm font-medium text-balance",
|
|
609
613
|
children: e
|
|
610
614
|
}),
|
|
611
|
-
|
|
615
|
+
r && /* @__PURE__ */ p(o, {
|
|
612
616
|
size: "sm",
|
|
613
617
|
variant: "secondary",
|
|
614
|
-
onClick:
|
|
615
|
-
children: [/* @__PURE__ */ f(
|
|
616
|
-
icon:
|
|
618
|
+
onClick: r,
|
|
619
|
+
children: [/* @__PURE__ */ f(g, {
|
|
620
|
+
icon: Me,
|
|
617
621
|
"data-icon": "inline-start"
|
|
618
622
|
}), a("player.retry")]
|
|
619
623
|
}),
|
|
@@ -625,6 +629,6 @@ function Ue({ children: e, icon: t, code: n, onRetry: i }) {
|
|
|
625
629
|
});
|
|
626
630
|
}
|
|
627
631
|
//#endregion
|
|
628
|
-
export {
|
|
632
|
+
export { Pe as SpriteFrame, b as VideoPlayer, Be as keyAllowed, We as previewStartAt, x as qualityLabel, ze as trackLabel };
|
|
629
633
|
|
|
630
634
|
//# sourceMappingURL=video-player.js.map
|