@munsonlabs/video-player 0.2.3 → 0.2.5
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 +49 -33
- package/dist/chunks/{ads-BV769SMr.mjs → ads-Dph3guS9.mjs} +1 -1
- package/dist/{elements/chunks/brightcove-rNI-XRxB.mjs → chunks/brightcove-DiJF_74z.mjs} +1 -1
- package/dist/chunks/constants-35ZnLsDv.mjs +1 -0
- package/dist/chunks/dailymotion-DTooszoV.mjs +1 -0
- package/dist/chunks/embedShared-CbArTtuR.mjs +1 -0
- package/dist/chunks/{jwplayer-WIkwoJTA.mjs → jwplayer-Dhq65VxK.mjs} +1 -1
- package/dist/chunks/loadScript-CxzeXqTe.mjs +1 -0
- package/dist/chunks/{sourceHelpers-rbs6D6ZG.mjs → sourceHelpers-B0tH-grj.mjs} +1 -1
- package/dist/chunks/vimeo-D0GAjId0.mjs +1 -0
- package/dist/chunks/youtube-B8AT2F-4.mjs +1 -0
- package/dist/elements/chunks/{ads-BV769SMr.mjs → ads-Dph3guS9.mjs} +1 -1
- package/dist/{chunks/brightcove-rNI-XRxB.mjs → elements/chunks/brightcove-DiJF_74z.mjs} +1 -1
- package/dist/elements/chunks/constants-35ZnLsDv.mjs +1 -0
- package/dist/elements/chunks/dailymotion-DTooszoV.mjs +1 -0
- package/dist/elements/chunks/embedShared-CbArTtuR.mjs +1 -0
- package/dist/elements/chunks/{jwplayer-WIkwoJTA.mjs → jwplayer-Dhq65VxK.mjs} +1 -1
- package/dist/elements/chunks/loadScript-CxzeXqTe.mjs +1 -0
- package/dist/elements/chunks/{sourceHelpers-rbs6D6ZG.mjs → sourceHelpers-B0tH-grj.mjs} +1 -1
- package/dist/elements/chunks/vimeo-D0GAjId0.mjs +1 -0
- package/dist/elements/chunks/youtube-B8AT2F-4.mjs +1 -0
- package/dist/elements/controls.d.mts +166 -38
- package/dist/elements/controls.mjs +1 -1
- package/dist/elements/core.d.mts +26 -31
- package/dist/elements/core.mjs +1 -1
- package/dist/elements/index.d.mts +136 -69
- package/dist/elements/index.mjs +1 -1
- package/dist/index.d.mts +208 -209
- package/dist/index.mjs +1 -1
- package/package.json +5 -3
- package/dist/chunks/constants-zR-UwEWY.mjs +0 -1
- package/dist/chunks/dailymotion-gEquA4h5.mjs +0 -1
- package/dist/chunks/embedShared-duyOYFQN.mjs +0 -1
- package/dist/chunks/loadScript-Du6JsTc2.mjs +0 -1
- package/dist/chunks/vimeo-WJYDJPA3.mjs +0 -1
- package/dist/chunks/youtube-DbJ-IrvP.mjs +0 -1
- package/dist/elements/chunks/constants-zR-UwEWY.mjs +0 -1
- package/dist/elements/chunks/dailymotion-gEquA4h5.mjs +0 -1
- package/dist/elements/chunks/embedShared-duyOYFQN.mjs +0 -1
- package/dist/elements/chunks/loadScript-Du6JsTc2.mjs +0 -1
- package/dist/elements/chunks/vimeo-WJYDJPA3.mjs +0 -1
- package/dist/elements/chunks/youtube-DbJ-IrvP.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,17 +2,6 @@ import { ComputedRef, Plugin, Ref, UnwrapNestedRefs } from "vue";
|
|
|
2
2
|
//#region src/composables/player/emitter.d.ts
|
|
3
3
|
type PlaybackListener = (...args: unknown[]) => void;
|
|
4
4
|
//#endregion
|
|
5
|
-
//#region src/adapters/embeds/embedShared.d.ts
|
|
6
|
-
interface EmbedAdapterOptions {
|
|
7
|
-
src: string;
|
|
8
|
-
poster?: string;
|
|
9
|
-
autoplay?: boolean;
|
|
10
|
-
muted?: boolean;
|
|
11
|
-
volume?: number;
|
|
12
|
-
nativeUi?: boolean;
|
|
13
|
-
customVars?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
5
|
//#region src/types/playback.d.ts
|
|
17
6
|
interface MediaErrorLike {
|
|
18
7
|
code: number;
|
|
@@ -31,7 +20,7 @@ interface QualityLevelInfo {
|
|
|
31
20
|
}
|
|
32
21
|
interface PlaybackAdapter {
|
|
33
22
|
readonly el: HTMLElement;
|
|
34
|
-
play():
|
|
23
|
+
play(): Promise<void>;
|
|
35
24
|
pause(): void;
|
|
36
25
|
paused(): boolean;
|
|
37
26
|
currentTime(): number;
|
|
@@ -61,7 +50,7 @@ interface PlaybackAdapter {
|
|
|
61
50
|
togglePip(): void;
|
|
62
51
|
enterFullscreen(): void;
|
|
63
52
|
exitFullscreen(): void;
|
|
64
|
-
on(event: string
|
|
53
|
+
on(event: string, listener: PlaybackListener): void;
|
|
65
54
|
off(event: string, listener: PlaybackListener): void;
|
|
66
55
|
dispose(): void;
|
|
67
56
|
}
|
|
@@ -76,6 +65,14 @@ interface Matcher {
|
|
|
76
65
|
key: string;
|
|
77
66
|
embed: boolean;
|
|
78
67
|
}
|
|
68
|
+
interface EmbedAdapterOptions {
|
|
69
|
+
src: string;
|
|
70
|
+
poster?: string;
|
|
71
|
+
autoplay?: boolean;
|
|
72
|
+
muted?: boolean;
|
|
73
|
+
volume?: number;
|
|
74
|
+
nativeUi?: boolean;
|
|
75
|
+
}
|
|
79
76
|
type EmbedAdapterFactory = (videoEl: HTMLVideoElement, options: EmbedAdapterOptions) => PlaybackAdapter;
|
|
80
77
|
type SourceResolver = (url: string) => ResolvedSource | Promise<ResolvedSource>;
|
|
81
78
|
type PlatformConfig = Pick<Matcher, 'key' | 'test'> & ({
|
|
@@ -86,6 +83,124 @@ type PlatformConfig = Pick<Matcher, 'key' | 'test'> & ({
|
|
|
86
83
|
resolveSource?: SourceResolver;
|
|
87
84
|
});
|
|
88
85
|
//#endregion
|
|
86
|
+
//#region src/composables/player/playerState.d.ts
|
|
87
|
+
declare function createPlayerState(props: PlayerProps): {
|
|
88
|
+
isPlaying: import("vue").Ref<boolean, boolean>;
|
|
89
|
+
hasEnded: import("vue").Ref<boolean, boolean>;
|
|
90
|
+
isReady: import("vue").Ref<boolean, boolean>;
|
|
91
|
+
isLoaded: import("vue").Ref<boolean, boolean>;
|
|
92
|
+
isLive: import("vue").Ref<boolean, boolean>;
|
|
93
|
+
hasStarted: import("vue").Ref<boolean, boolean>;
|
|
94
|
+
isError: import("vue").Ref<boolean, boolean>;
|
|
95
|
+
errorMessage: import("vue").Ref<string, string>;
|
|
96
|
+
current: import("vue").Ref<number, number>;
|
|
97
|
+
total: import("vue").Ref<number, number>;
|
|
98
|
+
buffered: import("vue").Ref<number, number>;
|
|
99
|
+
progress: import("vue").ComputedRef<number>;
|
|
100
|
+
bufferedDisplay: import("vue").ComputedRef<number>;
|
|
101
|
+
vol: import("vue").Ref<number, number>;
|
|
102
|
+
isMuted: import("vue").Ref<boolean, boolean>;
|
|
103
|
+
isAudible: import("vue").ComputedRef<boolean>;
|
|
104
|
+
isLooping: import("vue").Ref<boolean, boolean>;
|
|
105
|
+
currentPlaybackRate: import("vue").Ref<number, number>;
|
|
106
|
+
supportsPlaybackRate: import("vue").Ref<boolean, boolean>;
|
|
107
|
+
isAdPlaying: import("vue").Ref<boolean, boolean>;
|
|
108
|
+
isAdPaused: import("vue").Ref<boolean, boolean>;
|
|
109
|
+
isAdMuted: import("vue").Ref<boolean, boolean>;
|
|
110
|
+
adRemainingTime: import("vue").Ref<number, number>;
|
|
111
|
+
supportsCaptions: import("vue").Ref<boolean, boolean>;
|
|
112
|
+
captionTracks: import("vue").Ref<{
|
|
113
|
+
index: number;
|
|
114
|
+
label: string;
|
|
115
|
+
language: string;
|
|
116
|
+
}[], CaptionTrackInfo[] | {
|
|
117
|
+
index: number;
|
|
118
|
+
label: string;
|
|
119
|
+
language: string;
|
|
120
|
+
}[]>;
|
|
121
|
+
activeCaptionIndex: import("vue").Ref<number | null, number | null>;
|
|
122
|
+
supportsQuality: import("vue").Ref<boolean, boolean>;
|
|
123
|
+
qualityLevels: import("vue").Ref<{
|
|
124
|
+
index: number;
|
|
125
|
+
height: number;
|
|
126
|
+
bitrate: number;
|
|
127
|
+
label: string;
|
|
128
|
+
}[], QualityLevelInfo[] | {
|
|
129
|
+
index: number;
|
|
130
|
+
height: number;
|
|
131
|
+
bitrate: number;
|
|
132
|
+
label: string;
|
|
133
|
+
}[]>;
|
|
134
|
+
currentQualityIndex: import("vue").Ref<number | null, number | null>;
|
|
135
|
+
isAutoQuality: import("vue").Ref<boolean, boolean>;
|
|
136
|
+
supportsPip: import("vue").Ref<boolean, boolean>;
|
|
137
|
+
isPipActive: import("vue").Ref<boolean, boolean>;
|
|
138
|
+
isNativeUi: import("vue").Ref<boolean, boolean>;
|
|
139
|
+
};
|
|
140
|
+
type PlayerState = ReturnType<typeof createPlayerState>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/composables/player/usePlayerControls.d.ts
|
|
143
|
+
interface UsePlayerControlsReturn {
|
|
144
|
+
play: () => Promise<void>;
|
|
145
|
+
pause: () => void;
|
|
146
|
+
replay: () => Promise<void>;
|
|
147
|
+
togglePlay: () => void;
|
|
148
|
+
seek: (percent: number) => void;
|
|
149
|
+
seekTo: (seconds: number) => void;
|
|
150
|
+
toggleMute: () => void;
|
|
151
|
+
setVolume: (vol: number) => void;
|
|
152
|
+
toggleLoop: () => void;
|
|
153
|
+
setPlaybackRate: (rate: number) => void;
|
|
154
|
+
setCaptionTrack: (index: number | null) => void;
|
|
155
|
+
setQuality: (index: number | null) => void;
|
|
156
|
+
togglePip: () => void;
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/composables/player/usePlayer.d.ts
|
|
160
|
+
type UsePlayerReturn = PlayerState & UsePlayerControlsReturn & {
|
|
161
|
+
fire: (type: StateChangeType, extras?: Partial<StateChangeEvent>) => void;
|
|
162
|
+
retry: () => void;
|
|
163
|
+
isBuffering: Ref<boolean>;
|
|
164
|
+
toggleAdMute: () => void;
|
|
165
|
+
isFullscreen: Ref<boolean>;
|
|
166
|
+
isFullscreenPending: Ref<boolean>;
|
|
167
|
+
toggleFullscreen: () => void;
|
|
168
|
+
};
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/composables/overlay/useHud.d.ts
|
|
171
|
+
interface UseHudReturn {
|
|
172
|
+
showHUD: Ref<boolean>;
|
|
173
|
+
isOpen: Ref<boolean>;
|
|
174
|
+
scheduleHide: (delay?: number) => void;
|
|
175
|
+
pauseHide: () => void;
|
|
176
|
+
onVideoTap: () => void;
|
|
177
|
+
onMouseMove: () => void;
|
|
178
|
+
onMouseLeave: () => void;
|
|
179
|
+
openControls: () => void;
|
|
180
|
+
closeControls: (immediate?: boolean) => void;
|
|
181
|
+
keepOpen: () => void;
|
|
182
|
+
suppressMouseLeave: (ms?: number) => void;
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/composables/player/playerContext.d.ts
|
|
186
|
+
type PlayerContext = UnwrapNestedRefs<UsePlayerReturn>;
|
|
187
|
+
type HudContext = UnwrapNestedRefs<UseHudReturn>;
|
|
188
|
+
interface PlaylistContext {
|
|
189
|
+
hasPlaylist: boolean;
|
|
190
|
+
hasNext: boolean;
|
|
191
|
+
hasPrevious: boolean;
|
|
192
|
+
autoAdvance: boolean;
|
|
193
|
+
playNext: () => void;
|
|
194
|
+
playPrevious: () => void;
|
|
195
|
+
toggleAutoAdvance: () => void;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/composables/player/playerSurface.d.ts
|
|
199
|
+
declare const PLAYER_METHOD_KEYS: readonly ["retry", "play", "pause", "replay", "togglePlay", "seek", "seekTo", "toggleMute", "setVolume", "toggleFullscreen", "toggleLoop", "toggleAdMute", "setPlaybackRate", "setCaptionTrack", "setQuality", "togglePip"];
|
|
200
|
+
declare const PLAYER_STATE_KEYS: readonly ["isPlaying", "hasEnded", "isReady", "isLoaded", "isAdPlaying", "isAdPaused", "isAdMuted", "adRemainingTime", "isLive", "isBuffering", "current", "total", "vol", "isMuted", "isAudible", "isLooping", "currentPlaybackRate", "hasStarted", "isError", "errorMessage", "progress", "bufferedDisplay", "isFullscreen", "supportsPlaybackRate", "supportsCaptions", "captionTracks", "activeCaptionIndex", "supportsQuality", "qualityLevels", "currentQualityIndex", "isAutoQuality", "supportsPip", "isPipActive", "isNativeUi"];
|
|
201
|
+
type PlayerMethodKey = (typeof PLAYER_METHOD_KEYS)[number];
|
|
202
|
+
type PlayerStateKey = (typeof PLAYER_STATE_KEYS)[number];
|
|
203
|
+
//#endregion
|
|
89
204
|
//#region src/types/player.d.ts
|
|
90
205
|
export type BuiltinAction = 'mute' | 'loop' | 'autoplay';
|
|
91
206
|
export interface CustomAction {
|
|
@@ -94,7 +209,7 @@ export interface CustomAction {
|
|
|
94
209
|
onClick: () => void;
|
|
95
210
|
}
|
|
96
211
|
export type PlayerAction = BuiltinAction | CustomAction;
|
|
97
|
-
export type StateChangeType = 'play' | 'pause' | 'ended' | 'seeked' | 'error' | 'adstart' | 'adend' | 'volumechange' | 'ratechange' | 'captionchange' | 'qualitychange' | 'pipchange' | 'loopchange' | 'firstQuartile' | 'midpoint' | 'thirdQuartile' | 'controlsopen' | 'controlsclose' | 'stageopen' | 'stageclose' | 'bufferstart' | 'bufferend' | 'timeupdate' | 'tap';
|
|
212
|
+
export type StateChangeType = 'loaded' | 'play' | 'pause' | 'ended' | 'seeked' | 'error' | 'adstart' | 'adend' | 'volumechange' | 'ratechange' | 'captionchange' | 'qualitychange' | 'pipchange' | 'loopchange' | 'firstQuartile' | 'midpoint' | 'thirdQuartile' | 'controlsopen' | 'controlsclose' | 'stageopen' | 'stageclose' | 'bufferstart' | 'bufferend' | 'timeupdate' | 'tap';
|
|
98
213
|
export interface StateChangeEvent {
|
|
99
214
|
type: StateChangeType;
|
|
100
215
|
currentTime: number;
|
|
@@ -137,7 +252,7 @@ export interface CaptionTrackDef {
|
|
|
137
252
|
}
|
|
138
253
|
export interface PlayerProps {
|
|
139
254
|
src: string;
|
|
140
|
-
|
|
255
|
+
label?: string;
|
|
141
256
|
poster?: string;
|
|
142
257
|
aspectRatio?: string;
|
|
143
258
|
adTagUrl?: string;
|
|
@@ -149,8 +264,6 @@ export interface PlayerProps {
|
|
|
149
264
|
volume?: number;
|
|
150
265
|
playbackRate?: number;
|
|
151
266
|
nativeUi?: boolean;
|
|
152
|
-
autoStage?: boolean;
|
|
153
|
-
lazy?: boolean;
|
|
154
267
|
payload?: Record<string, unknown> | string;
|
|
155
268
|
action?: PlayerAction | null;
|
|
156
269
|
disableTapCapture?: boolean;
|
|
@@ -158,16 +271,18 @@ export interface PlayerProps {
|
|
|
158
271
|
controls?: boolean;
|
|
159
272
|
playInView?: boolean;
|
|
160
273
|
pin?: PinCorner;
|
|
274
|
+
loop?: boolean;
|
|
275
|
+
preload?: PreloadMode;
|
|
161
276
|
}
|
|
162
277
|
export type PinCorner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
163
|
-
export
|
|
164
|
-
currentSrc: string | null;
|
|
165
|
-
isPlaying: boolean;
|
|
166
|
-
}
|
|
278
|
+
export type PreloadMode = 'none' | 'metadata' | 'auto';
|
|
167
279
|
export interface VideoToggleDetail {
|
|
168
280
|
src: string;
|
|
169
281
|
}
|
|
170
|
-
export
|
|
282
|
+
export interface VideoEntry extends PlayerProps {
|
|
283
|
+
lazy?: boolean;
|
|
284
|
+
autoStage?: boolean;
|
|
285
|
+
}
|
|
171
286
|
export interface VideoSelectDetail extends VideoEntry {
|
|
172
287
|
fromGesture?: boolean;
|
|
173
288
|
}
|
|
@@ -176,156 +291,15 @@ export interface TranscriptCue {
|
|
|
176
291
|
end?: number;
|
|
177
292
|
text: string;
|
|
178
293
|
}
|
|
179
|
-
export
|
|
180
|
-
isPlaying: boolean;
|
|
181
|
-
togglePlay(): void;
|
|
182
|
-
hasEnded: boolean;
|
|
183
|
-
isError: boolean;
|
|
184
|
-
retry(): void;
|
|
185
|
-
isMuted: boolean;
|
|
186
|
-
toggleMute(): void;
|
|
187
|
-
isAudible: boolean;
|
|
188
|
-
isFullscreen: boolean;
|
|
189
|
-
toggleFullscreen(): void;
|
|
190
|
-
current: number;
|
|
191
|
-
total: number;
|
|
192
|
-
seek(percent: number): void;
|
|
193
|
-
bufferedDisplay: number;
|
|
194
|
-
isBuffering: boolean;
|
|
195
|
-
isLive: boolean;
|
|
196
|
-
vol: number;
|
|
197
|
-
setVolume(vol: number): void;
|
|
198
|
-
isLooping: boolean;
|
|
199
|
-
toggleLoop(): void;
|
|
200
|
-
supportsPip: boolean;
|
|
201
|
-
isPipActive: boolean;
|
|
202
|
-
togglePip(): void;
|
|
203
|
-
supportsCaptions: boolean;
|
|
204
|
-
captionTracks: CaptionTrackInfo[];
|
|
205
|
-
activeCaptionIndex: number | null;
|
|
206
|
-
setCaptionTrack(index: number | null): void;
|
|
207
|
-
supportsQuality: boolean;
|
|
208
|
-
qualityLevels: QualityLevelInfo[];
|
|
209
|
-
currentQualityIndex: number | null;
|
|
210
|
-
isAutoQuality: boolean;
|
|
211
|
-
setQuality(index: number | null): void;
|
|
212
|
-
supportsPlaybackRate: boolean;
|
|
213
|
-
currentPlaybackRate: number;
|
|
214
|
-
setPlaybackRate(rate: number): void;
|
|
215
|
-
}
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/composables/player/usePlayer.d.ts
|
|
218
|
-
interface UsePlayerReturn {
|
|
219
|
-
isPlaying: Ref<boolean>;
|
|
220
|
-
hasEnded: Ref<boolean>;
|
|
221
|
-
isReady: Ref<boolean>;
|
|
222
|
-
isLive: Ref<boolean>;
|
|
223
|
-
isBuffering: Ref<boolean>;
|
|
224
|
-
current: Ref<number>;
|
|
225
|
-
total: Ref<number>;
|
|
226
|
-
progress: ComputedRef<number>;
|
|
227
|
-
bufferedDisplay: ComputedRef<number>;
|
|
228
|
-
hasStarted: Ref<boolean>;
|
|
229
|
-
isError: Ref<boolean>;
|
|
230
|
-
errorMessage: Ref<string>;
|
|
231
|
-
fmt: (s: number) => string;
|
|
232
|
-
fire: (type: StateChangeType, extras?: Partial<StateChangeEvent>) => void;
|
|
233
|
-
retry: () => void;
|
|
234
|
-
togglePlay: () => void;
|
|
235
|
-
seek: (val: number) => void;
|
|
236
|
-
isAdPlaying: Ref<boolean>;
|
|
237
|
-
isAdPaused: Ref<boolean>;
|
|
238
|
-
isAdMuted: Ref<boolean>;
|
|
239
|
-
adRemainingTime: Ref<number>;
|
|
240
|
-
toggleAdMute: () => void;
|
|
241
|
-
vol: Ref<number>;
|
|
242
|
-
isMuted: Ref<boolean>;
|
|
243
|
-
isAudible: ComputedRef<boolean>;
|
|
244
|
-
toggleMute: () => void;
|
|
245
|
-
setVolume: (val: number) => void;
|
|
246
|
-
isLooping: Ref<boolean>;
|
|
247
|
-
toggleLoop: () => void;
|
|
248
|
-
currentPlaybackRate: Ref<number>;
|
|
249
|
-
setPlaybackRate: (rate: number) => void;
|
|
250
|
-
supportsPlaybackRate: Ref<boolean>;
|
|
251
|
-
isFullscreen: Ref<boolean>;
|
|
252
|
-
isFullscreenPending: Ref<boolean>;
|
|
253
|
-
toggleFullscreen: () => void;
|
|
254
|
-
markFullscreenPending: () => void;
|
|
255
|
-
supportsCaptions: Ref<boolean>;
|
|
256
|
-
captionTracks: Ref<CaptionTrackInfo[]>;
|
|
257
|
-
activeCaptionIndex: Ref<number | null>;
|
|
258
|
-
setCaptionTrack: (index: number | null) => void;
|
|
259
|
-
supportsQuality: Ref<boolean>;
|
|
260
|
-
qualityLevels: Ref<QualityLevelInfo[]>;
|
|
261
|
-
currentQualityIndex: Ref<number | null>;
|
|
262
|
-
isAutoQuality: Ref<boolean>;
|
|
263
|
-
setQuality: (index: number | null) => void;
|
|
264
|
-
supportsPip: Ref<boolean>;
|
|
265
|
-
isPipActive: Ref<boolean>;
|
|
266
|
-
togglePip: () => void;
|
|
267
|
-
isNativeUi: Ref<boolean>;
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/composables/overlay/useHud.d.ts
|
|
271
|
-
interface UseHudReturn {
|
|
272
|
-
showHUD: Ref<boolean>;
|
|
273
|
-
isOpen: Ref<boolean>;
|
|
274
|
-
scheduleHide: (delay?: number) => void;
|
|
275
|
-
pauseHide: () => void;
|
|
276
|
-
onVideoTap: () => void;
|
|
277
|
-
onMouseMove: () => void;
|
|
278
|
-
onMouseLeave: () => void;
|
|
279
|
-
openControls: () => void;
|
|
280
|
-
closeControls: (immediate?: boolean) => void;
|
|
281
|
-
keepOpen: () => void;
|
|
282
|
-
suppressMouseLeave: (ms?: number) => void;
|
|
283
|
-
}
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region src/composables/player/playerContext.d.ts
|
|
286
|
-
type PlayerContext = UnwrapNestedRefs<UsePlayerReturn>;
|
|
287
|
-
type HudContext = UnwrapNestedRefs<UseHudReturn>;
|
|
288
|
-
interface PlaylistContext {
|
|
289
|
-
hasPlaylist: boolean;
|
|
290
|
-
hasNext: boolean;
|
|
291
|
-
hasPrevious: boolean;
|
|
292
|
-
autoAdvance: boolean;
|
|
293
|
-
playNext: () => void;
|
|
294
|
-
playPrevious: () => void;
|
|
295
|
-
toggleAutoAdvance: () => void;
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region src/composables/useForwardedPlayer.d.ts
|
|
299
|
-
declare const METHOD_KEYS: readonly ["retry", "togglePlay", "seek", "toggleMute", "setVolume", "toggleFullscreen", "markFullscreenPending", "toggleLoop", "toggleAdMute", "setPlaybackRate", "setCaptionTrack", "setQuality", "togglePip"];
|
|
300
|
-
declare const STATE_KEYS: readonly ["isPlaying", "hasEnded", "isReady", "isAdPlaying", "isAdPaused", "isAdMuted", "adRemainingTime", "isLive", "isBuffering", "current", "total", "vol", "isMuted", "isAudible", "isLooping", "currentPlaybackRate", "hasStarted", "isError", "errorMessage", "progress", "bufferedDisplay", "isFullscreen", "isFullscreenPending", "supportsPlaybackRate", "supportsCaptions", "captionTracks", "activeCaptionIndex", "supportsQuality", "qualityLevels", "currentQualityIndex", "isAutoQuality", "supportsPip", "isPipActive", "isNativeUi"];
|
|
301
|
-
type MethodKey = (typeof METHOD_KEYS)[number];
|
|
302
|
-
type StateKey = (typeof STATE_KEYS)[number];
|
|
303
|
-
type ForwardedPlayer = { [K in MethodKey]: (...args: Parameters<PlayerContext[K]>) => Promise<void>; } & { [K in StateKey]: ComputedRef<PlayerContext[K]>; };
|
|
304
|
-
interface UseForwardedPlayerReturn {
|
|
305
|
-
playerRef: Ref<PlayerContext | null>;
|
|
306
|
-
forwarded: ForwardedPlayer;
|
|
307
|
-
}
|
|
308
|
-
export declare function useForwardedPlayer(guard?: (key: MethodKey) => boolean | Promise<boolean>): UseForwardedPlayerReturn;
|
|
294
|
+
export type PlayerHandle = Pick<UnwrapNestedRefs<UsePlayerReturn>, PlayerMethodKey | PlayerStateKey>;
|
|
309
295
|
//#endregion
|
|
310
296
|
//#region src/components/VideoPlayer.vue.d.ts
|
|
311
|
-
|
|
312
|
-
hasPlaylist?: boolean;
|
|
313
|
-
hasNext?: boolean;
|
|
314
|
-
hasPrevious?: boolean;
|
|
315
|
-
autoAdvance?: boolean;
|
|
316
|
-
};
|
|
317
|
-
declare const __VLS_export$17: import("vue").DefineComponent<__VLS_Props$2, ForwardedPlayer, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
297
|
+
declare const __VLS_export$17: import("vue").DefineComponent<PlayerProps, PlayerHandle, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
318
298
|
"state-change": (event: StateChangeEvent) => any;
|
|
319
|
-
|
|
320
|
-
"play-previous": () => any;
|
|
321
|
-
"toggle-auto-advance": () => any;
|
|
322
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props$2> & Readonly<{
|
|
299
|
+
}, string, import("vue").PublicProps, Readonly<PlayerProps> & Readonly<{
|
|
323
300
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
324
|
-
"onPlay-next"?: (() => any) | undefined;
|
|
325
|
-
"onPlay-previous"?: (() => any) | undefined;
|
|
326
|
-
"onToggle-auto-advance"?: (() => any) | undefined;
|
|
327
301
|
}>, {
|
|
328
|
-
|
|
302
|
+
label: string;
|
|
329
303
|
poster: string;
|
|
330
304
|
aspectRatio: string;
|
|
331
305
|
adTagUrl: string;
|
|
@@ -333,76 +307,84 @@ declare const __VLS_export$17: import("vue").DefineComponent<__VLS_Props$2, Forw
|
|
|
333
307
|
autoplay: boolean;
|
|
334
308
|
muted: boolean;
|
|
335
309
|
nativeUi: boolean;
|
|
336
|
-
autoStage: boolean;
|
|
337
|
-
lazy: boolean;
|
|
338
310
|
payload: Record<string, unknown> | string;
|
|
339
311
|
action: PlayerAction | null;
|
|
340
312
|
disableTapCapture: boolean;
|
|
341
313
|
disableKeyboardShortcuts: boolean;
|
|
342
314
|
controls: boolean;
|
|
343
315
|
playInView: boolean;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
hasPrevious: boolean;
|
|
347
|
-
autoAdvance: boolean;
|
|
316
|
+
loop: boolean;
|
|
317
|
+
preload: PreloadMode;
|
|
348
318
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
349
319
|
declare const _default$15: typeof __VLS_export$17;
|
|
350
320
|
//#endregion
|
|
351
321
|
//#region src/components/VideoStage.vue.d.ts
|
|
352
322
|
type __VLS_Props$1 = {
|
|
353
|
-
pin?:
|
|
323
|
+
pin?: PinCorner | 'full-width';
|
|
354
324
|
playlist?: VideoEntry[];
|
|
355
325
|
};
|
|
356
326
|
declare function playNext(fromGesture?: boolean): void;
|
|
357
327
|
declare function playPrevious(fromGesture?: boolean): void;
|
|
358
328
|
declare const __VLS_export$16: import("vue").DefineComponent<__VLS_Props$1, {
|
|
359
|
-
|
|
329
|
+
play: () => Promise<void>;
|
|
330
|
+
pause: () => Promise<void>;
|
|
331
|
+
replay: () => Promise<void>;
|
|
360
332
|
togglePlay: () => Promise<void>;
|
|
361
|
-
seek: (
|
|
333
|
+
seek: (percent: number) => Promise<void>;
|
|
334
|
+
seekTo: (seconds: number) => Promise<void>;
|
|
362
335
|
toggleMute: () => Promise<void>;
|
|
363
|
-
setVolume: (
|
|
364
|
-
toggleFullscreen: () => Promise<void>;
|
|
365
|
-
markFullscreenPending: () => Promise<void>;
|
|
336
|
+
setVolume: (vol: number) => Promise<void>;
|
|
366
337
|
toggleLoop: () => Promise<void>;
|
|
367
|
-
toggleAdMute: () => Promise<void>;
|
|
368
338
|
setPlaybackRate: (rate: number) => Promise<void>;
|
|
369
339
|
setCaptionTrack: (index: number | null) => Promise<void>;
|
|
370
340
|
setQuality: (index: number | null) => Promise<void>;
|
|
371
341
|
togglePip: () => Promise<void>;
|
|
342
|
+
retry: () => Promise<void>;
|
|
343
|
+
toggleAdMute: () => Promise<void>;
|
|
344
|
+
toggleFullscreen: () => Promise<void>;
|
|
372
345
|
isPlaying: import("vue").ComputedRef<boolean>;
|
|
373
346
|
hasEnded: import("vue").ComputedRef<boolean>;
|
|
374
347
|
isReady: import("vue").ComputedRef<boolean>;
|
|
375
|
-
|
|
376
|
-
isAdPaused: import("vue").ComputedRef<boolean>;
|
|
377
|
-
isAdMuted: import("vue").ComputedRef<boolean>;
|
|
378
|
-
adRemainingTime: import("vue").ComputedRef<number>;
|
|
348
|
+
isLoaded: import("vue").ComputedRef<boolean>;
|
|
379
349
|
isLive: import("vue").ComputedRef<boolean>;
|
|
380
|
-
|
|
350
|
+
hasStarted: import("vue").ComputedRef<boolean>;
|
|
351
|
+
isError: import("vue").ComputedRef<boolean>;
|
|
352
|
+
errorMessage: import("vue").ComputedRef<string>;
|
|
381
353
|
current: import("vue").ComputedRef<number>;
|
|
382
354
|
total: import("vue").ComputedRef<number>;
|
|
355
|
+
progress: import("vue").ComputedRef<number>;
|
|
356
|
+
bufferedDisplay: import("vue").ComputedRef<number>;
|
|
383
357
|
vol: import("vue").ComputedRef<number>;
|
|
384
358
|
isMuted: import("vue").ComputedRef<boolean>;
|
|
385
359
|
isAudible: import("vue").ComputedRef<boolean>;
|
|
386
360
|
isLooping: import("vue").ComputedRef<boolean>;
|
|
387
361
|
currentPlaybackRate: import("vue").ComputedRef<number>;
|
|
388
|
-
hasStarted: import("vue").ComputedRef<boolean>;
|
|
389
|
-
isError: import("vue").ComputedRef<boolean>;
|
|
390
|
-
errorMessage: import("vue").ComputedRef<string>;
|
|
391
|
-
progress: import("vue").ComputedRef<number>;
|
|
392
|
-
bufferedDisplay: import("vue").ComputedRef<number>;
|
|
393
|
-
isFullscreen: import("vue").ComputedRef<boolean>;
|
|
394
|
-
isFullscreenPending: import("vue").ComputedRef<boolean>;
|
|
395
362
|
supportsPlaybackRate: import("vue").ComputedRef<boolean>;
|
|
363
|
+
isAdPlaying: import("vue").ComputedRef<boolean>;
|
|
364
|
+
isAdPaused: import("vue").ComputedRef<boolean>;
|
|
365
|
+
isAdMuted: import("vue").ComputedRef<boolean>;
|
|
366
|
+
adRemainingTime: import("vue").ComputedRef<number>;
|
|
396
367
|
supportsCaptions: import("vue").ComputedRef<boolean>;
|
|
397
|
-
captionTracks: import("vue").ComputedRef<
|
|
368
|
+
captionTracks: import("vue").ComputedRef<{
|
|
369
|
+
index: number;
|
|
370
|
+
label: string;
|
|
371
|
+
language: string;
|
|
372
|
+
}[]>;
|
|
398
373
|
activeCaptionIndex: import("vue").ComputedRef<number | null>;
|
|
399
374
|
supportsQuality: import("vue").ComputedRef<boolean>;
|
|
400
|
-
qualityLevels: import("vue").ComputedRef<
|
|
375
|
+
qualityLevels: import("vue").ComputedRef<{
|
|
376
|
+
index: number;
|
|
377
|
+
height: number;
|
|
378
|
+
bitrate: number;
|
|
379
|
+
label: string;
|
|
380
|
+
}[]>;
|
|
401
381
|
currentQualityIndex: import("vue").ComputedRef<number | null>;
|
|
402
382
|
isAutoQuality: import("vue").ComputedRef<boolean>;
|
|
403
383
|
supportsPip: import("vue").ComputedRef<boolean>;
|
|
404
384
|
isPipActive: import("vue").ComputedRef<boolean>;
|
|
405
385
|
isNativeUi: import("vue").ComputedRef<boolean>;
|
|
386
|
+
isBuffering: import("vue").ComputedRef<boolean>;
|
|
387
|
+
isFullscreen: import("vue").ComputedRef<boolean>;
|
|
406
388
|
playNext: typeof playNext;
|
|
407
389
|
playPrevious: typeof playPrevious;
|
|
408
390
|
hasNext: import("vue").ComputedRef<boolean>;
|
|
@@ -412,39 +394,47 @@ declare const __VLS_export$16: import("vue").DefineComponent<__VLS_Props$1, {
|
|
|
412
394
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
413
395
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
414
396
|
}>, {
|
|
415
|
-
pin:
|
|
397
|
+
pin: PinCorner | "full-width";
|
|
416
398
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
417
399
|
declare const _default$16: typeof __VLS_export$16;
|
|
418
400
|
//#endregion
|
|
419
401
|
//#region src/components/VideoPlaceholder.vue.d.ts
|
|
420
|
-
declare const __VLS_export$15: import("vue").DefineComponent<
|
|
402
|
+
declare const __VLS_export$15: import("vue").DefineComponent<VideoEntry, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
421
403
|
"enter-view": () => any;
|
|
422
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
404
|
+
}, string, import("vue").PublicProps, Readonly<VideoEntry> & Readonly<{
|
|
423
405
|
"onEnter-view"?: (() => any) | undefined;
|
|
424
406
|
}>, {
|
|
425
|
-
|
|
407
|
+
label: string;
|
|
426
408
|
poster: string;
|
|
427
409
|
aspectRatio: string;
|
|
428
410
|
adTagUrl: string;
|
|
429
411
|
autoplay: boolean;
|
|
430
412
|
muted: boolean;
|
|
431
413
|
nativeUi: boolean;
|
|
432
|
-
autoStage: boolean;
|
|
433
414
|
payload: Record<string, unknown> | string;
|
|
434
415
|
action: PlayerAction | null;
|
|
416
|
+
autoStage: boolean;
|
|
435
417
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
436
418
|
declare const _default$14: typeof __VLS_export$15;
|
|
437
419
|
//#endregion
|
|
420
|
+
//#region src/composables/useForwardedPlayer.d.ts
|
|
421
|
+
type ForwardedPlayer = { [K in PlayerMethodKey]: (...args: Parameters<PlayerContext[K]>) => Promise<void>; } & { [K in PlayerStateKey]: ComputedRef<PlayerContext[K]>; };
|
|
422
|
+
interface UseForwardedPlayerReturn {
|
|
423
|
+
playerRef: Ref<PlayerContext | null>;
|
|
424
|
+
forwarded: ForwardedPlayer;
|
|
425
|
+
}
|
|
426
|
+
export declare function useForwardedPlayer(guard?: (key: PlayerMethodKey) => boolean | Promise<boolean>): UseForwardedPlayerReturn;
|
|
427
|
+
//#endregion
|
|
438
428
|
//#region src/components/VideoCard.vue.d.ts
|
|
439
|
-
declare const __VLS_export$14: import("vue").DefineComponent<
|
|
429
|
+
declare const __VLS_export$14: import("vue").DefineComponent<VideoEntry, ForwardedPlayer, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
440
430
|
"state-change": (event: StateChangeEvent) => any;
|
|
441
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
431
|
+
}, string, import("vue").PublicProps, Readonly<VideoEntry> & Readonly<{
|
|
442
432
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
443
433
|
}>, {
|
|
444
434
|
muted: boolean;
|
|
445
|
-
lazy: boolean;
|
|
446
435
|
action: PlayerAction | null;
|
|
447
436
|
controls: boolean;
|
|
437
|
+
lazy: boolean;
|
|
448
438
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
449
439
|
declare const _default$13: typeof __VLS_export$14;
|
|
450
440
|
//#endregion
|
|
@@ -576,7 +566,11 @@ type __VLS_WithSlots$6<T, S> = T & {
|
|
|
576
566
|
//#region src/components/controls/CaptionsButton.vue.d.ts
|
|
577
567
|
declare var __VLS_1$4: {
|
|
578
568
|
currentLabel: string;
|
|
579
|
-
tracks:
|
|
569
|
+
tracks: {
|
|
570
|
+
index: number;
|
|
571
|
+
label: string;
|
|
572
|
+
language: string;
|
|
573
|
+
}[];
|
|
580
574
|
activeIndex: number | null;
|
|
581
575
|
};
|
|
582
576
|
type __VLS_Slots$5 = {} & {
|
|
@@ -594,7 +588,12 @@ type __VLS_WithSlots$5<T, S> = T & {
|
|
|
594
588
|
//#region src/components/controls/QualityButton.vue.d.ts
|
|
595
589
|
declare var __VLS_1$3: {
|
|
596
590
|
currentLabel: string;
|
|
597
|
-
levels:
|
|
591
|
+
levels: {
|
|
592
|
+
index: number;
|
|
593
|
+
height: number;
|
|
594
|
+
bitrate: number;
|
|
595
|
+
label: string;
|
|
596
|
+
}[];
|
|
598
597
|
currentIndex: number | null;
|
|
599
598
|
isAuto: boolean;
|
|
600
599
|
};
|
|
@@ -689,10 +688,10 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
689
688
|
};
|
|
690
689
|
//#endregion
|
|
691
690
|
//#region src/adapters/index.d.ts
|
|
692
|
-
export declare function
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
691
|
+
export declare function resolvePlatform(url: string): {
|
|
692
|
+
key: string;
|
|
693
|
+
embed: boolean;
|
|
694
|
+
};
|
|
696
695
|
export declare function registerPlatform(config: PlatformConfig): void;
|
|
697
696
|
//#endregion
|
|
698
697
|
//#region src/composables/controls/useScrubber.d.ts
|
|
@@ -733,4 +732,4 @@ export declare function exposePlayerOnElement(el: Element, player: object | null
|
|
|
733
732
|
//#region src/index.d.ts
|
|
734
733
|
declare const VideoPlayerPlugin: Plugin;
|
|
735
734
|
//#endregion
|
|
736
|
-
export { _default as Buffering, type CaptionTrackInfo, _default$1 as CaptionsButton, type EmbedAdapterFactory, type EmbedAdapterOptions, type ForwardedPlayer, _default$2 as FullscreenButton, _default$3 as HideMarker, type HudContext, _default$4 as LoopButton, type Matcher, type MediaErrorLike,
|
|
735
|
+
export { _default as Buffering, type CaptionTrackInfo, _default$1 as CaptionsButton, type EmbedAdapterFactory, type EmbedAdapterOptions, type ForwardedPlayer, _default$2 as FullscreenButton, _default$3 as HideMarker, type HudContext, _default$4 as LoopButton, type Matcher, type MediaErrorLike, _default$5 as MuteButton, _default$6 as PipButton, type PlatformConfig, _default$7 as PlayButton, type PlaybackAdapter, _default$8 as PlaybackRateButton, type PlayerContext, type PlayerMethodKey, type PlayerStateKey, type PlaylistContext, _default$9 as QualityButton, type QualityLevelInfo, type ResolvedSource, _default$10 as Scrubber, type SourceResolver, _default$11 as TimeDisplay, _default$12 as Transcript, type UseForwardedPlayerReturn, _default$13 as VideoCard, _default$14 as VideoPlaceholder, _default$15 as VideoPlayer, VideoPlayerPlugin, VideoPlayerPlugin as default, _default$16 as VideoStage, _default$17 as VolumeSlider };
|