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
@@ -1,15 +1,10 @@
1
- import { useAudioPlayerActions, useAudioPlayerState } from "./composables.js";
1
+ import { Audio } from "./Audio.js";
2
2
  import "../register/audio/player.js";
3
- import { n as AudioPlayerRoot, t as Audio } from "../Audio-D-RH-zmq.js";
4
- import { t as createAudioPlayer } from "../createAudioPlayer-BqZWB8il.js";
3
+ import { AudioPlayerRoot } from "./AudioPlayerRoot.js";
5
4
  import "../register/audio/skin.js";
6
5
  import { DefaultAudioSkin } from "./skins/default.js";
7
6
  import "../register/audio/neutral-skin.js";
8
7
  import { NeutralAudioSkin } from "./skins/neutral.js";
9
- //#region src/audio/AudioPlayer.ts
10
- const AudioPlayer = /* @__PURE__ */ createAudioPlayer("AudioPlayer", {
11
- default: DefaultAudioSkin,
12
- neutral: NeutralAudioSkin
13
- }, "default");
14
- //#endregion
8
+ import { AudioPlayer } from "./AudioPlayer.js";
9
+ import { useAudioPlayerActions, useAudioPlayerState } from "./composables.js";
15
10
  export { Audio, AudioPlayer, AudioPlayerRoot, DefaultAudioSkin, NeutralAudioSkin, useAudioPlayerActions, useAudioPlayerState };
@@ -1,7 +1,8 @@
1
- import { 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 { c as OnCleanup } from "../index-DhJ5A5TI.js";
4
- import { t as AudioMediaComponent } from "../createAudioPlayer-BhUZLd4H.js";
1
+ import { OnCleanup } from "../node_modules/.pnpm/@vue_reactivity@3.5.43/node_modules/@vue/reactivity/dist/reactivity.js";
2
+ import { MediaTrack } from "../media/types.js";
3
+ import "../index.js";
4
+ import { AudioPlayerActions, AudioPlayerElement, AudioPlayerHandle, AudioPlayerState, AudioPlayerStore, AudioPlayerTarget } from "./types.js";
5
+ import { AudioMediaComponent } from "./createAudioPlayer.js";
5
6
  //#region src/audio/neutral.d.ts
6
7
  export declare const AudioPlayer: Omit<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
8
  src: import("vue").PropType<string | undefined>;
@@ -1,4 +1,4 @@
1
- import { t as createAudioPlayer } from "../createAudioPlayer-BqZWB8il.js";
1
+ import { createAudioPlayer } from "./createAudioPlayer.js";
2
2
  import { NeutralAudioSkin } from "./skins/neutral.js";
3
3
  //#region src/audio/neutral.ts
4
4
  const AudioPlayer = /* @__PURE__ */ createAudioPlayer("NeutralAudioPlayer", { neutral: NeutralAudioSkin }, "neutral");
@@ -0,0 +1,5 @@
1
+ //#region src/audio/skins/createAudioSkin.d.ts
2
+ export declare function createAudioSkin(name: string, tag: string): import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
+ [key: string]: any;
4
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
5
+ //#endregion
@@ -0,0 +1,20 @@
1
+ import { withSlot } from "../../skins/withSlot.js";
2
+ import { defineComponent, h, mergeProps } from "vue";
3
+ //#region src/audio/skins/createAudioSkin.ts
4
+ function createAudioSkin(name, tag) {
5
+ return defineComponent({
6
+ name,
7
+ inheritAttrs: false,
8
+ setup(_props, { attrs, slots }) {
9
+ return () => {
10
+ var _slots$default, _slots$poster;
11
+ return h(tag, mergeProps({ style: {
12
+ display: "block",
13
+ width: "100%"
14
+ } }, attrs), [(_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots), withSlot((_slots$poster = slots["poster"]) === null || _slots$poster === void 0 ? void 0 : _slots$poster.call(slots), "poster")]);
15
+ };
16
+ }
17
+ });
18
+ }
19
+ //#endregion
20
+ export { createAudioSkin };
@@ -1,2 +1,6 @@
1
- import { t as DefaultAudioSkin } from "../../default-3MW_94HC.js";
2
- export { DefaultAudioSkin };
1
+ import "../../register/audio/skin.js";
2
+ //#region src/audio/skins/default.d.ts
3
+ export declare const DefaultAudioSkin: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
+ [key: string]: any;
5
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ //#endregion
@@ -1,5 +1,5 @@
1
1
  import "../../register/audio/skin.js";
2
- import { t as createAudioSkin } from "../../createAudioSkin-BNmtEp7u.js";
2
+ import { createAudioSkin } from "./createAudioSkin.js";
3
3
  //#region src/audio/skins/default.ts
4
4
  const DefaultAudioSkin = /* @__PURE__ */ createAudioSkin("DefaultAudioSkin", "audio-skin");
5
5
  //#endregion
@@ -1,2 +1,6 @@
1
- import { t as NeutralAudioSkin } from "../../neutral-DWxkiOeo.js";
2
- export { NeutralAudioSkin };
1
+ import "../../register/audio/neutral-skin.js";
2
+ //#region src/audio/skins/neutral.d.ts
3
+ export declare const NeutralAudioSkin: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
4
+ [key: string]: any;
5
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ //#endregion
@@ -1,4 +1,4 @@
1
- import { t as createAudioSkin } from "../../createAudioSkin-BNmtEp7u.js";
1
+ import { createAudioSkin } from "./createAudioSkin.js";
2
2
  import "../../register/audio/neutral-skin.js";
3
3
  //#region src/audio/skins/neutral.ts
4
4
  const NeutralAudioSkin = /* @__PURE__ */ createAudioSkin("NeutralAudioSkin", "audio-neutral-skin");
@@ -0,0 +1,3 @@
1
+ import { DefaultAudioSkin } from "./skins/default.js";
2
+ import { NeutralAudioSkin } from "./skins/neutral.js";
3
+ export { DefaultAudioSkin, NeutralAudioSkin };
@@ -0,0 +1,3 @@
1
+ import { DefaultAudioSkin } from "./skins/default.js";
2
+ import { NeutralAudioSkin } from "./skins/neutral.js";
3
+ export { DefaultAudioSkin, NeutralAudioSkin };
@@ -0,0 +1,22 @@
1
+ import { PlayerMedia } from "../media/types.js";
2
+ import { CommonPlayerActions } from "../player/actions.js";
3
+ import { MaybeRefOrGetter } from "vue";
4
+ import { AudioPlayerStore, AudioPlayerStore as AudioPlayerStore$1 } from "@videojs/html";
5
+ import { AudioPlayerElement as AudioPlayerElement$1 } from "@videojs/html/audio";
6
+ //#region src/audio/types.d.ts
7
+ export type AudioPlayerState = AudioPlayerStore$1['state'];
8
+ export type AudioPlayerActions = CommonPlayerActions;
9
+ export type AudioPlayerElement = Omit<AudioPlayerElement$1, 'store'> & {
10
+ readonly store: AudioPlayerStore$1;
11
+ };
12
+ /**
13
+ * Live getters become null when the audio player is inactive or unmounted.
14
+ */
15
+ export interface AudioPlayerHandle extends AudioPlayerActions {
16
+ readonly element: AudioPlayerElement | null;
17
+ readonly store: AudioPlayerStore$1 | null;
18
+ readonly media: PlayerMedia | null;
19
+ }
20
+ export type AudioPlayerTarget = MaybeRefOrGetter<AudioPlayerHandle | null | undefined>;
21
+ //#endregion
22
+ export type { AudioPlayerStore };
File without changes
@@ -1,3 +1,4 @@
1
- import { c as PlayerTarget, i as PlayerHandle, n as PlayerActions, o as PlayerState, s as PlayerStore } from "../types-wAkjM01D.js";
2
- import { n as usePlayerState, t as usePlayerActions } from "../usePlayerActions-McyRKswV.js";
1
+ import { PlayerActions, PlayerHandle, PlayerState, PlayerStore, PlayerTarget } from "../player/types.js";
2
+ import { usePlayerState } from "./usePlayerState.js";
3
+ import { usePlayerActions } from "./usePlayerActions.js";
3
4
  export { type PlayerActions, type PlayerHandle, type PlayerState, type PlayerStore, type PlayerTarget, usePlayerActions, usePlayerState };
@@ -1 +1,3 @@
1
- export { t as usePlayerActions, n as usePlayerState } from "../usePlayerActions-D3ILoEVZ.js";
1
+ import { usePlayerState } from "./usePlayerState.js";
2
+ import { usePlayerActions } from "./usePlayerActions.js";
3
+ export { usePlayerActions, usePlayerState };
@@ -0,0 +1,9 @@
1
+ import { PlayerActions, PlayerTarget } from "../player/types.js";
2
+ //#region src/composables/usePlayerActions.d.ts
3
+ /**
4
+ * @param {PlayerTarget} target - Explicit player ref/getter, or injected context when omitted.
5
+ * @returns {PlayerActions} Actions that resolve their target on every call.
6
+ * Commands are never queued. Async failures retain the original rejection reason.
7
+ */
8
+ export declare function usePlayerActions(target?: PlayerTarget): PlayerActions;
9
+ //#endregion
@@ -0,0 +1,17 @@
1
+ import { usePlayerTarget } from "../player/context.js";
2
+ import { createPlayerActions } from "../player/actions.js";
3
+ //#region src/composables/usePlayerActions.ts
4
+ /**
5
+ * @param {PlayerTarget} target - Explicit player ref/getter, or injected context when omitted.
6
+ * @returns {PlayerActions} Actions that resolve their target on every call.
7
+ * Commands are never queued. Async failures retain the original rejection reason.
8
+ */
9
+ function usePlayerActions(target) {
10
+ const player = usePlayerTarget(target);
11
+ return createPlayerActions(() => {
12
+ var _player$value;
13
+ return ((_player$value = player.value) === null || _player$value === void 0 ? void 0 : _player$value.store) ?? null;
14
+ });
15
+ }
16
+ //#endregion
17
+ export { usePlayerActions };
@@ -0,0 +1,12 @@
1
+ import { PlayerState, PlayerTarget } from "../player/types.js";
2
+ import { ComputedRef } from "vue";
3
+ //#region src/composables/usePlayerState.d.ts
4
+ /**
5
+ * @param {(state: PlayerState) => Selected} selector - Selects a value from the immutable upstream snapshot.
6
+ * @param {PlayerTarget} target - Explicit player ref/getter, or injected context when omitted.
7
+ * @returns {ComputedRef<Selected | undefined>} A readonly selection, undefined while unavailable.
8
+ * Subscribe to a selection of the upstream snapshot. Unready targets yield undefined.
9
+ * Object selections should preserve identity when their selected fields are unchanged.
10
+ */
11
+ export declare function usePlayerState<Selected>(selector: (state: PlayerState) => Selected, target?: PlayerTarget): ComputedRef<Selected | undefined>;
12
+ //#endregion
@@ -0,0 +1,19 @@
1
+ import { usePlayerTarget } from "../player/context.js";
2
+ import { useStoreSelection } from "./useStoreSelection.js";
3
+ //#region src/composables/usePlayerState.ts
4
+ /**
5
+ * @param {(state: PlayerState) => Selected} selector - Selects a value from the immutable upstream snapshot.
6
+ * @param {PlayerTarget} target - Explicit player ref/getter, or injected context when omitted.
7
+ * @returns {ComputedRef<Selected | undefined>} A readonly selection, undefined while unavailable.
8
+ * Subscribe to a selection of the upstream snapshot. Unready targets yield undefined.
9
+ * Object selections should preserve identity when their selected fields are unchanged.
10
+ */
11
+ function usePlayerState(selector, target) {
12
+ const player = usePlayerTarget(target);
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);
17
+ }
18
+ //#endregion
19
+ export { usePlayerState };
@@ -0,0 +1,9 @@
1
+ import { ComputedRef } from "vue";
2
+ //#region src/composables/useStoreSelection.d.ts
3
+ interface SnapshotStore<State> {
4
+ readonly state: State;
5
+ subscribe: (listener: () => void) => () => void;
6
+ }
7
+ export declare function useStoreSelection<State, Selected>(getStore: () => SnapshotStore<State> | null | undefined, selector: (state: State) => Selected): ComputedRef<Selected | undefined>;
8
+ //#endregion
9
+ export {};
@@ -16,4 +16,4 @@ function useStoreSelection(getStore, selector) {
16
16
  return computed(() => selection.value);
17
17
  }
18
18
  //#endregion
19
- export { useStoreSelection as t };
19
+ export { useStoreSelection };
@@ -1,3 +1,7 @@
1
- import { a as PlayerMedia, c as PlayerTarget, i as PlayerHandle, n as PlayerActions, o as PlayerState, r as PlayerElement, s as PlayerStore, t as MediaTrack } from "../types-wAkjM01D.js";
2
- import { i as PlayerRoot, n as MediaProps, r as MediaEventName, s as Video } from "../index-DhJ5A5TI.js";
1
+ import { MediaTrack, PlayerMedia } from "../media/types.js";
2
+ import { Video } from "../media/Video.js";
3
+ import { PlayerActions, PlayerElement, PlayerHandle, PlayerState, PlayerStore, PlayerTarget } from "../player/types.js";
4
+ import { PlayerRoot } from "../player/PlayerRoot.js";
5
+ import { MediaEventName } from "../media/events.js";
6
+ import { MediaProps } from "../media/props.js";
3
7
  export { type MediaEventName, type MediaProps, type MediaTrack, type PlayerActions, type PlayerElement, type PlayerHandle, type PlayerMedia, PlayerRoot, type PlayerState, type PlayerStore, type PlayerTarget, Video };
@@ -1 +1,3 @@
1
- export { n as PlayerRoot, t as Video } from "../Video-fUL_ClzK.js";
1
+ import { Video } from "../media/Video.js";
2
+ import { PlayerRoot } from "../player/PlayerRoot.js";
3
+ export { PlayerRoot, Video };
@@ -0,0 +1,16 @@
1
+ import "../register/i18n.js";
2
+ import { PropType } from "vue";
3
+ //#region src/i18n/MediaI18n.d.ts
4
+ /**
5
+ * Shares the upstream locale with all descendant players and controls.
6
+ */
7
+ export declare const MediaI18n: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ lang: PropType<string | undefined>;
9
+ dir: PropType<'ltr' | 'rtl' | 'auto' | undefined>;
10
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
11
+ [key: string]: any;
12
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ lang: PropType<string | undefined>;
14
+ dir: PropType<'ltr' | 'rtl' | 'auto' | undefined>;
15
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ //#endregion
@@ -0,0 +1,26 @@
1
+ import "../register/i18n.js";
2
+ import { defineComponent, h } from "vue";
3
+ //#region src/i18n/MediaI18n.ts
4
+ /**
5
+ * Shares the upstream locale with all descendant players and controls.
6
+ */
7
+ const MediaI18n = defineComponent({
8
+ name: "MediaI18n",
9
+ inheritAttrs: false,
10
+ props: {
11
+ lang: String,
12
+ dir: String
13
+ },
14
+ setup(props, { attrs, slots }) {
15
+ return () => {
16
+ var _slots$default;
17
+ return h("media-i18n", {
18
+ ...attrs,
19
+ lang: props.lang ?? "",
20
+ dir: props.dir ?? ""
21
+ }, (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots));
22
+ };
23
+ }
24
+ });
25
+ //#endregion
26
+ export { MediaI18n };
@@ -0,0 +1,14 @@
1
+ import "../register/i18n.js";
2
+ import { PropType } from "vue";
3
+ //#region src/i18n/MediaText.d.ts
4
+ /**
5
+ * Translates a token using plain text from the default slot as its fallback.
6
+ */
7
+ export declare const MediaText: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ token: PropType<string | undefined>;
9
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
10
+ [key: string]: any;
11
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
12
+ token: PropType<string | undefined>;
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ //#endregion
@@ -0,0 +1,37 @@
1
+ import "../register/i18n.js";
2
+ import { Comment, defineComponent, h, isVNode, onMounted, shallowRef } from "vue";
3
+ //#region src/i18n/MediaText.ts
4
+ function getSlotText(value) {
5
+ if (typeof value === "string" || typeof value === "number") return String(value);
6
+ if (Array.isArray(value)) return value.map((child) => getSlotText(child)).join("");
7
+ if (isVNode(value) && value.type !== Comment) return getSlotText(value.children);
8
+ return "";
9
+ }
10
+ /**
11
+ * Translates a token using plain text from the default slot as its fallback.
12
+ */
13
+ const MediaText = defineComponent({
14
+ name: "MediaText",
15
+ inheritAttrs: false,
16
+ props: { token: String },
17
+ setup(props, { attrs, slots }) {
18
+ const element = shallowRef(null);
19
+ onMounted(() => {
20
+ var _element$value;
21
+ return (_element$value = element.value) === null || _element$value === void 0 ? void 0 : _element$value.requestUpdate();
22
+ });
23
+ return () => {
24
+ var _slots$default;
25
+ const fallback = getSlotText((_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)).trim();
26
+ return h("media-text", {
27
+ "data-allow-mismatch": "text",
28
+ ...attrs,
29
+ ref: element,
30
+ key: fallback,
31
+ token: props.token ?? ""
32
+ }, fallback);
33
+ };
34
+ }
35
+ });
36
+ //#endregion
37
+ export { MediaText };
@@ -1,30 +1,4 @@
1
- import "../i18n-C4MwExsj.js";
2
- import { PropType } from "vue";
1
+ import { MediaI18n } from "./MediaI18n.js";
2
+ import { MediaText } from "./MediaText.js";
3
3
  import { FlatTranslations, Locale, Translations, getI18nTranslations, hasRegisteredLocale, onI18nRegistryChange, registerI18n } from "@videojs/html/i18n";
4
- //#region src/i18n/MediaI18n.d.ts
5
- /**
6
- * Shares the upstream locale with all descendant players and controls.
7
- */
8
- export declare const MediaI18n: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
- lang: PropType<string | undefined>;
10
- dir: PropType<'ltr' | 'rtl' | 'auto' | undefined>;
11
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
12
- [key: string]: any;
13
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
14
- lang: PropType<string | undefined>;
15
- dir: PropType<'ltr' | 'rtl' | 'auto' | undefined>;
16
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
17
- //#endregion
18
- //#region src/i18n/MediaText.d.ts
19
- /**
20
- * Translates a token using plain text from the default slot as its fallback.
21
- */
22
- export declare const MediaText: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
23
- token: PropType<string | undefined>;
24
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
- [key: string]: any;
26
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
- token: PropType<string | undefined>;
28
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
29
- //#endregion
30
- export { type FlatTranslations, type Locale, type Translations, getI18nTranslations, hasRegisteredLocale, onI18nRegistryChange, registerI18n };
4
+ export { type FlatTranslations, type Locale, MediaI18n, MediaText, type Translations, getI18nTranslations, hasRegisteredLocale, onI18nRegistryChange, registerI18n };
@@ -1,54 +1,4 @@
1
- import "../register/i18n.js";
2
- import { Comment, defineComponent, h, isVNode, onMounted, shallowRef } from "vue";
1
+ import { MediaI18n } from "./MediaI18n.js";
2
+ import { MediaText } from "./MediaText.js";
3
3
  import { getI18nTranslations, hasRegisteredLocale, onI18nRegistryChange, registerI18n } from "@videojs/html/i18n";
4
- //#region src/i18n/MediaI18n.ts
5
- /**
6
- * Shares the upstream locale with all descendant players and controls.
7
- */
8
- const MediaI18n = defineComponent({
9
- name: "MediaI18n",
10
- inheritAttrs: false,
11
- props: {
12
- lang: String,
13
- dir: String
14
- },
15
- setup(props, { attrs, slots }) {
16
- return () => h("media-i18n", {
17
- ...attrs,
18
- lang: props.lang ?? "",
19
- dir: props.dir ?? ""
20
- }, slots["default"]?.());
21
- }
22
- });
23
- //#endregion
24
- //#region src/i18n/MediaText.ts
25
- function getSlotText(value) {
26
- if (typeof value === "string" || typeof value === "number") return String(value);
27
- if (Array.isArray(value)) return value.map((child) => getSlotText(child)).join("");
28
- if (isVNode(value) && value.type !== Comment) return getSlotText(value.children);
29
- return "";
30
- }
31
- /**
32
- * Translates a token using plain text from the default slot as its fallback.
33
- */
34
- const MediaText = defineComponent({
35
- name: "MediaText",
36
- inheritAttrs: false,
37
- props: { token: String },
38
- setup(props, { attrs, slots }) {
39
- const element = shallowRef(null);
40
- onMounted(() => element.value?.requestUpdate());
41
- return () => {
42
- const fallback = getSlotText(slots["default"]?.()).trim();
43
- return h("media-text", {
44
- "data-allow-mismatch": "text",
45
- ...attrs,
46
- ref: element,
47
- key: fallback,
48
- token: props.token ?? ""
49
- }, fallback);
50
- };
51
- }
52
- });
53
- //#endregion
54
4
  export { MediaI18n, MediaText, getI18nTranslations, hasRegisteredLocale, onI18nRegistryChange, registerI18n };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,17 @@
1
- import { a as PlayerMedia, c as PlayerTarget, i as PlayerHandle, n as PlayerActions, o as PlayerState, r as PlayerElement, s as PlayerStore, t as MediaTrack } from "./types-wAkjM01D.js";
2
- import { a as VideoPlayer, i as PlayerRoot, n as MediaProps, o as VideoMediaComponent, r as MediaEventName, s as Video } from "./index-DhJ5A5TI.js";
3
- import { t as DefaultVideoSkin } from "./default-C4INOLJr.js";
4
- import { t as NeutralVideoSkin } from "./neutral-x5edtrGj.js";
5
- import { n as usePlayerState, t as usePlayerActions } from "./usePlayerActions-McyRKswV.js";
1
+ import "./register/video/player.js";
2
+ import "./register/video/skin.js";
3
+ import "./register/video/neutral-skin.js";
4
+ import { MediaTrack, PlayerMedia } from "./media/types.js";
5
+ import { Video } from "./media/Video.js";
6
+ import { PlayerActions, PlayerElement, PlayerHandle, PlayerState, PlayerStore, PlayerTarget } from "./player/types.js";
7
+ import { VideoMediaComponent } from "./video/createVideoPlayer.js";
8
+ import { VideoPlayer } from "./video/VideoPlayer.js";
9
+ import { PlayerRoot } from "./player/PlayerRoot.js";
10
+ import { DefaultVideoSkin } from "./skins/default.js";
11
+ import { NeutralVideoSkin } from "./skins/neutral.js";
12
+ import "./skins/index.js";
13
+ import { usePlayerState } from "./composables/usePlayerState.js";
14
+ import { usePlayerActions } from "./composables/usePlayerActions.js";
15
+ import { MediaEventName } from "./media/events.js";
16
+ import { MediaProps } from "./media/props.js";
6
17
  export { DefaultVideoSkin, type MediaEventName, type MediaProps, type MediaTrack, NeutralVideoSkin, type PlayerActions, type PlayerElement, type PlayerHandle, type PlayerMedia, PlayerRoot, type PlayerState, type PlayerStore, type PlayerTarget, Video, type VideoMediaComponent, VideoPlayer, usePlayerActions, usePlayerState };
package/dist/index.js CHANGED
@@ -1,15 +1,11 @@
1
- import { n as usePlayerState, t as usePlayerActions } from "./usePlayerActions-D3ILoEVZ.js";
2
1
  import "./register/video/player.js";
3
- import { n as PlayerRoot, t as Video } from "./Video-fUL_ClzK.js";
4
2
  import "./register/video/skin.js";
5
3
  import "./register/video/neutral-skin.js";
6
- import { t as createVideoPlayer } from "./createVideoPlayer-CU9HWSAy.js";
7
4
  import { DefaultVideoSkin } from "./skins/default.js";
8
5
  import { NeutralVideoSkin } from "./skins/neutral.js";
9
- //#region src/VideoPlayer.ts
10
- const VideoPlayer = /* @__PURE__ */ createVideoPlayer("VideoPlayer", {
11
- default: DefaultVideoSkin,
12
- neutral: NeutralVideoSkin
13
- }, "default");
14
- //#endregion
6
+ import { Video } from "./media/Video.js";
7
+ import { PlayerRoot } from "./player/PlayerRoot.js";
8
+ import { VideoPlayer } from "./video/VideoPlayer.js";
9
+ import { usePlayerState } from "./composables/usePlayerState.js";
10
+ import { usePlayerActions } from "./composables/usePlayerActions.js";
15
11
  export { DefaultVideoSkin, NeutralVideoSkin, PlayerRoot, Video, VideoPlayer, usePlayerActions, usePlayerState };
@@ -0,0 +1,79 @@
1
+ import { MediaTrack } from "./types.js";
2
+ //#region src/media/Video.d.ts
3
+ export declare const Video: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ readonly src: import("vue").PropType<string | undefined>;
5
+ readonly autoplay: BooleanConstructor;
6
+ readonly loop: BooleanConstructor;
7
+ readonly preload: {
8
+ readonly type: import("vue").PropType<'none' | 'metadata' | 'auto'>;
9
+ readonly default: 'metadata';
10
+ };
11
+ readonly crossorigin: import("vue").PropType<'' | 'anonymous' | 'use-credentials' | undefined>;
12
+ readonly tracks: import("vue").PropType<readonly MediaTrack[] | undefined>;
13
+ readonly volume: import("vue").PropType<number | undefined>;
14
+ readonly muted: {
15
+ readonly type: import("vue").PropType<boolean | undefined>;
16
+ readonly default: undefined;
17
+ };
18
+ readonly playbackRate: import("vue").PropType<number | undefined>;
19
+ readonly poster: import("vue").PropType<string | undefined>;
20
+ readonly playsinline: {
21
+ readonly type: BooleanConstructor;
22
+ readonly default: true;
23
+ };
24
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
25
+ [key: string]: any;
26
+ }>, {}, {}, {}, 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<{
27
+ readonly src: import("vue").PropType<string | undefined>;
28
+ readonly autoplay: BooleanConstructor;
29
+ readonly loop: BooleanConstructor;
30
+ readonly preload: {
31
+ readonly type: import("vue").PropType<'none' | 'metadata' | 'auto'>;
32
+ readonly default: 'metadata';
33
+ };
34
+ readonly crossorigin: import("vue").PropType<'' | 'anonymous' | 'use-credentials' | undefined>;
35
+ readonly tracks: import("vue").PropType<readonly MediaTrack[] | undefined>;
36
+ readonly volume: import("vue").PropType<number | undefined>;
37
+ readonly muted: {
38
+ readonly type: import("vue").PropType<boolean | undefined>;
39
+ readonly default: undefined;
40
+ };
41
+ readonly playbackRate: import("vue").PropType<number | undefined>;
42
+ readonly poster: import("vue").PropType<string | undefined>;
43
+ readonly playsinline: {
44
+ readonly type: BooleanConstructor;
45
+ readonly default: true;
46
+ };
47
+ }>> & Readonly<{
48
+ onAbort?: (event: Event) => any;
49
+ onCanplay?: (event: Event) => any;
50
+ onCanplaythrough?: (event: Event) => any;
51
+ onDurationchange?: (event: Event) => any;
52
+ onEmptied?: (event: Event) => any;
53
+ onEnded?: (event: Event) => any;
54
+ onEnterpictureinpicture?: (event: Event) => any;
55
+ onError?: (event: Event) => any;
56
+ onLeavepictureinpicture?: (event: Event) => any;
57
+ onLoadeddata?: (event: Event) => any;
58
+ onLoadedmetadata?: (event: Event) => any;
59
+ onLoadstart?: (event: Event) => any;
60
+ onPause?: (event: Event) => any;
61
+ onPlay?: (event: Event) => any;
62
+ onPlaying?: (event: Event) => any;
63
+ onProgress?: (event: Event) => any;
64
+ onRatechange?: (event: Event) => any;
65
+ onSeeked?: (event: Event) => any;
66
+ onSeeking?: (event: Event) => any;
67
+ onStalled?: (event: Event) => any;
68
+ onSuspend?: (event: Event) => any;
69
+ onTimeupdate?: (event: Event) => any;
70
+ onVolumechange?: (event: Event) => any;
71
+ onWaiting?: (event: Event) => any;
72
+ }>, {
73
+ readonly autoplay: boolean;
74
+ readonly loop: boolean;
75
+ readonly preload: "auto" | "metadata" | "none";
76
+ readonly muted: boolean | undefined;
77
+ readonly playsinline: boolean;
78
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
79
+ //#endregion
@@ -0,0 +1,21 @@
1
+ import { mediaEmits } from "./events.js";
2
+ import { mediaProps } from "./props.js";
3
+ import { useMediaElement } from "./useMediaElement.js";
4
+ import { defineComponent } from "vue";
5
+ //#region src/media/Video.ts
6
+ const Video = defineComponent({
7
+ name: "Video",
8
+ inheritAttrs: false,
9
+ props: mediaProps,
10
+ emits: mediaEmits,
11
+ setup(props, context) {
12
+ return useMediaElement({
13
+ tag: "video",
14
+ props,
15
+ context,
16
+ emit: context.emit
17
+ });
18
+ }
19
+ });
20
+ //#endregion
21
+ export { Video };
@@ -0,0 +1,5 @@
1
+ //#region src/media/events.d.ts
2
+ export declare const MEDIA_EVENTS: readonly ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting', 'enterpictureinpicture', 'leavepictureinpicture'];
3
+ export type MediaEventName = (typeof MEDIA_EVENTS)[number];
4
+ export declare const mediaEmits: Record<MediaEventName, (event: Event) => boolean>;
5
+ //#endregion