@maas/vue-equipment 1.0.0-beta.2 → 1.0.0-beta.21
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 +2 -2
- package/dist/composables/index.d.ts +5 -5
- package/dist/composables/index.js +23 -13
- package/dist/composables/index.js.map +1 -1
- package/dist/nuxt/module.d.mts +2 -1
- package/dist/nuxt/module.json +2 -2
- package/dist/nuxt/module.mjs +9 -2
- package/dist/nuxt/types.d.mts +3 -1
- package/dist/plugins/.turbo/turbo-lint.log +2 -10
- package/dist/plugins/MagicAccordion/nuxt.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue +59 -82
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionContent.vue.d.ts +35 -22
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue +17 -31
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionProvider.vue.d.ts +12 -21
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue +57 -62
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionTrigger.vue.d.ts +23 -59
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue +34 -45
- package/dist/plugins/MagicAccordion/src/components/MagicAccordionView.vue.d.ts +17 -22
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.d.ts +1 -1
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionTrigger.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/private/useAccordionView.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/composables/useMagicAccordion.mjs +1 -0
- package/dist/plugins/MagicAccordion/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicCommand/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue +146 -152
- package/dist/plugins/MagicCommand/src/components/MagicCommandContent.vue.d.ts +24 -13
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue +42 -52
- package/dist/plugins/MagicCommand/src/components/MagicCommandDrawer.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue +72 -87
- package/dist/plugins/MagicCommand/src/components/MagicCommandItem.vue.d.ts +29 -28
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue +37 -47
- package/dist/plugins/MagicCommand/src/components/MagicCommandModal.vue.d.ts +12 -21
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue +61 -77
- package/dist/plugins/MagicCommand/src/components/MagicCommandProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicCommand/src/components/MagicCommandRenderer.vue +23 -39
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue +80 -86
- package/dist/plugins/MagicCommand/src/components/MagicCommandTrigger.vue.d.ts +25 -60
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue +36 -48
- package/dist/plugins/MagicCommand/src/components/MagicCommandView.vue.d.ts +15 -22
- package/dist/plugins/MagicCommand/src/composables/private/useCommandScroll.d.ts +2 -2
- package/dist/plugins/MagicCommand/src/composables/private/useCommandState.mjs +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.d.ts +1 -1
- package/dist/plugins/MagicCommand/src/composables/private/useCommandTrigger.mjs +1 -0
- package/dist/plugins/MagicCommand/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicCommand/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicCookie/nuxt.d.ts +1 -1
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue +34 -41
- package/dist/plugins/MagicCookie/src/components/MagicCookieItem.vue.d.ts +13 -22
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue +19 -36
- package/dist/plugins/MagicCookie/src/components/MagicCookieProvider.vue.d.ts +9 -21
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue +40 -72
- package/dist/plugins/MagicCookie/src/components/MagicCookieView.vue.d.ts +21 -12
- package/dist/plugins/MagicCookie/src/composables/private/useCookieItem.mjs +0 -1
- package/dist/plugins/MagicCookie/src/symbols/index.d.ts +2 -2
- package/dist/plugins/MagicDraggable/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue +81 -100
- package/dist/plugins/MagicDraggable/src/components/MagicDraggable.vue.d.ts +94 -22
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.d.ts +2 -2
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableDrag.mjs +43 -63
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableScrollLock.mjs +34 -14
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.d.ts +2 -15
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableSnap.mjs +117 -64
- package/dist/plugins/MagicDraggable/src/composables/private/useDraggableState.mjs +6 -5
- package/dist/plugins/MagicDraggable/src/types/index.d.ts +2 -1
- package/dist/plugins/MagicDraggable/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/MagicDrawer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue +271 -308
- package/dist/plugins/MagicDrawer/src/components/MagicDrawer.vue.d.ts +165 -23
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDOM.mjs +34 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerDrag.mjs +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerGuards.mjs +28 -10
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerProgress.d.ts +2 -2
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.d.ts +3 -3
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerSnap.mjs +16 -14
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.d.ts +1 -1
- package/dist/plugins/MagicDrawer/src/composables/private/useDrawerWheel.mjs +1 -1
- package/dist/plugins/MagicDrawer/src/types/index.mjs +1 -0
- package/dist/plugins/MagicEmitter/nuxt.d.ts +1 -1
- package/dist/plugins/MagicEmitter/src/composables/useMagicEmitter.d.ts +100 -100
- package/dist/plugins/MagicMarquee/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue +38 -72
- package/dist/plugins/MagicMarquee/src/components/MagicMarquee.vue.d.ts +14 -25
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.d.ts +1 -1
- package/dist/plugins/MagicMarquee/src/composables/private/useMarqueeApi.mjs +8 -2
- package/dist/plugins/MagicMarquee/src/composables/useMagicMarquee.d.ts +1 -1
- package/dist/plugins/MagicMenu/nuxt.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue +51 -63
- package/dist/plugins/MagicMenu/src/components/MagicMenuChannel.vue.d.ts +18 -21
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue +178 -214
- package/dist/plugins/MagicMenu/src/components/MagicMenuContent.vue.d.ts +41 -24
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue +171 -198
- package/dist/plugins/MagicMenu/src/components/MagicMenuFloat.vue.d.ts +40 -25
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue +87 -113
- package/dist/plugins/MagicMenu/src/components/MagicMenuItem.vue.d.ts +31 -28
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue +82 -81
- package/dist/plugins/MagicMenu/src/components/MagicMenuProvider.vue.d.ts +12 -58
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue +63 -86
- package/dist/plugins/MagicMenu/src/components/MagicMenuRemote.vue.d.ts +19 -23
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue +94 -97
- package/dist/plugins/MagicMenu/src/components/MagicMenuTrigger.vue.d.ts +27 -60
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue +49 -61
- package/dist/plugins/MagicMenu/src/components/MagicMenuView.vue.d.ts +15 -22
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCallback.mjs +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuChannel.mjs +15 -5
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.d.ts +3 -3
- package/dist/plugins/MagicMenu/src/composables/private/useMenuCursor.mjs +4 -4
- package/dist/plugins/MagicMenu/src/composables/private/useMenuDOM.mjs +35 -15
- package/dist/plugins/MagicMenu/src/composables/private/useMenuKeyListener.mjs +6 -2
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.d.ts +1 -1
- package/dist/plugins/MagicMenu/src/composables/private/useMenuTrigger.mjs +2 -0
- package/dist/plugins/MagicMenu/src/composables/private/useMenuView.mjs +18 -6
- package/dist/plugins/MagicMenu/src/composables/useMagicMenu.mjs +1 -0
- package/dist/plugins/MagicMenu/src/symbols/index.d.ts +4 -4
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.d.ts +2 -2
- package/dist/plugins/MagicMenu/src/utils/modeDelayDefaults.mjs +2 -2
- package/dist/plugins/MagicModal/nuxt.d.ts +1 -1
- package/dist/plugins/MagicModal/src/components/MagicModal.vue +133 -168
- package/dist/plugins/MagicModal/src/components/MagicModal.vue.d.ts +44 -21
- package/dist/plugins/MagicModal/src/composables/private/useModalDOM.mjs +34 -14
- package/dist/plugins/MagicModal/src/types/index.mjs +1 -0
- package/dist/plugins/MagicNoise/nuxt.d.ts +1 -1
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue +50 -81
- package/dist/plugins/MagicNoise/src/components/MagicNoise.vue.d.ts +1 -10
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.d.ts +3 -3
- package/dist/plugins/MagicNoise/src/composables/private/useNoiseApi.mjs +2 -2
- package/dist/plugins/MagicPie/index.d.ts +7 -0
- package/dist/plugins/MagicPie/index.mjs +8 -0
- package/dist/plugins/MagicPie/nuxt.d.ts +2 -0
- package/dist/plugins/MagicPie/nuxt.mjs +23 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue +168 -0
- package/dist/plugins/MagicPie/src/components/MagicPie.vue.d.ts +7 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.d.ts +6 -0
- package/dist/plugins/MagicPie/src/composables/private/usePieState.mjs +33 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.d.ts +13 -0
- package/dist/plugins/MagicPie/src/composables/useMagicPie.mjs +43 -0
- package/dist/plugins/MagicPie/src/types/index.d.ts +9 -0
- package/dist/plugins/MagicPie/src/types/index.mjs +0 -0
- package/dist/plugins/MagicPlayer/nuxt.d.ts +1 -1
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudio.vue +58 -63
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue +99 -127
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerAudioControls.vue.d.ts +30 -26
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue +32 -42
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerDisplayTime.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue +106 -105
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerMuxPopover.vue.d.ts +1 -10
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue +51 -76
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerOverlay.vue.d.ts +29 -14
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue +18 -37
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerPoster.vue.d.ts +12 -11
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue +41 -55
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerProvider.vue.d.ts +23 -23
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerTimeline.vue +60 -109
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideo.vue +74 -71
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue +163 -209
- package/dist/plugins/MagicPlayer/src/components/MagicPlayerVideoControls.vue.d.ts +63 -33
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.d.ts +0 -4
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerAudioApi.mjs +6 -47
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.d.ts +7 -34
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerControlsApi.mjs +154 -235
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.d.ts +3 -17
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerMediaApi.mjs +17 -157
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.d.ts +2 -3
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerRuntime.mjs +7 -25
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.d.ts +7 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerState.mjs +56 -0
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.d.ts +3 -8
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerVideoApi.mjs +7 -62
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.d.ts +32 -51
- package/dist/plugins/MagicPlayer/src/composables/useMagicPlayer.mjs +49 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.d.ts +5 -2
- package/dist/plugins/MagicPlayer/src/symbols/index.mjs +10 -1
- package/dist/plugins/MagicPlayer/src/types/index.d.ts +29 -0
- package/dist/plugins/MagicScroll/nuxt.d.ts +1 -1
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue +54 -61
- package/dist/plugins/MagicScroll/src/components/MagicScrollCollision.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue +56 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollMotion.vue.d.ts +9 -23
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue +26 -33
- package/dist/plugins/MagicScroll/src/components/MagicScrollProvider.vue.d.ts +45 -37
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue +63 -71
- package/dist/plugins/MagicScroll/src/components/MagicScrollScene.vue.d.ts +13 -24
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useCollisionDetection.mjs +16 -6
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.d.ts +2 -2
- package/dist/plugins/MagicScroll/src/composables/private/useScrollApi.mjs +41 -26
- package/dist/plugins/MagicScroll/src/symbols/index.d.ts +1 -1
- package/dist/plugins/MagicToast/nuxt.d.ts +1 -1
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue +94 -118
- package/dist/plugins/MagicToast/src/components/MagicToastProvider.vue.d.ts +1 -10
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue +54 -81
- package/dist/plugins/MagicToast/src/components/MagicToastView.vue.d.ts +24 -23
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.d.ts +2 -2
- package/dist/plugins/MagicToast/src/composables/private/useToastCallback.mjs +5 -5
- package/dist/plugins/MagicToast/src/composables/private/useToastDrag.mjs +22 -22
- package/dist/plugins/MagicToast/src/composables/private/useToastListener.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/private/useToastScrollLock.mjs +33 -15
- package/dist/plugins/MagicToast/src/composables/private/useToastView.mjs +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.d.ts +1 -0
- package/dist/plugins/MagicToast/src/composables/useMagicToast.mjs +10 -2
- package/dist/plugins/MagicToast/src/types/index.d.ts +1 -1
- package/dist/plugins/MagicToast/src/utils/defaultOptions.mjs +1 -1
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/utils/index.d.ts +9 -4
- package/dist/utils/index.js +39 -3
- package/dist/utils/index.js.map +1 -1
- package/package.json +17 -8
- package/dist/nuxt/module.cjs +0 -5
- package/dist/nuxt/module.d.ts +0 -9
- package/dist/nuxt/types.d.ts +0 -1
- package/dist/plugins/MagicAccordion/demo/data/footer.json +0 -117
- package/dist/plugins/MagicCommand/demo/data/about.json +0 -3
- package/dist/plugins/MagicCommand/demo/data/search.json +0 -594
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.d.ts +0 -15
- package/dist/plugins/MagicPlayer/src/composables/private/usePlayerStateEmitter.mjs +0 -9
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRefs, watch, unref, toValue } from "vue";
|
|
2
2
|
import { useEventListener, watchIgnorable } from "@vueuse/core";
|
|
3
|
-
import {
|
|
3
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
4
4
|
export function usePlayerMediaApi(args) {
|
|
5
|
-
const currentTime = ref(0);
|
|
6
|
-
const duration = ref(0);
|
|
7
|
-
const seeking = ref(false);
|
|
8
|
-
const volume = ref(1);
|
|
9
|
-
const rate = ref(1);
|
|
10
|
-
const waiting = ref(false);
|
|
11
|
-
const ended = ref(false);
|
|
12
|
-
const playing = ref(false);
|
|
13
|
-
const stalled = ref(false);
|
|
14
|
-
const buffered = ref([]);
|
|
15
|
-
const muted = ref(false);
|
|
16
5
|
const { mediaRef, id } = args;
|
|
17
|
-
const
|
|
6
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
7
|
+
const state = initializeState();
|
|
8
|
+
const {
|
|
9
|
+
currentTime,
|
|
10
|
+
duration,
|
|
11
|
+
seeking,
|
|
12
|
+
volume,
|
|
13
|
+
rate,
|
|
14
|
+
waiting,
|
|
15
|
+
ended,
|
|
16
|
+
playing,
|
|
17
|
+
stalled,
|
|
18
|
+
buffered,
|
|
19
|
+
muted
|
|
20
|
+
} = toRefs(state);
|
|
18
21
|
function timeRangeToArray(timeRanges) {
|
|
19
22
|
let ranges = [];
|
|
20
23
|
for (let i = 0; i < timeRanges.length; ++i)
|
|
@@ -120,147 +123,4 @@ export function usePlayerMediaApi(args) {
|
|
|
120
123
|
volume.value = el.volume;
|
|
121
124
|
muted.value = el.muted;
|
|
122
125
|
});
|
|
123
|
-
const emitter = usePlayerStateEmitter();
|
|
124
|
-
emitter.on("update", (payload) => {
|
|
125
|
-
if (payload.id !== toValue(id)) return;
|
|
126
|
-
if (payload.api === "media") {
|
|
127
|
-
switch (payload.key) {
|
|
128
|
-
case "currentTime":
|
|
129
|
-
currentTime.value = payload.value;
|
|
130
|
-
break;
|
|
131
|
-
case "duration":
|
|
132
|
-
duration.value = payload.value;
|
|
133
|
-
break;
|
|
134
|
-
case "seeking":
|
|
135
|
-
seeking.value = payload.value;
|
|
136
|
-
break;
|
|
137
|
-
case "volume":
|
|
138
|
-
volume.value = payload.value;
|
|
139
|
-
break;
|
|
140
|
-
case "rate":
|
|
141
|
-
rate.value = payload.value;
|
|
142
|
-
break;
|
|
143
|
-
case "waiting":
|
|
144
|
-
waiting.value = payload.value;
|
|
145
|
-
break;
|
|
146
|
-
case "ended":
|
|
147
|
-
ended.value = payload.value;
|
|
148
|
-
break;
|
|
149
|
-
case "playing":
|
|
150
|
-
playing.value = payload.value;
|
|
151
|
-
break;
|
|
152
|
-
case "stalled":
|
|
153
|
-
stalled.value = payload.value;
|
|
154
|
-
break;
|
|
155
|
-
case "buffered":
|
|
156
|
-
buffered.value = payload.value;
|
|
157
|
-
break;
|
|
158
|
-
case "muted":
|
|
159
|
-
muted.value = payload.value;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
watch(currentTime, (value) => {
|
|
165
|
-
emitter.emit("update", {
|
|
166
|
-
id: toValue(id),
|
|
167
|
-
api: "media",
|
|
168
|
-
key: "currentTime",
|
|
169
|
-
value
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
watch(duration, (value) => {
|
|
173
|
-
emitter.emit("update", {
|
|
174
|
-
id: toValue(id),
|
|
175
|
-
api: "media",
|
|
176
|
-
key: "duration",
|
|
177
|
-
value
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
watch(seeking, (value) => {
|
|
181
|
-
emitter.emit("update", {
|
|
182
|
-
id: toValue(id),
|
|
183
|
-
api: "media",
|
|
184
|
-
key: "seeking",
|
|
185
|
-
value
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
watch(volume, (value) => {
|
|
189
|
-
emitter.emit("update", {
|
|
190
|
-
id: toValue(id),
|
|
191
|
-
api: "media",
|
|
192
|
-
key: "volume",
|
|
193
|
-
value
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
watch(rate, (value) => {
|
|
197
|
-
emitter.emit("update", {
|
|
198
|
-
id: toValue(id),
|
|
199
|
-
api: "media",
|
|
200
|
-
key: "rate",
|
|
201
|
-
value
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
watch(waiting, (value) => {
|
|
205
|
-
emitter.emit("update", {
|
|
206
|
-
id: toValue(id),
|
|
207
|
-
api: "media",
|
|
208
|
-
key: "waiting",
|
|
209
|
-
value
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
watch(ended, (value) => {
|
|
213
|
-
emitter.emit("update", {
|
|
214
|
-
id: toValue(id),
|
|
215
|
-
api: "media",
|
|
216
|
-
key: "ended",
|
|
217
|
-
value
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
watch(playing, (value) => {
|
|
221
|
-
emitter.emit("update", {
|
|
222
|
-
id: toValue(id),
|
|
223
|
-
api: "media",
|
|
224
|
-
key: "playing",
|
|
225
|
-
value
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
watch(stalled, (value) => {
|
|
229
|
-
emitter.emit("update", {
|
|
230
|
-
id: toValue(id),
|
|
231
|
-
api: "media",
|
|
232
|
-
key: "stalled",
|
|
233
|
-
value
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
watch(buffered, (value) => {
|
|
237
|
-
emitter.emit("update", {
|
|
238
|
-
id: toValue(id),
|
|
239
|
-
api: "media",
|
|
240
|
-
key: "buffered",
|
|
241
|
-
value
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
watch(muted, (value) => {
|
|
245
|
-
emitter.emit("update", {
|
|
246
|
-
id: toValue(id),
|
|
247
|
-
api: "media",
|
|
248
|
-
key: "muted",
|
|
249
|
-
value
|
|
250
|
-
});
|
|
251
|
-
});
|
|
252
|
-
return {
|
|
253
|
-
currentTime,
|
|
254
|
-
remainingTime,
|
|
255
|
-
duration,
|
|
256
|
-
seeking,
|
|
257
|
-
volume,
|
|
258
|
-
rate,
|
|
259
|
-
waiting,
|
|
260
|
-
ended,
|
|
261
|
-
playing,
|
|
262
|
-
stalled,
|
|
263
|
-
buffered,
|
|
264
|
-
muted
|
|
265
|
-
};
|
|
266
126
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { type MaybeRef, type Ref } from 'vue';
|
|
2
2
|
import type { MagicPlayerOptions } from '../../types/index.js';
|
|
3
3
|
export type UsePlayerRuntimeArgs = {
|
|
4
4
|
id: MaybeRef<string>;
|
|
5
|
-
mediaRef?:
|
|
5
|
+
mediaRef?: Ref<HTMLVideoElement | HTMLAudioElement | null>;
|
|
6
6
|
srcType?: MagicPlayerOptions['srcType'];
|
|
7
7
|
src?: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function usePlayerRuntime(args: UsePlayerRuntimeArgs): {
|
|
10
|
-
loaded: import("vue").Ref<boolean, boolean>;
|
|
11
10
|
initialize: () => void;
|
|
12
11
|
destroy: () => void;
|
|
13
12
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { usePlayerStateEmitter } from "./usePlayerStateEmitter.mjs";
|
|
1
|
+
import { shallowRef, toRefs, toValue } from "vue";
|
|
3
2
|
import { useEventListener } from "@vueuse/core";
|
|
3
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
4
4
|
export function usePlayerRuntime(args) {
|
|
5
5
|
let hls;
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const {
|
|
6
|
+
const defferedLoading = shallowRef(false);
|
|
7
|
+
const { id, mediaRef, srcType, src } = args;
|
|
8
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
9
|
+
const state = initializeState();
|
|
10
|
+
const { loaded } = toRefs(state);
|
|
9
11
|
function useNative() {
|
|
10
12
|
const el = toValue(mediaRef);
|
|
11
13
|
if (!el || !src) return;
|
|
@@ -61,27 +63,7 @@ export function usePlayerRuntime(args) {
|
|
|
61
63
|
hls?.destroy();
|
|
62
64
|
defferedLoading.value = false;
|
|
63
65
|
}
|
|
64
|
-
const emitter = usePlayerStateEmitter();
|
|
65
|
-
emitter.on("update", (payload) => {
|
|
66
|
-
if (payload.id !== toValue(args.id)) return;
|
|
67
|
-
if (payload.api === "runtime") {
|
|
68
|
-
switch (payload.key) {
|
|
69
|
-
case "loaded":
|
|
70
|
-
loaded.value = payload.value;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
watch(loaded, (value) => {
|
|
76
|
-
emitter.emit("update", {
|
|
77
|
-
id: toValue(args.id),
|
|
78
|
-
api: "runtime",
|
|
79
|
-
key: "loaded",
|
|
80
|
-
value
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
66
|
return {
|
|
84
|
-
loaded,
|
|
85
67
|
initialize,
|
|
86
68
|
destroy
|
|
87
69
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Ref, type MaybeRef } from 'vue';
|
|
2
|
+
import type { PlayerState } from '../../types/index.js';
|
|
3
|
+
export declare function usePlayerState(id: MaybeRef<string>): {
|
|
4
|
+
initializeState: () => PlayerState;
|
|
5
|
+
deleteState: () => void;
|
|
6
|
+
playerStateStore: Ref<PlayerState[], PlayerState[]>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ref, reactive, toValue } from "vue";
|
|
2
|
+
const playerStateStore = ref([]);
|
|
3
|
+
export function usePlayerState(id) {
|
|
4
|
+
function createState(id2) {
|
|
5
|
+
const state = {
|
|
6
|
+
id: id2,
|
|
7
|
+
currentTime: 0,
|
|
8
|
+
duration: 0,
|
|
9
|
+
seeking: false,
|
|
10
|
+
volume: 1,
|
|
11
|
+
rate: 1,
|
|
12
|
+
loaded: false,
|
|
13
|
+
waiting: false,
|
|
14
|
+
ended: false,
|
|
15
|
+
playing: false,
|
|
16
|
+
stalled: false,
|
|
17
|
+
buffered: [],
|
|
18
|
+
muted: false,
|
|
19
|
+
touched: false,
|
|
20
|
+
isFullscreen: false,
|
|
21
|
+
fullscreenTarget: null,
|
|
22
|
+
mouseEntered: false,
|
|
23
|
+
controlsMouseEntered: false,
|
|
24
|
+
dragging: false,
|
|
25
|
+
seekedTime: 0,
|
|
26
|
+
seekedPercentage: 0,
|
|
27
|
+
scrubbedPercentage: 0,
|
|
28
|
+
thumbPercentage: 0,
|
|
29
|
+
popoverOffsetX: 0,
|
|
30
|
+
controlsBarRect: void 0,
|
|
31
|
+
controlsTrackRect: void 0,
|
|
32
|
+
controlsPopoverRect: void 0
|
|
33
|
+
};
|
|
34
|
+
return reactive(state);
|
|
35
|
+
}
|
|
36
|
+
function addState(id2) {
|
|
37
|
+
const state = createState(id2);
|
|
38
|
+
playerStateStore.value = [...playerStateStore.value, state];
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
function initializeState() {
|
|
42
|
+
let state = playerStateStore.value.find((entry) => {
|
|
43
|
+
return entry.id === id;
|
|
44
|
+
});
|
|
45
|
+
if (!state) state = addState(toValue(id));
|
|
46
|
+
return state;
|
|
47
|
+
}
|
|
48
|
+
function deleteState() {
|
|
49
|
+
playerStateStore.value = playerStateStore.value.filter((x) => x.id !== id);
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
initializeState,
|
|
53
|
+
deleteState,
|
|
54
|
+
playerStateStore
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { type MaybeRef } from 'vue';
|
|
1
|
+
import { type MaybeRef, type Ref } from 'vue';
|
|
2
2
|
export type UsePlayerVideoApiArgs = {
|
|
3
3
|
id: MaybeRef<string>;
|
|
4
|
-
playerRef?:
|
|
5
|
-
videoRef?:
|
|
4
|
+
playerRef?: Ref<HTMLElement | null>;
|
|
5
|
+
videoRef?: Ref<HTMLVideoElement | null>;
|
|
6
6
|
};
|
|
7
7
|
export declare function usePlayerVideoApi(args: UsePlayerVideoApiArgs): {
|
|
8
|
-
mouseEntered: import("vue").Ref<boolean, boolean>;
|
|
9
|
-
isFullscreen: import("vue").Ref<boolean, boolean>;
|
|
10
|
-
touched: import("vue").Ref<boolean, boolean>;
|
|
11
8
|
play: () => void;
|
|
12
9
|
pause: () => void;
|
|
13
10
|
togglePlay: () => void;
|
|
@@ -16,7 +13,5 @@ export declare function usePlayerVideoApi(args: UsePlayerVideoApiArgs): {
|
|
|
16
13
|
unmute: () => void;
|
|
17
14
|
enterFullscreen: () => void;
|
|
18
15
|
exitFullscreen: () => void;
|
|
19
|
-
onMouseenter: () => void;
|
|
20
|
-
onMouseleave: () => void;
|
|
21
16
|
};
|
|
22
17
|
export type UsePlayerVideoApiReturn = ReturnType<typeof usePlayerVideoApi>;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toRefs, watch, toValue } from "vue";
|
|
2
2
|
import { useFullscreen } from "@vueuse/core";
|
|
3
3
|
import { isIOS } from "@maas/vue-equipment/utils";
|
|
4
|
-
import {
|
|
5
|
-
import { usePlayerMediaApi } from "./usePlayerMediaApi.mjs";
|
|
4
|
+
import { usePlayerState } from "./usePlayerState.mjs";
|
|
6
5
|
export function usePlayerVideoApi(args) {
|
|
7
6
|
const { id, playerRef, videoRef } = args;
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const touched =
|
|
11
|
-
const
|
|
12
|
-
const { isFullscreen, enter, exit } = useFullscreen(fullscreenTarget);
|
|
7
|
+
const { initializeState } = usePlayerState(toValue(id));
|
|
8
|
+
const state = initializeState();
|
|
9
|
+
const { currentTime, playing, muted, touched, fullscreenTarget } = toRefs(state);
|
|
10
|
+
const { enter, exit } = useFullscreen(fullscreenTarget);
|
|
13
11
|
function play() {
|
|
14
12
|
playing.value = true;
|
|
15
13
|
}
|
|
@@ -28,12 +26,6 @@ export function usePlayerVideoApi(args) {
|
|
|
28
26
|
function unmute() {
|
|
29
27
|
muted.value = false;
|
|
30
28
|
}
|
|
31
|
-
function onMouseenter() {
|
|
32
|
-
mouseEntered.value = true;
|
|
33
|
-
}
|
|
34
|
-
function onMouseleave() {
|
|
35
|
-
mouseEntered.value = false;
|
|
36
|
-
}
|
|
37
29
|
function enterFullscreen() {
|
|
38
30
|
if (!fullscreenTarget.value) {
|
|
39
31
|
console.error("No fullscreen target found");
|
|
@@ -78,52 +70,7 @@ export function usePlayerVideoApi(args) {
|
|
|
78
70
|
}
|
|
79
71
|
});
|
|
80
72
|
}
|
|
81
|
-
const emitter = usePlayerStateEmitter();
|
|
82
|
-
emitter.on("update", (payload) => {
|
|
83
|
-
if (payload.id !== toValue(id)) return;
|
|
84
|
-
if (payload.api === "player") {
|
|
85
|
-
switch (payload.key) {
|
|
86
|
-
case "mouseEntered":
|
|
87
|
-
mouseEntered.value = payload.value;
|
|
88
|
-
break;
|
|
89
|
-
case "fullscreenTarget":
|
|
90
|
-
fullscreenTarget.value = payload.value;
|
|
91
|
-
break;
|
|
92
|
-
case "touched":
|
|
93
|
-
touched.value = payload.value;
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
watch(mouseEntered, (value) => {
|
|
99
|
-
emitter.emit("update", {
|
|
100
|
-
id: toValue(id),
|
|
101
|
-
api: "player",
|
|
102
|
-
key: "mouseEntered",
|
|
103
|
-
value
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
watch(touched, (value) => {
|
|
107
|
-
emitter.emit("update", {
|
|
108
|
-
id: toValue(id),
|
|
109
|
-
api: "player",
|
|
110
|
-
key: "touched",
|
|
111
|
-
value
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
watch(fullscreenTarget, (value) => {
|
|
115
|
-
if (!value) return;
|
|
116
|
-
emitter.emit("update", {
|
|
117
|
-
id: toValue(id),
|
|
118
|
-
api: "player",
|
|
119
|
-
key: "fullscreenTarget",
|
|
120
|
-
value
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
73
|
return {
|
|
124
|
-
mouseEntered,
|
|
125
|
-
isFullscreen,
|
|
126
|
-
touched,
|
|
127
74
|
play,
|
|
128
75
|
pause,
|
|
129
76
|
togglePlay,
|
|
@@ -131,8 +78,6 @@ export function usePlayerVideoApi(args) {
|
|
|
131
78
|
mute,
|
|
132
79
|
unmute,
|
|
133
80
|
enterFullscreen,
|
|
134
|
-
exitFullscreen
|
|
135
|
-
onMouseenter,
|
|
136
|
-
onMouseleave
|
|
81
|
+
exitFullscreen
|
|
137
82
|
};
|
|
138
83
|
}
|
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type MaybeRef } from 'vue';
|
|
2
2
|
export declare function useMagicPlayer(id: MaybeRef<string>): {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
duration: import("vue").Ref<number, number>;
|
|
4
|
+
seeking: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
volume: import("vue").Ref<number, number>;
|
|
6
|
+
rate: import("vue").Ref<number, number>;
|
|
7
|
+
loaded: import("vue").Ref<boolean, boolean>;
|
|
8
|
+
waiting: import("vue").Ref<boolean, boolean>;
|
|
9
|
+
ended: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
playing: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
stalled: import("vue").Ref<boolean, boolean>;
|
|
12
|
+
buffered: import("vue").Ref<import("../types/index.js").Buffered, import("../types/index.js").Buffered>;
|
|
13
|
+
muted: import("vue").Ref<boolean, boolean>;
|
|
14
|
+
touched: import("vue").Ref<boolean, boolean>;
|
|
15
|
+
dragging: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
isFullscreen: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
currentTime: import("vue").Ref<number, number>;
|
|
18
|
+
seekedTime: import("vue").Ref<number, number>;
|
|
19
|
+
seekedPercentage: import("vue").Ref<number, number>;
|
|
20
|
+
scrubbedPercentage: import("vue").Ref<number, number>;
|
|
21
|
+
thumbPercentage: import("vue").Ref<number, number>;
|
|
22
|
+
popoverOffsetX: import("vue").Ref<number, number>;
|
|
23
|
+
audioApi: {
|
|
24
|
+
play: () => void;
|
|
25
|
+
pause: () => void;
|
|
26
|
+
togglePlay: () => void;
|
|
27
|
+
seek: (time: number) => void;
|
|
28
|
+
mute: () => void;
|
|
29
|
+
unmute: () => void;
|
|
16
30
|
};
|
|
17
31
|
videoApi: {
|
|
18
|
-
mouseEntered: import("vue").Ref<boolean, boolean>;
|
|
19
|
-
isFullscreen: import("vue").Ref<boolean, boolean>;
|
|
20
|
-
touched: import("vue").Ref<boolean, boolean>;
|
|
21
32
|
play: () => void;
|
|
22
33
|
pause: () => void;
|
|
23
34
|
togglePlay: () => void;
|
|
@@ -26,47 +37,17 @@ export declare function useMagicPlayer(id: MaybeRef<string>): {
|
|
|
26
37
|
unmute: () => void;
|
|
27
38
|
enterFullscreen: () => void;
|
|
28
39
|
exitFullscreen: () => void;
|
|
29
|
-
onMouseenter: () => void;
|
|
30
|
-
onMouseleave: () => void;
|
|
31
40
|
};
|
|
32
41
|
controlsApi: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
seekedTime: import("vue").Ref<number, number>;
|
|
36
|
-
seekedPercentage: import("vue").Ref<number, number>;
|
|
37
|
-
scrubbedPercentage: import("vue").Ref<number, number>;
|
|
42
|
+
initialize: () => void;
|
|
43
|
+
destroy: () => void;
|
|
38
44
|
bufferedPercentage: import("vue").ComputedRef<number>;
|
|
39
|
-
thumbPercentage: import("vue").Ref<number, number>;
|
|
40
|
-
popoverOffsetX: import("vue").Ref<number, number>;
|
|
41
45
|
onMouseenter: () => void;
|
|
42
46
|
onMouseleave: () => void;
|
|
43
|
-
onPointerdown: (e:
|
|
44
|
-
|
|
45
|
-
onPointermove: (e: MouseEvent | TouchEvent) => void;
|
|
46
|
-
trackRect: import("vue").Ref<{
|
|
47
|
-
height: number;
|
|
48
|
-
width: number;
|
|
49
|
-
x: number;
|
|
50
|
-
y: number;
|
|
51
|
-
readonly bottom: number;
|
|
52
|
-
readonly left: number;
|
|
53
|
-
readonly right: number;
|
|
54
|
-
readonly top: number;
|
|
55
|
-
toJSON: () => any;
|
|
56
|
-
} | undefined, DOMRect | {
|
|
57
|
-
height: number;
|
|
58
|
-
width: number;
|
|
59
|
-
x: number;
|
|
60
|
-
y: number;
|
|
61
|
-
readonly bottom: number;
|
|
62
|
-
readonly left: number;
|
|
63
|
-
readonly right: number;
|
|
64
|
-
readonly top: number;
|
|
65
|
-
toJSON: () => any;
|
|
66
|
-
} | undefined>;
|
|
47
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
48
|
+
onPointermove: (e: PointerEvent) => void;
|
|
67
49
|
};
|
|
68
50
|
playerRuntime: {
|
|
69
|
-
loaded: import("vue").Ref<boolean, boolean>;
|
|
70
51
|
initialize: () => void;
|
|
71
52
|
destroy: () => void;
|
|
72
53
|
};
|
|
@@ -1,14 +1,61 @@
|
|
|
1
|
+
import { toRefs } from "vue";
|
|
1
2
|
import { usePlayerMediaApi } from "./private/usePlayerMediaApi.mjs";
|
|
2
3
|
import { usePlayerVideoApi } from "./private/usePlayerVideoApi.mjs";
|
|
4
|
+
import { usePlayerAudioApi } from "./private/usePlayerAudioApi.mjs";
|
|
3
5
|
import { usePlayerRuntime } from "./private/usePlayerRuntime.mjs";
|
|
4
6
|
import { usePlayerControlsApi } from "./private/usePlayerControlsApi.mjs";
|
|
7
|
+
import { usePlayerState } from "./private/usePlayerState.mjs";
|
|
5
8
|
export function useMagicPlayer(id) {
|
|
6
|
-
const
|
|
9
|
+
const audioApi = usePlayerAudioApi({ id });
|
|
7
10
|
const videoApi = usePlayerVideoApi({ id });
|
|
8
11
|
const controlsApi = usePlayerControlsApi({ id });
|
|
9
12
|
const playerRuntime = usePlayerRuntime({ id });
|
|
13
|
+
const { initializeState } = usePlayerState(id);
|
|
14
|
+
const state = initializeState();
|
|
15
|
+
const {
|
|
16
|
+
currentTime,
|
|
17
|
+
duration,
|
|
18
|
+
seeking,
|
|
19
|
+
volume,
|
|
20
|
+
rate,
|
|
21
|
+
loaded,
|
|
22
|
+
waiting,
|
|
23
|
+
ended,
|
|
24
|
+
playing,
|
|
25
|
+
stalled,
|
|
26
|
+
buffered,
|
|
27
|
+
muted,
|
|
28
|
+
touched,
|
|
29
|
+
dragging,
|
|
30
|
+
isFullscreen,
|
|
31
|
+
seekedTime,
|
|
32
|
+
seekedPercentage,
|
|
33
|
+
scrubbedPercentage,
|
|
34
|
+
thumbPercentage,
|
|
35
|
+
popoverOffsetX
|
|
36
|
+
} = toRefs(state);
|
|
10
37
|
return {
|
|
11
|
-
|
|
38
|
+
duration,
|
|
39
|
+
seeking,
|
|
40
|
+
volume,
|
|
41
|
+
rate,
|
|
42
|
+
loaded,
|
|
43
|
+
waiting,
|
|
44
|
+
ended,
|
|
45
|
+
playing,
|
|
46
|
+
stalled,
|
|
47
|
+
buffered,
|
|
48
|
+
muted,
|
|
49
|
+
touched,
|
|
50
|
+
dragging,
|
|
51
|
+
isFullscreen,
|
|
52
|
+
currentTime,
|
|
53
|
+
seekedTime,
|
|
54
|
+
seekedPercentage,
|
|
55
|
+
scrubbedPercentage,
|
|
56
|
+
thumbPercentage,
|
|
57
|
+
popoverOffsetX,
|
|
58
|
+
audioApi,
|
|
12
59
|
videoApi,
|
|
13
60
|
controlsApi,
|
|
14
61
|
playerRuntime
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type { InjectionKey, MaybeRef } from 'vue';
|
|
1
|
+
import type { InjectionKey, MaybeRef, Ref } from 'vue';
|
|
2
2
|
import type { MagicPlayerOptions } from '../types/index.js';
|
|
3
3
|
declare const MagicPlayerInstanceId: InjectionKey<MaybeRef<string>>;
|
|
4
4
|
declare const MagicPlayerOptionsKey: InjectionKey<MagicPlayerOptions>;
|
|
5
|
-
|
|
5
|
+
declare const MagicPlayerTrackRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
6
|
+
declare const MagicPlayerBarRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
7
|
+
declare const MagicPlayerPopoverRef: InjectionKey<Ref<HTMLDivElement | null>>;
|
|
8
|
+
export { MagicPlayerInstanceId, MagicPlayerOptionsKey, MagicPlayerTrackRef, MagicPlayerBarRef, MagicPlayerPopoverRef, };
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
const MagicPlayerInstanceId = Symbol();
|
|
2
2
|
const MagicPlayerOptionsKey = Symbol();
|
|
3
|
-
|
|
3
|
+
const MagicPlayerTrackRef = Symbol();
|
|
4
|
+
const MagicPlayerBarRef = Symbol();
|
|
5
|
+
const MagicPlayerPopoverRef = Symbol();
|
|
6
|
+
export {
|
|
7
|
+
MagicPlayerInstanceId,
|
|
8
|
+
MagicPlayerOptionsKey,
|
|
9
|
+
MagicPlayerTrackRef,
|
|
10
|
+
MagicPlayerBarRef,
|
|
11
|
+
MagicPlayerPopoverRef
|
|
12
|
+
};
|
|
@@ -19,4 +19,33 @@ export type PlayerPrivateEvents = {
|
|
|
19
19
|
value: string | number | boolean | Buffered | DOMRect | HTMLElement;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
export interface PlayerState {
|
|
23
|
+
id: string;
|
|
24
|
+
currentTime: number;
|
|
25
|
+
duration: number;
|
|
26
|
+
seeking: boolean;
|
|
27
|
+
volume: number;
|
|
28
|
+
rate: number;
|
|
29
|
+
loaded: boolean;
|
|
30
|
+
waiting: boolean;
|
|
31
|
+
ended: boolean;
|
|
32
|
+
playing: boolean;
|
|
33
|
+
stalled: boolean;
|
|
34
|
+
buffered: Buffered;
|
|
35
|
+
muted: boolean;
|
|
36
|
+
touched: boolean;
|
|
37
|
+
isFullscreen: boolean;
|
|
38
|
+
fullscreenTarget: HTMLElement | null;
|
|
39
|
+
mouseEntered: boolean;
|
|
40
|
+
controlsMouseEntered: boolean;
|
|
41
|
+
dragging: boolean;
|
|
42
|
+
seekedTime: number;
|
|
43
|
+
seekedPercentage: number;
|
|
44
|
+
scrubbedPercentage: number;
|
|
45
|
+
thumbPercentage: number;
|
|
46
|
+
popoverOffsetX: number;
|
|
47
|
+
controlsBarRect: DOMRect | undefined;
|
|
48
|
+
controlsTrackRect: DOMRect | undefined;
|
|
49
|
+
controlsPopoverRect: DOMRect | undefined;
|
|
50
|
+
}
|
|
22
51
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("
|
|
1
|
+
declare const _default: import("nuxt/schema").NuxtModule<import("nuxt/schema").ModuleOptions, import("nuxt/schema").ModuleOptions, false>;
|
|
2
2
|
export default _default;
|