@hanifhan1f/vidstack-react 1.12.25 → 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,125 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { MediaRemoteControl, sortVideoQualities, DEFAULT_PLAYBACK_RATES } from 'vidstack';
|
|
5
|
+
import { MediaPlayerInstance } from './vidstack-SkX-mSrw.js';
|
|
6
|
+
import { useMediaContext } from './vidstack-DbNoKLjz.js';
|
|
7
|
+
import { useSignal, isString } from './vidstack-D4t_SZbb.js';
|
|
8
|
+
|
|
9
|
+
function useMediaRemote(target) {
|
|
10
|
+
const media = useMediaContext(), remote = React.useRef(null);
|
|
11
|
+
if (!remote.current) {
|
|
12
|
+
remote.current = new MediaRemoteControl();
|
|
13
|
+
}
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
const ref = target && "current" in target ? target.current : target, isPlayerRef = ref instanceof MediaPlayerInstance, player = isPlayerRef ? ref : media?.player;
|
|
16
|
+
remote.current.setPlayer(player ?? null);
|
|
17
|
+
remote.current.setTarget(ref ?? null);
|
|
18
|
+
}, [media, target && "current" in target ? target.current : target]);
|
|
19
|
+
return remote.current;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function useVideoQualityOptions({
|
|
23
|
+
auto = true,
|
|
24
|
+
sort = "descending"
|
|
25
|
+
} = {}) {
|
|
26
|
+
const media = useMediaContext(), { qualities, quality, autoQuality, canSetQuality } = media.$state, $qualities = useSignal(qualities);
|
|
27
|
+
useSignal(quality);
|
|
28
|
+
useSignal(autoQuality);
|
|
29
|
+
useSignal(canSetQuality);
|
|
30
|
+
return React.useMemo(() => {
|
|
31
|
+
const sortedQualities = sortVideoQualities($qualities, sort === "descending"), options = sortedQualities.map((q) => {
|
|
32
|
+
return {
|
|
33
|
+
quality: q,
|
|
34
|
+
label: q.height + "p",
|
|
35
|
+
value: getQualityValue(q),
|
|
36
|
+
bitrateText: q.bitrate && q.bitrate > 0 ? `${(q.bitrate / 1e6).toFixed(2)} Mbps` : null,
|
|
37
|
+
get selected() {
|
|
38
|
+
return q === quality();
|
|
39
|
+
},
|
|
40
|
+
get autoSelected() {
|
|
41
|
+
return autoQuality();
|
|
42
|
+
},
|
|
43
|
+
select(trigger) {
|
|
44
|
+
const index = qualities().indexOf(q);
|
|
45
|
+
if (index >= 0) media.remote.changeQuality(index, trigger);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
if (auto) {
|
|
50
|
+
options.unshift({
|
|
51
|
+
quality: null,
|
|
52
|
+
label: isString(auto) ? auto : "Auto",
|
|
53
|
+
value: "auto",
|
|
54
|
+
bitrateText: null,
|
|
55
|
+
get selected() {
|
|
56
|
+
return autoQuality();
|
|
57
|
+
},
|
|
58
|
+
get autoSelected() {
|
|
59
|
+
return autoQuality();
|
|
60
|
+
},
|
|
61
|
+
select(trigger) {
|
|
62
|
+
media.remote.requestAutoQuality(trigger);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
Object.defineProperty(options, "disabled", {
|
|
67
|
+
get() {
|
|
68
|
+
return !canSetQuality() || $qualities.length <= 1;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
Object.defineProperty(options, "selectedQuality", {
|
|
72
|
+
get() {
|
|
73
|
+
return quality();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(options, "selectedValue", {
|
|
77
|
+
get() {
|
|
78
|
+
const $quality = quality();
|
|
79
|
+
return !autoQuality() && $quality ? getQualityValue($quality) : "auto";
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return options;
|
|
83
|
+
}, [$qualities, sort]);
|
|
84
|
+
}
|
|
85
|
+
function getQualityValue(quality) {
|
|
86
|
+
return quality.height + "_" + quality.bitrate;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function usePlaybackRateOptions({
|
|
90
|
+
rates = DEFAULT_PLAYBACK_RATES,
|
|
91
|
+
normalLabel = "Normal"
|
|
92
|
+
} = {}) {
|
|
93
|
+
const media = useMediaContext(), { playbackRate, canSetPlaybackRate } = media.$state;
|
|
94
|
+
useSignal(playbackRate);
|
|
95
|
+
useSignal(canSetPlaybackRate);
|
|
96
|
+
return React.useMemo(() => {
|
|
97
|
+
const options = rates.map((opt) => {
|
|
98
|
+
const label = typeof opt === "number" ? opt === 1 && normalLabel ? normalLabel : opt + "x" : opt.label, rate = typeof opt === "number" ? opt : opt.rate;
|
|
99
|
+
return {
|
|
100
|
+
label,
|
|
101
|
+
value: rate.toString(),
|
|
102
|
+
rate,
|
|
103
|
+
get selected() {
|
|
104
|
+
return playbackRate() === rate;
|
|
105
|
+
},
|
|
106
|
+
select(trigger) {
|
|
107
|
+
media.remote.changePlaybackRate(rate, trigger);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(options, "disabled", {
|
|
112
|
+
get() {
|
|
113
|
+
return !canSetPlaybackRate() || !options.length;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(options, "selectedValue", {
|
|
117
|
+
get() {
|
|
118
|
+
return playbackRate().toString();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return options;
|
|
122
|
+
}, [rates]);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export { useMediaRemote, usePlaybackRateOptions, useVideoQualityOptions };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { composeRefs, useStateContext, useSignal, useSignalRecord } from './vidstack-D4t_SZbb.js';
|
|
5
|
+
import { MediaPlayer, MediaAnnouncer, MediaProvider, Controls, ControlsGroup, Tooltip, TooltipTrigger, TooltipContent, ToggleButton, AirPlayButton, GoogleCastButton, PlayButton, CaptionButton, FullscreenButton, MuteButton, PIPButton, SeekButton, LiveButton, Slider, SliderValue, SliderPreview, VolumeSlider, QualitySlider, AudioGainSlider, SpeedSlider, Thumbnail, TimeSlider, SliderChapters, SliderThumbnail, SliderVideo, RadioGroup, Radio, Menu, MenuButton, MenuItems, MenuItem, Gesture, Captions, Poster, Time, MenuPortal, sliderState, mediaState } from 'vidstack';
|
|
6
|
+
|
|
7
|
+
class MediaPlayerInstance extends MediaPlayer {
|
|
8
|
+
}
|
|
9
|
+
class MediaProviderInstance extends MediaProvider {
|
|
10
|
+
}
|
|
11
|
+
class MediaAnnouncerInstance extends MediaAnnouncer {
|
|
12
|
+
}
|
|
13
|
+
class ControlsInstance extends Controls {
|
|
14
|
+
}
|
|
15
|
+
class ControlsGroupInstance extends ControlsGroup {
|
|
16
|
+
}
|
|
17
|
+
class ToggleButtonInstance extends ToggleButton {
|
|
18
|
+
}
|
|
19
|
+
class CaptionButtonInstance extends CaptionButton {
|
|
20
|
+
}
|
|
21
|
+
class FullscreenButtonInstance extends FullscreenButton {
|
|
22
|
+
}
|
|
23
|
+
class LiveButtonInstance extends LiveButton {
|
|
24
|
+
}
|
|
25
|
+
class MuteButtonInstance extends MuteButton {
|
|
26
|
+
}
|
|
27
|
+
class PIPButtonInstance extends PIPButton {
|
|
28
|
+
}
|
|
29
|
+
class PlayButtonInstance extends PlayButton {
|
|
30
|
+
}
|
|
31
|
+
class AirPlayButtonInstance extends AirPlayButton {
|
|
32
|
+
}
|
|
33
|
+
class GoogleCastButtonInstance extends GoogleCastButton {
|
|
34
|
+
}
|
|
35
|
+
class SeekButtonInstance extends SeekButton {
|
|
36
|
+
}
|
|
37
|
+
class TooltipInstance extends Tooltip {
|
|
38
|
+
}
|
|
39
|
+
class TooltipTriggerInstance extends TooltipTrigger {
|
|
40
|
+
}
|
|
41
|
+
class TooltipContentInstance extends TooltipContent {
|
|
42
|
+
}
|
|
43
|
+
class SliderInstance extends Slider {
|
|
44
|
+
}
|
|
45
|
+
class TimeSliderInstance extends TimeSlider {
|
|
46
|
+
}
|
|
47
|
+
class VolumeSliderInstance extends VolumeSlider {
|
|
48
|
+
}
|
|
49
|
+
class AudioGainSliderInstance extends AudioGainSlider {
|
|
50
|
+
}
|
|
51
|
+
class SpeedSliderInstance extends SpeedSlider {
|
|
52
|
+
}
|
|
53
|
+
class QualitySliderInstance extends QualitySlider {
|
|
54
|
+
}
|
|
55
|
+
class SliderThumbnailInstance extends SliderThumbnail {
|
|
56
|
+
}
|
|
57
|
+
class SliderValueInstance extends SliderValue {
|
|
58
|
+
}
|
|
59
|
+
class SliderVideoInstance extends SliderVideo {
|
|
60
|
+
}
|
|
61
|
+
class SliderPreviewInstance extends SliderPreview {
|
|
62
|
+
}
|
|
63
|
+
class SliderChaptersInstance extends SliderChapters {
|
|
64
|
+
}
|
|
65
|
+
class MenuInstance extends Menu {
|
|
66
|
+
}
|
|
67
|
+
class MenuButtonInstance extends MenuButton {
|
|
68
|
+
}
|
|
69
|
+
class MenuItemsInstance extends MenuItems {
|
|
70
|
+
}
|
|
71
|
+
class MenuItemInstance extends MenuItem {
|
|
72
|
+
}
|
|
73
|
+
class MenuPortalInstance extends MenuPortal {
|
|
74
|
+
}
|
|
75
|
+
class RadioGroupInstance extends RadioGroup {
|
|
76
|
+
}
|
|
77
|
+
class RadioInstance extends Radio {
|
|
78
|
+
}
|
|
79
|
+
class CaptionsInstance extends Captions {
|
|
80
|
+
}
|
|
81
|
+
class GestureInstance extends Gesture {
|
|
82
|
+
}
|
|
83
|
+
class PosterInstance extends Poster {
|
|
84
|
+
}
|
|
85
|
+
class ThumbnailInstance extends Thumbnail {
|
|
86
|
+
}
|
|
87
|
+
class TimeInstance extends Time {
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const Slot = React.forwardRef((props, forwardedRef) => {
|
|
91
|
+
const { children, ...slotProps } = props;
|
|
92
|
+
const childrenArray = React.Children.toArray(children);
|
|
93
|
+
const slottable = childrenArray.find(isSlottable);
|
|
94
|
+
if (slottable) {
|
|
95
|
+
const newElement = slottable.props.children;
|
|
96
|
+
const newChildren = childrenArray.map((child) => {
|
|
97
|
+
if (child === slottable) {
|
|
98
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
99
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
100
|
+
} else {
|
|
101
|
+
return child;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
return /* @__PURE__ */ React.createElement(SlotClone, { ...slotProps, ref: forwardedRef }, React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null);
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ React.createElement(SlotClone, { ...slotProps, ref: forwardedRef }, children);
|
|
107
|
+
});
|
|
108
|
+
Slot.displayName = "Slot";
|
|
109
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
110
|
+
const { children, ...slotProps } = props;
|
|
111
|
+
if (React.isValidElement(children)) {
|
|
112
|
+
return React.cloneElement(children, {
|
|
113
|
+
...mergeProps(slotProps, children.props),
|
|
114
|
+
ref: forwardedRef ? composeRefs(forwardedRef, children.ref) : children.ref
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
118
|
+
});
|
|
119
|
+
SlotClone.displayName = "SlotClone";
|
|
120
|
+
const Slottable = ({ children }) => {
|
|
121
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
122
|
+
};
|
|
123
|
+
function isSlottable(child) {
|
|
124
|
+
return React.isValidElement(child) && child.type === Slottable;
|
|
125
|
+
}
|
|
126
|
+
function mergeProps(slotProps, childProps) {
|
|
127
|
+
const overrideProps = { ...childProps };
|
|
128
|
+
for (const propName in childProps) {
|
|
129
|
+
const slotPropValue = slotProps[propName];
|
|
130
|
+
const childPropValue = childProps[propName];
|
|
131
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
132
|
+
if (isHandler) {
|
|
133
|
+
if (slotPropValue && childPropValue) {
|
|
134
|
+
overrideProps[propName] = (...args) => {
|
|
135
|
+
childPropValue(...args);
|
|
136
|
+
slotPropValue(...args);
|
|
137
|
+
};
|
|
138
|
+
} else if (slotPropValue) {
|
|
139
|
+
overrideProps[propName] = slotPropValue;
|
|
140
|
+
}
|
|
141
|
+
} else if (propName === "style") {
|
|
142
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
143
|
+
} else if (propName === "className") {
|
|
144
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return { ...slotProps, ...overrideProps };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const NODES = ["button", "div", "span", "img", "video", "audio"];
|
|
151
|
+
const Primitive = NODES.reduce((primitives, node) => {
|
|
152
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
153
|
+
const { asChild, ...primitiveProps } = props;
|
|
154
|
+
const Comp = asChild ? Slot : node;
|
|
155
|
+
return /* @__PURE__ */ React.createElement(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
156
|
+
});
|
|
157
|
+
Node.displayName = `Primitive.${node}`;
|
|
158
|
+
return { ...primitives, [node]: Node };
|
|
159
|
+
}, {});
|
|
160
|
+
|
|
161
|
+
function isRemotionProvider(provider) {
|
|
162
|
+
return provider?.$$PROVIDER_TYPE === "REMOTION";
|
|
163
|
+
}
|
|
164
|
+
function isRemotionSrc(src) {
|
|
165
|
+
return src?.type === "video/remotion";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const sliderStateRecord = SliderInstance.state.record, initialSliderStore = Object.keys(sliderStateRecord).reduce(
|
|
169
|
+
(store, prop) => ({
|
|
170
|
+
...store,
|
|
171
|
+
[prop]() {
|
|
172
|
+
return sliderStateRecord[prop];
|
|
173
|
+
}
|
|
174
|
+
}),
|
|
175
|
+
{}
|
|
176
|
+
);
|
|
177
|
+
function useSliderState(prop, ref) {
|
|
178
|
+
const $state = useStateContext(sliderState);
|
|
179
|
+
return useSignal((ref?.current?.$state || $state || initialSliderStore)[prop]);
|
|
180
|
+
}
|
|
181
|
+
function useSliderStore(ref) {
|
|
182
|
+
const $state = useStateContext(sliderState);
|
|
183
|
+
return useSignalRecord(ref?.current ? ref.current.$state : $state || initialSliderStore);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const IS_SERVER = typeof document === "undefined";
|
|
187
|
+
|
|
188
|
+
const mediaStateRecord = MediaPlayerInstance.state.record, initialMediaStore = Object.keys(mediaStateRecord).reduce(
|
|
189
|
+
(store, prop) => ({
|
|
190
|
+
...store,
|
|
191
|
+
[prop]() {
|
|
192
|
+
return mediaStateRecord[prop];
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
{}
|
|
196
|
+
);
|
|
197
|
+
function useMediaState(prop, ref) {
|
|
198
|
+
const $state = useStateContext(mediaState);
|
|
199
|
+
return useSignal((ref?.current?.$state || $state || initialMediaStore)[prop]);
|
|
200
|
+
}
|
|
201
|
+
function useMediaStore(ref) {
|
|
202
|
+
const $state = useStateContext(mediaState);
|
|
203
|
+
return useSignalRecord(ref?.current ? ref.current.$state : $state || initialMediaStore);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { AirPlayButtonInstance, AudioGainSliderInstance, CaptionButtonInstance, CaptionsInstance, ControlsGroupInstance, ControlsInstance, FullscreenButtonInstance, GestureInstance, GoogleCastButtonInstance, IS_SERVER, LiveButtonInstance, MediaAnnouncerInstance, MediaPlayerInstance, MediaProviderInstance, MenuButtonInstance, MenuInstance, MenuItemInstance, MenuItemsInstance, MenuPortalInstance, MuteButtonInstance, PIPButtonInstance, PlayButtonInstance, PosterInstance, Primitive, QualitySliderInstance, RadioGroupInstance, RadioInstance, SeekButtonInstance, SliderChaptersInstance, SliderInstance, SliderPreviewInstance, SliderThumbnailInstance, SliderValueInstance, SliderVideoInstance, SpeedSliderInstance, ThumbnailInstance, TimeInstance, TimeSliderInstance, ToggleButtonInstance, TooltipContentInstance, TooltipInstance, TooltipTriggerInstance, VolumeSliderInstance, isRemotionProvider, isRemotionSrc, useMediaState, useMediaStore, useSliderState, useSliderStore };
|
|
@@ -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-DiHlnSws.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-D4t_SZbb.js';
|
|
7
|
+
import '../chunks/vidstack-B4rJ1ZKK.js';
|
|
8
|
+
import '../chunks/vidstack-SkX-mSrw.js';
|
|
9
|
+
import 'vidstack';
|
|
10
|
+
import '../chunks/vidstack-DbNoKLjz.js';
|
|
11
11
|
import 'react-dom';
|
|
12
|
-
import '../chunks/vidstack-
|
|
13
|
-
import '../chunks/vidstack-
|
|
12
|
+
import '../chunks/vidstack-BTdEfKqV.js';
|
|
13
|
+
import '../chunks/vidstack-DeS67_gx.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-D4t_SZbb.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-DiHlnSws.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-D4t_SZbb.js';
|
|
7
|
+
import '../chunks/vidstack-B4rJ1ZKK.js';
|
|
8
|
+
import '../chunks/vidstack-SkX-mSrw.js';
|
|
9
|
+
import 'vidstack';
|
|
10
|
+
import '../chunks/vidstack-DbNoKLjz.js';
|
|
11
11
|
import 'react-dom';
|
|
12
|
-
import '../chunks/vidstack-
|
|
13
|
-
import '../chunks/vidstack-
|
|
12
|
+
import '../chunks/vidstack-BTdEfKqV.js';
|
|
13
|
+
import '../chunks/vidstack-DeS67_gx.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-SkX-mSrw.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-D4t_SZbb.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-DbNoKLjz.js';
|
|
8
|
+
import { useMediaRemote, useVideoQualityOptions, usePlaybackRateOptions } from '../chunks/vidstack-DnoqxmOs.js';
|
|
9
|
+
import { useLayoutName, useClassName } from '../chunks/vidstack-BTdEfKqV.js';
|
|
10
|
+
import { RemotionThumbnail, RemotionPoster, RemotionSliderThumbnail } from '../chunks/vidstack-DeS67_gx.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-D4t_SZbb.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-SkX-mSrw.js';
|
|
7
|
+
export { isRemotionProvider } from '../chunks/vidstack-SkX-mSrw.js';
|
|
8
|
+
import { RemotionThumbnail as RemotionThumbnail$1, RemotionSliderThumbnail as RemotionSliderThumbnail$1, RemotionPoster as RemotionPoster$1 } from '../chunks/vidstack-DeS67_gx.js';
|
|
9
|
+
import 'vidstack';
|
|
10
10
|
|
|
11
11
|
class RemotionLayoutEngine {
|
|
12
12
|
#src = null;
|
|
@@ -328,7 +328,7 @@ class RemotionProviderLoader {
|
|
|
328
328
|
return "video";
|
|
329
329
|
}
|
|
330
330
|
async load(ctx) {
|
|
331
|
-
return new (await import('../chunks/vidstack-
|
|
331
|
+
return new (await import('../chunks/vidstack-DOIUveQF.js')).RemotionProvider(this.target, ctx);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
|