@volcengine/veplayer 1.8.1 → 1.9.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -2,10 +2,9 @@ import VodLogger from '@byted/xgplayer-app-logger/es/logger.js';
2
2
  import VeStrategy from '@volcengine/vestrategy';
3
3
  import { StrategyRecommendation, VeStrategyInitOptions } from '@volcengine/vestrategy';
4
4
  import { VeStrategyH265Config } from '@volcengine/vestrategy-h265';
5
- import { Property } from 'dom-helpers/esm/types';
6
5
  import EventEmitter from 'eventemitter3';
7
6
  import Player from 'xgplayer';
8
- import { BasePlugin, Events as XgEvents, I18N, IXGI18nText, Plugin } from 'xgplayer';
7
+ import { BasePlugin, I18N, IXGI18nText, Plugin } from 'xgplayer';
9
8
 
10
9
  declare enum POSITIONS {
11
10
  ROOT = "root",
@@ -17,76 +16,83 @@ declare enum POSITIONS {
17
16
  CONTROLS_CENTER = "controlsCenter"
18
17
  }
19
18
  /**
20
- * @detail Options
21
- *
22
- *
23
- * @export
24
- * @interface ISdkErrorConfig
19
+ * @brief 发错错误时的UI表现配置
20
+ * @list Options
21
+ * @kind property
25
22
  */
26
23
  export interface ISdkErrorConfig {
27
- /**
28
- * 报错时是否显示提示图片
29
- * 默认:true
30
- *
31
- * @type {boolean}
32
- * @memberof ISdkErrorConfig
24
+ /** {zh}
25
+ * @brief 报错时是否显示提示图片
26
+ * @default true
33
27
  */
34
28
  errorImg?: boolean;
35
- /**
36
- * 报错时是否展示
37
- * 默认:true
38
- *
39
- * @type {boolean}
40
- * @memberof ISdkErrorConfig
29
+ /** {zh}
30
+ * @brief 报错时是否展示
31
+ * @default true
41
32
  */
42
33
  errorTips?: boolean;
43
- /**
44
- * 报错时是否展示“刷新”按钮
45
- * 默认:true
46
- *
47
- * @type {boolean}
48
- * @memberof ISdkErrorConfig
34
+ /** {zh}
35
+ * @brief 报错时是否展示“刷新”按钮
36
+ * @default ture
49
37
  */
50
38
  isNeedRefreshButton?: boolean;
51
- /**
52
- * 报错后是否进行降级,true则降级到playlist中相应 backUrlList字段(type为 rtm 不能设置true)
53
- * 默认:false
54
- *
55
- * @type {boolean}
56
- * @memberof ISdkErrorConfig
39
+ /** {zh}
40
+ * @brief 报错后是否进行降级,true则降级到playlist中相应 backUrlList字段(type为 rtm 不能设置true)
41
+ * @default false
42
+ * @hidden
57
43
  */
58
44
  isNeedDemoteBack?: boolean;
59
- /**
60
- *
61
- * 报错后重试次数
62
- * 默认: 1
63
- *
64
- * @type {number}
65
- * @memberof ISdkErrorConfig
45
+ /** {zh}
46
+ * @brief 报错后重试次数
47
+ * @default 1
66
48
  */
67
49
  retryLoopNum?: number;
68
- /**
69
- *
70
- * 报错后提示文案
71
- * 默认:播放发生错误,点击刷新试试吧
72
- *
73
- * @type {(HTMLElement | string)}
74
- * @memberof ISdkErrorConfig
50
+ /** {zh}
51
+ * @brief 报错后提示文案
52
+ * @default 播放发生错误,点击刷新试试吧
75
53
  */
76
- errorTipsText?: HTMLElement | string;
77
- /**
78
- * 播放器中所处的位置
54
+ /** {en}
55
+ * @brief Prompt copy after error
56
+ * @default An error occurred while playing, click refresh to try
57
+ */
58
+ errorTipsText?: TipsTextConfig;
59
+ /** {zh}
79
60
  * @hidden
80
- * @type {string}
81
- * @memberof ISdkErrorConfig
61
+ * @brief 播放器中所处的位置
82
62
  */
83
63
  position?: POSITIONS;
84
64
  }
85
65
  /**
86
- * @detail Options
87
- *
88
- *
89
- * @export
66
+ * @list Options
67
+ * @brief 错误文案配置
68
+ * @kind property
69
+ */
70
+ export interface TipsTextConfig {
71
+ /**
72
+ * @brief 中文错误文案
73
+ * @default 播放发生错误,点击刷新试试吧
74
+ */
75
+ zh?: HTMLElement | string;
76
+ /**
77
+ * @brief 英文错误文案
78
+ * @default An error occurred while playing, click refresh to try
79
+ */
80
+ en?: HTMLElement | string;
81
+ /**
82
+ * @brief 日文错误文案
83
+ * @default 再生中にエラーが発生しました。[更新]をクリックして試してください
84
+ */
85
+ jp?: HTMLElement | string;
86
+ /**
87
+ * @brief 香港繁体中文错误文案。
88
+ * @default 播放發生錯誤,點擊刷新試試吧
89
+ */
90
+ "zh-hk"?: HTMLElement | string;
91
+ }
92
+ /**
93
+ * @hidden
94
+ * @brief rtm配置
95
+ * @list Options
90
96
  * @interface IRtmConfig
91
97
  */
92
98
  export interface IRtmConfig {
@@ -140,87 +146,58 @@ export interface IRtmConfig {
140
146
  backupStreamType: "hls" | "flv";
141
147
  }
142
148
  /**
143
- * @detail Options
144
149
  * @brief 弹幕相关设置
145
- *
146
- * @export
147
- * @interface InitConfig
150
+ * @list Options
151
+ * @kind property
148
152
  */
149
- export interface InitConfig {
153
+ export interface IDanmuConfig {
150
154
  /**
151
- * 透明度, 枚举值[0, 33, 66, 99], 实际对应0, 0.33, 0.66, 1
152
- * 默认:99
153
- *
154
- * @type {number}
155
- * @memberof InitConfig
155
+ * @brief 透明度, 枚举值[0, 33, 66, 99], 实际对应0, 0.33, 0.66, 1
156
+ * @default 99
156
157
  */
157
158
  opacity?: number;
158
159
  /**
159
- * 枚举值[0, 33, 66, 99] 实际对应1/4, 1/2, 3/4, 1
160
- * 默认:99
161
- *
162
- * @type {number}
163
- * @memberof InitConfig
160
+ * @brief 枚举值[0, 33, 66, 99] 实际对应1/4, 1/2, 3/4, 1
161
+ * @default 99
164
162
  */
165
163
  area?: number;
166
164
  /**
167
- * 速度, 枚举值[0, 20, 40, 60, 80, 100], 实际对应1/4, 1/2,1,5/4,3/2,2
168
- * 默认:40
169
- *
170
- * @type {number}
171
- * @memberof InitConfig
165
+ * @brief 速度, 枚举值[0, 20, 40, 60, 80, 100], 实际对应1/4, 1/2,1,5/4,3/2,2
166
+ * @default 40
172
167
  */
173
168
  speed?: number;
174
169
  /**
175
- * 字体大小, 枚举值[0, 50, 100],实际对应14px 16px 20px
176
- * 默认:50
177
- *
178
- * @type {number}
179
- * @memberof InitConfig
170
+ * @brief 字体大小, 枚举值[0, 50, 100],实际对应14px 16px 20px
171
+ * @default 50
180
172
  */
181
173
  fontSize?: number;
182
174
  /**
183
- * 是否打开面板
184
- * 默认:false
185
- *
186
- * @type {boolean}
187
- * @memberof InitConfig
175
+ * @brief 是否打开面板
176
+ * @default false
188
177
  */
189
178
  active?: boolean;
190
179
  /**
191
- * 是否展示弹幕设置面板
192
- * 默认: true
193
- *
194
- * @type {boolean}
195
- * @memberof InitConfig
180
+ * @brief 是否展示弹幕设置面板
181
+ * @default true
196
182
  */
197
183
  usePanel?: boolean;
198
184
  /**
199
- * 弹幕列表
200
- *
201
- * @type {DanmuItem[]}
202
- * @memberof InitConfig
185
+ * @brief 弹幕列表
186
+ * @default -
203
187
  */
204
188
  danmuItems?: DanmuItem[];
205
189
  /**
206
190
  * @hidden
207
- *
208
191
  * @type {ExternalItem[]}
209
- * @memberof InitConfig
192
+ * @memberof IDanmuConfig
210
193
  */
211
194
  external?: ExternalItem[];
212
195
  /**
213
196
  * @hidden
214
- *
215
- * @type {IMaskConfig}
216
- * @memberof InitConfig
217
197
  */
218
198
  maskConfig?: IMaskConfig;
219
199
  /**
220
200
  * @hidden
221
- *
222
- * @type {boolean}
223
- * @memberof InitConfig
224
201
  */
225
202
  maskActive?: boolean;
226
203
  }
@@ -235,9 +212,9 @@ export interface Lang {
235
212
  [props: string]: string;
236
213
  }
237
214
  /**
238
- * @detail Options
239
- *
240
- *
215
+ * @brief 弹幕项配置
216
+ * @list Options
217
+ * @kind property
241
218
  * @export
242
219
  * @interface DanmuItem
243
220
  */
@@ -258,9 +235,7 @@ export interface DanmuItem {
258
235
  txt: string;
259
236
  /**
260
237
  * 弹幕出现时间, 单位为ms
261
- *
262
- * @type {number}
263
- * @memberof DanmuItem
238
+ * @default 0
264
239
  */
265
240
  start?: number;
266
241
  /**
@@ -272,6 +247,7 @@ export interface DanmuItem {
272
247
  prior?: boolean;
273
248
  /**
274
249
  * 弹幕持续显示时间, 单位为ms
250
+ * @default 5000
275
251
  *
276
252
  * @type {number}
277
253
  * @memberof DanmuItem
@@ -279,16 +255,18 @@ export interface DanmuItem {
279
255
  duration?: number;
280
256
  /**
281
257
  * 弹幕样式
258
+ * @example
259
+ * ``` javascript
282
260
  * style : {
283
261
  * color: '#ff9500',
284
262
  * fontSize: '20px',
285
263
  * padding: '2px 11px'
286
264
  * }
287
- *
265
+ *```
288
266
  * @type {Partial<Record<Property, string>>}
289
267
  * @memberof DanmuItem
290
268
  */
291
- style?: Partial<Record<Property, string>>;
269
+ style?: CSSStyleDeclaration;
292
270
  }
293
271
  export interface ExternalItem {
294
272
  key: string;
@@ -297,10 +275,9 @@ export interface ExternalItem {
297
275
  lang?: Lang;
298
276
  }
299
277
  /**
300
- * @detail Options
301
- *
302
- * @export
303
- * @interface ISubtitleConfig
278
+ * @brief 外挂字幕配置
279
+ * @list Options
280
+ * @kind property
304
281
  */
305
282
  export interface ISubtitleConfig {
306
283
  /**
@@ -309,192 +286,164 @@ export interface ISubtitleConfig {
309
286
  */
310
287
  [propName: string]: any;
311
288
  /**
312
- * 图标位置
313
- * 默认值:controlsRight
314
- * @type {string}
315
- * @memberof ISubtitleConfig
289
+ * @brief 图标位置
290
+ * @default controlsRight
316
291
  */
317
292
  position?: string;
318
293
  /**
319
- * 图标排列权重
320
- * 默认值:6
321
- * @type {number}
322
- * @memberof ISubtitleConfig
294
+ * @brief 图标排列权重
295
+ * @default 6
323
296
  */
324
297
  index?: number;
325
298
  /**
326
- * 字幕列表
327
- * 默认值:无
328
- * @type {Array<SubTitleItem>}
329
- * @memberof ISubtitleConfig
299
+ * @brief 字幕列表
300
+ * @default -
330
301
  */
331
302
  list?: Array<ISubTitleItem>;
332
303
  /**
333
- * 是否默认打开
334
- * 默认值:true
335
- * @type {boolean}
336
- * @memberof ISubtitleConfig
304
+ * @brief 是否默认打开
305
+ * @default true
337
306
  */
338
307
  isDefaultOpen?: boolean;
339
308
  /**
340
- * 是否显示图标
341
- * 默认值:true
342
- * @type {boolean}
343
- * @memberof ISubtitleConfig
309
+ * @brief 是否显示图标
310
+ * @default true
344
311
  */
345
312
  isShowIcon?: boolean;
346
313
  /**
347
- * 字幕渲染模式,外挂字幕或原生字幕
348
- * 默认值:external
349
- * @type {string}
350
- * @memberof ISubtitleConfig
314
+ * @brief 字幕渲染模式,外挂字幕或原生字幕
315
+ * @default external
351
316
  */
352
317
  mode?: "external" | "native";
353
318
  /**
354
- * 字幕更新模式,默认vod
355
- * 默认值:vod
356
- * @type {string}
357
- * @memberof ISubtitleConfig
319
+ * @brief 字幕更新模式,默认vod
320
+ * @default vod
358
321
  */
359
322
  updateMode?: "vod" | "live";
360
323
  /**
361
- * 字幕样式
362
- * 默认值:无
363
- * @type {ISubtitleStyle}
364
- * @memberof ISubtitleConfig
324
+ * @brief 字幕样式
325
+ * @default -
365
326
  */
366
327
  style?: ISubtitleStyle;
367
328
  }
368
329
  /**
369
- * @detail Options
370
- *
371
- * @export
372
- * @interface ISubtitleStyle
330
+ * @list Options
331
+ * @brief 字幕样式配置
332
+ * @kind property
373
333
  */
374
334
  export interface ISubtitleStyle {
375
335
  /**
376
336
  * 是否跟随控制栏调整位置
377
- * 默认值:true
337
+ * @default true
378
338
  * @type {boolean | null}
379
339
  * @memberof ISubtitleStyle
380
340
  */
381
341
  follow: boolean | null;
382
342
  /**
383
343
  * 字体显示模式,默认是描边
384
- * 默认值:'stroke'
344
+ * @default 'stroke'
385
345
  * @type {'stroke' | 'bg'}
386
346
  * @memberof ISubtitleStyle
387
347
  */
388
348
  mode?: "stroke" | "bg";
389
349
  /**
390
350
  * 跟随底部控制栏的高度
391
- * 默认值:50
351
+ * @default 50
392
352
  * @type {number}
393
353
  * @memberof ISubtitleStyle
394
354
  */
395
355
  followBottom?: number;
396
356
  /**
397
357
  * 是否跟随视频自动调整字号
398
- * 默认值:true
358
+ * @default true
399
359
  * @type {boolean}
400
360
  * @memberof ISubtitleStyle
401
361
  */
402
362
  fitVideo?: boolean;
403
363
  /**
404
364
  * 字幕距离画面底部百分比
405
- * 默认值:4
365
+ * @default 4
406
366
  * @type {number}
407
367
  * @memberof ISubtitleStyle
408
368
  */
409
369
  offsetBottom?: number;
410
370
  /**
411
371
  * 横屏视频适配基准字号
412
- * 默认值:49
372
+ * @default 49
413
373
  * @type {number}
414
374
  * @memberof ISubtitleStyle
415
375
  */
416
376
  baseSizeX?: number;
417
377
  /**
418
378
  * 竖屏视频适配基准字号
419
- * 默认值:28
379
+ * @default 28
420
380
  * @type {number}
421
381
  * @memberof ISubtitleStyle
422
382
  */
423
383
  baseSizeY?: number;
424
384
  /**
425
385
  * pc端最小字号
426
- * 默认值:16
386
+ * @default 16
427
387
  * @type {number}
428
388
  * @memberof ISubtitleStyle
429
389
  */
430
390
  minSize?: number;
431
391
  /**
432
392
  * 移动端最小字号
433
- * 默认值:13
393
+ * @default 13
434
394
  * @type {number}
435
395
  * @memberof ISubtitleStyle
436
396
  */
437
397
  minMobileSize?: number;
438
398
  /**
439
399
  * 最大显示行数
440
- * 默认值:'double'
400
+ * @default double
441
401
  * @type {'double' | 'single' | 'three'}
442
402
  * @memberof ISubtitleStyle
443
403
  */
444
404
  line?: "double" | "single" | "three";
445
405
  /**
446
406
  * 字体颜色, 16位颜色值或rgb值
447
- * 默认值:'#fff'
407
+ * @default #fff
448
408
  * @type {string}
449
409
  * @memberof ISubtitleStyle
450
410
  */
451
411
  fontColor?: string;
452
412
  }
453
413
  /**
454
- * @detail Options
455
- *
456
- * @export
457
- * @interface ISubTitleItem
414
+ * @list Options
415
+ * @brief 字幕项配置
416
+ * @kind property
458
417
  */
459
418
  export interface ISubTitleItem {
460
419
  /**
461
- * 字幕语言
462
- * 默认值:无
463
- * @type {string | number}
464
- * @memberof ISubTitleItem
420
+ * @brief 字幕语言
421
+ * @default -
465
422
  */
466
423
  language?: string | number;
467
424
  /**
468
- * 字幕id
469
- * 默认值:无
470
- * @type {string | number}
471
- * @memberof ISubTitleItem
425
+ * @brief 字幕id
426
+ * @default -
472
427
  */
473
428
  id?: number | string;
474
429
  /**
475
- * 是否是默认选择的字幕
476
- * 默认值:false
477
- * @type {boolean}
478
- * @memberof ISubTitleItem
430
+ * @brief 是否是默认选择的字幕
431
+ * @default false
479
432
  */
480
433
  isDefault?: boolean;
481
434
  /**
482
- * 字幕名称
483
- * 默认值:无
484
- * @type {any}
485
- * @memberof ISubTitleItem
435
+ * @brief 字幕名称
436
+ * @default -
486
437
  */
487
- text?: any;
438
+ text?: string;
488
439
  /**
489
- * 外挂字幕地址
490
- * 默认值:false
491
- * @type {string}
492
- * @memberof ISubTitleItem
440
+ * @brief 外挂字幕地址
441
+ * @default -
493
442
  */
494
443
  url?: string;
495
444
  /**
496
445
  * stringContent
497
- * 默认值:无
446
+ * @default 无
498
447
  * @hidden
499
448
  * @type {string}
500
449
  * @memberof ISubTitleItem
@@ -502,15 +451,16 @@ export interface ISubTitleItem {
502
451
  stringContent?: string;
503
452
  /**
504
453
  * 字幕内容列表,非url形式时使用
505
- * 默认值:无
454
+ * @default 无
506
455
  * @type {Array<Object>}
507
456
  * @memberof ISubTitleItem
508
457
  */
509
458
  list?: IListItem[];
510
459
  }
511
460
  /**
512
- * @detail Options
513
- *
461
+ * @brief 字幕内容项配置
462
+ * @list Options
463
+ * @kind property
514
464
  * @export
515
465
  * @interface IListItem
516
466
  */
@@ -531,21 +481,20 @@ export interface IListItem {
531
481
  */
532
482
  list: Array<ITextItem>;
533
483
  /**
534
- * 默认值:无
484
+ * @default 无
535
485
  * @hidden
536
486
  * @type {any}
537
487
  */
538
488
  [propName: string]: any;
539
489
  }
540
490
  /**
541
- * @detail Options
542
- *
543
- * @export
544
- * @interface ITextItem
491
+ * @breif 字幕文案配置
492
+ * @list Options
493
+ * @kind property
545
494
  */
546
495
  export interface ITextItem {
547
496
  /**
548
- * 默认值:无
497
+ * @default 无
549
498
  * @hidden
550
499
  * @type {any}
551
500
  */
@@ -572,8 +521,9 @@ export interface ITextItem {
572
521
  index?: number;
573
522
  }
574
523
  /**
575
- * @detail Options
576
- *
524
+ * @brief 清晰度自动降级配置
525
+ * @list Options
526
+ * @hidden
577
527
  *
578
528
  * @export
579
529
  * @interface IDefinitionDemotePlugin
@@ -622,38 +572,30 @@ export interface IDefinitionDemotePlugin {
622
572
  demotePriority?: string[];
623
573
  }
624
574
  /**
625
- * @detail Options
626
- * @brief 更多options
627
- * @id 2
628
- *
629
-
630
- /**
631
- * dash播放配置想
632
- *
633
- * @detail Options
634
- * @export
635
- * @interface IDashPluginConfig
575
+ * @brief DASH 播放配置项
576
+ * @list Options
577
+ * @kind property
636
578
  */
637
579
  export interface IDashPluginConfig {
638
580
  /**
639
- * 视频vid
640
- * 默认:无
641
- * 播放加密视频时必选
581
+ * @brief 视频vid
582
+ * @default -
583
+ * @notice 播放加密视频时必选
642
584
  */
643
585
  vid?: string;
644
586
  /**
645
- * 播放类型
646
- * 默认:`TOP`
647
- * 非必选
587
+ * @hidden
588
+ * @brief 播放类型
589
+ * @default TOP
648
590
  */
649
591
  playInfoType: "TOP";
650
592
  /**
651
- * 清晰度映射文案
652
- * 默认:无
653
- * 非必选
593
+ * @brief 清晰度映射文案
594
+ * @default -
654
595
  * @example
655
596
  * ``` javascript
656
- * { 360p: "流畅 360p",
597
+ * {
598
+ * 360p: "流畅 360p",
657
599
  * 480p: "清晰 480p",
658
600
  * 720p: "高清 720p",
659
601
  * 1080p: "超高清 1080p"
@@ -662,26 +604,19 @@ export interface IDashPluginConfig {
662
604
  */
663
605
  definitionText: Record<string, string>;
664
606
  /**
665
- * 默认清晰度
666
- * 默认:列表第一个
667
- * 非必选
668
- * @example
669
- * ``` javascript
670
- * { 360p: "流畅 360p",
671
- * 480p: "清晰 480p",
672
- * 720p: "高清 720p",
673
- * 1080p: "超高清 1080p"
674
- * }
675
- * ```
607
+ * @brief 默认清晰度
608
+ * @default 列表第一个
676
609
  */
677
610
  defaultDefinition?: string;
678
611
  /**
612
+ * @hidden
679
613
  * 获取证书地址
680
614
  * 默认:`//i.snssdk.com/video/drm/v1/play_licenses`
681
615
  * 播放加密视频时必选
682
616
  */
683
617
  getLicenseUrl?: string;
684
618
  /**
619
+ * @hidden
685
620
  * dash播放信息,由`Service.url`服务接口获取
686
621
  * 默认:无
687
622
  * 必选
@@ -690,17 +625,16 @@ export interface IDashPluginConfig {
690
625
  Data: any;
691
626
  };
692
627
  /**
693
- * 兜底的mp4播放列表,由`Service.url`服务接口获取
694
- * 默认:无
695
- * 非必选
628
+ * @brief 兜底的mp4播放列表,由`Service.url`服务接口获取
629
+ * @default -
630
+ * @hidden
696
631
  */
697
632
  mp4Opts: {
698
633
  mp4List: mp4OptsItem[];
699
634
  };
700
635
  /**
701
636
  * 预加载时间,单位ms
702
- * 默认:undefined
703
- * 非必选
637
+ * @default 50
704
638
  */
705
639
  preloadTime?: number;
706
640
  /**
@@ -728,11 +662,9 @@ export interface IDashPluginConfig {
728
662
  url_range_domains?: string[];
729
663
  }
730
664
  /**
731
- * dash播放的mp4兜底播放列表配置
732
- *
733
- * @detail Options
734
- * @export
735
- * @interface mp4OptsItem
665
+ * @brief dash播放的mp4兜底播放列表配置
666
+ * @list Options
667
+ * @hidden
736
668
  */
737
669
  export interface mp4OptsItem {
738
670
  /**
@@ -749,217 +681,207 @@ export interface mp4OptsItem {
749
681
  url: string;
750
682
  }
751
683
  /**
752
- * DASH播放配置
753
- *
754
- * @detail Options
755
- * @export
756
- * @interface IDashPluginConfig
684
+ * @brief HLS加密播放配置
685
+ * @list Options
686
+ * @kind property
757
687
  */
758
688
  export interface IEncryptHlsPluginConfig {
759
- /**
760
- * 播放地址请求域名
761
- * 默认:无
762
- * 必选
689
+ /** {zh}
690
+ * @brief 获取播放地址的请求域名。
691
+ * @default https://vod.volcengineapi.com
763
692
  */
764
- playDomain: string;
765
- /**
766
- * 请求类型,固定值 'TOP'
767
- * 默认: 无
693
+ /** {en}
694
+ * @brief Get the requested domain name of the playback address
695
+ * @default https://vod.byteplusapi.com
768
696
  */
769
- getKeyType: string;
697
+ playDomain?: string;
770
698
  /**
771
- * 密钥请求域名
772
- * 默认:无
773
- * 必选
699
+ * @hidden
700
+ * @brief 请求类型,固定值 'TOP'
701
+ * @default TOP
774
702
  */
775
- keyDomain: string;
703
+ getKeyType?: string;
776
704
  /**
777
- * 播放地址获取token,由服务端生成下发,详见{@link https://www.volcengine.com/docs/4/67350#%E4%B8%B4%E6%97%B6%E5%AE%89%E5%85%A8%E5%87%AD%E8%AF%81%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E 播放临时安全凭证(PlayAuthToken)}
778
- * 默认:无
779
- * 必选
705
+ * @hidden
706
+ * @brief 密钥请求域名
707
+ * @default https://vod.volcengineapi.com
780
708
  */
781
- playAuthToken: string;
709
+ keyDomain?: string;
782
710
  /**
783
- * 密钥获取token,由服务端生成下发,详见{@link https://www.volcengine.com/docs/4/65659#%E7%AD%BE%E5%8F%91-hls-%E6%A0%87%E5%87%86%E5%8A%A0%E5%AF%86-authtoken%EF%BC%88sha1hlsdrmauthtoken%EF%BC%89 签发 Hls 标准加密AuthToken}
784
- * 默认:无
785
- * 必选
711
+ * @brief 播放地址获取token,由服务端生成下发,详见{@link https://www.volcengine.com/docs/4/67350#%E4%B8%B4%E6%97%B6%E5%AE%89%E5%85%A8%E5%87%AD%E8%AF%81%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E 播放临时安全凭证(PlayAuthToken)}
712
+ * @default -
786
713
  */
787
- keyToken: string;
714
+ playAuthToken?: string;
788
715
  /**
789
- * hls加密播放地址
790
- * 默认:无
716
+ * @brief 密钥获取token,由服务端生成下发,详见{@link https://www.volcengine.com/docs/4/65659#%E7%AD%BE%E5%8F%91-hls-%E6%A0%87%E5%87%86%E5%8A%A0%E5%AF%86-authtoken%EF%BC%88sha1hlsdrmauthtoken%EF%BC%89 签发 Hls 标准加密AuthToken}
717
+ * @default -
791
718
  */
792
- url?: string;
719
+ keyToken: string;
793
720
  }
794
721
  /**
795
- * 质量日志配置
796
- *
797
- * @detail Options
798
- * @export
799
- * @interface IVodLogOptsConfig
722
+ * @brief 质量日志配置
723
+ * @list Options
724
+ * @kind property
800
725
  */
801
726
  export interface IVodLogOptsConfig {
802
727
  /**
803
- * 表示业务来源,使用业务自己的appid即可
804
- * 默认:无
805
- * 必选
728
+ * @brief 视频点播应用 ID。您可在视频{@link https://console.volcengine.com/vod/region:vod+cn-north-1/sdk/app/ 点播控制台 > 点播SDK > 应用管理}页面获取应用 ID(App ID)。
729
+ * @default -
806
730
  */
807
731
  line_app_id: number;
808
732
  /**
809
- * 用于识别单一用户的id
810
- * 默认:无
811
- * 必选
733
+ * @brief 用于识别单一用户的 ID,可在{@link https://www.volcengine.com/docs/4/75736#qoe-%E6%8C%87%E6%A0%87%E8%AF%B4%E6%98%8E QoE指标}中用于用户维度的筛选,也可以用于{@link https://www.volcengine.com/docs/4/106093 单点追查} 查找单用户的播放日志
734
+ * 用户 ID 对应于单点追查功能的查询条件中的设备 ID 维度。如不设置用户 ID,VePlayer 将根据用户浏览器随机生成一个值,该值会在浏览器端缓存。
735
+ * @notice 强烈建议您使用与业务相关的用户 ID,以便在发生播放错误时通过{@link https://console.volcengine.com/vod/region:vod+cn-north-1/quality_control/SingleTracing/?Tab=play 点播控制台 > 质量平台 > 单点追查}功能排查故障。
736
+ * @default -
812
737
  */
813
738
  line_user_id: string | number;
814
739
  /**
815
- * 视频类型
816
- * 默认:无
817
- * 必选
740
+ * @hidden
741
+ * @brief 视频类型
742
+ * @default MP4
818
743
  */
819
744
  vtype?: "MP4" | "HLS" | "DASH" | "FLV";
820
745
  /**
821
- * 自定义标签,对应控制台"业务维类型"维度
822
- * 默认:`default`
823
- * 必选
746
+ * @brief 业务标签。对应于质量平台上的业务类型维度,其作用是区分业务中的不同场景,以便进行多维度分析。举例来说,假设您的应用中包含短视频和长视频两个场景,则可分别将 `tag` 设为 `short` 和 `long`。这样一来,您就能够在{@link https://www.volcengine.com/docs/4/120175 质量平台}上通过业务标签维度查询或过滤不同场景的数据。
747
+ * @notice 如需自定义配置 tag 值在点播控制台上的展示文案,请联系{@link https://www.volcengine.com/docs/4/108992#%E5%94%AE%E5%90%8E%E6%94%AF%E6%8C%81 技术支持}
748
+ * @default 普通视频
824
749
  */
825
750
  tag?: string;
826
751
  /**
827
- * 自定义子标签,对应控制台"自定义标签"维度
828
- * 默认:`default`
829
- * 必选
752
+ * @brief 自定义子标签。对应于质量平台上的自定义标签维度,与 `tag` 配合使用,可用于区分同一业务类型下更为细分的音视频类型,比如加密视频、非加密视频、音频等。
753
+ * @default -
830
754
  */
831
755
  subtag?: string;
832
756
  /**
833
- * 视频解码器类型名称
834
- * 默认:`h264`
835
- * 必选
757
+ * @brief 视频编码类型,取值如下
758
+ * - `h264`:H.264
759
+ * - `h265`:H.265
760
+ * @default unknown
836
761
  */
837
762
  codec_type?: "h264" | "h265";
838
763
  /**
839
- * 是否加密,0:非drm视频,1:drm视频
840
- * 默认:`0`
841
- * 可选
764
+ * @brief 是否加密,0:非drm视频,1:drm视频
765
+ * @hidden
766
+ * @default 0
842
767
  */
843
768
  drm_type?: 0 | 1;
844
769
  /**
845
- * 播放内核版本号
846
- * 默认:无
847
- * 可选
770
+ * @hidden
771
+ * @brief 播放内核版本号
848
772
  */
849
773
  playerCoreVersion?: string;
850
774
  /**
851
- * 播放器版本号
852
- * 默认:无
853
- * 可选
775
+ * @hidden
776
+ * @brief 播放器版本号
854
777
  */
855
778
  playerVersion?: string;
856
779
  /**
857
- * DASH播放的封装类型
858
- * 默认:无
859
- * 可选
780
+ * @hidden
781
+ * @brief DASH播放的封装类型
860
782
  */
861
783
  dynamic_type?: "segment_base" | "segment_template";
862
784
  /**
863
- * 是否使用bash,0:不使用,1:使用
864
- * 默认:`0`
865
- * 可选
785
+ * @hidden
786
+ * @brief 是否使用bash,0:不使用,1:使用
787
+ * @default 0
866
788
  */
867
789
  enable_bash?: 0 | 1;
868
790
  /**
869
- * 发送的埋点日志是本地缓存的时候回调
870
- * 默认:无
871
- * 可选
791
+ * @hidden
792
+ * @brief 发送的埋点日志是本地缓存的时候回调
793
+ * @default -
872
794
  */
873
795
  sendLocalCallback?: (event: any, data: any) => void;
874
796
  /**
875
- * 是否禁用localStorage暂时缓存onPlay逻辑
876
- * 默认:`false`
877
- * 可选
797
+ * @hidden
798
+ * @brief 是否禁用localStorage暂时缓存onPlay逻辑
799
+ * @default false
878
800
  */
879
801
  disableLocalCache?: boolean;
880
802
  /**
881
- * 数据上报渠道,可选值:cn(国内)、va(美东) 、sg(新加坡)
882
- * 默认:`cn`
883
- * 可选
803
+ * @hidden
804
+ * @brief 数据上报渠道,可选值:cn(国内)、va(美东) 、sg(新加坡)
805
+ * @default cn
884
806
  */
885
807
  channel?: "cn" | "va" | "sg";
886
808
  /**
887
- * 是否关闭清晰度切换埋点
888
- * 默认:`false`
889
- * 可选
809
+ * @hidden
810
+ * @brief 是否关闭清晰度切换埋点
811
+ * @default false
890
812
  */
891
813
  closeResolutionLog?: boolean;
892
814
  /**
893
- * 关闭seek相关埋点
894
- * 默认:`false`
895
- * 可选
815
+ * @hidden
816
+ * @brief 关闭seek相关埋点
817
+ * @default false
896
818
  */
897
819
  closeSeekLog?: boolean;
898
820
  /**
899
- * 队列超过多少条日志的时候发送
900
- * 默认:`5`
901
- * 可选
821
+ * @hidden
822
+ * @brief 队列超过多少条日志的时候发送
823
+ * @default 5
902
824
  */
903
825
  maxQueueCount?: number;
904
826
  }
905
827
  /**
906
- * mp4加密日志配置项
907
- *
908
- * @detail Options
909
- * @export
910
- * @interface IMp4EncryptPlayerConfig
828
+ * @brief mp4加密日志配置项
829
+ * @list Options
830
+ * @hidden
911
831
  */
912
832
  export interface IMp4EncryptPlayerConfig {
913
833
  /**
914
- * 是否加密
915
- * 默认:`false`
916
- * 可选
834
+ * @hidden
835
+ * @brief 是否加密
836
+ * @default false
917
837
  */
918
838
  isEncrypt?: boolean;
919
839
  /**
920
- * 视频vid
921
- * 默认:无
922
- * 可选
840
+ * @hidden
841
+ * @brief 视频vid
842
+ * @default -
923
843
  */
924
844
  vid?: string;
925
845
  /**
926
- * 视频密钥 id
927
- * 默认:无
928
- * 可选
846
+ * @hidden
847
+ * @brief 视频密钥 id
848
+ * @default -
929
849
  */
930
850
  kid?: string;
931
851
  /**
932
- * 获取密钥凭证地址
933
- * 默认:无
934
- * 可选
852
+ * @hidden
853
+ * @brief 获取密钥凭证地址
854
+ * @default -
935
855
  */
936
856
  getLicenseUrl?: string;
937
857
  /**
938
- * 是否使用EME
939
- * 默认:`false`
940
- * 可选
858
+ * @hidden
859
+ * @brief 是否使用EME
860
+ * @default false
941
861
  */
942
862
  useEME?: boolean;
943
863
  /**
944
- * 视频密钥值
945
- * 默认:无
946
- * 可选
864
+ * @hidden
865
+ * @brief 视频密钥值
866
+ * @default -
947
867
  */
948
868
  keyValue?: string;
949
869
  /**
950
- * 加密后的视频密钥值
951
- * 默认:无
952
- * 可选
870
+ * @hidden
871
+ * @brief 加密后的视频密钥值
872
+ * @default -
953
873
  */
954
874
  secretKey?: string;
955
875
  /**
956
- * 是否携带cookie
876
+ * @hidden
877
+ * @brief 是否携带cookie
878
+ * @default false
957
879
  */
958
880
  withCredentials?: boolean;
959
881
  /**
960
- * drm内容
961
- * 默认:无
962
- * 可选
882
+ * @hidden
883
+ * @brief drm内容
884
+ * @default -
963
885
  */
964
886
  drm?: {
965
887
  clearKeys: {
@@ -967,6 +889,9 @@ export interface IMp4EncryptPlayerConfig {
967
889
  };
968
890
  };
969
891
  }
892
+ /**
893
+ * @hidden
894
+ */
970
895
  export declare type IDefinition = {
971
896
  [propName: string]: any;
972
897
  url: any;
@@ -980,6 +905,9 @@ export declare type IDefinition = {
980
905
  [propName: string]: any;
981
906
  };
982
907
  };
908
+ /**
909
+ * @hidden
910
+ */
983
911
  export declare type IPlayerOptions = {
984
912
  [propName: string]: any;
985
913
  id?: string;
@@ -1093,11 +1021,35 @@ export declare type IPlayerOptions = {
1093
1021
  volumeColor?: string;
1094
1022
  };
1095
1023
  };
1024
+ /**
1025
+ * @brief 自动播放配置
1026
+ * @list Options
1027
+ * @kind property
1028
+ */
1096
1029
  export interface IAutoplayPluginConfig {
1030
+ /**
1031
+ * @hidden
1032
+ */
1097
1033
  position?: string;
1034
+ /**
1035
+ * @brief 有声音自动播放失败时是否降级成静音自动播放
1036
+ * @default false
1037
+ */
1098
1038
  enableDegradeMuteAutoplay?: boolean;
1039
+ /**
1040
+ * @brief 启用微信jsBridge方式的自动播放
1041
+ * @default false
1042
+ */
1099
1043
  enableWxJsBridgeAutoplay?: boolean;
1044
+ /**
1045
+ * @brief 用户触发自动播放的目标dom
1046
+ * @default window.document.body
1047
+ */
1100
1048
  userActionDom?: Node;
1049
+ /**
1050
+ * @brief 开启任意点击/触摸的用户行为触发自动播放
1051
+ * @default false
1052
+ */
1101
1053
  enableUserActionAutoplay?: boolean;
1102
1054
  }
1103
1055
  declare class PlayList {
@@ -1123,6 +1075,11 @@ export declare const enum TOGGLE_MODES {
1123
1075
  CLICK = "click",
1124
1076
  HOVER = "hover"
1125
1077
  }
1078
+ /**
1079
+ * @list Options
1080
+ * @brief 播放列表项配置,支持 DirectUrl 和 Vid + playAuthToken 两种播放模式。
1081
+ * @kind property
1082
+ */
1126
1083
  export interface IPlayListItem {
1127
1084
  url?: string;
1128
1085
  playAuthToken?: string;
@@ -1134,14 +1091,51 @@ declare enum EPlayMode {
1134
1091
  ORDER = "order",
1135
1092
  LOOP = "loop"
1136
1093
  }
1094
+ /**
1095
+ * @list Options
1096
+ * @brief 播放列表插件配置项
1097
+ * @kind property
1098
+ */
1137
1099
  export interface IPlayListConfig {
1100
+ /**
1101
+ * @brief 图标位置
1102
+ * @default controlsLeft 控制栏左侧
1103
+ */
1138
1104
  position?: string;
1105
+ /**
1106
+ * @brief 图标位置权重
1107
+ * @default 20
1108
+ */
1139
1109
  index?: number;
1110
+ /**
1111
+ * @brief 列表数据
1112
+ * @default []
1113
+ */
1140
1114
  list: IPlayListItem[];
1115
+ /**
1116
+ * @brief 循环模式
1117
+ * @default order
1118
+ */
1141
1119
  mode?: EPlayMode;
1120
+ /**
1121
+ * @brief 默认起始播放序号
1122
+ * @default order
1123
+ */
1142
1124
  defaultIndex?: number;
1125
+ /**
1126
+ * @brief 列表点击之后是否隐藏列表
1127
+ * @default true
1128
+ */
1143
1129
  isItemClickHide?: boolean;
1130
+ /**
1131
+ * @brief 列表行为触发模式
1132
+ * @default click 点击
1133
+ */
1144
1134
  toggleMode?: TOGGLE_MODES;
1135
+ /**
1136
+ * @brief 是否显示图标
1137
+ * @default true
1138
+ */
1145
1139
  isShowIcon?: boolean;
1146
1140
  }
1147
1141
  export declare class PlayListPlugin extends Plugin {
@@ -1251,8 +1245,17 @@ export interface IPlayInfoList {
1251
1245
  Width: number;
1252
1246
  }
1253
1247
  declare enum CodecType {
1248
+ /**
1249
+ * @brief H.265
1250
+ */
1254
1251
  H265 = "h265",
1252
+ /**
1253
+ * @brief H.264
1254
+ */
1255
1255
  H264 = "h264",
1256
+ /**
1257
+ * @brief 未知编码
1258
+ */
1256
1259
  UNKNOWN = "unknown"
1257
1260
  }
1258
1261
  declare enum RTMCodec {
@@ -1265,7 +1268,6 @@ export interface IMusicListItem {
1265
1268
  * 音乐地址
1266
1269
  *
1267
1270
  * @type {string}
1268
- * @memberof IMusicListItem
1269
1271
  */
1270
1272
  src: string;
1271
1273
  /**
@@ -1289,11 +1291,20 @@ export interface IMusicListItem {
1289
1291
  * @memberof IMusicListItem
1290
1292
  */
1291
1293
  title?: string;
1294
+ /**
1295
+ * @hidden
1296
+ */
1292
1297
  [propName: string]: any;
1293
1298
  }
1299
+ /**
1300
+ * @brief 循环播放配置
1301
+ * @list Options
1302
+ * @kind property
1303
+ */
1294
1304
  export interface IABCycle {
1295
1305
  /**
1296
1306
  * AB循环段开始时间
1307
+ * @default 0
1297
1308
  *
1298
1309
  * @type {boolean}
1299
1310
  * @memberof IABCycle
@@ -1301,6 +1312,7 @@ export interface IABCycle {
1301
1312
  start: number;
1302
1313
  /**
1303
1314
  * AB循环段结束时间
1315
+ * @default 音乐结束时间点
1304
1316
  *
1305
1317
  * @type {boolean}
1306
1318
  * @memberof IABCycle
@@ -1308,16 +1320,26 @@ export interface IABCycle {
1308
1320
  end: number;
1309
1321
  /**
1310
1322
  * AB段是否循环播放
1323
+ * @default false
1311
1324
  *
1312
1325
  * @type {boolean}
1313
1326
  * @memberof IABCycle
1314
1327
  */
1315
1328
  loop?: boolean;
1329
+ /**
1330
+ * @hidden
1331
+ */
1316
1332
  [propName: string]: any;
1317
1333
  }
1334
+ /**
1335
+ * @list Options
1336
+ * @brief 音乐播放模式配置
1337
+ * @kind property
1338
+ */
1318
1339
  export interface IMusicConfig {
1319
1340
  /**
1320
1341
  * 是否启用离线下载播放
1342
+ * @default false
1321
1343
  *
1322
1344
  * @type {boolean}
1323
1345
  * @memberof IMusicConfig
@@ -1325,6 +1347,7 @@ export interface IMusicConfig {
1325
1347
  offline?: boolean;
1326
1348
  /**
1327
1349
  * AB循环设置
1350
+ * @default null
1328
1351
  *
1329
1352
  * @type {IABCycle}
1330
1353
  * @memberof IMusicConfig
@@ -1332,6 +1355,7 @@ export interface IMusicConfig {
1332
1355
  abCycle?: IABCycle | null;
1333
1356
  /**
1334
1357
  * 快进快退时间跨度
1358
+ * @default 15
1335
1359
  *
1336
1360
  * @type {number}
1337
1361
  * @memberof IMusicConfig
@@ -1339,6 +1363,7 @@ export interface IMusicConfig {
1339
1363
  timeScale?: number;
1340
1364
  /**
1341
1365
  * 循环模式
1366
+ * @default order
1342
1367
  *
1343
1368
  * @type {('order' | 'sloop' | 'loop' | 'random')}
1344
1369
  * @memberof IMusicConfig
@@ -1346,16 +1371,21 @@ export interface IMusicConfig {
1346
1371
  mode?: PlayModeType;
1347
1372
  /**
1348
1373
  * 播放列表
1374
+ * @default []
1349
1375
  *
1350
1376
  * @type {Array<IMusicListItem>}
1351
1377
  * @memberof IMusicConfig
1352
1378
  */
1353
1379
  list?: Array<IMusicListItem>;
1380
+ /**
1381
+ * @hidden
1382
+ */
1354
1383
  [propName: string]: any;
1355
1384
  }
1356
1385
  /**
1357
- * @detail Options
1386
+ * @list Options
1358
1387
  * @brief 播放地址列表, 可配置多线路和多清晰度
1388
+ * @kind property
1359
1389
  *
1360
1390
  * @export
1361
1391
  * @interface Stream
@@ -1398,17 +1428,12 @@ export interface Stream extends Partial<IPlayInfoList> {
1398
1428
  */
1399
1429
  definitionTextKey?: string;
1400
1430
  /**
1401
- * 编码格式
1402
- *
1403
- * @type {('h265' | 'h264')}
1404
- * @memberof Stream
1431
+ * @brief 编码格式
1432
+ * @default unknown
1405
1433
  */
1406
1434
  codec?: CodecType;
1407
1435
  /**
1408
1436
  * 线路唯一id
1409
- *
1410
- * @type {(number | string)}
1411
- * @memberof Stream
1412
1437
  */
1413
1438
  lineId?: number | string;
1414
1439
  /**
@@ -1426,14 +1451,24 @@ export interface Stream extends Partial<IPlayInfoList> {
1426
1451
  * @memberof Stream
1427
1452
  */
1428
1453
  lineTextKey?: string;
1454
+ /**
1455
+ * @hidden
1456
+ */
1429
1457
  [propName: string]: any;
1430
1458
  }
1459
+ /**
1460
+ * @hidden
1461
+ */
1431
1462
  export interface Condition {
1432
1463
  definition?: string;
1433
1464
  lineId?: number | string;
1465
+ /**
1466
+ * @hidden
1467
+ */
1434
1468
  [propName: string]: any;
1435
1469
  }
1436
1470
  /**
1471
+ * @hidden
1437
1472
  * @description 播放器当前状态
1438
1473
  */
1439
1474
  export interface Current {
@@ -1442,110 +1477,295 @@ export interface Current {
1442
1477
  language: string;
1443
1478
  lineId?: number | string;
1444
1479
  codec?: CodecType;
1480
+ /**
1481
+ * @hidden
1482
+ */
1445
1483
  [propName: string]: any;
1446
1484
  }
1447
1485
  /**
1448
- * @detail Options
1449
- * @id 1
1450
- * @brief options参数列表:
1451
- * 本文档是介绍火山引擎直播和点播播放器VePlayer的相关参数和Api。
1486
+ * @list Options
1487
+ * @kind property
1488
+ * @brief 实例化参数配置项
1452
1489
  */
1453
1490
  export interface IPlayerConfig extends IPlayerOptions {
1454
- /**
1455
- * 是否是直播,默认为false
1456
- * @type {boolean}
1457
- * @memberof IPlayerConfig
1491
+ /** {zh}
1492
+ * @brief 是否是直播,默认为false
1493
+ * @default false
1494
+ * @hidden
1458
1495
  */
1459
1496
  isLive?: boolean;
1460
- /**
1461
- * 播放器容器id,VePlayer将被插入在该容器中
1462
- *
1463
- * @notes id和root必填一个
1464
- * @type {string}
1465
- * @memberof IPlayerConfig
1497
+ /** {zh}
1498
+ * @brief 播放器容器id,VePlayer将被插入在该容器中
1499
+ * @notes `id`和`root`参数至少传入 1 个。
1500
+ * @default -
1466
1501
  */
1467
1502
  id?: string;
1468
- /**
1469
- * 播放器容器,VePlayer将被插入在该容器中
1470
- *
1471
- * @type {HTMLElement}
1472
- * @memberof IPlayerConfig
1503
+ /** {zh}
1504
+ * @brief 播放器容器DOM元素,VePlayer将被插入在该容器中
1505
+ * @notes `id`和`root`参数至少传入 1 个。
1506
+ * @default -
1473
1507
  */
1474
1508
  root?: HTMLElement;
1475
- /**
1476
- * 播放地址
1477
- * 直播可通过 {@link https://console.volcengine.com/live/main/locationGenerate 视频直播控制台} 生成
1478
- *
1479
- * @type {string}
1480
- * @memberof IPlayerConfig
1509
+ /** {zh}
1510
+ * @brief 视频地址
1511
+ * @default -
1481
1512
  */
1482
1513
  url?: string;
1483
- /**
1484
- * 播放地址类型,可以选值为“rtm”/“flv”/“mp4”/“hls”
1485
- * @notes 播放地址带后缀的则streamType非必填,否则为必填
1514
+ /** {zh}
1515
+ * @brief vid播放配置项
1516
+ * @notes 需要业务方服务端通过vid生成临时playAuthToken
1486
1517
  *
1487
- * @type {(''mp4' | 'hls' | 'dash' | 'rtm' | 'flv')}
1518
+ * @type {IPlayAuthTokenConfig}
1488
1519
  * @memberof IPlayerConfig
1489
1520
  */
1521
+ getVideoByToken?: IPlayAuthTokenConfig;
1522
+ /** {zh}
1523
+ * @brief 视频格式/协议类型。取值如下:
1524
+ * - `mp4`
1525
+ * - `hls`
1526
+ * - `dash`
1527
+ * - `flv`
1528
+ * @notes 如果`url`参数视频地址不包含文件格式后缀,则`streamType`必传。
1529
+ */
1490
1530
  streamType?: "mp4" | "hls" | "dash" | "rtm" | "flv";
1491
- /**
1492
- * 是否总是显示清晰度切换控件,即只有一个清晰度时也显示清晰度切换控件
1493
- * @type {boolean}
1494
- * @memberof IPlayerConfig
1531
+ /** {zh}
1532
+ * @brief 播放器宽度,可以是数字或者css width 属性值,是数字时单位是`px`
1533
+ * @default 100%
1534
+ */
1535
+ width?: number | string;
1536
+ /** {zh}
1537
+ * @brief 播放器高度,可以是数字或者css width 属性值,是数字时单位是`px`
1538
+ * @default 100%
1539
+ */
1540
+ height?: number | string;
1541
+ /** {zh}
1542
+ * @brief 默认音量
1543
+ * @default 0.6
1544
+ */
1545
+ volume?: number;
1546
+ /** {zh}
1547
+ * @brief 是否自动播放。取值如下:
1548
+ * - `true`:是
1549
+ * - `false`:否
1550
+ * @default false
1551
+ * @notice 受限制于浏览器策略,自动播放不一定能成功,取决于浏览器环境、用户行为、浏览器配置等,详细参考自动播放 @link https://www.volcengine.com/docs/4/68693#%E8%87%AA%E5%8A%A8%E6%92%AD%E6%94%BE
1552
+ */
1553
+ autoplay?: boolean;
1554
+ poster?: string | IPoster;
1555
+ /** {zh}
1556
+ * @brief 是否开启静音自动播放。取值如下:
1557
+ * - `true`:是
1558
+ * - `false`:否
1559
+ * @default false
1560
+ */
1561
+ autoplayMuted?: boolean;
1562
+ /** {zh}
1563
+ * @brief 有声音自动播放失败时是否降级成静音自动播放,默认不降级
1564
+ * - `true`:是,降级
1565
+ * - `false`:否,不降级
1566
+ * @default false
1567
+ */
1568
+ enableDegradeMuteAutoplay?: boolean;
1569
+ /** {zh}
1570
+ * @brief 启用微信jsBridge方式的自动播放,默认不开启
1571
+ * - `true`:是,降级
1572
+ * - `false`:否,不降级
1573
+ * @default false
1574
+ */
1575
+ enableWxJsBridgeAutoplay?: boolean;
1576
+ /** {zh}
1577
+ * @brief 开启任意点击的用户行为触发自动播放,默认不开启
1578
+ * - `true`:是,开启
1579
+ * - `false`:否,不开启
1580
+ * @default false
1581
+ */
1582
+ enableUserActionAutoplay?: boolean;
1583
+ /** {zh}
1584
+ * @brief 是否开启循环播放。
1585
+ * - `true`:是,开启
1586
+ * - `false`:否,不开启
1587
+ * @default false
1588
+ */
1589
+ loop?: boolean;
1590
+ /** {zh}
1591
+ * @brief 默认起播倍速。参考值 0.5/0.75/1/1.5/2
1592
+ * @default 1
1593
+ */
1594
+ defaultPlaybackRate?: number;
1595
+ /** {zh}
1596
+ * @brief 国际化语言。支持自定义,默认语言类型包括:
1597
+ * - `zh` 或 `zh-cn`
1598
+ * - `en`
1599
+ * - `jp`
1600
+ * - `zh-hk`
1601
+ * @default zh
1602
+ */
1603
+ lang?: "zh" | "zh-cn" | "en" | "jp" | "zh-hk";
1604
+ /** {zh}
1605
+ * @brief 自定义多语言词典。可设置每个语种的词典 `{ [key: string]: Object; }`。例如:
1606
+ * ```javascript
1607
+ * {
1608
+ * zh: {
1609
+ * PIP: '画中画'
1610
+ * },
1611
+ * en: {
1612
+ * PIP: 'pip'
1613
+ * }
1614
+ * }
1615
+ * ```
1616
+ * @notice
1617
+ * @see 了解更多,请参见{@link https://www.volcengine.com/docs/6469/127529 默认词典}。
1618
+ */
1619
+ languages?: {
1620
+ [key: string]: Record<string, any>;
1621
+ };
1622
+ /** {zh}
1623
+ * @brief 画中画配置
1624
+ * @default PC: {position: 'controlsRight', index: 2.5, showIcon: true}; mobile:false
1625
+ * @notice 画中画功能由浏览器提供,如果本身浏览器不支持,即使有该配置也不显示画中画按钮
1626
+ */
1627
+ pip?: IPIPConfig | boolean;
1628
+ /** {zh}
1629
+ * @brief 全屏相关配置
1630
+ * @default {position: 'controlsRight', index: 0, rotateFullscreen: false, useCssFullscreen: false, target: null, switchCallback: null, disable: false, needBackIcon: false }
1631
+ */
1632
+ fullscreen?: IFullscreenConfig;
1633
+ /** {zh}
1634
+ * @breif 是否总是显示清晰度切换控件,即只有一个清晰度时也显示清晰度切换控件
1635
+ * @default false
1495
1636
  */
1496
1637
  alwaysShowDefinition?: boolean;
1497
- /**
1498
- * url对应视频的清晰度文案,仅alwaysShowDefinitiontrue时有效
1499
- *
1500
- * @type {string}
1501
- * @memberof IPlayerConfig
1638
+ /** {zh}
1639
+ * @breif url对应视频的清晰度文案,仅`alwaysShowDefinition`为`true`时有效
1640
+ * @default HD
1502
1641
  */
1503
1642
  definitionText?: string;
1504
- /**
1505
- * url对应视频的清晰度文案的多语言key,对应参数 languages 中相对应的文案,仅alwaysShowDefinition为true时有效,优先级高于definitionText
1506
- *
1507
- * @type {string}
1508
- * @memberof IPlayerConfig
1643
+ /** {zh}
1644
+ * @brief url对应视频的清晰度文案的多语言key,对应参数 languages 中相对应的文案,仅alwaysShowDefinition为true时有效,优先级高于definitionText
1645
+ * @default -
1509
1646
  */
1510
1647
  definitionTextKey?: string;
1511
- /**
1512
- * 视频编码方式
1648
+ /** {zh}
1649
+ * @brief 视频编码方式
1513
1650
  * 软解useSoftDecoding设置为true时,提供codec可提升软解初始效率
1514
- *
1515
- * @type {CodecType}
1516
- * @memberof IPlayerConfig
1651
+ * @notice 在已知视频编码方式的情况下推荐传入,以方便日志分析
1517
1652
  */
1518
- codec?: CodecType;
1519
- /**
1520
- * 区域,影响服务接口和日志上报
1521
- * @volcengine/veplayer默认区域为cn, @byteplus/veplayer默认区域为sg
1522
- * 火山引擎海外区域播放时请填写'sg'
1523
- *
1524
- * @type {TRegionType}
1525
- * @memberof IPlayerConfig
1653
+ codec?: `${CodecType}`;
1654
+ /** {zh}
1655
+ * @brief 点播服务所在区域,影响服务接口和日志上报
1656
+ * @default cn
1657
+ * @notice 火山引擎海外区域播放时请填写'mya'
1658
+ * @hidden
1659
+ */
1660
+ /** {en}
1661
+ * @brief The area where the on-demand service is located affects the service interface and log reporting.
1662
+ * @default sg
1663
+ * @hidden
1526
1664
  */
1527
1665
  region?: TRegionType;
1528
- /**
1529
- * 多语言配置key,影响播放器文案的语言种类
1530
- * @type {'zh' | 'zh-cn' | 'en' | 'jp' | 'zh-hk'}
1531
- * @memberof IPlayerConfig
1666
+ /** {zh}
1667
+ * @brief 插件加载公共路径,用于指定插件的加载路径,或者本地文件服务加载插件
1668
+ * @default https://lf-unpkg.volccdn.com/obj/vcloudfe/sdk/@volcengine/veplayer/${version}/plugin
1669
+ * @notice 可将插件文件夹置于业务方服务器上,指定插件的地址即可
1532
1670
  */
1533
- lang?: "zh" | "zh-cn" | "en" | "jp" | "zh-hk";
1534
- /**
1535
- * 插件加载公共路径,用于指定插件的加载路径,或者本地文件服务加载插件
1536
- *
1537
- * @type {(string)}
1538
- * @memberof IPlayerConfig
1671
+ /** {en}
1672
+ * @brief plug loading public path, used to specify the loading path of the plug-in, or the local file service to load the plug-in
1673
+ * @default https://sf-unpkg.bytepluscdn.com/obj/byteplusfe-sg/sdk/@byteplus/veplayer/${version}/plugin
1674
+ * @notice can place the plug-in folder on the business server and specify the address of the plug-in.
1539
1675
  */
1540
1676
  pluginPublicPath?: string;
1541
1677
  /**
1542
- * 是否音乐播放器模式
1678
+ * @brief 开始播放时间
1679
+ * @default -
1680
+ */
1681
+ startTime?: number;
1682
+ /** {zh}
1683
+ * @brief 为播放器设置是否启用内联播放模式。playsinline 属性是 HTML5 视频标签的一个属性,用于指定视频是否应在页面文档内播放。
1684
+ * - `true`:启用,表示视频将在页面文档内播放;
1685
+ * - `false`:停用,默认浏览器播放行为。</br>
1543
1686
  *
1544
- * @type {boolean}
1545
- * @memberof IPlayerConfig
1687
+ * 该配置项只在移动端生效,当取值为 true 的时候,会在初始化 video 或 audio 对象的时候,将 playsinline、webkit-playsinline、x5-playsinline 三个属性设置为 true,请参考 [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) 了解内联模式相关知识。
1688
+ * @listtip
1689
+ * - iOS 10 及以上系统 Safari 浏览器支持配置内联播放模式;
1690
+ * - iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
1691
+ * @default true
1692
+ */
1693
+ playsinline?: boolean;
1694
+ /** {zh}
1695
+ * @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
1696
+ * @default 无
1697
+ */
1698
+ videoAttributes?: Partial<HTMLVideoElement>;
1699
+ /** {zh}
1700
+ * @brief 为播放器设置是否启用流式布局,启用流式布局后播放器会根据屏幕的宽度进行调整,保持在不同屏幕尺寸上都有良好的显示效果。
1701
+ * - `true`:启用
1702
+ * - `false`:停用
1703
+ * @listtip
1704
+ * 启用流式布局时:
1705
+ * - 如果 `width` 和 `height` 是 `Number` 类型,则按照其数值计算播放器宽高比;
1706
+ * - 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
1707
+ * @default false
1708
+ */
1709
+ fluid?: boolean;
1710
+ /** {zh}
1711
+ * @brief 为播放器设置尺寸适配方式,在视频资源初始化之后,根据获取到的 videoWidth 和 videoHeight 值对播放器容器宽高比例进行调整,可选项有:
1712
+ * - `fixed`: 保持容器宽/高,不做适配;
1713
+ * - `fixWidth`: 保持容器宽度,适配高度;
1714
+ * - `fixHeight`: 保持容器高度,适配宽度。
1715
+ *
1716
+ * @default fixed
1717
+ */
1718
+ fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
1719
+ /** {zh}
1720
+ * @brief 为播放器设置视频画面填充模式,可选项有:
1721
+ * - `fillwidth`: 填充宽度,高度溢出则裁剪高度;
1722
+ * - `fillHeight`: 填充高度,宽度溢出则裁剪宽度;
1723
+ * - `fill`: 拉伸视频以填充容器;
1724
+ * - `cover`: 保持其宽高比的同时填充元素的整个内容框;
1725
+ * - `auto`: 使用浏览器默认的视频画面填充模式。
1726
+ * @default auto
1727
+ */
1728
+ videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
1729
+ /** {zh}
1730
+ * @brief 是否开启画面和控制栏分离模式。设置为开启时,控制栏将会常驻,与视频画面不重叠。
1731
+ * - `true`:开启
1732
+ * - `false`:关闭
1733
+ * @default false
1734
+ */
1735
+ marginControls?: boolean;
1736
+ /** {zh}
1737
+ * @brief 启用x5内核浏览器的同层播放。
1738
+ * @default 无
1739
+ */
1740
+ "x5-video-player-type"?: string;
1741
+ /** {zh}
1742
+ * @brief 是否启用x5内核浏览器的全屏播放模式。
1743
+ * - `true`:启用
1744
+ * - `false`:停用
1745
+ * @default 无
1746
+ */
1747
+ "x5-video-player-fullscreen"?: boolean;
1748
+ /** {zh}
1749
+ * @brief x5内核浏览器的横竖屏控制,支持如下取值:
1750
+ * - `landscape`:横屏
1751
+ * - `portrait`:竖屏
1752
+ * - `landscape|portrait`:跟随手机自动旋转
1753
+ * @default mobile:`landscape|portrait`,pc:-
1754
+ */
1755
+ "x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
1756
+ /** {zh}
1757
+ * @brief 为播放器配置关键点样式。
1758
+ * @default 无
1759
+ * @hidden 直播目前没用到
1760
+ */
1761
+ commonStyle?: ICommonStyle;
1762
+ /** {zh}
1763
+ * @brief 是否启用音乐播放器模式
1764
+ * @default `false`
1546
1765
  */
1547
1766
  isMusic?: boolean;
1548
- /**
1767
+ /** {zh}
1768
+ * @hidden
1549
1769
  * 是否开启播放器原生控件菜单(右键触发)
1550
1770
  * @default false 默认不开启
1551
1771
  *
@@ -1553,249 +1773,177 @@ export interface IPlayerConfig extends IPlayerOptions {
1553
1773
  * @memberof IPlayerConfig
1554
1774
  */
1555
1775
  enableContextmenu?: boolean;
1556
- /**
1557
- * 关闭video上的阻止事件传播
1558
- * @default false 默认不阻止
1559
- *
1560
- * @type {boolean}
1561
- * @memberof IPlayerConfig
1776
+ /** {zh}
1777
+ * @brief 是否关闭video上的阻止事件传播
1778
+ * @default `false`
1562
1779
  */
1563
1780
  closeVideoStopPropagation?: boolean;
1564
- /**
1565
- * 右键菜单是否可用,启用后enableContextmenu强制为false
1566
- * @default false 默认不可用
1567
- *
1568
- * @type {boolean}
1569
- * @memberof IPlayerConfig
1781
+ /** {zh}
1782
+ * @brief 右键菜单是否可用
1783
+ * @default `false`
1570
1784
  */
1571
1785
  enableMenu?: boolean;
1572
- /**
1573
- * 是否开启hls的MSE模式,仅移动端生效,开启后采用MSE方式播放HLS,默认在移动端使用原生video播放hls
1574
- *
1575
- * @type {boolean}
1576
- * @memberof IPlayerConfig
1786
+ /** {zh}
1787
+ * @brief 是否开启hls的MSE模式,
1788
+ * @notice 仅移动端生效,开启后采用MSE方式播放HLS,默认在移动端使用原生video播放hls
1577
1789
  */
1578
1790
  enableHlsMSE?: boolean;
1579
- /**
1580
- * 在PC Safari上是否不使用hls插件播放,默认true。true: 启用;false: 不启用
1581
- *
1582
- * @type {boolean}
1583
- * @memberof IPlayerConfig
1791
+ /** {zh}
1792
+ * @brief 在PC Safari上是否使用hls插件播放
1793
+ * - true: 使用;
1794
+ * - false: 不使用
1795
+ * @default `true`
1584
1796
  */
1585
1797
  useHlsPluginForSafari?: boolean;
1586
- /**
1587
- * 是否开启mp4的MSE模式,开启后采用MSE方式播放MP4,
1588
- * 同时带来精确的seek加载、视频的无缝切换、流量节省等功能
1589
- *
1590
- * @type {boolean}
1591
- * @memberof IPlayerConfig
1798
+ /** {zh}
1799
+ * @brief 是否开启mp4的MSE模式,开启后采用MSE方式播放MP4,
1800
+ * mp4的MSE模式具有精确的seek加载、视频的无缝切换、流量节省等功能
1801
+ * @default `false`
1592
1802
  */
1593
1803
  enableMp4MSE?: boolean;
1594
- /**
1595
- * 播放列表
1804
+ /** {zh}
1805
+ * @brief 播放列表
1596
1806
  * @notes url和playList必填一个,二者都传入时, url必须在playList中。
1597
- *
1598
- * @type {Stream[]}
1599
- * @memberof IPlayerConfig
1807
+ * @default -
1600
1808
  */
1601
1809
  playList?: Stream[];
1602
- /**
1603
- * 插件,可自行选择高级插件。
1604
- * 目前支持的高级插件为: DefinitionDemotePlugin
1605
- *
1606
- * @type {any[]}
1607
- * @memberof IPlayerConfig
1810
+ /** {zh}
1811
+ * @brief 插件,可自行选择安装的插件,支持{@link https://h5player.bytedance.com/plugins/ 西瓜播放器插件}。
1812
+ * @default -
1608
1813
  */
1609
1814
  plugins?: any[];
1610
- /**
1611
- * 默认配置
1815
+ /** {zh}
1816
+ * @brief 忽略加载的插件,用于禁用默认加载的插件,传入插件名称数组,名称不区分大小写
1817
+ * @default []
1818
+ */
1819
+ ignores?: string[];
1820
+ /** {zh}
1821
+ * @brief 默认配置
1612
1822
  * @hidden
1613
- *
1614
- * @type {IDefaultConfig}
1615
- * @memberof IPlayerConfig
1616
1823
  */
1617
1824
  defaultConfig?: IDefaultConfig;
1618
- /**
1619
- * 设置多语言词典,可设置每个语言的多语言词典,
1620
- * 例如:
1621
- * {
1622
- * zh: {
1623
- * PIP: '画中画'
1624
- * },
1625
- * en: {
1626
- * PIP: 'pip'
1627
- * }
1628
- * }
1629
- *
1630
- * @type {{ [key: string]: Record<string, any> }}
1631
- * @memberof IPlayerConfig
1632
- */
1633
- languages?: {
1634
- [key: string]: Record<string, any>;
1635
- };
1636
- /**
1825
+ /** {zh}
1637
1826
  * @hidden
1638
- *
1639
- * @type {boolean}
1640
- * @memberof IPlayerConfig
1827
+ * @brief 模拟mobile
1641
1828
  */
1642
1829
  isMobile?: boolean;
1643
- /**
1644
- * umd依赖备用地址
1645
- * 用于依赖的CDN发生网络错误时的降级备用地址
1830
+ /** {zh}
1831
+ * @brief umd插件依赖备用地址
1832
+ * 用于依赖的插件所在CDN发生网络错误时的进行安全降级的备用地址,可以是相对地址
1646
1833
  * 支持的依赖有hls(非加密hls播放)、flv(flv播放)、XGVideo(软解播放)、hlsEncrypt(加密hls播放)、dash(dash播放)、mp4Encrypt(加密np4播放)、danmujs(弹幕)、danmuMask(蒙版弹幕)、subtitle(外挂字幕)
1834
+ * @example 以配置hls插件的备用地址为例
1835
+ * ```
1836
+ * const playerSdkIns = new VePlayer({
1837
+ * url: 'demo.m3u8',
1838
+ * id: 'video',
1839
+ * umdUrlMap: {
1840
+ * hls: '/VePlayerPlugin/hls.js'
1841
+ * }
1842
+ * })
1843
+ * ```
1844
+ * @default -
1845
+ * @notice 插件可以从{@link https://www.volcengine.com/docs/4/67077 集成SDK} 章节中下载SDK离线包获取
1647
1846
  */
1648
1847
  umdUrlMap?: Record<string, string>;
1649
1848
  /**
1650
- * 是否启用软解
1651
- * 默认: false
1652
- *
1653
- * @type {boolean}
1654
- * @memberof IPlayerConfig
1849
+ * @brief 唯一id,用于私有DRM加密
1850
+ * @default -
1851
+ */
1852
+ unionId?: string;
1853
+ /** {zh}
1854
+ * @brief 是否启用软解
1855
+ * @default `false`
1655
1856
  */
1656
1857
  useSoftDecoding?: boolean;
1657
- /**
1658
- * 是否开H265播放降级,即H.265硬解不支持时自动降级为软解
1659
- *
1660
- * @type {boolean}
1661
- * @memberof IPlayerConfig
1858
+ /** {zh}
1859
+ * @brief 是否开H265播放降级,即H.265硬解不支持时自动降级为软解
1860
+ * @default `false`
1662
1861
  */
1663
1862
  enableH265Degrade?: boolean;
1664
- /**
1665
- * 资源过期时的回调函数,用来更新视频资源
1666
- *
1667
- * @type {(any) => Promise<IPlayerConfig>}
1668
- * @memberof IPlayerConfig
1863
+ /** {zh}
1864
+ * @hidden
1865
+ * @brief 资源过期时的回调函数,用来更新视频资源
1866
+ * @default -
1669
1867
  */
1670
1868
  onMediaExpired?: () => Promise<IPlayerConfig>;
1671
- /**
1672
- * playAuthToken过期时的回调函数,用来更新playAuthToken
1673
- *
1674
- * @type {(any) => Promise<IPlayAuthTokenConfig>}
1675
- * @memberof IPlayerConfig
1869
+ /** {zh}
1870
+ * @brief playAuthToken过期时的回调函数,用来更新playAuthToken
1871
+ * @default -
1676
1872
  */
1677
1873
  onTokenExpired?: () => Promise<IPlayAuthTokenConfig>;
1678
- /**
1679
- * 定期检查资源过期的周期,单位秒,默认400
1680
- *
1681
- * @type {boolean}
1682
- * @memberof IPlayerConfig
1874
+ /** {zh}
1875
+ * @hidden
1876
+ * @brief 定期检查资源过期的周期,单位秒
1877
+ * @default `400`
1683
1878
  */
1684
1879
  checkExpireInterval?: number;
1685
- /**
1686
- * 定期检查资源过期的方式,支持三种类型
1687
- * urlExpire 根据url的过期时间判断
1688
- * xhrStatus 发送资源请求,根据资源xhr状态判断
1689
- * getUrlTime 根据估算的地址获取时间判断
1690
- * @type {boolean}
1691
- * @memberof IPlayerConfig
1692
- */
1693
- expireDetectType?: Array<"xhrStatus" | "getUrlTime">;
1694
- /**
1695
- * 有声音自动播放失败时是否降级成静音自动播放,默认不降级
1696
- *
1697
- * @type {boolean}
1698
- * @memberof IPlayerConfig
1699
- */
1700
- enableDegradeMuteAutoplay?: boolean;
1701
- /**
1702
- * 启用微信jsBridge方式的自动播放,默认不开启
1703
- *
1704
- * @type {boolean}
1705
- * @memberof IPlayerConfig
1706
- */
1707
- enableWxJsBridgeAutoplay?: boolean;
1708
- /**
1709
- * 开启任意点击的用户行为触发自动播放,默认不开启
1710
- *
1711
- * @type {boolean}
1712
- * @memberof IPlayerConfig
1880
+ /** {zh}
1881
+ * @hidden
1882
+ * @brief 定期检查资源过期的方式,支持三种类型
1883
+ * - `urlExpire`: 根据url的过期时间判断
1884
+ * - `xhrStatus`: 发送资源请求,根据资源xhr状态判断
1885
+ * - `getUrlTime`: 根据估算的地址获取时间判断
1713
1886
  */
1714
- enableUserActionAutoplay?: boolean;
1715
- /**
1716
- * 禁用点播日志配置检测,默认开启,如果未配置line_app_id则会播放报错
1717
- *
1718
- * @type {boolean}
1719
- * @memberof IPlayerConfig
1887
+ expireDetectType?: Array<"urlExpire" | "xhrStatus" | "getUrlTime">;
1888
+ /** {zh}
1889
+ * @hidden
1890
+ * @brief 禁用点播日志配置检测,默认开启,如果未配置line_app_id则会播放报错
1891
+ * @default -
1720
1892
  */
1721
1893
  disableVodLogOptsCheck?: boolean;
1722
- /**
1723
- * 播放器报错展示配置, 可以配置播放异常时的播放器显示的异常文案、图片,以及是否提供刷新按钮等
1724
- *
1894
+ /** {zh}
1895
+ * @brief 播放器报错展示配置, 可以配置播放异常时的播放器显示的异常文案、图片,以及是否提供刷新按钮等
1896
+ * @default -
1725
1897
  */
1726
1898
  sdkErrorPlugin?: ISdkErrorConfig;
1727
- /**
1728
- * rtm配置,配置rtm拉流参数
1899
+ /** {zh}
1900
+ * @brief rtm配置,配置rtm拉流参数
1729
1901
  * @notes 传入rtm流url时才生效
1730
- *
1731
- * @type {IRtmConfig}
1732
- * @memberof IPlayerConfig
1902
+ * @default -
1733
1903
  */
1734
- rtm?: IRtmConfig;
1735
- /**
1736
- * 弹幕及面板配置,可配置弹幕的一些参数,如弹幕文字大小、透明度、展示区域等,
1737
- *
1738
- * @type {InitConfig | boolean}
1739
- * @memberof IPlayerConfig
1740
- */
1741
- DanmuPlugin?: InitConfig | boolean;
1742
- /**
1743
- * 清晰度自动降级配置
1744
- * @notes 需要先引入DefinitionDemotePlugin插件,plugins: [window.VePlayer.DefinitionDemotePlugin]
1745
- *
1746
- * @type {IDefinitionDemotePlugin}
1747
- * @memberof IPlayerConfig
1748
- */
1749
- DefinitionDemotePlugin?: IDefinitionDemotePlugin;
1904
+ rtm?: IRtmConfig;
1750
1905
  /**
1751
- * 唯一id,用于私有DRM加密
1752
- *
1753
- * @type {string}
1754
- * @memberof IPlayerConfig
1906
+ * @brief 弹幕及面板配置,可配置弹幕的一些参数,如弹幕文字大小、透明度、展示区域等
1907
+ * @default -
1755
1908
  */
1756
- unionId?: string;
1909
+ DanmuPlugin?: IDanmuConfig | boolean;
1757
1910
  /**
1758
- * vid播放配置项
1759
- * @notes 需要业务方服务端通过vid生成临时playAuthToken
1760
- *
1761
- * @type {IPlayAuthTokenConfig}
1762
- * @memberof IPlayerConfig
1911
+ * @brief 清晰度自动降级配置
1912
+ * @hidden
1913
+ * @notes 需要先引入DefinitionDemotePlugin插件,plugins: [VePlayer.DefinitionDemotePlugin]
1763
1914
  */
1764
- getVideoByToken?: IPlayAuthTokenConfig;
1915
+ DefinitionDemotePlugin?: IDefinitionDemotePlugin;
1765
1916
  /**
1766
- * dash 播放配置项
1767
- * @type {Partial<IDashPluginConfig>}
1768
- * @memberof IPlayerConfig
1917
+ * @hidden
1918
+ * @brief DASH 播放配置项
1919
+ * @default -
1769
1920
  */
1770
1921
  DASHPlugin?: Partial<IDashPluginConfig>;
1771
1922
  /**
1772
- * hls 加密播放配置项
1773
- * @type {Partial<IEncryptHlsPluginConfig> | boolean}
1774
- * @memberof IPlayerConfig
1923
+ * @brief HLS 加密播放配置项
1924
+ * @default -
1775
1925
  */
1776
1926
  EncryptHlsPlugin?: Partial<IEncryptHlsPluginConfig> | boolean;
1777
1927
  /**
1778
- * 质量日志配置项
1779
- * @type {Partial<IVodLogOptsConfig>}
1780
- * @memberof IPlayerConfig
1928
+ * @brief 质量日志配置项
1929
+ * @default -
1781
1930
  */
1782
1931
  vodLogOpts?: Partial<IVodLogOptsConfig>;
1783
1932
  /**
1784
- * mp4加密播放配置项
1785
- * @type {Partial<IMp4EncryptPlayerConfig> | boolean}
1786
- * @memberof IPlayerConfig
1933
+ * @hidden
1934
+ * @brief mp4加密播放配置项
1935
+ * @default -
1787
1936
  */
1788
1937
  Mp4EncryptPlayer?: Partial<IMp4EncryptPlayerConfig> | boolean;
1789
1938
  /**
1790
- * 自适应码率配置项
1791
- * @type {IAutoBitrateOptsConfig}
1792
- * @memberof IPlayerConfig
1939
+ * @hidden
1940
+ * @brief 自适应码率配置项
1941
+ * @default -
1793
1942
  */
1794
1943
  autoBitrateOpts?: IAutoBitrateOptsConfig;
1795
1944
  /**
1796
- * 外挂字幕配置项
1797
- * @type {ISubtitleConfig}
1798
- * @memberof IPlayerConfig
1945
+ * @brief 外挂字幕配置项
1946
+ * @default -
1799
1947
  */
1800
1948
  Subtitle?: ISubtitleConfig;
1801
1949
  /**
@@ -1888,105 +2036,80 @@ export interface IDefaultConfig {
1888
2036
  LiveSubtitlesIconPlugin?: any;
1889
2037
  }
1890
2038
  /**
1891
- * vid播放配置信息
1892
- *
1893
- * @detail Options
1894
- * @description PlayAuthToken获取视频信息配置
1895
- * @export
1896
- * @interface IPlayAuthTokenConfig
2039
+ * @brief vid播放配置信息
2040
+ * @list Options
2041
+ * @kind property
1897
2042
  */
1898
2043
  export interface IPlayAuthTokenConfig {
1899
- /**
1900
- * 服务端生成的临时playAuthToken
1901
- *
1902
- * @type {string}
1903
- * @memberof IPlayAuthTokenConfig
2044
+ /** {zh}
2045
+ * @brief 服务端生成的临时播放凭证。
2046
+ * @default -
1904
2047
  */
1905
2048
  playAuthToken: string;
1906
- /**
1907
- * 默认清晰度
1908
- *
2049
+ /** {zh}
2050
+ * @brief 默认清晰度
2051
+ * @default -
1909
2052
  * @notes 为空时默认为最大码率的清晰度
1910
- * @type {string}
1911
- * @memberof IPlayAuthTokenConfig
1912
2053
  */
1913
2054
  defaultDefinition?: string;
1914
- /**
1915
- * 求地址接口域名
1916
- *
1917
- * @notes 默认为`//vod.volcengineapi.com`
1918
- * @type {string}
1919
- * @memberof IPlayAuthTokenConfig
2055
+ /** {zh}
2056
+ * @brief 获取播放地址的请求域名。
2057
+ * @default`https://vod.volcengineapi.com`
2058
+ */
2059
+ /** {en}
2060
+ * @brief Get the requested domain name of the playback address
2061
+ * @default `https://vod.byteplusapi.com`
1920
2062
  */
1921
2063
  playDomain?: string;
1922
- /**
1923
- * 是否启用控制台设置的封面图,默认false
1924
- * @type {boolean}
1925
- * @memberof IPlayAuthTokenConfig
2064
+ /** {zh}
2065
+ * @brief 是否启用控制台设置的封面图
2066
+ * @default `false`
1926
2067
  */
1927
2068
  needPoster?: boolean;
1928
- /**
1929
- * 是否启用控制台设置的雪碧图,默认false
1930
- * @type {boolean}
1931
- * @memberof IPlayAuthTokenConfig
2069
+ /** {zh}
2070
+ * @brief 是否启用控制台设置的截图中的雪碧图
2071
+ * @default `false`
1932
2072
  */
1933
2073
  needThumbs?: boolean;
1934
- /**
1935
- * 是否启用控制台设置的蒙版弹幕,默认false
1936
- * @type {boolean}
1937
- * @memberof IPlayAuthTokenConfig
2074
+ /** {zh}
2075
+ * @brief 是否启用控制台设置的蒙版弹幕
2076
+ * @default `false`
1938
2077
  */
1939
2078
  needBarrageMask?: boolean;
1940
- /**
1941
- * 是否需要多清晰度,默认为true
1942
- * @type {boolean}
1943
- * @memberof IPlayAuthTokenConfig
2079
+ /** {zh}
2080
+ * @brief 是否需要多清晰度
2081
+ * @default `true`
1944
2082
  */
1945
2083
  needDefinitionList?: boolean;
1946
- /**
1947
- * hls标准加密播放所用的keyToken
1948
- * @type {boolean}
1949
- * @memberof IPlayAuthTokenConfig
2084
+ /** {zh}
2085
+ * @briefhls标准加密播放所需要的keyToken
2086
+ * @default -
1950
2087
  */
1951
2088
  keyToken?: string;
1952
- /**
1953
- * 密钥请求域名
1954
- * @type {string}
1955
- * @memberof IPlayAuthTokenConfig
1956
- */
1957
- keyDomain?: string;
1958
- /**
1959
- * 获取key方式,默认'TOP'
1960
- * @type {string}
1961
- * @memberof IPlayAuthTokenConfig
2089
+ /** {zh}
2090
+ * @hidden
2091
+ * @brief 获取key方式,默认'TOP'
2092
+ * @default `'TOP'`
1962
2093
  */
1963
2094
  getKeyType?: string;
1964
- /**
1965
- * 获取privateDrmAuthToken的异步回调,
1966
- * @type {(
1967
- * playAuthIds: string,
1968
- * vid: string,
1969
- * unionInfo: string,
1970
- * ) => Promise<string>}
2095
+ /** {zh}
2096
+ * @brief 获取`PrivateDrmAuthToken`的异步回调,
1971
2097
  * 回调入参:
1972
- * playAuthIds 视频的密钥 KeyID,对应OpenAPI GetPlayInfo{@link https://www.volcengine.com/docs/4/2918#%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E} 返回视频信息中的PlayAuthId,当有多个KeyID时以英文逗号相连
1973
- * vid 视频vid
1974
- * unionInfo unionId生成的unionInfo,以用来加密PrivateDrmAuthToken
1975
- * @memberof IPlayAuthTokenConfig
1976
- *
2098
+ * - `playAuthIds`: 视频的密钥 KeyID,对应OpenAPI GetPlayInfo{@link https://www.volcengine.com/docs/4/2918#%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E} 返回视频信息中的PlayAuthId,当有多个KeyID时以英文逗号相连
2099
+ * - `vid`: 视频vid
2100
+ * - `unionInfo`: 由`unionId`生成的`unionInfo`,以用来加密`PrivateDrmAuthToken`
2101
+ * @default -
1977
2102
  */
1978
2103
  getDrmAuthToken?: (playAuthIds: string, vid: string, unionInfo: string) => Promise<string>;
1979
- /**
1980
- * 可携带aid等透传参数,如
2104
+ /** {zh}
2105
+ * @brief 可携带aid等透传参数,如:
1981
2106
  * {aid: 1234},以playAuthToken下发的参数的优先级最高。
1982
2107
  * 具体可传参数见{@link https://www.volcengine.com/docs/4/65659 签发 PlayAuthToken}
1983
- *
1984
- * @type {Record<string, number | string | boolean>}
1985
- * @memberof IPlayAuthTokenConfig
2108
+ * @default -
1986
2109
  */
1987
2110
  reqParams?: Record<string, number | string | boolean>;
1988
- /**
1989
- * 定义清晰度的映射
2111
+ /** {zh}
2112
+ * @brief 定义清晰度的映射
1990
2113
  *
1991
2114
  * @example 如:
1992
2115
  * ``` javascript
@@ -2009,21 +2132,19 @@ export interface IPlayAuthTokenConfig {
2009
2132
  * }
2010
2133
  * ```
2011
2134
  * `definitionTextKey`用来指定多语言的key
2012
- * @type {Record<string, string | definitionItem>}
2013
- * @memberof IPlayAuthTokenConfig
2135
+ * @default -
2014
2136
  */
2015
2137
  definitionMap?: Record<string, string | definitionItem>;
2016
- /**
2017
- * 服务502错误时重试次数,默认为1
2018
- * @type {number}
2019
- * @memberof IPlayAuthTokenConfig
2138
+ /** {zh}
2139
+ * @brief 点播服务502错误时重试次数
2140
+ * @default 1
2020
2141
  */
2021
2142
  retryCount?: number;
2022
2143
  }
2023
2144
  /**
2024
2145
  * 清晰度定义
2025
2146
  *
2026
- * @detail Options
2147
+ * @list Options
2027
2148
  * @export
2028
2149
  * @interface definitionItem
2029
2150
  */
@@ -2095,9 +2216,9 @@ export interface IAutoBitrateOptsConfig {
2095
2216
  module?: any;
2096
2217
  }
2097
2218
  /**
2098
- * 初始配置
2099
- *
2100
- * @export
2219
+ * @brief 记忆播放配置项
2220
+ * @kind property
2221
+ * @list Options
2101
2222
  * @interface IMemoryPlayConfig
2102
2223
  */
2103
2224
  export interface IMemoryPlayConfig {
@@ -2123,6 +2244,180 @@ export interface IMemoryPlayConfig {
2123
2244
  */
2124
2245
  getTime: (id: number | string) => number | Promise<number>;
2125
2246
  }
2247
+ export declare const enum POSITIONS {
2248
+ ROOT = "root",
2249
+ ROOT_LEFT = "rootLeft",
2250
+ ROOT_RIGHT = "rootRight",
2251
+ ROOT_TOP = "rootTop",
2252
+ CONTROLS_LEFT = "controlsLeft",
2253
+ CONTROLS_RIGTH = "controlsRight",
2254
+ CONTROLS_RIGHT = "controlsRight",
2255
+ CONTROLS_CENTER = "controlsCenter",
2256
+ CONTROLS = "controls"
2257
+ }
2258
+ export interface IIconPluginConfig {
2259
+ position?: POSITIONS;
2260
+ index?: number;
2261
+ }
2262
+ /**
2263
+ * @brief 画中画配置项
2264
+ * @list Options
2265
+ * @kind property
2266
+ */
2267
+ export interface IPIPConfig extends IIconPluginConfig {
2268
+ /** {zh}
2269
+ * @brief 是否显示画中画按钮
2270
+ * - `true`:是,显示
2271
+ * - `false`:否,不显示
2272
+ * @default `false`
2273
+ */
2274
+ showIcon?: boolean;
2275
+ /** {zh}
2276
+ * @brief 是否优先采用文档画中画,仅浏览器支持 DocumentPictureInPicture 才生效
2277
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/DocumentPictureInPicture DocumentPictureInPicture}
2278
+ * - `true`:是,优先使用文档画中画
2279
+ * - `false`:否
2280
+ * @default `false`
2281
+ */
2282
+ preferDocument?: boolean;
2283
+ /** {zh}
2284
+ * @brief 文档画中画窗口的宽度
2285
+ * @default -
2286
+ */
2287
+ width?: number;
2288
+ /** {zh}
2289
+ * @brief 文档画中画窗口的高度
2290
+ * @default -
2291
+ */
2292
+ height?: number;
2293
+ /** {zh}
2294
+ * @brief 文档画中画窗口的根节点
2295
+ * @default -
2296
+ */
2297
+ docPiPNode?: HTMLElement;
2298
+ /** {zh}
2299
+ * @brief 文档画中画窗口的css style
2300
+ * @default -
2301
+ */
2302
+ docPiPStyle?: ((...arg: any) => string) | string;
2303
+ }
2304
+ /**
2305
+ * @brief 全屏配置
2306
+ * @list Options
2307
+ * @kind property
2308
+ */
2309
+ export interface IFullscreenConfig {
2310
+ /** {zh}
2311
+ * @brief 是否使用页面全屏代替全屏功能。取值如下:
2312
+ - `true`:页面全屏;
2313
+ - `false`:系统全屏。
2314
+ * @default `false`
2315
+ */
2316
+ useCssFullscreen?: boolean;
2317
+ /** {zh}
2318
+ * @brief 是否使用旋转横屏。取值如下:
2319
+ * - `false`:否。
2320
+ * - `true`:是,即全屏将会在竖屏状态下把 dom 旋转 90 度实现横屏效果。
2321
+ * @default `false`
2322
+ * @notice
2323
+ * - 该配置优先于 `useCssFullscreen` 配置。
2324
+ * - 该配置一般在移动端使用。
2325
+ */
2326
+ rotateFullscreen?: boolean;
2327
+ /** {zh}
2328
+ * @brief 自定义全屏作用的dom,默认是播放器根节点, 该配置项必须是player.root的父辈节点,使用场景是解决全屏下和player.root同级的dom需要显示的场景
2329
+ * @default `null`
2330
+ */
2331
+ target?: HTMLElement;
2332
+ /** {zh}
2333
+ * @brief 是否禁用全凭按钮功能,禁用后不渲染全屏按钮
2334
+ * - `true`:禁用;
2335
+ * - `false`:不禁用。
2336
+ * @default `false`
2337
+ */
2338
+ disable?: boolean;
2339
+ /** {zh}
2340
+ * @brief 全屏的时候是否使用右上角返回按钮
2341
+ * - `true`:显示;
2342
+ * - `false`:不显示。
2343
+ * @default `false`
2344
+ * @notice 该配置一般在移动端开启
2345
+ */
2346
+ needBackIcon?: boolean;
2347
+ /** {zh}
2348
+ * @brief 全屏切换自定义实现,该函数配置相当于完全替代插件内部的切换逻辑
2349
+ * @default `null`
2350
+ */
2351
+ switchCallback?: (...arg: any) => any;
2352
+ }
2353
+ /**
2354
+ * @list Options
2355
+ * @kind property
2356
+ */
2357
+ export interface ICommonStyle {
2358
+ /** {zh}
2359
+ * @brief 进度条底色
2360
+ * @default 无
2361
+ */
2362
+ progressColor?: string;
2363
+ /** {zh}
2364
+ * @brief 播放完成部分进度条底色
2365
+ * @default 无
2366
+ */
2367
+ playedColor?: string;
2368
+ /** {zh}
2369
+ * @brief 缓存部分进度条底色
2370
+ * @default 无
2371
+ */
2372
+ cachedColor?: string;
2373
+ /** {zh}
2374
+ * @brief 进度条滑块样式
2375
+ * @default 无
2376
+ */
2377
+ sliderBtnStyle?: CSSStyleDeclaration;
2378
+ /** {zh}
2379
+ * @brief 音量颜色
2380
+ * @default 无
2381
+ */
2382
+ volumeColor?: string;
2383
+ }
2384
+ /**
2385
+ * @list Options
2386
+ * @brief 封面配置
2387
+ * @kind property
2388
+ */
2389
+ export interface IPoster {
2390
+ /** {zh}
2391
+ * @brief 封面图地址
2392
+ * @default -
2393
+ */
2394
+ poster: string;
2395
+ /**
2396
+ * @brief 是否在播放结束之后显示
2397
+ * @default `true`
2398
+ */
2399
+ isEndedShow?: boolean;
2400
+ /**
2401
+ * @brief 是否播放后隐藏
2402
+ * - `true`:播放后才隐藏,在视频地址更新后会重新显示poster
2403
+ * - `false`:在play事件触发后隐藏poster
2404
+ * @default `false`
2405
+ */
2406
+ hideCanplay?: boolean;
2407
+ /**
2408
+ * @brief 是否一直显示
2409
+ * @default `false`
2410
+ */
2411
+ notHidden?: boolean;
2412
+ /**
2413
+ * @brief 封面图填充方式
2414
+ * - `fixWidth`:宽度方向填充,不会被拉伸压缩
2415
+ * - `fixHeight`:高度方向完全填充,不会被拉伸压缩
2416
+ * - `cover`:方式完全覆盖容器,多余但部分会被裁剪
2417
+ * - `contain`:完全覆盖,与容器不匹配时会被拉伸压缩
2418
+ */
2419
+ fillMode?: "fixWidth" | "fixHeight" | "cover" | "contain";
2420
+ }
2126
2421
  export interface ApiMapConfig {
2127
2422
  playDomain: string;
2128
2423
  backupPlayDomain?: string;
@@ -2343,15 +2638,14 @@ declare class umdLoader {
2343
2638
  }
2344
2639
  declare class VePlayer {
2345
2640
  /**
2346
- * 播放相关配置数据
2641
+ * @brief 播放相关配置数据
2347
2642
  * @hidden
2348
- *
2349
2643
  * @type {PlayerData}
2350
2644
  * @memberof VePlayer
2351
2645
  */
2352
2646
  playerData: PlayerData;
2353
2647
  /**
2354
- * 播放器内核实例
2648
+ * @brief 播放器内核实例
2355
2649
  * @type {*}
2356
2650
  * @memberof VePlayer
2357
2651
  */
@@ -2459,10 +2753,21 @@ declare class VePlayer {
2459
2753
  * @memberof VePlayer
2460
2754
  */
2461
2755
  sdkUmdLoader: umdLoader;
2756
+ /**
2757
+ * @hidden
2758
+ */
2462
2759
  static isMSESupported: typeof isMSESupport;
2463
2760
  static isRTMSupported: typeof import("@byted/xgplayer-rts").RtsPlugin.isSupported;
2761
+ /**
2762
+ * @hidden
2763
+ */
2464
2764
  static veStrategy: typeof VeStrategy;
2465
2765
  static sdkVersion: string;
2766
+ /**
2767
+ * @hidden
2768
+ * @param codec
2769
+ * @param options
2770
+ */
2466
2771
  static isRTMSupportCodec: (codec: RTMCodec, options: {
2467
2772
  targetProfileLevel?: string;
2468
2773
  }) => Promise<boolean>;
@@ -2470,7 +2775,7 @@ declare class VePlayer {
2470
2775
  constructor(configs: IPlayerConfig);
2471
2776
  /**
2472
2777
  *
2473
- *
2778
+ * @hidden
2474
2779
  * @private
2475
2780
  * @param {IPlayerConfig} configs 播放器配置
2476
2781
  * @memberof VePlayer
@@ -2494,6 +2799,10 @@ declare class VePlayer {
2494
2799
  * @memberof VePlayer
2495
2800
  */
2496
2801
  private initUmdLoader;
2802
+ /**
2803
+ * @hidden
2804
+ * @private
2805
+ */
2497
2806
  private checkVodLogOptions;
2498
2807
  /**
2499
2808
  * @hidden
@@ -2509,28 +2818,28 @@ declare class VePlayer {
2509
2818
  onRepeat(): void;
2510
2819
  /**
2511
2820
  * @hidden
2512
- * @description 触发过期事件
2821
+ * @brief 触发过期事件
2513
2822
  * @memberof VePlayer
2514
2823
  */
2515
2824
  emitExpireEvent(): void;
2516
2825
  /**
2517
2826
  * @hidden
2518
- * @description 地址获取时间
2827
+ * @brief 地址获取时间
2519
2828
  * @memberof VePlayer
2520
2829
  */
2521
2830
  getUrlTimestamp(url: string): void;
2522
2831
  /**
2523
- * @description 监听sdk事件
2832
+ * @brief 监听sdk事件
2524
2833
  *
2525
- * @param {string} action
2834
+ * @param action 监听的事件名
2526
2835
  * @param {(...args: any[]) => void} func
2527
2836
  * @memberof VePlayer
2528
2837
  */
2529
2838
  on(action: string, func: (...args: any[]) => void): void;
2530
2839
  /**
2531
- * @description 触发sdk事件
2840
+ * @brief 触发sdk事件
2532
2841
  *
2533
- * @param {string} action
2842
+ * @param {string} action 监听的事件名
2534
2843
  * @param {*} [payload]
2535
2844
  * @memberof VePlayer
2536
2845
  */
@@ -2633,6 +2942,10 @@ declare class VePlayer {
2633
2942
  */
2634
2943
  beforePlayerCreate(): Promise<void>;
2635
2944
  private prepareStrategies;
2945
+ /**
2946
+ * @hidden
2947
+ * @brief 更新播放策略
2948
+ */
2636
2949
  updateConfigByStrategy(): void;
2637
2950
  /**
2638
2951
  * @hidden
@@ -2714,14 +3027,14 @@ declare class VePlayer {
2714
3027
  /**
2715
3028
  * @hidden
2716
3029
  *
2717
- * @description 对外提供获取SDK插件实例的方法
3030
+ * @brief 对外提供获取SDK插件实例的方法
2718
3031
  * @param { string } name
2719
3032
  * @return {*}
2720
3033
  * @memberof VePlayer
2721
3034
  */
2722
3035
  getSdkPlugin(name: any): any;
2723
3036
  /**
2724
- * @description 更换playAuthToken的方法
3037
+ * @brief 更换playAuthToken的方法
2725
3038
  * @notes 这里指同一个视频切换视频源,不能用来切换不同类型的视频
2726
3039
  * @param { IPlayAuthTokenConfig } config authToken配置
2727
3040
  * @param { boolean } isNewVideo 是否是新视频,默认true。若未false即表示同一个视频切换token播放,会在切换前时间点继续播放
@@ -2729,18 +3042,18 @@ declare class VePlayer {
2729
3042
  */
2730
3043
  switchAuthToken(config: IPlayAuthTokenConfig, isNewVideo?: boolean): Promise<void>;
2731
3044
  /**
2732
- * @description 更新playAuthToken的方法,用来更新视频地址
3045
+ * @brief 更新playAuthToken的方法,用来更新视频地址
2733
3046
  * @param { IPlayAuthTokenConfig } config
2734
3047
  * @memberof VePlayer
2735
3048
  */
2736
3049
  updateAuthToken(config: IPlayAuthTokenConfig): Promise<void>;
2737
3050
  /**
2738
- * @description 返回当前视频的地址
3051
+ * @brief 返回当前视频的地址
2739
3052
  * @memberof VePlayer
2740
3053
  */
2741
3054
  get src(): any;
2742
3055
  /**
2743
- * @description 设置当前视频的地址
3056
+ * @brief 设置当前视频的地址
2744
3057
  * @notes 会重新拉取新的视频,从0开始起播
2745
3058
  * @memberof VePlayer
2746
3059
  */
@@ -2766,7 +3079,7 @@ declare class VePlayer {
2766
3079
  *
2767
3080
  * @param {IPlayerConfig} config
2768
3081
  * @param { boolean } isNewVideo 是否是新视频,默认true。若为false即表示同一个视频切换地址播放,会在切换前的时间点继续播放
2769
- * @description 默认切换后是暂停状态,如果设置了自动播放,则会自动播放
3082
+ * @brief 默认切换后是暂停状态,如果设置了自动播放,则会自动播放
2770
3083
  * @return{Promise<any>}
2771
3084
  * @memberof VePlayer
2772
3085
  */
@@ -2816,7 +3129,7 @@ declare class VePlayer {
2816
3129
  /**
2817
3130
  * @hidden
2818
3131
  *
2819
- * @description 获取h265软解播放时的播放列表
3132
+ * @brief 获取h265软解播放时的播放列表
2820
3133
  * @memberof VePlayer
2821
3134
  */
2822
3135
  setH265SoftPlayList(): void;
@@ -3262,6 +3575,36 @@ export declare class Subtitle extends Plugin {
3262
3575
  destroy(): void;
3263
3576
  render(): string;
3264
3577
  }
3578
+ export interface WatermarkConfig {
3579
+ enable: boolean;
3580
+ content: string;
3581
+ displayType: 0 | 1 | 2;
3582
+ fontSize: number | string;
3583
+ fontColor: string;
3584
+ opacity: number;
3585
+ tickerSpeed?: "SLOW" | "MODERATE" | "FAST";
3586
+ fontFamily?: string;
3587
+ top?: number;
3588
+ left?: number;
3589
+ bottom?: number;
3590
+ right?: number;
3591
+ }
3592
+ export declare class DynamicWatermarkPlugin extends Plugin {
3593
+ private wm;
3594
+ static get pluginName(): string;
3595
+ static get defaultConfig(): WatermarkConfig & {
3596
+ position: string;
3597
+ };
3598
+ constructor(props: any);
3599
+ afterCreate(): void;
3600
+ start(): void;
3601
+ pause(): void;
3602
+ resume(): void;
3603
+ resize(): void;
3604
+ _initWatermark(): void;
3605
+ destroy(): void;
3606
+ render(): string | HTMLElement;
3607
+ }
3265
3608
  export declare class DefinitionDemotePlugin extends Plugin {
3266
3609
  static get pluginName(): string;
3267
3610
  waitings: number[];
@@ -3723,6 +4066,154 @@ export declare const Events: {
3723
4066
  * 播放列表播放项变更
3724
4067
  */
3725
4068
  PLAY_LIST_ITEM_CHANGE: string;
4069
+ /** {zh}
4070
+ * 播放器完成实例化
4071
+ */
4072
+ /** {en}
4073
+ * The player is instantiated.
4074
+ */
4075
+ READY: string;
4076
+ /** {zh}
4077
+ * 播放器创建video完成,可以开始播放
4078
+ */
4079
+ /** {en}
4080
+ * The player has created the video and the playback is ready to start.
4081
+ */
4082
+ COMPLETE: string;
4083
+ /** {zh}
4084
+ * 播放资源发生变化
4085
+ */
4086
+ /** {en}
4087
+ * The playback address changes.
4088
+ */
4089
+ URL_CHANGE: string;
4090
+ /** {zh}
4091
+ * 播放器聚焦
4092
+ */
4093
+ /** {en}
4094
+ * The player has focus.
4095
+ */
4096
+ PLAYER_FOCUS: string;
4097
+ /** {zh}
4098
+ * 播放器失焦
4099
+ */
4100
+ /** {en}
4101
+ * The player loses focus.
4102
+ */
4103
+ PLAYER_BLUR: string;
4104
+ /** {zh}
4105
+ * 系统全屏状态切换
4106
+ */
4107
+ /** {en}
4108
+ * The player switches to or from full-window mode, in which the player covers the entire desktop.
4109
+ */
4110
+ FULLSCREEN_CHANGE: string;
4111
+ /** {zh}
4112
+ * 网页样式全屏状态切换
4113
+ */
4114
+ /** {en}
4115
+ * The player switches to or from full-screen mode, in which the player covers the browser window.
4116
+ */
4117
+ CSS_FULLSCREEN_CHANGE: string;
4118
+ /**
4119
+ * @brief 画中画播放模式切换
4120
+ */
4121
+ MINI_STATE_CHANGE: string;
4122
+ /** {zh}
4123
+ * 播放器销毁
4124
+ */
4125
+ /** {en}
4126
+ * The player is destroyed.
4127
+ */
4128
+ DESTROY: string;
4129
+ /** {zh}
4130
+ * 播放器重新播放
4131
+ */
4132
+ /** {en}
4133
+ * Replay starts.
4134
+ */
4135
+ REPLAY: string;
4136
+ /**
4137
+ * @brief 重试
4138
+ */
4139
+ RETRY: string;
4140
+ /** {zh}
4141
+ * 清晰度发生变化
4142
+ */
4143
+ /** {en}
4144
+ * The video resolution changes.
4145
+ */
4146
+ DEFINITION_CHANGE: string;
4147
+ /** {zh}
4148
+ * @hidden
4149
+ */
4150
+ /** {en}
4151
+ * @hidden
4152
+ */
4153
+ Before_DEFINITION_CHANGE: string;
4154
+ /** {zh}
4155
+ * @hidden
4156
+ */
4157
+ /** {en}
4158
+ * @hidden
4159
+ */
4160
+ AFTER_DEFINITION_CHANGE: string;
4161
+ /** {zh}
4162
+ * 播放器容器尺寸发生变化
4163
+ */
4164
+ /** {en}
4165
+ * The size of the player container changes.
4166
+ */
4167
+ VIDEO_RESIZE: string;
4168
+ /** {zh}
4169
+ * 画中画状态切换
4170
+ */
4171
+ /** {en}
4172
+ * The player switches to or from Picture-in-Picture (PIP) mode.
4173
+ */
4174
+ PIP_CHANGE: string;
4175
+ /** {zh}
4176
+ * 播放器被旋转
4177
+ */
4178
+ /** {en}
4179
+ * The player is rotated.
4180
+ */
4181
+ ROTATE: string;
4182
+ /** {zh}
4183
+ * 播放器内置快捷键事件触发
4184
+ */
4185
+ /** {en}
4186
+ * A built-in shortcut event occurs within the player.
4187
+ */
4188
+ SHORTCUT: string;
4189
+ /** {zh}
4190
+ * SEI 信息解析
4191
+ */
4192
+ /** {en}
4193
+ * The player parses the SEI information.
4194
+ */
4195
+ SEI_PARSED: string;
4196
+ /** {zh}
4197
+ * 内置插件用户行为触发,所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点
4198
+ */
4199
+ /** {en}
4200
+ * A user event occurs within a built-in plug-in. This event applies to all built-in plug-ins and can be used for tracking user behaviors.
4201
+ */
4202
+ USER_ACTION: string;
4203
+ /** {zh}
4204
+ * 自动播放成功
4205
+ */
4206
+ /** {en}
4207
+ * Autoplay starts successfully.
4208
+ */
4209
+ AUTOPLAY_STARTED: string;
4210
+ /** {zh}
4211
+ * 自动播放失败
4212
+ */
4213
+ /** {en}
4214
+ * Autoplay fails to start.
4215
+ */
4216
+ AUTOPLAY_PREVENTED: string;
3726
4217
  /**
3727
4218
  * 播放器完成创建
3728
4219
  */
@@ -3747,66 +4238,267 @@ export declare const Events: {
3747
4238
  * umd 加载失败
3748
4239
  */
3749
4240
  UMD_LOAD_FAIL: string;
3750
- PLAY: "play";
3751
- PLAYING: "playing";
3752
- ENDED: "ended";
3753
- PAUSE: "pause";
3754
- ERROR: "error";
3755
- SEEKING: "seeking";
3756
- SEEKED: "seeked";
3757
- TIME_UPDATE: "timeupdate";
3758
- WAITING: "waiting";
3759
- CANPLAY: "canplay";
3760
- CANPLAY_THROUGH: "canplaythrough";
3761
- DURATION_CHANGE: "durationchange";
3762
- VOLUME_CHANGE: "volumechange";
3763
- LOADED_DATA: "loadeddata";
3764
- LOADED_METADATA: "loadedmetadata";
3765
- RATE_CHANGE: "ratechange";
3766
- PROGRESS: "progress";
3767
- LOAD_START: "loadstart";
3768
- EMPTIED: "emptied";
3769
- STALLED: "stalled";
3770
- SUSPEND: "suspend";
3771
- ABORT: "abort";
3772
- BUFFER_CHANGE: "bufferedChange";
3773
- PLAYER_FOCUS: "focus";
3774
- PLAYER_BLUR: "blur";
3775
- READY: "ready";
3776
- URL_NULL: "urlNull";
3777
- AUTOPLAY_STARTED: "autoplay_started";
3778
- AUTOPLAY_PREVENTED: "autoplay_was_prevented";
3779
- COMPLETE: "complete";
3780
- REPLAY: "replay";
3781
- DESTROY: "destroy";
3782
- URL_CHANGE: "urlchange";
3783
- DOWNLOAD_SPEED_CHANGE: "download_speed_change";
3784
- FULLSCREEN_CHANGE: "fullscreen_change";
3785
- CSS_FULLSCREEN_CHANGE: "cssFullscreen_change";
3786
- MINI_STATE_CHANGE: "mini_state_change";
3787
- DEFINITION_CHANGE: "definition_change";
3788
- BEFORE_DEFINITION_CHANGE: "before_definition_change";
3789
- AFTER_DEFINITION_CHANGE: "after_definition_change";
3790
- SEI_PARSED: "SEI_PARSED";
3791
- RETRY: "retry";
3792
- VIDEO_RESIZE: "video_resize";
3793
- PIP_CHANGE: "pip_change";
3794
- ROTATE: "rotate";
3795
- SCREEN_SHOT: "screenShot";
3796
- PLAYNEXT: "playnext";
3797
- SHORTCUT: "shortcut";
3798
- XGLOG: "xglog";
3799
- USER_ACTION: "user_action";
3800
- RESET: "reset";
3801
- SOURCE_ERROR: "source_error";
3802
- SOURCE_SUCCESS: "source_success";
3803
- SWITCH_SUBTITLE: "switch_subtitle";
3804
- VIDEO_EVENTS: string[];
3805
- STATS_EVENTS: typeof XgEvents.STATS_EVENTS;
3806
- FPS_STUCK: "fps_stuck";
4241
+ /**
4242
+ * @brief 在播放被终止时触发。例如:当播放中的视频重新开始播放。
4243
+ */
4244
+ ABORT: string;
4245
+ /** {zh}
4246
+ * @brief在媒体数据已经有足够的数据(至少播放数帧)可供播放时触发。
4247
+ **/
4248
+ CANPLAY: string;
4249
+ /** {zh}
4250
+ * @brief表明媒体可以在保持当前的下载速度的情况下不被中断地播放完毕。
4251
+ * @notice 手动设置currentTime会使得firefox触发一次canplaythrough事件,其他浏览器或许不会如此。
4252
+ */
4253
+ CANPLAY_THROUGH: string;
4254
+ /** {zh}
4255
+ * @brief表明媒体的长度发生了改变。例如:在媒体已被加载足够的长度从而得知总长度时会触发这个事件。
4256
+ */
4257
+ DURATION_CHANGE: string;
4258
+ /**
4259
+ * @brief 媒体被清空(初始化)时触发
4260
+ */
4261
+ EMPITED: string;
4262
+ /** {zh}
4263
+ * 视频播放完毕
4264
+ */
4265
+ /** {en}
4266
+ * Video playback ends.
4267
+ */
4268
+ ENDED: string;
4269
+ /** {zh}
4270
+ * 发生错误
4271
+ */
4272
+ ERROR: string;
4273
+ /** {zh}
4274
+ * @brief媒体的第一帧已经加载完毕
4275
+ */
4276
+ LOADED_DATA: string;
4277
+ /**
4278
+ * 媒体的元数据已经加载完毕,playerSdkIns.player.video 可获取所有的video属性
4279
+ */
4280
+ LOADED_META_DATA: string;
4281
+ /** {zh}
4282
+ * 媒体内容开始加载
4283
+ */
4284
+ LOAD_START: string;
4285
+ /** {zh}
4286
+ * 视频暂停播放
4287
+ */
4288
+ /** {en}
4289
+ * Video playback pauses.
4290
+ */
4291
+ PAUSE: string;
4292
+ /** {zh}
4293
+ * @brief 视频开始播放
4294
+ */
4295
+ /** {en}
4296
+ * @brief Video playback starts.
4297
+ */
4298
+ PLAY: string;
4299
+ /** {zh}
4300
+ * 恢复播放(包括暂停后恢复播放或卡顿后恢复播放)
4301
+ */
4302
+ /** {en}
4303
+ * Video playback resumes after a pause or freeze.
4304
+ */
4305
+ PLAYING: string;
4306
+ /**
4307
+ * 媒体下载进度,即已缓存播放数据进度
4308
+ */
4309
+ PROGRESS: string;
4310
+ /**
4311
+ * 播放速率变化
4312
+ */
4313
+ RATE_CHANGE: string;
4314
+ /**
4315
+ * 在跳跃(seek)操作完成时触发
4316
+ */
4317
+ SEEKED: string;
4318
+ /**
4319
+ * 在跳跃(seek)操作开始时触发
4320
+ */
4321
+ SEEKING: string;
4322
+ /**
4323
+ * 在尝试获取媒体数据,但数据不可用时触发。
4324
+ */
4325
+ STALLED: string;
4326
+ /**
4327
+ * 在媒体资源加载终止时触发,这可能是因为下载已完成或因为其他原因暂停。
4328
+ */
4329
+ SUSPEND: string;
4330
+ /** {zh}
4331
+ * 视频播放时间更新
4332
+ */
4333
+ /** {en}
4334
+ * The video playback time is updated.
4335
+ */
4336
+ TIME_UPDATE: string;
4337
+ /** {zh}
4338
+ * 视频音量发生变化
4339
+ */
4340
+ /** {en}
4341
+ * The video volume changes.
4342
+ */
4343
+ VOLUME_CHANGE: string;
4344
+ /** {zh}
4345
+ * 等待加载数据
4346
+ */
4347
+ /** {en}
4348
+ * The player is loading data.
4349
+ */
4350
+ WAITING: string;
3807
4351
  };
3808
4352
  export declare const Event: {
3809
4353
  SDKEvents: {
4354
+ /** {zh}
4355
+ * 播放器完成实例化
4356
+ */
4357
+ /** {en}
4358
+ * The player is instantiated.
4359
+ */
4360
+ READY: string;
4361
+ /** {zh}
4362
+ * 播放器创建video完成,可以开始播放
4363
+ */
4364
+ /** {en}
4365
+ * The player has created the video and the playback is ready to start.
4366
+ */
4367
+ COMPLETE: string;
4368
+ /** {zh}
4369
+ * 播放资源发生变化
4370
+ */
4371
+ /** {en}
4372
+ * The playback address changes.
4373
+ */
4374
+ URL_CHANGE: string;
4375
+ /** {zh}
4376
+ * 播放器聚焦
4377
+ */
4378
+ /** {en}
4379
+ * The player has focus.
4380
+ */
4381
+ PLAYER_FOCUS: string;
4382
+ /** {zh}
4383
+ * 播放器失焦
4384
+ */
4385
+ /** {en}
4386
+ * The player loses focus.
4387
+ */
4388
+ PLAYER_BLUR: string;
4389
+ /** {zh}
4390
+ * 系统全屏状态切换
4391
+ */
4392
+ /** {en}
4393
+ * The player switches to or from full-window mode, in which the player covers the entire desktop.
4394
+ */
4395
+ FULLSCREEN_CHANGE: string;
4396
+ /** {zh}
4397
+ * 网页样式全屏状态切换
4398
+ */
4399
+ /** {en}
4400
+ * The player switches to or from full-screen mode, in which the player covers the browser window.
4401
+ */
4402
+ CSS_FULLSCREEN_CHANGE: string;
4403
+ /**
4404
+ * @brief 画中画播放模式切换
4405
+ */
4406
+ MINI_STATE_CHANGE: string;
4407
+ /** {zh}
4408
+ * 播放器销毁
4409
+ */
4410
+ /** {en}
4411
+ * The player is destroyed.
4412
+ */
4413
+ DESTROY: string;
4414
+ /** {zh}
4415
+ * 播放器重新播放
4416
+ */
4417
+ /** {en}
4418
+ * Replay starts.
4419
+ */
4420
+ REPLAY: string;
4421
+ /**
4422
+ * @brief 重试
4423
+ */
4424
+ RETRY: string;
4425
+ /** {zh}
4426
+ * 清晰度发生变化
4427
+ */
4428
+ /** {en}
4429
+ * The video resolution changes.
4430
+ */
4431
+ DEFINITION_CHANGE: string;
4432
+ /** {zh}
4433
+ * @hidden
4434
+ */
4435
+ /** {en}
4436
+ * @hidden
4437
+ */
4438
+ Before_DEFINITION_CHANGE: string;
4439
+ /** {zh}
4440
+ * @hidden
4441
+ */
4442
+ /** {en}
4443
+ * @hidden
4444
+ */
4445
+ AFTER_DEFINITION_CHANGE: string;
4446
+ /** {zh}
4447
+ * 播放器容器尺寸发生变化
4448
+ */
4449
+ /** {en}
4450
+ * The size of the player container changes.
4451
+ */
4452
+ VIDEO_RESIZE: string;
4453
+ /** {zh}
4454
+ * 画中画状态切换
4455
+ */
4456
+ /** {en}
4457
+ * The player switches to or from Picture-in-Picture (PIP) mode.
4458
+ */
4459
+ PIP_CHANGE: string;
4460
+ /** {zh}
4461
+ * 播放器被旋转
4462
+ */
4463
+ /** {en}
4464
+ * The player is rotated.
4465
+ */
4466
+ ROTATE: string;
4467
+ /** {zh}
4468
+ * 播放器内置快捷键事件触发
4469
+ */
4470
+ /** {en}
4471
+ * A built-in shortcut event occurs within the player.
4472
+ */
4473
+ SHORTCUT: string;
4474
+ /** {zh}
4475
+ * SEI 信息解析
4476
+ */
4477
+ /** {en}
4478
+ * The player parses the SEI information.
4479
+ */
4480
+ SEI_PARSED: string;
4481
+ /** {zh}
4482
+ * 内置插件用户行为触发,所有内置插件用户行为交互都会下发该事件,可用于用户行为埋点
4483
+ */
4484
+ /** {en}
4485
+ * A user event occurs within a built-in plug-in. This event applies to all built-in plug-ins and can be used for tracking user behaviors.
4486
+ */
4487
+ USER_ACTION: string;
4488
+ /** {zh}
4489
+ * 自动播放成功
4490
+ */
4491
+ /** {en}
4492
+ * Autoplay starts successfully.
4493
+ */
4494
+ AUTOPLAY_STARTED: string;
4495
+ /** {zh}
4496
+ * 自动播放失败
4497
+ */
4498
+ /** {en}
4499
+ * Autoplay fails to start.
4500
+ */
4501
+ AUTOPLAY_PREVENTED: string;
3810
4502
  /**
3811
4503
  * 播放器完成创建
3812
4504
  */