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.
Files changed (181) hide show
  1. package/README.md +6 -0
  2. package/dist/{Audio-DmoQgIRM.d.ts → audio/Audio.d.ts} +4 -5
  3. package/dist/audio/Audio.js +21 -0
  4. package/dist/audio/AudioPlayer.d.ts +948 -0
  5. package/dist/audio/AudioPlayer.js +10 -0
  6. package/dist/{AudioPlayerRoot-D47326rh.d.ts → audio/AudioPlayerRoot.d.ts} +34 -4
  7. package/dist/audio/AudioPlayerRoot.js +43 -0
  8. package/dist/audio/composables.d.ts +1 -1
  9. package/dist/audio/composables.js +11 -5
  10. package/dist/audio/core.d.ts +6 -5
  11. package/dist/audio/core.js +3 -1
  12. package/dist/audio/createAudioPlayer.d.ts +954 -0
  13. package/dist/{createAudioPlayer-BqZWB8il.js → audio/createAudioPlayer.js} +16 -8
  14. package/dist/audio/default.d.ts +5 -4
  15. package/dist/audio/default.js +1 -1
  16. package/dist/audio/index.d.ts +13 -952
  17. package/dist/audio/index.js +4 -9
  18. package/dist/audio/neutral.d.ts +5 -4
  19. package/dist/audio/neutral.js +1 -1
  20. package/dist/audio/skins/createAudioSkin.d.ts +5 -0
  21. package/dist/audio/skins/createAudioSkin.js +20 -0
  22. package/dist/audio/skins/default.d.ts +6 -2
  23. package/dist/audio/skins/default.js +1 -1
  24. package/dist/audio/skins/neutral.d.ts +6 -2
  25. package/dist/audio/skins/neutral.js +1 -1
  26. package/dist/audio/skins.d.ts +3 -0
  27. package/dist/audio/skins.js +3 -0
  28. package/dist/audio/types.d.ts +22 -0
  29. package/dist/audio/types.js +0 -0
  30. package/dist/composables/index.d.ts +3 -2
  31. package/dist/composables/index.js +3 -1
  32. package/dist/composables/usePlayerActions.d.ts +9 -0
  33. package/dist/composables/usePlayerActions.js +17 -0
  34. package/dist/composables/usePlayerState.d.ts +12 -0
  35. package/dist/composables/usePlayerState.js +19 -0
  36. package/dist/composables/useStoreSelection.d.ts +9 -0
  37. package/dist/{useStoreSelection-BFUpSMPo.js → composables/useStoreSelection.js} +1 -1
  38. package/dist/core/index.d.ts +6 -2
  39. package/dist/core/index.js +3 -1
  40. package/dist/i18n/MediaI18n.d.ts +16 -0
  41. package/dist/i18n/MediaI18n.js +26 -0
  42. package/dist/i18n/MediaText.d.ts +14 -0
  43. package/dist/i18n/MediaText.js +37 -0
  44. package/dist/i18n/index.d.ts +3 -29
  45. package/dist/i18n/index.js +2 -52
  46. package/dist/index.d.ts +16 -5
  47. package/dist/index.js +5 -9
  48. package/dist/media/Video.d.ts +79 -0
  49. package/dist/media/Video.js +21 -0
  50. package/dist/media/events.d.ts +5 -0
  51. package/dist/media/events.js +30 -0
  52. package/dist/media/hls.d.ts +1 -2
  53. package/dist/media/hls.js +3 -1
  54. package/dist/media/props.d.ts +45 -0
  55. package/dist/media/props.js +28 -0
  56. package/dist/media/types.d.ts +23 -0
  57. package/dist/media/types.js +0 -0
  58. package/dist/media/useMediaElement.d.ts +18 -0
  59. package/dist/media/useMediaElement.js +91 -0
  60. package/dist/node_modules/.pnpm/@vue_reactivity@3.5.43/node_modules/@vue/reactivity/dist/reactivity.d.ts +3 -0
  61. package/dist/player/PlayerRoot.d.ts +109 -0
  62. package/dist/player/PlayerRoot.js +43 -0
  63. package/dist/player/actions.d.ts +17 -0
  64. package/dist/{actions-CRZ5C4-3.js → player/actions.js} +1 -1
  65. package/dist/player/context.d.ts +18 -0
  66. package/dist/{context-Zjy9Z5Uy.js → player/context.js} +1 -1
  67. package/dist/player/events.d.ts +32 -0
  68. package/dist/player/events.js +13 -0
  69. package/dist/player/preservePlayerTree.d.ts +8 -0
  70. package/dist/player/preservePlayerTree.js +64 -0
  71. package/dist/player/types.d.ts +22 -0
  72. package/dist/player/types.js +0 -0
  73. package/dist/player/usePlayerRoot.d.ts +32 -0
  74. package/dist/player/usePlayerRoot.js +89 -0
  75. package/dist/polyfills.d.ts +2 -0
  76. package/dist/polyfills.js +2 -0
  77. package/dist/register/audio/player.d.ts +1 -1
  78. package/dist/register/i18n.d.ts +1 -1
  79. package/dist/register/video/compat-skin.d.ts +1 -0
  80. package/dist/register/video/compat-skin.js +1 -0
  81. package/dist/register/video/neutral-skin.d.ts +1 -1
  82. package/dist/register/video/player.d.ts +1 -1
  83. package/dist/register/video/skin.d.ts +1 -1
  84. package/dist/skins/compat.d.ts +6 -0
  85. package/dist/skins/compat.js +6 -0
  86. package/dist/skins/createVideoSkin.d.ts +5 -0
  87. package/dist/skins/createVideoSkin.js +25 -0
  88. package/dist/skins/default.d.ts +6 -2
  89. package/dist/skins/default.js +1 -1
  90. package/dist/skins/index.d.ts +3 -0
  91. package/dist/skins/index.js +3 -0
  92. package/dist/skins/legacy/LegacyControls.d.ts +8 -0
  93. package/dist/skins/legacy/LegacyControls.js +89 -0
  94. package/dist/skins/legacy/useLegacySize.d.ts +9 -0
  95. package/dist/skins/legacy/useLegacySize.js +32 -0
  96. package/dist/skins/legacy.css +160 -0
  97. package/dist/skins/legacy.d.ts +6 -0
  98. package/dist/skins/legacy.js +36 -0
  99. package/dist/skins/neutral.d.ts +6 -2
  100. package/dist/skins/neutral.js +1 -1
  101. package/dist/skins/withSlot.d.ts +10 -0
  102. package/dist/{withSlot-DQS-dOOR.js → skins/withSlot.js} +1 -1
  103. package/dist/ui/captions-button.d.ts +1 -1
  104. package/dist/ui/captions-button.js +3 -3
  105. package/dist/ui/container.d.ts +1 -1
  106. package/dist/ui/container.js +2 -2
  107. package/dist/ui/controls-content.d.ts +1 -1
  108. package/dist/ui/controls-content.js +2 -2
  109. package/dist/ui/controls-group.d.ts +1 -1
  110. package/dist/ui/controls-group.js +2 -2
  111. package/dist/ui/controls.d.ts +1 -1
  112. package/dist/ui/controls.js +2 -2
  113. package/dist/ui/createElementComponent.d.ts +10 -0
  114. package/dist/{createElementComponent-CUeAF_JU.js → ui/createElementComponent.js} +6 -3
  115. package/dist/ui/fullscreen-button.d.ts +1 -1
  116. package/dist/ui/fullscreen-button.js +3 -3
  117. package/dist/ui/hotkey.d.ts +1 -1
  118. package/dist/ui/hotkey.js +3 -3
  119. package/dist/ui/index.d.ts +10 -10
  120. package/dist/ui/index.js +21 -21
  121. package/dist/ui/mute-button.d.ts +1 -1
  122. package/dist/ui/mute-button.js +3 -3
  123. package/dist/ui/pip-button.d.ts +1 -1
  124. package/dist/ui/pip-button.js +3 -3
  125. package/dist/ui/play-button.d.ts +1 -1
  126. package/dist/ui/play-button.js +3 -3
  127. package/dist/ui/poster.d.ts +1 -1
  128. package/dist/ui/poster.js +2 -2
  129. package/dist/ui/props.d.ts +25 -0
  130. package/dist/{props-D3O1wYXT.js → ui/props.js} +1 -1
  131. package/dist/ui/seek-button.d.ts +1 -1
  132. package/dist/ui/seek-button.js +3 -3
  133. package/dist/ui/slider-buffer.d.ts +1 -1
  134. package/dist/ui/slider-buffer.js +2 -2
  135. package/dist/ui/slider-fill.d.ts +1 -1
  136. package/dist/ui/slider-fill.js +2 -2
  137. package/dist/ui/slider-thumb.d.ts +1 -1
  138. package/dist/ui/slider-thumb.js +2 -2
  139. package/dist/ui/slider-track.d.ts +1 -1
  140. package/dist/ui/slider-track.js +2 -2
  141. package/dist/ui/status-announcer.d.ts +1 -1
  142. package/dist/ui/status-announcer.js +2 -2
  143. package/dist/ui/time-slider.d.ts +1 -1
  144. package/dist/ui/time-slider.js +3 -3
  145. package/dist/ui/time.d.ts +1 -1
  146. package/dist/ui/time.js +3 -3
  147. package/dist/ui/volume-slider.d.ts +1 -1
  148. package/dist/ui/volume-slider.js +3 -3
  149. package/dist/{index-DhJ5A5TI.d.ts → video/VideoPlayer.d.ts} +21 -233
  150. package/dist/video/VideoPlayer.js +10 -0
  151. package/dist/video/compat.d.ts +1068 -0
  152. package/dist/video/compat.js +6 -0
  153. package/dist/video/createVideoPlayer.d.ts +1076 -0
  154. package/dist/{createVideoPlayer-CU9HWSAy.js → video/createVideoPlayer.js} +17 -9
  155. package/dist/video/default.d.ts +18 -15
  156. package/dist/video/default.js +1 -1
  157. package/dist/video/legacy.d.ts +1068 -0
  158. package/dist/video/legacy.js +6 -0
  159. package/dist/video/neutral.d.ts +18 -15
  160. package/dist/video/neutral.js +1 -1
  161. package/package.json +38 -7
  162. package/dist/Audio-D-RH-zmq.js +0 -55
  163. package/dist/Video-fUL_ClzK.js +0 -55
  164. package/dist/createAudioPlayer-BhUZLd4H.d.ts +0 -11
  165. package/dist/createAudioSkin-BNmtEp7u.js +0 -17
  166. package/dist/createVideoSkin-BxpJYgKe.js +0 -22
  167. package/dist/default-3MW_94HC.d.ts +0 -7
  168. package/dist/default-C4INOLJr.d.ts +0 -7
  169. package/dist/i18n-C4MwExsj.d.ts +0 -1
  170. package/dist/neutral-DWxkiOeo.d.ts +0 -7
  171. package/dist/neutral-skin-B8htnvI5.d.ts +0 -1
  172. package/dist/neutral-x5edtrGj.d.ts +0 -7
  173. package/dist/player-DwjY3MEu.d.ts +0 -1
  174. package/dist/player-RUaCdKKE.d.ts +0 -1
  175. package/dist/skin-0b-NvVj8.d.ts +0 -1
  176. package/dist/types-DR9kogyX.d.ts +0 -24
  177. package/dist/types-wAkjM01D.d.ts +0 -42
  178. package/dist/useMediaElement-CO_r--i0.js +0 -143
  179. package/dist/usePlayerActions-D3ILoEVZ.js +0 -28
  180. package/dist/usePlayerActions-McyRKswV.d.ts +0 -21
  181. 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 { r as AudioPlayerHandle } from "./types-DR9kogyX.js";
2
- import "./player-DwjY3MEu.js";
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 { AudioPlayerRoot as t };
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 { a as AudioPlayerStore, i as AudioPlayerState, o as AudioPlayerTarget, r as AudioPlayerHandle, t as AudioPlayerActions } from "../types-DR9kogyX.js";
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 { 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";
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(() => player.value?.store, selector);
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(() => player.value?.store ?? null);
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 };
@@ -1,6 +1,7 @@
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";
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 };
@@ -1 +1,3 @@
1
- export { t as Audio, n as AudioPlayerRoot } from "../Audio-D-RH-zmq.js";
1
+ import { Audio } from "./Audio.js";
2
+ import { AudioPlayerRoot } from "./AudioPlayerRoot.js";
3
+ export { Audio, AudioPlayerRoot };