@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
package/dev/vidstack.js
CHANGED
|
@@ -1,136 +1,25 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
export * from 'vidstack/exports/core.ts';
|
|
4
|
+
export * from 'vidstack/exports/events.ts';
|
|
5
|
+
export * from 'vidstack/exports/foundation.ts';
|
|
6
|
+
export * from 'vidstack/exports/maverick.ts';
|
|
7
|
+
export * from 'vidstack/exports/providers.ts';
|
|
8
|
+
export * from 'vidstack/exports/utils.ts';
|
|
9
|
+
export { DEFAULT_AUDIO_GAINS, DEFAULT_PLAYBACK_RATES, sliderState } from 'vidstack/exports/components.ts';
|
|
10
|
+
import { Primitive, MediaPlayerInstance, MediaProviderInstance, isRemotionProvider, ToggleButtonInstance, PosterInstance, useMediaState } from './chunks/vidstack-FuCbl228.js';
|
|
11
|
+
export { AirPlayButtonInstance, AudioGainSliderInstance, CaptionButtonInstance, CaptionsInstance, ControlsGroupInstance, ControlsInstance, FullscreenButtonInstance, GestureInstance, GoogleCastButtonInstance, LiveButtonInstance, MediaAnnouncerInstance, MenuButtonInstance, MenuInstance, MenuItemInstance, MenuItemsInstance, MenuPortalInstance, MuteButtonInstance, PIPButtonInstance, PlayButtonInstance, QualitySliderInstance, RadioGroupInstance, RadioInstance, SeekButtonInstance, SliderChaptersInstance, SliderInstance, SliderPreviewInstance, SliderThumbnailInstance, SliderValueInstance, SliderVideoInstance, SpeedSliderInstance, ThumbnailInstance, TimeInstance, TimeSliderInstance, TooltipContentInstance, TooltipInstance, TooltipTriggerInstance, VolumeSliderInstance, useMediaStore, useSliderState, useSliderStore } from './chunks/vidstack-FuCbl228.js';
|
|
5
12
|
import * as React from 'react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { useMediaContext
|
|
11
|
-
export { AirPlayButton, CaptionButton, FullscreenButton, Gesture, LiveButton, menu as Menu, MuteButton, PIPButton, PlayButton, radioGroup as RadioGroup, SeekButton, slider as Slider, thumbnail as Thumbnail, Time, timeSlider as TimeSlider, volumeSlider as VolumeSlider, useAudioOptions, useCaptionOptions, useMediaPlayer } from './chunks/vidstack-
|
|
13
|
+
import { createReactComponent, useStateContext, useSignal, isString, composeRefs, useSignalRecord, effect, useReactScope, signal, EventsController } from './chunks/vidstack-BalWqr4j.js';
|
|
14
|
+
import { createSignal, useScoped } from './chunks/vidstack-gqKBE4xH.js';
|
|
15
|
+
export { audioGainSlider as AudioGainSlider, Captions, ChapterTitle, controls as Controls, GoogleCastButton, MediaAnnouncer, qualitySlider as QualitySlider, speedSlider as SpeedSlider, spinner as Spinner, Title, tooltip as Tooltip, useActiveTextCues, useActiveTextTrack, useChapterOptions, useChapterTitle, useTextCues } from './chunks/vidstack-gqKBE4xH.js';
|
|
16
|
+
import { mediaState, TextTrack, ThumbnailsLoader, updateSliderPreviewPlacement, DEFAULT_AUDIO_GAINS } from 'vidstack';
|
|
17
|
+
import { useMediaContext } from './chunks/vidstack-CqNX679o.js';
|
|
18
|
+
export { AirPlayButton, CaptionButton, FullscreenButton, Gesture, LiveButton, menu as Menu, MuteButton, PIPButton, PlayButton, radioGroup as RadioGroup, SeekButton, slider as Slider, thumbnail as Thumbnail, Time, timeSlider as TimeSlider, volumeSlider as VolumeSlider, useAudioOptions, useCaptionOptions, useMediaPlayer } from './chunks/vidstack-CqNX679o.js';
|
|
12
19
|
import { Icon } from './chunks/vidstack-CBF7iUqu.js';
|
|
13
|
-
export {
|
|
14
|
-
import '@floating-ui/dom';
|
|
20
|
+
export { useMediaRemote, usePlaybackRateOptions, useVideoQualityOptions } from './chunks/vidstack-PREbBNMG.js';
|
|
15
21
|
import 'react-dom';
|
|
16
22
|
|
|
17
|
-
class LibASSTextRenderer {
|
|
18
|
-
constructor(loader, config) {
|
|
19
|
-
this.loader = loader;
|
|
20
|
-
this.config = config;
|
|
21
|
-
}
|
|
22
|
-
priority = 1;
|
|
23
|
-
#instance = null;
|
|
24
|
-
#track = null;
|
|
25
|
-
#typeRE = /(ssa|ass)$/;
|
|
26
|
-
canRender(track, video) {
|
|
27
|
-
return !!video && !!track.src && (isString(track.type) && this.#typeRE.test(track.type) || this.#typeRE.test(track.src));
|
|
28
|
-
}
|
|
29
|
-
attach(video) {
|
|
30
|
-
if (!video) return;
|
|
31
|
-
this.loader().then(async (mod) => {
|
|
32
|
-
this.#instance = new mod.default({
|
|
33
|
-
...this.config,
|
|
34
|
-
video,
|
|
35
|
-
subUrl: this.#track?.src || ""
|
|
36
|
-
});
|
|
37
|
-
new EventsController(this.#instance).add("ready", () => {
|
|
38
|
-
const canvas = this.#instance?._canvas;
|
|
39
|
-
if (canvas) canvas.style.pointerEvents = "none";
|
|
40
|
-
}).add("error", (event) => {
|
|
41
|
-
if (!this.#track) return;
|
|
42
|
-
this.#track[TextTrackSymbol.readyState] = 3;
|
|
43
|
-
this.#track.dispatchEvent(
|
|
44
|
-
new DOMEvent("error", {
|
|
45
|
-
trigger: event,
|
|
46
|
-
detail: event.error
|
|
47
|
-
})
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
changeTrack(track) {
|
|
53
|
-
if (!track || track.readyState === 3) {
|
|
54
|
-
this.#freeTrack();
|
|
55
|
-
} else if (this.#track !== track) {
|
|
56
|
-
this.#instance?.setTrackByUrl(track.src);
|
|
57
|
-
this.#track = track;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
detach() {
|
|
61
|
-
this.#freeTrack();
|
|
62
|
-
}
|
|
63
|
-
#freeTrack() {
|
|
64
|
-
this.#instance?.freeTrack();
|
|
65
|
-
this.#track = null;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const DEFAULT_AUDIO_GAINS = [1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4];
|
|
70
|
-
class AudioGainRadioGroup extends Component {
|
|
71
|
-
static props = {
|
|
72
|
-
normalLabel: "Disabled",
|
|
73
|
-
gains: DEFAULT_AUDIO_GAINS
|
|
74
|
-
};
|
|
75
|
-
#media;
|
|
76
|
-
#menu;
|
|
77
|
-
#controller;
|
|
78
|
-
get value() {
|
|
79
|
-
return this.#controller.value;
|
|
80
|
-
}
|
|
81
|
-
get disabled() {
|
|
82
|
-
const { gains } = this.$props, { canSetAudioGain } = this.#media.$state;
|
|
83
|
-
return !canSetAudioGain() || gains().length === 0;
|
|
84
|
-
}
|
|
85
|
-
constructor() {
|
|
86
|
-
super();
|
|
87
|
-
this.#controller = new RadioGroupController();
|
|
88
|
-
this.#controller.onValueChange = this.#onValueChange.bind(this);
|
|
89
|
-
}
|
|
90
|
-
onSetup() {
|
|
91
|
-
this.#media = useMediaContext();
|
|
92
|
-
if (hasProvidedContext(menuContext)) {
|
|
93
|
-
this.#menu = useContext(menuContext);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
onConnect(el) {
|
|
97
|
-
effect(this.#watchValue.bind(this));
|
|
98
|
-
effect(this.#watchHintText.bind(this));
|
|
99
|
-
effect(this.#watchControllerDisabled.bind(this));
|
|
100
|
-
}
|
|
101
|
-
getOptions() {
|
|
102
|
-
const { gains, normalLabel } = this.$props;
|
|
103
|
-
return gains().map((gain) => ({
|
|
104
|
-
label: gain === 1 || gain === null ? normalLabel : String(gain * 100) + "%",
|
|
105
|
-
value: gain.toString()
|
|
106
|
-
}));
|
|
107
|
-
}
|
|
108
|
-
#watchValue() {
|
|
109
|
-
this.#controller.value = this.#getValue();
|
|
110
|
-
}
|
|
111
|
-
#watchHintText() {
|
|
112
|
-
const { normalLabel } = this.$props, { audioGain } = this.#media.$state, gain = audioGain();
|
|
113
|
-
this.#menu?.hint.set(gain === 1 || gain == null ? normalLabel() : String(gain * 100) + "%");
|
|
114
|
-
}
|
|
115
|
-
#watchControllerDisabled() {
|
|
116
|
-
this.#menu?.disable(this.disabled);
|
|
117
|
-
}
|
|
118
|
-
#getValue() {
|
|
119
|
-
const { audioGain } = this.#media.$state;
|
|
120
|
-
return audioGain()?.toString() ?? "1";
|
|
121
|
-
}
|
|
122
|
-
#onValueChange(value, trigger) {
|
|
123
|
-
if (this.disabled) return;
|
|
124
|
-
const gain = +value;
|
|
125
|
-
this.#media.remote.changeAudioGain(gain, trigger);
|
|
126
|
-
this.dispatch("change", { detail: gain, trigger });
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
const audiogainradiogroup__proto = AudioGainRadioGroup.prototype;
|
|
130
|
-
prop(audiogainradiogroup__proto, "value");
|
|
131
|
-
prop(audiogainradiogroup__proto, "disabled");
|
|
132
|
-
method(audiogainradiogroup__proto, "getOptions");
|
|
133
|
-
|
|
134
23
|
const playerCallbacks = [
|
|
135
24
|
"onAbort",
|
|
136
25
|
"onAudioTrackChange",
|
|
@@ -225,10 +114,10 @@ const MediaProvider = React.forwardRef(
|
|
|
225
114
|
);
|
|
226
115
|
MediaProvider.displayName = "MediaProvider";
|
|
227
116
|
function MediaOutlet({ provider, mediaProps, iframeProps }) {
|
|
228
|
-
const { sources, crossOrigin, poster, remotePlaybackInfo, nativeControls, viewType } = useStateContext(mediaState), { loader } = provider.$state, { $provider: $$provider, $providerSetup: $$providerSetup } = useMediaContext
|
|
117
|
+
const { sources, crossOrigin, poster, remotePlaybackInfo, nativeControls, viewType } = useStateContext(mediaState), { loader } = provider.$state, { $provider: $$provider, $providerSetup: $$providerSetup } = useMediaContext(), $sources = useSignal(sources), $nativeControls = useSignal(nativeControls), $crossOrigin = useSignal(crossOrigin), $poster = useSignal(poster), $loader = useSignal(loader), $provider = useSignal($$provider), $providerSetup = useSignal($$providerSetup), $remoteInfo = useSignal(remotePlaybackInfo), $mediaType = $loader?.mediaType(), $viewType = useSignal(viewType), isAudioView = $viewType === "audio", isYouTubeEmbed = $loader?.name === "youtube", isVimeoEmbed = $loader?.name === "vimeo", isEmbed = isYouTubeEmbed || isVimeoEmbed, isRemotion = $loader?.name === "remotion", isGoogleCast = $loader?.name === "google-cast", [googleCastIconPaths, setGoogleCastIconPaths] = React.useState(""), [hasMounted, setHasMounted] = React.useState(false);
|
|
229
118
|
React.useEffect(() => {
|
|
230
119
|
if (!isGoogleCast || googleCastIconPaths) return;
|
|
231
|
-
import('./chunks/vidstack-
|
|
120
|
+
import('./chunks/vidstack-BalWqr4j.js').then(function (n) { return n.chromecast; }).then((mod) => {
|
|
232
121
|
setGoogleCastIconPaths(mod.default);
|
|
233
122
|
});
|
|
234
123
|
}, [isGoogleCast]);
|
|
@@ -292,7 +181,7 @@ function MediaOutlet({ provider, mediaProps, iframeProps }) {
|
|
|
292
181
|
MediaOutlet.displayName = "MediaOutlet";
|
|
293
182
|
|
|
294
183
|
function createTextTrack(init) {
|
|
295
|
-
const media = useMediaContext
|
|
184
|
+
const media = useMediaContext(), track = React.useMemo(() => new TextTrack(init), Object.values(init));
|
|
296
185
|
React.useEffect(() => {
|
|
297
186
|
media.textTracks.add(track);
|
|
298
187
|
return () => void media.textTracks.remove(track);
|
|
@@ -429,7 +318,7 @@ function useStore(ctor, ref) {
|
|
|
429
318
|
}
|
|
430
319
|
|
|
431
320
|
function useMediaProvider() {
|
|
432
|
-
const [provider, setProvider] = React.useState(null), context = useMediaContext
|
|
321
|
+
const [provider, setProvider] = React.useState(null), context = useMediaContext();
|
|
433
322
|
if (!context) {
|
|
434
323
|
throw Error(
|
|
435
324
|
"[vidstack] no media context was found - was this called outside of `<MediaPlayer>`?"
|
|
@@ -552,7 +441,7 @@ function useAudioGainOptions({
|
|
|
552
441
|
gains = DEFAULT_AUDIO_GAINS,
|
|
553
442
|
disabledLabel = "disabled"
|
|
554
443
|
} = {}) {
|
|
555
|
-
const media = useMediaContext
|
|
444
|
+
const media = useMediaContext(), { audioGain, canSetAudioGain } = media.$state;
|
|
556
445
|
useSignal(audioGain);
|
|
557
446
|
useSignal(canSetAudioGain);
|
|
558
447
|
return React.useMemo(() => {
|
|
@@ -584,4 +473,4 @@ function useAudioGainOptions({
|
|
|
584
473
|
}, [gains]);
|
|
585
474
|
}
|
|
586
475
|
|
|
587
|
-
export { caption as Caption,
|
|
476
|
+
export { caption as Caption, Icon, MediaPlayer, MediaPlayerInstance, MediaProvider, MediaProviderInstance, Poster, PosterInstance, ToggleButton, ToggleButtonInstance, Track, createTextTrack, useActiveThumbnail, useAudioGainOptions, useMediaContext, useMediaProvider, useMediaState, useSliderPreview, useState, useStore, useThumbnails };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanifhan1f/vidstack-react",
|
|
3
3
|
"description": "UI component library for building high-quality, accessible video and audio experiences on the web.",
|
|
4
|
-
"version": "1.12.
|
|
4
|
+
"version": "1.12.30",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "index.d.ts",
|