videojs-vue 0.2.0 → 0.3.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 +6 -0
- package/dist/{Audio-DmoQgIRM.d.ts → audio/Audio.d.ts} +4 -5
- package/dist/audio/Audio.js +21 -0
- package/dist/audio/AudioPlayer.d.ts +948 -0
- package/dist/audio/AudioPlayer.js +10 -0
- package/dist/{AudioPlayerRoot-D47326rh.d.ts → audio/AudioPlayerRoot.d.ts} +34 -4
- package/dist/audio/AudioPlayerRoot.js +43 -0
- package/dist/audio/composables.d.ts +1 -1
- package/dist/audio/composables.js +11 -5
- package/dist/audio/core.d.ts +6 -5
- package/dist/audio/core.js +3 -1
- package/dist/audio/createAudioPlayer.d.ts +954 -0
- package/dist/{createAudioPlayer-BqZWB8il.js → audio/createAudioPlayer.js} +16 -8
- package/dist/audio/default.d.ts +5 -4
- package/dist/audio/default.js +1 -1
- package/dist/audio/index.d.ts +13 -952
- package/dist/audio/index.js +4 -9
- package/dist/audio/neutral.d.ts +5 -4
- package/dist/audio/neutral.js +1 -1
- package/dist/audio/skins/createAudioSkin.d.ts +5 -0
- package/dist/audio/skins/createAudioSkin.js +20 -0
- package/dist/audio/skins/default.d.ts +6 -2
- package/dist/audio/skins/default.js +1 -1
- package/dist/audio/skins/neutral.d.ts +6 -2
- package/dist/audio/skins/neutral.js +1 -1
- package/dist/audio/skins.d.ts +3 -0
- package/dist/audio/skins.js +3 -0
- package/dist/audio/types.d.ts +22 -0
- package/dist/audio/types.js +0 -0
- package/dist/composables/index.d.ts +3 -2
- package/dist/composables/index.js +3 -1
- package/dist/composables/usePlayerActions.d.ts +9 -0
- package/dist/composables/usePlayerActions.js +17 -0
- package/dist/composables/usePlayerState.d.ts +12 -0
- package/dist/composables/usePlayerState.js +19 -0
- package/dist/composables/useStoreSelection.d.ts +9 -0
- package/dist/{useStoreSelection-BFUpSMPo.js → composables/useStoreSelection.js} +1 -1
- package/dist/core/index.d.ts +6 -2
- package/dist/core/index.js +3 -1
- package/dist/i18n/MediaI18n.d.ts +16 -0
- package/dist/i18n/MediaI18n.js +26 -0
- package/dist/i18n/MediaText.d.ts +14 -0
- package/dist/i18n/MediaText.js +37 -0
- package/dist/i18n/index.d.ts +3 -29
- package/dist/i18n/index.js +2 -52
- package/dist/index.d.ts +16 -5
- package/dist/index.js +5 -9
- package/dist/media/Video.d.ts +79 -0
- package/dist/media/Video.js +21 -0
- package/dist/media/events.d.ts +5 -0
- package/dist/media/events.js +30 -0
- package/dist/media/hls.d.ts +1 -2
- package/dist/media/hls.js +3 -1
- package/dist/media/props.d.ts +45 -0
- package/dist/media/props.js +28 -0
- package/dist/media/types.d.ts +23 -0
- package/dist/media/types.js +0 -0
- package/dist/media/useMediaElement.d.ts +18 -0
- package/dist/media/useMediaElement.js +91 -0
- package/dist/node_modules/.pnpm/@vue_reactivity@3.5.43/node_modules/@vue/reactivity/dist/reactivity.d.ts +3 -0
- package/dist/player/PlayerRoot.d.ts +109 -0
- package/dist/player/PlayerRoot.js +43 -0
- package/dist/player/actions.d.ts +17 -0
- package/dist/{actions-CRZ5C4-3.js → player/actions.js} +1 -1
- package/dist/player/context.d.ts +18 -0
- package/dist/{context-Zjy9Z5Uy.js → player/context.js} +1 -1
- package/dist/player/events.d.ts +32 -0
- package/dist/player/events.js +13 -0
- package/dist/player/preservePlayerTree.d.ts +8 -0
- package/dist/player/preservePlayerTree.js +64 -0
- package/dist/player/types.d.ts +22 -0
- package/dist/player/types.js +0 -0
- package/dist/player/usePlayerRoot.d.ts +32 -0
- package/dist/player/usePlayerRoot.js +89 -0
- package/dist/polyfills.d.ts +2 -0
- package/dist/polyfills.js +2 -0
- package/dist/register/audio/player.d.ts +1 -1
- package/dist/register/i18n.d.ts +1 -1
- package/dist/register/video/compat-skin.d.ts +1 -0
- package/dist/register/video/compat-skin.js +1 -0
- package/dist/register/video/neutral-skin.d.ts +1 -1
- package/dist/register/video/player.d.ts +1 -1
- package/dist/register/video/skin.d.ts +1 -1
- package/dist/skins/compat.d.ts +6 -0
- package/dist/skins/compat.js +6 -0
- package/dist/skins/createVideoSkin.d.ts +5 -0
- package/dist/skins/createVideoSkin.js +25 -0
- package/dist/skins/default.d.ts +6 -2
- package/dist/skins/default.js +1 -1
- package/dist/skins/index.d.ts +3 -0
- package/dist/skins/index.js +3 -0
- package/dist/skins/legacy/LegacyControls.d.ts +8 -0
- package/dist/skins/legacy/LegacyControls.js +89 -0
- package/dist/skins/legacy/useLegacySize.d.ts +9 -0
- package/dist/skins/legacy/useLegacySize.js +32 -0
- package/dist/skins/legacy.css +160 -0
- package/dist/skins/legacy.d.ts +6 -0
- package/dist/skins/legacy.js +36 -0
- package/dist/skins/neutral.d.ts +6 -2
- package/dist/skins/neutral.js +1 -1
- package/dist/skins/withSlot.d.ts +10 -0
- package/dist/{withSlot-DQS-dOOR.js → skins/withSlot.js} +1 -1
- package/dist/ui/captions-button.d.ts +1 -1
- package/dist/ui/captions-button.js +3 -3
- package/dist/ui/container.d.ts +1 -1
- package/dist/ui/container.js +2 -2
- package/dist/ui/controls-content.d.ts +1 -1
- package/dist/ui/controls-content.js +2 -2
- package/dist/ui/controls-group.d.ts +1 -1
- package/dist/ui/controls-group.js +2 -2
- package/dist/ui/controls.d.ts +1 -1
- package/dist/ui/controls.js +2 -2
- package/dist/ui/createElementComponent.d.ts +10 -0
- package/dist/{createElementComponent-CUeAF_JU.js → ui/createElementComponent.js} +6 -3
- package/dist/ui/fullscreen-button.d.ts +1 -1
- package/dist/ui/fullscreen-button.js +3 -3
- package/dist/ui/hotkey.d.ts +1 -1
- package/dist/ui/hotkey.js +3 -3
- package/dist/ui/index.d.ts +10 -10
- package/dist/ui/index.js +21 -21
- package/dist/ui/mute-button.d.ts +1 -1
- package/dist/ui/mute-button.js +3 -3
- package/dist/ui/pip-button.d.ts +1 -1
- package/dist/ui/pip-button.js +3 -3
- package/dist/ui/play-button.d.ts +1 -1
- package/dist/ui/play-button.js +3 -3
- package/dist/ui/poster.d.ts +1 -1
- package/dist/ui/poster.js +2 -2
- package/dist/ui/props.d.ts +25 -0
- package/dist/{props-D3O1wYXT.js → ui/props.js} +1 -1
- package/dist/ui/seek-button.d.ts +1 -1
- package/dist/ui/seek-button.js +3 -3
- package/dist/ui/slider-buffer.d.ts +1 -1
- package/dist/ui/slider-buffer.js +2 -2
- package/dist/ui/slider-fill.d.ts +1 -1
- package/dist/ui/slider-fill.js +2 -2
- package/dist/ui/slider-thumb.d.ts +1 -1
- package/dist/ui/slider-thumb.js +2 -2
- package/dist/ui/slider-track.d.ts +1 -1
- package/dist/ui/slider-track.js +2 -2
- package/dist/ui/status-announcer.d.ts +1 -1
- package/dist/ui/status-announcer.js +2 -2
- package/dist/ui/time-slider.d.ts +1 -1
- package/dist/ui/time-slider.js +3 -3
- package/dist/ui/time.d.ts +1 -1
- package/dist/ui/time.js +3 -3
- package/dist/ui/volume-slider.d.ts +1 -1
- package/dist/ui/volume-slider.js +3 -3
- package/dist/{index-DhJ5A5TI.d.ts → video/VideoPlayer.d.ts} +21 -233
- package/dist/video/VideoPlayer.js +10 -0
- package/dist/video/compat.d.ts +1068 -0
- package/dist/video/compat.js +6 -0
- package/dist/video/createVideoPlayer.d.ts +1076 -0
- package/dist/{createVideoPlayer-CU9HWSAy.js → video/createVideoPlayer.js} +17 -9
- package/dist/video/default.d.ts +18 -15
- package/dist/video/default.js +1 -1
- package/dist/video/legacy.d.ts +1068 -0
- package/dist/video/legacy.js +6 -0
- package/dist/video/neutral.d.ts +18 -15
- package/dist/video/neutral.js +1 -1
- package/package.json +38 -7
- package/dist/Audio-D-RH-zmq.js +0 -55
- package/dist/Video-fUL_ClzK.js +0 -55
- package/dist/createAudioPlayer-BhUZLd4H.d.ts +0 -11
- package/dist/createAudioSkin-BNmtEp7u.js +0 -17
- package/dist/createVideoSkin-BxpJYgKe.js +0 -22
- package/dist/default-3MW_94HC.d.ts +0 -7
- package/dist/default-C4INOLJr.d.ts +0 -7
- package/dist/i18n-C4MwExsj.d.ts +0 -1
- package/dist/neutral-DWxkiOeo.d.ts +0 -7
- package/dist/neutral-skin-B8htnvI5.d.ts +0 -1
- package/dist/neutral-x5edtrGj.d.ts +0 -7
- package/dist/player-DwjY3MEu.d.ts +0 -1
- package/dist/player-RUaCdKKE.d.ts +0 -1
- package/dist/skin-0b-NvVj8.d.ts +0 -1
- package/dist/types-DR9kogyX.d.ts +0 -24
- package/dist/types-wAkjM01D.d.ts +0 -42
- package/dist/useMediaElement-CO_r--i0.js +0 -143
- package/dist/usePlayerActions-D3ILoEVZ.js +0 -28
- package/dist/usePlayerActions-McyRKswV.d.ts +0 -21
- package/dist/usePlayerRoot-Nsnn7msd.js +0 -162
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createAudioPlayer } from "./createAudioPlayer.js";
|
|
2
|
+
import { DefaultAudioSkin } from "./skins/default.js";
|
|
3
|
+
import { NeutralAudioSkin } from "./skins/neutral.js";
|
|
4
|
+
//#region src/audio/AudioPlayer.ts
|
|
5
|
+
const AudioPlayer = /* @__PURE__ */ createAudioPlayer("AudioPlayer", {
|
|
6
|
+
default: DefaultAudioSkin,
|
|
7
|
+
neutral: NeutralAudioSkin
|
|
8
|
+
}, "default");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { AudioPlayer };
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
1
|
+
import { AudioPlayerHandle } from "./types.js";
|
|
2
|
+
import "../register/audio/player.js";
|
|
3
3
|
import { PropType } from "vue";
|
|
4
4
|
//#region src/audio/AudioPlayerRoot.d.ts
|
|
5
|
+
export declare const audioPlayerEmits: {
|
|
6
|
+
ready: (_player: AudioPlayerHandle) => boolean;
|
|
7
|
+
'update:volume': (_volume: number) => boolean;
|
|
8
|
+
'update:muted': (_muted: boolean) => boolean;
|
|
9
|
+
'update:playbackRate': (_rate: number) => boolean;
|
|
10
|
+
abort: (event: Event) => boolean;
|
|
11
|
+
canplay: (event: Event) => boolean;
|
|
12
|
+
canplaythrough: (event: Event) => boolean;
|
|
13
|
+
durationchange: (event: Event) => boolean;
|
|
14
|
+
emptied: (event: Event) => boolean;
|
|
15
|
+
ended: (event: Event) => boolean;
|
|
16
|
+
enterpictureinpicture: (event: Event) => boolean;
|
|
17
|
+
error: (event: Event) => boolean;
|
|
18
|
+
leavepictureinpicture: (event: Event) => boolean;
|
|
19
|
+
loadeddata: (event: Event) => boolean;
|
|
20
|
+
loadedmetadata: (event: Event) => boolean;
|
|
21
|
+
loadstart: (event: Event) => boolean;
|
|
22
|
+
pause: (event: Event) => boolean;
|
|
23
|
+
play: (event: Event) => boolean;
|
|
24
|
+
playing: (event: Event) => boolean;
|
|
25
|
+
progress: (event: Event) => boolean;
|
|
26
|
+
ratechange: (event: Event) => boolean;
|
|
27
|
+
seeked: (event: Event) => boolean;
|
|
28
|
+
seeking: (event: Event) => boolean;
|
|
29
|
+
stalled: (event: Event) => boolean;
|
|
30
|
+
suspend: (event: Event) => boolean;
|
|
31
|
+
timeupdate: (event: Event) => boolean;
|
|
32
|
+
volumechange: (event: Event) => boolean;
|
|
33
|
+
waiting: (event: Event) => boolean;
|
|
34
|
+
};
|
|
5
35
|
declare const component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
36
|
title: PropType<string | undefined>;
|
|
7
37
|
poster: PropType<string | undefined>;
|
|
@@ -72,8 +102,8 @@ declare const component: import("vue").DefineComponent<import("vue").ExtractProp
|
|
|
72
102
|
/**
|
|
73
103
|
* Vue component ref exposes the player handle alongside the standard instance.
|
|
74
104
|
*/
|
|
75
|
-
declare const AudioPlayerRoot: typeof component & {
|
|
105
|
+
export declare const AudioPlayerRoot: typeof component & {
|
|
76
106
|
new (): InstanceType<typeof component> & AudioPlayerHandle;
|
|
77
107
|
};
|
|
78
108
|
//#endregion
|
|
79
|
-
export {
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AUDIO_PLAYER_CONTEXT } from "../player/context.js";
|
|
2
|
+
import { createCommonPlayerActions } from "../player/actions.js";
|
|
3
|
+
import { createPlayerEmits } from "../player/events.js";
|
|
4
|
+
import { preservePlayerTree } from "../player/preservePlayerTree.js";
|
|
5
|
+
import { usePlayerRoot } from "../player/usePlayerRoot.js";
|
|
6
|
+
import "../register/audio/player.js";
|
|
7
|
+
import { defineComponent, h, provide, withDirectives } from "vue";
|
|
8
|
+
//#region src/audio/AudioPlayerRoot.ts
|
|
9
|
+
const audioPlayerEmits = createPlayerEmits();
|
|
10
|
+
/**
|
|
11
|
+
* Vue component ref exposes the player handle alongside the standard instance.
|
|
12
|
+
*/
|
|
13
|
+
const AudioPlayerRoot = defineComponent({
|
|
14
|
+
name: "AudioPlayerRoot",
|
|
15
|
+
inheritAttrs: false,
|
|
16
|
+
props: {
|
|
17
|
+
title: String,
|
|
18
|
+
poster: String
|
|
19
|
+
},
|
|
20
|
+
emits: audioPlayerEmits,
|
|
21
|
+
setup(props, { attrs, slots, emit, expose }) {
|
|
22
|
+
const { element, handle } = usePlayerRoot(createCommonPlayerActions, {
|
|
23
|
+
onReady: () => emit("ready", handle),
|
|
24
|
+
onMediaEvent: emit,
|
|
25
|
+
onVolume: (volume) => emit("update:volume", volume),
|
|
26
|
+
onMuted: (muted) => emit("update:muted", muted),
|
|
27
|
+
onPlaybackRate: (rate) => emit("update:playbackRate", rate)
|
|
28
|
+
});
|
|
29
|
+
provide(AUDIO_PLAYER_CONTEXT, handle);
|
|
30
|
+
expose(handle);
|
|
31
|
+
return () => {
|
|
32
|
+
var _slots$default;
|
|
33
|
+
return withDirectives(h("audio-player", {
|
|
34
|
+
...attrs,
|
|
35
|
+
ref: element,
|
|
36
|
+
"content-title": props.title,
|
|
37
|
+
poster: props.poster
|
|
38
|
+
}, (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)), [[preservePlayerTree]]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AudioPlayerRoot, audioPlayerEmits };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AudioPlayerActions, AudioPlayerHandle, AudioPlayerState, AudioPlayerStore, AudioPlayerTarget } from "./types.js";
|
|
2
2
|
import { ComputedRef } from "vue";
|
|
3
3
|
//#region src/audio/composables.d.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AUDIO_PLAYER_CONTEXT, useTarget } from "../player/context.js";
|
|
2
|
+
import { createCommonPlayerActions } from "../player/actions.js";
|
|
3
|
+
import { useStoreSelection } from "../composables/useStoreSelection.js";
|
|
4
4
|
//#region src/audio/composables.ts
|
|
5
5
|
/**
|
|
6
6
|
* Subscribe to an audio snapshot selection; unavailable players yield undefined.
|
|
@@ -10,7 +10,10 @@ import { a as useTarget, t as AUDIO_PLAYER_CONTEXT } from "../context-Zjy9Z5Uy.j
|
|
|
10
10
|
*/
|
|
11
11
|
function useAudioPlayerState(selector, target) {
|
|
12
12
|
const player = useTarget(AUDIO_PLAYER_CONTEXT, "AudioPlayerRoot", target);
|
|
13
|
-
return useStoreSelection(() =>
|
|
13
|
+
return useStoreSelection(() => {
|
|
14
|
+
var _player$value;
|
|
15
|
+
return (_player$value = player.value) === null || _player$value === void 0 ? void 0 : _player$value.store;
|
|
16
|
+
}, selector);
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Resolve the current audio player on each call. Unready actions are never queued.
|
|
@@ -19,7 +22,10 @@ function useAudioPlayerState(selector, target) {
|
|
|
19
22
|
*/
|
|
20
23
|
function useAudioPlayerActions(target) {
|
|
21
24
|
const player = useTarget(AUDIO_PLAYER_CONTEXT, "AudioPlayerRoot", target);
|
|
22
|
-
return createCommonPlayerActions(() =>
|
|
25
|
+
return createCommonPlayerActions(() => {
|
|
26
|
+
var _player$value2;
|
|
27
|
+
return ((_player$value2 = player.value) === null || _player$value2 === void 0 ? void 0 : _player$value2.store) ?? null;
|
|
28
|
+
});
|
|
23
29
|
}
|
|
24
30
|
//#endregion
|
|
25
31
|
export { useAudioPlayerActions, useAudioPlayerState };
|
package/dist/audio/core.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { MediaTrack, PlayerMedia } from "../media/types.js";
|
|
2
|
+
import { MediaEventName } from "../media/events.js";
|
|
3
|
+
import { CommonMediaProps } from "../media/props.js";
|
|
4
|
+
import { Audio } from "./Audio.js";
|
|
5
|
+
import { AudioPlayerActions, AudioPlayerElement, AudioPlayerHandle, AudioPlayerState, AudioPlayerStore, AudioPlayerTarget } from "./types.js";
|
|
6
|
+
import { AudioPlayerRoot } from "./AudioPlayerRoot.js";
|
|
6
7
|
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 };
|
package/dist/audio/core.js
CHANGED