@volcengine/veplayer 1.6.5-rc.0 → 2.0.0-rc.1

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.
Files changed (49) hide show
  1. package/README.md +3 -45
  2. package/esm/index.d.ts +1405 -0
  3. package/esm/veplayer.biz.live.development.css +41 -0
  4. package/esm/veplayer.biz.live.development.js +3157 -0
  5. package/esm/veplayer.biz.live.production.css +1 -0
  6. package/esm/veplayer.biz.live.production.js +2 -0
  7. package/esm/veplayer.biz.vod.development.js +13 -0
  8. package/esm/veplayer.biz.vod.production.js +2 -0
  9. package/esm/veplayer.d.ts +3071 -0
  10. package/esm/veplayer.development.css +743 -0
  11. package/esm/veplayer.development.js +21023 -0
  12. package/esm/veplayer.live.d.ts +3074 -0
  13. package/esm/veplayer.live.development.css +743 -0
  14. package/esm/veplayer.live.development.js +21022 -0
  15. package/esm/veplayer.live.production.css +1 -0
  16. package/esm/veplayer.live.production.js +11 -0
  17. package/esm/veplayer.production.css +1 -0
  18. package/esm/veplayer.production.js +11 -0
  19. package/esm/veplayer.vod.d.ts +1405 -0
  20. package/esm/veplayer.vod.development.css +702 -0
  21. package/esm/veplayer.vod.development.js +13104 -0
  22. package/esm/veplayer.vod.production.css +1 -0
  23. package/esm/veplayer.vod.production.js +11 -0
  24. package/package.json +78 -6
  25. package/umd/index.d.ts +1405 -0
  26. package/umd/veplayer.biz.live.development.css +41 -0
  27. package/umd/veplayer.biz.live.development.js +3169 -0
  28. package/umd/veplayer.biz.live.production.css +1 -0
  29. package/umd/veplayer.biz.live.production.js +1 -0
  30. package/umd/veplayer.biz.vod.development.js +29 -0
  31. package/umd/veplayer.biz.vod.production.js +1 -0
  32. package/umd/veplayer.d.ts +3071 -0
  33. package/umd/veplayer.development.css +743 -0
  34. package/umd/veplayer.development.js +21026 -0
  35. package/umd/veplayer.live.d.ts +3074 -0
  36. package/umd/veplayer.live.development.css +743 -0
  37. package/umd/veplayer.live.development.js +21034 -0
  38. package/umd/veplayer.live.production.css +1 -0
  39. package/umd/veplayer.live.production.js +1 -0
  40. package/umd/veplayer.production.css +1 -0
  41. package/umd/veplayer.production.js +1 -0
  42. package/umd/veplayer.vod.d.ts +1405 -0
  43. package/umd/veplayer.vod.development.css +702 -0
  44. package/umd/veplayer.vod.development.js +13119 -0
  45. package/umd/veplayer.vod.production.css +1 -0
  46. package/umd/veplayer.vod.production.js +1 -0
  47. package/index.d.ts +0 -3256
  48. package/index.min.css +0 -1
  49. package/index.min.js +0 -2
@@ -0,0 +1,3071 @@
1
+ import { default as XGPlayer } from "xgplayer/es/player";
2
+ import { IPlayerOptions as PlayerOptions } from "xgplayer/es/player";
3
+ import Player from "xgplayer";
4
+ import { IXGI18nText, IPluginOptions, Plugin, Sniffer } from "xgplayer";
5
+ import { IDefinition as XGDefinition } from "xgplayer";
6
+ import { IError as XGError } from "xgplayer";
7
+ import { default as Player$0 } from "xgplayer";
8
+ import { IBasePluginOptions as XGPluginOptions } from "xgplayer";
9
+ import { IXGI18n } from "xgplayer/es/lang/i18n";
10
+ import XG_EN from "xgplayer/es/lang/en";
11
+ import XG_ZH_CN from "xgplayer/es/lang/zh-cn";
12
+ import OptionList from "xgplayer/es/plugins/common/optionList";
13
+ import { FlvOption } from "xgplayer-flv/es/flv/options";
14
+ import { HlsOption } from "xgplayer-hls/es/hls/config";
15
+ import Poster from "xgplayer/es/plugins/poster";
16
+ import Start from "xgplayer/es/plugins/start";
17
+ import Enter from "xgplayer/es/plugins/enter";
18
+ import PC from "xgplayer/es/plugins/pc";
19
+ import Mobile from "xgplayer/es/plugins/mobile";
20
+ import Keyboard from "xgplayer/es/plugins/keyboard";
21
+ import Loading from "xgplayer/es/plugins/loading";
22
+ import Play from "xgplayer/es/plugins/play";
23
+ import FullScreen from "xgplayer/es/plugins/fullscreen";
24
+ import Volume from "xgplayer/es/plugins/volume";
25
+ import MiniScreen from "xgplayer/es/plugins/miniScreen";
26
+ import PIPIcon from "xgplayer/es/plugins/pip";
27
+ declare const EN: {
28
+ DEFINITION_FALLBACK_TOAST: string;
29
+ DEFINITION_SWITCHING: string;
30
+ ERROR_REFRESH: string;
31
+ UNMUTE: string;
32
+ MANIFEST: string;
33
+ NETWORK: string;
34
+ NETWORK_TIMEOUT: string;
35
+ NETWORK_FORBIDDEN: string;
36
+ NETWORK_NOTFOUND: string;
37
+ DEMUX: string;
38
+ REMUX: string;
39
+ MEDIA: string;
40
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
41
+ MEDIA_ERR_URL_EMPTY: string;
42
+ DRM: string;
43
+ OTHER: string;
44
+ RUNTIME: string;
45
+ MODULE_LOAD_ERROR: string;
46
+ UNKNOWN: string;
47
+ ERROR_TYPES: typeof XG_EN.TEXT.ERROR_TYPES;
48
+ HAVE_NOTHING: string;
49
+ HAVE_METADATA: string;
50
+ HAVE_CURRENT_DATA: string;
51
+ HAVE_FUTURE_DATA: string;
52
+ HAVE_ENOUGH_DATA: string;
53
+ NETWORK_EMPTY: string;
54
+ NETWORK_IDLE: string;
55
+ NETWORK_LOADING: string;
56
+ NETWORK_NO_SOURCE: string;
57
+ MEDIA_ERR_ABORTED: string;
58
+ MEDIA_ERR_NETWORK: string;
59
+ MEDIA_ERR_DECODE: string;
60
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
61
+ REPLAY: string;
62
+ ERROR: string;
63
+ PLAY_TIPS: string;
64
+ PAUSE_TIPS: string;
65
+ PLAYNEXT_TIPS: string;
66
+ DOWNLOAD_TIPS: string;
67
+ ROTATE_TIPS: string;
68
+ RELOAD_TIPS: string;
69
+ FULLSCREEN_TIPS: string;
70
+ EXITFULLSCREEN_TIPS: string;
71
+ CSSFULLSCREEN_TIPS: string;
72
+ EXITCSSFULLSCREEN_TIPS: string;
73
+ TEXTTRACK: string;
74
+ PIP: string;
75
+ SCREENSHOT: string;
76
+ LIVE: string;
77
+ OFF: string;
78
+ OPEN: string;
79
+ MINI_DRAG: string;
80
+ MINISCREEN: string;
81
+ REFRESH_TIPS: string;
82
+ REFRESH: string;
83
+ FORWARD: string;
84
+ LIVE_TIP: string;
85
+ };
86
+ declare const ZH_CN: {
87
+ DEFINITION_FALLBACK_TOAST: string;
88
+ DEFINITION_SWITCHING: string;
89
+ ERROR_REFRESH: string;
90
+ UNMUTE: string;
91
+ MANIFEST: string;
92
+ NETWORK: string;
93
+ NETWORK_TIMEOUT: string;
94
+ NETWORK_FORBIDDEN: string;
95
+ NETWORK_NOTFOUND: string;
96
+ DEMUX: string;
97
+ REMUX: string;
98
+ MEDIA: string;
99
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
100
+ MEDIA_ERR_URL_EMPTY: string;
101
+ DRM: string;
102
+ OTHER: string;
103
+ RUNTIME: string;
104
+ MODULE_LOAD_ERROR: string;
105
+ UNKNOWN: string;
106
+ ERROR_TYPES: typeof XG_ZH_CN.TEXT.ERROR_TYPES;
107
+ HAVE_NOTHING: string;
108
+ HAVE_METADATA: string;
109
+ HAVE_CURRENT_DATA: string;
110
+ HAVE_FUTURE_DATA: string;
111
+ HAVE_ENOUGH_DATA: string;
112
+ NETWORK_EMPTY: string;
113
+ NETWORK_IDLE: string;
114
+ NETWORK_LOADING: string;
115
+ NETWORK_NO_SOURCE: string;
116
+ MEDIA_ERR_ABORTED: string;
117
+ MEDIA_ERR_NETWORK: string;
118
+ MEDIA_ERR_DECODE: string;
119
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
120
+ REPLAY: string;
121
+ ERROR: string;
122
+ PLAY_TIPS: string;
123
+ PAUSE_TIPS: string;
124
+ PLAYNEXT_TIPS: string;
125
+ DOWNLOAD_TIPS: string;
126
+ ROTATE_TIPS: string;
127
+ RELOAD_TIPS: string;
128
+ FULLSCREEN_TIPS: string;
129
+ EXITFULLSCREEN_TIPS: string;
130
+ CSSFULLSCREEN_TIPS: string;
131
+ EXITCSSFULLSCREEN_TIPS: string;
132
+ TEXTTRACK: string;
133
+ PIP: string;
134
+ SCREENSHOT: string;
135
+ LIVE: string;
136
+ OFF: string;
137
+ OPEN: string;
138
+ MINI_DRAG: string;
139
+ MINISCREEN: string;
140
+ REFRESH_TIPS: string;
141
+ REFRESH: string;
142
+ FORWARD: string;
143
+ LIVE_TIP: string;
144
+ };
145
+ type TextKey = keyof typeof EN;
146
+ type Lang = "zh-cn" | "zh-hk" | "en" | "jp" | string;
147
+ declare class VeI18n<T extends string = TextKey> {
148
+ private _lang;
149
+ constructor(config?: {
150
+ lang?: Lang;
151
+ i18n?: {
152
+ texts?: Record<Lang, Record<string, string>>;
153
+ };
154
+ });
155
+ static get langKeys(): any;
156
+ static isLangValid(lang: Lang): boolean;
157
+ static extend(i18nTextList: Array<IXGI18nText>, i18nLangs?: IXGI18n): void;
158
+ setLang(lang: string): void;
159
+ getLang(): string;
160
+ normalize(text?: string | Record<Lang, string>): string;
161
+ getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
162
+ }
163
+ interface DefinitionUrl {
164
+ url: string;
165
+ next: DefinitionUrl | null;
166
+ }
167
+ declare class Definition implements XGDefinition {
168
+ readonly definition: string;
169
+ readonly source: Source;
170
+ readonly text?: Record<Lang, string> | string;
171
+ readonly fallbackUrl: DefinitionUrl;
172
+ readonly urls: string[];
173
+ private _currentUrlRef;
174
+ constructor(definitionSetting: {
175
+ url: string;
176
+ definition: string;
177
+ source: Source;
178
+ text?: Record<Lang, string> | string;
179
+ fallbackUrls?: string[];
180
+ });
181
+ get url(): string;
182
+ next(): DefinitionUrl;
183
+ }
184
+ interface ExposedDefinition {
185
+ url: string;
186
+ definition: string;
187
+ text?: Record<Lang, string> | string;
188
+ fallbackUrls?: string[];
189
+ }
190
+ interface ExposedSource {
191
+ name?: string;
192
+ text?: Record<Lang, string> | string;
193
+ definitions: Array<ExposedDefinition | string>;
194
+ }
195
+ interface CompoundSources {
196
+ sources?: ExposedSource[];
197
+ url?: string;
198
+ fallbackUrls?: string[];
199
+ }
200
+ declare class Source {
201
+ readonly name?: string;
202
+ readonly text?: Record<Lang, string> | string;
203
+ readonly definitions: Array<Definition & {
204
+ source: Source;
205
+ }>;
206
+ private constructor();
207
+ get defaultDefinition(): Definition & {
208
+ source: Source;
209
+ };
210
+ static normalize(input: CompoundSources | ExposedSource[] | string): Source[];
211
+ private static normalizeUrl;
212
+ add(definition: Definition): void;
213
+ }
214
+ declare enum TOP_RIGHT_POSITIONS {
215
+ ROOT_TOP_RIGHT = "rootTopRight",
216
+ ROOT_TOP_RIGHT_COLLAPSE = "rootTopRightCollapse"
217
+ }
218
+ declare class TopRightBar extends Plugin {
219
+ static get pluginName(): string;
220
+ static get defaultConfig(): {
221
+ position: string;
222
+ plugins: never[];
223
+ };
224
+ static isTopRightPlugin(plugin: any, options: VePlayerBaseOptions): boolean;
225
+ registerIcons(): {
226
+ more: {
227
+ icon: any;
228
+ class: string;
229
+ };
230
+ };
231
+ children(): Record<string, {
232
+ plugin: Partial<Plugin>;
233
+ options: IPluginOptions["config"];
234
+ }>;
235
+ render(): string;
236
+ private _getPlugins;
237
+ }
238
+ interface Config {
239
+ listType: ListTypeOption;
240
+ isAutoChange?: boolean;
241
+ onItemClick?: (e: Event, data: CallbackData) => void;
242
+ onOptionClick?: (e: Event, data: CallbackData) => void;
243
+ hide?: () => void;
244
+ list?: ListItem[];
245
+ panel?: {
246
+ className?: string;
247
+ title?: string | Record<Lang, string>;
248
+ };
249
+ }
250
+ interface Options {
251
+ config: Config;
252
+ root: HTMLElement | null;
253
+ player: Player;
254
+ }
255
+ declare class MobilePlayerPanel {
256
+ private _root?;
257
+ private _config;
258
+ private _parent;
259
+ private _listDom?;
260
+ private _container?;
261
+ private _titleDom?;
262
+ private _player;
263
+ private _delegates?;
264
+ private _listType?;
265
+ constructor(args: Options);
266
+ changeMode(listType: ListTypeOption): void;
267
+ // 渲染选择列表
268
+ renderItemList(data?: ListItem[]): HTMLElement;
269
+ // 渲染panel的标题
270
+ renderTitle(): HTMLElement | undefined;
271
+ updatePanel(listType: ListTypeOption): void;
272
+ // 渲染panel
273
+ renderPanel(): void;
274
+ show(): void;
275
+ hide(): void;
276
+ destroy(): void;
277
+ private _bind;
278
+ private _unbind;
279
+ private _initEvents;
280
+ private _unbindEvents;
281
+ private _handleOrientationChange;
282
+ private _bindDomEvent;
283
+ private _unbindDomEvent;
284
+ private _stopPropagation;
285
+ private _onItemClick;
286
+ private _handleHide;
287
+ }
288
+ declare module MobilePlayerPanelWrapper {
289
+ export { MobilePlayerPanel };
290
+ }
291
+ import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
292
+ declare const ListType: {
293
+ readonly Middle: "middle";
294
+ readonly Bottom: "bottom";
295
+ readonly Fullscreen: "fullscreen";
296
+ readonly Inner: "inner";
297
+ };
298
+ type ListTypeOption = (typeof ListType)[keyof typeof ListType];
299
+ interface ListItem {
300
+ [key: string]: any;
301
+ selected?: boolean;
302
+ className?: string;
303
+ showText?: string | HTMLElement;
304
+ text?: string | Record<Lang, string>;
305
+ iconText?: string | Record<Lang, string>;
306
+ }
307
+ type CallbackData = {
308
+ to?: ListItem;
309
+ from?: ListItem;
310
+ };
311
+ declare const enum RenderType {
312
+ Icon = "Icon",
313
+ Text = "Text"
314
+ }
315
+ type Config$0<T> = {
316
+ [key: string]: any;
317
+ // 【xg】顺序
318
+ index?: number;
319
+ // 【xg】展示的选择列表
320
+ list?: Array<T>;
321
+ // 【xg】竖屏
322
+ hidePortrait?: boolean;
323
+ // 【xg】列表点击之后是否隐藏列表
324
+ isItemClickHide?: boolean;
325
+ className?: string;
326
+ // 【xg】是否展示已选择的
327
+ isShowIcon?: boolean;
328
+ // 【xg 扩展】列表渲染样式类型
329
+ listType?: ListTypeOption;
330
+ // 已选择的展示类型(文案 or icon)
331
+ renderType?: RenderType;
332
+ // 列表数据只有一个是否展示
333
+ hideOnSingleOption?: boolean;
334
+ // 横屏的时候是否切换mode
335
+ isAutoChange?: boolean;
336
+ // 自定义组件 mobilePanel的配置
337
+ panel?: {
338
+ className?: string;
339
+ // panel 的标题
340
+ title?: string | Record<Lang, string>;
341
+ };
342
+ };
343
+ // 源自packages/xgplayer/src/plugins/common/optionsIcon.js
344
+ // 自定义了几种选择类型
345
+ declare class OptionsIcon extends Plugin {
346
+ icons: Record<string, any>;
347
+ config: Config$0<ListItem>;
348
+ optionsList?: MobilePanel | OptionList;
349
+ private _isIcon?;
350
+ private _isActive?;
351
+ private _curIndex;
352
+ private activeEvent?;
353
+ constructor(args: IPluginOptions);
354
+ static get pluginName(): string;
355
+ static get defaultConfig(): Config$0<ListItem>;
356
+ updateLang(): void;
357
+ afterCreate(): void;
358
+ initIcons(): void;
359
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
360
+ // @ts-ignore
361
+ show(): void;
362
+ hide(): void;
363
+ onEnter: (e: Event) => void;
364
+ onLeave: (e: Event) => void;
365
+ // 状态切换
366
+ toggle(isActive: boolean): void;
367
+ // 列表选择回调
368
+ onItemClick(e: Event, data: CallbackData): void;
369
+ // 列表点击回调
370
+ onOptionClick(e: Event, _data: CallbackData): void;
371
+ // 已选择 option 的文案
372
+ changeCurrentText(): void;
373
+ renderItemList(itemList: ListItem[], curIndex?: number): void;
374
+ destroy(): void;
375
+ render(): string;
376
+ private _getListType;
377
+ }
378
+ declare enum Codec {
379
+ H265 = "h265",
380
+ H264 = "h264"
381
+ }
382
+ declare enum Degradation {
383
+ SoftFirst = "soft-first",
384
+ H264First = "h264-first"
385
+ }
386
+ declare enum DecodeType {
387
+ Software = "software",
388
+ Hardware = "hardware"
389
+ }
390
+ type PrepareResult = {
391
+ options?: Partial<VePlayerBaseOptions>;
392
+ plugins?: any[];
393
+ };
394
+ type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
395
+ type Constructor<T> = new (...args: any[]) => T;
396
+ declare const POSITIONS: {
397
+ ROOT_TOP_RIGHT: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT;
398
+ ROOT_TOP_RIGHT_COLLAPSE: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT_COLLAPSE;
399
+ ROOT: string;
400
+ ROOT_LEFT: string;
401
+ ROOT_RIGHT: string;
402
+ ROOT_TOP: string;
403
+ CONTROLS_LEFT: string;
404
+ CONTROLS_RIGTH: string;
405
+ CONTROLS_RIGHT: string;
406
+ CONTROLS_CENTER: string;
407
+ CONTROLS: string;
408
+ };
409
+ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
410
+ url?: string;
411
+ id?: string;
412
+ el?: HTMLElement;
413
+ codec?: Codec;
414
+ fallbackUrls?: string[];
415
+ maxFallbackRound?: number;
416
+ degradation?: Degradation | boolean;
417
+ decodeType?: DecodeType;
418
+ poster?: string;
419
+ defaultSource?: string;
420
+ defaultDefinition?: string;
421
+ preparePlugins?: PreparePlugins;
422
+ autoplay?: {
423
+ muted: boolean;
424
+ } | boolean;
425
+ playlist?: ExposedSource[];
426
+ listType?: ListTypeOption;
427
+ flv?: Partial<FlvOption>;
428
+ hls?: Partial<HlsOption> & {
429
+ enableMSE?: boolean;
430
+ };
431
+ i18n?: {
432
+ texts: Record<Lang, Record<string, string>>;
433
+ };
434
+ }
435
+ declare class VePlayerBase {
436
+ protected readonly _player: XGPlayer;
437
+ private readonly _sourceManager;
438
+ private readonly _preparePlugins?;
439
+ private _previousPrepareResult?;
440
+ private _i18nManager;
441
+ private _events;
442
+ private _errorCallback;
443
+ constructor(options?: VePlayerBaseOptions);
444
+ get readyState(): 0 | 2 | 1 | 4 | 3;
445
+ get buffered(): TimeRanges;
446
+ get played(): TimeRanges;
447
+ get cumulateTime(): number;
448
+ get isFocused(): boolean;
449
+ get isFullscreen(): boolean;
450
+ get isCssFullscreen(): boolean;
451
+ get networkState(): 0 | 2 | 1 | 3;
452
+ get paused(): boolean;
453
+ get ended(): boolean;
454
+ get state(): number;
455
+ get url(): any;
456
+ get source(): string | undefined;
457
+ get definition(): string;
458
+ get crossOrigin(): string;
459
+ set crossOrigin(crossOrigin: string);
460
+ // eslint-disable-next-line @typescript-eslint/member-ordering
461
+ get volume(): number;
462
+ set volume(volume: number);
463
+ // eslint-disable-next-line @typescript-eslint/member-ordering
464
+ get muted(): boolean;
465
+ set muted(isMuted: boolean);
466
+ // eslint-disable-next-line @typescript-eslint/member-ordering
467
+ get lang(): Lang;
468
+ set lang(lang: Lang);
469
+ // eslint-disable-next-line @typescript-eslint/member-ordering
470
+ protected get _src(): string;
471
+ static create<T extends VePlayerBase>(options?: VePlayerBaseOptions, Constructor?: Constructor<T>): Promise<T>;
472
+ switch(target: string | {
473
+ definition?: string;
474
+ source?: string;
475
+ }, options?: {
476
+ fallbackToFirstDefinition?: boolean;
477
+ }): Promise<Definition>;
478
+ updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
479
+ definition?: string;
480
+ source?: string;
481
+ }): Promise<void>;
482
+ // TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
483
+ once(event: string, callback: (data?: any) => any, ...args: any[]): void;
484
+ off(event: string, callback: (data?: any) => any, ...args: any[]): void;
485
+ emit(event: string, data?: any, ...args: any[]): void;
486
+ offAll(): void;
487
+ on(event: string, callback: (data?: any) => any, ...args: any[]): void;
488
+ play(): any;
489
+ pause(): void;
490
+ requestPIP(): void;
491
+ exitPIP(): void;
492
+ retry(): void;
493
+ focus(data?: {
494
+ autoHide?: boolean;
495
+ delay?: number;
496
+ }): void;
497
+ blur(data?: {
498
+ ignorePaused?: boolean;
499
+ }): void;
500
+ getFullscreen(el?: HTMLElement): Promise<void>;
501
+ exitFullscreen(el?: HTMLElement): Promise<void>;
502
+ getCssFullscreen(el?: HTMLElement): void;
503
+ exitCssFullscreen(): void;
504
+ registerPlugin(plugin:
505
+ // eslint-disable-next-line @typescript-eslint/ban-types
506
+ Function | {
507
+ // eslint-disable-next-line @typescript-eslint/ban-types
508
+ plugin: Function;
509
+ options: object;
510
+ }, config?: {
511
+ [propName: string]: any;
512
+ }): any;
513
+ unRegisterPlugin(plugin: any, removedFromConfig?: boolean): void;
514
+ // 显示插件
515
+ showIcon(pluginNames: string[]): void;
516
+ // 隐藏插件显示
517
+ hideIcon(pluginNames: string[]): void;
518
+ destroy(): void;
519
+ prepare(url: string): Promise<any[]>;
520
+ private _handleFallback;
521
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
522
+ private _transformEvent;
523
+ private _switch;
524
+ private _switchUrl;
525
+ // 获取需要卸载和需要注册的播放插件
526
+ private _diffPlugins;
527
+ private _callBeforePlayerInitForUrl;
528
+ }
529
+ declare const enum State {
530
+ Fetching = 0,
531
+ Ready = 1,
532
+ Error = 2
533
+ }
534
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
535
+ type Exports = Record<string, any>;
536
+ interface Module {
537
+ src: string;
538
+ state: State;
539
+ name: string;
540
+ exports: Exports;
541
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
542
+ error?: any;
543
+ }
544
+ type ModuleSystem = "esm" | "umd";
545
+ interface LoaderOptions {
546
+ baseUrl: string;
547
+ }
548
+ declare enum DynamicModule {
549
+ BizVod = "biz:vod",
550
+ BizLive = "biz:live",
551
+ PluginFlv = "plugin:flv",
552
+ PluginMp4 = "plugin:mp4",
553
+ PluginHls = "plugin:hls",
554
+ PluginShaka = "plugin:shaka",
555
+ PluginRtm = "plugin:rtm",
556
+ PluginXgvideo = "plugin:xgvideo"
557
+ }
558
+ type ModulesMap = {
559
+ [DynamicModule.BizVod]: Exports;
560
+ [DynamicModule.BizLive]: Exports;
561
+ [DynamicModule.PluginFlv]: Exports;
562
+ [DynamicModule.PluginMp4]: Exports;
563
+ [DynamicModule.PluginHls]: Exports;
564
+ [DynamicModule.PluginShaka]: Exports;
565
+ [DynamicModule.PluginRtm]: Exports;
566
+ [DynamicModule.PluginXgvideo]: Exports;
567
+ };
568
+ declare const register: (name: string, exports: {
569
+ [x: string]: any;
570
+ }) => {
571
+ [x: string]: any;
572
+ };
573
+ declare function load<T extends DynamicModule>(name: T, src?: string): Promise<ModulesMap[T]>;
574
+ declare module MobilePlayerPanelWrapper {
575
+ export { MobilePlayerPanel };
576
+ }
577
+ declare namespace strategy {
578
+ const EN: {
579
+ DEFINITION_FALLBACK_TOAST: string;
580
+ DEFINITION_SWITCHING: string;
581
+ ERROR_REFRESH: string;
582
+ UNMUTE: string;
583
+ MANIFEST: string;
584
+ NETWORK: string;
585
+ NETWORK_TIMEOUT: string;
586
+ NETWORK_FORBIDDEN: string;
587
+ NETWORK_NOTFOUND: string;
588
+ DEMUX: string;
589
+ REMUX: string;
590
+ MEDIA: string;
591
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
592
+ MEDIA_ERR_URL_EMPTY: string;
593
+ DRM: string;
594
+ OTHER: string;
595
+ RUNTIME: string;
596
+ MODULE_LOAD_ERROR: string;
597
+ UNKNOWN: string;
598
+ ERROR_TYPES: typeof XG_EN.TEXT.ERROR_TYPES;
599
+ HAVE_NOTHING: string;
600
+ HAVE_METADATA: string;
601
+ HAVE_CURRENT_DATA: string;
602
+ HAVE_FUTURE_DATA: string;
603
+ HAVE_ENOUGH_DATA: string;
604
+ NETWORK_EMPTY: string;
605
+ NETWORK_IDLE: string;
606
+ NETWORK_LOADING: string;
607
+ NETWORK_NO_SOURCE: string;
608
+ MEDIA_ERR_ABORTED: string;
609
+ MEDIA_ERR_NETWORK: string;
610
+ MEDIA_ERR_DECODE: string;
611
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
612
+ REPLAY: string;
613
+ ERROR: string;
614
+ PLAY_TIPS: string;
615
+ PAUSE_TIPS: string;
616
+ PLAYNEXT_TIPS: string;
617
+ DOWNLOAD_TIPS: string;
618
+ ROTATE_TIPS: string;
619
+ RELOAD_TIPS: string;
620
+ FULLSCREEN_TIPS: string;
621
+ EXITFULLSCREEN_TIPS: string;
622
+ CSSFULLSCREEN_TIPS: string;
623
+ EXITCSSFULLSCREEN_TIPS: string;
624
+ TEXTTRACK: string;
625
+ PIP: string;
626
+ SCREENSHOT: string;
627
+ LIVE: string;
628
+ OFF: string;
629
+ OPEN: string;
630
+ MINI_DRAG: string;
631
+ MINISCREEN: string;
632
+ REFRESH_TIPS: string;
633
+ REFRESH: string;
634
+ FORWARD: string;
635
+ LIVE_TIP: string;
636
+ };
637
+ const ZH_CN: {
638
+ DEFINITION_FALLBACK_TOAST: string;
639
+ DEFINITION_SWITCHING: string;
640
+ ERROR_REFRESH: string;
641
+ UNMUTE: string;
642
+ MANIFEST: string;
643
+ NETWORK: string;
644
+ NETWORK_TIMEOUT: string;
645
+ NETWORK_FORBIDDEN: string;
646
+ NETWORK_NOTFOUND: string;
647
+ DEMUX: string;
648
+ REMUX: string;
649
+ MEDIA: string;
650
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
651
+ MEDIA_ERR_URL_EMPTY: string;
652
+ DRM: string;
653
+ OTHER: string;
654
+ RUNTIME: string;
655
+ MODULE_LOAD_ERROR: string;
656
+ UNKNOWN: string;
657
+ ERROR_TYPES: typeof XG_ZH_CN.TEXT.ERROR_TYPES;
658
+ HAVE_NOTHING: string;
659
+ HAVE_METADATA: string;
660
+ HAVE_CURRENT_DATA: string;
661
+ HAVE_FUTURE_DATA: string;
662
+ HAVE_ENOUGH_DATA: string;
663
+ NETWORK_EMPTY: string;
664
+ NETWORK_IDLE: string;
665
+ NETWORK_LOADING: string;
666
+ NETWORK_NO_SOURCE: string;
667
+ MEDIA_ERR_ABORTED: string;
668
+ MEDIA_ERR_NETWORK: string;
669
+ MEDIA_ERR_DECODE: string;
670
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
671
+ REPLAY: string;
672
+ ERROR: string;
673
+ PLAY_TIPS: string;
674
+ PAUSE_TIPS: string;
675
+ PLAYNEXT_TIPS: string;
676
+ DOWNLOAD_TIPS: string;
677
+ ROTATE_TIPS: string;
678
+ RELOAD_TIPS: string;
679
+ FULLSCREEN_TIPS: string;
680
+ EXITFULLSCREEN_TIPS: string;
681
+ CSSFULLSCREEN_TIPS: string;
682
+ EXITCSSFULLSCREEN_TIPS: string;
683
+ TEXTTRACK: string;
684
+ PIP: string;
685
+ SCREENSHOT: string;
686
+ LIVE: string;
687
+ OFF: string;
688
+ OPEN: string;
689
+ MINI_DRAG: string;
690
+ MINISCREEN: string;
691
+ REFRESH_TIPS: string;
692
+ REFRESH: string;
693
+ FORWARD: string;
694
+ LIVE_TIP: string;
695
+ };
696
+ type TextKey = keyof typeof EN;
697
+ type Lang = "zh-cn" | "zh-hk" | "en" | "jp" | string;
698
+ class VeI18n<T extends string = TextKey> {
699
+ private _lang;
700
+ constructor(config?: {
701
+ lang?: Lang;
702
+ i18n?: {
703
+ texts?: Record<Lang, Record<string, string>>;
704
+ };
705
+ });
706
+ static get langKeys(): any;
707
+ static isLangValid(lang: Lang): boolean;
708
+ static extend(i18nTextList: Array<IXGI18nText>, i18nLangs?: IXGI18n): void;
709
+ setLang(lang: string): void;
710
+ getLang(): string;
711
+ normalize(text?: string | Record<Lang, string>): string;
712
+ getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
713
+ }
714
+ interface DefinitionUrl {
715
+ url: string;
716
+ next: DefinitionUrl | null;
717
+ }
718
+ function arrayToList(urls?: string[]): DefinitionUrl;
719
+ class Definition implements XGDefinition {
720
+ readonly definition: string;
721
+ readonly source: Source;
722
+ readonly text?: Record<Lang, string> | string;
723
+ readonly fallbackUrl: DefinitionUrl;
724
+ readonly urls: string[];
725
+ private _currentUrlRef;
726
+ constructor(definitionSetting: {
727
+ url: string;
728
+ definition: string;
729
+ source: Source;
730
+ text?: Record<Lang, string> | string;
731
+ fallbackUrls?: string[];
732
+ });
733
+ get url(): string;
734
+ next(): DefinitionUrl;
735
+ }
736
+ interface ExposedDefinition {
737
+ url: string;
738
+ definition: string;
739
+ text?: Record<Lang, string> | string;
740
+ fallbackUrls?: string[];
741
+ }
742
+ interface ExposedSource {
743
+ name?: string;
744
+ text?: Record<Lang, string> | string;
745
+ definitions: Array<ExposedDefinition | string>;
746
+ }
747
+ interface CompoundSources {
748
+ sources?: ExposedSource[];
749
+ url?: string;
750
+ fallbackUrls?: string[];
751
+ }
752
+ class Source {
753
+ readonly name?: string;
754
+ readonly text?: Record<Lang, string> | string;
755
+ readonly definitions: Array<Definition & {
756
+ source: Source;
757
+ }>;
758
+ private constructor();
759
+ get defaultDefinition(): Definition & {
760
+ source: Source;
761
+ };
762
+ static normalize(input: CompoundSources | ExposedSource[] | string): Source[];
763
+ private static normalizeUrl;
764
+ add(definition: Definition): void;
765
+ }
766
+ enum TOP_RIGHT_POSITIONS {
767
+ ROOT_TOP_RIGHT = "rootTopRight",
768
+ ROOT_TOP_RIGHT_COLLAPSE = "rootTopRightCollapse"
769
+ }
770
+ class TopRightBar extends Plugin {
771
+ static get pluginName(): string;
772
+ static get defaultConfig(): {
773
+ position: string;
774
+ plugins: never[];
775
+ };
776
+ static isTopRightPlugin(plugin: any, options: VePlayerBaseOptions): boolean;
777
+ registerIcons(): {
778
+ more: {
779
+ icon: any;
780
+ class: string;
781
+ };
782
+ };
783
+ children(): Record<string, {
784
+ plugin: Partial<Plugin>;
785
+ options: IPluginOptions["config"];
786
+ }>;
787
+ render(): string;
788
+ private _getPlugins;
789
+ }
790
+ interface Config {
791
+ listType: ListTypeOption;
792
+ isAutoChange?: boolean;
793
+ onItemClick?: (e: Event, data: CallbackData) => void;
794
+ onOptionClick?: (e: Event, data: CallbackData) => void;
795
+ hide?: () => void;
796
+ list?: ListItem[];
797
+ panel?: {
798
+ className?: string;
799
+ title?: string | Record<Lang, string>;
800
+ };
801
+ }
802
+ interface Options {
803
+ config: Config;
804
+ root: HTMLElement | null;
805
+ player: Player;
806
+ }
807
+ class MobilePlayerPanel {
808
+ private _root?;
809
+ private _config;
810
+ private _parent;
811
+ private _listDom?;
812
+ private _container?;
813
+ private _titleDom?;
814
+ private _player;
815
+ private _delegates?;
816
+ private _listType?;
817
+ constructor(args: Options);
818
+ changeMode(listType: ListTypeOption): void;
819
+ // 渲染选择列表
820
+ renderItemList(data?: ListItem[]): HTMLElement;
821
+ // 渲染panel的标题
822
+ renderTitle(): HTMLElement | undefined;
823
+ updatePanel(listType: ListTypeOption): void;
824
+ // 渲染panel
825
+ renderPanel(): void;
826
+ show(): void;
827
+ hide(): void;
828
+ destroy(): void;
829
+ private _bind;
830
+ private _unbind;
831
+ private _initEvents;
832
+ private _unbindEvents;
833
+ private _handleOrientationChange;
834
+ private _bindDomEvent;
835
+ private _unbindDomEvent;
836
+ private _stopPropagation;
837
+ private _onItemClick;
838
+ private _handleHide;
839
+ }
840
+ import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
841
+ const ListType: {
842
+ readonly Middle: "middle";
843
+ readonly Bottom: "bottom";
844
+ readonly Fullscreen: "fullscreen";
845
+ readonly Inner: "inner";
846
+ };
847
+ type ListTypeOption = (typeof ListType)[keyof typeof ListType];
848
+ interface ListItem {
849
+ [key: string]: any;
850
+ selected?: boolean;
851
+ className?: string;
852
+ showText?: string | HTMLElement;
853
+ text?: string | Record<Lang, string>;
854
+ iconText?: string | Record<Lang, string>;
855
+ }
856
+ type CallbackData = {
857
+ to?: ListItem;
858
+ from?: ListItem;
859
+ };
860
+ const enum RenderType {
861
+ Icon = "Icon",
862
+ Text = "Text"
863
+ }
864
+ type Config$0<T> = {
865
+ [key: string]: any;
866
+ // 【xg】顺序
867
+ index?: number;
868
+ // 【xg】展示的选择列表
869
+ list?: Array<T>;
870
+ // 【xg】竖屏
871
+ hidePortrait?: boolean;
872
+ // 【xg】列表点击之后是否隐藏列表
873
+ isItemClickHide?: boolean;
874
+ className?: string;
875
+ // 【xg】是否展示已选择的
876
+ isShowIcon?: boolean;
877
+ // 【xg 扩展】列表渲染样式类型
878
+ listType?: ListTypeOption;
879
+ // 已选择的展示类型(文案 or icon)
880
+ renderType?: RenderType;
881
+ // 列表数据只有一个是否展示
882
+ hideOnSingleOption?: boolean;
883
+ // 横屏的时候是否切换mode
884
+ isAutoChange?: boolean;
885
+ // 自定义组件 mobilePanel的配置
886
+ panel?: {
887
+ className?: string;
888
+ // panel 的标题
889
+ title?: string | Record<Lang, string>;
890
+ };
891
+ };
892
+ // 源自packages/xgplayer/src/plugins/common/optionsIcon.js
893
+ // 自定义了几种选择类型
894
+ class OptionsIcon extends Plugin {
895
+ icons: Record<string, any>;
896
+ config: Config$0<ListItem>;
897
+ optionsList?: MobilePanel | OptionList;
898
+ private _isIcon?;
899
+ private _isActive?;
900
+ private _curIndex;
901
+ private activeEvent?;
902
+ constructor(args: IPluginOptions);
903
+ static get pluginName(): string;
904
+ static get defaultConfig(): Config$0<ListItem>;
905
+ updateLang(): void;
906
+ afterCreate(): void;
907
+ initIcons(): void;
908
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
909
+ // @ts-ignore
910
+ show(): void;
911
+ hide(): void;
912
+ onEnter: (e: Event) => void;
913
+ onLeave: (e: Event) => void;
914
+ // 状态切换
915
+ toggle(isActive: boolean): void;
916
+ // 列表选择回调
917
+ onItemClick(e: Event, data: CallbackData): void;
918
+ // 列表点击回调
919
+ onOptionClick(e: Event, _data: CallbackData): void;
920
+ // 已选择 option 的文案
921
+ changeCurrentText(): void;
922
+ renderItemList(itemList: ListItem[], curIndex?: number): void;
923
+ destroy(): void;
924
+ render(): string;
925
+ private _getListType;
926
+ }
927
+ enum Codec {
928
+ H265 = "h265",
929
+ H264 = "h264"
930
+ }
931
+ enum Degradation {
932
+ SoftFirst = "soft-first",
933
+ H264First = "h264-first"
934
+ }
935
+ enum DecodeType {
936
+ Software = "software",
937
+ Hardware = "hardware"
938
+ }
939
+ type PrepareResult = {
940
+ options?: Partial<VePlayerBaseOptions>;
941
+ plugins?: any[];
942
+ };
943
+ type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
944
+ type Constructor<T> = new (...args: any[]) => T;
945
+ const POSITIONS: {
946
+ ROOT_TOP_RIGHT: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT;
947
+ ROOT_TOP_RIGHT_COLLAPSE: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT_COLLAPSE;
948
+ ROOT: string;
949
+ ROOT_LEFT: string;
950
+ ROOT_RIGHT: string;
951
+ ROOT_TOP: string;
952
+ CONTROLS_LEFT: string;
953
+ CONTROLS_RIGTH: string;
954
+ CONTROLS_RIGHT: string;
955
+ CONTROLS_CENTER: string;
956
+ CONTROLS: string;
957
+ };
958
+ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
959
+ url?: string;
960
+ id?: string;
961
+ el?: HTMLElement;
962
+ codec?: Codec;
963
+ fallbackUrls?: string[];
964
+ maxFallbackRound?: number;
965
+ degradation?: Degradation | boolean;
966
+ decodeType?: DecodeType;
967
+ poster?: string;
968
+ defaultSource?: string;
969
+ defaultDefinition?: string;
970
+ preparePlugins?: PreparePlugins;
971
+ autoplay?: {
972
+ muted: boolean;
973
+ } | boolean;
974
+ playlist?: ExposedSource[];
975
+ listType?: ListTypeOption;
976
+ flv?: Partial<FlvOption>;
977
+ hls?: Partial<HlsOption> & {
978
+ enableMSE?: boolean;
979
+ };
980
+ i18n?: {
981
+ texts: Record<Lang, Record<string, string>>;
982
+ };
983
+ }
984
+ const transformOption: (options: VePlayerBaseOptions) => Omit<VePlayerBaseOptions, "i18n">;
985
+ class VePlayerBase {
986
+ protected readonly _player: XGPlayer;
987
+ private readonly _sourceManager;
988
+ private readonly _preparePlugins?;
989
+ private _previousPrepareResult?;
990
+ private _i18nManager;
991
+ private _events;
992
+ private _errorCallback;
993
+ constructor(options?: VePlayerBaseOptions);
994
+ get readyState(): 0 | 2 | 1 | 4 | 3;
995
+ get buffered(): TimeRanges;
996
+ get played(): TimeRanges;
997
+ get cumulateTime(): number;
998
+ get isFocused(): boolean;
999
+ get isFullscreen(): boolean;
1000
+ get isCssFullscreen(): boolean;
1001
+ get networkState(): 0 | 2 | 1 | 3;
1002
+ get paused(): boolean;
1003
+ get ended(): boolean;
1004
+ get state(): number;
1005
+ get url(): any;
1006
+ get source(): string | undefined;
1007
+ get definition(): string;
1008
+ get crossOrigin(): string;
1009
+ set crossOrigin(crossOrigin: string);
1010
+ // eslint-disable-next-line @typescript-eslint/member-ordering
1011
+ get volume(): number;
1012
+ set volume(volume: number);
1013
+ // eslint-disable-next-line @typescript-eslint/member-ordering
1014
+ get muted(): boolean;
1015
+ set muted(isMuted: boolean);
1016
+ // eslint-disable-next-line @typescript-eslint/member-ordering
1017
+ get lang(): Lang;
1018
+ set lang(lang: Lang);
1019
+ // eslint-disable-next-line @typescript-eslint/member-ordering
1020
+ protected get _src(): string;
1021
+ static create<T extends VePlayerBase>(options?: VePlayerBaseOptions, Constructor?: Constructor<T>): Promise<T>;
1022
+ switch(target: string | {
1023
+ definition?: string;
1024
+ source?: string;
1025
+ }, options?: {
1026
+ fallbackToFirstDefinition?: boolean;
1027
+ }): Promise<Definition>;
1028
+ updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
1029
+ definition?: string;
1030
+ source?: string;
1031
+ }): Promise<void>;
1032
+ // TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
1033
+ once(event: string, callback: (data?: any) => any, ...args: any[]): void;
1034
+ off(event: string, callback: (data?: any) => any, ...args: any[]): void;
1035
+ emit(event: string, data?: any, ...args: any[]): void;
1036
+ offAll(): void;
1037
+ on(event: string, callback: (data?: any) => any, ...args: any[]): void;
1038
+ play(): any;
1039
+ pause(): void;
1040
+ requestPIP(): void;
1041
+ exitPIP(): void;
1042
+ retry(): void;
1043
+ focus(data?: {
1044
+ autoHide?: boolean;
1045
+ delay?: number;
1046
+ }): void;
1047
+ blur(data?: {
1048
+ ignorePaused?: boolean;
1049
+ }): void;
1050
+ getFullscreen(el?: HTMLElement): Promise<void>;
1051
+ exitFullscreen(el?: HTMLElement): Promise<void>;
1052
+ getCssFullscreen(el?: HTMLElement): void;
1053
+ exitCssFullscreen(): void;
1054
+ registerPlugin(plugin:
1055
+ // eslint-disable-next-line @typescript-eslint/ban-types
1056
+ Function | {
1057
+ // eslint-disable-next-line @typescript-eslint/ban-types
1058
+ plugin: Function;
1059
+ options: object;
1060
+ }, config?: {
1061
+ [propName: string]: any;
1062
+ }): any;
1063
+ unRegisterPlugin(plugin: any, removedFromConfig?: boolean): void;
1064
+ // 显示插件
1065
+ showIcon(pluginNames: string[]): void;
1066
+ // 隐藏插件显示
1067
+ hideIcon(pluginNames: string[]): void;
1068
+ destroy(): void;
1069
+ prepare(url: string): Promise<any[]>;
1070
+ private _handleFallback;
1071
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1072
+ private _transformEvent;
1073
+ private _switch;
1074
+ private _switchUrl;
1075
+ // 获取需要卸载和需要注册的播放插件
1076
+ private _diffPlugins;
1077
+ private _callBeforePlayerInitForUrl;
1078
+ }
1079
+ /// <reference types="./loader" />
1080
+ const NAME_MAP: {
1081
+ readonly "biz:vod": "veplayer.biz.vod.[env].[ext]";
1082
+ readonly "biz:live": "veplayer.biz.live.[env].[ext]";
1083
+ readonly "plugin:flv": "veplayer.plugin.flv.[env].[ext]";
1084
+ readonly "plugin:mp4": "veplayer.plugin.mp4.[env].[ext]";
1085
+ readonly "plugin:hls": "veplayer.plugin.hls.[env].[ext]";
1086
+ readonly "plugin:shaka": "veplayer.plugin.shaka.[env].[ext]";
1087
+ readonly "plugin:rtm": "veplayer.plugin.rtm.[env].[ext]";
1088
+ readonly "plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]";
1089
+ };
1090
+ const enum State {
1091
+ Fetching = 0,
1092
+ Ready = 1,
1093
+ Error = 2
1094
+ }
1095
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1096
+ type Exports = Record<string, any>;
1097
+ interface Module {
1098
+ src: string;
1099
+ state: State;
1100
+ name: string;
1101
+ exports: Exports;
1102
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1103
+ error?: any;
1104
+ }
1105
+ type ModuleSystem = "esm" | "umd";
1106
+ interface LoaderOptions {
1107
+ baseUrl: string;
1108
+ }
1109
+ enum DynamicModule {
1110
+ BizVod = "biz:vod",
1111
+ BizLive = "biz:live",
1112
+ PluginFlv = "plugin:flv",
1113
+ PluginMp4 = "plugin:mp4",
1114
+ PluginHls = "plugin:hls",
1115
+ PluginShaka = "plugin:shaka",
1116
+ PluginRtm = "plugin:rtm",
1117
+ PluginXgvideo = "plugin:xgvideo"
1118
+ }
1119
+ type ModulesMap = {
1120
+ [DynamicModule.BizVod]: Exports;
1121
+ [DynamicModule.BizLive]: Exports;
1122
+ [DynamicModule.PluginFlv]: Exports;
1123
+ [DynamicModule.PluginMp4]: Exports;
1124
+ [DynamicModule.PluginHls]: Exports;
1125
+ [DynamicModule.PluginShaka]: Exports;
1126
+ [DynamicModule.PluginRtm]: Exports;
1127
+ [DynamicModule.PluginXgvideo]: Exports;
1128
+ };
1129
+ class Loader {
1130
+ readonly modules: Record<string, Module>;
1131
+ readonly mountPromiseMap: Record<string, Promise<Exports>>;
1132
+ private _baseUrl;
1133
+ private _moduleSystem?;
1134
+ constructor(options: LoaderOptions);
1135
+ get baseUrl(): string;
1136
+ get moduleSystem(): ModuleSystem | undefined;
1137
+ setModuleSystem(moduleSystem: ModuleSystem): void;
1138
+ setBaseUrl(url: string): void;
1139
+ load: <T extends DynamicModule>(name: T, src?: string) => Promise<ModulesMap[T]>;
1140
+ register: (name: string, exports: Exports) => Exports;
1141
+ private _mount;
1142
+ }
1143
+ const register: (name: string, exports: {
1144
+ [x: string]: any;
1145
+ }) => {
1146
+ [x: string]: any;
1147
+ };
1148
+ function setModuleSystem(moduleSystem: ModuleSystem): void;
1149
+ function setBaseUrl(url: string): void;
1150
+ function getBaseUrl(): string;
1151
+ function load<T extends DynamicModule>(name: T, src?: string): Promise<ModulesMap[T]>;
1152
+ interface Strategy<T = VePlayerBaseOptions, R extends keyof ModulesMap = any> {
1153
+ options: Partial<T>;
1154
+ module: R;
1155
+ afterLoad?: (module: ModulesMap[R]) => void;
1156
+ }
1157
+ type StrategyCreator<T, R extends keyof ModulesMap = any> = (options?: T) => Strategy<T, R>;
1158
+ const createFlvMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginFlv>;
1159
+ const createHlsMseStrategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginHls>;
1160
+ const createSoftDecodeH264Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
1161
+ const createSoftDecodeH265Strategy: StrategyCreator<VePlayerBaseOptions, DynamicModule.PluginXgvideo>;
1162
+ function getCodec(options: VePlayerBaseOptions): Promise<"unknown" | Codec>;
1163
+ function detectCodec(url: string): Promise<"unknown" | Codec>;
1164
+ function isSoftDecode(options: VePlayerBaseOptions): Promise<boolean>;
1165
+ function combineOptions<T = VePlayerBaseOptions>(strategyList: (Strategy<T> | undefined)[]): Partial<T>;
1166
+ const getFlvStrategy: (options: VePlayerBaseOptions) => Promise<{
1167
+ options?: undefined;
1168
+ plugins?: undefined;
1169
+ } | {
1170
+ options: Partial<VePlayerBaseOptions>;
1171
+ plugins: {
1172
+ [x: string]: any;
1173
+ }[];
1174
+ }>;
1175
+ const getHlsStrategy: (options: VePlayerBaseOptions) => Promise<{
1176
+ options?: undefined;
1177
+ plugins?: undefined;
1178
+ } | {
1179
+ options: Partial<VePlayerBaseOptions>;
1180
+ plugins: {
1181
+ [x: string]: any;
1182
+ }[];
1183
+ }>;
1184
+ }
1185
+ declare function getStreamType(url: string): "unknown" | "hls" | "flv" | "rtm" | "mp4" | "dash";
1186
+ declare function isMseSupported(codec?: Codec): any;
1187
+ declare function isSoftDecodeSupported(): Promise<any>;
1188
+ declare const util: {
1189
+ getStreamType: typeof getStreamType;
1190
+ isMseSupported: typeof isMseSupported;
1191
+ isSoftDecodeSupported: typeof isSoftDecodeSupported;
1192
+ createDom(el?: string | undefined, tpl?: string | undefined, attrs?: {
1193
+ [propName: string]: any;
1194
+ } | undefined, cname?: string | undefined): HTMLElement;
1195
+ createDomFromHtml(html: string, attrs?: string | undefined, classname?: string | undefined): HTMLElement;
1196
+ hasClass(el: HTMLElement, className: string): boolean;
1197
+ addClass(el: HTMLElement, className: string): void;
1198
+ removeClass(el: HTMLElement, className: string): void;
1199
+ toggleClass(el: HTMLElement, className: string): void;
1200
+ classNames(...args: any[]): string;
1201
+ findDom(el: HTMLElement, sel: string): HTMLElement;
1202
+ getCss(dom: HTMLElement, key: string): any;
1203
+ padStart(str: any, length: any, pad: any): string;
1204
+ format(time: number): string;
1205
+ event(e: any): any;
1206
+ typeOf(obj: any): string;
1207
+ deepCopy(dst: any, src: any): any;
1208
+ deepMerge(dst: any, src: any): any;
1209
+ getBgImage(el: any): string;
1210
+ copyDom(dom: HTMLElement): HTMLElement;
1211
+ setInterval(context: any, eventName: string, intervalFunc: Function, frequency: number): void;
1212
+ clearInterval(context: any, eventName: string): void;
1213
+ setTimeout(context: any, fun: Function, time: number): number;
1214
+ clearTimeout(context: any, id: number): void;
1215
+ clearAllTimers(context: any): void;
1216
+ createImgBtn(name: string, imgUrl: string, width?: number | undefined, height?: number | undefined): HTMLElement;
1217
+ Hex2RGBA(hex: string, alpha: string | number): string;
1218
+ getFullScreenEl(): HTMLElement;
1219
+ checkIsFunction(fun: any): boolean;
1220
+ checkIsObject(obj: any): boolean;
1221
+ hide(dom: any): void;
1222
+ show(dom: any, display: any): void;
1223
+ isUndefined(val: any): boolean;
1224
+ isNotNull(val: any): boolean;
1225
+ setStyleFromCsstext(dom: HTMLElement, text?: string | undefined): void;
1226
+ filterStyleFromText(dom: HTMLElement, list?: string[] | undefined): {} | {
1227
+ [propName: string]: any;
1228
+ };
1229
+ getStyleFromCsstext(dom: HTMLElement): {} | {
1230
+ [propName: string]: any;
1231
+ };
1232
+ preloadImg(url: any, onload?: (() => void) | undefined, onerror?: (() => void) | undefined): void;
1233
+ stopPropagation(e: any): void;
1234
+ scrollTop(): number;
1235
+ scrollLeft(): number;
1236
+ checkTouchSupport(): boolean;
1237
+ getBuffered2(vbuffered: any, maxHoleDuration?: number | undefined): import("xgplayer/es/utils/xgplayerTimeRange").default;
1238
+ getEventPos(e: Events, zoom?: number | undefined): {
1239
+ x: number;
1240
+ y: number;
1241
+ clientX: number;
1242
+ clientY: number;
1243
+ offsetX: number;
1244
+ offsetY: number;
1245
+ pageX: number;
1246
+ pageY: number;
1247
+ };
1248
+ requestAnimationFrame(callback: any): any;
1249
+ getHostFromUrl(url: any): string;
1250
+ cancelAnimationFrame(frameId: any): void;
1251
+ isMSE(video: HTMLElement | HTMLVideoElement | HTMLAudioElement): boolean;
1252
+ generateSessionId(did?: number | undefined): string;
1253
+ createEvent(eventName: any): Event;
1254
+ adjustTimeByDuration(time: number, duration: number, isEnded: boolean): number;
1255
+ createPositionBar(className: any, root: any): HTMLElement;
1256
+ getTransformStyle(pos?: {
1257
+ x: number;
1258
+ y: number;
1259
+ scale: number;
1260
+ rotate: number;
1261
+ } | undefined): string;
1262
+ convertDeg(val: number): number;
1263
+ };
1264
+ declare namespace error {
1265
+ const EN: {
1266
+ DEFINITION_FALLBACK_TOAST: string;
1267
+ DEFINITION_SWITCHING: string;
1268
+ ERROR_REFRESH: string;
1269
+ UNMUTE: string;
1270
+ MANIFEST: string;
1271
+ NETWORK: string;
1272
+ NETWORK_TIMEOUT: string;
1273
+ NETWORK_FORBIDDEN: string;
1274
+ NETWORK_NOTFOUND: string;
1275
+ DEMUX: string;
1276
+ REMUX: string;
1277
+ MEDIA: string;
1278
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
1279
+ MEDIA_ERR_URL_EMPTY: string;
1280
+ DRM: string;
1281
+ OTHER: string;
1282
+ RUNTIME: string;
1283
+ MODULE_LOAD_ERROR: string;
1284
+ UNKNOWN: string;
1285
+ ERROR_TYPES: typeof XG_EN.TEXT.ERROR_TYPES;
1286
+ HAVE_NOTHING: string;
1287
+ HAVE_METADATA: string;
1288
+ HAVE_CURRENT_DATA: string;
1289
+ HAVE_FUTURE_DATA: string;
1290
+ HAVE_ENOUGH_DATA: string;
1291
+ NETWORK_EMPTY: string;
1292
+ NETWORK_IDLE: string;
1293
+ NETWORK_LOADING: string;
1294
+ NETWORK_NO_SOURCE: string;
1295
+ MEDIA_ERR_ABORTED: string;
1296
+ MEDIA_ERR_NETWORK: string;
1297
+ MEDIA_ERR_DECODE: string;
1298
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
1299
+ REPLAY: string;
1300
+ ERROR: string;
1301
+ PLAY_TIPS: string;
1302
+ PAUSE_TIPS: string;
1303
+ PLAYNEXT_TIPS: string;
1304
+ DOWNLOAD_TIPS: string;
1305
+ ROTATE_TIPS: string;
1306
+ RELOAD_TIPS: string;
1307
+ FULLSCREEN_TIPS: string;
1308
+ EXITFULLSCREEN_TIPS: string;
1309
+ CSSFULLSCREEN_TIPS: string;
1310
+ EXITCSSFULLSCREEN_TIPS: string;
1311
+ TEXTTRACK: string;
1312
+ PIP: string;
1313
+ SCREENSHOT: string;
1314
+ LIVE: string;
1315
+ OFF: string;
1316
+ OPEN: string;
1317
+ MINI_DRAG: string;
1318
+ MINISCREEN: string;
1319
+ REFRESH_TIPS: string;
1320
+ REFRESH: string;
1321
+ FORWARD: string;
1322
+ LIVE_TIP: string;
1323
+ };
1324
+ const ZH_CN: {
1325
+ DEFINITION_FALLBACK_TOAST: string;
1326
+ DEFINITION_SWITCHING: string;
1327
+ ERROR_REFRESH: string;
1328
+ UNMUTE: string;
1329
+ MANIFEST: string;
1330
+ NETWORK: string;
1331
+ NETWORK_TIMEOUT: string;
1332
+ NETWORK_FORBIDDEN: string;
1333
+ NETWORK_NOTFOUND: string;
1334
+ DEMUX: string;
1335
+ REMUX: string;
1336
+ MEDIA: string;
1337
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
1338
+ MEDIA_ERR_URL_EMPTY: string;
1339
+ DRM: string;
1340
+ OTHER: string;
1341
+ RUNTIME: string;
1342
+ MODULE_LOAD_ERROR: string;
1343
+ UNKNOWN: string;
1344
+ ERROR_TYPES: typeof XG_ZH_CN.TEXT.ERROR_TYPES;
1345
+ HAVE_NOTHING: string;
1346
+ HAVE_METADATA: string;
1347
+ HAVE_CURRENT_DATA: string;
1348
+ HAVE_FUTURE_DATA: string;
1349
+ HAVE_ENOUGH_DATA: string;
1350
+ NETWORK_EMPTY: string;
1351
+ NETWORK_IDLE: string;
1352
+ NETWORK_LOADING: string;
1353
+ NETWORK_NO_SOURCE: string;
1354
+ MEDIA_ERR_ABORTED: string;
1355
+ MEDIA_ERR_NETWORK: string;
1356
+ MEDIA_ERR_DECODE: string;
1357
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
1358
+ REPLAY: string;
1359
+ ERROR: string;
1360
+ PLAY_TIPS: string;
1361
+ PAUSE_TIPS: string;
1362
+ PLAYNEXT_TIPS: string;
1363
+ DOWNLOAD_TIPS: string;
1364
+ ROTATE_TIPS: string;
1365
+ RELOAD_TIPS: string;
1366
+ FULLSCREEN_TIPS: string;
1367
+ EXITFULLSCREEN_TIPS: string;
1368
+ CSSFULLSCREEN_TIPS: string;
1369
+ EXITCSSFULLSCREEN_TIPS: string;
1370
+ TEXTTRACK: string;
1371
+ PIP: string;
1372
+ SCREENSHOT: string;
1373
+ LIVE: string;
1374
+ OFF: string;
1375
+ OPEN: string;
1376
+ MINI_DRAG: string;
1377
+ MINISCREEN: string;
1378
+ REFRESH_TIPS: string;
1379
+ REFRESH: string;
1380
+ FORWARD: string;
1381
+ LIVE_TIP: string;
1382
+ };
1383
+ type TextKey = keyof typeof EN;
1384
+ type Lang = "zh-cn" | "zh-hk" | "en" | "jp" | string;
1385
+ class VeI18n<T extends string = TextKey> {
1386
+ private _lang;
1387
+ constructor(config?: {
1388
+ lang?: Lang;
1389
+ i18n?: {
1390
+ texts?: Record<Lang, Record<string, string>>;
1391
+ };
1392
+ });
1393
+ static get langKeys(): any;
1394
+ static isLangValid(lang: Lang): boolean;
1395
+ static extend(i18nTextList: Array<IXGI18nText>, i18nLangs?: IXGI18n): void;
1396
+ setLang(lang: string): void;
1397
+ getLang(): string;
1398
+ normalize(text?: string | Record<Lang, string>): string;
1399
+ getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
1400
+ }
1401
+ enum Level {
1402
+ Fatal = "Fatal",
1403
+ Error = "Error"
1404
+ }
1405
+ enum ErrorCode {
1406
+ MANIFEST_HLS_ERROR = 1100,
1407
+ MANIFEST_DASH_ERROR = 1200,
1408
+ NETWORK = 2100,
1409
+ NETWORK_TIMEOUT = 2101,
1410
+ NETWORK_FORBIDDEN = 2103,
1411
+ NETWORK_NOTFOUND = 2104,
1412
+ NETWORK_RANGE_NOT_SATISFIABLE = 2116,
1413
+ DEMUX_FLV_ERROR = 3100,
1414
+ DEMUX_HLS_ERROR = 3200,
1415
+ DEMUX_MP4_ERROR = 3300,
1416
+ DEMUX_FMP4_ERROR = 3400,
1417
+ DEMUX_SIDX_ERROR = 3410,
1418
+ REMUX_FMP4_ERROR = 4100,
1419
+ REMUX_MP4_ERROR = 4200,
1420
+ MEDIA_ERR_ABORTED = 5101,
1421
+ MEDIA_ERR_NETWORK = 5102,
1422
+ MEDIA_ERR_DECODE = 5103,
1423
+ MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
1424
+ MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
1425
+ MEDIA_ERR_URL_EMPTY = 5106,
1426
+ MEDIA_MSE_ADD_SB = 5200,
1427
+ MEDIA_MSE_APPEND_BUFFER = 5201,
1428
+ MEDIA_MSE_OTHER = 5202,
1429
+ MEDIA_MSE_FULL = 5203,
1430
+ MEDIA_MSE_HIJACK = 5204,
1431
+ MEDIA_EME_HIJACK = 5301,
1432
+ DRM_LICENSE = 7100,
1433
+ DRM_CUSTOM_LICENSE = 7200,
1434
+ OTHER = 8000,
1435
+ RUNTIME_NO_CANPLAY_ERROR = 9001,
1436
+ RUNTIME_BUFFERBREAK_ERROR = 9002,
1437
+ RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
1438
+ // veplayer 报错
1439
+ MODULE_LOAD_ERROR = 100,
1440
+ UNKNOWN = "UNKNOWN"
1441
+ }
1442
+ enum ErrorType {
1443
+ MANIFEST = "manifest",
1444
+ NETWORK = "network",
1445
+ DEMUX = "demux",
1446
+ REMUX = "remux",
1447
+ MEDIA = "media",
1448
+ DRM = "drm",
1449
+ OTHER = "other",
1450
+ RUNTIME = "runtime"
1451
+ }
1452
+ interface ErrorInfo<T = TextKey> {
1453
+ errorCode?: ErrorCode;
1454
+ message?: string;
1455
+ messageTextKey?: T;
1456
+ level?: Level;
1457
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1458
+ ext?: any;
1459
+ error?: Error;
1460
+ }
1461
+ // 参考: https://bytedance.feishu.cn/docx/doxcnGPXIOrJk3dGE3E3YghgZke
1462
+ const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
1463
+ const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
1464
+ class VeError<T extends string = TextKey> extends Error {
1465
+ readonly errorCode: ErrorCode;
1466
+ readonly level?: Level;
1467
+ readonly ext?: any;
1468
+ constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
1469
+ }
1470
+ function create(errorCode: ErrorCode, info?: ErrorInfo, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
1471
+ function transform(xgErr: XGError, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
1472
+ }
1473
+ declare namespace event {
1474
+ const BaseEvents: {
1475
+ SEI: string;
1476
+ PLAYER_CREATE_FINISH: string;
1477
+ FALLBACK_ERROR: string;
1478
+ FALLBACK: string;
1479
+ AUTOPLAY_STARTED: string;
1480
+ AUTOPLAY_PREVENTED: string;
1481
+ DOWNLOAD_SPEED_CHANGE: string;
1482
+ FULLSCREEN_CHANGE: string;
1483
+ CSS_FULLSCREEN_CHANGE: string;
1484
+ MINI_STATE_CHANGE: string;
1485
+ DEFINITION_CHANGE: string;
1486
+ BEFORE_DEFINITION_CHANGE: string;
1487
+ AFTER_DEFINITION_CHANGE: string;
1488
+ VIDEO_RESIZE: string;
1489
+ PIP_CHANGE: string;
1490
+ USER_ACTION: string;
1491
+ AUTOPLAY_UNMUTE: string;
1492
+ LONG_WAITING: string;
1493
+ DEFINITION_FALLBACK: string;
1494
+ AUTOPLAY_FAIL: string;
1495
+ AUTOPLAY_SUCCESS: string;
1496
+ ERROR_REFRESH_CLICK: string;
1497
+ SOURCE_CHANGE: string;
1498
+ };
1499
+ const Events: {
1500
+ SEI: string;
1501
+ PLAYER_CREATE_FINISH: string;
1502
+ FALLBACK_ERROR: string;
1503
+ FALLBACK: string;
1504
+ AUTOPLAY_STARTED: string;
1505
+ AUTOPLAY_PREVENTED: string;
1506
+ DOWNLOAD_SPEED_CHANGE: string;
1507
+ FULLSCREEN_CHANGE: string;
1508
+ CSS_FULLSCREEN_CHANGE: string;
1509
+ MINI_STATE_CHANGE: string;
1510
+ DEFINITION_CHANGE: string;
1511
+ BEFORE_DEFINITION_CHANGE: string;
1512
+ AFTER_DEFINITION_CHANGE: string;
1513
+ VIDEO_RESIZE: string;
1514
+ PIP_CHANGE: string;
1515
+ USER_ACTION: string;
1516
+ AUTOPLAY_UNMUTE: string;
1517
+ LONG_WAITING: string;
1518
+ DEFINITION_FALLBACK: string;
1519
+ AUTOPLAY_FAIL: string;
1520
+ AUTOPLAY_SUCCESS: string;
1521
+ ERROR_REFRESH_CLICK: string;
1522
+ SOURCE_CHANGE: string;
1523
+ REPLAY: string;
1524
+ ERROR: string;
1525
+ PLAY: string;
1526
+ PLAYING: string;
1527
+ ENDED: string;
1528
+ PAUSE: string;
1529
+ SEEKING: string;
1530
+ SEEKED: string;
1531
+ TIME_UPDATE: string;
1532
+ WAITING: string;
1533
+ CANPLAY: string;
1534
+ CANPLAY_THROUGH: string;
1535
+ DURATION_CHANGE: string;
1536
+ VOLUME_CHANGE: string;
1537
+ LOADED_DATA: string;
1538
+ RATE_CHANGE: string;
1539
+ PROGRESS: string;
1540
+ LOAD_START: string;
1541
+ EMPTIED: string;
1542
+ STALLED: string;
1543
+ SUSPEND: string;
1544
+ ABORT: string;
1545
+ BUFFER_CHANGE: string;
1546
+ PLAYER_FOCUS: string;
1547
+ PLAYER_BLUR: string;
1548
+ READY: string;
1549
+ URL_NULL: string;
1550
+ COMPLETE: string;
1551
+ DESTROY: string;
1552
+ URL_CHANGE: string;
1553
+ SEI_PARSED: string;
1554
+ RETRY: string;
1555
+ ROTATE: string;
1556
+ SCREEN_SHOT: string;
1557
+ PLAYNEXT: string;
1558
+ SHORTCUT: string;
1559
+ XGLOG: string;
1560
+ RESET: string;
1561
+ SOURCE_ERROR: string;
1562
+ SOURCE_SUCCESS: string;
1563
+ SWITCH_SUBTITLE: string;
1564
+ VIDEO_EVENTS: string;
1565
+ STATS_EVENTS: string;
1566
+ FPS_STUCK: string;
1567
+ };
1568
+ function transform(event: string, callback?: (data?: any) => void): {
1569
+ xgEventName: string;
1570
+ xgCallback: ((...args: any) => void) | undefined;
1571
+ };
1572
+ }
1573
+ type Text = string | Record<Lang, string>;
1574
+ type Config$1 = {
1575
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1576
+ [key: string]: any;
1577
+ showErrorImg: boolean;
1578
+ showErrorTip: boolean;
1579
+ showRefresh: boolean;
1580
+ errorTipsText: Text;
1581
+ extraTips: {
1582
+ label: Text;
1583
+ value: Text;
1584
+ }[];
1585
+ };
1586
+ declare class Error extends Plugin {
1587
+ player: Player$0;
1588
+ icons: {
1589
+ error: HTMLElement;
1590
+ };
1591
+ langText: {
1592
+ refresh: string;
1593
+ errorTip: string;
1594
+ };
1595
+ config: Config$1;
1596
+ private _error?;
1597
+ static get pluginName(): string;
1598
+ static get defaultConfig(): Config$1;
1599
+ get _errorTip(): string;
1600
+ afterCreate(): void;
1601
+ registerIcons(): {
1602
+ error: {
1603
+ icon: any;
1604
+ class: string;
1605
+ };
1606
+ };
1607
+ updateLang(): void;
1608
+ showError(error: VeError | XGError): void;
1609
+ hideError(): void;
1610
+ destroy(): void;
1611
+ render(): string;
1612
+ private _focus;
1613
+ private _initIcons;
1614
+ private _initEvents;
1615
+ private _renderText;
1616
+ private _renderExtraTips;
1617
+ private _handleRefresh;
1618
+ private _renderRefresh;
1619
+ }
1620
+ type ToastOption = {
1621
+ duration?: number;
1622
+ closable?: boolean;
1623
+ };
1624
+ declare class Toast extends Plugin {
1625
+ private _toastNumber;
1626
+ private _toastMap;
1627
+ static get pluginName(): string;
1628
+ static get defaultConfig(): {
1629
+ index: number;
1630
+ };
1631
+ toast(content: string | HTMLElement, options?: ToastOption): number;
1632
+ remove(id: number): void;
1633
+ render(): string;
1634
+ private _renderToast;
1635
+ }
1636
+ declare class Sources extends OptionsIcon {
1637
+ static get pluginName(): string;
1638
+ static get defaultConfig(): {
1639
+ index: number;
1640
+ panel: {
1641
+ title: {
1642
+ jp: string;
1643
+ en: string;
1644
+ "zh-cn": string;
1645
+ "zh-hk": string;
1646
+ };
1647
+ };
1648
+ list: never[];
1649
+ className: string;
1650
+ hidePortrait: boolean;
1651
+ isShowIcon: boolean;
1652
+ isItemClickHide?: boolean | undefined;
1653
+ listType?: ListTypeOption | undefined;
1654
+ renderType?: RenderType | undefined;
1655
+ hideOnSingleOption?: boolean | undefined;
1656
+ isAutoChange?: boolean | undefined;
1657
+ };
1658
+ static get textTips(): {
1659
+ jp: string;
1660
+ en: string;
1661
+ "zh-cn": string;
1662
+ "zh-hk": string;
1663
+ };
1664
+ updateLang(): void;
1665
+ beforeCreate(args: XGPluginOptions): void;
1666
+ afterCreate(): void;
1667
+ registerIcons(): {
1668
+ source: {
1669
+ icon: any;
1670
+ };
1671
+ };
1672
+ renderItemList(): void;
1673
+ onItemClick(_: never, data: {
1674
+ to: Source;
1675
+ }): void;
1676
+ }
1677
+ declare class DefinitionPlugin extends OptionsIcon {
1678
+ langText: Record<string, string>;
1679
+ private _waitingStartTime;
1680
+ private _timer?;
1681
+ private _toastId?;
1682
+ static get pluginName(): string;
1683
+ static get defaultConfig(): {
1684
+ index: number;
1685
+ list: never[];
1686
+ panel: {
1687
+ title: {
1688
+ jp: string;
1689
+ en: string;
1690
+ "zh-cn": string;
1691
+ "zh-hk": string;
1692
+ };
1693
+ };
1694
+ className: string;
1695
+ hidePortrait: boolean;
1696
+ isShowIcon: boolean;
1697
+ longWaitingTime: number;
1698
+ needFallback: boolean;
1699
+ demotePriority: string[];
1700
+ isItemClickHide?: boolean | undefined;
1701
+ listType?: ListTypeOption | undefined;
1702
+ renderType?: RenderType | undefined;
1703
+ hideOnSingleOption?: boolean | undefined;
1704
+ isAutoChange?: boolean | undefined;
1705
+ };
1706
+ static get textTips(): {
1707
+ jp: string;
1708
+ en: string;
1709
+ "zh-cn": string;
1710
+ "zh-hk": string;
1711
+ };
1712
+ updateLang(): void;
1713
+ beforeCreate(args: XGPluginOptions): void;
1714
+ afterCreate(): void;
1715
+ registerIcons(): {
1716
+ source: {
1717
+ icon: any;
1718
+ };
1719
+ };
1720
+ renderItemList(): void;
1721
+ onItemClick(_: never, data: {
1722
+ to: Definition;
1723
+ }): void;
1724
+ fallback(options?: {
1725
+ toast: boolean;
1726
+ }): Promise<void>;
1727
+ private _waiting;
1728
+ private _clearTimer;
1729
+ private _toast;
1730
+ private _getNextDefinition;
1731
+ private _initTimeUpdateEvent;
1732
+ private _showToast;
1733
+ }
1734
+ interface IAutoplayPluginConfig {
1735
+ position?: string;
1736
+ // 有声音自动播放失败时是否降级成静音自动播放
1737
+ enableDegradeMuteAutoplay?: boolean;
1738
+ // 启用微信jsBridge方式的自动播放
1739
+ enableWxJsBridgeAutoplay?: boolean;
1740
+ // 用户触发自动播放的目标dom
1741
+ userActionDom?: Node;
1742
+ // 开启任意点击/触摸的用户行为触发自动播放
1743
+ enableUserActionAutoplay?: boolean;
1744
+ }
1745
+ declare class Autoplay extends Plugin {
1746
+ config: IAutoplayPluginConfig;
1747
+ private _hasSetUserAutoplay?;
1748
+ private _timer?;
1749
+ private _wxTimer?;
1750
+ private _state;
1751
+ constructor(args: any);
1752
+ // 插件的名称,将作为插件实例的唯一key值
1753
+ static get pluginName(): string;
1754
+ static get defaultConfig(): IAutoplayPluginConfig;
1755
+ afterCreate(): void;
1756
+ updateLang(): void;
1757
+ initState(): void;
1758
+ initEvents(): void;
1759
+ setWXAutoPlay(): void;
1760
+ wxCanPlayFn(): void;
1761
+ wxPlay(): void;
1762
+ userClickPlay: () => void;
1763
+ setUserActionAutoPlay(): void;
1764
+ // 自动播放失败事件回调
1765
+ handleAutoplayPrevented(): void;
1766
+ changeMuteMode(): void;
1767
+ // 自动播放成功事件回调
1768
+ handleAutoplayStart(): void;
1769
+ // 有音量修改,取消静音
1770
+ handleVolumechange(): void;
1771
+ renderUnmuteBt(): void;
1772
+ cancelUnmute(): void;
1773
+ destroy(): void;
1774
+ render(): string;
1775
+ }
1776
+ interface Options$0 {
1777
+ url?: string;
1778
+ defaultDefinition?: string;
1779
+ defaultSource?: string;
1780
+ sources: Source[];
1781
+ maxFallbackRound?: number;
1782
+ }
1783
+ type Url = string;
1784
+ interface LiveVePlayerOptions extends VePlayerBaseOptions {
1785
+ rtm?: {
1786
+ fallbackUrl: string;
1787
+ };
1788
+ }
1789
+ declare class VePlayerLive extends VePlayerBase {
1790
+ openLog(): void;
1791
+ closeLog(): void;
1792
+ openInfoPanel(): void;
1793
+ closeInfoPanel(): void;
1794
+ }
1795
+ declare function createLivePlayer(options?: LiveVePlayerOptions): Promise<VePlayerLive>;
1796
+ declare enum RTMCodec {
1797
+ H264 = "h264"
1798
+ }
1799
+ declare const isRTMSupported: () => Promise<any>;
1800
+ declare const isRTMSupportCodec: (codec?: RTMCodec, options?: {
1801
+ targetProfileLevel?: string;
1802
+ }) => Promise<any>;
1803
+ declare module MobilePlayerPanelWrapper {
1804
+ export { MobilePlayerPanel };
1805
+ }
1806
+ declare namespace live {
1807
+ const Events: {
1808
+ TIME_SHIFT_CHANGE: string;
1809
+ REFRESH_CLICK: string;
1810
+ SEI: string;
1811
+ PLAYER_CREATE_FINISH: string;
1812
+ FALLBACK_ERROR: string;
1813
+ FALLBACK: string;
1814
+ AUTOPLAY_STARTED: string;
1815
+ AUTOPLAY_PREVENTED: string;
1816
+ DOWNLOAD_SPEED_CHANGE: string;
1817
+ FULLSCREEN_CHANGE: string;
1818
+ CSS_FULLSCREEN_CHANGE: string;
1819
+ MINI_STATE_CHANGE: string;
1820
+ DEFINITION_CHANGE: string;
1821
+ BEFORE_DEFINITION_CHANGE: string;
1822
+ AFTER_DEFINITION_CHANGE: string;
1823
+ VIDEO_RESIZE: string;
1824
+ PIP_CHANGE: string;
1825
+ USER_ACTION: string;
1826
+ AUTOPLAY_UNMUTE: string;
1827
+ LONG_WAITING: string;
1828
+ DEFINITION_FALLBACK: string;
1829
+ AUTOPLAY_FAIL: string;
1830
+ AUTOPLAY_SUCCESS: string;
1831
+ ERROR_REFRESH_CLICK: string;
1832
+ SOURCE_CHANGE: string;
1833
+ REPLAY: string;
1834
+ ERROR: string;
1835
+ PLAY: string;
1836
+ PLAYING: string;
1837
+ ENDED: string;
1838
+ PAUSE: string;
1839
+ SEEKING: string;
1840
+ SEEKED: string;
1841
+ TIME_UPDATE: string;
1842
+ WAITING: string;
1843
+ CANPLAY: string;
1844
+ CANPLAY_THROUGH: string;
1845
+ DURATION_CHANGE: string;
1846
+ VOLUME_CHANGE: string;
1847
+ LOADED_DATA: string;
1848
+ RATE_CHANGE: string;
1849
+ PROGRESS: string;
1850
+ LOAD_START: string;
1851
+ EMPTIED: string;
1852
+ STALLED: string;
1853
+ SUSPEND: string;
1854
+ ABORT: string;
1855
+ BUFFER_CHANGE: string;
1856
+ PLAYER_FOCUS: string;
1857
+ PLAYER_BLUR: string;
1858
+ READY: string;
1859
+ URL_NULL: string;
1860
+ COMPLETE: string;
1861
+ DESTROY: string;
1862
+ URL_CHANGE: string;
1863
+ SEI_PARSED: string;
1864
+ RETRY: string;
1865
+ ROTATE: string;
1866
+ SCREEN_SHOT: string;
1867
+ PLAYNEXT: string;
1868
+ SHORTCUT: string;
1869
+ XGLOG: string;
1870
+ RESET: string;
1871
+ SOURCE_ERROR: string;
1872
+ SOURCE_SUCCESS: string;
1873
+ SWITCH_SUBTITLE: string;
1874
+ VIDEO_EVENTS: string;
1875
+ STATS_EVENTS: string;
1876
+ FPS_STUCK: string;
1877
+ };
1878
+ const EN: {
1879
+ DEFINITION_FALLBACK_TOAST: string;
1880
+ DEFINITION_SWITCHING: string;
1881
+ ERROR_REFRESH: string;
1882
+ UNMUTE: string;
1883
+ MANIFEST: string;
1884
+ NETWORK: string;
1885
+ NETWORK_TIMEOUT: string;
1886
+ NETWORK_FORBIDDEN: string;
1887
+ NETWORK_NOTFOUND: string;
1888
+ DEMUX: string;
1889
+ REMUX: string;
1890
+ MEDIA: string;
1891
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
1892
+ MEDIA_ERR_URL_EMPTY: string;
1893
+ DRM: string;
1894
+ OTHER: string;
1895
+ RUNTIME: string;
1896
+ MODULE_LOAD_ERROR: string;
1897
+ UNKNOWN: string;
1898
+ ERROR_TYPES: typeof XG_EN.TEXT.ERROR_TYPES;
1899
+ HAVE_NOTHING: string;
1900
+ HAVE_METADATA: string;
1901
+ HAVE_CURRENT_DATA: string;
1902
+ HAVE_FUTURE_DATA: string;
1903
+ HAVE_ENOUGH_DATA: string;
1904
+ NETWORK_EMPTY: string;
1905
+ NETWORK_IDLE: string;
1906
+ NETWORK_LOADING: string;
1907
+ NETWORK_NO_SOURCE: string;
1908
+ MEDIA_ERR_ABORTED: string;
1909
+ MEDIA_ERR_NETWORK: string;
1910
+ MEDIA_ERR_DECODE: string;
1911
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
1912
+ REPLAY: string;
1913
+ ERROR: string;
1914
+ PLAY_TIPS: string;
1915
+ PAUSE_TIPS: string;
1916
+ PLAYNEXT_TIPS: string;
1917
+ DOWNLOAD_TIPS: string;
1918
+ ROTATE_TIPS: string;
1919
+ RELOAD_TIPS: string;
1920
+ FULLSCREEN_TIPS: string;
1921
+ EXITFULLSCREEN_TIPS: string;
1922
+ CSSFULLSCREEN_TIPS: string;
1923
+ EXITCSSFULLSCREEN_TIPS: string;
1924
+ TEXTTRACK: string;
1925
+ PIP: string;
1926
+ SCREENSHOT: string;
1927
+ LIVE: string;
1928
+ OFF: string;
1929
+ OPEN: string;
1930
+ MINI_DRAG: string;
1931
+ MINISCREEN: string;
1932
+ REFRESH_TIPS: string;
1933
+ REFRESH: string;
1934
+ FORWARD: string;
1935
+ LIVE_TIP: string;
1936
+ };
1937
+ const ZH_CN: {
1938
+ DEFINITION_FALLBACK_TOAST: string;
1939
+ DEFINITION_SWITCHING: string;
1940
+ ERROR_REFRESH: string;
1941
+ UNMUTE: string;
1942
+ MANIFEST: string;
1943
+ NETWORK: string;
1944
+ NETWORK_TIMEOUT: string;
1945
+ NETWORK_FORBIDDEN: string;
1946
+ NETWORK_NOTFOUND: string;
1947
+ DEMUX: string;
1948
+ REMUX: string;
1949
+ MEDIA: string;
1950
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
1951
+ MEDIA_ERR_URL_EMPTY: string;
1952
+ DRM: string;
1953
+ OTHER: string;
1954
+ RUNTIME: string;
1955
+ MODULE_LOAD_ERROR: string;
1956
+ UNKNOWN: string;
1957
+ ERROR_TYPES: typeof XG_ZH_CN.TEXT.ERROR_TYPES;
1958
+ HAVE_NOTHING: string;
1959
+ HAVE_METADATA: string;
1960
+ HAVE_CURRENT_DATA: string;
1961
+ HAVE_FUTURE_DATA: string;
1962
+ HAVE_ENOUGH_DATA: string;
1963
+ NETWORK_EMPTY: string;
1964
+ NETWORK_IDLE: string;
1965
+ NETWORK_LOADING: string;
1966
+ NETWORK_NO_SOURCE: string;
1967
+ MEDIA_ERR_ABORTED: string;
1968
+ MEDIA_ERR_NETWORK: string;
1969
+ MEDIA_ERR_DECODE: string;
1970
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
1971
+ REPLAY: string;
1972
+ ERROR: string;
1973
+ PLAY_TIPS: string;
1974
+ PAUSE_TIPS: string;
1975
+ PLAYNEXT_TIPS: string;
1976
+ DOWNLOAD_TIPS: string;
1977
+ ROTATE_TIPS: string;
1978
+ RELOAD_TIPS: string;
1979
+ FULLSCREEN_TIPS: string;
1980
+ EXITFULLSCREEN_TIPS: string;
1981
+ CSSFULLSCREEN_TIPS: string;
1982
+ EXITCSSFULLSCREEN_TIPS: string;
1983
+ TEXTTRACK: string;
1984
+ PIP: string;
1985
+ SCREENSHOT: string;
1986
+ LIVE: string;
1987
+ OFF: string;
1988
+ OPEN: string;
1989
+ MINI_DRAG: string;
1990
+ MINISCREEN: string;
1991
+ REFRESH_TIPS: string;
1992
+ REFRESH: string;
1993
+ FORWARD: string;
1994
+ LIVE_TIP: string;
1995
+ };
1996
+ type TextKey = keyof typeof EN;
1997
+ type Lang = "zh-cn" | "zh-hk" | "en" | "jp" | string;
1998
+ class VeI18n<T extends string = TextKey> {
1999
+ private _lang;
2000
+ constructor(config?: {
2001
+ lang?: Lang;
2002
+ i18n?: {
2003
+ texts?: Record<Lang, Record<string, string>>;
2004
+ };
2005
+ });
2006
+ static get langKeys(): any;
2007
+ static isLangValid(lang: Lang): boolean;
2008
+ static extend(i18nTextList: Array<IXGI18nText>, i18nLangs?: IXGI18n): void;
2009
+ setLang(lang: string): void;
2010
+ getLang(): string;
2011
+ normalize(text?: string | Record<Lang, string>): string;
2012
+ getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
2013
+ }
2014
+ interface DefinitionUrl {
2015
+ url: string;
2016
+ next: DefinitionUrl | null;
2017
+ }
2018
+ function arrayToList(urls?: string[]): DefinitionUrl;
2019
+ class Definition implements XGDefinition {
2020
+ readonly definition: string;
2021
+ readonly source: Source;
2022
+ readonly text?: Record<Lang, string> | string;
2023
+ readonly fallbackUrl: DefinitionUrl;
2024
+ readonly urls: string[];
2025
+ private _currentUrlRef;
2026
+ constructor(definitionSetting: {
2027
+ url: string;
2028
+ definition: string;
2029
+ source: Source;
2030
+ text?: Record<Lang, string> | string;
2031
+ fallbackUrls?: string[];
2032
+ });
2033
+ get url(): string;
2034
+ next(): DefinitionUrl;
2035
+ }
2036
+ interface ExposedDefinition {
2037
+ url: string;
2038
+ definition: string;
2039
+ text?: Record<Lang, string> | string;
2040
+ fallbackUrls?: string[];
2041
+ }
2042
+ interface ExposedSource {
2043
+ name?: string;
2044
+ text?: Record<Lang, string> | string;
2045
+ definitions: Array<ExposedDefinition | string>;
2046
+ }
2047
+ interface CompoundSources {
2048
+ sources?: ExposedSource[];
2049
+ url?: string;
2050
+ fallbackUrls?: string[];
2051
+ }
2052
+ class Source {
2053
+ readonly name?: string;
2054
+ readonly text?: Record<Lang, string> | string;
2055
+ readonly definitions: Array<Definition & {
2056
+ source: Source;
2057
+ }>;
2058
+ private constructor();
2059
+ get defaultDefinition(): Definition & {
2060
+ source: Source;
2061
+ };
2062
+ static normalize(input: CompoundSources | ExposedSource[] | string): Source[];
2063
+ private static normalizeUrl;
2064
+ add(definition: Definition): void;
2065
+ }
2066
+ enum TOP_RIGHT_POSITIONS {
2067
+ ROOT_TOP_RIGHT = "rootTopRight",
2068
+ ROOT_TOP_RIGHT_COLLAPSE = "rootTopRightCollapse"
2069
+ }
2070
+ class TopRightBar extends Plugin {
2071
+ static get pluginName(): string;
2072
+ static get defaultConfig(): {
2073
+ position: string;
2074
+ plugins: never[];
2075
+ };
2076
+ static isTopRightPlugin(plugin: any, options: VePlayerBaseOptions): boolean;
2077
+ registerIcons(): {
2078
+ more: {
2079
+ icon: any;
2080
+ class: string;
2081
+ };
2082
+ };
2083
+ children(): Record<string, {
2084
+ plugin: Partial<Plugin>;
2085
+ options: IPluginOptions["config"];
2086
+ }>;
2087
+ render(): string;
2088
+ private _getPlugins;
2089
+ }
2090
+ interface Config {
2091
+ listType: ListTypeOption;
2092
+ isAutoChange?: boolean;
2093
+ onItemClick?: (e: Event, data: CallbackData) => void;
2094
+ onOptionClick?: (e: Event, data: CallbackData) => void;
2095
+ hide?: () => void;
2096
+ list?: ListItem[];
2097
+ panel?: {
2098
+ className?: string;
2099
+ title?: string | Record<Lang, string>;
2100
+ };
2101
+ }
2102
+ interface Options {
2103
+ config: Config;
2104
+ root: HTMLElement | null;
2105
+ player: Player$0;
2106
+ }
2107
+ class MobilePlayerPanel {
2108
+ private _root?;
2109
+ private _config;
2110
+ private _parent;
2111
+ private _listDom?;
2112
+ private _container?;
2113
+ private _titleDom?;
2114
+ private _player;
2115
+ private _delegates?;
2116
+ private _listType?;
2117
+ constructor(args: Options);
2118
+ changeMode(listType: ListTypeOption): void;
2119
+ // 渲染选择列表
2120
+ renderItemList(data?: ListItem[]): HTMLElement;
2121
+ // 渲染panel的标题
2122
+ renderTitle(): HTMLElement | undefined;
2123
+ updatePanel(listType: ListTypeOption): void;
2124
+ // 渲染panel
2125
+ renderPanel(): void;
2126
+ show(): void;
2127
+ hide(): void;
2128
+ destroy(): void;
2129
+ private _bind;
2130
+ private _unbind;
2131
+ private _initEvents;
2132
+ private _unbindEvents;
2133
+ private _handleOrientationChange;
2134
+ private _bindDomEvent;
2135
+ private _unbindDomEvent;
2136
+ private _stopPropagation;
2137
+ private _onItemClick;
2138
+ private _handleHide;
2139
+ }
2140
+ import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
2141
+ const ListType: {
2142
+ readonly Middle: "middle";
2143
+ readonly Bottom: "bottom";
2144
+ readonly Fullscreen: "fullscreen";
2145
+ readonly Inner: "inner";
2146
+ };
2147
+ type ListTypeOption = (typeof ListType)[keyof typeof ListType];
2148
+ interface ListItem {
2149
+ [key: string]: any;
2150
+ selected?: boolean;
2151
+ className?: string;
2152
+ showText?: string | HTMLElement;
2153
+ text?: string | Record<Lang, string>;
2154
+ iconText?: string | Record<Lang, string>;
2155
+ }
2156
+ type CallbackData = {
2157
+ to?: ListItem;
2158
+ from?: ListItem;
2159
+ };
2160
+ const enum RenderType {
2161
+ Icon = "Icon",
2162
+ Text = "Text"
2163
+ }
2164
+ type Config$0<T> = {
2165
+ [key: string]: any;
2166
+ // 【xg】顺序
2167
+ index?: number;
2168
+ // 【xg】展示的选择列表
2169
+ list?: Array<T>;
2170
+ // 【xg】竖屏
2171
+ hidePortrait?: boolean;
2172
+ // 【xg】列表点击之后是否隐藏列表
2173
+ isItemClickHide?: boolean;
2174
+ className?: string;
2175
+ // 【xg】是否展示已选择的
2176
+ isShowIcon?: boolean;
2177
+ // 【xg 扩展】列表渲染样式类型
2178
+ listType?: ListTypeOption;
2179
+ // 已选择的展示类型(文案 or icon)
2180
+ renderType?: RenderType;
2181
+ // 列表数据只有一个是否展示
2182
+ hideOnSingleOption?: boolean;
2183
+ // 横屏的时候是否切换mode
2184
+ isAutoChange?: boolean;
2185
+ // 自定义组件 mobilePanel的配置
2186
+ panel?: {
2187
+ className?: string;
2188
+ // panel 的标题
2189
+ title?: string | Record<Lang, string>;
2190
+ };
2191
+ };
2192
+ // 源自packages/xgplayer/src/plugins/common/optionsIcon.js
2193
+ // 自定义了几种选择类型
2194
+ class OptionsIcon extends Plugin {
2195
+ icons: Record<string, any>;
2196
+ config: Config$0<ListItem>;
2197
+ optionsList?: MobilePanel | OptionList;
2198
+ private _isIcon?;
2199
+ private _isActive?;
2200
+ private _curIndex;
2201
+ private activeEvent?;
2202
+ constructor(args: IPluginOptions);
2203
+ static get pluginName(): string;
2204
+ static get defaultConfig(): Config$0<ListItem>;
2205
+ updateLang(): void;
2206
+ afterCreate(): void;
2207
+ initIcons(): void;
2208
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2209
+ // @ts-ignore
2210
+ show(): void;
2211
+ hide(): void;
2212
+ onEnter: (e: Event) => void;
2213
+ onLeave: (e: Event) => void;
2214
+ // 状态切换
2215
+ toggle(isActive: boolean): void;
2216
+ // 列表选择回调
2217
+ onItemClick(e: Event, data: CallbackData): void;
2218
+ // 列表点击回调
2219
+ onOptionClick(e: Event, _data: CallbackData): void;
2220
+ // 已选择 option 的文案
2221
+ changeCurrentText(): void;
2222
+ renderItemList(itemList: ListItem[], curIndex?: number): void;
2223
+ destroy(): void;
2224
+ render(): string;
2225
+ private _getListType;
2226
+ }
2227
+ enum Codec {
2228
+ H265 = "h265",
2229
+ H264 = "h264"
2230
+ }
2231
+ enum Degradation {
2232
+ SoftFirst = "soft-first",
2233
+ H264First = "h264-first"
2234
+ }
2235
+ enum DecodeType {
2236
+ Software = "software",
2237
+ Hardware = "hardware"
2238
+ }
2239
+ type PrepareResult = {
2240
+ options?: Partial<VePlayerBaseOptions>;
2241
+ plugins?: any[];
2242
+ };
2243
+ type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
2244
+ type Constructor<T> = new (...args: any[]) => T;
2245
+ const POSITIONS: {
2246
+ ROOT_TOP_RIGHT: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT;
2247
+ ROOT_TOP_RIGHT_COLLAPSE: TOP_RIGHT_POSITIONS.ROOT_TOP_RIGHT_COLLAPSE;
2248
+ ROOT: string;
2249
+ ROOT_LEFT: string;
2250
+ ROOT_RIGHT: string;
2251
+ ROOT_TOP: string;
2252
+ CONTROLS_LEFT: string;
2253
+ CONTROLS_RIGTH: string;
2254
+ CONTROLS_RIGHT: string;
2255
+ CONTROLS_CENTER: string;
2256
+ CONTROLS: string;
2257
+ };
2258
+ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
2259
+ url?: string;
2260
+ id?: string;
2261
+ el?: HTMLElement;
2262
+ codec?: Codec;
2263
+ fallbackUrls?: string[];
2264
+ maxFallbackRound?: number;
2265
+ degradation?: Degradation | boolean;
2266
+ decodeType?: DecodeType;
2267
+ poster?: string;
2268
+ defaultSource?: string;
2269
+ defaultDefinition?: string;
2270
+ preparePlugins?: PreparePlugins;
2271
+ autoplay?: {
2272
+ muted: boolean;
2273
+ } | boolean;
2274
+ playlist?: ExposedSource[];
2275
+ listType?: ListTypeOption;
2276
+ flv?: Partial<FlvOption>;
2277
+ hls?: Partial<HlsOption> & {
2278
+ enableMSE?: boolean;
2279
+ };
2280
+ i18n?: {
2281
+ texts: Record<Lang, Record<string, string>>;
2282
+ };
2283
+ }
2284
+ const transformOption: (options: VePlayerBaseOptions) => Omit<VePlayerBaseOptions, "i18n">;
2285
+ class VePlayerBase {
2286
+ protected readonly _player: XGPlayer;
2287
+ private readonly _sourceManager;
2288
+ private readonly _preparePlugins?;
2289
+ private _previousPrepareResult?;
2290
+ private _i18nManager;
2291
+ private _events;
2292
+ private _errorCallback;
2293
+ constructor(options?: VePlayerBaseOptions);
2294
+ get readyState(): 0 | 2 | 1 | 4 | 3;
2295
+ get buffered(): TimeRanges;
2296
+ get played(): TimeRanges;
2297
+ get cumulateTime(): number;
2298
+ get isFocused(): boolean;
2299
+ get isFullscreen(): boolean;
2300
+ get isCssFullscreen(): boolean;
2301
+ get networkState(): 0 | 2 | 1 | 3;
2302
+ get paused(): boolean;
2303
+ get ended(): boolean;
2304
+ get state(): number;
2305
+ get url(): any;
2306
+ get source(): string | undefined;
2307
+ get definition(): string;
2308
+ get crossOrigin(): string;
2309
+ set crossOrigin(crossOrigin: string);
2310
+ // eslint-disable-next-line @typescript-eslint/member-ordering
2311
+ get volume(): number;
2312
+ set volume(volume: number);
2313
+ // eslint-disable-next-line @typescript-eslint/member-ordering
2314
+ get muted(): boolean;
2315
+ set muted(isMuted: boolean);
2316
+ // eslint-disable-next-line @typescript-eslint/member-ordering
2317
+ get lang(): Lang;
2318
+ set lang(lang: Lang);
2319
+ // eslint-disable-next-line @typescript-eslint/member-ordering
2320
+ protected get _src(): string;
2321
+ static create<T extends VePlayerBase>(options?: VePlayerBaseOptions, Constructor?: Constructor<T>): Promise<T>;
2322
+ switch(target: string | {
2323
+ definition?: string;
2324
+ source?: string;
2325
+ }, options?: {
2326
+ fallbackToFirstDefinition?: boolean;
2327
+ }): Promise<Definition>;
2328
+ updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
2329
+ definition?: string;
2330
+ source?: string;
2331
+ }): Promise<void>;
2332
+ // TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
2333
+ once(event: string, callback: (data?: any) => any, ...args: any[]): void;
2334
+ off(event: string, callback: (data?: any) => any, ...args: any[]): void;
2335
+ emit(event: string, data?: any, ...args: any[]): void;
2336
+ offAll(): void;
2337
+ on(event: string, callback: (data?: any) => any, ...args: any[]): void;
2338
+ play(): any;
2339
+ pause(): void;
2340
+ requestPIP(): void;
2341
+ exitPIP(): void;
2342
+ retry(): void;
2343
+ focus(data?: {
2344
+ autoHide?: boolean;
2345
+ delay?: number;
2346
+ }): void;
2347
+ blur(data?: {
2348
+ ignorePaused?: boolean;
2349
+ }): void;
2350
+ getFullscreen(el?: HTMLElement): Promise<void>;
2351
+ exitFullscreen(el?: HTMLElement): Promise<void>;
2352
+ getCssFullscreen(el?: HTMLElement): void;
2353
+ exitCssFullscreen(): void;
2354
+ registerPlugin(plugin:
2355
+ // eslint-disable-next-line @typescript-eslint/ban-types
2356
+ Function | {
2357
+ // eslint-disable-next-line @typescript-eslint/ban-types
2358
+ plugin: Function;
2359
+ options: object;
2360
+ }, config?: {
2361
+ [propName: string]: any;
2362
+ }): any;
2363
+ unRegisterPlugin(plugin: any, removedFromConfig?: boolean): void;
2364
+ // 显示插件
2365
+ showIcon(pluginNames: string[]): void;
2366
+ // 隐藏插件显示
2367
+ hideIcon(pluginNames: string[]): void;
2368
+ destroy(): void;
2369
+ prepare(url: string): Promise<any[]>;
2370
+ private _handleFallback;
2371
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2372
+ private _transformEvent;
2373
+ private _switch;
2374
+ private _switchUrl;
2375
+ // 获取需要卸载和需要注册的播放插件
2376
+ private _diffPlugins;
2377
+ private _callBeforePlayerInitForUrl;
2378
+ }
2379
+ /// <reference types="./loader" />
2380
+ const NAME_MAP: {
2381
+ readonly "biz:vod": "veplayer.biz.vod.[env].[ext]";
2382
+ readonly "biz:live": "veplayer.biz.live.[env].[ext]";
2383
+ readonly "plugin:flv": "veplayer.plugin.flv.[env].[ext]";
2384
+ readonly "plugin:mp4": "veplayer.plugin.mp4.[env].[ext]";
2385
+ readonly "plugin:hls": "veplayer.plugin.hls.[env].[ext]";
2386
+ readonly "plugin:shaka": "veplayer.plugin.shaka.[env].[ext]";
2387
+ readonly "plugin:rtm": "veplayer.plugin.rtm.[env].[ext]";
2388
+ readonly "plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]";
2389
+ };
2390
+ const enum State {
2391
+ Fetching = 0,
2392
+ Ready = 1,
2393
+ Error = 2
2394
+ }
2395
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2396
+ type Exports = Record<string, any>;
2397
+ interface Module {
2398
+ src: string;
2399
+ state: State;
2400
+ name: string;
2401
+ exports: Exports;
2402
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2403
+ error?: any;
2404
+ }
2405
+ type ModuleSystem = "esm" | "umd";
2406
+ interface LoaderOptions {
2407
+ baseUrl: string;
2408
+ }
2409
+ enum DynamicModule {
2410
+ BizVod = "biz:vod",
2411
+ BizLive = "biz:live",
2412
+ PluginFlv = "plugin:flv",
2413
+ PluginMp4 = "plugin:mp4",
2414
+ PluginHls = "plugin:hls",
2415
+ PluginShaka = "plugin:shaka",
2416
+ PluginRtm = "plugin:rtm",
2417
+ PluginXgvideo = "plugin:xgvideo"
2418
+ }
2419
+ type ModulesMap = {
2420
+ [DynamicModule.BizVod]: Exports;
2421
+ [DynamicModule.BizLive]: Exports;
2422
+ [DynamicModule.PluginFlv]: Exports;
2423
+ [DynamicModule.PluginMp4]: Exports;
2424
+ [DynamicModule.PluginHls]: Exports;
2425
+ [DynamicModule.PluginShaka]: Exports;
2426
+ [DynamicModule.PluginRtm]: Exports;
2427
+ [DynamicModule.PluginXgvideo]: Exports;
2428
+ };
2429
+ class Loader {
2430
+ readonly modules: Record<string, Module>;
2431
+ readonly mountPromiseMap: Record<string, Promise<Exports>>;
2432
+ private _baseUrl;
2433
+ private _moduleSystem?;
2434
+ constructor(options: LoaderOptions);
2435
+ get baseUrl(): string;
2436
+ get moduleSystem(): ModuleSystem | undefined;
2437
+ setModuleSystem(moduleSystem: ModuleSystem): void;
2438
+ setBaseUrl(url: string): void;
2439
+ load: <T extends DynamicModule>(name: T, src?: string) => Promise<ModulesMap[T]>;
2440
+ register: (name: string, exports: Exports) => Exports;
2441
+ private _mount;
2442
+ }
2443
+ const register: (name: string, exports: {
2444
+ [x: string]: any;
2445
+ }) => {
2446
+ [x: string]: any;
2447
+ };
2448
+ function setModuleSystem(moduleSystem: ModuleSystem): void;
2449
+ function setBaseUrl(url: string): void;
2450
+ function getBaseUrl(): string;
2451
+ function load<T extends DynamicModule>(name: T, src?: string): Promise<ModulesMap[T]>;
2452
+ const isHls: (url: string) => boolean;
2453
+ const isMp4: (url: string) => boolean;
2454
+ const isFlv: (url: string) => boolean;
2455
+ const isRtm: (url: string) => boolean;
2456
+ const isDash: (url: string) => boolean;
2457
+ function getStreamType(url: string): "unknown" | "hls" | "flv" | "rtm" | "mp4" | "dash";
2458
+ function isMseSupported(codec?: Codec): any;
2459
+ function isSoftDecodeSupported(): Promise<any>;
2460
+ const util: {
2461
+ getStreamType: typeof getStreamType;
2462
+ isMseSupported: typeof isMseSupported;
2463
+ isSoftDecodeSupported: typeof isSoftDecodeSupported;
2464
+ createDom(el?: string | undefined, tpl?: string | undefined, attrs?: {
2465
+ [propName: string]: any;
2466
+ } | undefined, cname?: string | undefined): HTMLElement;
2467
+ createDomFromHtml(html: string, attrs?: string | undefined, classname?: string | undefined): HTMLElement;
2468
+ hasClass(el: HTMLElement, className: string): boolean;
2469
+ addClass(el: HTMLElement, className: string): void;
2470
+ removeClass(el: HTMLElement, className: string): void;
2471
+ toggleClass(el: HTMLElement, className: string): void;
2472
+ classNames(...args: any[]): string;
2473
+ findDom(el: HTMLElement, sel: string): HTMLElement;
2474
+ getCss(dom: HTMLElement, key: string): any;
2475
+ padStart(str: any, length: any, pad: any): string;
2476
+ format(time: number): string;
2477
+ event(e: any): any;
2478
+ typeOf(obj: any): string;
2479
+ deepCopy(dst: any, src: any): any;
2480
+ deepMerge(dst: any, src: any): any;
2481
+ getBgImage(el: any): string;
2482
+ copyDom(dom: HTMLElement): HTMLElement;
2483
+ setInterval(context: any, eventName: string, intervalFunc: Function, frequency: number): void;
2484
+ clearInterval(context: any, eventName: string): void;
2485
+ setTimeout(context: any, fun: Function, time: number): number;
2486
+ clearTimeout(context: any, id: number): void;
2487
+ clearAllTimers(context: any): void;
2488
+ createImgBtn(name: string, imgUrl: string, width?: number | undefined, height?: number | undefined): HTMLElement;
2489
+ Hex2RGBA(hex: string, alpha: string | number): string;
2490
+ getFullScreenEl(): HTMLElement;
2491
+ checkIsFunction(fun: any): boolean;
2492
+ checkIsObject(obj: any): boolean;
2493
+ hide(dom: any): void;
2494
+ show(dom: any, display: any): void;
2495
+ isUndefined(val: any): boolean;
2496
+ isNotNull(val: any): boolean;
2497
+ setStyleFromCsstext(dom: HTMLElement, text?: string | undefined): void;
2498
+ filterStyleFromText(dom: HTMLElement, list?: string[] | undefined): {} | {
2499
+ [propName: string]: any;
2500
+ };
2501
+ getStyleFromCsstext(dom: HTMLElement): {} | {
2502
+ [propName: string]: any;
2503
+ };
2504
+ preloadImg(url: any, onload?: (() => void) | undefined, onerror?: (() => void) | undefined): void;
2505
+ stopPropagation(e: any): void;
2506
+ scrollTop(): number;
2507
+ scrollLeft(): number;
2508
+ checkTouchSupport(): boolean;
2509
+ getBuffered2(vbuffered: any, maxHoleDuration?: number | undefined): import("xgplayer/es/utils/xgplayerTimeRange").default;
2510
+ getEventPos(e: Events, zoom?: number | undefined): {
2511
+ x: number;
2512
+ y: number;
2513
+ clientX: number;
2514
+ clientY: number;
2515
+ offsetX: number;
2516
+ offsetY: number;
2517
+ pageX: number;
2518
+ pageY: number;
2519
+ };
2520
+ requestAnimationFrame(callback: any): any;
2521
+ getHostFromUrl(url: any): string;
2522
+ cancelAnimationFrame(frameId: any): void;
2523
+ isMSE(video: HTMLElement | HTMLVideoElement | HTMLAudioElement): boolean;
2524
+ generateSessionId(did?: number | undefined): string;
2525
+ createEvent(eventName: any): Event;
2526
+ adjustTimeByDuration(time: number, duration: number, isEnded: boolean): number;
2527
+ createPositionBar(className: any, root: any): HTMLElement;
2528
+ getTransformStyle(pos?: {
2529
+ x: number;
2530
+ y: number;
2531
+ scale: number;
2532
+ rotate: number;
2533
+ } | undefined): string;
2534
+ convertDeg(val: number): number;
2535
+ };
2536
+ enum Level {
2537
+ Fatal = "Fatal",
2538
+ Error = "Error"
2539
+ }
2540
+ enum ErrorCode {
2541
+ MANIFEST_HLS_ERROR = 1100,
2542
+ MANIFEST_DASH_ERROR = 1200,
2543
+ NETWORK = 2100,
2544
+ NETWORK_TIMEOUT = 2101,
2545
+ NETWORK_FORBIDDEN = 2103,
2546
+ NETWORK_NOTFOUND = 2104,
2547
+ NETWORK_RANGE_NOT_SATISFIABLE = 2116,
2548
+ DEMUX_FLV_ERROR = 3100,
2549
+ DEMUX_HLS_ERROR = 3200,
2550
+ DEMUX_MP4_ERROR = 3300,
2551
+ DEMUX_FMP4_ERROR = 3400,
2552
+ DEMUX_SIDX_ERROR = 3410,
2553
+ REMUX_FMP4_ERROR = 4100,
2554
+ REMUX_MP4_ERROR = 4200,
2555
+ MEDIA_ERR_ABORTED = 5101,
2556
+ MEDIA_ERR_NETWORK = 5102,
2557
+ MEDIA_ERR_DECODE = 5103,
2558
+ MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
2559
+ MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
2560
+ MEDIA_ERR_URL_EMPTY = 5106,
2561
+ MEDIA_MSE_ADD_SB = 5200,
2562
+ MEDIA_MSE_APPEND_BUFFER = 5201,
2563
+ MEDIA_MSE_OTHER = 5202,
2564
+ MEDIA_MSE_FULL = 5203,
2565
+ MEDIA_MSE_HIJACK = 5204,
2566
+ MEDIA_EME_HIJACK = 5301,
2567
+ DRM_LICENSE = 7100,
2568
+ DRM_CUSTOM_LICENSE = 7200,
2569
+ OTHER = 8000,
2570
+ RUNTIME_NO_CANPLAY_ERROR = 9001,
2571
+ RUNTIME_BUFFERBREAK_ERROR = 9002,
2572
+ RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
2573
+ // veplayer 报错
2574
+ MODULE_LOAD_ERROR = 100,
2575
+ UNKNOWN = "UNKNOWN"
2576
+ }
2577
+ enum ErrorType {
2578
+ MANIFEST = "manifest",
2579
+ NETWORK = "network",
2580
+ DEMUX = "demux",
2581
+ REMUX = "remux",
2582
+ MEDIA = "media",
2583
+ DRM = "drm",
2584
+ OTHER = "other",
2585
+ RUNTIME = "runtime"
2586
+ }
2587
+ interface ErrorInfo<T = TextKey> {
2588
+ errorCode?: ErrorCode;
2589
+ message?: string;
2590
+ messageTextKey?: T;
2591
+ level?: Level;
2592
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2593
+ ext?: any;
2594
+ error?: Error;
2595
+ }
2596
+ // 参考: https://bytedance.feishu.cn/docx/doxcnGPXIOrJk3dGE3E3YghgZke
2597
+ const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
2598
+ const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
2599
+ class VeError<T extends string = TextKey> extends Error {
2600
+ readonly errorCode: ErrorCode;
2601
+ readonly level?: Level;
2602
+ readonly ext?: any;
2603
+ constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
2604
+ }
2605
+ function create(errorCode: ErrorCode, info?: ErrorInfo, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
2606
+ function transform(xgErr: XGError, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
2607
+ type Text = string | Record<Lang, string>;
2608
+ type Config$1 = {
2609
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2610
+ [key: string]: any;
2611
+ showErrorImg: boolean;
2612
+ showErrorTip: boolean;
2613
+ showRefresh: boolean;
2614
+ errorTipsText: Text;
2615
+ extraTips: {
2616
+ label: Text;
2617
+ value: Text;
2618
+ }[];
2619
+ };
2620
+ class Error extends Plugin {
2621
+ player: Player$0;
2622
+ icons: {
2623
+ error: HTMLElement;
2624
+ };
2625
+ langText: {
2626
+ refresh: string;
2627
+ errorTip: string;
2628
+ };
2629
+ config: Config$1;
2630
+ private _error?;
2631
+ static get pluginName(): string;
2632
+ static get defaultConfig(): Config$1;
2633
+ get _errorTip(): string;
2634
+ afterCreate(): void;
2635
+ registerIcons(): {
2636
+ error: {
2637
+ icon: any;
2638
+ class: string;
2639
+ };
2640
+ };
2641
+ updateLang(): void;
2642
+ showError(error: VeError | XGError): void;
2643
+ hideError(): void;
2644
+ destroy(): void;
2645
+ render(): string;
2646
+ private _focus;
2647
+ private _initIcons;
2648
+ private _initEvents;
2649
+ private _renderText;
2650
+ private _renderExtraTips;
2651
+ private _handleRefresh;
2652
+ private _renderRefresh;
2653
+ }
2654
+ type ToastOption = {
2655
+ duration?: number;
2656
+ closable?: boolean;
2657
+ };
2658
+ class Toast extends Plugin {
2659
+ private _toastNumber;
2660
+ private _toastMap;
2661
+ static get pluginName(): string;
2662
+ static get defaultConfig(): {
2663
+ index: number;
2664
+ };
2665
+ toast(content: string | HTMLElement, options?: ToastOption): number;
2666
+ remove(id: number): void;
2667
+ render(): string;
2668
+ private _renderToast;
2669
+ }
2670
+ class Sources extends OptionsIcon {
2671
+ static get pluginName(): string;
2672
+ static get defaultConfig(): {
2673
+ index: number;
2674
+ panel: {
2675
+ title: {
2676
+ jp: string;
2677
+ en: string;
2678
+ "zh-cn": string;
2679
+ "zh-hk": string;
2680
+ };
2681
+ };
2682
+ list: never[];
2683
+ className: string;
2684
+ hidePortrait: boolean;
2685
+ isShowIcon: boolean;
2686
+ isItemClickHide?: boolean | undefined;
2687
+ listType?: ListTypeOption | undefined;
2688
+ renderType?: RenderType | undefined;
2689
+ hideOnSingleOption?: boolean | undefined;
2690
+ isAutoChange?: boolean | undefined;
2691
+ };
2692
+ static get textTips(): {
2693
+ jp: string;
2694
+ en: string;
2695
+ "zh-cn": string;
2696
+ "zh-hk": string;
2697
+ };
2698
+ updateLang(): void;
2699
+ beforeCreate(args: XGPluginOptions): void;
2700
+ afterCreate(): void;
2701
+ registerIcons(): {
2702
+ source: {
2703
+ icon: any;
2704
+ };
2705
+ };
2706
+ renderItemList(): void;
2707
+ onItemClick(_: never, data: {
2708
+ to: Source;
2709
+ }): void;
2710
+ }
2711
+ class DefinitionPlugin extends OptionsIcon {
2712
+ langText: Record<string, string>;
2713
+ private _waitingStartTime;
2714
+ private _timer?;
2715
+ private _toastId?;
2716
+ static get pluginName(): string;
2717
+ static get defaultConfig(): {
2718
+ index: number;
2719
+ list: never[];
2720
+ panel: {
2721
+ title: {
2722
+ jp: string;
2723
+ en: string;
2724
+ "zh-cn": string;
2725
+ "zh-hk": string;
2726
+ };
2727
+ };
2728
+ className: string;
2729
+ hidePortrait: boolean;
2730
+ isShowIcon: boolean;
2731
+ longWaitingTime: number;
2732
+ needFallback: boolean;
2733
+ demotePriority: string[];
2734
+ isItemClickHide?: boolean | undefined;
2735
+ listType?: ListTypeOption | undefined;
2736
+ renderType?: RenderType | undefined;
2737
+ hideOnSingleOption?: boolean | undefined;
2738
+ isAutoChange?: boolean | undefined;
2739
+ };
2740
+ static get textTips(): {
2741
+ jp: string;
2742
+ en: string;
2743
+ "zh-cn": string;
2744
+ "zh-hk": string;
2745
+ };
2746
+ updateLang(): void;
2747
+ beforeCreate(args: XGPluginOptions): void;
2748
+ afterCreate(): void;
2749
+ registerIcons(): {
2750
+ source: {
2751
+ icon: any;
2752
+ };
2753
+ };
2754
+ renderItemList(): void;
2755
+ onItemClick(_: never, data: {
2756
+ to: Definition;
2757
+ }): void;
2758
+ fallback(options?: {
2759
+ toast: boolean;
2760
+ }): Promise<void>;
2761
+ private _waiting;
2762
+ private _clearTimer;
2763
+ private _toast;
2764
+ private _getNextDefinition;
2765
+ private _initTimeUpdateEvent;
2766
+ private _showToast;
2767
+ }
2768
+ interface IAutoplayPluginConfig {
2769
+ position?: string;
2770
+ // 有声音自动播放失败时是否降级成静音自动播放
2771
+ enableDegradeMuteAutoplay?: boolean;
2772
+ // 启用微信jsBridge方式的自动播放
2773
+ enableWxJsBridgeAutoplay?: boolean;
2774
+ // 用户触发自动播放的目标dom
2775
+ userActionDom?: Node;
2776
+ // 开启任意点击/触摸的用户行为触发自动播放
2777
+ enableUserActionAutoplay?: boolean;
2778
+ }
2779
+ class Autoplay extends Plugin {
2780
+ config: IAutoplayPluginConfig;
2781
+ private _hasSetUserAutoplay?;
2782
+ private _timer?;
2783
+ private _wxTimer?;
2784
+ private _state;
2785
+ constructor(args: any);
2786
+ // 插件的名称,将作为插件实例的唯一key值
2787
+ static get pluginName(): string;
2788
+ static get defaultConfig(): IAutoplayPluginConfig;
2789
+ afterCreate(): void;
2790
+ updateLang(): void;
2791
+ initState(): void;
2792
+ initEvents(): void;
2793
+ setWXAutoPlay(): void;
2794
+ wxCanPlayFn(): void;
2795
+ wxPlay(): void;
2796
+ userClickPlay: () => void;
2797
+ setUserActionAutoPlay(): void;
2798
+ // 自动播放失败事件回调
2799
+ handleAutoplayPrevented(): void;
2800
+ changeMuteMode(): void;
2801
+ // 自动播放成功事件回调
2802
+ handleAutoplayStart(): void;
2803
+ // 有音量修改,取消静音
2804
+ handleVolumechange(): void;
2805
+ renderUnmuteBt(): void;
2806
+ cancelUnmute(): void;
2807
+ destroy(): void;
2808
+ render(): string;
2809
+ }
2810
+ const DEFAULT_PC_PLUGINS: (typeof Error | typeof Toast | typeof Sources | typeof DefinitionPlugin | typeof Autoplay | typeof TopRightBar | typeof Play | typeof FullScreen | typeof Volume | typeof MiniScreen | typeof PIPIcon | typeof Poster | typeof Start | typeof Loading | typeof Enter | typeof Keyboard | typeof PC)[];
2811
+ const DEFAULT_MOBILE_PLUGINS: (typeof Error | typeof Toast | typeof Sources | typeof DefinitionPlugin | typeof Autoplay | typeof TopRightBar | typeof Play | typeof FullScreen | typeof Volume | typeof MiniScreen | typeof PIPIcon | typeof Poster | typeof Start | typeof Loading | typeof Enter | typeof Mobile)[];
2812
+ const DEFAULT_PLUGINS: (typeof Error | typeof Toast | typeof Sources | typeof DefinitionPlugin | typeof Autoplay | typeof TopRightBar | typeof Play | typeof FullScreen | typeof Volume | typeof MiniScreen | typeof PIPIcon | typeof Poster | typeof Start | typeof Loading | typeof Enter | typeof Keyboard | typeof PC)[] | (typeof Error | typeof Toast | typeof Sources | typeof DefinitionPlugin | typeof Autoplay | typeof TopRightBar | typeof Play | typeof FullScreen | typeof Volume | typeof MiniScreen | typeof PIPIcon | typeof Poster | typeof Start | typeof Loading | typeof Enter | typeof Mobile)[];
2813
+ interface Options$0 {
2814
+ url?: string;
2815
+ defaultDefinition?: string;
2816
+ defaultSource?: string;
2817
+ sources: Source[];
2818
+ maxFallbackRound?: number;
2819
+ }
2820
+ type Url = string;
2821
+ const DEFINITION_CHANGE_ACTION = "change_definition";
2822
+ class SourceManager {
2823
+ readonly defaultSource?: string;
2824
+ readonly defaultDefinition?: string;
2825
+ readonly maxFallbackRound: number;
2826
+ private _prepareList;
2827
+ private _currentDefinition;
2828
+ private _sources;
2829
+ private _fallbackCount;
2830
+ constructor(options: Options$0);
2831
+ get sources(): Source[];
2832
+ get definition(): Definition;
2833
+ get source(): Source;
2834
+ get url(): string;
2835
+ /**
2836
+ * 以给定的参数搜索源和对应清晰度。`source` 和 `definition`
2837
+ * 都是可选的,当未指定时,使用当前的 {@link SourceManager.source}
2838
+ * 或 {@link SourceManager.definition}。
2839
+ *
2840
+ * 如果没有搜索到结果,返回 `undefined`。
2841
+ */
2842
+ find(target: Url | {
2843
+ definition?: string;
2844
+ source?: string;
2845
+ }, options?: {
2846
+ fallbackToFirstDefinition?: boolean;
2847
+ }): (Definition & {
2848
+ source: Source;
2849
+ }) | undefined;
2850
+ fallback(): string | undefined;
2851
+ /**
2852
+ * 切换到目标源或者清晰度。参数和 {@link SourceManager.find}
2853
+ * 一致,使用 {@link SourceManager.find}
2854
+ * 方法进行搜索,如果搜索结果不为空,则切换搜索结果。
2855
+ *
2856
+ * 如果没有搜索到结果则会报错。
2857
+ */
2858
+ switch(target: Definition): Definition;
2859
+ updateSources(sources: ExposedSource[] | string, target?: string | {
2860
+ definition?: string;
2861
+ source?: string;
2862
+ }): this;
2863
+ registerPrepare(prepare: (url: Url) => Promise<Plugin[]>): void;
2864
+ prepare(url: Url): Promise<void>;
2865
+ resetFallback(): void;
2866
+ }
2867
+ const EN$0: {
2868
+ INVALID_PARAMETER: string;
2869
+ FORMAT: string;
2870
+ FPS: string;
2871
+ BITRATE: string;
2872
+ GOP: string;
2873
+ RESOLUTION: string;
2874
+ ENCODE_TYPE: string;
2875
+ BUFFER_END: string;
2876
+ CURRENT_TIME: string;
2877
+ DECODE_EFFICIENCY: string;
2878
+ DECODE_COST: string;
2879
+ DECODE_INFO: string;
2880
+ REFRESH: string;
2881
+ DEFINITION_FALLBACK_TOAST: string;
2882
+ DEFINITION_SWITCHING: string;
2883
+ ERROR_REFRESH: string;
2884
+ UNMUTE: string;
2885
+ MANIFEST: string;
2886
+ NETWORK: string;
2887
+ NETWORK_TIMEOUT: string;
2888
+ NETWORK_FORBIDDEN: string;
2889
+ NETWORK_NOTFOUND: string;
2890
+ DEMUX: string;
2891
+ REMUX: string;
2892
+ MEDIA: string;
2893
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
2894
+ MEDIA_ERR_URL_EMPTY: string;
2895
+ DRM: string;
2896
+ OTHER: string;
2897
+ RUNTIME: string;
2898
+ MODULE_LOAD_ERROR: string;
2899
+ UNKNOWN: string;
2900
+ ERROR_TYPES: typeof XG_EN.default.TEXT.ERROR_TYPES;
2901
+ HAVE_NOTHING: string;
2902
+ HAVE_METADATA: string;
2903
+ HAVE_CURRENT_DATA: string;
2904
+ HAVE_FUTURE_DATA: string;
2905
+ HAVE_ENOUGH_DATA: string;
2906
+ NETWORK_EMPTY: string;
2907
+ NETWORK_IDLE: string;
2908
+ NETWORK_LOADING: string;
2909
+ NETWORK_NO_SOURCE: string;
2910
+ MEDIA_ERR_ABORTED: string;
2911
+ MEDIA_ERR_NETWORK: string;
2912
+ MEDIA_ERR_DECODE: string;
2913
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
2914
+ REPLAY: string;
2915
+ ERROR: string;
2916
+ PLAY_TIPS: string;
2917
+ PAUSE_TIPS: string;
2918
+ PLAYNEXT_TIPS: string;
2919
+ DOWNLOAD_TIPS: string;
2920
+ ROTATE_TIPS: string;
2921
+ RELOAD_TIPS: string;
2922
+ FULLSCREEN_TIPS: string;
2923
+ EXITFULLSCREEN_TIPS: string;
2924
+ CSSFULLSCREEN_TIPS: string;
2925
+ EXITCSSFULLSCREEN_TIPS: string;
2926
+ TEXTTRACK: string;
2927
+ PIP: string;
2928
+ SCREENSHOT: string;
2929
+ LIVE: string;
2930
+ OFF: string;
2931
+ OPEN: string;
2932
+ MINI_DRAG: string;
2933
+ MINISCREEN: string;
2934
+ REFRESH_TIPS: string;
2935
+ FORWARD: string;
2936
+ LIVE_TIP: string;
2937
+ };
2938
+ const ZH_CN$0: {
2939
+ INVALID_PARAMETER: string;
2940
+ FORMAT: string;
2941
+ FPS: string;
2942
+ BITRATE: string;
2943
+ GOP: string;
2944
+ RESOLUTION: string;
2945
+ ENCODE_TYPE: string;
2946
+ BUFFER_END: string;
2947
+ CURRENT_TIME: string;
2948
+ DECODE_EFFICIENCY: string;
2949
+ DECODE_COST: string;
2950
+ DECODE_INFO: string;
2951
+ REFRESH: string;
2952
+ DEFINITION_FALLBACK_TOAST: string;
2953
+ DEFINITION_SWITCHING: string;
2954
+ ERROR_REFRESH: string;
2955
+ UNMUTE: string;
2956
+ MANIFEST: string;
2957
+ NETWORK: string;
2958
+ NETWORK_TIMEOUT: string;
2959
+ NETWORK_FORBIDDEN: string;
2960
+ NETWORK_NOTFOUND: string;
2961
+ DEMUX: string;
2962
+ REMUX: string;
2963
+ MEDIA: string;
2964
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
2965
+ MEDIA_ERR_URL_EMPTY: string;
2966
+ DRM: string;
2967
+ OTHER: string;
2968
+ RUNTIME: string;
2969
+ MODULE_LOAD_ERROR: string;
2970
+ UNKNOWN: string;
2971
+ ERROR_TYPES: typeof XG_ZH.default.TEXT.ERROR_TYPES;
2972
+ HAVE_NOTHING: string;
2973
+ HAVE_METADATA: string;
2974
+ HAVE_CURRENT_DATA: string;
2975
+ HAVE_FUTURE_DATA: string;
2976
+ HAVE_ENOUGH_DATA: string;
2977
+ NETWORK_EMPTY: string;
2978
+ NETWORK_IDLE: string;
2979
+ NETWORK_LOADING: string;
2980
+ NETWORK_NO_SOURCE: string;
2981
+ MEDIA_ERR_ABORTED: string;
2982
+ MEDIA_ERR_NETWORK: string;
2983
+ MEDIA_ERR_DECODE: string;
2984
+ MEDIA_ERR_SRC_NOT_SUPPORTED: string;
2985
+ REPLAY: string;
2986
+ ERROR: string;
2987
+ PLAY_TIPS: string;
2988
+ PAUSE_TIPS: string;
2989
+ PLAYNEXT_TIPS: string;
2990
+ DOWNLOAD_TIPS: string;
2991
+ ROTATE_TIPS: string;
2992
+ RELOAD_TIPS: string;
2993
+ FULLSCREEN_TIPS: string;
2994
+ EXITFULLSCREEN_TIPS: string;
2995
+ CSSFULLSCREEN_TIPS: string;
2996
+ EXITCSSFULLSCREEN_TIPS: string;
2997
+ TEXTTRACK: string;
2998
+ PIP: string;
2999
+ SCREENSHOT: string;
3000
+ LIVE: string;
3001
+ OFF: string;
3002
+ OPEN: string;
3003
+ MINI_DRAG: string;
3004
+ MINISCREEN: string;
3005
+ REFRESH_TIPS: string;
3006
+ FORWARD: string;
3007
+ LIVE_TIP: string;
3008
+ };
3009
+ type TextKey$0 = keyof typeof EN$0;
3010
+ const VeError$0: typeof error.VeError;
3011
+ enum LiveErrorCode {
3012
+ INVALID_PARAMETER = 200
3013
+ }
3014
+ const Level$0: typeof error.Level;
3015
+ type ErrorInfo$0 = error.ErrorInfo;
3016
+ type VeError$1 = error.VeError;
3017
+ const ErrorCode$0: {
3018
+ [x: number]: string;
3019
+ MANIFEST_HLS_ERROR: error.ErrorCode.MANIFEST_HLS_ERROR;
3020
+ MANIFEST_DASH_ERROR: error.ErrorCode.MANIFEST_DASH_ERROR;
3021
+ NETWORK: error.ErrorCode.NETWORK;
3022
+ NETWORK_TIMEOUT: error.ErrorCode.NETWORK_TIMEOUT;
3023
+ NETWORK_FORBIDDEN: error.ErrorCode.NETWORK_FORBIDDEN;
3024
+ NETWORK_NOTFOUND: error.ErrorCode.NETWORK_NOTFOUND;
3025
+ NETWORK_RANGE_NOT_SATISFIABLE: error.ErrorCode.NETWORK_RANGE_NOT_SATISFIABLE;
3026
+ DEMUX_FLV_ERROR: error.ErrorCode.DEMUX_FLV_ERROR;
3027
+ DEMUX_HLS_ERROR: error.ErrorCode.DEMUX_HLS_ERROR;
3028
+ DEMUX_MP4_ERROR: error.ErrorCode.DEMUX_MP4_ERROR;
3029
+ DEMUX_FMP4_ERROR: error.ErrorCode.DEMUX_FMP4_ERROR;
3030
+ DEMUX_SIDX_ERROR: error.ErrorCode.DEMUX_SIDX_ERROR;
3031
+ REMUX_FMP4_ERROR: error.ErrorCode.REMUX_FMP4_ERROR;
3032
+ REMUX_MP4_ERROR: error.ErrorCode.REMUX_MP4_ERROR;
3033
+ MEDIA_ERR_ABORTED: error.ErrorCode.MEDIA_ERR_ABORTED;
3034
+ MEDIA_ERR_NETWORK: error.ErrorCode.MEDIA_ERR_NETWORK;
3035
+ MEDIA_ERR_DECODE: error.ErrorCode.MEDIA_ERR_DECODE;
3036
+ MEDIA_ERR_SRC_NOT_SUPPORTED: error.ErrorCode.MEDIA_ERR_SRC_NOT_SUPPORTED;
3037
+ MEDIA_ERR_CODEC_NOT_SUPPORTED: error.ErrorCode.MEDIA_ERR_CODEC_NOT_SUPPORTED;
3038
+ MEDIA_ERR_URL_EMPTY: error.ErrorCode.MEDIA_ERR_URL_EMPTY;
3039
+ MEDIA_MSE_ADD_SB: error.ErrorCode.MEDIA_MSE_ADD_SB;
3040
+ MEDIA_MSE_APPEND_BUFFER: error.ErrorCode.MEDIA_MSE_APPEND_BUFFER;
3041
+ MEDIA_MSE_OTHER: error.ErrorCode.MEDIA_MSE_OTHER;
3042
+ MEDIA_MSE_FULL: error.ErrorCode.MEDIA_MSE_FULL;
3043
+ MEDIA_MSE_HIJACK: error.ErrorCode.MEDIA_MSE_HIJACK;
3044
+ MEDIA_EME_HIJACK: error.ErrorCode.MEDIA_EME_HIJACK;
3045
+ DRM_LICENSE: error.ErrorCode.DRM_LICENSE;
3046
+ DRM_CUSTOM_LICENSE: error.ErrorCode.DRM_CUSTOM_LICENSE;
3047
+ OTHER: error.ErrorCode.OTHER;
3048
+ RUNTIME_NO_CANPLAY_ERROR: error.ErrorCode.RUNTIME_NO_CANPLAY_ERROR;
3049
+ RUNTIME_BUFFERBREAK_ERROR: error.ErrorCode.RUNTIME_BUFFERBREAK_ERROR;
3050
+ RUNTIME_BWAITING_TIMEOUT_ERROR: error.ErrorCode.RUNTIME_BUFFERBREAK_ERROR;
3051
+ MODULE_LOAD_ERROR: error.ErrorCode.MODULE_LOAD_ERROR;
3052
+ UNKNOWN: error.ErrorCode.UNKNOWN;
3053
+ INVALID_PARAMETER: LiveErrorCode.INVALID_PARAMETER;
3054
+ };
3055
+ type ValueOf<T> = T[keyof T];
3056
+ const ERRORS: Partial<Record<ValueOf<typeof ErrorCode$0>, error.ErrorInfo<TextKey$0>>>;
3057
+ function create$0(errorCode: ValueOf<typeof ErrorCode$0>, i18n?: VeI18n<TextKey$0>): error.VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP" | "GOP" | "INVALID_PARAMETER" | "FORMAT" | "FPS" | "BITRATE" | "RESOLUTION" | "ENCODE_TYPE" | "BUFFER_END" | "CURRENT_TIME" | "DECODE_EFFICIENCY" | "DECODE_COST" | "DECODE_INFO">;
3058
+ interface LiveVePlayerOptions extends VePlayerBaseOptions {
3059
+ rtm?: {
3060
+ fallbackUrl: string;
3061
+ };
3062
+ }
3063
+ class VePlayerLive extends VePlayerBase {
3064
+ openLog(): void;
3065
+ closeLog(): void;
3066
+ openInfoPanel(): void;
3067
+ closeInfoPanel(): void;
3068
+ }
3069
+ function createLivePlayer(options?: LiveVePlayerOptions): Promise<VePlayerLive>;
3070
+ }
3071
+ export { Codec, DecodeType, Degradation, DynamicModule, RTMCodec, Plugin, ExposedSource, util, register, createLivePlayer, isMseSupported, isSoftDecodeSupported, isRTMSupported, isRTMSupportCodec, load, POSITIONS, EN, ZH_CN, Sniffer, live };