@lazycatcloud/lzc-video-player 0.0.87 → 0.0.89
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 +18 -5
- package/dist/{browser-ponyfill.77fe21a3.js → browser-ponyfill.4ec1d3bb.js} +1 -1
- package/dist/lzc-video-player.ae1d5d50.js +72045 -0
- package/dist/lzc-video-player.js +2 -2
- package/dist/src/components/PlayList/index.vue.d.ts +1 -1
- package/dist/src/components/Video/NativeVideoPlayer.vue.d.ts +78 -0
- package/dist/src/components/Video/components/LzcModal/list.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcModal/playrate.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcModal/resolution.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcModal/subtitle.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcOverlay/cast.vue.d.ts +9 -2
- package/dist/src/components/Video/components/LzcOverlay/casting.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcOverlay/error.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcOverlay/index.vue.d.ts +7 -3
- package/dist/src/components/Video/components/LzcOverlay/playing.vue.d.ts +7 -1
- package/dist/src/components/Video/components/LzcOverlay/playingButtons.vue.d.ts +1 -1
- package/dist/src/components/Video/components/LzcOverlay/playingLayout.vue.d.ts +7 -1
- package/dist/src/components/Video/components/LzcOverlay/useCast.d.ts +1 -1
- package/dist/src/components/Video/components/LzcOverlay/useCommon.d.ts +1 -1
- package/dist/src/components/Video/native/EventEmitter.d.ts +22 -0
- package/dist/src/components/Video/native/NativeControls.vue.d.ts +90 -0
- package/dist/src/components/Video/native/NativeModal.vue.d.ts +38 -0
- package/dist/src/components/Video/native/NativePlayer.d.ts +176 -0
- package/dist/src/components/Video/native/NativePlayer.vue.d.ts +27 -0
- package/dist/src/components/Video/native/index.d.ts +3 -0
- package/dist/src/components/Video/native/playerKey.d.ts +3 -0
- package/dist/src/components/Video/native/useNativeCastMiddleware.d.ts +2 -0
- package/dist/src/components/Video/native/useNativePlayer.d.ts +2 -0
- package/dist/src/components/Video/native/useNativePlayerFullscreen.d.ts +10 -0
- package/dist/src/components/Video/native/useNativePlayerHistory.d.ts +9 -0
- package/dist/src/components/Video/native/useNativePlayerModal.d.ts +17 -0
- package/dist/src/components/Video/native/useNativePlayerPlaylist.d.ts +9 -0
- package/dist/src/components/Video/native/useNativePlayerState.d.ts +15 -0
- package/dist/src/components/Video/player.d.ts +94 -0
- package/dist/src/components/Video/useSource.d.ts +1 -1
- package/dist/src/components/Video/useWebview.d.ts +2 -2
- package/dist/src/components/Video/videoFrame.d.ts +1 -1
- package/dist/src/lzc-video-player.d.ts +3 -2
- package/dist/src/model.d.ts +3 -0
- package/dist/src/stores/playlist.d.ts +75 -0
- package/package.json +1 -1
- package/dist/lzc-video-player.56b6c6f6.js +0 -92046
- package/dist/src/components/Video/components/LzcCurrentTimeDisplay.d.ts +0 -7
- package/dist/src/components/Video/components/LzcFullscreenToggle.d.ts +0 -10
- package/dist/src/components/Video/components/LzcLoadingSpinner.d.ts +0 -7
- package/dist/src/components/Video/components/LzcModal/index.vue.d.ts +0 -22
- package/dist/src/components/Video/components/LzcModal.d.ts +0 -9
- package/dist/src/components/Video/components/LzcOverlay/castMiddleware.d.ts +0 -1
- package/dist/src/components/Video/components/LzcOverlay/castPlugin.d.ts +0 -11
- package/dist/src/components/Video/components/LzcOverlay.d.ts +0 -7
- package/dist/src/components/Video/components/LzcPlayRate.d.ts +0 -8
- package/dist/src/components/Video/components/LzcPlayToggle.d.ts +0 -7
- package/dist/src/components/Video/components/LzcPlaylistButton.d.ts +0 -9
- package/dist/src/components/Video/components/LzcPlaylistNext.d.ts +0 -10
- package/dist/src/components/Video/components/LzcPlaylistPrev.d.ts +0 -10
- package/dist/src/components/Video/components/LzcProgress.d.ts +0 -11
- package/dist/src/components/Video/components/LzcRemainingTimeDisplay.d.ts +0 -9
- package/dist/src/components/Video/components/LzcResolutionButton.d.ts +0 -9
- package/dist/src/components/Video/components/LzcSeekBar.d.ts +0 -10
- package/dist/src/components/Video/components/LzcSubtitleButton.d.ts +0 -10
- package/dist/src/components/Video/hlsjs.d.ts +0 -1
- package/dist/src/components/Video/index.vue.d.ts +0 -61
- package/dist/src/components/Video/useWebviewMiddleware.d.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import type { NativePlayerAPI } from "./NativePlayer";
|
|
3
|
+
import type { useHistoryInfo } from '../../../stores/playlist';
|
|
4
|
+
export declare function useNativePlayerPlaylist(player: Ref<NativePlayerAPI | null>, store: ReturnType<typeof useHistoryInfo>, options: {
|
|
5
|
+
playPrev?: () => void;
|
|
6
|
+
playNext?: () => void;
|
|
7
|
+
}): {
|
|
8
|
+
bind: (p: NativePlayerAPI) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
import type { NativePlayerAPI } from "./NativePlayer";
|
|
3
|
+
export declare function useNativePlayerState(player: Ref<NativePlayerAPI | null>): {
|
|
4
|
+
showBigPlay: Ref<boolean, boolean>;
|
|
5
|
+
showSpinner: Ref<boolean, boolean>;
|
|
6
|
+
videoName: Ref<string, string>;
|
|
7
|
+
isPlaying: Ref<boolean, boolean>;
|
|
8
|
+
currentTime: Ref<number, number>;
|
|
9
|
+
duration: Ref<number, number>;
|
|
10
|
+
prevEnabled: Ref<boolean, boolean>;
|
|
11
|
+
nextEnabled: Ref<boolean, boolean>;
|
|
12
|
+
isFullscreen: Ref<boolean, boolean>;
|
|
13
|
+
bind: (p: NativePlayerAPI) => void;
|
|
14
|
+
unbindIfNeeded: () => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { PreviewInfo, Subtitle, VideoInfo, VideoQualityLevel, VideoResolution } from '../../model';
|
|
2
|
+
export declare type SourceObject = {
|
|
3
|
+
src: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface QualityLevelList {
|
|
7
|
+
levels_: VideoQualityLevel[];
|
|
8
|
+
selectedIndex_: number;
|
|
9
|
+
on: (event: string, fn: (e: any) => void) => void;
|
|
10
|
+
trigger: (e: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface LzcModalHandle {
|
|
13
|
+
openModal: (page: string) => void;
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface LzcPlayer {
|
|
17
|
+
options_: {
|
|
18
|
+
mediaPrefix: string;
|
|
19
|
+
showTopBar?: boolean;
|
|
20
|
+
};
|
|
21
|
+
qualityLevels(): QualityLevelList;
|
|
22
|
+
play(): Promise<void>;
|
|
23
|
+
pause(): void;
|
|
24
|
+
paused(): boolean;
|
|
25
|
+
currentTime(seconds?: number): number | void;
|
|
26
|
+
duration(seconds?: number): number | void;
|
|
27
|
+
volume(percent?: number): number | Promise<number> | void;
|
|
28
|
+
muted(muted?: boolean): boolean | void;
|
|
29
|
+
currentSrc(): string;
|
|
30
|
+
src(sources?: string | SourceObject | SourceObject[] | null): string | void;
|
|
31
|
+
poster(url?: string): string | void;
|
|
32
|
+
on(event: string, fn: (e?: any) => void): void;
|
|
33
|
+
one(event: string, fn: (e?: any) => void): void;
|
|
34
|
+
off(event: string, fn?: (e?: any) => void): void;
|
|
35
|
+
ready?(fn: () => void): void;
|
|
36
|
+
trigger(eventOrName: string | {
|
|
37
|
+
type: string;
|
|
38
|
+
[k: string]: unknown;
|
|
39
|
+
}, data?: unknown): void;
|
|
40
|
+
currentVideoInfo(): VideoInfo | null;
|
|
41
|
+
currentVideoName(): string | undefined;
|
|
42
|
+
currentPreview(): PreviewInfo | undefined;
|
|
43
|
+
supportResolution(): VideoQualityLevel[];
|
|
44
|
+
currentResolution(): VideoResolution | undefined;
|
|
45
|
+
changeResolution(level: VideoQualityLevel): void;
|
|
46
|
+
getAvaliableSubtitles(): Subtitle[] | undefined;
|
|
47
|
+
currentSubtitle(): Subtitle | undefined;
|
|
48
|
+
changeSubtitle(sub: Subtitle | number): void;
|
|
49
|
+
clearSubtitle(): void;
|
|
50
|
+
toggleSubtitleVisibility(): void;
|
|
51
|
+
isSubtitleHidden(): boolean;
|
|
52
|
+
setSubtitleHidden(value: boolean): void;
|
|
53
|
+
currentBrightness(): Promise<number>;
|
|
54
|
+
isCastMode(): boolean;
|
|
55
|
+
isNetdiskSource(): boolean;
|
|
56
|
+
reloadSource(index?: number): void;
|
|
57
|
+
playPrev?: () => void;
|
|
58
|
+
playNext?: () => void;
|
|
59
|
+
enablePrev(value: boolean): void;
|
|
60
|
+
enableNext(value: boolean): void;
|
|
61
|
+
readonly prevEnabled: boolean;
|
|
62
|
+
readonly nextEnabled: boolean;
|
|
63
|
+
setFullscreenTarget(el: HTMLElement | null): void;
|
|
64
|
+
requestFullscreen(): void;
|
|
65
|
+
exitFullscreen(): void;
|
|
66
|
+
isFullscreen(): boolean;
|
|
67
|
+
$video(): HTMLVideoElement;
|
|
68
|
+
playbackRate(rate?: number): number | void;
|
|
69
|
+
playbackRates(rates?: number[]): number[];
|
|
70
|
+
lzcModal?: () => LzcModalHandle;
|
|
71
|
+
id(): string;
|
|
72
|
+
isDisposed(): boolean;
|
|
73
|
+
dispose(): void;
|
|
74
|
+
networkState(): number;
|
|
75
|
+
currentSource(): {
|
|
76
|
+
src: string;
|
|
77
|
+
type?: string;
|
|
78
|
+
};
|
|
79
|
+
currentType(): string;
|
|
80
|
+
currentWidth(): number;
|
|
81
|
+
currentDimensions(): {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
};
|
|
85
|
+
addClass(name: string): void;
|
|
86
|
+
removeClass(name: string): void;
|
|
87
|
+
hasClass(name: string): boolean;
|
|
88
|
+
ended(): boolean;
|
|
89
|
+
seeking(): boolean;
|
|
90
|
+
scrubbing(): boolean;
|
|
91
|
+
setScrubbing(value: boolean): void;
|
|
92
|
+
bufferedEnd(): number;
|
|
93
|
+
error(): MediaError | null;
|
|
94
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const controller: {
|
|
2
2
|
IsApp(): boolean;
|
|
3
|
-
GetScreenBrightNess(): Promise<number>;
|
|
4
|
-
GetCurrentVolume(): Promise<number>;
|
|
3
|
+
GetScreenBrightNess(): number | Promise<number>;
|
|
4
|
+
GetCurrentVolume(): number | Promise<number>;
|
|
5
5
|
SetScreentBrightness(b: number): void;
|
|
6
6
|
SetVoice(v: number): void;
|
|
7
7
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { LzcPlayer } from "
|
|
1
|
+
import type { LzcPlayer } from "./player";
|
|
2
2
|
export declare const makeVideoFrame: (player: LzcPlayer) => Promise<Blob | null>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
export { LzcVideoPlayer };
|
|
3
|
+
import NativeVideoPlayer from './components/Video/NativeVideoPlayer.vue';
|
|
4
|
+
export { NativeVideoPlayer as LzcVideoPlayer };
|
|
5
|
+
export type { NativePlayer, NativePlayerAPI } from './components/Video/native';
|
|
5
6
|
export { init } from './i18n';
|
package/dist/src/model.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface VideoQualityLevel {
|
|
|
7
7
|
height: number;
|
|
8
8
|
width: number;
|
|
9
9
|
bitrate: number;
|
|
10
|
+
enabled?: boolean;
|
|
10
11
|
}
|
|
11
12
|
export interface VideoResolution {
|
|
12
13
|
id: string;
|
|
@@ -32,6 +33,8 @@ export interface Subtitle {
|
|
|
32
33
|
codec_name: string;
|
|
33
34
|
is_external: boolean;
|
|
34
35
|
path: string;
|
|
36
|
+
/** 来自 subtitle-info API,表示是否为默认字幕轨 */
|
|
37
|
+
default?: boolean;
|
|
35
38
|
}
|
|
36
39
|
export interface VideoInfo extends Doc {
|
|
37
40
|
sourceUrl: string;
|
|
@@ -4,6 +4,8 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
4
4
|
collection: RemoteDB<VideoInfo>;
|
|
5
5
|
infos: VideoInfo[];
|
|
6
6
|
ready: Promise<void>;
|
|
7
|
+
/** 从历史记录点击播放时传入的完整 info,供 Player 优先使用 */
|
|
8
|
+
pendingPlayInfo: VideoInfo | null;
|
|
7
9
|
}, {
|
|
8
10
|
getHistoryInfo(state: {
|
|
9
11
|
collection: {
|
|
@@ -39,6 +41,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
39
41
|
codec_name: string;
|
|
40
42
|
is_external: boolean;
|
|
41
43
|
path: string;
|
|
44
|
+
default?: boolean | undefined;
|
|
42
45
|
}[] | undefined;
|
|
43
46
|
beforeHiddenSubtitle?: {
|
|
44
47
|
name: string;
|
|
@@ -47,6 +50,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
47
50
|
codec_name: string;
|
|
48
51
|
is_external: boolean;
|
|
49
52
|
path: string;
|
|
53
|
+
default?: boolean | undefined;
|
|
50
54
|
} | undefined;
|
|
51
55
|
requestHistory?: boolean | undefined;
|
|
52
56
|
_id: string;
|
|
@@ -57,10 +61,42 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
57
61
|
finally: (onfinally?: (() => void) | null | undefined) => Promise<void>;
|
|
58
62
|
readonly [Symbol.toStringTag]: string;
|
|
59
63
|
};
|
|
64
|
+
pendingPlayInfo: {
|
|
65
|
+
sourceUrl: string;
|
|
66
|
+
name: string;
|
|
67
|
+
duration: number;
|
|
68
|
+
currentTime: number;
|
|
69
|
+
invalid: boolean;
|
|
70
|
+
updateTime: number | undefined;
|
|
71
|
+
fromNetdisk: boolean;
|
|
72
|
+
path: string | undefined;
|
|
73
|
+
subtitles: {
|
|
74
|
+
name: string;
|
|
75
|
+
language: string;
|
|
76
|
+
stream_index: number;
|
|
77
|
+
codec_name: string;
|
|
78
|
+
is_external: boolean;
|
|
79
|
+
path: string;
|
|
80
|
+
default?: boolean | undefined;
|
|
81
|
+
}[] | undefined;
|
|
82
|
+
beforeHiddenSubtitle?: {
|
|
83
|
+
name: string;
|
|
84
|
+
language: string;
|
|
85
|
+
stream_index: number;
|
|
86
|
+
codec_name: string;
|
|
87
|
+
is_external: boolean;
|
|
88
|
+
path: string;
|
|
89
|
+
default?: boolean | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
requestHistory?: boolean | undefined;
|
|
92
|
+
_id: string;
|
|
93
|
+
} | null;
|
|
60
94
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
61
95
|
collection: RemoteDB<VideoInfo>;
|
|
62
96
|
infos: VideoInfo[];
|
|
63
97
|
ready: Promise<void>;
|
|
98
|
+
/** 从历史记录点击播放时传入的完整 info,供 Player 优先使用 */
|
|
99
|
+
pendingPlayInfo: VideoInfo | null;
|
|
64
100
|
}>): (sourceUrl: string) => {
|
|
65
101
|
sourceUrl: string;
|
|
66
102
|
name: string;
|
|
@@ -77,6 +113,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
77
113
|
codec_name: string;
|
|
78
114
|
is_external: boolean;
|
|
79
115
|
path: string;
|
|
116
|
+
default?: boolean | undefined;
|
|
80
117
|
}[] | undefined;
|
|
81
118
|
beforeHiddenSubtitle?: {
|
|
82
119
|
name: string;
|
|
@@ -85,6 +122,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
85
122
|
codec_name: string;
|
|
86
123
|
is_external: boolean;
|
|
87
124
|
path: string;
|
|
125
|
+
default?: boolean | undefined;
|
|
88
126
|
} | undefined;
|
|
89
127
|
requestHistory?: boolean | undefined;
|
|
90
128
|
_id: string;
|
|
@@ -123,6 +161,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
123
161
|
codec_name: string;
|
|
124
162
|
is_external: boolean;
|
|
125
163
|
path: string;
|
|
164
|
+
default?: boolean | undefined;
|
|
126
165
|
}[] | undefined;
|
|
127
166
|
beforeHiddenSubtitle?: {
|
|
128
167
|
name: string;
|
|
@@ -131,6 +170,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
131
170
|
codec_name: string;
|
|
132
171
|
is_external: boolean;
|
|
133
172
|
path: string;
|
|
173
|
+
default?: boolean | undefined;
|
|
134
174
|
} | undefined;
|
|
135
175
|
requestHistory?: boolean | undefined;
|
|
136
176
|
_id: string;
|
|
@@ -141,10 +181,42 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
141
181
|
finally: (onfinally?: (() => void) | null | undefined) => Promise<void>;
|
|
142
182
|
readonly [Symbol.toStringTag]: string;
|
|
143
183
|
};
|
|
184
|
+
pendingPlayInfo: {
|
|
185
|
+
sourceUrl: string;
|
|
186
|
+
name: string;
|
|
187
|
+
duration: number;
|
|
188
|
+
currentTime: number;
|
|
189
|
+
invalid: boolean;
|
|
190
|
+
updateTime: number | undefined;
|
|
191
|
+
fromNetdisk: boolean;
|
|
192
|
+
path: string | undefined;
|
|
193
|
+
subtitles: {
|
|
194
|
+
name: string;
|
|
195
|
+
language: string;
|
|
196
|
+
stream_index: number;
|
|
197
|
+
codec_name: string;
|
|
198
|
+
is_external: boolean;
|
|
199
|
+
path: string;
|
|
200
|
+
default?: boolean | undefined;
|
|
201
|
+
}[] | undefined;
|
|
202
|
+
beforeHiddenSubtitle?: {
|
|
203
|
+
name: string;
|
|
204
|
+
language: string;
|
|
205
|
+
stream_index: number;
|
|
206
|
+
codec_name: string;
|
|
207
|
+
is_external: boolean;
|
|
208
|
+
path: string;
|
|
209
|
+
default?: boolean | undefined;
|
|
210
|
+
} | undefined;
|
|
211
|
+
requestHistory?: boolean | undefined;
|
|
212
|
+
_id: string;
|
|
213
|
+
} | null;
|
|
144
214
|
} & import("pinia").PiniaCustomStateProperties<{
|
|
145
215
|
collection: RemoteDB<VideoInfo>;
|
|
146
216
|
infos: VideoInfo[];
|
|
147
217
|
ready: Promise<void>;
|
|
218
|
+
/** 从历史记录点击播放时传入的完整 info,供 Player 优先使用 */
|
|
219
|
+
pendingPlayInfo: VideoInfo | null;
|
|
148
220
|
}>): (path: string) => {
|
|
149
221
|
sourceUrl: string;
|
|
150
222
|
name: string;
|
|
@@ -161,6 +233,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
161
233
|
codec_name: string;
|
|
162
234
|
is_external: boolean;
|
|
163
235
|
path: string;
|
|
236
|
+
default?: boolean | undefined;
|
|
164
237
|
}[] | undefined;
|
|
165
238
|
beforeHiddenSubtitle?: {
|
|
166
239
|
name: string;
|
|
@@ -169,6 +242,7 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
169
242
|
codec_name: string;
|
|
170
243
|
is_external: boolean;
|
|
171
244
|
path: string;
|
|
245
|
+
default?: boolean | undefined;
|
|
172
246
|
} | undefined;
|
|
173
247
|
requestHistory?: boolean | undefined;
|
|
174
248
|
_id: string;
|
|
@@ -180,5 +254,6 @@ export declare const useHistoryInfo: () => import("pinia").Store<"historyInfo",
|
|
|
180
254
|
batchDeleteHistory(ids: string[]): Promise<void>;
|
|
181
255
|
updateOrCreateHistory(info: VideoInfo, blobFn: (() => Promise<Blob | null>) | null): Promise<void>;
|
|
182
256
|
markAsInvalid(sourceUrl: string): Promise<void>;
|
|
257
|
+
setPendingPlayInfo(info: VideoInfo | null): void;
|
|
183
258
|
clear(): Promise<void>;
|
|
184
259
|
}>;
|