@krizaka/ui 3.83.0 → 3.85.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/dist/app-header/search.js +1 -1
- package/dist/app-shell.js +16 -25
- package/dist/app-shell.js.map +1 -1
- package/dist/bird-plate.js +1 -1
- package/dist/card-grid.js +1 -1
- package/dist/{chunk-DJ5ZPPWL.js → chunk-7P7I5OQV.js} +2 -2
- package/dist/{chunk-27AWSJTK.js → chunk-EDQLPCM4.js} +2 -2
- package/dist/chunk-FYPYJ6MW.js +60 -0
- package/dist/chunk-FYPYJ6MW.js.map +1 -0
- package/dist/chunk-QHVV2JGF.js +144 -0
- package/dist/chunk-QHVV2JGF.js.map +1 -0
- package/dist/chunk-S2O4NSN5.js +72 -0
- package/dist/{chunk-GFRUTPGG.js.map → chunk-S2O4NSN5.js.map} +1 -1
- package/dist/chunk-TN5JJ6JI.js +60 -0
- package/dist/chunk-TN5JJ6JI.js.map +1 -0
- package/dist/{chunk-XVXFMVG3.js → chunk-TVLRE7S3.js} +2 -2
- package/dist/chunk-VYZFQE3P.js +518 -0
- package/dist/chunk-VYZFQE3P.js.map +1 -0
- package/dist/{chunk-7MQNG35Q.js → chunk-ZKKMYIDN.js} +3 -2
- package/dist/chunk-ZKKMYIDN.js.map +1 -0
- package/dist/code-block.js +2 -2
- package/dist/cover-hero.js +3 -3
- package/dist/filter-bar.d.ts +3 -3
- package/dist/flock.js +1 -1
- package/dist/grade-stamp.js +2 -2
- package/dist/map.d.ts +16 -2
- package/dist/map.js +20 -18
- package/dist/map.js.map +1 -1
- package/dist/mascot-quote.js +1 -1
- package/dist/media-carousel.d.ts +113 -0
- package/dist/media-carousel.js +122 -0
- package/dist/media-carousel.js.map +1 -0
- package/dist/media-player.d.ts +177 -0
- package/dist/media-player.js +14 -0
- package/dist/media-player.js.map +1 -0
- package/dist/motion.css +7 -0
- package/dist/player-lightbox-ETBQWDOT.js +148 -0
- package/dist/player-lightbox-ETBQWDOT.js.map +1 -0
- package/dist/rail-nav.js +3 -3
- package/dist/retro-tv-playlist.d.ts +2 -0
- package/dist/retro-tv.js +1 -1
- package/dist/{schema-CL7t7xqb.d.ts → schema-DgjBz7-8.d.ts} +1 -1
- package/dist/shop.d.ts +2 -2
- package/dist/site-cahier.js +4 -4
- package/dist/taped-photo.js +2 -2
- package/dist/toc.js +1 -1
- package/dist/versus-card.js +1 -1
- package/dist/video-player.d.ts +3 -1
- package/dist/video-player.js +1 -1
- package/dist/virtual.d.ts +3 -3
- package/dist/wall.js +2 -2
- package/package.json +32 -4
- package/registry/app-frame.json +1 -1
- package/registry/examples/map/full-screen.d.ts +4 -0
- package/registry/examples/map/full-screen.js +26 -0
- package/registry/examples/map/full-screen.tsx +27 -0
- package/registry/examples/media-gallery/carousel.d.ts +4 -0
- package/registry/examples/media-gallery/carousel.js +22 -0
- package/registry/examples/media-gallery/carousel.tsx +20 -0
- package/registry/examples/media-gallery/player.d.ts +4 -0
- package/registry/examples/media-gallery/player.js +15 -0
- package/registry/examples/media-gallery/player.tsx +13 -0
- package/registry/index.json +16 -12
- package/registry/map.json +31 -4
- package/registry/media-gallery.json +57 -6
- package/registry/nav-bar.json +1 -1
- package/registry/rail-nav.json +1 -1
- package/registry/retro-tv.json +14 -0
- package/registry/shop.json +1 -1
- package/registry/site-footer.json +1 -1
- package/registry/video-player.json +15 -1
- package/dist/chunk-7MQNG35Q.js.map +0 -1
- package/dist/chunk-GFRUTPGG.js +0 -43
- /package/dist/{chunk-DJ5ZPPWL.js.map → chunk-7P7I5OQV.js.map} +0 -0
- /package/dist/{chunk-27AWSJTK.js.map → chunk-EDQLPCM4.js.map} +0 -0
- /package/dist/{chunk-XVXFMVG3.js.map → chunk-TVLRE7S3.js.map} +0 -0
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
clamp,
|
|
4
|
+
formatClock,
|
|
5
|
+
playSafely,
|
|
6
|
+
useInView,
|
|
7
|
+
usePrefersReducedMotion
|
|
8
|
+
} from "./chunk-TN5JJ6JI.js";
|
|
9
|
+
import {
|
|
10
|
+
CaptionsGlyph,
|
|
11
|
+
FullscreenGlyph,
|
|
12
|
+
PauseGlyph,
|
|
13
|
+
PipGlyph,
|
|
14
|
+
PlayGlyph,
|
|
15
|
+
RetryGlyph,
|
|
16
|
+
VolumeGlyph
|
|
17
|
+
} from "./chunk-S2O4NSN5.js";
|
|
18
|
+
import {
|
|
19
|
+
twMergeConfig
|
|
20
|
+
} from "./chunk-NSLXEDIS.js";
|
|
21
|
+
|
|
22
|
+
// src/video-player/video-player.tsx
|
|
23
|
+
import * as React2 from "react";
|
|
24
|
+
import { tv as tv2 } from "tailwind-variants";
|
|
25
|
+
|
|
26
|
+
// src/slider/slider.tsx
|
|
27
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
28
|
+
import * as React from "react";
|
|
29
|
+
|
|
30
|
+
// src/tv.ts
|
|
31
|
+
import { createTV } from "tailwind-variants";
|
|
32
|
+
var tv = createTV({ twMergeConfig });
|
|
33
|
+
|
|
34
|
+
// src/slider/slider.tsx
|
|
35
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
36
|
+
var slider = tv({
|
|
37
|
+
slots: {
|
|
38
|
+
root: "flex flex-col gap-2 data-[orientation=vertical]:h-full data-[orientation=vertical]:items-center",
|
|
39
|
+
header: "flex items-baseline justify-between gap-3 text-xs font-semibold text-fg-secondary",
|
|
40
|
+
value: "font-mono text-[11px] tabular-nums text-fg-secondary",
|
|
41
|
+
control: "relative flex touch-none select-none items-center data-disabled:cursor-not-allowed data-disabled:opacity-40 data-[orientation=horizontal]:h-6 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-6 data-[orientation=vertical]:flex-col",
|
|
42
|
+
track: "relative grow overflow-hidden rounded-sm bg-surface-3 inset-shadow-well data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
43
|
+
range: "absolute rounded-sm data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full",
|
|
44
|
+
thumb: "group/thumb relative block h-5 w-5 cursor-grab rounded-full border-2 border-accent bg-fg-on-media shadow-raised transition-[box-shadow,scale] duration-150 hover:ring-4 hover:ring-accent/15 focus-visible:outline-hidden focus-visible:focus-ring active:scale-110 active:cursor-grabbing motion-reduce:transition-none motion-reduce:active:scale-100",
|
|
45
|
+
// The value over the thumb: shown while the thumb is hovered, focused or held.
|
|
46
|
+
bubble: "pointer-events-none absolute bottom-full left-1/2 mb-2.5 -translate-x-1/2 whitespace-nowrap rounded-lg bg-fg px-2 py-1 font-mono text-[11px] font-semibold tabular-nums text-surface-0 opacity-0 shadow-floating transition-opacity duration-150 after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-fg group-hover/thumb:opacity-100 group-focus-visible/thumb:opacity-100 group-active/thumb:opacity-100 data-[always]:opacity-100 motion-reduce:transition-none",
|
|
47
|
+
bubbleVertical: "bottom-auto left-full top-1/2 mb-0 ml-3 -translate-x-0 -translate-y-1/2 after:hidden",
|
|
48
|
+
ticks: "pointer-events-none absolute inset-0",
|
|
49
|
+
tick: "absolute rounded-sm bg-border-strong data-[on]:bg-on-accent/70 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-px data-[orientation=horizontal]:-translate-x-1/2 data-[orientation=horizontal]:-translate-y-1/2 data-[orientation=vertical]:left-1/2 data-[orientation=vertical]:h-px data-[orientation=vertical]:w-1 data-[orientation=vertical]:-translate-x-1/2 data-[orientation=vertical]:translate-y-1/2",
|
|
50
|
+
marks: "relative h-4 w-full text-[11px] font-medium tabular-nums text-fg-secondary",
|
|
51
|
+
mark: "absolute top-0 -translate-x-1/2 whitespace-nowrap first:translate-x-0 last:-translate-x-full"
|
|
52
|
+
},
|
|
53
|
+
variants: {
|
|
54
|
+
tone: {
|
|
55
|
+
/** The brand's signature: accent → accent-2, a glow under it. */
|
|
56
|
+
gradient: { range: "bg-linear-to-r from-accent to-accent-2 shadow-glow data-[orientation=vertical]:bg-linear-to-t" },
|
|
57
|
+
/** The accent alone. */
|
|
58
|
+
solid: { range: "bg-accent" }
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
md: {},
|
|
62
|
+
lg: {
|
|
63
|
+
track: "data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5",
|
|
64
|
+
thumb: "h-6 w-6",
|
|
65
|
+
control: "data-[orientation=horizontal]:h-8 data-[orientation=vertical]:w-8"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
defaultVariants: { tone: "gradient", size: "md" }
|
|
70
|
+
});
|
|
71
|
+
var toArray = (v) => v === void 0 ? void 0 : typeof v === "number" ? [v] : v;
|
|
72
|
+
function Slider({
|
|
73
|
+
value,
|
|
74
|
+
defaultValue,
|
|
75
|
+
onValueChange,
|
|
76
|
+
onValueCommit,
|
|
77
|
+
label,
|
|
78
|
+
thumbLabels,
|
|
79
|
+
formatValue = String,
|
|
80
|
+
showLabel,
|
|
81
|
+
floatingValue,
|
|
82
|
+
origin,
|
|
83
|
+
ticks,
|
|
84
|
+
marks,
|
|
85
|
+
tone,
|
|
86
|
+
size,
|
|
87
|
+
min = 0,
|
|
88
|
+
max = 100,
|
|
89
|
+
step = 1,
|
|
90
|
+
orientation = "horizontal",
|
|
91
|
+
className,
|
|
92
|
+
...props
|
|
93
|
+
}) {
|
|
94
|
+
const s = slider({ tone, size });
|
|
95
|
+
const range = Array.isArray(value ?? defaultValue);
|
|
96
|
+
const vertical = orientation === "vertical";
|
|
97
|
+
const [inner, setInner] = React.useState(() => toArray(defaultValue) ?? [min]);
|
|
98
|
+
const current = toArray(value) ?? inner;
|
|
99
|
+
const out = (next) => range ? next : next[0];
|
|
100
|
+
const pct = (v) => (v - min) / (max - min || 1) * 100;
|
|
101
|
+
const fill = origin !== void 0 && !range && !vertical ? { left: `${Math.min(pct(origin), pct(current[0]))}%`, right: `${100 - Math.max(pct(origin), pct(current[0]))}%` } : void 0;
|
|
102
|
+
const lo = range ? Math.min(...current) : origin ?? min;
|
|
103
|
+
const hi = range ? Math.max(...current) : current[0];
|
|
104
|
+
const tickValues = ticks === true ? (max - min) / step <= 40 ? Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step) : [] : ticks ? [...ticks] : [];
|
|
105
|
+
const id = React.useId();
|
|
106
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), "data-range": range ? "" : void 0, "data-orientation": orientation, children: [
|
|
107
|
+
showLabel && /* @__PURE__ */ jsxs("div", { className: s.header(), children: [
|
|
108
|
+
/* @__PURE__ */ jsx("span", { id: `${id}-label`, children: label }),
|
|
109
|
+
/* @__PURE__ */ jsx("span", { className: s.value(), "aria-hidden": true, children: current.map(formatValue).join(" \u2013 ") })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ jsxs(
|
|
112
|
+
SliderPrimitive.Root,
|
|
113
|
+
{
|
|
114
|
+
min,
|
|
115
|
+
max,
|
|
116
|
+
step,
|
|
117
|
+
orientation,
|
|
118
|
+
value: current,
|
|
119
|
+
onValueChange: (next) => {
|
|
120
|
+
if (value === void 0) setInner(next);
|
|
121
|
+
onValueChange?.(out(next));
|
|
122
|
+
},
|
|
123
|
+
onValueCommit: onValueCommit && ((next) => onValueCommit(out(next))),
|
|
124
|
+
className: s.control(),
|
|
125
|
+
...props,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsxs(SliderPrimitive.Track, { className: s.track(), children: [
|
|
128
|
+
fill ? /* @__PURE__ */ jsx("span", { "data-origin": "", "data-orientation": orientation, className: s.range(), style: fill }) : /* @__PURE__ */ jsx(SliderPrimitive.Range, { className: s.range() }),
|
|
129
|
+
tickValues.length ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: s.ticks(), children: tickValues.map((t) => /* @__PURE__ */ jsx(
|
|
130
|
+
"span",
|
|
131
|
+
{
|
|
132
|
+
"data-orientation": orientation,
|
|
133
|
+
"data-on": t > lo && t < hi ? "" : void 0,
|
|
134
|
+
className: s.tick(),
|
|
135
|
+
style: vertical ? { bottom: `${pct(t)}%` } : { left: `${pct(t)}%` }
|
|
136
|
+
},
|
|
137
|
+
t
|
|
138
|
+
)) }) : null
|
|
139
|
+
] }),
|
|
140
|
+
current.map((v, i) => /* @__PURE__ */ jsx(
|
|
141
|
+
SliderPrimitive.Thumb,
|
|
142
|
+
{
|
|
143
|
+
"aria-label": range ? thumbLabels?.[i] ?? label : showLabel ? void 0 : label,
|
|
144
|
+
"aria-labelledby": !range && showLabel ? `${id}-label` : void 0,
|
|
145
|
+
"aria-valuetext": formatValue(v),
|
|
146
|
+
className: s.thumb(),
|
|
147
|
+
children: floatingValue ? /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-always": floatingValue === "always" ? "" : void 0, className: s.bubble({ className: vertical ? s.bubbleVertical() : void 0 }), children: formatValue(v) }) : null
|
|
148
|
+
},
|
|
149
|
+
i
|
|
150
|
+
))
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
marks?.length && !vertical ? /* @__PURE__ */ jsx("div", { "aria-hidden": true, className: s.marks(), children: marks.map((m) => /* @__PURE__ */ jsx("span", { className: s.mark(), style: { left: `${pct(m.value)}%` }, children: m.label }, m.value)) }) : null
|
|
155
|
+
] });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// src/video-player/video-player.tsx
|
|
159
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
160
|
+
var videoPlayer = tv2({
|
|
161
|
+
slots: {
|
|
162
|
+
root: "theme-dark group/player relative isolate w-full overflow-hidden rounded-xl bg-media text-fg-on-media focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[idle]:cursor-none",
|
|
163
|
+
video: "absolute inset-0 h-full w-full object-contain",
|
|
164
|
+
poster: "pointer-events-none absolute inset-0 h-full w-full object-contain",
|
|
165
|
+
big: "absolute left-1/2 top-1/2 z-10 inline-flex h-16 w-16 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full bg-scrim-strong text-fg-on-media shadow-lg backdrop-blur-sm transition-colors hover:bg-scrim motion-reduce:transition-none focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
166
|
+
bar: "absolute inset-x-0 bottom-0 z-20 flex flex-col gap-1 bg-linear-to-t from-scrim-strong via-scrim to-transparent px-3 pb-2 pt-10 transition-opacity duration-300 motion-reduce:transition-none group-data-[idle]/player:opacity-0 group-focus-within/player:opacity-100",
|
|
167
|
+
row: "flex flex-wrap items-center gap-1",
|
|
168
|
+
button: "inline-flex h-9 min-w-9 shrink-0 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-semibold text-fg-on-media transition-colors hover:bg-fg-on-media/15 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:bg-fg-on-media/20",
|
|
169
|
+
time: "px-1.5 font-mono text-[11px] tabular-nums text-fg-on-media",
|
|
170
|
+
volume: "hidden w-20 items-center sm:flex",
|
|
171
|
+
status: "absolute inset-0 z-30 flex flex-col items-center justify-center gap-3 bg-scrim-strong p-6 text-center text-sm",
|
|
172
|
+
spinner: "h-10 w-10 animate-spin rounded-full border-2 border-fg-on-media/30 border-t-fg-on-media motion-reduce:animate-none",
|
|
173
|
+
overlay: "absolute inset-0 z-30"
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
var videoPlayerLabels = {
|
|
177
|
+
play: "Play",
|
|
178
|
+
pause: "Pause",
|
|
179
|
+
mute: "Mute",
|
|
180
|
+
unmute: "Unmute",
|
|
181
|
+
volume: "Volume",
|
|
182
|
+
seek: "Seek",
|
|
183
|
+
speed: (rate) => `Speed ${rate}\xD7`,
|
|
184
|
+
captions: (track) => `Subtitles: ${track ?? "off"}`,
|
|
185
|
+
fullscreen: "Full screen",
|
|
186
|
+
exitFullscreen: "Exit full screen",
|
|
187
|
+
pictureInPicture: "Picture in picture",
|
|
188
|
+
loading: "Loading",
|
|
189
|
+
error: "This video cannot be played.",
|
|
190
|
+
retry: "Try again",
|
|
191
|
+
time: (time, duration) => `${time} of ${duration}`
|
|
192
|
+
};
|
|
193
|
+
var RATES = [0.5, 1, 1.25, 1.5, 2];
|
|
194
|
+
var isHls = (url, type) => type === "hls" || type !== "file" && /\.m3u8(\?|#|$)/i.test(url);
|
|
195
|
+
function showTrack(element, index) {
|
|
196
|
+
const list = element.textTracks;
|
|
197
|
+
for (let i = 0; i < list.length; i += 1) list[i].mode = i === index ? "showing" : "disabled";
|
|
198
|
+
}
|
|
199
|
+
function VideoPlayer({
|
|
200
|
+
src,
|
|
201
|
+
type = "auto",
|
|
202
|
+
loadHls,
|
|
203
|
+
title,
|
|
204
|
+
poster,
|
|
205
|
+
autoPlay,
|
|
206
|
+
muted: initiallyMuted = false,
|
|
207
|
+
playOnMount = false,
|
|
208
|
+
loop,
|
|
209
|
+
preload = "metadata",
|
|
210
|
+
tracks = [],
|
|
211
|
+
playbackRates = RATES,
|
|
212
|
+
pauseWhenHidden = true,
|
|
213
|
+
controls = true,
|
|
214
|
+
overlay,
|
|
215
|
+
aspectRatio = "16 / 9",
|
|
216
|
+
onPlay,
|
|
217
|
+
onPause,
|
|
218
|
+
onEnded,
|
|
219
|
+
onTimeUpdate,
|
|
220
|
+
onError,
|
|
221
|
+
labels: given,
|
|
222
|
+
className
|
|
223
|
+
}) {
|
|
224
|
+
const labels = { ...videoPlayerLabels, ...given };
|
|
225
|
+
const s = videoPlayer();
|
|
226
|
+
const root = React2.useRef(null);
|
|
227
|
+
const video = React2.useRef(null);
|
|
228
|
+
const reduce = usePrefersReducedMotion();
|
|
229
|
+
const [resolved, setResolved] = React2.useState(null);
|
|
230
|
+
const [attempt, setAttempt] = React2.useState(0);
|
|
231
|
+
const [wanted, setWanted] = React2.useState(playOnMount);
|
|
232
|
+
const [playing, setPlaying] = React2.useState(false);
|
|
233
|
+
const [time, setTime] = React2.useState(0);
|
|
234
|
+
const [duration, setDuration] = React2.useState(0);
|
|
235
|
+
const [volume, setVolume] = React2.useState(1);
|
|
236
|
+
const [muted, setMuted] = React2.useState(initiallyMuted || Boolean(autoPlay));
|
|
237
|
+
const [rate, setRate] = React2.useState(1);
|
|
238
|
+
const [caption, setCaption] = React2.useState(() => tracks.findIndex((t) => t.default));
|
|
239
|
+
const [fullscreen, setFullscreen] = React2.useState(false);
|
|
240
|
+
const [waiting, setWaiting] = React2.useState(false);
|
|
241
|
+
const [failed, setFailed] = React2.useState(false);
|
|
242
|
+
const [idle, setIdle] = React2.useState(false);
|
|
243
|
+
const [started, setStarted] = React2.useState(false);
|
|
244
|
+
const idleTimer = React2.useRef(void 0);
|
|
245
|
+
const url = typeof src === "string" ? src : resolved?.attempt === attempt ? resolved.url : null;
|
|
246
|
+
const needSource = typeof src === "function" && (preload !== "none" || wanted || autoPlay && !reduce);
|
|
247
|
+
React2.useEffect(() => {
|
|
248
|
+
if (typeof src !== "function" || !needSource) return;
|
|
249
|
+
let live = true;
|
|
250
|
+
src().then(
|
|
251
|
+
(next) => live && setResolved({ attempt, url: next }),
|
|
252
|
+
(error) => {
|
|
253
|
+
if (!live) return;
|
|
254
|
+
setFailed(true);
|
|
255
|
+
onError?.(error);
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
return () => {
|
|
259
|
+
live = false;
|
|
260
|
+
};
|
|
261
|
+
}, [src, needSource, attempt]);
|
|
262
|
+
React2.useEffect(() => {
|
|
263
|
+
const element = video.current;
|
|
264
|
+
if (!element || !url) return;
|
|
265
|
+
let hls = null;
|
|
266
|
+
let live = true;
|
|
267
|
+
const fail = (error) => {
|
|
268
|
+
if (!live) return;
|
|
269
|
+
setFailed(true);
|
|
270
|
+
onError?.(error);
|
|
271
|
+
};
|
|
272
|
+
if (isHls(url, type) && !element.canPlayType("application/vnd.apple.mpegurl")) {
|
|
273
|
+
if (!loadHls) fail(new Error("VideoPlayer: HLS needs `loadHls` in this browser."));
|
|
274
|
+
else
|
|
275
|
+
loadHls().then(({ default: Hls }) => {
|
|
276
|
+
if (!live) return;
|
|
277
|
+
if (!Hls.isSupported()) return fail(new Error("VideoPlayer: HLS is not supported here."));
|
|
278
|
+
hls = new Hls({ enableWorker: true, backBufferLength: 60 });
|
|
279
|
+
hls.on(Hls.Events.ERROR, (_event, data) => {
|
|
280
|
+
if (!data.fatal) return;
|
|
281
|
+
if (data.type === Hls.ErrorTypes.NETWORK_ERROR) hls?.startLoad();
|
|
282
|
+
else if (data.type === Hls.ErrorTypes.MEDIA_ERROR) hls?.recoverMediaError();
|
|
283
|
+
else fail(data);
|
|
284
|
+
});
|
|
285
|
+
hls.loadSource(url);
|
|
286
|
+
hls.attachMedia(element);
|
|
287
|
+
}, fail);
|
|
288
|
+
} else element.src = url;
|
|
289
|
+
return () => {
|
|
290
|
+
live = false;
|
|
291
|
+
hls?.destroy();
|
|
292
|
+
};
|
|
293
|
+
}, [url, type]);
|
|
294
|
+
const [inView, setInView] = React2.useState(() => !pauseWhenHidden || typeof IntersectionObserver === "undefined");
|
|
295
|
+
React2.useEffect(() => {
|
|
296
|
+
const element = video.current;
|
|
297
|
+
if (!element || !url || !wanted) return;
|
|
298
|
+
playSafely(element);
|
|
299
|
+
}, [url, wanted]);
|
|
300
|
+
React2.useEffect(() => {
|
|
301
|
+
const element = video.current;
|
|
302
|
+
if (!element || !url || !autoPlay || reduce || !inView) return;
|
|
303
|
+
playSafely(element);
|
|
304
|
+
}, [url, autoPlay, reduce, inView]);
|
|
305
|
+
React2.useEffect(() => {
|
|
306
|
+
if (video.current) showTrack(video.current, caption);
|
|
307
|
+
}, [caption, tracks.length]);
|
|
308
|
+
React2.useEffect(() => {
|
|
309
|
+
const change = () => setFullscreen(document.fullscreenElement === root.current);
|
|
310
|
+
document.addEventListener("fullscreenchange", change);
|
|
311
|
+
return () => document.removeEventListener("fullscreenchange", change);
|
|
312
|
+
}, []);
|
|
313
|
+
React2.useEffect(() => () => clearTimeout(idleTimer.current), []);
|
|
314
|
+
useInView(
|
|
315
|
+
root,
|
|
316
|
+
(visible) => {
|
|
317
|
+
setInView(visible);
|
|
318
|
+
if (!visible && video.current && !video.current.paused) video.current.pause();
|
|
319
|
+
},
|
|
320
|
+
pauseWhenHidden
|
|
321
|
+
);
|
|
322
|
+
const play = () => {
|
|
323
|
+
setWanted(true);
|
|
324
|
+
setFailed(false);
|
|
325
|
+
playSafely(video.current);
|
|
326
|
+
};
|
|
327
|
+
const toggle = () => playing ? video.current?.pause() : play();
|
|
328
|
+
const seek = (to) => {
|
|
329
|
+
if (!video.current) return;
|
|
330
|
+
video.current.currentTime = clamp(to, 0, duration || video.current.duration || 0);
|
|
331
|
+
setTime(video.current.currentTime);
|
|
332
|
+
};
|
|
333
|
+
const changeVolume = (to) => {
|
|
334
|
+
if (!video.current) return;
|
|
335
|
+
const next = clamp(to, 0, 1);
|
|
336
|
+
video.current.volume = next;
|
|
337
|
+
video.current.muted = next === 0;
|
|
338
|
+
setVolume(next);
|
|
339
|
+
setMuted(next === 0);
|
|
340
|
+
};
|
|
341
|
+
const toggleMute = () => {
|
|
342
|
+
if (!video.current) return;
|
|
343
|
+
if (muted && volume === 0) changeVolume(0.5);
|
|
344
|
+
video.current.muted = !muted;
|
|
345
|
+
setMuted(!muted);
|
|
346
|
+
};
|
|
347
|
+
const cycleRate = () => {
|
|
348
|
+
const next = playbackRates[(playbackRates.indexOf(rate) + 1) % playbackRates.length] ?? 1;
|
|
349
|
+
if (video.current) video.current.playbackRate = next;
|
|
350
|
+
setRate(next);
|
|
351
|
+
};
|
|
352
|
+
const cycleCaption = () => tracks.length > 0 && setCaption((c) => (c + 2) % (tracks.length + 1) - 1);
|
|
353
|
+
const toggleFullscreen = () => {
|
|
354
|
+
const element = root.current;
|
|
355
|
+
if (!element) return;
|
|
356
|
+
if (document.fullscreenElement) void document.exitFullscreen();
|
|
357
|
+
else if (element.requestFullscreen) void element.requestFullscreen();
|
|
358
|
+
else video.current?.webkitEnterFullscreen?.();
|
|
359
|
+
};
|
|
360
|
+
const pip = () => {
|
|
361
|
+
if (document.pictureInPictureElement) void document.exitPictureInPicture();
|
|
362
|
+
else void video.current?.requestPictureInPicture?.();
|
|
363
|
+
};
|
|
364
|
+
const wake = () => {
|
|
365
|
+
setIdle(false);
|
|
366
|
+
clearTimeout(idleTimer.current);
|
|
367
|
+
if (playing) idleTimer.current = setTimeout(() => setIdle(true), 2500);
|
|
368
|
+
};
|
|
369
|
+
const onKeyDown = (event) => {
|
|
370
|
+
const target = event.target;
|
|
371
|
+
const inControl = target.getAttribute("role") === "slider";
|
|
372
|
+
const key = event.key.length === 1 ? event.key.toLowerCase() : event.key;
|
|
373
|
+
const now = video.current?.currentTime ?? 0;
|
|
374
|
+
const actions = {
|
|
375
|
+
" ": target.tagName === "BUTTON" ? void 0 : toggle,
|
|
376
|
+
k: toggle,
|
|
377
|
+
j: () => seek(now - 10),
|
|
378
|
+
l: () => seek(now + 10),
|
|
379
|
+
m: toggleMute,
|
|
380
|
+
f: toggleFullscreen,
|
|
381
|
+
c: tracks.length ? cycleCaption : void 0,
|
|
382
|
+
ArrowLeft: inControl ? void 0 : () => seek(now - 5),
|
|
383
|
+
ArrowRight: inControl ? void 0 : () => seek(now + 5),
|
|
384
|
+
ArrowUp: inControl ? void 0 : () => changeVolume(volume + 0.1),
|
|
385
|
+
ArrowDown: inControl ? void 0 : () => changeVolume(volume - 0.1),
|
|
386
|
+
Home: inControl ? void 0 : () => seek(0),
|
|
387
|
+
End: inControl ? void 0 : () => seek(duration)
|
|
388
|
+
};
|
|
389
|
+
const action = /^[0-9]$/.test(key) && !inControl ? () => seek(Number(key) / 10 * duration) : actions[key];
|
|
390
|
+
if (!action || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
391
|
+
event.preventDefault();
|
|
392
|
+
action();
|
|
393
|
+
wake();
|
|
394
|
+
};
|
|
395
|
+
const showControls = controls && !overlay;
|
|
396
|
+
const pipSupported = typeof document !== "undefined" && "pictureInPictureEnabled" in document && document.pictureInPictureEnabled;
|
|
397
|
+
return /* @__PURE__ */ jsxs2(
|
|
398
|
+
"div",
|
|
399
|
+
{
|
|
400
|
+
ref: root,
|
|
401
|
+
role: "region",
|
|
402
|
+
"aria-label": title,
|
|
403
|
+
tabIndex: showControls ? 0 : void 0,
|
|
404
|
+
"data-idle": idle && playing ? "" : void 0,
|
|
405
|
+
"data-state": playing ? "playing" : "paused",
|
|
406
|
+
className: s.root({ className }),
|
|
407
|
+
style: { aspectRatio },
|
|
408
|
+
onKeyDown: showControls ? onKeyDown : void 0,
|
|
409
|
+
onPointerMove: showControls ? wake : void 0,
|
|
410
|
+
onPointerLeave: () => playing && setIdle(true),
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ jsx2(
|
|
413
|
+
"video",
|
|
414
|
+
{
|
|
415
|
+
ref: video,
|
|
416
|
+
className: s.video(),
|
|
417
|
+
preload,
|
|
418
|
+
loop,
|
|
419
|
+
muted,
|
|
420
|
+
playsInline: true,
|
|
421
|
+
crossOrigin: tracks.length ? "anonymous" : void 0,
|
|
422
|
+
onClick: showControls ? toggle : void 0,
|
|
423
|
+
onPlay: () => {
|
|
424
|
+
setStarted(true);
|
|
425
|
+
setPlaying(true);
|
|
426
|
+
wake();
|
|
427
|
+
onPlay?.();
|
|
428
|
+
},
|
|
429
|
+
onPause: () => {
|
|
430
|
+
setPlaying(false);
|
|
431
|
+
setIdle(false);
|
|
432
|
+
onPause?.();
|
|
433
|
+
},
|
|
434
|
+
onEnded: () => onEnded?.(),
|
|
435
|
+
onTimeUpdate: (event) => {
|
|
436
|
+
setTime(event.currentTarget.currentTime);
|
|
437
|
+
onTimeUpdate?.(event.currentTarget.currentTime);
|
|
438
|
+
},
|
|
439
|
+
onDurationChange: (event) => setDuration(Number.isFinite(event.currentTarget.duration) ? event.currentTarget.duration : 0),
|
|
440
|
+
onWaiting: () => setWaiting(true),
|
|
441
|
+
onPlaying: () => setWaiting(false),
|
|
442
|
+
onCanPlay: () => setWaiting(false),
|
|
443
|
+
onError: (event) => {
|
|
444
|
+
setFailed(true);
|
|
445
|
+
onError?.(event.currentTarget.error);
|
|
446
|
+
},
|
|
447
|
+
children: tracks.map((track) => /* @__PURE__ */ jsx2("track", { src: track.src, srcLang: track.srcLang, label: track.label, kind: track.kind ?? "subtitles", default: track.default }, track.src))
|
|
448
|
+
}
|
|
449
|
+
),
|
|
450
|
+
poster && !started ? /* @__PURE__ */ jsx2("img", { src: poster, alt: "", "aria-hidden": true, decoding: "async", className: s.poster() }) : null,
|
|
451
|
+
showControls && !playing && !failed && !waiting && /* @__PURE__ */ jsx2("button", { type: "button", className: s.big(), "aria-label": labels.play, onClick: play, children: /* @__PURE__ */ jsx2(PlayGlyph, { className: "ml-1 h-7 w-7" }) }),
|
|
452
|
+
waiting && !failed && /* @__PURE__ */ jsxs2("div", { className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center", children: [
|
|
453
|
+
/* @__PURE__ */ jsx2("span", { className: s.spinner(), "aria-hidden": true }),
|
|
454
|
+
/* @__PURE__ */ jsx2("span", { role: "status", className: "sr-only", children: labels.loading })
|
|
455
|
+
] }),
|
|
456
|
+
failed && /* @__PURE__ */ jsxs2("div", { role: "alert", className: s.status(), children: [
|
|
457
|
+
/* @__PURE__ */ jsx2("p", { children: labels.error }),
|
|
458
|
+
/* @__PURE__ */ jsxs2(
|
|
459
|
+
"button",
|
|
460
|
+
{
|
|
461
|
+
type: "button",
|
|
462
|
+
className: s.button({ className: "border border-fg-on-media/40 px-3" }),
|
|
463
|
+
onClick: () => {
|
|
464
|
+
setFailed(false);
|
|
465
|
+
setAttempt((a) => a + 1);
|
|
466
|
+
video.current?.load();
|
|
467
|
+
},
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx2(RetryGlyph, { className: "h-4 w-4" }),
|
|
470
|
+
labels.retry
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
)
|
|
474
|
+
] }),
|
|
475
|
+
overlay ? /* @__PURE__ */ jsx2("div", { className: s.overlay(), children: overlay }) : null,
|
|
476
|
+
showControls && /* @__PURE__ */ jsxs2("div", { className: s.bar(), children: [
|
|
477
|
+
/* @__PURE__ */ jsx2(
|
|
478
|
+
Slider,
|
|
479
|
+
{
|
|
480
|
+
label: labels.seek,
|
|
481
|
+
min: 0,
|
|
482
|
+
max: duration || 1,
|
|
483
|
+
step: 0.1,
|
|
484
|
+
value: Math.min(time, duration || 1),
|
|
485
|
+
onValueChange: seek,
|
|
486
|
+
formatValue: (v) => labels.time(formatClock(v), formatClock(duration)),
|
|
487
|
+
disabled: !duration,
|
|
488
|
+
className: "[&_[role=slider]]:h-4 [&_[role=slider]]:w-4"
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
/* @__PURE__ */ jsxs2("div", { className: s.row(), children: [
|
|
492
|
+
/* @__PURE__ */ jsx2("button", { type: "button", className: s.button(), "aria-label": playing ? labels.pause : labels.play, onClick: toggle, children: playing ? /* @__PURE__ */ jsx2(PauseGlyph, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx2(PlayGlyph, { className: "h-5 w-5" }) }),
|
|
493
|
+
/* @__PURE__ */ jsx2("button", { type: "button", className: s.button(), "aria-label": muted ? labels.unmute : labels.mute, onClick: toggleMute, children: /* @__PURE__ */ jsx2(VolumeGlyph, { muted, className: "h-5 w-5" }) }),
|
|
494
|
+
/* @__PURE__ */ jsx2("div", { className: s.volume(), children: /* @__PURE__ */ jsx2(Slider, { label: labels.volume, min: 0, max: 1, step: 0.05, value: muted ? 0 : volume, onValueChange: changeVolume, formatValue: (v) => `${Math.round(v * 100)} %`, className: "w-full" }) }),
|
|
495
|
+
/* @__PURE__ */ jsxs2("span", { className: s.time(), "aria-hidden": true, children: [
|
|
496
|
+
formatClock(time),
|
|
497
|
+
" / ",
|
|
498
|
+
formatClock(duration)
|
|
499
|
+
] }),
|
|
500
|
+
/* @__PURE__ */ jsx2("span", { className: "flex-1" }),
|
|
501
|
+
playbackRates.length > 1 && /* @__PURE__ */ jsxs2("button", { type: "button", className: s.button(), "aria-label": labels.speed(rate), onClick: cycleRate, children: [
|
|
502
|
+
rate,
|
|
503
|
+
"\xD7"
|
|
504
|
+
] }),
|
|
505
|
+
tracks.length > 0 && /* @__PURE__ */ jsx2("button", { type: "button", className: s.button(), "aria-pressed": caption >= 0, "aria-label": labels.captions(caption >= 0 ? tracks[caption]?.label ?? null : null), onClick: cycleCaption, children: /* @__PURE__ */ jsx2(CaptionsGlyph, { className: "h-5 w-5" }) }),
|
|
506
|
+
pipSupported && /* @__PURE__ */ jsx2("button", { type: "button", className: s.button(), "aria-label": labels.pictureInPicture, onClick: pip, children: /* @__PURE__ */ jsx2(PipGlyph, { className: "h-5 w-5" }) }),
|
|
507
|
+
/* @__PURE__ */ jsx2("button", { type: "button", className: s.button(), "aria-label": fullscreen ? labels.exitFullscreen : labels.fullscreen, onClick: toggleFullscreen, children: /* @__PURE__ */ jsx2(FullscreenGlyph, { exit: fullscreen, className: "h-5 w-5" }) })
|
|
508
|
+
] })
|
|
509
|
+
] })
|
|
510
|
+
]
|
|
511
|
+
}
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export {
|
|
516
|
+
VideoPlayer
|
|
517
|
+
};
|
|
518
|
+
//# sourceMappingURL=chunk-VYZFQE3P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/video-player/video-player.tsx","../src/slider/slider.tsx","../src/tv.ts"],"sourcesContent":["// Client. A `<video>` with its own controls, accessible from end to end: a named region the keyboard reaches (Space /\n// K, arrows, J / L, M, F, C, Home / End, 0–9), every button named by a prop, the seek and volume sliders of\n// `@krizaka/ui/slider` with the time read aloud. HLS plays natively where the browser can (Safari, iOS) and through\n// hls.js elsewhere — loaded only then, by the app's `loadHls` (`() => import(\"hls.js\")`): an optional peer, never in\n// the bundle of a page that does not play HLS. A signed address can be resolved at the last moment (`src` as a\n// function), again after an error; the video pauses when it leaves the screen; autoplay waits under reduced motion.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CaptionsGlyph, FullscreenGlyph, PauseGlyph, PipGlyph, PlayGlyph, RetryGlyph, VolumeGlyph } from \"../glyphs\";\nimport { clamp, formatClock, playSafely, useInView, usePrefersReducedMotion } from \"../media\";\nimport { Slider } from \"../slider\";\n\nexport const videoPlayer = tv({\n slots: {\n root:\n \"theme-dark group/player relative isolate w-full overflow-hidden rounded-xl bg-media text-fg-on-media \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[idle]:cursor-none\",\n video: \"absolute inset-0 h-full w-full object-contain\",\n poster: \"pointer-events-none absolute inset-0 h-full w-full object-contain\",\n big:\n \"absolute left-1/2 top-1/2 z-10 inline-flex h-16 w-16 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full \" +\n \"bg-scrim-strong text-fg-on-media shadow-lg backdrop-blur-sm transition-colors hover:bg-scrim motion-reduce:transition-none \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n bar:\n \"absolute inset-x-0 bottom-0 z-20 flex flex-col gap-1 bg-linear-to-t from-scrim-strong via-scrim to-transparent px-3 pb-2 pt-10 \" +\n \"transition-opacity duration-300 motion-reduce:transition-none group-data-[idle]/player:opacity-0 group-focus-within/player:opacity-100\",\n row: \"flex flex-wrap items-center gap-1\",\n button:\n \"inline-flex h-9 min-w-9 shrink-0 items-center justify-center gap-1 rounded-md px-1.5 text-xs font-semibold text-fg-on-media \" +\n \"transition-colors hover:bg-fg-on-media/15 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:bg-fg-on-media/20\",\n time: \"px-1.5 font-mono text-[11px] tabular-nums text-fg-on-media\",\n volume: \"hidden w-20 items-center sm:flex\",\n status: \"absolute inset-0 z-30 flex flex-col items-center justify-center gap-3 bg-scrim-strong p-6 text-center text-sm\",\n spinner: \"h-10 w-10 animate-spin rounded-full border-2 border-fg-on-media/30 border-t-fg-on-media motion-reduce:animate-none\",\n overlay: \"absolute inset-0 z-30\",\n },\n});\n\n/** What `loadHls` resolves to: the module of hls.js (only the members the player uses are typed). */\nexport type HlsModule = {\n default: {\n new (config?: Record<string, unknown>): {\n loadSource(url: string): void;\n attachMedia(media: HTMLMediaElement): void;\n destroy(): void;\n startLoad(): void;\n recoverMediaError(): void;\n on(event: string, listener: (event: string, data: { fatal?: boolean; type?: string }) => void): void;\n };\n isSupported(): boolean;\n Events: { ERROR: string };\n ErrorTypes: { NETWORK_ERROR: string; MEDIA_ERROR: string };\n };\n};\n\nexport type VideoTrack = {\n /** The WebVTT file. */\n src: string;\n /** Its language, BCP 47 (`\"fr\"`). */\n srcLang: string;\n /** Its name in the menu (\"Français\"), passed translated. */\n label: string;\n /** `subtitles` (default) or `captions` (with the sounds, for deaf viewers). */\n kind?: \"subtitles\" | \"captions\";\n /** Shown from the start. */\n default?: boolean;\n};\n\nexport type VideoPlayerLabels = {\n play: string;\n pause: string;\n mute: string;\n unmute: string;\n volume: string;\n seek: string;\n /** The speed button: `(rate) => \"Speed \" + rate + \"×\"`. */\n speed: (rate: number) => string;\n /** The captions button: `(track) => \"Subtitles: \" + (track ?? \"off\")`, the track's label or `null` when off. */\n captions: (track: string | null) => string;\n fullscreen: string;\n exitFullscreen: string;\n pictureInPicture: string;\n /** Read while the video waits for data. */\n loading: string;\n /** The video cannot play. */\n error: string;\n /** Tries again (resolves a signed `src` again). */\n retry: string;\n /** The seek slider's value: `(time, duration) => \"1:05 of 3:20\"`. */\n time: (time: string, duration: string) => string;\n};\n\nexport const videoPlayerLabels: VideoPlayerLabels = {\n play: \"Play\",\n pause: \"Pause\",\n mute: \"Mute\",\n unmute: \"Unmute\",\n volume: \"Volume\",\n seek: \"Seek\",\n speed: (rate) => `Speed ${rate}×`,\n captions: (track) => `Subtitles: ${track ?? \"off\"}`,\n fullscreen: \"Full screen\",\n exitFullscreen: \"Exit full screen\",\n pictureInPicture: \"Picture in picture\",\n loading: \"Loading\",\n error: \"This video cannot be played.\",\n retry: \"Try again\",\n time: (time, duration) => `${time} of ${duration}`,\n};\n\nexport type VideoPlayerProps = {\n /** The address of the video (MP4, WebM, or an HLS `.m3u8`), or a function that resolves a signed one when needed. */\n src: string | (() => Promise<string>);\n /** `auto` (default): HLS when the address ends in `.m3u8`. */\n type?: \"auto\" | \"hls\" | \"file\";\n /** Loads hls.js when the browser cannot play HLS itself: `() => import(\"hls.js\")`. Without it, HLS needs Safari. */\n loadHls?: () => Promise<HlsModule>;\n /** The accessible name of the player (\"Video: Sunset over Montréal\"), passed translated. */\n title: string;\n /** The picture shown before playback. */\n poster?: string;\n /** Starts playing, muted (browsers refuse sound without a gesture), once on screen and again each time it comes back — not under reduced motion. */\n autoPlay?: boolean;\n /** Starts muted. */\n muted?: boolean;\n /** Starts playing as soon as it mounts, with sound: for a player opened by a press (a lightbox), never for one that was already on the page. */\n playOnMount?: boolean;\n /** Plays again from the start at the end. */\n loop?: boolean;\n /** How much to fetch before playback: `none` (a list of many videos), `metadata` (default), `auto`. */\n preload?: \"none\" | \"metadata\" | \"auto\";\n /** Subtitles or captions (WebVTT): the C key and a button cycle through them. */\n tracks?: readonly VideoTrack[];\n /** The speeds offered by the speed button. Default `[0.5, 1, 1.25, 1.5, 2]`. */\n playbackRates?: readonly number[];\n /** Pauses when less than a quarter of the player is on screen. Default `true`. */\n pauseWhenHidden?: boolean;\n /** Shows the controls (default). `false`: a bare video (a background loop) — give it no sound. */\n controls?: boolean;\n /** Covers the video and hides the controls: a gate (sign in, unlock, age check) drawn by the app. */\n overlay?: React.ReactNode;\n /** The width / height ratio of the frame. Default `\"16 / 9\"`; `\"9 / 16\"` for a vertical video. */\n aspectRatio?: string;\n /** Called when playback starts. */\n onPlay?: () => void;\n /** Called when playback pauses. */\n onPause?: () => void;\n /** Called at the end. */\n onEnded?: () => void;\n /** Called as the time moves, in seconds (a few times a second). */\n onTimeUpdate?: (time: number) => void;\n /** Called when the video cannot play (a network failure, an expired address). */\n onError?: (error: unknown) => void;\n /** The words, passed translated; English by default. */\n labels?: Partial<VideoPlayerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nconst RATES = [0.5, 1, 1.25, 1.5, 2] as const;\nconst isHls = (url: string, type: VideoPlayerProps[\"type\"]) => type === \"hls\" || (type !== \"file\" && /\\.m3u8(\\?|#|$)/i.test(url));\n\n/** Shows the text track `index` of a video (and hides the others); -1 hides them all. */\nfunction showTrack(element: HTMLVideoElement, index: number) {\n const list = element.textTracks;\n for (let i = 0; i < list.length; i += 1) list[i]!.mode = i === index ? \"showing\" : \"disabled\";\n}\n\n/** A video player with accessible controls, HLS on demand, signed sources, subtitles, speed, full screen. */\nexport function VideoPlayer({\n src,\n type = \"auto\",\n loadHls,\n title,\n poster,\n autoPlay,\n muted: initiallyMuted = false,\n playOnMount = false,\n loop,\n preload = \"metadata\",\n tracks = [],\n playbackRates = RATES,\n pauseWhenHidden = true,\n controls = true,\n overlay,\n aspectRatio = \"16 / 9\",\n onPlay,\n onPause,\n onEnded,\n onTimeUpdate,\n onError,\n labels: given,\n className,\n}: VideoPlayerProps) {\n const labels = { ...videoPlayerLabels, ...given };\n const s = videoPlayer();\n const root = React.useRef<HTMLDivElement>(null);\n const video = React.useRef<HTMLVideoElement>(null);\n const reduce = usePrefersReducedMotion();\n const [resolved, setResolved] = React.useState<{ attempt: number; url: string } | null>(null);\n const [attempt, setAttempt] = React.useState(0);\n const [wanted, setWanted] = React.useState(playOnMount);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState(0);\n const [duration, setDuration] = React.useState(0);\n const [volume, setVolume] = React.useState(1);\n const [muted, setMuted] = React.useState(initiallyMuted || Boolean(autoPlay));\n const [rate, setRate] = React.useState(1);\n const [caption, setCaption] = React.useState(() => tracks.findIndex((t) => t.default));\n const [fullscreen, setFullscreen] = React.useState(false);\n const [waiting, setWaiting] = React.useState(false);\n const [failed, setFailed] = React.useState(false);\n const [idle, setIdle] = React.useState(false);\n // The poster is an image over the video until the first play: it loads like any image (lazy, decoded once), the\n // same in every browser — the `poster` attribute is painted late and differently.\n const [started, setStarted] = React.useState(false);\n const idleTimer = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n const url = typeof src === \"string\" ? src : resolved?.attempt === attempt ? resolved.url : null;\n const needSource = typeof src === \"function\" && (preload !== \"none\" || wanted || (autoPlay && !reduce));\n\n // A signed source is resolved when it is needed, and again on \"Try again\".\n React.useEffect(() => {\n if (typeof src !== \"function\" || !needSource) return;\n let live = true;\n src().then(\n (next) => live && setResolved({ attempt, url: next }),\n (error: unknown) => {\n if (!live) return;\n setFailed(true);\n onError?.(error);\n },\n );\n return () => {\n live = false;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `onError` is a callback, not a reason to resolve again\n }, [src, needSource, attempt]);\n\n // Attaches the source: natively, or through hls.js when the browser needs it.\n React.useEffect(() => {\n const element = video.current;\n if (!element || !url) return;\n let hls: InstanceType<HlsModule[\"default\"]> | null = null;\n let live = true;\n const fail = (error: unknown) => {\n if (!live) return;\n setFailed(true);\n onError?.(error);\n };\n if (isHls(url, type) && !element.canPlayType(\"application/vnd.apple.mpegurl\")) {\n if (!loadHls) fail(new Error(\"VideoPlayer: HLS needs `loadHls` in this browser.\"));\n else\n loadHls().then(({ default: Hls }) => {\n if (!live) return;\n if (!Hls.isSupported()) return fail(new Error(\"VideoPlayer: HLS is not supported here.\"));\n hls = new Hls({ enableWorker: true, backBufferLength: 60 });\n hls.on(Hls.Events.ERROR, (_event, data) => {\n if (!data.fatal) return;\n if (data.type === Hls.ErrorTypes.NETWORK_ERROR) hls?.startLoad();\n else if (data.type === Hls.ErrorTypes.MEDIA_ERROR) hls?.recoverMediaError();\n else fail(data);\n });\n hls.loadSource(url);\n hls.attachMedia(element);\n }, fail);\n } else element.src = url;\n return () => {\n live = false;\n hls?.destroy();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- `onError` and `loadHls` are callbacks\n }, [url, type]);\n\n // An autoplay waits for the player to be on screen (nothing is fetched before, with `preload=\"none\"`), and plays\n // again each time it comes back: a page of loops costs only the ones in view.\n const [inView, setInView] = React.useState(() => !pauseWhenHidden || typeof IntersectionObserver === \"undefined\");\n\n // Plays once the source is there, when it was asked for (a click before a signed source resolved).\n React.useEffect(() => {\n const element = video.current;\n if (!element || !url || !wanted) return;\n playSafely(element);\n }, [url, wanted]);\n\n // An autoplay: while in view, never under reduced motion.\n React.useEffect(() => {\n const element = video.current;\n if (!element || !url || !autoPlay || reduce || !inView) return;\n playSafely(element);\n }, [url, autoPlay, reduce, inView]);\n\n React.useEffect(() => {\n if (video.current) showTrack(video.current, caption);\n }, [caption, tracks.length]);\n\n React.useEffect(() => {\n const change = () => setFullscreen(document.fullscreenElement === root.current);\n document.addEventListener(\"fullscreenchange\", change);\n return () => document.removeEventListener(\"fullscreenchange\", change);\n }, []);\n React.useEffect(() => () => clearTimeout(idleTimer.current), []);\n\n useInView(\n root,\n (visible) => {\n setInView(visible);\n if (!visible && video.current && !video.current.paused) video.current.pause();\n },\n pauseWhenHidden,\n );\n\n const play = () => {\n setWanted(true);\n setFailed(false);\n playSafely(video.current);\n };\n const toggle = () => (playing ? video.current?.pause() : play());\n const seek = (to: number) => {\n if (!video.current) return;\n video.current.currentTime = clamp(to, 0, duration || video.current.duration || 0);\n setTime(video.current.currentTime);\n };\n const changeVolume = (to: number) => {\n if (!video.current) return;\n const next = clamp(to, 0, 1);\n video.current.volume = next;\n video.current.muted = next === 0;\n setVolume(next);\n setMuted(next === 0);\n };\n const toggleMute = () => {\n if (!video.current) return;\n if (muted && volume === 0) changeVolume(0.5);\n video.current.muted = !muted;\n setMuted(!muted);\n };\n const cycleRate = () => {\n const next = playbackRates[(playbackRates.indexOf(rate) + 1) % playbackRates.length] ?? 1;\n if (video.current) video.current.playbackRate = next;\n setRate(next);\n };\n const cycleCaption = () => tracks.length > 0 && setCaption((c) => (c + 2) % (tracks.length + 1) - 1);\n const toggleFullscreen = () => {\n const element = root.current;\n if (!element) return;\n if (document.fullscreenElement) void document.exitFullscreen();\n else if (element.requestFullscreen) void element.requestFullscreen();\n else (video.current as HTMLVideoElement & { webkitEnterFullscreen?: () => void })?.webkitEnterFullscreen?.();\n };\n const pip = () => {\n if (document.pictureInPictureElement) void document.exitPictureInPicture();\n else void video.current?.requestPictureInPicture?.();\n };\n const wake = () => {\n setIdle(false);\n clearTimeout(idleTimer.current);\n if (playing) idleTimer.current = setTimeout(() => setIdle(true), 2500);\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const target = event.target as HTMLElement;\n const inControl = target.getAttribute(\"role\") === \"slider\";\n const key = event.key.length === 1 ? event.key.toLowerCase() : event.key;\n const now = video.current?.currentTime ?? 0;\n const actions: Record<string, (() => void) | undefined> = {\n \" \": target.tagName === \"BUTTON\" ? undefined : toggle,\n k: toggle,\n j: () => seek(now - 10),\n l: () => seek(now + 10),\n m: toggleMute,\n f: toggleFullscreen,\n c: tracks.length ? cycleCaption : undefined,\n ArrowLeft: inControl ? undefined : () => seek(now - 5),\n ArrowRight: inControl ? undefined : () => seek(now + 5),\n ArrowUp: inControl ? undefined : () => changeVolume(volume + 0.1),\n ArrowDown: inControl ? undefined : () => changeVolume(volume - 0.1),\n Home: inControl ? undefined : () => seek(0),\n End: inControl ? undefined : () => seek(duration),\n };\n const action = /^[0-9]$/.test(key) && !inControl ? () => seek((Number(key) / 10) * duration) : actions[key];\n if (!action || event.metaKey || event.ctrlKey || event.altKey) return;\n event.preventDefault();\n action();\n wake();\n };\n\n const showControls = controls && !overlay;\n const pipSupported = typeof document !== \"undefined\" && \"pictureInPictureEnabled\" in document && document.pictureInPictureEnabled;\n\n return (\n <div\n ref={root}\n role=\"region\"\n aria-label={title}\n tabIndex={showControls ? 0 : undefined}\n data-idle={idle && playing ? \"\" : undefined}\n data-state={playing ? \"playing\" : \"paused\"}\n className={s.root({ className })}\n style={{ aspectRatio }}\n onKeyDown={showControls ? onKeyDown : undefined}\n onPointerMove={showControls ? wake : undefined}\n onPointerLeave={() => playing && setIdle(true)}\n >\n <video\n ref={video}\n className={s.video()}\n preload={preload}\n loop={loop}\n muted={muted}\n playsInline\n crossOrigin={tracks.length ? \"anonymous\" : undefined}\n onClick={showControls ? toggle : undefined}\n onPlay={() => {\n setStarted(true);\n setPlaying(true);\n wake();\n onPlay?.();\n }}\n onPause={() => {\n setPlaying(false);\n setIdle(false);\n onPause?.();\n }}\n onEnded={() => onEnded?.()}\n onTimeUpdate={(event) => {\n setTime(event.currentTarget.currentTime);\n onTimeUpdate?.(event.currentTarget.currentTime);\n }}\n onDurationChange={(event) => setDuration(Number.isFinite(event.currentTarget.duration) ? event.currentTarget.duration : 0)}\n onWaiting={() => setWaiting(true)}\n onPlaying={() => setWaiting(false)}\n onCanPlay={() => setWaiting(false)}\n onError={(event) => {\n setFailed(true);\n onError?.(event.currentTarget.error);\n }}\n >\n {tracks.map((track) => (\n <track key={track.src} src={track.src} srcLang={track.srcLang} label={track.label} kind={track.kind ?? \"subtitles\"} default={track.default} />\n ))}\n </video>\n\n {poster && !started ? <img src={poster} alt=\"\" aria-hidden decoding=\"async\" className={s.poster()} /> : null}\n\n {showControls && !playing && !failed && !waiting && (\n <button type=\"button\" className={s.big()} aria-label={labels.play} onClick={play}>\n <PlayGlyph className=\"ml-1 h-7 w-7\" />\n </button>\n )}\n\n {waiting && !failed && (\n <div className=\"pointer-events-none absolute inset-0 z-10 flex items-center justify-center\">\n <span className={s.spinner()} aria-hidden />\n <span role=\"status\" className=\"sr-only\">\n {labels.loading}\n </span>\n </div>\n )}\n\n {failed && (\n <div role=\"alert\" className={s.status()}>\n <p>{labels.error}</p>\n <button\n type=\"button\"\n className={s.button({ className: \"border border-fg-on-media/40 px-3\" })}\n onClick={() => {\n setFailed(false);\n setAttempt((a) => a + 1);\n video.current?.load();\n }}\n >\n <RetryGlyph className=\"h-4 w-4\" />\n {labels.retry}\n </button>\n </div>\n )}\n\n {overlay ? <div className={s.overlay()}>{overlay}</div> : null}\n\n {showControls && (\n <div className={s.bar()}>\n <Slider\n label={labels.seek}\n min={0}\n max={duration || 1}\n step={0.1}\n value={Math.min(time, duration || 1)}\n onValueChange={seek}\n formatValue={(v) => labels.time(formatClock(v), formatClock(duration))}\n disabled={!duration}\n className=\"[&_[role=slider]]:h-4 [&_[role=slider]]:w-4\"\n />\n <div className={s.row()}>\n <button type=\"button\" className={s.button()} aria-label={playing ? labels.pause : labels.play} onClick={toggle}>\n {playing ? <PauseGlyph className=\"h-5 w-5\" /> : <PlayGlyph className=\"h-5 w-5\" />}\n </button>\n <button type=\"button\" className={s.button()} aria-label={muted ? labels.unmute : labels.mute} onClick={toggleMute}>\n <VolumeGlyph muted={muted} className=\"h-5 w-5\" />\n </button>\n <div className={s.volume()}>\n <Slider label={labels.volume} min={0} max={1} step={0.05} value={muted ? 0 : volume} onValueChange={changeVolume} formatValue={(v) => `${Math.round(v * 100)} %`} className=\"w-full\" />\n </div>\n <span className={s.time()} aria-hidden>\n {formatClock(time)} / {formatClock(duration)}\n </span>\n <span className=\"flex-1\" />\n {playbackRates.length > 1 && (\n <button type=\"button\" className={s.button()} aria-label={labels.speed(rate)} onClick={cycleRate}>\n {rate}×\n </button>\n )}\n {tracks.length > 0 && (\n <button type=\"button\" className={s.button()} aria-pressed={caption >= 0} aria-label={labels.captions(caption >= 0 ? (tracks[caption]?.label ?? null) : null)} onClick={cycleCaption}>\n <CaptionsGlyph className=\"h-5 w-5\" />\n </button>\n )}\n {pipSupported && (\n <button type=\"button\" className={s.button()} aria-label={labels.pictureInPicture} onClick={pip}>\n <PipGlyph className=\"h-5 w-5\" />\n </button>\n )}\n <button type=\"button\" className={s.button()} aria-label={fullscreen ? labels.exitFullscreen : labels.fullscreen} onClick={toggleFullscreen}>\n <FullscreenGlyph exit={fullscreen} className=\"h-5 w-5\" />\n </button>\n </div>\n </div>\n )}\n </div>\n );\n}\n","// Client. Radix Slider: role=\"slider\" on each thumb, arrows / Page Up / Page Down / Home / End, a range with two\n// thumbs, horizontal or vertical. The words arrive as props: `label` names the thumb(s), `formatValue` gives the\n// aria-valuetext and the value shown (above the track, or floating over the thumb while it is touched). `ticks` draws the\n// graduations of the steps (and `marks` their words under the track); `tone` fills with the brand's gradient or its\n// accent alone.\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport * as React from \"react\";\n\nimport { tv } from \"../tv\";\n\nexport const slider = tv({\n slots: {\n root: \"flex flex-col gap-2 data-[orientation=vertical]:h-full data-[orientation=vertical]:items-center\",\n header: \"flex items-baseline justify-between gap-3 text-xs font-semibold text-fg-secondary\",\n value: \"font-mono text-[11px] tabular-nums text-fg-secondary\",\n control:\n \"relative flex touch-none select-none items-center data-disabled:cursor-not-allowed data-disabled:opacity-40 \" +\n \"data-[orientation=horizontal]:h-6 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-40 data-[orientation=vertical]:w-6 data-[orientation=vertical]:flex-col\",\n track:\n \"relative grow overflow-hidden rounded-sm bg-surface-3 inset-shadow-well \" +\n \"data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\",\n range: \"absolute rounded-sm data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\",\n thumb:\n \"group/thumb relative block h-5 w-5 cursor-grab rounded-full border-2 border-accent bg-fg-on-media shadow-raised transition-[box-shadow,scale] duration-150 \" +\n \"hover:ring-4 hover:ring-accent/15 focus-visible:outline-hidden focus-visible:focus-ring active:scale-110 active:cursor-grabbing motion-reduce:transition-none motion-reduce:active:scale-100\",\n // The value over the thumb: shown while the thumb is hovered, focused or held.\n bubble:\n \"pointer-events-none absolute bottom-full left-1/2 mb-2.5 -translate-x-1/2 whitespace-nowrap rounded-lg bg-fg px-2 py-1 font-mono text-[11px] font-semibold tabular-nums text-surface-0 opacity-0 shadow-floating \" +\n \"transition-opacity duration-150 after:absolute after:left-1/2 after:top-full after:-translate-x-1/2 after:border-4 after:border-transparent after:border-t-fg \" +\n \"group-hover/thumb:opacity-100 group-focus-visible/thumb:opacity-100 group-active/thumb:opacity-100 data-[always]:opacity-100 motion-reduce:transition-none\",\n bubbleVertical: \"bottom-auto left-full top-1/2 mb-0 ml-3 -translate-x-0 -translate-y-1/2 after:hidden\",\n ticks: \"pointer-events-none absolute inset-0\",\n tick: \"absolute rounded-sm bg-border-strong data-[on]:bg-on-accent/70 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:h-1 data-[orientation=horizontal]:w-px data-[orientation=horizontal]:-translate-x-1/2 data-[orientation=horizontal]:-translate-y-1/2 data-[orientation=vertical]:left-1/2 data-[orientation=vertical]:h-px data-[orientation=vertical]:w-1 data-[orientation=vertical]:-translate-x-1/2 data-[orientation=vertical]:translate-y-1/2\",\n marks: \"relative h-4 w-full text-[11px] font-medium tabular-nums text-fg-secondary\",\n mark: \"absolute top-0 -translate-x-1/2 whitespace-nowrap first:translate-x-0 last:-translate-x-full\",\n },\n variants: {\n tone: {\n /** The brand's signature: accent → accent-2, a glow under it. */\n gradient: { range: \"bg-linear-to-r from-accent to-accent-2 shadow-glow data-[orientation=vertical]:bg-linear-to-t\" },\n /** The accent alone. */\n solid: { range: \"bg-accent\" },\n },\n size: {\n md: {},\n lg: {\n track: \"data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5\",\n thumb: \"h-6 w-6\",\n control: \"data-[orientation=horizontal]:h-8 data-[orientation=vertical]:w-8\",\n },\n },\n },\n defaultVariants: { tone: \"gradient\", size: \"md\" },\n});\n\nexport type SliderValue = number | [number, number];\n\nexport type SliderMark = {\n /** Where the mark stands. */\n value: number;\n /** Its words under the track (\"0\", \"50 %\", \"Max\"), passed translated. */\n label: string;\n};\n\nexport type SliderProps<V extends SliderValue = number> = Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n \"value\" | \"defaultValue\" | \"onValueChange\" | \"onValueCommit\" | \"children\"\n> & {\n /** One number (a thumb) or two (a range). Controlled with `onValueChange`. */\n value?: V;\n /** The value at first, uncontrolled: one number, or two for a range. */\n defaultValue?: V;\n /** Called on every move, with one number or two. */\n onValueChange?: (value: V) => void;\n /** Called once the drag or the key press ends. */\n onValueCommit?: (value: V) => void;\n /** The accessible name — of the thumb, or of both thumbs of a range — passed translated. */\n label: string;\n /** For a range: each thumb's own name ([\"Minimum\", \"Maximum\"]), passed translated. */\n thumbLabels?: [string, string];\n /** The value as words (aria-valuetext) and as shown: \"1.5×\", \"−12 %\", \"3 min\". */\n formatValue?: (value: number) => string;\n /** Shows the label and the value above the track. Without it, `label` only names the thumb. */\n showLabel?: boolean;\n /** Shows the value floating over the thumb while it is hovered, focused or held (`\"always\"`: at all times). */\n floatingValue?: boolean | \"always\";\n /** Fills from this value instead of the minimum (a ±range from 0: brightness, balance). One horizontal thumb only. */\n origin?: number;\n /** Draws a graduation at every step (`true`, up to 40 of them) or at the values given. */\n ticks?: boolean | readonly number[];\n /** Words under the track at some values (`[{ value: 0, label: \"0\" }, { value: 100, label: \"100\" }]`). Horizontal only. */\n marks?: readonly SliderMark[];\n /**\n * `gradient` (the brand's accent → accent-2, a glow) or `solid` (the accent alone).\n * @default \"gradient\"\n */\n tone?: \"gradient\" | \"solid\";\n /**\n * md · lg (a thicker track and thumb: a hero control, a touch screen).\n * @default \"md\"\n */\n size?: \"md\" | \"lg\";\n};\n\nconst toArray = (v: SliderValue | undefined) => (v === undefined ? undefined : typeof v === \"number\" ? [v] : v);\n\n/** A slider on one value or a range: `value`/`defaultValue` + `onValueChange`, `min`, `max`, `step`, `orientation`. */\nexport function Slider<V extends SliderValue = number>({\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n label,\n thumbLabels,\n formatValue = String,\n showLabel,\n floatingValue,\n origin,\n ticks,\n marks,\n tone,\n size,\n min = 0,\n max = 100,\n step = 1,\n orientation = \"horizontal\",\n className,\n ...props\n}: SliderProps<V>) {\n const s = slider({ tone, size });\n const range = Array.isArray(value ?? defaultValue);\n const vertical = orientation === \"vertical\";\n const [inner, setInner] = React.useState(() => toArray(defaultValue) ?? [min]);\n const current = toArray(value) ?? inner;\n const out = (next: number[]) => (range ? next : next[0]) as V;\n const pct = (v: number) => ((v - min) / (max - min || 1)) * 100;\n const fill =\n origin !== undefined && !range && !vertical\n ? { left: `${Math.min(pct(origin), pct(current[0]!))}%`, right: `${100 - Math.max(pct(origin), pct(current[0]!))}%` }\n : undefined;\n const lo = range ? Math.min(...current) : (origin ?? min);\n const hi = range ? Math.max(...current) : current[0]!;\n const tickValues = ticks === true ? (max - min) / step <= 40 ? Array.from({ length: Math.round((max - min) / step) + 1 }, (_, i) => min + i * step) : [] : ticks ? [...ticks] : [];\n const id = React.useId();\n return (\n <div className={s.root({ className })} data-range={range ? \"\" : undefined} data-orientation={orientation}>\n {showLabel && (\n <div className={s.header()}>\n <span id={`${id}-label`}>{label}</span>\n <span className={s.value()} aria-hidden>\n {current.map(formatValue).join(\" – \")}\n </span>\n </div>\n )}\n <SliderPrimitive.Root\n min={min}\n max={max}\n step={step}\n orientation={orientation}\n value={current}\n onValueChange={(next) => {\n if (value === undefined) setInner(next);\n onValueChange?.(out(next));\n }}\n onValueCommit={onValueCommit && ((next) => onValueCommit(out(next)))}\n className={s.control()}\n {...props}\n >\n <SliderPrimitive.Track className={s.track()}>\n {fill ? <span data-origin=\"\" data-orientation={orientation} className={s.range()} style={fill} /> : <SliderPrimitive.Range className={s.range()} />}\n {tickValues.length ? (\n <span aria-hidden className={s.ticks()}>\n {tickValues.map((t) => (\n <span\n key={t}\n data-orientation={orientation}\n data-on={t > lo && t < hi ? \"\" : undefined}\n className={s.tick()}\n style={vertical ? { bottom: `${pct(t)}%` } : { left: `${pct(t)}%` }}\n />\n ))}\n </span>\n ) : null}\n </SliderPrimitive.Track>\n {current.map((v, i) => (\n <SliderPrimitive.Thumb\n key={i}\n aria-label={range ? (thumbLabels?.[i] ?? label) : showLabel ? undefined : label}\n aria-labelledby={!range && showLabel ? `${id}-label` : undefined}\n aria-valuetext={formatValue(v)}\n className={s.thumb()}\n >\n {floatingValue ? (\n <span aria-hidden data-always={floatingValue === \"always\" ? \"\" : undefined} className={s.bubble({ className: vertical ? s.bubbleVertical() : undefined })}>\n {formatValue(v)}\n </span>\n ) : null}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n {marks?.length && !vertical ? (\n <div aria-hidden className={s.marks()}>\n {marks.map((m) => (\n <span key={m.value} className={s.mark()} style={{ left: `${pct(m.value)}%` }}>\n {m.label}\n </span>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n","import { createTV } from \"tailwind-variants\";\n\nimport { twMergeConfig } from \"./cn\";\n\n/** `tv` with the preset's utilities known to the merge engine (`twMergeConfig`): what a primitive wearing the material is styled with. */\nexport const tv = createTV({ twMergeConfig });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,YAAYA,YAAW;AACvB,SAAS,MAAAC,WAAU;;;ACFnB,SAAS,UAAU,uBAAuB;AAC1C,YAAY,WAAW;;;ACNvB,SAAS,gBAAgB;AAKlB,IAAM,KAAK,SAAS,EAAE,cAAc,CAAC;;;AD8IpC,SACE,KADF;AAzID,IAAM,SAAS,GAAG;AAAA,EACvB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SACE;AAAA,IAEF,OACE;AAAA,IAEF,OAAO;AAAA,IACP,OACE;AAAA;AAAA,IAGF,QACE;AAAA,IAGF,gBAAgB;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA;AAAA,MAEJ,UAAU,EAAE,OAAO,gGAAgG;AAAA;AAAA,MAEnH,OAAO,EAAE,OAAO,YAAY;AAAA,IAC9B;AAAA,IACA,MAAM;AAAA,MACJ,IAAI,CAAC;AAAA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F;AAAA;AAAA,cAAK;AAAA,eACR;AAAA,YAED,OAAO,SAAS,KACf,gBAAAD,KAAC,YAAO,MAAK,UAAS,WAAW,EAAE,OAAO,GAAG,gBAAc,WAAW,GAAG,cAAY,OAAO,SAAS,WAAW,IAAK,OAAO,OAAO,GAAG,SAAS,OAAQ,IAAI,GAAG,SAAS,cACrK,0BAAAA,KAAC,iBAAc,WAAU,WAAU,GACrC;AAAA,YAED,gBACC,gBAAAA,KAAC,YAAO,MAAK,UAAS,WAAW,EAAE,OAAO,GAAG,cAAY,OAAO,kBAAkB,SAAS,KACzF,0BAAAA,KAAC,YAAS,WAAU,WAAU,GAChC;AAAA,YAEF,gBAAAA,KAAC,YAAO,MAAK,UAAS,WAAW,EAAE,OAAO,GAAG,cAAY,aAAa,OAAO,iBAAiB,OAAO,YAAY,SAAS,kBACxH,0BAAAA,KAAC,mBAAgB,MAAM,YAAY,WAAU,WAAU,GACzD;AAAA,aACF;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["React","tv","jsx","jsxs","tv"]}
|
|
@@ -70,6 +70,7 @@ function VideoPlayer({
|
|
|
70
70
|
poster,
|
|
71
71
|
autoPlay,
|
|
72
72
|
muted: initiallyMuted = false,
|
|
73
|
+
playOnMount = false,
|
|
73
74
|
loop,
|
|
74
75
|
preload = "metadata",
|
|
75
76
|
tracks = [],
|
|
@@ -93,7 +94,7 @@ function VideoPlayer({
|
|
|
93
94
|
const reduce = usePrefersReducedMotion();
|
|
94
95
|
const [resolved, setResolved] = React.useState(null);
|
|
95
96
|
const [attempt, setAttempt] = React.useState(0);
|
|
96
|
-
const [wanted, setWanted] = React.useState(
|
|
97
|
+
const [wanted, setWanted] = React.useState(playOnMount);
|
|
97
98
|
const [playing, setPlaying] = React.useState(false);
|
|
98
99
|
const [time, setTime] = React.useState(0);
|
|
99
100
|
const [duration, setDuration] = React.useState(0);
|
|
@@ -382,4 +383,4 @@ export {
|
|
|
382
383
|
videoPlayerLabels,
|
|
383
384
|
VideoPlayer
|
|
384
385
|
};
|
|
385
|
-
//# sourceMappingURL=chunk-
|
|
386
|
+
//# sourceMappingURL=chunk-ZKKMYIDN.js.map
|