videojs-vue 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -184
- package/dist/Audio-D-RH-zmq.js +55 -0
- package/dist/Audio-DmoQgIRM.d.ts +70 -0
- package/dist/AudioPlayerRoot-D47326rh.d.ts +79 -0
- package/dist/Video-fUL_ClzK.js +55 -0
- package/dist/actions-CRZ5C4-3.js +59 -0
- package/dist/audio/composables.d.ts +18 -0
- package/dist/audio/composables.js +25 -0
- package/dist/audio/core.d.ts +6 -0
- package/dist/audio/core.js +1 -0
- package/dist/audio/default.d.ts +947 -0
- package/dist/audio/default.js +6 -0
- package/dist/audio/index.d.ts +955 -0
- package/dist/audio/index.js +15 -0
- package/dist/audio/neutral.d.ts +947 -0
- package/dist/audio/neutral.js +6 -0
- package/dist/audio/skins/default.d.ts +2 -0
- package/dist/audio/skins/default.js +6 -0
- package/dist/audio/skins/neutral.d.ts +2 -0
- package/dist/audio/skins/neutral.js +6 -0
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +1 -0
- package/dist/context-Zjy9Z5Uy.js +16 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.js +1 -0
- package/dist/createAudioPlayer-BhUZLd4H.d.ts +11 -0
- package/dist/createAudioPlayer-BqZWB8il.js +68 -0
- package/dist/createAudioSkin-BNmtEp7u.js +17 -0
- package/dist/createElementComponent-CUeAF_JU.js +25 -0
- package/dist/createVideoPlayer-CU9HWSAy.js +70 -0
- package/dist/createVideoSkin-BxpJYgKe.js +22 -0
- package/dist/default-3MW_94HC.d.ts +7 -0
- package/dist/default-C4INOLJr.d.ts +7 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/i18n/index.js +54 -0
- package/dist/i18n-C4MwExsj.d.ts +1 -0
- package/dist/index-DhJ5A5TI.d.ts +1280 -0
- package/dist/index.d.ts +6 -130
- package/dist/index.js +14 -102
- package/dist/media/hls.d.ts +88 -0
- package/dist/media/hls.js +30 -0
- package/dist/neutral-DWxkiOeo.d.ts +7 -0
- package/dist/neutral-skin-B8htnvI5.d.ts +1 -0
- package/dist/neutral-x5edtrGj.d.ts +7 -0
- package/dist/player-DwjY3MEu.d.ts +1 -0
- package/dist/player-RUaCdKKE.d.ts +1 -0
- package/dist/props-D3O1wYXT.js +17 -0
- package/dist/register/audio/neutral-skin.d.ts +1 -0
- package/dist/register/audio/neutral-skin.js +1 -0
- package/dist/register/audio/player.d.ts +1 -0
- package/dist/register/audio/player.js +1 -0
- package/dist/register/audio/skin.d.ts +1 -0
- package/dist/register/audio/skin.js +1 -0
- package/dist/register/i18n.d.ts +1 -0
- package/dist/register/i18n.js +1 -0
- package/dist/register/ui/captions-button.d.ts +1 -0
- package/dist/register/ui/captions-button.js +1 -0
- package/dist/register/ui/container.d.ts +1 -0
- package/dist/register/ui/container.js +1 -0
- package/dist/register/ui/controls-content.d.ts +1 -0
- package/dist/register/ui/controls-content.js +1 -0
- package/dist/register/ui/controls-group.d.ts +1 -0
- package/dist/register/ui/controls-group.js +1 -0
- package/dist/register/ui/controls.d.ts +1 -0
- package/dist/register/ui/controls.js +1 -0
- package/dist/register/ui/fullscreen-button.d.ts +1 -0
- package/dist/register/ui/fullscreen-button.js +1 -0
- package/dist/register/ui/hotkey.d.ts +1 -0
- package/dist/register/ui/hotkey.js +1 -0
- package/dist/register/ui/mute-button.d.ts +1 -0
- package/dist/register/ui/mute-button.js +1 -0
- package/dist/register/ui/pip-button.d.ts +1 -0
- package/dist/register/ui/pip-button.js +1 -0
- package/dist/register/ui/play-button.d.ts +1 -0
- package/dist/register/ui/play-button.js +1 -0
- package/dist/register/ui/poster.d.ts +1 -0
- package/dist/register/ui/poster.js +1 -0
- package/dist/register/ui/seek-button.d.ts +1 -0
- package/dist/register/ui/seek-button.js +1 -0
- package/dist/register/ui/slider-buffer.d.ts +1 -0
- package/dist/register/ui/slider-buffer.js +1 -0
- package/dist/register/ui/slider-fill.d.ts +1 -0
- package/dist/register/ui/slider-fill.js +1 -0
- package/dist/register/ui/slider-thumb.d.ts +1 -0
- package/dist/register/ui/slider-thumb.js +1 -0
- package/dist/register/ui/slider-track.d.ts +1 -0
- package/dist/register/ui/slider-track.js +1 -0
- package/dist/register/ui/status-announcer.d.ts +1 -0
- package/dist/register/ui/status-announcer.js +1 -0
- package/dist/register/ui/time-slider.d.ts +1 -0
- package/dist/register/ui/time-slider.js +1 -0
- package/dist/register/ui/time.d.ts +1 -0
- package/dist/register/ui/time.js +1 -0
- package/dist/register/ui/volume-slider.d.ts +1 -0
- package/dist/register/ui/volume-slider.js +1 -0
- package/dist/register/video/neutral-skin.d.ts +1 -0
- package/dist/register/video/neutral-skin.js +1 -0
- package/dist/register/video/player.d.ts +1 -0
- package/dist/register/video/player.js +1 -0
- package/dist/register/video/skin.d.ts +1 -0
- package/dist/register/video/skin.js +1 -0
- package/dist/skin-0b-NvVj8.d.ts +1 -0
- package/dist/skins/default.d.ts +2 -0
- package/dist/skins/default.js +6 -0
- package/dist/skins/neutral.d.ts +2 -0
- package/dist/skins/neutral.js +6 -0
- package/dist/types-DR9kogyX.d.ts +24 -0
- package/dist/types-wAkjM01D.d.ts +42 -0
- package/dist/ui/captions-button.d.ts +20 -0
- package/dist/ui/captions-button.js +7 -0
- package/dist/ui/container.d.ts +6 -0
- package/dist/ui/container.js +6 -0
- package/dist/ui/controls-content.d.ts +6 -0
- package/dist/ui/controls-content.js +6 -0
- package/dist/ui/controls-group.d.ts +6 -0
- package/dist/ui/controls-group.js +6 -0
- package/dist/ui/controls.d.ts +12 -0
- package/dist/ui/controls.js +6 -0
- package/dist/ui/fullscreen-button.d.ts +20 -0
- package/dist/ui/fullscreen-button.js +7 -0
- package/dist/ui/hotkey.d.ts +28 -0
- package/dist/ui/hotkey.js +13 -0
- package/dist/ui/index.d.ts +41 -0
- package/dist/ui/index.js +41 -0
- package/dist/ui/mute-button.d.ts +20 -0
- package/dist/ui/mute-button.js +7 -0
- package/dist/ui/pip-button.d.ts +20 -0
- package/dist/ui/pip-button.js +7 -0
- package/dist/ui/play-button.d.ts +20 -0
- package/dist/ui/play-button.js +7 -0
- package/dist/ui/poster.d.ts +6 -0
- package/dist/ui/poster.js +6 -0
- package/dist/ui/seek-button.d.ts +22 -0
- package/dist/ui/seek-button.js +10 -0
- package/dist/ui/slider-buffer.d.ts +6 -0
- package/dist/ui/slider-buffer.js +6 -0
- package/dist/ui/slider-fill.d.ts +6 -0
- package/dist/ui/slider-fill.js +6 -0
- package/dist/ui/slider-thumb.d.ts +6 -0
- package/dist/ui/slider-thumb.js +6 -0
- package/dist/ui/slider-track.d.ts +6 -0
- package/dist/ui/slider-track.js +6 -0
- package/dist/ui/status-announcer.d.ts +6 -0
- package/dist/ui/status-announcer.js +6 -0
- package/dist/ui/time-slider.d.ts +37 -0
- package/dist/ui/time-slider.js +11 -0
- package/dist/ui/time.d.ts +26 -0
- package/dist/ui/time.js +12 -0
- package/dist/ui/volume-slider.d.ts +26 -0
- package/dist/ui/volume-slider.js +7 -0
- package/dist/useMediaElement-CO_r--i0.js +143 -0
- package/dist/usePlayerActions-D3ILoEVZ.js +28 -0
- package/dist/usePlayerActions-McyRKswV.d.ts +21 -0
- package/dist/usePlayerRoot-Nsnn7msd.js +162 -0
- package/dist/useStoreSelection-BFUpSMPo.js +19 -0
- package/dist/video/default.d.ts +1065 -0
- package/dist/video/default.js +6 -0
- package/dist/video/neutral.d.ts +1065 -0
- package/dist/video/neutral.js +6 -0
- package/dist/withSlot-DQS-dOOR.js +16 -0
- package/package.json +159 -103
- package/dist/AlertDialog-BPntemoC.js +0 -112
- package/dist/Audio-3HgRIaNt.js +0 -29
- package/dist/Audio-rV5KrK6q.d.ts +0 -7
- package/dist/BufferingIndicator-Crzitkyo.js +0 -64
- package/dist/CaptionsButton-DZvnZsRf.js +0 -124
- package/dist/CastButton-B645yeE0.js +0 -32
- package/dist/Controls-CEaWmHRW.js +0 -33
- package/dist/ErrorDialog-Csv288q6.js +0 -60
- package/dist/FullscreenButton-C29YwATz.js +0 -59
- package/dist/Gesture-DFE17PKp.js +0 -75
- package/dist/Hotkey-DbQF7Kcc.js +0 -72
- package/dist/MuteButton-DI9PgX0j.js +0 -47
- package/dist/PiPButton-Da-rW3zX.js +0 -55
- package/dist/PlayButton-D8BRNiiy.js +0 -51
- package/dist/PlaybackRateButton-BL6cly9Z.js +0 -60
- package/dist/Popover-BoMi7OiJ.js +0 -94
- package/dist/Poster-uAFVQvx8.js +0 -33
- package/dist/SeekButton-VPcC9jiz.js +0 -48
- package/dist/Slider-C8FCipIJ.js +0 -127
- package/dist/Thumbnail-D1iL13r4.js +0 -48
- package/dist/Time-pfGZovLG.js +0 -77
- package/dist/TimeSlider-dlcFBLwL.js +0 -147
- package/dist/Tooltip-DyEkP_xv.js +0 -119
- package/dist/Video-DZX6iEK6.d.ts +0 -7
- package/dist/Video-DtjXh6lt.js +0 -29
- package/dist/VolumeSlider-C_nTFP4G.js +0 -148
- package/dist/alert-dialog.d.ts +0 -2
- package/dist/alert-dialog.js +0 -2
- package/dist/audio.d.ts +0 -3
- package/dist/audio.js +0 -3
- package/dist/background.d.ts +0 -8
- package/dist/background.js +0 -19
- package/dist/buffering-indicator.d.ts +0 -2
- package/dist/buffering-indicator.js +0 -2
- package/dist/captions-button.d.ts +0 -2
- package/dist/captions-button.js +0 -2
- package/dist/cast-button.d.ts +0 -2
- package/dist/cast-button.js +0 -2
- package/dist/context-C48Uabdu.js +0 -83
- package/dist/controls.d.ts +0 -2
- package/dist/controls.js +0 -2
- package/dist/createParts-Cq1bDfQi.d.ts +0 -20
- package/dist/createParts-DQhQPfRO.js +0 -115
- package/dist/error-dialog.d.ts +0 -2
- package/dist/error-dialog.js +0 -2
- package/dist/formatClock-D8z33znG.js +0 -12
- package/dist/full-screen-button.d.ts +0 -2
- package/dist/full-screen-button.js +0 -2
- package/dist/gesture.d.ts +0 -2
- package/dist/gesture.js +0 -2
- package/dist/hotkey.d.ts +0 -2
- package/dist/hotkey.js +0 -2
- package/dist/index-B3CYxKTC.d.ts +0 -12
- package/dist/index-B6WjYRnz.d.ts +0 -33
- package/dist/index-BJwWXroQ.d.ts +0 -33
- package/dist/index-BQN2NnER.d.ts +0 -127
- package/dist/index-BfzCw_wH.d.ts +0 -71
- package/dist/index-Bt_p2vCi.d.ts +0 -176
- package/dist/index-Bx7oSSQd.d.ts +0 -33
- package/dist/index-C8DkRbnH.d.ts +0 -108
- package/dist/index-CSs1G8z6.d.ts +0 -7
- package/dist/index-CcKZD20a.d.ts +0 -90
- package/dist/index-Cp23VNuH.d.ts +0 -23
- package/dist/index-Cry-CeV9.d.ts +0 -57
- package/dist/index-D5lfnRsK.d.ts +0 -20
- package/dist/index-D8EBYIXG.d.ts +0 -38
- package/dist/index-DYxPIvnt.d.ts +0 -119
- package/dist/index-DrelWSL1.d.ts +0 -50
- package/dist/index-EsA6hZWc.d.ts +0 -23
- package/dist/index-RI8VZ21i.d.ts +0 -69
- package/dist/index-iTm4WaZf.d.ts +0 -33
- package/dist/index-lmsQv-dG.d.ts +0 -33
- package/dist/index-w4PLuacs.d.ts +0 -33
- package/dist/index-ygLHhQAa.d.ts +0 -7
- package/dist/live-audio.d.ts +0 -6
- package/dist/live-audio.js +0 -6
- package/dist/live-video.d.ts +0 -6
- package/dist/live-video.js +0 -6
- package/dist/mediaActions-Bhs90znv.js +0 -39
- package/dist/mute-button.d.ts +0 -2
- package/dist/mute-button.js +0 -2
- package/dist/pip-button.d.ts +0 -2
- package/dist/pip-button.js +0 -2
- package/dist/play-button.d.ts +0 -2
- package/dist/play-button.js +0 -2
- package/dist/playback-rate-button.d.ts +0 -2
- package/dist/playback-rate-button.js +0 -2
- package/dist/popover.d.ts +0 -2
- package/dist/popover.js +0 -2
- package/dist/poster.d.ts +0 -2
- package/dist/poster.js +0 -2
- package/dist/renderElement-D_UbvLk5.js +0 -114
- package/dist/seek-button.d.ts +0 -2
- package/dist/seek-button.js +0 -2
- package/dist/slider.d.ts +0 -3
- package/dist/slider.js +0 -2
- package/dist/thumbnail.d.ts +0 -2
- package/dist/thumbnail.js +0 -2
- package/dist/time-slider.d.ts +0 -3
- package/dist/time-slider.js +0 -2
- package/dist/time.d.ts +0 -2
- package/dist/time.js +0 -2
- package/dist/tooltip.d.ts +0 -2
- package/dist/tooltip.js +0 -2
- package/dist/useMediaEvents-Br7vzJ_l.js +0 -17
- package/dist/useSyncMediaProps-C7F52G6b.js +0 -95
- package/dist/video.d.ts +0 -3
- package/dist/video.js +0 -3
- package/dist/volume-slider.d.ts +0 -3
- package/dist/volume-slider.js +0 -2
package/README.md
CHANGED
|
@@ -5,204 +5,59 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/videojs-vue)
|
|
6
6
|
[](https://github.com/ntnyq/videojs-vue/blob/main/LICENSE)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Vue 3 components and composables for Video.js 10, with video and audio players, packaged skins, reactive playback state, and optional HLS support.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
> Status: **Beta**
|
|
10
|
+
[Documentation](https://videojs-vue-docs.vercel.app) · [Playground](https://videojs-vue-playground.vercel.app)
|
|
12
11
|
|
|
13
|
-
##
|
|
12
|
+
## Installation
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
pnpm add videojs-vue
|
|
17
|
-
```
|
|
14
|
+
Requires Vue 3.5 or later.
|
|
18
15
|
|
|
19
|
-
```
|
|
20
|
-
|
|
16
|
+
```sh
|
|
17
|
+
pnpm add videojs-vue vue
|
|
21
18
|
```
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
import { VideoPlayer } from 'videojs-vue/video/default'
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<VideoPlayer
|
|
29
|
+
src="/demo.mp4"
|
|
30
|
+
poster="/poster.webp"
|
|
31
|
+
title="Demo"
|
|
32
|
+
/>
|
|
33
|
+
</template>
|
|
25
34
|
```
|
|
26
35
|
|
|
27
|
-
|
|
36
|
+
Serve your video and poster at the URLs above. Component registration and skin styles are included; no Vue `isCustomElement` configuration is needed.
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
See the [documentation](https://videojs-vue-docs.vercel.app) for HLS, custom controls, internationalization, and the API reference. Try the [playground](https://videojs-vue-playground.vercel.app) for interactive examples.
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
import { createPlayer } from 'videojs-vue'
|
|
33
|
-
import { Video, videoFeatures } from 'videojs-vue/video'
|
|
40
|
+
## Audio
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
```
|
|
42
|
+
```vue
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { AudioPlayer } from 'videojs-vue/audio/default'
|
|
45
|
+
</script>
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setup() {
|
|
48
|
-
const paused = Player.usePlayer(state => state.paused)
|
|
49
|
-
const store = Player.usePlayer()
|
|
50
|
-
|
|
51
|
-
return () =>
|
|
52
|
-
h(Player.Provider, () =>
|
|
53
|
-
h(Player.Container, { class: 'player-shell' }, () => [
|
|
54
|
-
h(Video, {
|
|
55
|
-
src: 'https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4',
|
|
56
|
-
playsInline: true,
|
|
57
|
-
}),
|
|
58
|
-
h(
|
|
59
|
-
'button',
|
|
60
|
-
{
|
|
61
|
-
type: 'button',
|
|
62
|
-
onClick: () => (paused.value ? store.play() : store.pause()),
|
|
63
|
-
},
|
|
64
|
-
paused.value ? 'Play' : 'Pause',
|
|
65
|
-
),
|
|
66
|
-
]),
|
|
67
|
-
)
|
|
68
|
-
},
|
|
69
|
-
})
|
|
47
|
+
<template>
|
|
48
|
+
<AudioPlayer
|
|
49
|
+
src="/episode.mp3"
|
|
50
|
+
title="Episode one"
|
|
51
|
+
/>
|
|
52
|
+
</template>
|
|
70
53
|
```
|
|
71
54
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- `Provider`
|
|
78
|
-
- `Container`
|
|
79
|
-
- `usePlayer()`
|
|
80
|
-
- `useMedia()`
|
|
81
|
-
- `createPlayer({ plugins })` supports runtime extension hooks:
|
|
82
|
-
- `onProviderSetup(context)`
|
|
83
|
-
- `onAttach(context)`
|
|
84
|
-
- `onDetach(context)`
|
|
85
|
-
- `onProviderDestroy(context)`
|
|
86
|
-
- `usePlayer(selector)` returns a readonly `ref`, which is the Vue equivalent of the React hook's reactive selected value.
|
|
87
|
-
- `useOptionalPlayer()`, `useContainer()`, `useMediaAttach()` and `useContainerAttach()` are also exported for lower-level integrations.
|
|
88
|
-
- Utility exports:
|
|
89
|
-
- `mergeProps(...props)`
|
|
90
|
-
- `renderElement(tag, componentProps, params)`
|
|
91
|
-
|
|
92
|
-
### Preset entry points
|
|
93
|
-
|
|
94
|
-
- `videojs-vue/video`
|
|
95
|
-
- `Video`
|
|
96
|
-
- `videoFeatures`
|
|
97
|
-
- `videojs-vue/audio`
|
|
98
|
-
- `Audio`
|
|
99
|
-
- `audioFeatures`
|
|
100
|
-
- `videojs-vue/background`
|
|
101
|
-
- `BackgroundVideo`
|
|
102
|
-
- `backgroundFeatures`
|
|
103
|
-
- `videojs-vue/live-video`
|
|
104
|
-
- `Video`
|
|
105
|
-
- `liveVideoFeatures`
|
|
106
|
-
- `videojs-vue/live-audio`
|
|
107
|
-
- `Audio`
|
|
108
|
-
- `liveAudioFeatures`
|
|
109
|
-
|
|
110
|
-
### UI entry points
|
|
111
|
-
|
|
112
|
-
- `videojs-vue/full-screen-button` (or `videojs-vue/fullscreen-button`)
|
|
113
|
-
- `FullscreenButton`
|
|
114
|
-
- `videojs-vue/playback-rate-button`
|
|
115
|
-
- `PlaybackRateButton`
|
|
116
|
-
- `videojs-vue/poster`
|
|
117
|
-
- `Poster`
|
|
118
|
-
- `videojs-vue/time`
|
|
119
|
-
- `Time.Group`
|
|
120
|
-
- `Time.Separator`
|
|
121
|
-
- `Time.Value`
|
|
122
|
-
- `videojs-vue/play-button`
|
|
123
|
-
- `PlayButton`
|
|
124
|
-
- `videojs-vue/mute-button`
|
|
125
|
-
- `MuteButton`
|
|
126
|
-
- `videojs-vue/pip-button`
|
|
127
|
-
- `PiPButton`
|
|
128
|
-
- `videojs-vue/seek-button`
|
|
129
|
-
- `SeekButton`
|
|
130
|
-
- `videojs-vue/volume-slider`
|
|
131
|
-
- `VolumeSlider.Root`
|
|
132
|
-
- `VolumeSlider.Track`
|
|
133
|
-
- `VolumeSlider.Fill`
|
|
134
|
-
- `VolumeSlider.Thumb`
|
|
135
|
-
- `VolumeSlider.Value`
|
|
136
|
-
- `VolumeSlider.Preview`
|
|
137
|
-
- `videojs-vue/time-slider`
|
|
138
|
-
- `TimeSlider.Root`
|
|
139
|
-
- `TimeSlider.Track`
|
|
140
|
-
- `TimeSlider.Buffer`
|
|
141
|
-
- `TimeSlider.Fill`
|
|
142
|
-
- `TimeSlider.Thumb`
|
|
143
|
-
- `TimeSlider.Value`
|
|
144
|
-
- `TimeSlider.Preview`
|
|
145
|
-
- `videojs-vue/controls`
|
|
146
|
-
- `Controls.Root`
|
|
147
|
-
- `Controls.Group`
|
|
148
|
-
- `videojs-vue/tooltip`
|
|
149
|
-
- `Tooltip.Provider`
|
|
150
|
-
- `Tooltip.Root`
|
|
151
|
-
- `Tooltip.Trigger`
|
|
152
|
-
- `Tooltip.Popup`
|
|
153
|
-
- `Tooltip.Arrow`
|
|
154
|
-
- `videojs-vue/popover`
|
|
155
|
-
- `Popover.Root`
|
|
156
|
-
- `Popover.Trigger`
|
|
157
|
-
- `Popover.Popup`
|
|
158
|
-
- `Popover.Arrow`
|
|
159
|
-
- `videojs-vue/captions-button`
|
|
160
|
-
- `CaptionsButton`
|
|
161
|
-
- `videojs-vue/cast-button`
|
|
162
|
-
- `CastButton`
|
|
163
|
-
- `videojs-vue/buffering-indicator`
|
|
164
|
-
- `BufferingIndicator`
|
|
165
|
-
- `videojs-vue/alert-dialog`
|
|
166
|
-
- `AlertDialog.Root`
|
|
167
|
-
- `AlertDialog.Popup`
|
|
168
|
-
- `AlertDialog.Title`
|
|
169
|
-
- `AlertDialog.Description`
|
|
170
|
-
- `AlertDialog.Close`
|
|
171
|
-
- `videojs-vue/error-dialog`
|
|
172
|
-
- `ErrorDialog.Root`
|
|
173
|
-
- `ErrorDialog.Popup`
|
|
174
|
-
- `ErrorDialog.Title`
|
|
175
|
-
- `ErrorDialog.Description`
|
|
176
|
-
- `ErrorDialog.Close`
|
|
177
|
-
- `videojs-vue/hotkey`
|
|
178
|
-
- `Hotkey`
|
|
179
|
-
- `videojs-vue/gesture`
|
|
180
|
-
- `Gesture`
|
|
181
|
-
- `videojs-vue/thumbnail`
|
|
182
|
-
- `Thumbnail`
|
|
183
|
-
- `videojs-vue/slider`
|
|
184
|
-
- `Slider.Root`
|
|
185
|
-
- `Slider.Track`
|
|
186
|
-
- `Slider.Buffer`
|
|
187
|
-
- `Slider.Fill`
|
|
188
|
-
- `Slider.Thumb`
|
|
189
|
-
- `Slider.Value`
|
|
190
|
-
- `Slider.Preview`
|
|
191
|
-
- `Slider.Thumbnail`
|
|
192
|
-
|
|
193
|
-
## Notes
|
|
194
|
-
|
|
195
|
-
- `Provider` owns the Video.js store instance and reattaches it whenever the media element or container changes.
|
|
196
|
-
- `Container` keeps the same focus behavior as the React implementation: on pointer release it focuses itself when nothing inside already has focus, so keyboard shortcuts can work reliably.
|
|
197
|
-
- Media components use native `<video>` / `<audio>` elements, register themselves automatically through provide/inject, and reactively sync key media props (`src`, `poster`, `autoplay`, `controls`, `loop`, `muted`, `playsInline`, `preload`, `crossOrigin`, `volume`, `playbackRate`).
|
|
198
|
-
- Captions button now uses reactive track state and auto-disables when no caption/subtitle tracks are available.
|
|
199
|
-
|
|
200
|
-
## Migration (Current Beta)
|
|
201
|
-
|
|
202
|
-
- UI button primitives now use unified internal prop-merging behavior (`mergeProps`) instead of per-component manual click chaining.
|
|
203
|
-
- External event handlers still run before internal handlers and can cancel internal behavior via `event.preventDefault()`.
|
|
204
|
-
- Prefer `playsInline` over lowercase `playsinline` in JSX/templates.
|
|
55
|
+
The fixed audio entry loads only the default audio skin. Use `videojs-vue/audio` when switching between both skins at runtime. Lightweight `core`, `composables`, and individual control entries are also available; see [bundle size and imports](https://videojs-vue-docs.vercel.app/guide/bundle-size). See the [audio API](https://videojs-vue-docs.vercel.app/api/audio).
|
|
56
|
+
|
|
57
|
+
## Credits
|
|
58
|
+
|
|
59
|
+
Built on [Video.js](https://videojs.org), which provides the player, media adapters, and controls. Thanks to the [Video.js contributors](https://github.com/videojs/video.js).
|
|
205
60
|
|
|
206
61
|
## License
|
|
207
62
|
|
|
208
|
-
[MIT](
|
|
63
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { t as createCommonPlayerActions } from "./actions-CRZ5C4-3.js";
|
|
2
|
+
import { t as AUDIO_PLAYER_CONTEXT } from "./context-Zjy9Z5Uy.js";
|
|
3
|
+
import "./register/audio/player.js";
|
|
4
|
+
import { a as mediaEmits, n as commonMediaProps, t as useMediaElement } from "./useMediaElement-CO_r--i0.js";
|
|
5
|
+
import { n as preservePlayerTree, r as createPlayerEmits, t as usePlayerRoot } from "./usePlayerRoot-Nsnn7msd.js";
|
|
6
|
+
import { defineComponent, h, provide, withDirectives } from "vue";
|
|
7
|
+
//#region src/audio/AudioPlayerRoot.ts
|
|
8
|
+
const audioPlayerEmits = createPlayerEmits();
|
|
9
|
+
/**
|
|
10
|
+
* Vue component ref exposes the player handle alongside the standard instance.
|
|
11
|
+
*/
|
|
12
|
+
const AudioPlayerRoot = defineComponent({
|
|
13
|
+
name: "AudioPlayerRoot",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
title: String,
|
|
17
|
+
poster: String
|
|
18
|
+
},
|
|
19
|
+
emits: audioPlayerEmits,
|
|
20
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
21
|
+
const { element, handle } = usePlayerRoot(createCommonPlayerActions, {
|
|
22
|
+
onReady: () => emit("ready", handle),
|
|
23
|
+
onMediaEvent: emit,
|
|
24
|
+
onVolume: (volume) => emit("update:volume", volume),
|
|
25
|
+
onMuted: (muted) => emit("update:muted", muted),
|
|
26
|
+
onPlaybackRate: (rate) => emit("update:playbackRate", rate)
|
|
27
|
+
});
|
|
28
|
+
provide(AUDIO_PLAYER_CONTEXT, handle);
|
|
29
|
+
expose(handle);
|
|
30
|
+
return () => withDirectives(h("audio-player", {
|
|
31
|
+
...attrs,
|
|
32
|
+
ref: element,
|
|
33
|
+
"content-title": props.title,
|
|
34
|
+
poster: props.poster
|
|
35
|
+
}, slots["default"]?.()), [[preservePlayerTree]]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/audio/Audio.ts
|
|
40
|
+
const Audio = defineComponent({
|
|
41
|
+
name: "Audio",
|
|
42
|
+
inheritAttrs: false,
|
|
43
|
+
props: commonMediaProps,
|
|
44
|
+
emits: mediaEmits,
|
|
45
|
+
setup(props, context) {
|
|
46
|
+
return useMediaElement({
|
|
47
|
+
tag: "audio",
|
|
48
|
+
props,
|
|
49
|
+
context,
|
|
50
|
+
emit: context.emit
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { AudioPlayerRoot as n, audioPlayerEmits as r, Audio as t };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { t as MediaTrack } from "./types-wAkjM01D.js";
|
|
2
|
+
import "./index-DhJ5A5TI.js";
|
|
3
|
+
//#region src/audio/Audio.d.ts
|
|
4
|
+
declare const Audio: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
|
+
readonly src: import("vue").PropType<string | undefined>;
|
|
6
|
+
readonly autoplay: BooleanConstructor;
|
|
7
|
+
readonly loop: BooleanConstructor;
|
|
8
|
+
readonly preload: {
|
|
9
|
+
readonly type: import("vue").PropType<'none' | 'metadata' | 'auto'>;
|
|
10
|
+
readonly default: 'metadata';
|
|
11
|
+
};
|
|
12
|
+
readonly crossorigin: import("vue").PropType<'' | 'anonymous' | 'use-credentials' | undefined>;
|
|
13
|
+
readonly tracks: import("vue").PropType<readonly MediaTrack[] | undefined>;
|
|
14
|
+
readonly volume: import("vue").PropType<number | undefined>;
|
|
15
|
+
readonly muted: {
|
|
16
|
+
readonly type: import("vue").PropType<boolean | undefined>;
|
|
17
|
+
readonly default: undefined;
|
|
18
|
+
};
|
|
19
|
+
readonly playbackRate: import("vue").PropType<number | undefined>;
|
|
20
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<"abort" | "canplay" | "canplaythrough" | "durationchange" | "emptied" | "ended" | "enterpictureinpicture" | "error" | "leavepictureinpicture" | "loadeddata" | "loadedmetadata" | "loadstart" | "pause" | "play" | "playing" | "progress" | "ratechange" | "seeked" | "seeking" | "stalled" | "suspend" | "timeupdate" | "volumechange" | "waiting", (event: Event) => boolean>, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
readonly src: import("vue").PropType<string | undefined>;
|
|
24
|
+
readonly autoplay: BooleanConstructor;
|
|
25
|
+
readonly loop: BooleanConstructor;
|
|
26
|
+
readonly preload: {
|
|
27
|
+
readonly type: import("vue").PropType<'none' | 'metadata' | 'auto'>;
|
|
28
|
+
readonly default: 'metadata';
|
|
29
|
+
};
|
|
30
|
+
readonly crossorigin: import("vue").PropType<'' | 'anonymous' | 'use-credentials' | undefined>;
|
|
31
|
+
readonly tracks: import("vue").PropType<readonly MediaTrack[] | undefined>;
|
|
32
|
+
readonly volume: import("vue").PropType<number | undefined>;
|
|
33
|
+
readonly muted: {
|
|
34
|
+
readonly type: import("vue").PropType<boolean | undefined>;
|
|
35
|
+
readonly default: undefined;
|
|
36
|
+
};
|
|
37
|
+
readonly playbackRate: import("vue").PropType<number | undefined>;
|
|
38
|
+
}>> & Readonly<{
|
|
39
|
+
onAbort?: (event: Event) => any;
|
|
40
|
+
onCanplay?: (event: Event) => any;
|
|
41
|
+
onCanplaythrough?: (event: Event) => any;
|
|
42
|
+
onDurationchange?: (event: Event) => any;
|
|
43
|
+
onEmptied?: (event: Event) => any;
|
|
44
|
+
onEnded?: (event: Event) => any;
|
|
45
|
+
onEnterpictureinpicture?: (event: Event) => any;
|
|
46
|
+
onError?: (event: Event) => any;
|
|
47
|
+
onLeavepictureinpicture?: (event: Event) => any;
|
|
48
|
+
onLoadeddata?: (event: Event) => any;
|
|
49
|
+
onLoadedmetadata?: (event: Event) => any;
|
|
50
|
+
onLoadstart?: (event: Event) => any;
|
|
51
|
+
onPause?: (event: Event) => any;
|
|
52
|
+
onPlay?: (event: Event) => any;
|
|
53
|
+
onPlaying?: (event: Event) => any;
|
|
54
|
+
onProgress?: (event: Event) => any;
|
|
55
|
+
onRatechange?: (event: Event) => any;
|
|
56
|
+
onSeeked?: (event: Event) => any;
|
|
57
|
+
onSeeking?: (event: Event) => any;
|
|
58
|
+
onStalled?: (event: Event) => any;
|
|
59
|
+
onSuspend?: (event: Event) => any;
|
|
60
|
+
onTimeupdate?: (event: Event) => any;
|
|
61
|
+
onVolumechange?: (event: Event) => any;
|
|
62
|
+
onWaiting?: (event: Event) => any;
|
|
63
|
+
}>, {
|
|
64
|
+
readonly autoplay: boolean;
|
|
65
|
+
readonly loop: boolean;
|
|
66
|
+
readonly preload: "auto" | "metadata" | "none";
|
|
67
|
+
readonly muted: boolean | undefined;
|
|
68
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { Audio as t };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { r as AudioPlayerHandle } from "./types-DR9kogyX.js";
|
|
2
|
+
import "./player-DwjY3MEu.js";
|
|
3
|
+
import { PropType } from "vue";
|
|
4
|
+
//#region src/audio/AudioPlayerRoot.d.ts
|
|
5
|
+
declare const component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
title: PropType<string | undefined>;
|
|
7
|
+
poster: PropType<string | undefined>;
|
|
8
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
ready: (_player: AudioPlayerHandle) => boolean;
|
|
12
|
+
'update:volume': (_volume: number) => boolean;
|
|
13
|
+
'update:muted': (_muted: boolean) => boolean;
|
|
14
|
+
'update:playbackRate': (_rate: number) => boolean;
|
|
15
|
+
abort: (event: Event) => boolean;
|
|
16
|
+
canplay: (event: Event) => boolean;
|
|
17
|
+
canplaythrough: (event: Event) => boolean;
|
|
18
|
+
durationchange: (event: Event) => boolean;
|
|
19
|
+
emptied: (event: Event) => boolean;
|
|
20
|
+
ended: (event: Event) => boolean;
|
|
21
|
+
enterpictureinpicture: (event: Event) => boolean;
|
|
22
|
+
error: (event: Event) => boolean;
|
|
23
|
+
leavepictureinpicture: (event: Event) => boolean;
|
|
24
|
+
loadeddata: (event: Event) => boolean;
|
|
25
|
+
loadedmetadata: (event: Event) => boolean;
|
|
26
|
+
loadstart: (event: Event) => boolean;
|
|
27
|
+
pause: (event: Event) => boolean;
|
|
28
|
+
play: (event: Event) => boolean;
|
|
29
|
+
playing: (event: Event) => boolean;
|
|
30
|
+
progress: (event: Event) => boolean;
|
|
31
|
+
ratechange: (event: Event) => boolean;
|
|
32
|
+
seeked: (event: Event) => boolean;
|
|
33
|
+
seeking: (event: Event) => boolean;
|
|
34
|
+
stalled: (event: Event) => boolean;
|
|
35
|
+
suspend: (event: Event) => boolean;
|
|
36
|
+
timeupdate: (event: Event) => boolean;
|
|
37
|
+
volumechange: (event: Event) => boolean;
|
|
38
|
+
waiting: (event: Event) => boolean;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
title: PropType<string | undefined>;
|
|
41
|
+
poster: PropType<string | undefined>;
|
|
42
|
+
}>> & Readonly<{
|
|
43
|
+
onAbort?: (event: Event) => any;
|
|
44
|
+
onCanplay?: (event: Event) => any;
|
|
45
|
+
onCanplaythrough?: (event: Event) => any;
|
|
46
|
+
onDurationchange?: (event: Event) => any;
|
|
47
|
+
onEmptied?: (event: Event) => any;
|
|
48
|
+
onEnded?: (event: Event) => any;
|
|
49
|
+
onEnterpictureinpicture?: (event: Event) => any;
|
|
50
|
+
onError?: (event: Event) => any;
|
|
51
|
+
onLeavepictureinpicture?: (event: Event) => any;
|
|
52
|
+
onLoadeddata?: (event: Event) => any;
|
|
53
|
+
onLoadedmetadata?: (event: Event) => any;
|
|
54
|
+
onLoadstart?: (event: Event) => any;
|
|
55
|
+
onPause?: (event: Event) => any;
|
|
56
|
+
onPlay?: (event: Event) => any;
|
|
57
|
+
onPlaying?: (event: Event) => any;
|
|
58
|
+
onProgress?: (event: Event) => any;
|
|
59
|
+
onRatechange?: (event: Event) => any;
|
|
60
|
+
onReady?: (_player: AudioPlayerHandle) => any;
|
|
61
|
+
onSeeked?: (event: Event) => any;
|
|
62
|
+
onSeeking?: (event: Event) => any;
|
|
63
|
+
onStalled?: (event: Event) => any;
|
|
64
|
+
onSuspend?: (event: Event) => any;
|
|
65
|
+
onTimeupdate?: (event: Event) => any;
|
|
66
|
+
"onUpdate:muted"?: (_muted: boolean) => any;
|
|
67
|
+
"onUpdate:playbackRate"?: (_rate: number) => any;
|
|
68
|
+
"onUpdate:volume"?: (_volume: number) => any;
|
|
69
|
+
onVolumechange?: (event: Event) => any;
|
|
70
|
+
onWaiting?: (event: Event) => any;
|
|
71
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
|
+
/**
|
|
73
|
+
* Vue component ref exposes the player handle alongside the standard instance.
|
|
74
|
+
*/
|
|
75
|
+
declare const AudioPlayerRoot: typeof component & {
|
|
76
|
+
new (): InstanceType<typeof component> & AudioPlayerHandle;
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { AudioPlayerRoot as t };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { n as createPlayerActions } from "./actions-CRZ5C4-3.js";
|
|
2
|
+
import { r as PLAYER_CONTEXT } from "./context-Zjy9Z5Uy.js";
|
|
3
|
+
import { a as mediaEmits, r as mediaProps, t as useMediaElement } from "./useMediaElement-CO_r--i0.js";
|
|
4
|
+
import { n as preservePlayerTree, r as createPlayerEmits, t as usePlayerRoot } from "./usePlayerRoot-Nsnn7msd.js";
|
|
5
|
+
import "./register/video/player.js";
|
|
6
|
+
import { defineComponent, h, provide, withDirectives } from "vue";
|
|
7
|
+
//#region src/player/PlayerRoot.ts
|
|
8
|
+
const playerEmits = createPlayerEmits();
|
|
9
|
+
/**
|
|
10
|
+
* Vue component ref exposes the player handle alongside the standard instance.
|
|
11
|
+
*/
|
|
12
|
+
const PlayerRoot = defineComponent({
|
|
13
|
+
name: "PlayerRoot",
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
title: String,
|
|
17
|
+
poster: String
|
|
18
|
+
},
|
|
19
|
+
emits: playerEmits,
|
|
20
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
21
|
+
const { element, handle } = usePlayerRoot(createPlayerActions, {
|
|
22
|
+
onReady: () => emit("ready", handle),
|
|
23
|
+
onMediaEvent: emit,
|
|
24
|
+
onVolume: (volume) => emit("update:volume", volume),
|
|
25
|
+
onMuted: (muted) => emit("update:muted", muted),
|
|
26
|
+
onPlaybackRate: (rate) => emit("update:playbackRate", rate)
|
|
27
|
+
});
|
|
28
|
+
provide(PLAYER_CONTEXT, handle);
|
|
29
|
+
expose(handle);
|
|
30
|
+
return () => withDirectives(h("video-player", {
|
|
31
|
+
...attrs,
|
|
32
|
+
ref: element,
|
|
33
|
+
"content-title": props.title,
|
|
34
|
+
poster: props.poster
|
|
35
|
+
}, slots["default"]?.()), [[preservePlayerTree]]);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/media/Video.ts
|
|
40
|
+
const Video = defineComponent({
|
|
41
|
+
name: "Video",
|
|
42
|
+
inheritAttrs: false,
|
|
43
|
+
props: mediaProps,
|
|
44
|
+
emits: mediaEmits,
|
|
45
|
+
setup(props, context) {
|
|
46
|
+
return useMediaElement({
|
|
47
|
+
tag: "video",
|
|
48
|
+
props,
|
|
49
|
+
context,
|
|
50
|
+
emit: context.emit
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { PlayerRoot as n, playerEmits as r, Video as t };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/player/actions.ts
|
|
2
|
+
function requirePlayerStore(getStore) {
|
|
3
|
+
const store = getStore();
|
|
4
|
+
if (!store) throw new Error("[videojs-vue] Player is not ready or is inactive.");
|
|
5
|
+
return store;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Resolve shared playback commands against the active store on every call.
|
|
9
|
+
* @param {() => AudioPlayerStore | null} getStore - Reads the currently active audio or video store.
|
|
10
|
+
* @returns {CommonPlayerActions} Commands bound to the current player.
|
|
11
|
+
*/
|
|
12
|
+
function createCommonPlayerActions(getStore) {
|
|
13
|
+
const requireStore = () => requirePlayerStore(getStore);
|
|
14
|
+
return {
|
|
15
|
+
async play() {
|
|
16
|
+
return await requireStore().play();
|
|
17
|
+
},
|
|
18
|
+
pause() {
|
|
19
|
+
return requireStore().pause();
|
|
20
|
+
},
|
|
21
|
+
async seek(time) {
|
|
22
|
+
return await requireStore().seek(time);
|
|
23
|
+
},
|
|
24
|
+
setVolume(volume) {
|
|
25
|
+
return requireStore().setVolume(volume);
|
|
26
|
+
},
|
|
27
|
+
setMuted(muted) {
|
|
28
|
+
return requireStore().setMuted(muted);
|
|
29
|
+
},
|
|
30
|
+
setPlaybackRate(rate) {
|
|
31
|
+
return requireStore().setPlaybackRate(rate);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve on every call so actions cannot retain an unmounted player's store.
|
|
37
|
+
* @param {() => PlayerStore | null} getStore - Reads the currently active store.
|
|
38
|
+
* @returns {PlayerActions} Commands bound to the current player.
|
|
39
|
+
*/
|
|
40
|
+
function createPlayerActions(getStore) {
|
|
41
|
+
const requireStore = () => requirePlayerStore(getStore);
|
|
42
|
+
return {
|
|
43
|
+
...createCommonPlayerActions(getStore),
|
|
44
|
+
async requestFullscreen() {
|
|
45
|
+
return await requireStore().requestFullscreen();
|
|
46
|
+
},
|
|
47
|
+
async exitFullscreen() {
|
|
48
|
+
return await requireStore().exitFullscreen();
|
|
49
|
+
},
|
|
50
|
+
async requestPictureInPicture() {
|
|
51
|
+
return await requireStore().requestPictureInPicture();
|
|
52
|
+
},
|
|
53
|
+
async exitPictureInPicture() {
|
|
54
|
+
return await requireStore().exitPictureInPicture();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { createPlayerActions as n, createCommonPlayerActions as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { a as AudioPlayerStore, i as AudioPlayerState, o as AudioPlayerTarget, r as AudioPlayerHandle, t as AudioPlayerActions } from "../types-DR9kogyX.js";
|
|
2
|
+
import { ComputedRef } from "vue";
|
|
3
|
+
//#region src/audio/composables.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Subscribe to an audio snapshot selection; unavailable players yield undefined.
|
|
6
|
+
* @param {(state: AudioPlayerState) => Selected} selector - Selects from the immutable upstream audio snapshot.
|
|
7
|
+
* @param {AudioPlayerTarget} target - Explicit player target, or injected audio context when omitted.
|
|
8
|
+
* @returns {ComputedRef<Selected | undefined>} A readonly selection, undefined while unavailable.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAudioPlayerState<Selected>(selector: (state: AudioPlayerState) => Selected, target?: AudioPlayerTarget): ComputedRef<Selected | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the current audio player on each call. Unready actions are never queued.
|
|
13
|
+
* @param {AudioPlayerTarget} target - Explicit player target, or injected audio context when omitted.
|
|
14
|
+
* @returns {AudioPlayerActions} Playback commands bound to the current player.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAudioPlayerActions(target?: AudioPlayerTarget): AudioPlayerActions;
|
|
17
|
+
//#endregion
|
|
18
|
+
export type { AudioPlayerActions, AudioPlayerHandle, AudioPlayerState, AudioPlayerStore, AudioPlayerTarget };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { t as useStoreSelection } from "../useStoreSelection-BFUpSMPo.js";
|
|
2
|
+
import { t as createCommonPlayerActions } from "../actions-CRZ5C4-3.js";
|
|
3
|
+
import { a as useTarget, t as AUDIO_PLAYER_CONTEXT } from "../context-Zjy9Z5Uy.js";
|
|
4
|
+
//#region src/audio/composables.ts
|
|
5
|
+
/**
|
|
6
|
+
* Subscribe to an audio snapshot selection; unavailable players yield undefined.
|
|
7
|
+
* @param {(state: AudioPlayerState) => Selected} selector - Selects from the immutable upstream audio snapshot.
|
|
8
|
+
* @param {AudioPlayerTarget} target - Explicit player target, or injected audio context when omitted.
|
|
9
|
+
* @returns {ComputedRef<Selected | undefined>} A readonly selection, undefined while unavailable.
|
|
10
|
+
*/
|
|
11
|
+
function useAudioPlayerState(selector, target) {
|
|
12
|
+
const player = useTarget(AUDIO_PLAYER_CONTEXT, "AudioPlayerRoot", target);
|
|
13
|
+
return useStoreSelection(() => player.value?.store, selector);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the current audio player on each call. Unready actions are never queued.
|
|
17
|
+
* @param {AudioPlayerTarget} target - Explicit player target, or injected audio context when omitted.
|
|
18
|
+
* @returns {AudioPlayerActions} Playback commands bound to the current player.
|
|
19
|
+
*/
|
|
20
|
+
function useAudioPlayerActions(target) {
|
|
21
|
+
const player = useTarget(AUDIO_PLAYER_CONTEXT, "AudioPlayerRoot", target);
|
|
22
|
+
return createCommonPlayerActions(() => player.value?.store ?? null);
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { useAudioPlayerActions, useAudioPlayerState };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { a as PlayerMedia, t as MediaTrack } from "../types-wAkjM01D.js";
|
|
2
|
+
import { a as AudioPlayerStore, i as AudioPlayerState, n as AudioPlayerElement, o as AudioPlayerTarget, r as AudioPlayerHandle, t as AudioPlayerActions } from "../types-DR9kogyX.js";
|
|
3
|
+
import { t as AudioPlayerRoot } from "../AudioPlayerRoot-D47326rh.js";
|
|
4
|
+
import { r as MediaEventName, t as CommonMediaProps } from "../index-DhJ5A5TI.js";
|
|
5
|
+
import { t as Audio } from "../Audio-DmoQgIRM.js";
|
|
6
|
+
export { Audio, type CommonMediaProps as AudioMediaProps, type AudioPlayerActions, type AudioPlayerElement, type AudioPlayerHandle, AudioPlayerRoot, type AudioPlayerState, type AudioPlayerStore, type AudioPlayerTarget, type MediaEventName, type MediaTrack, type PlayerMedia };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Audio, n as AudioPlayerRoot } from "../Audio-D-RH-zmq.js";
|