@hanifhan1f/vidstack-react 1.12.26 → 1.12.30
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/dev/chunks/vidstack-BalWqr4j.js +1422 -0
- package/dev/chunks/vidstack-CKsUl4ll.js +1384 -0
- package/dev/chunks/vidstack-CqNX679o.js +669 -0
- package/dev/chunks/vidstack-D3ZXOE4d.js +643 -0
- package/dev/chunks/vidstack-DjqYvkVp.js +84 -0
- package/dev/chunks/vidstack-DqaqkU4T.js +9 -0
- package/dev/chunks/vidstack-FuCbl228.js +226 -0
- package/dev/chunks/vidstack-PREbBNMG.js +125 -0
- package/dev/chunks/vidstack-gqKBE4xH.js +376 -0
- package/dev/player/vidstack-default-components.js +9 -8
- package/dev/player/vidstack-default-icons.js +1 -1
- package/dev/player/vidstack-default-layout.js +9 -8
- package/dev/player/vidstack-plyr-layout.js +77 -63
- package/dev/player/vidstack-remotion.js +6 -6
- package/dev/vidstack.js +22 -133
- package/package.json +1 -1
- package/prod/chunks/vidstack-BCBskRpc.js +664 -0
- package/prod/chunks/vidstack-BZVrgeRF.js +9 -0
- package/prod/chunks/vidstack-CKapDFwB.js +376 -0
- package/prod/chunks/vidstack-CYK75vJF.js +1382 -0
- package/prod/chunks/vidstack-CtxjO6HG.js +84 -0
- package/prod/chunks/vidstack-D91K36KQ.js +206 -0
- package/prod/chunks/vidstack-DJThTSEm.js +125 -0
- package/prod/chunks/vidstack-DXSNXDnS.js +1384 -0
- package/prod/chunks/vidstack-DdiGCJVp.js +504 -0
- package/prod/player/vidstack-default-components.js +9 -8
- package/prod/player/vidstack-default-icons.js +1 -1
- package/prod/player/vidstack-default-layout.js +9 -8
- package/prod/player/vidstack-plyr-layout.js +77 -63
- package/prod/player/vidstack-remotion.js +6 -6
- package/prod/vidstack.js +22 -204
- package/server/chunks/vidstack-B4rJ1ZKK.js +376 -0
- package/server/chunks/vidstack-BTdEfKqV.js +84 -0
- package/server/chunks/vidstack-D4t_SZbb.js +1416 -0
- package/server/chunks/vidstack-DOIUveQF.js +504 -0
- package/server/chunks/vidstack-DbNoKLjz.js +664 -0
- package/server/chunks/vidstack-DeS67_gx.js +9 -0
- package/server/chunks/vidstack-DiHlnSws.js +1384 -0
- package/server/chunks/vidstack-DnoqxmOs.js +125 -0
- package/server/chunks/vidstack-SkX-mSrw.js +206 -0
- package/server/player/vidstack-default-components.js +9 -8
- package/server/player/vidstack-default-icons.js +1 -1
- package/server/player/vidstack-default-layout.js +9 -8
- package/server/player/vidstack-plyr-layout.js +77 -63
- package/server/player/vidstack-remotion.js +6 -6
- package/server/vidstack.js +22 -204
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createReactComponent, composeRefs, listenEvent, useReactScope, scoped, computed, signal, effect, EventsController, useSignal } from './vidstack-BalWqr4j.js';
|
|
5
|
+
import { MediaAnnouncerInstance, Primitive, ControlsInstance, ControlsGroupInstance, TooltipInstance, TooltipTriggerInstance, TooltipContentInstance, GoogleCastButtonInstance, QualitySliderInstance, AudioGainSliderInstance, SpeedSliderInstance, useMediaState, CaptionsInstance } from './vidstack-FuCbl228.js';
|
|
6
|
+
import { sliderCallbacks, Preview, Steps, Thumb, Track as Track$1, TrackFill as TrackFill$1, Value, useMediaContext } from './vidstack-CqNX679o.js';
|
|
7
|
+
import { watchActiveTextTrack, formatSpokenTime, formatTime } from 'vidstack';
|
|
8
|
+
|
|
9
|
+
const MediaAnnouncerBridge = createReactComponent(MediaAnnouncerInstance, {
|
|
10
|
+
events: ["onChange"]
|
|
11
|
+
});
|
|
12
|
+
const MediaAnnouncer = React.forwardRef(
|
|
13
|
+
({ style, children, ...props }, forwardRef) => {
|
|
14
|
+
return /* @__PURE__ */ React.createElement(MediaAnnouncerBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
15
|
+
Primitive.div,
|
|
16
|
+
{
|
|
17
|
+
...props2,
|
|
18
|
+
style: { display: "contents", ...style },
|
|
19
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
20
|
+
},
|
|
21
|
+
children
|
|
22
|
+
));
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
MediaAnnouncer.displayName = "MediaAnnouncer";
|
|
26
|
+
|
|
27
|
+
const ControlsBridge = createReactComponent(ControlsInstance);
|
|
28
|
+
const Root$5 = React.forwardRef(({ children, ...props }, forwardRef) => {
|
|
29
|
+
return /* @__PURE__ */ React.createElement(ControlsBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
30
|
+
Primitive.div,
|
|
31
|
+
{
|
|
32
|
+
...props2,
|
|
33
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
34
|
+
},
|
|
35
|
+
children
|
|
36
|
+
));
|
|
37
|
+
});
|
|
38
|
+
Root$5.displayName = "Controls";
|
|
39
|
+
const ControlsGroupBridge = createReactComponent(ControlsGroupInstance);
|
|
40
|
+
const Group = React.forwardRef(({ children, ...props }, forwardRef) => {
|
|
41
|
+
return /* @__PURE__ */ React.createElement(ControlsGroupBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
42
|
+
Primitive.div,
|
|
43
|
+
{
|
|
44
|
+
...props2,
|
|
45
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
46
|
+
},
|
|
47
|
+
children
|
|
48
|
+
));
|
|
49
|
+
});
|
|
50
|
+
Group.displayName = "ControlsGroup";
|
|
51
|
+
|
|
52
|
+
var controls = /*#__PURE__*/Object.freeze({
|
|
53
|
+
__proto__: null,
|
|
54
|
+
Group: Group,
|
|
55
|
+
Root: Root$5
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const TooltipBridge = createReactComponent(TooltipInstance);
|
|
59
|
+
function Root$4({ children, ...props }) {
|
|
60
|
+
return /* @__PURE__ */ React.createElement(TooltipBridge, { ...props }, children);
|
|
61
|
+
}
|
|
62
|
+
Root$4.displayName = "Tooltip";
|
|
63
|
+
const TriggerBridge = createReactComponent(TooltipTriggerInstance);
|
|
64
|
+
const Trigger = React.forwardRef(
|
|
65
|
+
({ children, ...props }, forwardRef) => {
|
|
66
|
+
return /* @__PURE__ */ React.createElement(TriggerBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
67
|
+
Primitive.button,
|
|
68
|
+
{
|
|
69
|
+
...props2,
|
|
70
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
71
|
+
},
|
|
72
|
+
children
|
|
73
|
+
));
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
Trigger.displayName = "TooltipTrigger";
|
|
77
|
+
const ContentBridge = createReactComponent(TooltipContentInstance);
|
|
78
|
+
const Content = React.forwardRef(
|
|
79
|
+
({ children, ...props }, forwardRef) => {
|
|
80
|
+
return /* @__PURE__ */ React.createElement(ContentBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
81
|
+
Primitive.div,
|
|
82
|
+
{
|
|
83
|
+
...props2,
|
|
84
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
85
|
+
},
|
|
86
|
+
children
|
|
87
|
+
));
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
Content.displayName = "TooltipContent";
|
|
91
|
+
|
|
92
|
+
var tooltip = /*#__PURE__*/Object.freeze({
|
|
93
|
+
__proto__: null,
|
|
94
|
+
Content: Content,
|
|
95
|
+
Root: Root$4,
|
|
96
|
+
Trigger: Trigger
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const GoogleCastButtonBridge = createReactComponent(GoogleCastButtonInstance, {
|
|
100
|
+
domEventsRegex: /^onMedia/
|
|
101
|
+
});
|
|
102
|
+
const GoogleCastButton = React.forwardRef(
|
|
103
|
+
({ children, ...props }, forwardRef) => {
|
|
104
|
+
return /* @__PURE__ */ React.createElement(GoogleCastButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
105
|
+
Primitive.button,
|
|
106
|
+
{
|
|
107
|
+
...props2,
|
|
108
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
109
|
+
},
|
|
110
|
+
children
|
|
111
|
+
));
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
GoogleCastButton.displayName = "GoogleCastButton";
|
|
115
|
+
|
|
116
|
+
const QualitySliderBridge = createReactComponent(QualitySliderInstance, {
|
|
117
|
+
events: sliderCallbacks,
|
|
118
|
+
domEventsRegex: /^onMedia/
|
|
119
|
+
});
|
|
120
|
+
const Root$3 = React.forwardRef(
|
|
121
|
+
({ children, ...props }, forwardRef) => {
|
|
122
|
+
return /* @__PURE__ */ React.createElement(QualitySliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
Root$3.displayName = "QualitySlider";
|
|
126
|
+
|
|
127
|
+
var qualitySlider = /*#__PURE__*/Object.freeze({
|
|
128
|
+
__proto__: null,
|
|
129
|
+
Preview: Preview,
|
|
130
|
+
Root: Root$3,
|
|
131
|
+
Steps: Steps,
|
|
132
|
+
Thumb: Thumb,
|
|
133
|
+
Track: Track$1,
|
|
134
|
+
TrackFill: TrackFill$1,
|
|
135
|
+
Value: Value
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const AudioGainSliderBridge = createReactComponent(AudioGainSliderInstance, {
|
|
139
|
+
events: sliderCallbacks,
|
|
140
|
+
domEventsRegex: /^onMedia/
|
|
141
|
+
});
|
|
142
|
+
const Root$2 = React.forwardRef(
|
|
143
|
+
({ children, ...props }, forwardRef) => {
|
|
144
|
+
return /* @__PURE__ */ React.createElement(AudioGainSliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
Root$2.displayName = "AudioGainSlider";
|
|
148
|
+
|
|
149
|
+
var audioGainSlider = /*#__PURE__*/Object.freeze({
|
|
150
|
+
__proto__: null,
|
|
151
|
+
Preview: Preview,
|
|
152
|
+
Root: Root$2,
|
|
153
|
+
Steps: Steps,
|
|
154
|
+
Thumb: Thumb,
|
|
155
|
+
Track: Track$1,
|
|
156
|
+
TrackFill: TrackFill$1,
|
|
157
|
+
Value: Value
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
const SpeedSliderBridge = createReactComponent(SpeedSliderInstance, {
|
|
161
|
+
events: sliderCallbacks,
|
|
162
|
+
domEventsRegex: /^onMedia/
|
|
163
|
+
});
|
|
164
|
+
const Root$1 = React.forwardRef(
|
|
165
|
+
({ children, ...props }, forwardRef) => {
|
|
166
|
+
return /* @__PURE__ */ React.createElement(SpeedSliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
Root$1.displayName = "SpeedSlider";
|
|
170
|
+
|
|
171
|
+
var speedSlider = /*#__PURE__*/Object.freeze({
|
|
172
|
+
__proto__: null,
|
|
173
|
+
Preview: Preview,
|
|
174
|
+
Root: Root$1,
|
|
175
|
+
Steps: Steps,
|
|
176
|
+
Thumb: Thumb,
|
|
177
|
+
Track: Track$1,
|
|
178
|
+
TrackFill: TrackFill$1,
|
|
179
|
+
Value: Value
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
const Title = React.forwardRef(({ children, ...props }, forwardRef) => {
|
|
183
|
+
const $title = useMediaState("title");
|
|
184
|
+
return /* @__PURE__ */ React.createElement(Primitive.span, { ...props, ref: forwardRef }, $title, children);
|
|
185
|
+
});
|
|
186
|
+
Title.displayName = "Title";
|
|
187
|
+
|
|
188
|
+
function useActiveTextCues(track) {
|
|
189
|
+
const [activeCues, setActiveCues] = React.useState([]);
|
|
190
|
+
React.useEffect(() => {
|
|
191
|
+
if (!track) {
|
|
192
|
+
setActiveCues([]);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
function onCuesChange() {
|
|
196
|
+
if (track) setActiveCues(track.activeCues);
|
|
197
|
+
}
|
|
198
|
+
onCuesChange();
|
|
199
|
+
return listenEvent(track, "cue-change", onCuesChange);
|
|
200
|
+
}, [track]);
|
|
201
|
+
return activeCues;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function useActiveTextTrack(kind) {
|
|
205
|
+
const media = useMediaContext(), [track, setTrack] = React.useState(null);
|
|
206
|
+
React.useEffect(() => {
|
|
207
|
+
return watchActiveTextTrack(media.textTracks, kind, setTrack);
|
|
208
|
+
}, [kind]);
|
|
209
|
+
return track;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function useChapterTitle() {
|
|
213
|
+
const $track = useActiveTextTrack("chapters"), $cues = useActiveTextCues($track);
|
|
214
|
+
return $cues[0]?.text || "";
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const ChapterTitle = React.forwardRef(
|
|
218
|
+
({ defaultText = "", children, ...props }, forwardRef) => {
|
|
219
|
+
const $chapterTitle = useChapterTitle();
|
|
220
|
+
return /* @__PURE__ */ React.createElement(Primitive.span, { ...props, ref: forwardRef }, $chapterTitle || defaultText, children);
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
ChapterTitle.displayName = "ChapterTitle";
|
|
224
|
+
|
|
225
|
+
const CaptionsBridge = createReactComponent(CaptionsInstance);
|
|
226
|
+
const Captions = React.forwardRef(
|
|
227
|
+
({ children, ...props }, forwardRef) => {
|
|
228
|
+
return /* @__PURE__ */ React.createElement(CaptionsBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
|
|
229
|
+
}
|
|
230
|
+
);
|
|
231
|
+
Captions.displayName = "Captions";
|
|
232
|
+
|
|
233
|
+
const Root = React.forwardRef(
|
|
234
|
+
({ size = 96, children, ...props }, forwardRef) => {
|
|
235
|
+
return /* @__PURE__ */ React.createElement(
|
|
236
|
+
"svg",
|
|
237
|
+
{
|
|
238
|
+
width: size,
|
|
239
|
+
height: size,
|
|
240
|
+
fill: "none",
|
|
241
|
+
viewBox: "0 0 120 120",
|
|
242
|
+
"aria-hidden": "true",
|
|
243
|
+
"data-part": "root",
|
|
244
|
+
...props,
|
|
245
|
+
ref: forwardRef
|
|
246
|
+
},
|
|
247
|
+
children
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
const Track = React.forwardRef(
|
|
252
|
+
({ width = 8, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
253
|
+
"circle",
|
|
254
|
+
{
|
|
255
|
+
cx: "60",
|
|
256
|
+
cy: "60",
|
|
257
|
+
r: "54",
|
|
258
|
+
stroke: "currentColor",
|
|
259
|
+
strokeWidth: width,
|
|
260
|
+
"data-part": "track",
|
|
261
|
+
...props,
|
|
262
|
+
ref
|
|
263
|
+
},
|
|
264
|
+
children
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
const TrackFill = React.forwardRef(
|
|
268
|
+
({ width = 8, fillPercent = 50, children, ...props }, ref) => /* @__PURE__ */ React.createElement(
|
|
269
|
+
"circle",
|
|
270
|
+
{
|
|
271
|
+
cx: "60",
|
|
272
|
+
cy: "60",
|
|
273
|
+
r: "54",
|
|
274
|
+
stroke: "currentColor",
|
|
275
|
+
pathLength: "100",
|
|
276
|
+
strokeWidth: width,
|
|
277
|
+
strokeDasharray: 100,
|
|
278
|
+
strokeDashoffset: 100 - fillPercent,
|
|
279
|
+
"data-part": "track-fill",
|
|
280
|
+
...props,
|
|
281
|
+
ref
|
|
282
|
+
},
|
|
283
|
+
children
|
|
284
|
+
)
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
var spinner = /*#__PURE__*/Object.freeze({
|
|
288
|
+
__proto__: null,
|
|
289
|
+
Root: Root,
|
|
290
|
+
Track: Track,
|
|
291
|
+
TrackFill: TrackFill
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
function createSignal(initialValue, deps = []) {
|
|
295
|
+
const scope = useReactScope();
|
|
296
|
+
return React.useMemo(() => scoped(() => signal(initialValue), scope), [scope, ...deps]);
|
|
297
|
+
}
|
|
298
|
+
function createComputed(compute, deps = []) {
|
|
299
|
+
const scope = useReactScope();
|
|
300
|
+
return React.useMemo(() => scoped(() => computed(compute), scope), [scope, ...deps]);
|
|
301
|
+
}
|
|
302
|
+
function createEffect(compute, deps = []) {
|
|
303
|
+
const scope = useReactScope();
|
|
304
|
+
React.useEffect(() => scoped(() => effect(compute), scope), [scope, ...deps]);
|
|
305
|
+
}
|
|
306
|
+
function useScoped(compute) {
|
|
307
|
+
const scope = useReactScope();
|
|
308
|
+
return React.useMemo(() => scoped(compute, scope), [scope]);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function useTextCues(track) {
|
|
312
|
+
const [cues, setCues] = React.useState([]);
|
|
313
|
+
React.useEffect(() => {
|
|
314
|
+
if (!track) return;
|
|
315
|
+
function onCuesChange() {
|
|
316
|
+
if (track) setCues([...track.cues]);
|
|
317
|
+
}
|
|
318
|
+
const events = new EventsController(track).add("add-cue", onCuesChange).add("remove-cue", onCuesChange);
|
|
319
|
+
onCuesChange();
|
|
320
|
+
return () => {
|
|
321
|
+
setCues([]);
|
|
322
|
+
events.abort();
|
|
323
|
+
};
|
|
324
|
+
}, [track]);
|
|
325
|
+
return cues;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
function useChapterOptions() {
|
|
329
|
+
const media = useMediaContext(), track = useActiveTextTrack("chapters"), cues = useTextCues(track), $startTime = useSignal(media.$state.seekableStart), $endTime = useSignal(media.$state.seekableEnd);
|
|
330
|
+
useActiveTextCues(track);
|
|
331
|
+
return React.useMemo(() => {
|
|
332
|
+
const options = track ? cues.filter((cue) => cue.startTime <= $endTime && cue.endTime >= $startTime).map((cue, i) => {
|
|
333
|
+
let currentRef = null, stopProgressEffect;
|
|
334
|
+
return {
|
|
335
|
+
cue,
|
|
336
|
+
label: cue.text,
|
|
337
|
+
value: i.toString(),
|
|
338
|
+
startTimeText: formatTime(Math.max(0, cue.startTime - $startTime)),
|
|
339
|
+
durationText: formatSpokenTime(
|
|
340
|
+
Math.min($endTime, cue.endTime) - Math.max($startTime, cue.startTime)
|
|
341
|
+
),
|
|
342
|
+
get selected() {
|
|
343
|
+
return cue === track.activeCues[0];
|
|
344
|
+
},
|
|
345
|
+
setProgressVar(ref) {
|
|
346
|
+
if (!ref || cue !== track.activeCues[0]) {
|
|
347
|
+
stopProgressEffect?.();
|
|
348
|
+
stopProgressEffect = void 0;
|
|
349
|
+
ref?.style.setProperty("--progress", "0%");
|
|
350
|
+
currentRef = null;
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
if (currentRef === ref) return;
|
|
354
|
+
currentRef = ref;
|
|
355
|
+
stopProgressEffect?.();
|
|
356
|
+
stopProgressEffect = effect(() => {
|
|
357
|
+
const { realCurrentTime } = media.$state, time = realCurrentTime(), cueStartTime = Math.max($startTime, cue.startTime), duration = Math.min($endTime, cue.endTime) - cueStartTime, progress = Math.max(0, time - cueStartTime) / duration * 100;
|
|
358
|
+
ref.style.setProperty("--progress", progress.toFixed(3) + "%");
|
|
359
|
+
});
|
|
360
|
+
},
|
|
361
|
+
select(trigger) {
|
|
362
|
+
media.remote.seek(cue.startTime - $startTime, trigger);
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}) : [];
|
|
366
|
+
Object.defineProperty(options, "selectedValue", {
|
|
367
|
+
get() {
|
|
368
|
+
const index = options.findIndex((option) => option.selected);
|
|
369
|
+
return (index >= 0 ? index : 0).toString();
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
return options;
|
|
373
|
+
}, [cues, $startTime, $endTime]);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
export { Captions, ChapterTitle, Content, GoogleCastButton, Group, MediaAnnouncer, Root$4 as Root, Root$2 as Root$1, Root$1 as Root$2, Root$3, Root$5 as Root$4, Root as Root$5, Title, Track, TrackFill, Trigger, audioGainSlider, controls, createComputed, createEffect, createSignal, qualitySlider, speedSlider, spinner, tooltip, useActiveTextCues, useActiveTextTrack, useChapterOptions, useChapterTitle, useScoped, useTextCues };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
export { DefaultAudioLayout, DefaultBufferingIndicator, DefaultKeyboardDisplay, DefaultMenuButton, DefaultMenuCheckbox, DefaultMenuItem, DefaultMenuRadioGroup, DefaultMenuSection, DefaultMenuSliderItem, DefaultSliderParts, DefaultSliderSteps, DefaultTooltip, DefaultVideoGestures, DefaultVideoLargeLayout, DefaultVideoLayout, DefaultVideoSmallLayout, createRadioOptions } from '../chunks/vidstack-
|
|
3
|
+
export { DefaultAudioLayout, DefaultBufferingIndicator, DefaultKeyboardDisplay, DefaultMenuButton, DefaultMenuCheckbox, DefaultMenuItem, DefaultMenuRadioGroup, DefaultMenuSection, DefaultMenuSliderItem, DefaultSliderParts, DefaultSliderSteps, DefaultTooltip, DefaultVideoGestures, DefaultVideoLargeLayout, DefaultVideoLayout, DefaultVideoSmallLayout, createRadioOptions } from '../chunks/vidstack-CKsUl4ll.js';
|
|
4
4
|
export { defaultLayoutIcons } from './vidstack-default-icons.js';
|
|
5
5
|
import 'react';
|
|
6
|
-
import '../chunks/vidstack-
|
|
7
|
-
import '../chunks/vidstack-
|
|
8
|
-
import '../chunks/vidstack-
|
|
9
|
-
import '
|
|
10
|
-
import '../chunks/vidstack-
|
|
6
|
+
import '../chunks/vidstack-BalWqr4j.js';
|
|
7
|
+
import '../chunks/vidstack-gqKBE4xH.js';
|
|
8
|
+
import '../chunks/vidstack-FuCbl228.js';
|
|
9
|
+
import 'vidstack';
|
|
10
|
+
import '../chunks/vidstack-CqNX679o.js';
|
|
11
11
|
import 'react-dom';
|
|
12
|
-
import '../chunks/vidstack-
|
|
13
|
-
import '../chunks/vidstack-
|
|
12
|
+
import '../chunks/vidstack-DjqYvkVp.js';
|
|
13
|
+
import '../chunks/vidstack-DqaqkU4T.js';
|
|
14
|
+
import 'vidstack/exports/font.ts';
|
|
14
15
|
import '../chunks/vidstack-CBF7iUqu.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { Icon$34, Icon$35, Icon$27, Icon$26, Icon$60, Icon$61, Icon$39, Icon$40, Icon$105, Icon$104, Icon$54, Icon$59, Icon$62, Icon$19, Icon$56, Icon$33, Icon$8, Icon$13, Icon$88, Icon$63, Icon$16, Icon$53, Icon$22, Icon$11, Icon$0, Icon$31, Icon$81, Icon$77, Icon$74, Icon$24, Icon$5 } from '../chunks/vidstack-
|
|
4
|
+
import { Icon$34, Icon$35, Icon$27, Icon$26, Icon$60, Icon$61, Icon$39, Icon$40, Icon$105, Icon$104, Icon$54, Icon$59, Icon$62, Icon$19, Icon$56, Icon$33, Icon$8, Icon$13, Icon$88, Icon$63, Icon$16, Icon$53, Icon$22, Icon$11, Icon$0, Icon$31, Icon$81, Icon$77, Icon$74, Icon$24, Icon$5 } from '../chunks/vidstack-BalWqr4j.js';
|
|
5
5
|
import { Icon } from '../chunks/vidstack-CBF7iUqu.js';
|
|
6
6
|
|
|
7
7
|
function createIcon(paths) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
export { DefaultAudioLayout, DefaultBufferingIndicator, DefaultKeyboardDisplay, DefaultLayoutContext, DefaultMenuButton, DefaultMenuCheckbox, DefaultMenuItem, DefaultMenuRadioGroup, DefaultMenuSection, DefaultMenuSliderItem, DefaultSliderParts, DefaultSliderSteps, DefaultTooltip, DefaultVideoGestures, DefaultVideoLargeLayout, DefaultVideoLayout, DefaultVideoSmallLayout, createRadioOptions, i18n, useDefaultLayoutContext, useDefaultLayoutWord } from '../chunks/vidstack-
|
|
3
|
+
export { DefaultAudioLayout, DefaultBufferingIndicator, DefaultKeyboardDisplay, DefaultLayoutContext, DefaultMenuButton, DefaultMenuCheckbox, DefaultMenuItem, DefaultMenuRadioGroup, DefaultMenuSection, DefaultMenuSliderItem, DefaultSliderParts, DefaultSliderSteps, DefaultTooltip, DefaultVideoGestures, DefaultVideoLargeLayout, DefaultVideoLayout, DefaultVideoSmallLayout, createRadioOptions, i18n, useDefaultLayoutContext, useDefaultLayoutWord } from '../chunks/vidstack-CKsUl4ll.js';
|
|
4
4
|
export { defaultLayoutIcons } from './vidstack-default-icons.js';
|
|
5
5
|
import 'react';
|
|
6
|
-
import '../chunks/vidstack-
|
|
7
|
-
import '../chunks/vidstack-
|
|
8
|
-
import '../chunks/vidstack-
|
|
9
|
-
import '
|
|
10
|
-
import '../chunks/vidstack-
|
|
6
|
+
import '../chunks/vidstack-BalWqr4j.js';
|
|
7
|
+
import '../chunks/vidstack-gqKBE4xH.js';
|
|
8
|
+
import '../chunks/vidstack-FuCbl228.js';
|
|
9
|
+
import 'vidstack';
|
|
10
|
+
import '../chunks/vidstack-CqNX679o.js';
|
|
11
11
|
import 'react-dom';
|
|
12
|
-
import '../chunks/vidstack-
|
|
13
|
-
import '../chunks/vidstack-
|
|
12
|
+
import '../chunks/vidstack-DjqYvkVp.js';
|
|
13
|
+
import '../chunks/vidstack-DqaqkU4T.js';
|
|
14
|
+
import 'vidstack/exports/font.ts';
|
|
14
15
|
import '../chunks/vidstack-CBF7iUqu.js';
|
|
@@ -1,75 +1,89 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import { useMediaState, Primitive,
|
|
3
|
+
import { IS_SERVER, useMediaState, Primitive, isRemotionSrc } from '../chunks/vidstack-FuCbl228.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { isString, isBoolean, uppercaseFirstChar, isUndefined, signal, composeRefs, useSignal, isNumber, listenEvent } from '../chunks/vidstack-BalWqr4j.js';
|
|
6
|
+
import { usePlyrLayoutClasses, isKeyboardEvent, isKeyboardClick } from 'vidstack';
|
|
7
|
+
import { useMediaContext, PlayButton, Root, Img, Gesture, AirPlayButton, CaptionButton, FullscreenButton, PIPButton, SeekButton, Root$1, Value, Preview, Thumbnail, LiveButton, Time, appendParamsToURL, Root$2, Button, Items, useAudioOptions, Root$3, Item, useCaptionOptions, MuteButton, Root$4 } from '../chunks/vidstack-CqNX679o.js';
|
|
8
|
+
import { useMediaRemote, useVideoQualityOptions, usePlaybackRateOptions } from '../chunks/vidstack-PREbBNMG.js';
|
|
9
|
+
import { useLayoutName, useClassName } from '../chunks/vidstack-DjqYvkVp.js';
|
|
10
|
+
import { RemotionThumbnail, RemotionPoster, RemotionSliderThumbnail } from '../chunks/vidstack-DqaqkU4T.js';
|
|
10
11
|
export { plyrLayoutIcons } from './vidstack-plyr-icons.js';
|
|
11
|
-
import '@floating-ui/dom';
|
|
12
12
|
import 'react-dom';
|
|
13
13
|
import '../chunks/vidstack-CBF7iUqu.js';
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
15
|
+
IS_SERVER ? "" : navigator?.userAgent.toLowerCase() || "";
|
|
16
|
+
function canPlayHLSNatively(video) {
|
|
17
|
+
if (IS_SERVER) return false;
|
|
18
|
+
if (!video) video = document.createElement("video");
|
|
19
|
+
return video.canPlayType("application/vnd.apple.mpegurl").length > 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i;
|
|
23
|
+
const AUDIO_TYPES = /* @__PURE__ */ new Set([
|
|
24
|
+
"audio/mpeg",
|
|
25
|
+
"audio/ogg",
|
|
26
|
+
"audio/3gp",
|
|
27
|
+
"audio/mp3",
|
|
28
|
+
"audio/webm",
|
|
29
|
+
"audio/flac",
|
|
30
|
+
"audio/m4a",
|
|
31
|
+
"audio/m4b",
|
|
32
|
+
"audio/mp4a",
|
|
33
|
+
"audio/mp4"
|
|
34
|
+
]);
|
|
35
|
+
const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
|
|
36
|
+
const VIDEO_TYPES = /* @__PURE__ */ new Set([
|
|
37
|
+
"video/mp4",
|
|
38
|
+
"video/webm",
|
|
39
|
+
"video/3gp",
|
|
40
|
+
"video/ogg",
|
|
41
|
+
"video/avi",
|
|
42
|
+
"video/mpeg"
|
|
43
|
+
]);
|
|
44
|
+
const HLS_VIDEO_EXTENSIONS = /\.(m3u8)($|\?)/i;
|
|
45
|
+
const HLS_VIDEO_TYPES = /* @__PURE__ */ new Set([
|
|
46
|
+
// Apple sanctioned
|
|
47
|
+
"application/vnd.apple.mpegurl",
|
|
48
|
+
// Apple sanctioned for backwards compatibility
|
|
49
|
+
"audio/mpegurl",
|
|
50
|
+
// Very common
|
|
51
|
+
"audio/x-mpegurl",
|
|
52
|
+
// Very common
|
|
53
|
+
"application/x-mpegurl",
|
|
54
|
+
// Included for completeness
|
|
55
|
+
"video/x-mpegurl",
|
|
56
|
+
"video/mpegurl",
|
|
57
|
+
"application/mpegurl"
|
|
58
|
+
]);
|
|
59
|
+
function isAudioSrc({ src, type }) {
|
|
60
|
+
return isString(src) ? AUDIO_EXTENSIONS.test(src) || AUDIO_TYPES.has(type) || src.startsWith("blob:") && type === "audio/object" : type === "audio/object";
|
|
61
|
+
}
|
|
62
|
+
function isVideoSrc(src) {
|
|
63
|
+
return isString(src.src) ? VIDEO_EXTENSIONS.test(src.src) || VIDEO_TYPES.has(src.type) || src.src.startsWith("blob:") && src.type === "video/object" || isHLSSrc(src) && (IS_SERVER || canPlayHLSNatively()) : src.type === "video/object";
|
|
64
|
+
}
|
|
65
|
+
function isHLSSrc({ src, type }) {
|
|
66
|
+
return isString(src) && HLS_VIDEO_EXTENSIONS.test(src) || HLS_VIDEO_TYPES.has(type);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getDownloadFile({
|
|
70
|
+
title,
|
|
71
|
+
src,
|
|
72
|
+
download
|
|
73
|
+
}) {
|
|
74
|
+
const url = isBoolean(download) || download === "" ? src.src : isString(download) ? download : download?.url;
|
|
75
|
+
if (!isValidFileDownload({ url, src, download })) return null;
|
|
76
|
+
return {
|
|
77
|
+
url,
|
|
78
|
+
name: !isBoolean(download) && !isString(download) && download?.filename || title.toLowerCase() || "media"
|
|
52
79
|
};
|
|
53
|
-
const disposal = createDisposalBin();
|
|
54
|
-
for (const token of Object.keys(classes)) {
|
|
55
|
-
disposal.add(effect(() => void el.classList.toggle(token, !!classes[token]())));
|
|
56
|
-
}
|
|
57
|
-
disposal.add(
|
|
58
|
-
effect(() => {
|
|
59
|
-
const token = `plyr--${viewType()}`;
|
|
60
|
-
el.classList.add(token);
|
|
61
|
-
return () => el.classList.remove(token);
|
|
62
|
-
}),
|
|
63
|
-
effect(() => {
|
|
64
|
-
const { $provider } = media, type = $provider()?.type, token = `plyr--${isHTMLProvider(type) ? "html5" : type}`;
|
|
65
|
-
el.classList.toggle(token, !!type);
|
|
66
|
-
return () => el.classList.remove(token);
|
|
67
|
-
})
|
|
68
|
-
);
|
|
69
|
-
return () => disposal.empty();
|
|
70
80
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
81
|
+
function isValidFileDownload({
|
|
82
|
+
url,
|
|
83
|
+
src,
|
|
84
|
+
download
|
|
85
|
+
}) {
|
|
86
|
+
return isString(url) && (download && download !== true || isAudioSrc(src) || isVideoSrc(src));
|
|
73
87
|
}
|
|
74
88
|
|
|
75
89
|
const PlyrLayoutContext = React.createContext({});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { createDisposalBin, animationFrameThrottle, noop } from '../chunks/vidstack-
|
|
4
|
+
import { createDisposalBin, animationFrameThrottle, noop } from '../chunks/vidstack-BalWqr4j.js';
|
|
5
5
|
import { Internals, random } from 'remotion';
|
|
6
|
-
import { IS_SERVER, useMediaState, isRemotionSrc, Primitive, useSliderState } from '../chunks/vidstack-
|
|
7
|
-
export { isRemotionProvider } from '../chunks/vidstack-
|
|
8
|
-
import { RemotionThumbnail as RemotionThumbnail$1, RemotionSliderThumbnail as RemotionSliderThumbnail$1, RemotionPoster as RemotionPoster$1 } from '../chunks/vidstack-
|
|
9
|
-
import '
|
|
6
|
+
import { IS_SERVER, useMediaState, isRemotionSrc, Primitive, useSliderState } from '../chunks/vidstack-FuCbl228.js';
|
|
7
|
+
export { isRemotionProvider } from '../chunks/vidstack-FuCbl228.js';
|
|
8
|
+
import { RemotionThumbnail as RemotionThumbnail$1, RemotionSliderThumbnail as RemotionSliderThumbnail$1, RemotionPoster as RemotionPoster$1 } from '../chunks/vidstack-DqaqkU4T.js';
|
|
9
|
+
import 'vidstack';
|
|
10
10
|
|
|
11
11
|
class RemotionLayoutEngine {
|
|
12
12
|
#src = null;
|
|
@@ -338,7 +338,7 @@ class RemotionProviderLoader {
|
|
|
338
338
|
return "video";
|
|
339
339
|
}
|
|
340
340
|
async load(ctx) {
|
|
341
|
-
return new (await import('../chunks/vidstack-
|
|
341
|
+
return new (await import('../chunks/vidstack-D3ZXOE4d.js')).RemotionProvider(this.target, ctx);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
|