@byteplus/veplayer 1.15.3-rc.31 → 1.15.3-rc.33
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/index.min.js +2 -2
- package/lite.cjs +2 -2
- package/lite.d.ts +262 -0
- package/lite.esm.mjs +2 -2
- package/lite.min.js +2 -2
- package/package.json +1 -1
- package/plugin/modules/DashAbralgo.mjs +1 -1
- package/plugin/modules/XGVideo.mjs +1 -1
- package/plugin/modules/danmuMask.mjs +1 -1
- package/plugin/modules/danmujs.mjs +1 -1
- package/plugin/modules/dash.mjs +1 -1
- package/plugin/modules/flv.mjs +1 -1
- package/plugin/modules/hls.mjs +1 -1
- package/plugin/modules/hlsEncrypt.mjs +1 -1
- package/plugin/modules/mp4Encrypt.mjs +1 -1
- package/plugin/modules/preloader.mjs +1 -1
- package/plugin/modules/streamprobe.mjs +1 -1
- package/plugin/modules/vestrategy.mjs +1 -1
- package/plugin/modules/vestrategy_adapt_range.mjs +1 -1
- package/plugin/modules/vestrategy_h265.mjs +1 -1
- package/plugin/modules/vestrategy_preload.mjs +1 -1
package/lite.d.ts
CHANGED
|
@@ -1,5 +1,83 @@
|
|
|
1
1
|
import { I18N } from 'xgplayer';
|
|
2
2
|
|
|
3
|
+
/** UMD modules that can be loaded or explicitly pre-registered. */
|
|
4
|
+
export declare enum UmdKeys {
|
|
5
|
+
HLS = "hls",
|
|
6
|
+
FLV = "flv",
|
|
7
|
+
XGVideo = "XGVideo",
|
|
8
|
+
HLSEncrypt = "hlsEncrypt",
|
|
9
|
+
DASH = "dash",
|
|
10
|
+
MP4Encrypt = "mp4Encrypt",
|
|
11
|
+
DanmuJS = "danmujs",
|
|
12
|
+
DanmuMask = "danmuMask",
|
|
13
|
+
StreamProbe = "streamprobe",
|
|
14
|
+
VeStrategy = "vestrategy",
|
|
15
|
+
VeStrategyH265 = "vestrategy_h265",
|
|
16
|
+
VeStrategyPreload = "vestrategy_preload",
|
|
17
|
+
VeStrategyAdaptRange = "vestrategy_adapt_range",
|
|
18
|
+
DashAbralgo = "DashAbralgo",
|
|
19
|
+
Preloader = "preloader"
|
|
20
|
+
}
|
|
21
|
+
/** Resolved UMD module values keyed by their public UMD key. */
|
|
22
|
+
export type UmdModules = Partial<Record<UmdKeys, unknown>>;
|
|
23
|
+
/** Video and audio codec names supported by the player. */
|
|
24
|
+
export declare const CodecType: {
|
|
25
|
+
readonly H264: "h264";
|
|
26
|
+
readonly H265: "h265";
|
|
27
|
+
readonly H266: "h266";
|
|
28
|
+
readonly AAC: "aac";
|
|
29
|
+
readonly MP3: "mp3";
|
|
30
|
+
readonly OPUS: "opus";
|
|
31
|
+
readonly UNKNOWN: "unknown";
|
|
32
|
+
};
|
|
33
|
+
/** MIME type mapping for the supported MSE video codecs. */
|
|
34
|
+
export declare const ContentType: {
|
|
35
|
+
readonly h265: string;
|
|
36
|
+
readonly h264: string;
|
|
37
|
+
};
|
|
38
|
+
export declare enum EVideoFormat {
|
|
39
|
+
MP4 = "mp4",
|
|
40
|
+
DASH = "dash",
|
|
41
|
+
HLS = "hls"
|
|
42
|
+
}
|
|
43
|
+
export declare enum EAudioFormat {
|
|
44
|
+
M4A = "m4a",
|
|
45
|
+
MP4 = "mp4",
|
|
46
|
+
MP3 = "mp3",
|
|
47
|
+
DASH = "dash",
|
|
48
|
+
HLS = "hls",
|
|
49
|
+
OGG = "ogg"
|
|
50
|
+
}
|
|
51
|
+
export declare const enum EDRMTYPE {
|
|
52
|
+
DRM_ENCRYPT = "drm_encrypt",
|
|
53
|
+
PRIVATE_ENCRYPT = "private_encrypt",
|
|
54
|
+
PRIVATE_ENCRYPT_UPGRADE = "private_encrypt_upgrade",
|
|
55
|
+
STANDARD_ENCRYPT = "standard_encrypt"
|
|
56
|
+
}
|
|
57
|
+
/** Plugin placement values compatible with the Full entry. */
|
|
58
|
+
export declare const enum POSITIONS {
|
|
59
|
+
ROOT = "root",
|
|
60
|
+
ROOT_LEFT = "rootLeft",
|
|
61
|
+
ROOT_RIGHT = "rootRight",
|
|
62
|
+
ROOT_TOP = "rootTop",
|
|
63
|
+
CONTROLS_LEFT = "controlsLeft",
|
|
64
|
+
CONTROLS_RIGTH = "controlsRight",
|
|
65
|
+
CONTROLS_RIGHT = "controlsRight",
|
|
66
|
+
CONTROLS_CENTER = "controlsCenter",
|
|
67
|
+
CONTROLS = "controls"
|
|
68
|
+
}
|
|
69
|
+
/** Public event-name map shared by Lite and Full UMD constructors. */
|
|
70
|
+
export interface LiteEvents {
|
|
71
|
+
readonly READY: "ready";
|
|
72
|
+
readonly [eventName: string]: string;
|
|
73
|
+
}
|
|
74
|
+
/** Legacy grouped event-name map. */
|
|
75
|
+
export interface LiteEvent {
|
|
76
|
+
readonly SDKEvents: LiteEvents;
|
|
77
|
+
readonly PluginEvents: Record<string, string>;
|
|
78
|
+
}
|
|
79
|
+
export declare const Events: LiteEvents;
|
|
80
|
+
export declare const Event: LiteEvent;
|
|
3
81
|
export type LiteStreamType = "mp4" | "hls" | "dash" | "flv";
|
|
4
82
|
export type LiteCodecType = "h264" | "h265" | "h266" | "aac" | "mp3" | "opus" | "unknown";
|
|
5
83
|
export type LiteDrmType = "drm_encrypt" | "private_encrypt" | "private_encrypt_upgrade" | "standard_encrypt";
|
|
@@ -38,6 +116,174 @@ export interface LitePlayAuthTokenConfig {
|
|
|
38
116
|
autoDemoteDefinitionTextKey?: string;
|
|
39
117
|
urlQueryParams?: Record<string, string>;
|
|
40
118
|
}
|
|
119
|
+
/** Lite-only preloading scene values supported by the player runtime. */
|
|
120
|
+
export type LitePreloadScene = 0 | 1;
|
|
121
|
+
/** Lite-safe preload strategy configuration. */
|
|
122
|
+
export interface LitePreloadStrategyConfig {
|
|
123
|
+
preloadScene?: LitePreloadScene;
|
|
124
|
+
prevCount?: number;
|
|
125
|
+
nextCount?: number;
|
|
126
|
+
preloadTime?: number;
|
|
127
|
+
preloadMaxCacheCount?: number;
|
|
128
|
+
Strategy?: unknown;
|
|
129
|
+
disabled?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/** Lite strategy initialization. Full strategy names are deliberately absent. */
|
|
132
|
+
export interface LiteStrategyInitOptions {
|
|
133
|
+
/** Optional for a configured short-drama environment. */
|
|
134
|
+
appId?: number;
|
|
135
|
+
region?: "cn" | "mya" | "va" | "sg";
|
|
136
|
+
strategies: {
|
|
137
|
+
preload?: true | LitePreloadStrategyConfig;
|
|
138
|
+
};
|
|
139
|
+
deviceId?: string;
|
|
140
|
+
plugins?: unknown[];
|
|
141
|
+
Module?: unknown;
|
|
142
|
+
}
|
|
143
|
+
/** Runtime updates supported for Lite preload scenes. */
|
|
144
|
+
export interface LitePreloadUpdateConfig {
|
|
145
|
+
prevCount?: number;
|
|
146
|
+
nextCount?: number;
|
|
147
|
+
}
|
|
148
|
+
/** Lite-safe media information cache settings. */
|
|
149
|
+
export interface LiteMediaInfoCacheConfig {
|
|
150
|
+
enable?: boolean;
|
|
151
|
+
cacheType?: "memory" | "localStorage";
|
|
152
|
+
expireTime?: number;
|
|
153
|
+
maxEntries?: number;
|
|
154
|
+
}
|
|
155
|
+
/** Current media information cache settings, with defaults resolved. */
|
|
156
|
+
export interface LiteMediaInfoCacheState {
|
|
157
|
+
enable: boolean;
|
|
158
|
+
cacheType: "memory" | "localStorage";
|
|
159
|
+
expireTime: number;
|
|
160
|
+
maxEntries: number;
|
|
161
|
+
}
|
|
162
|
+
/** Minimal preloader operations available from the Lite static surface. */
|
|
163
|
+
export interface LitePreloaderManager {
|
|
164
|
+
removeAll(): void;
|
|
165
|
+
removeAllPreloadTask(): void;
|
|
166
|
+
clearPreloadList(): void;
|
|
167
|
+
}
|
|
168
|
+
/** Lite preloader lifecycle states. */
|
|
169
|
+
export type LitePreloaderStatus = 0 | 1 | 2 | 3;
|
|
170
|
+
/** Lite-safe view of the strategy controller exposed by the player. */
|
|
171
|
+
export interface LiteVeStrategy {
|
|
172
|
+
readonly preloader?: LitePreloaderManager;
|
|
173
|
+
readonly preloaderStatus: LitePreloaderStatus;
|
|
174
|
+
}
|
|
175
|
+
/** Encryption metadata generated by a registered encryption module. */
|
|
176
|
+
export type LiteEncryptInfo = Record<string, unknown>;
|
|
177
|
+
/** A direct media entry accepted by Lite preload APIs. */
|
|
178
|
+
export interface LitePreloadResolvedStream {
|
|
179
|
+
vid: string;
|
|
180
|
+
url: string;
|
|
181
|
+
definition: string;
|
|
182
|
+
streamType: "mp4";
|
|
183
|
+
codec: "h264";
|
|
184
|
+
bitrate: number;
|
|
185
|
+
duration: number;
|
|
186
|
+
size: number;
|
|
187
|
+
}
|
|
188
|
+
/** A short-drama episode accepted by Lite preload APIs. */
|
|
189
|
+
export interface LitePreloadDramaStream {
|
|
190
|
+
vid?: string;
|
|
191
|
+
albumId: string;
|
|
192
|
+
episodeId: string;
|
|
193
|
+
defaultDefinition?: string;
|
|
194
|
+
getVideoByToken?: LitePlayAuthTokenConfig;
|
|
195
|
+
}
|
|
196
|
+
/** A token-resolved VOD item accepted by Lite preload APIs. */
|
|
197
|
+
export interface LitePreloadAuthTokenStream {
|
|
198
|
+
vid?: string;
|
|
199
|
+
defaultDefinition?: string;
|
|
200
|
+
getVideoByToken: LitePlayAuthTokenConfig;
|
|
201
|
+
}
|
|
202
|
+
/** Lite preload entries do not expose Full strategy stream contracts. */
|
|
203
|
+
export type LitePreloadStream = LitePreloadResolvedStream | LitePreloadDramaStream | LitePreloadAuthTokenStream;
|
|
204
|
+
/** Request passed by the host short-drama bridge. */
|
|
205
|
+
export interface LiteDramaInfoRequest {
|
|
206
|
+
clientKey: string;
|
|
207
|
+
albumId: string;
|
|
208
|
+
episodeId: string;
|
|
209
|
+
vid: string;
|
|
210
|
+
}
|
|
211
|
+
/** Error returned by the host short-drama bridge. */
|
|
212
|
+
export interface LiteDramaInfoError {
|
|
213
|
+
error_code: number;
|
|
214
|
+
error_msg: string;
|
|
215
|
+
error_extra?: unknown;
|
|
216
|
+
}
|
|
217
|
+
/** Safe VOD fields exposed from a short-drama video result. */
|
|
218
|
+
export interface LiteDramaVideoInfo {
|
|
219
|
+
version?: number;
|
|
220
|
+
vid?: string;
|
|
221
|
+
status?: number;
|
|
222
|
+
poster_url?: string;
|
|
223
|
+
duration?: number;
|
|
224
|
+
file_type?: string;
|
|
225
|
+
enable_adaptive?: boolean;
|
|
226
|
+
total_count?: number;
|
|
227
|
+
adaptive_info?: unknown;
|
|
228
|
+
adaptive_bitrate_streaming_info?: unknown;
|
|
229
|
+
play_info_list?: Array<{
|
|
230
|
+
file_id?: string;
|
|
231
|
+
md5?: string;
|
|
232
|
+
file_type?: string;
|
|
233
|
+
format?: string;
|
|
234
|
+
codec?: string;
|
|
235
|
+
definition?: string;
|
|
236
|
+
main_play_url?: string;
|
|
237
|
+
backup_play_url?: string;
|
|
238
|
+
bitrate?: number;
|
|
239
|
+
width?: number;
|
|
240
|
+
height?: number;
|
|
241
|
+
size?: number;
|
|
242
|
+
duration?: number;
|
|
243
|
+
drm_type?: string;
|
|
244
|
+
}>;
|
|
245
|
+
thumb_info_list?: unknown[];
|
|
246
|
+
subtitle_info_list?: unknown[];
|
|
247
|
+
}
|
|
248
|
+
/** Short-drama bridge result with only Lite-safe media data. */
|
|
249
|
+
export interface LiteDramaInfoResponse {
|
|
250
|
+
is_success: number | boolean;
|
|
251
|
+
error?: LiteDramaInfoError;
|
|
252
|
+
data?: {
|
|
253
|
+
status: number;
|
|
254
|
+
drama_info: {
|
|
255
|
+
album_id: string;
|
|
256
|
+
drama_name: string;
|
|
257
|
+
drama_cover: string;
|
|
258
|
+
drama_description: string;
|
|
259
|
+
};
|
|
260
|
+
episode_info: {
|
|
261
|
+
episode_id: string;
|
|
262
|
+
episode_name: string;
|
|
263
|
+
episode_cover: string;
|
|
264
|
+
episode_description: string;
|
|
265
|
+
};
|
|
266
|
+
video_info: LiteDramaVideoInfo;
|
|
267
|
+
perf_info?: {
|
|
268
|
+
prepare_cost?: number;
|
|
269
|
+
request_cost?: number;
|
|
270
|
+
parse_cost?: number;
|
|
271
|
+
total_cost?: number;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/** Host callbacks required by Lite short-drama playback. */
|
|
276
|
+
export interface LiteTTDramaEnv {
|
|
277
|
+
channel?: "volcengine" | "byteplus";
|
|
278
|
+
appVersion: string;
|
|
279
|
+
clientKey: string;
|
|
280
|
+
canIUseGetDramaInfo: boolean;
|
|
281
|
+
canAndroidBatchGetDramaInfo?: boolean;
|
|
282
|
+
getDramaInfo: (callback: (res: LiteDramaInfoResponse) => void, options: LiteDramaInfoRequest) => void;
|
|
283
|
+
videoSecurityModule?: unknown;
|
|
284
|
+
sendLog: (eventName: string, params: Record<string, unknown>) => void;
|
|
285
|
+
getTokenVerifySecret?: () => Promise<string>;
|
|
286
|
+
}
|
|
41
287
|
export interface LiteDefaultConfig {
|
|
42
288
|
type?: "vod";
|
|
43
289
|
isLive?: false;
|
|
@@ -341,12 +587,28 @@ type CollectorConstructor = new (name: string) => any;
|
|
|
341
587
|
export interface LiteVePlayerConstructor {
|
|
342
588
|
readonly prototype: LiteVePlayer;
|
|
343
589
|
readonly sdkVersion: string;
|
|
590
|
+
readonly Events: LiteEvents;
|
|
591
|
+
readonly Event: LiteEvent;
|
|
592
|
+
readonly veStrategy: LiteVeStrategy;
|
|
593
|
+
readonly ttDramaEnv: LiteTTDramaEnv | null;
|
|
594
|
+
readonly preloader: LitePreloaderManager | undefined;
|
|
595
|
+
readonly preloaderStatus: LitePreloaderStatus;
|
|
344
596
|
new <MediaUrl extends LiteMediaUrl = LiteMediaUrl, StreamUrl extends LiteMediaUrl = LiteMediaUrl>(configs: LitePlayerConfig<MediaUrl, StreamUrl>): LiteVePlayer;
|
|
597
|
+
prepare(options: LiteStrategyInitOptions): Promise<void>;
|
|
598
|
+
registerModules(modules: UmdModules): void;
|
|
599
|
+
setTTDramaEnv(env: LiteTTDramaEnv): void;
|
|
600
|
+
setPreloadScene(preloadScene: LitePreloadScene, options?: LitePreloadUpdateConfig): void;
|
|
601
|
+
addPreloadList(list: LitePreloadStream[]): Promise<void>;
|
|
602
|
+
setPreloadList(list: LitePreloadStream[]): Promise<void>;
|
|
345
603
|
getAppendVideoUrlTimestamp(): boolean;
|
|
346
604
|
isMSESupported(): boolean;
|
|
347
605
|
setAppendVideoUrlTimestamp(enable?: boolean): void;
|
|
348
606
|
setCollector(Collector?: CollectorConstructor): void;
|
|
349
607
|
setDebug(enable: boolean): void;
|
|
608
|
+
setMediaInfoCacheConfig(config: LiteMediaInfoCacheConfig): void;
|
|
609
|
+
getMediaInfoCacheConfig(): LiteMediaInfoCacheState;
|
|
610
|
+
clearMediaInfoCache(): void;
|
|
611
|
+
generateEncryptInfo(unionId: string, streamType: "hls" | "mp4" | "dash"): Promise<LiteEncryptInfo | undefined>;
|
|
350
612
|
}
|
|
351
613
|
declare const LiteVePlayer: LiteVePlayerConstructor;
|
|
352
614
|
export declare const Subtitle: LitePluginConstructor;
|