@munsonlabs/video-player 0.2.4 → 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 +27 -13
- 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 +23 -31
- package/dist/elements/core.mjs +1 -1
- package/dist/elements/index.d.mts +133 -69
- package/dist/elements/index.mjs +1 -1
- package/dist/index.d.mts +203 -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;
|
|
@@ -163,14 +276,13 @@ export interface PlayerProps {
|
|
|
163
276
|
}
|
|
164
277
|
export type PinCorner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
165
278
|
export type PreloadMode = 'none' | 'metadata' | 'auto';
|
|
166
|
-
export interface VideoStateDetail {
|
|
167
|
-
currentSrc: string | null;
|
|
168
|
-
isPlaying: boolean;
|
|
169
|
-
}
|
|
170
279
|
export interface VideoToggleDetail {
|
|
171
280
|
src: string;
|
|
172
281
|
}
|
|
173
|
-
export
|
|
282
|
+
export interface VideoEntry extends PlayerProps {
|
|
283
|
+
lazy?: boolean;
|
|
284
|
+
autoStage?: boolean;
|
|
285
|
+
}
|
|
174
286
|
export interface VideoSelectDetail extends VideoEntry {
|
|
175
287
|
fromGesture?: boolean;
|
|
176
288
|
}
|
|
@@ -179,156 +291,15 @@ export interface TranscriptCue {
|
|
|
179
291
|
end?: number;
|
|
180
292
|
text: string;
|
|
181
293
|
}
|
|
182
|
-
export
|
|
183
|
-
isPlaying: boolean;
|
|
184
|
-
togglePlay(): void;
|
|
185
|
-
hasEnded: boolean;
|
|
186
|
-
isError: boolean;
|
|
187
|
-
retry(): void;
|
|
188
|
-
isMuted: boolean;
|
|
189
|
-
toggleMute(): void;
|
|
190
|
-
isAudible: boolean;
|
|
191
|
-
isFullscreen: boolean;
|
|
192
|
-
toggleFullscreen(): void;
|
|
193
|
-
current: number;
|
|
194
|
-
total: number;
|
|
195
|
-
seek(percent: number): void;
|
|
196
|
-
bufferedDisplay: number;
|
|
197
|
-
isBuffering: boolean;
|
|
198
|
-
isLive: boolean;
|
|
199
|
-
vol: number;
|
|
200
|
-
setVolume(vol: number): void;
|
|
201
|
-
isLooping: boolean;
|
|
202
|
-
toggleLoop(): void;
|
|
203
|
-
supportsPip: boolean;
|
|
204
|
-
isPipActive: boolean;
|
|
205
|
-
togglePip(): void;
|
|
206
|
-
supportsCaptions: boolean;
|
|
207
|
-
captionTracks: CaptionTrackInfo[];
|
|
208
|
-
activeCaptionIndex: number | null;
|
|
209
|
-
setCaptionTrack(index: number | null): void;
|
|
210
|
-
supportsQuality: boolean;
|
|
211
|
-
qualityLevels: QualityLevelInfo[];
|
|
212
|
-
currentQualityIndex: number | null;
|
|
213
|
-
isAutoQuality: boolean;
|
|
214
|
-
setQuality(index: number | null): void;
|
|
215
|
-
supportsPlaybackRate: boolean;
|
|
216
|
-
currentPlaybackRate: number;
|
|
217
|
-
setPlaybackRate(rate: number): void;
|
|
218
|
-
}
|
|
219
|
-
//#endregion
|
|
220
|
-
//#region src/composables/player/usePlayer.d.ts
|
|
221
|
-
interface UsePlayerReturn {
|
|
222
|
-
isPlaying: Ref<boolean>;
|
|
223
|
-
hasEnded: Ref<boolean>;
|
|
224
|
-
isReady: Ref<boolean>;
|
|
225
|
-
isLive: Ref<boolean>;
|
|
226
|
-
isBuffering: Ref<boolean>;
|
|
227
|
-
current: Ref<number>;
|
|
228
|
-
total: Ref<number>;
|
|
229
|
-
progress: ComputedRef<number>;
|
|
230
|
-
bufferedDisplay: ComputedRef<number>;
|
|
231
|
-
hasStarted: Ref<boolean>;
|
|
232
|
-
isError: Ref<boolean>;
|
|
233
|
-
errorMessage: Ref<string>;
|
|
234
|
-
fmt: (s: number) => string;
|
|
235
|
-
fire: (type: StateChangeType, extras?: Partial<StateChangeEvent>) => void;
|
|
236
|
-
retry: () => void;
|
|
237
|
-
togglePlay: () => void;
|
|
238
|
-
seek: (val: number) => void;
|
|
239
|
-
isAdPlaying: Ref<boolean>;
|
|
240
|
-
isAdPaused: Ref<boolean>;
|
|
241
|
-
isAdMuted: Ref<boolean>;
|
|
242
|
-
adRemainingTime: Ref<number>;
|
|
243
|
-
toggleAdMute: () => void;
|
|
244
|
-
vol: Ref<number>;
|
|
245
|
-
isMuted: Ref<boolean>;
|
|
246
|
-
isAudible: ComputedRef<boolean>;
|
|
247
|
-
toggleMute: () => void;
|
|
248
|
-
setVolume: (val: number) => void;
|
|
249
|
-
isLooping: Ref<boolean>;
|
|
250
|
-
toggleLoop: () => void;
|
|
251
|
-
currentPlaybackRate: Ref<number>;
|
|
252
|
-
setPlaybackRate: (rate: number) => void;
|
|
253
|
-
supportsPlaybackRate: Ref<boolean>;
|
|
254
|
-
isFullscreen: Ref<boolean>;
|
|
255
|
-
isFullscreenPending: Ref<boolean>;
|
|
256
|
-
toggleFullscreen: () => void;
|
|
257
|
-
markFullscreenPending: () => void;
|
|
258
|
-
supportsCaptions: Ref<boolean>;
|
|
259
|
-
captionTracks: Ref<CaptionTrackInfo[]>;
|
|
260
|
-
activeCaptionIndex: Ref<number | null>;
|
|
261
|
-
setCaptionTrack: (index: number | null) => void;
|
|
262
|
-
supportsQuality: Ref<boolean>;
|
|
263
|
-
qualityLevels: Ref<QualityLevelInfo[]>;
|
|
264
|
-
currentQualityIndex: Ref<number | null>;
|
|
265
|
-
isAutoQuality: Ref<boolean>;
|
|
266
|
-
setQuality: (index: number | null) => void;
|
|
267
|
-
supportsPip: Ref<boolean>;
|
|
268
|
-
isPipActive: Ref<boolean>;
|
|
269
|
-
togglePip: () => void;
|
|
270
|
-
isNativeUi: Ref<boolean>;
|
|
271
|
-
}
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region src/composables/overlay/useHud.d.ts
|
|
274
|
-
interface UseHudReturn {
|
|
275
|
-
showHUD: Ref<boolean>;
|
|
276
|
-
isOpen: Ref<boolean>;
|
|
277
|
-
scheduleHide: (delay?: number) => void;
|
|
278
|
-
pauseHide: () => void;
|
|
279
|
-
onVideoTap: () => void;
|
|
280
|
-
onMouseMove: () => void;
|
|
281
|
-
onMouseLeave: () => void;
|
|
282
|
-
openControls: () => void;
|
|
283
|
-
closeControls: (immediate?: boolean) => void;
|
|
284
|
-
keepOpen: () => void;
|
|
285
|
-
suppressMouseLeave: (ms?: number) => void;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region src/composables/player/playerContext.d.ts
|
|
289
|
-
type PlayerContext = UnwrapNestedRefs<UsePlayerReturn>;
|
|
290
|
-
type HudContext = UnwrapNestedRefs<UseHudReturn>;
|
|
291
|
-
interface PlaylistContext {
|
|
292
|
-
hasPlaylist: boolean;
|
|
293
|
-
hasNext: boolean;
|
|
294
|
-
hasPrevious: boolean;
|
|
295
|
-
autoAdvance: boolean;
|
|
296
|
-
playNext: () => void;
|
|
297
|
-
playPrevious: () => void;
|
|
298
|
-
toggleAutoAdvance: () => void;
|
|
299
|
-
}
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region src/composables/useForwardedPlayer.d.ts
|
|
302
|
-
declare const METHOD_KEYS: readonly ["retry", "togglePlay", "seek", "toggleMute", "setVolume", "toggleFullscreen", "markFullscreenPending", "toggleLoop", "toggleAdMute", "setPlaybackRate", "setCaptionTrack", "setQuality", "togglePip"];
|
|
303
|
-
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"];
|
|
304
|
-
type MethodKey = (typeof METHOD_KEYS)[number];
|
|
305
|
-
type StateKey = (typeof STATE_KEYS)[number];
|
|
306
|
-
type ForwardedPlayer = { [K in MethodKey]: (...args: Parameters<PlayerContext[K]>) => Promise<void>; } & { [K in StateKey]: ComputedRef<PlayerContext[K]>; };
|
|
307
|
-
interface UseForwardedPlayerReturn {
|
|
308
|
-
playerRef: Ref<PlayerContext | null>;
|
|
309
|
-
forwarded: ForwardedPlayer;
|
|
310
|
-
}
|
|
311
|
-
export declare function useForwardedPlayer(guard?: (key: MethodKey) => boolean | Promise<boolean>): UseForwardedPlayerReturn;
|
|
294
|
+
export type PlayerHandle = Pick<UnwrapNestedRefs<UsePlayerReturn>, PlayerMethodKey | PlayerStateKey>;
|
|
312
295
|
//#endregion
|
|
313
296
|
//#region src/components/VideoPlayer.vue.d.ts
|
|
314
|
-
|
|
315
|
-
hasPlaylist?: boolean;
|
|
316
|
-
hasNext?: boolean;
|
|
317
|
-
hasPrevious?: boolean;
|
|
318
|
-
autoAdvance?: boolean;
|
|
319
|
-
};
|
|
320
|
-
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, {
|
|
321
298
|
"state-change": (event: StateChangeEvent) => any;
|
|
322
|
-
|
|
323
|
-
"play-previous": () => any;
|
|
324
|
-
"toggle-auto-advance": () => any;
|
|
325
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props$2> & Readonly<{
|
|
299
|
+
}, string, import("vue").PublicProps, Readonly<PlayerProps> & Readonly<{
|
|
326
300
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
327
|
-
"onPlay-next"?: (() => any) | undefined;
|
|
328
|
-
"onPlay-previous"?: (() => any) | undefined;
|
|
329
|
-
"onToggle-auto-advance"?: (() => any) | undefined;
|
|
330
301
|
}>, {
|
|
331
|
-
|
|
302
|
+
label: string;
|
|
332
303
|
poster: string;
|
|
333
304
|
aspectRatio: string;
|
|
334
305
|
adTagUrl: string;
|
|
@@ -336,8 +307,6 @@ declare const __VLS_export$17: import("vue").DefineComponent<__VLS_Props$2, Forw
|
|
|
336
307
|
autoplay: boolean;
|
|
337
308
|
muted: boolean;
|
|
338
309
|
nativeUi: boolean;
|
|
339
|
-
autoStage: boolean;
|
|
340
|
-
lazy: boolean;
|
|
341
310
|
payload: Record<string, unknown> | string;
|
|
342
311
|
action: PlayerAction | null;
|
|
343
312
|
disableTapCapture: boolean;
|
|
@@ -346,68 +315,76 @@ declare const __VLS_export$17: import("vue").DefineComponent<__VLS_Props$2, Forw
|
|
|
346
315
|
playInView: boolean;
|
|
347
316
|
loop: boolean;
|
|
348
317
|
preload: PreloadMode;
|
|
349
|
-
hasPlaylist: boolean;
|
|
350
|
-
hasNext: boolean;
|
|
351
|
-
hasPrevious: boolean;
|
|
352
|
-
autoAdvance: boolean;
|
|
353
318
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
354
319
|
declare const _default$15: typeof __VLS_export$17;
|
|
355
320
|
//#endregion
|
|
356
321
|
//#region src/components/VideoStage.vue.d.ts
|
|
357
322
|
type __VLS_Props$1 = {
|
|
358
|
-
pin?:
|
|
323
|
+
pin?: PinCorner | 'full-width';
|
|
359
324
|
playlist?: VideoEntry[];
|
|
360
325
|
};
|
|
361
326
|
declare function playNext(fromGesture?: boolean): void;
|
|
362
327
|
declare function playPrevious(fromGesture?: boolean): void;
|
|
363
328
|
declare const __VLS_export$16: import("vue").DefineComponent<__VLS_Props$1, {
|
|
364
|
-
|
|
329
|
+
play: () => Promise<void>;
|
|
330
|
+
pause: () => Promise<void>;
|
|
331
|
+
replay: () => Promise<void>;
|
|
365
332
|
togglePlay: () => Promise<void>;
|
|
366
|
-
seek: (
|
|
333
|
+
seek: (percent: number) => Promise<void>;
|
|
334
|
+
seekTo: (seconds: number) => Promise<void>;
|
|
367
335
|
toggleMute: () => Promise<void>;
|
|
368
|
-
setVolume: (
|
|
369
|
-
toggleFullscreen: () => Promise<void>;
|
|
370
|
-
markFullscreenPending: () => Promise<void>;
|
|
336
|
+
setVolume: (vol: number) => Promise<void>;
|
|
371
337
|
toggleLoop: () => Promise<void>;
|
|
372
|
-
toggleAdMute: () => Promise<void>;
|
|
373
338
|
setPlaybackRate: (rate: number) => Promise<void>;
|
|
374
339
|
setCaptionTrack: (index: number | null) => Promise<void>;
|
|
375
340
|
setQuality: (index: number | null) => Promise<void>;
|
|
376
341
|
togglePip: () => Promise<void>;
|
|
342
|
+
retry: () => Promise<void>;
|
|
343
|
+
toggleAdMute: () => Promise<void>;
|
|
344
|
+
toggleFullscreen: () => Promise<void>;
|
|
377
345
|
isPlaying: import("vue").ComputedRef<boolean>;
|
|
378
346
|
hasEnded: import("vue").ComputedRef<boolean>;
|
|
379
347
|
isReady: import("vue").ComputedRef<boolean>;
|
|
380
|
-
|
|
381
|
-
isAdPaused: import("vue").ComputedRef<boolean>;
|
|
382
|
-
isAdMuted: import("vue").ComputedRef<boolean>;
|
|
383
|
-
adRemainingTime: import("vue").ComputedRef<number>;
|
|
348
|
+
isLoaded: import("vue").ComputedRef<boolean>;
|
|
384
349
|
isLive: import("vue").ComputedRef<boolean>;
|
|
385
|
-
|
|
350
|
+
hasStarted: import("vue").ComputedRef<boolean>;
|
|
351
|
+
isError: import("vue").ComputedRef<boolean>;
|
|
352
|
+
errorMessage: import("vue").ComputedRef<string>;
|
|
386
353
|
current: import("vue").ComputedRef<number>;
|
|
387
354
|
total: import("vue").ComputedRef<number>;
|
|
355
|
+
progress: import("vue").ComputedRef<number>;
|
|
356
|
+
bufferedDisplay: import("vue").ComputedRef<number>;
|
|
388
357
|
vol: import("vue").ComputedRef<number>;
|
|
389
358
|
isMuted: import("vue").ComputedRef<boolean>;
|
|
390
359
|
isAudible: import("vue").ComputedRef<boolean>;
|
|
391
360
|
isLooping: import("vue").ComputedRef<boolean>;
|
|
392
361
|
currentPlaybackRate: import("vue").ComputedRef<number>;
|
|
393
|
-
hasStarted: import("vue").ComputedRef<boolean>;
|
|
394
|
-
isError: import("vue").ComputedRef<boolean>;
|
|
395
|
-
errorMessage: import("vue").ComputedRef<string>;
|
|
396
|
-
progress: import("vue").ComputedRef<number>;
|
|
397
|
-
bufferedDisplay: import("vue").ComputedRef<number>;
|
|
398
|
-
isFullscreen: import("vue").ComputedRef<boolean>;
|
|
399
|
-
isFullscreenPending: import("vue").ComputedRef<boolean>;
|
|
400
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>;
|
|
401
367
|
supportsCaptions: import("vue").ComputedRef<boolean>;
|
|
402
|
-
captionTracks: import("vue").ComputedRef<
|
|
368
|
+
captionTracks: import("vue").ComputedRef<{
|
|
369
|
+
index: number;
|
|
370
|
+
label: string;
|
|
371
|
+
language: string;
|
|
372
|
+
}[]>;
|
|
403
373
|
activeCaptionIndex: import("vue").ComputedRef<number | null>;
|
|
404
374
|
supportsQuality: import("vue").ComputedRef<boolean>;
|
|
405
|
-
qualityLevels: import("vue").ComputedRef<
|
|
375
|
+
qualityLevels: import("vue").ComputedRef<{
|
|
376
|
+
index: number;
|
|
377
|
+
height: number;
|
|
378
|
+
bitrate: number;
|
|
379
|
+
label: string;
|
|
380
|
+
}[]>;
|
|
406
381
|
currentQualityIndex: import("vue").ComputedRef<number | null>;
|
|
407
382
|
isAutoQuality: import("vue").ComputedRef<boolean>;
|
|
408
383
|
supportsPip: import("vue").ComputedRef<boolean>;
|
|
409
384
|
isPipActive: import("vue").ComputedRef<boolean>;
|
|
410
385
|
isNativeUi: import("vue").ComputedRef<boolean>;
|
|
386
|
+
isBuffering: import("vue").ComputedRef<boolean>;
|
|
387
|
+
isFullscreen: import("vue").ComputedRef<boolean>;
|
|
411
388
|
playNext: typeof playNext;
|
|
412
389
|
playPrevious: typeof playPrevious;
|
|
413
390
|
hasNext: import("vue").ComputedRef<boolean>;
|
|
@@ -417,39 +394,47 @@ declare const __VLS_export$16: import("vue").DefineComponent<__VLS_Props$1, {
|
|
|
417
394
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props$1> & Readonly<{
|
|
418
395
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
419
396
|
}>, {
|
|
420
|
-
pin:
|
|
397
|
+
pin: PinCorner | "full-width";
|
|
421
398
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
422
399
|
declare const _default$16: typeof __VLS_export$16;
|
|
423
400
|
//#endregion
|
|
424
401
|
//#region src/components/VideoPlaceholder.vue.d.ts
|
|
425
|
-
declare const __VLS_export$15: import("vue").DefineComponent<
|
|
402
|
+
declare const __VLS_export$15: import("vue").DefineComponent<VideoEntry, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
426
403
|
"enter-view": () => any;
|
|
427
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
404
|
+
}, string, import("vue").PublicProps, Readonly<VideoEntry> & Readonly<{
|
|
428
405
|
"onEnter-view"?: (() => any) | undefined;
|
|
429
406
|
}>, {
|
|
430
|
-
|
|
407
|
+
label: string;
|
|
431
408
|
poster: string;
|
|
432
409
|
aspectRatio: string;
|
|
433
410
|
adTagUrl: string;
|
|
434
411
|
autoplay: boolean;
|
|
435
412
|
muted: boolean;
|
|
436
413
|
nativeUi: boolean;
|
|
437
|
-
autoStage: boolean;
|
|
438
414
|
payload: Record<string, unknown> | string;
|
|
439
415
|
action: PlayerAction | null;
|
|
416
|
+
autoStage: boolean;
|
|
440
417
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
441
418
|
declare const _default$14: typeof __VLS_export$15;
|
|
442
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
|
|
443
428
|
//#region src/components/VideoCard.vue.d.ts
|
|
444
|
-
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, {
|
|
445
430
|
"state-change": (event: StateChangeEvent) => any;
|
|
446
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
431
|
+
}, string, import("vue").PublicProps, Readonly<VideoEntry> & Readonly<{
|
|
447
432
|
"onState-change"?: ((event: StateChangeEvent) => any) | undefined;
|
|
448
433
|
}>, {
|
|
449
434
|
muted: boolean;
|
|
450
|
-
lazy: boolean;
|
|
451
435
|
action: PlayerAction | null;
|
|
452
436
|
controls: boolean;
|
|
437
|
+
lazy: boolean;
|
|
453
438
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
454
439
|
declare const _default$13: typeof __VLS_export$14;
|
|
455
440
|
//#endregion
|
|
@@ -581,7 +566,11 @@ type __VLS_WithSlots$6<T, S> = T & {
|
|
|
581
566
|
//#region src/components/controls/CaptionsButton.vue.d.ts
|
|
582
567
|
declare var __VLS_1$4: {
|
|
583
568
|
currentLabel: string;
|
|
584
|
-
tracks:
|
|
569
|
+
tracks: {
|
|
570
|
+
index: number;
|
|
571
|
+
label: string;
|
|
572
|
+
language: string;
|
|
573
|
+
}[];
|
|
585
574
|
activeIndex: number | null;
|
|
586
575
|
};
|
|
587
576
|
type __VLS_Slots$5 = {} & {
|
|
@@ -599,7 +588,12 @@ type __VLS_WithSlots$5<T, S> = T & {
|
|
|
599
588
|
//#region src/components/controls/QualityButton.vue.d.ts
|
|
600
589
|
declare var __VLS_1$3: {
|
|
601
590
|
currentLabel: string;
|
|
602
|
-
levels:
|
|
591
|
+
levels: {
|
|
592
|
+
index: number;
|
|
593
|
+
height: number;
|
|
594
|
+
bitrate: number;
|
|
595
|
+
label: string;
|
|
596
|
+
}[];
|
|
603
597
|
currentIndex: number | null;
|
|
604
598
|
isAuto: boolean;
|
|
605
599
|
};
|
|
@@ -694,10 +688,10 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
694
688
|
};
|
|
695
689
|
//#endregion
|
|
696
690
|
//#region src/adapters/index.d.ts
|
|
697
|
-
export declare function
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
691
|
+
export declare function resolvePlatform(url: string): {
|
|
692
|
+
key: string;
|
|
693
|
+
embed: boolean;
|
|
694
|
+
};
|
|
701
695
|
export declare function registerPlatform(config: PlatformConfig): void;
|
|
702
696
|
//#endregion
|
|
703
697
|
//#region src/composables/controls/useScrubber.d.ts
|
|
@@ -738,4 +732,4 @@ export declare function exposePlayerOnElement(el: Element, player: object | null
|
|
|
738
732
|
//#region src/index.d.ts
|
|
739
733
|
declare const VideoPlayerPlugin: Plugin;
|
|
740
734
|
//#endregion
|
|
741
|
-
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 };
|