@volcengine/veplayer 2.3.0-rc.0 → 2.3.0-rc.2
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/esm/index.d.ts +1681 -219
- package/esm/veplayer.biz.live.development.js +18 -1
- package/esm/veplayer.d.ts +3585 -494
- package/esm/veplayer.development.js +274 -54
- package/esm/veplayer.live.d.ts +3585 -494
- package/esm/veplayer.live.development.js +274 -54
- package/esm/veplayer.live.production.js +2 -2
- package/esm/veplayer.production.js +2 -2
- package/esm/veplayer.vod.d.ts +1681 -219
- package/esm/veplayer.vod.development.js +255 -52
- package/esm/veplayer.vod.production.js +1 -1
- package/package.json +1 -1
- package/umd/index.d.ts +1681 -219
- package/umd/veplayer.biz.live.development.js +18 -1
- package/umd/veplayer.d.ts +3585 -494
- package/umd/veplayer.development.js +274 -54
- package/umd/veplayer.live.d.ts +3585 -494
- package/umd/veplayer.live.development.js +274 -54
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +1681 -219
- package/umd/veplayer.vod.development.js +255 -52
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +3585 -494
- package/veplayer.live.d.ts +3585 -494
- package/veplayer.vod.d.ts +1681 -219
package/esm/veplayer.vod.d.ts
CHANGED
|
@@ -110,7 +110,14 @@ declare class Definition implements XGDefinition {
|
|
|
110
110
|
set url(url: string);
|
|
111
111
|
next(): DefinitionUrl;
|
|
112
112
|
}
|
|
113
|
-
/**
|
|
113
|
+
/** {zh}
|
|
114
|
+
* @list option
|
|
115
|
+
* @kind property
|
|
116
|
+
* @id Definition
|
|
117
|
+
* @name Definition
|
|
118
|
+
*
|
|
119
|
+
*/
|
|
120
|
+
/** {en}
|
|
114
121
|
* @list option
|
|
115
122
|
* @kind property
|
|
116
123
|
* @id Definition
|
|
@@ -122,26 +129,46 @@ interface ExposedDefinition {
|
|
|
122
129
|
* @brief 播放地址。
|
|
123
130
|
* @default 无
|
|
124
131
|
*/
|
|
132
|
+
/** {en}
|
|
133
|
+
* @brief The playback address.
|
|
134
|
+
*/
|
|
125
135
|
url: string;
|
|
126
136
|
/** {zh}
|
|
127
137
|
* @brief 清晰度标识(唯一值)。
|
|
128
138
|
* @default 无
|
|
129
139
|
*
|
|
130
140
|
*/
|
|
141
|
+
/** {en}
|
|
142
|
+
* @brief The resolution ID. This value must be unique.
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
131
145
|
definition: string;
|
|
132
146
|
/** {zh}
|
|
133
147
|
* @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
|
|
134
148
|
* @default 无
|
|
135
149
|
*/
|
|
150
|
+
/** {en}
|
|
151
|
+
* @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
|
|
152
|
+
*/
|
|
136
153
|
text?: Record<Lang, string> | string;
|
|
137
154
|
/** {zh}
|
|
138
155
|
* @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
139
156
|
* @default 无
|
|
140
157
|
*
|
|
141
158
|
*/
|
|
159
|
+
/** {en}
|
|
160
|
+
* @brief The backup pull stream address for the current resolution. You can set multiple backup addresses. When the player fails to pull a stream from the current address, it will loop between the current and the backup addresses until it successfully pulls a stream.
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
142
163
|
fallbackUrls?: string[];
|
|
143
164
|
}
|
|
144
|
-
/**
|
|
165
|
+
/** {zh}
|
|
166
|
+
* @list option
|
|
167
|
+
* @kind property
|
|
168
|
+
* @id Source
|
|
169
|
+
* @alias Source
|
|
170
|
+
*/
|
|
171
|
+
/** {en}
|
|
145
172
|
* @list option
|
|
146
173
|
* @kind property
|
|
147
174
|
* @id Source
|
|
@@ -152,18 +179,29 @@ interface ExposedSource {
|
|
|
152
179
|
* @brief 线路标识(唯一值)。
|
|
153
180
|
* @default 无
|
|
154
181
|
*/
|
|
182
|
+
/** {en}
|
|
183
|
+
* @brief The playback source ID. This value must be unique.
|
|
184
|
+
*/
|
|
155
185
|
name?: string;
|
|
156
186
|
/** {zh}
|
|
157
187
|
* @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
|
|
158
188
|
* @default 无
|
|
159
189
|
*
|
|
160
190
|
*/
|
|
191
|
+
/** {en}
|
|
192
|
+
* @brief The display name of the live stream source. Multiple languages are supported. For example, you set it to `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`.
|
|
193
|
+
*
|
|
194
|
+
*/
|
|
161
195
|
text?: Record<Lang, string> | string;
|
|
162
196
|
/** {zh}
|
|
163
197
|
* @brief 该线路下清晰度列表。
|
|
164
198
|
* @default 无
|
|
165
199
|
*
|
|
166
200
|
*/
|
|
201
|
+
/** {en}
|
|
202
|
+
* @brief A list of resolutions of the current source.
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
167
205
|
definitions: Array<ExposedDefinition | string>;
|
|
168
206
|
}
|
|
169
207
|
interface CompoundSources {
|
|
@@ -239,27 +277,44 @@ declare module MobilePlayerPanelWrapper {
|
|
|
239
277
|
export { MobilePlayerPanel };
|
|
240
278
|
}
|
|
241
279
|
import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
|
|
242
|
-
/**
|
|
280
|
+
/** {zh}
|
|
243
281
|
* @detail option
|
|
244
282
|
* @brief **清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
245
283
|
*/
|
|
284
|
+
/** {en}
|
|
285
|
+
* @detail option
|
|
286
|
+
* @brief The panel style for resolution and live stream source selection. This setting is effective on mobile devices only.
|
|
287
|
+
*/
|
|
246
288
|
declare enum ListType {
|
|
247
289
|
/** {zh}
|
|
248
290
|
* @brief 全屏布局
|
|
249
291
|
* @hidden
|
|
250
292
|
*/
|
|
293
|
+
/** {en}
|
|
294
|
+
* @brief Fullscreen layout.
|
|
295
|
+
* @hidden
|
|
296
|
+
*/
|
|
251
297
|
Middle = "middle",
|
|
252
298
|
/** {zh}
|
|
253
299
|
* @brief 底部抽屉
|
|
254
300
|
*/
|
|
301
|
+
/** {en}
|
|
302
|
+
* @brief Bottom navigation drawer.
|
|
303
|
+
*/
|
|
255
304
|
Bottom = "bottom",
|
|
256
305
|
/** {zh}
|
|
257
306
|
* @brief 右侧抽屉,常用于全屏时展示
|
|
258
307
|
*/
|
|
308
|
+
/** {en}
|
|
309
|
+
* @brief Right navigation drawer. This is often used for fullscreen display.
|
|
310
|
+
*/
|
|
259
311
|
Fullscreen = "fullscreen",
|
|
260
312
|
/** {zh}
|
|
261
313
|
* @brief 窗口蒙层展示
|
|
262
314
|
*/
|
|
315
|
+
/** {en}
|
|
316
|
+
* @brief Overlay.
|
|
317
|
+
*/
|
|
263
318
|
Inner = "inner"
|
|
264
319
|
}
|
|
265
320
|
interface ListItem {
|
|
@@ -341,203 +396,363 @@ declare class OptionsIcon extends Plugin {
|
|
|
341
396
|
render(): string;
|
|
342
397
|
private _getListType;
|
|
343
398
|
}
|
|
344
|
-
/**
|
|
399
|
+
/** {zh}
|
|
400
|
+
* @detail error
|
|
401
|
+
*/
|
|
402
|
+
/** {en}
|
|
345
403
|
* @detail error
|
|
346
404
|
*/
|
|
347
405
|
declare enum Level {
|
|
348
|
-
/**
|
|
406
|
+
/** {zh}
|
|
349
407
|
* @brief 严重
|
|
350
408
|
*
|
|
351
409
|
*/
|
|
410
|
+
/** {en}
|
|
411
|
+
* @brief Fatal.
|
|
412
|
+
*
|
|
413
|
+
*/
|
|
352
414
|
Fatal = "Fatal",
|
|
353
|
-
/**
|
|
415
|
+
/** {zh}
|
|
354
416
|
* @brief 报错
|
|
355
417
|
*/
|
|
418
|
+
/** {en}
|
|
419
|
+
* @brief Error.
|
|
420
|
+
*/
|
|
356
421
|
Error = "Error"
|
|
357
422
|
}
|
|
358
423
|
declare enum ErrorCode {
|
|
359
|
-
/**
|
|
424
|
+
/** {zh}
|
|
360
425
|
* @brief 视频解析错误
|
|
361
426
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
362
427
|
*/
|
|
428
|
+
/** {en}
|
|
429
|
+
* @brief Video parsing error.
|
|
430
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
431
|
+
*/
|
|
363
432
|
MANIFEST_HLS_ERROR = 1100,
|
|
364
|
-
/**
|
|
433
|
+
/** {zh}
|
|
365
434
|
* @brief 视频解析错误
|
|
366
435
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
367
436
|
*/
|
|
437
|
+
/** {en}
|
|
438
|
+
* @brief Video parsing error.
|
|
439
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
440
|
+
*/
|
|
368
441
|
MANIFEST_DASH_ERROR = 1200,
|
|
369
|
-
/**
|
|
442
|
+
/** {zh}
|
|
370
443
|
* @brief 网络错误
|
|
371
444
|
* @solution 请检查当前网络环境或播放地址是否合法。
|
|
372
445
|
*/
|
|
446
|
+
/** {en}
|
|
447
|
+
* @brief Network error.
|
|
448
|
+
* @solution Please check the current network environment and ensure the pull stream address is valid.
|
|
449
|
+
*/
|
|
373
450
|
NETWORK = 2100,
|
|
374
|
-
/**
|
|
451
|
+
/** {zh}
|
|
375
452
|
* @brief 网络请求超时
|
|
376
453
|
* @solution 请检查拉流地址是否合法。
|
|
377
454
|
*/
|
|
455
|
+
/** {en}
|
|
456
|
+
* @brief Network request timed out
|
|
457
|
+
* @solution Please check whether the pull stream address is valid.
|
|
458
|
+
*/
|
|
378
459
|
NETWORK_TIMEOUT = 2101,
|
|
379
|
-
/**
|
|
460
|
+
/** {zh}
|
|
380
461
|
* @brief 网络请求 403
|
|
381
462
|
* @solution 请检查拉流地址鉴权信息。
|
|
382
463
|
*/
|
|
464
|
+
/** {en}
|
|
465
|
+
* @brief The player received a 403 response code.
|
|
466
|
+
* @solution Check the authentication information in the pull stream address.
|
|
467
|
+
*/
|
|
383
468
|
NETWORK_FORBIDDEN = 2103,
|
|
384
|
-
/**
|
|
469
|
+
/** {zh}
|
|
385
470
|
* @brief 网络请求 404
|
|
386
471
|
* @solution 请检查拉流地址是否合法。
|
|
387
472
|
*/
|
|
473
|
+
/** {en}
|
|
474
|
+
* @brief The player received a 404 response code.
|
|
475
|
+
* @solution Check whether the pull stream address is valid.
|
|
476
|
+
*/
|
|
388
477
|
NETWORK_NOTFOUND = 2104,
|
|
389
|
-
/**
|
|
478
|
+
/** {zh}
|
|
390
479
|
* @brief 网络请求 206
|
|
391
480
|
* @solution 请检查拉流地址是否合法。
|
|
392
481
|
*/
|
|
482
|
+
/** {en}
|
|
483
|
+
* @brief The player received a 206 response code.
|
|
484
|
+
* @solution Check whether the pull stream address is valid.
|
|
485
|
+
*/
|
|
393
486
|
NETWORK_RANGE_NOT_SATISFIABLE = 2116,
|
|
394
|
-
/**
|
|
487
|
+
/** {zh}
|
|
395
488
|
* @brief 视频解析错误
|
|
396
489
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
397
490
|
*/
|
|
491
|
+
/** {en}
|
|
492
|
+
* @brief Video parsing error.
|
|
493
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
494
|
+
*/
|
|
398
495
|
DEMUX_FLV_ERROR = 3100,
|
|
399
|
-
/**
|
|
496
|
+
/** {zh}
|
|
400
497
|
* @brief 视频解析错误
|
|
401
498
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
402
499
|
*/
|
|
500
|
+
/** {en}
|
|
501
|
+
* @brief Video parsing error.
|
|
502
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
503
|
+
*/
|
|
403
504
|
DEMUX_HLS_ERROR = 3200,
|
|
404
|
-
/**
|
|
505
|
+
/** {zh}
|
|
405
506
|
* @brief 视频解析错误
|
|
406
507
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
407
508
|
*
|
|
408
509
|
*/
|
|
510
|
+
/** {en}
|
|
511
|
+
* @brief Video parsing error.
|
|
512
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
513
|
+
*
|
|
514
|
+
*/
|
|
409
515
|
DEMUX_MP4_ERROR = 3300,
|
|
410
|
-
/**
|
|
516
|
+
/** {zh}
|
|
411
517
|
* @brief 视频解析错误
|
|
412
518
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
413
519
|
*
|
|
414
520
|
*/
|
|
521
|
+
/** {en}
|
|
522
|
+
* @brief Video parsing error.
|
|
523
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
524
|
+
*
|
|
525
|
+
*/
|
|
415
526
|
DEMUX_FMP4_ERROR = 3400,
|
|
416
|
-
/**
|
|
527
|
+
/** {zh}
|
|
417
528
|
* @brief 视频解析错误
|
|
418
529
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
419
530
|
*
|
|
420
531
|
*/
|
|
532
|
+
/** {en}
|
|
533
|
+
* @brief Video parsing error.
|
|
534
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
535
|
+
*
|
|
536
|
+
*/
|
|
421
537
|
DEMUX_SIDX_ERROR = 3410,
|
|
422
|
-
/**
|
|
538
|
+
/** {zh}
|
|
423
539
|
* @brief 视频解析错误
|
|
424
540
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
425
541
|
*
|
|
426
542
|
*/
|
|
543
|
+
/** {en}
|
|
544
|
+
* @brief Video parsing error.
|
|
545
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
546
|
+
*
|
|
547
|
+
*/
|
|
427
548
|
REMUX_FMP4_ERROR = 4100,
|
|
428
|
-
/**
|
|
549
|
+
/** {zh}
|
|
429
550
|
* @brief 视频解析错误
|
|
430
551
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
431
552
|
*
|
|
432
553
|
*/
|
|
554
|
+
/** {en}
|
|
555
|
+
* @brief Video parsing error.
|
|
556
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
557
|
+
*
|
|
558
|
+
*/
|
|
433
559
|
REMUX_MP4_ERROR = 4200,
|
|
434
|
-
/**
|
|
560
|
+
/** {zh}
|
|
435
561
|
* @brief 获取数据过程被中止
|
|
436
562
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
437
563
|
*/
|
|
564
|
+
/** {en}
|
|
565
|
+
* @brief The process of obtaining data was aborted.
|
|
566
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
567
|
+
*/
|
|
438
568
|
MEDIA_ERR_ABORTED = 5101,
|
|
439
|
-
/**
|
|
569
|
+
/** {zh}
|
|
440
570
|
* @brief 网络发生错误,无法成功获取媒体文件
|
|
441
571
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
442
572
|
*/
|
|
573
|
+
/** {en}
|
|
574
|
+
* @brief A network error occurred and the media file could not be successfully obtained.
|
|
575
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
576
|
+
*/
|
|
443
577
|
MEDIA_ERR_NETWORK = 5102,
|
|
444
|
-
/**
|
|
578
|
+
/** {zh}
|
|
445
579
|
* @brief 浏览器在解码媒体资源时发生错误
|
|
446
580
|
* @solution
|
|
447
581
|
* 1. 请检查原始视频是否正常;
|
|
448
582
|
* 2. 重新进行转码和播放;
|
|
449
583
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
450
584
|
*/
|
|
585
|
+
/** {en}
|
|
586
|
+
* @brief An error occurred to the browser while decoding the media resources.
|
|
587
|
+
* @solution
|
|
588
|
+
* 1. Check whether there is any issue with the original video.
|
|
589
|
+
* 2. Re-transcode the video and play it again.
|
|
590
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
591
|
+
*/
|
|
451
592
|
MEDIA_ERR_DECODE = 5103,
|
|
452
|
-
/**
|
|
593
|
+
/** {zh}
|
|
453
594
|
* @brief 因视频格式不支持、服务器或网络的问题造成视频无法加载
|
|
454
595
|
* @solution
|
|
455
596
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
456
597
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
457
598
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
458
599
|
*/
|
|
600
|
+
/** {en}
|
|
601
|
+
* @brief The video cannot be loaded due to unsupported video format or server or network issues.
|
|
602
|
+
* @solution
|
|
603
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
604
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
605
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
606
|
+
*/
|
|
459
607
|
MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
|
|
460
|
-
/**
|
|
608
|
+
/** {zh}
|
|
461
609
|
* @brief 当前浏览器不支持视频解码
|
|
462
610
|
* @solution
|
|
463
611
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
464
612
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
465
613
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
466
614
|
*/
|
|
615
|
+
/** {en}
|
|
616
|
+
* @brief The current browser does not support video decoding.
|
|
617
|
+
* @solution
|
|
618
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
619
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
620
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
621
|
+
*/
|
|
467
622
|
MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
|
|
468
|
-
/**
|
|
623
|
+
/** {zh}
|
|
469
624
|
* @brief 当前播放地址为空
|
|
470
625
|
* @solution 请检查必要参数 `url` 或 `playlist` 是否传入。
|
|
471
626
|
*/
|
|
627
|
+
/** {en}
|
|
628
|
+
* @brief The current pull stream address is empty.
|
|
629
|
+
* @solution Check whether 'url' or 'playlist' is specified.
|
|
630
|
+
*/
|
|
472
631
|
MEDIA_ERR_URL_EMPTY = 5106,
|
|
473
|
-
/**
|
|
632
|
+
/** {zh}
|
|
474
633
|
* @brief 播放异常
|
|
475
634
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
476
635
|
*/
|
|
636
|
+
/** {en}
|
|
637
|
+
* @brief A playback issue occurred.
|
|
638
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
639
|
+
*/
|
|
477
640
|
MEDIA_MSE_ADD_SB = 5200,
|
|
478
|
-
/**
|
|
641
|
+
/** {zh}
|
|
479
642
|
* @brief 播放异常
|
|
480
643
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
481
644
|
*/
|
|
645
|
+
/** {en}
|
|
646
|
+
* @brief A playback issue occurred.
|
|
647
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
648
|
+
*/
|
|
482
649
|
MEDIA_MSE_APPEND_BUFFER = 5201,
|
|
483
|
-
/**
|
|
650
|
+
/** {zh}
|
|
484
651
|
* @brief 播放异常
|
|
485
652
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
486
653
|
*/
|
|
654
|
+
/** {en}
|
|
655
|
+
* @brief A playback issue occurred.
|
|
656
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
657
|
+
*/
|
|
487
658
|
MEDIA_MSE_OTHER = 5202,
|
|
488
|
-
/**
|
|
659
|
+
/** {zh}
|
|
489
660
|
* @brief 播放异常
|
|
490
661
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
491
662
|
*/
|
|
663
|
+
/** {en}
|
|
664
|
+
* @brief A playback issue occurred.
|
|
665
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
666
|
+
*/
|
|
492
667
|
MEDIA_MSE_FULL = 5203,
|
|
493
|
-
/**
|
|
668
|
+
/** {zh}
|
|
494
669
|
* @brief 播放异常
|
|
495
670
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
496
671
|
*/
|
|
672
|
+
/** {en}
|
|
673
|
+
* @brief A playback issue occurred.
|
|
674
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
675
|
+
*/
|
|
497
676
|
MEDIA_MSE_HIJACK = 5204,
|
|
498
|
-
/**
|
|
677
|
+
/** {zh}
|
|
499
678
|
* @brief 播放异常
|
|
500
679
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
501
680
|
*/
|
|
681
|
+
/** {en}
|
|
682
|
+
* @brief A playback issue occurred.
|
|
683
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
684
|
+
*/
|
|
502
685
|
MEDIA_EME_HIJACK = 5301,
|
|
503
|
-
/**
|
|
686
|
+
/** {zh}
|
|
504
687
|
* @brief DRM 权限校验失败
|
|
505
688
|
* @hidden
|
|
506
689
|
*/
|
|
690
|
+
/** {en}
|
|
691
|
+
* @brief DRM authentication failed.
|
|
692
|
+
* @hidden
|
|
693
|
+
*/
|
|
507
694
|
DRM_LICENSE = 7100,
|
|
508
|
-
/**
|
|
695
|
+
/** {zh}
|
|
509
696
|
* @brief DRM 权限校验失败
|
|
510
697
|
* @hidden
|
|
511
698
|
*/
|
|
699
|
+
/** {en}
|
|
700
|
+
* @brief DRM authentication failed.
|
|
701
|
+
* @hidden
|
|
702
|
+
*/
|
|
512
703
|
DRM_CUSTOM_LICENSE = 7200,
|
|
513
|
-
/**
|
|
704
|
+
/** {zh}
|
|
514
705
|
* @brief 播放异常
|
|
515
706
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
516
707
|
*/
|
|
708
|
+
/** {en}
|
|
709
|
+
* @brief A playback issue occurred.
|
|
710
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
711
|
+
*/
|
|
517
712
|
OTHER = 8000,
|
|
518
|
-
/**
|
|
713
|
+
/** {zh}
|
|
519
714
|
* @brief 播放异常
|
|
520
715
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
521
716
|
*/
|
|
717
|
+
/** {en}
|
|
718
|
+
* @brief A playback issue occurred.
|
|
719
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
720
|
+
*/
|
|
522
721
|
RUNTIME_NO_CANPLAY_ERROR = 9001,
|
|
523
|
-
/**
|
|
722
|
+
/** {zh}
|
|
524
723
|
* @brief 播放异常
|
|
525
724
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
526
725
|
*/
|
|
726
|
+
/** {en}
|
|
727
|
+
* @brief A playback issue occurred.
|
|
728
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
729
|
+
*/
|
|
527
730
|
RUNTIME_BUFFERBREAK_ERROR = 9002,
|
|
528
|
-
/**
|
|
731
|
+
/** {zh}
|
|
529
732
|
* @brief 播放异常
|
|
530
733
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
531
734
|
*/
|
|
735
|
+
/** {en}
|
|
736
|
+
* @brief A playback issue occurred.
|
|
737
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
738
|
+
*/
|
|
532
739
|
RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
|
|
533
740
|
// veplayer 报错
|
|
534
|
-
/**
|
|
741
|
+
/** {zh}
|
|
535
742
|
* @brief CDN 异步获取失败
|
|
536
743
|
* @solution 请刷新重试或者检查网络环境。
|
|
537
744
|
*
|
|
538
745
|
*/
|
|
746
|
+
/** {en}
|
|
747
|
+
* @brief CDN asynchronous fetch failed.
|
|
748
|
+
* @solution Refresh the page or check the network environment.
|
|
749
|
+
*
|
|
750
|
+
*/
|
|
539
751
|
MODULE_LOAD_ERROR = 110,
|
|
540
|
-
/**
|
|
752
|
+
/** {zh}
|
|
753
|
+
* @hidden
|
|
754
|
+
*/
|
|
755
|
+
/** {en}
|
|
541
756
|
* @hidden
|
|
542
757
|
*/
|
|
543
758
|
UNKNOWN = "UNKNOWN"
|
|
@@ -561,38 +776,66 @@ interface ErrorInfo<T = TextKey> {
|
|
|
561
776
|
ext?: any;
|
|
562
777
|
error?: Error;
|
|
563
778
|
}
|
|
564
|
-
/**
|
|
779
|
+
/** {zh}
|
|
565
780
|
* @list error
|
|
566
781
|
* @detail error
|
|
567
782
|
* @brief 错误对象
|
|
568
783
|
* @name VeError
|
|
569
784
|
* @id VeError
|
|
570
785
|
*/
|
|
786
|
+
/** {en}
|
|
787
|
+
* @list error
|
|
788
|
+
* @detail error
|
|
789
|
+
* @brief The error object.
|
|
790
|
+
* @name VeError
|
|
791
|
+
* @id VeError
|
|
792
|
+
*/
|
|
571
793
|
declare class VeError<T extends string = TextKey> extends Error {
|
|
572
794
|
/**
|
|
573
|
-
* @brief
|
|
795
|
+
* @brief 错误码。
|
|
796
|
+
*/
|
|
797
|
+
/** {en}
|
|
798
|
+
* @brief The error code.
|
|
574
799
|
*/
|
|
575
800
|
readonly errorCode: ErrorCode;
|
|
576
|
-
/**
|
|
801
|
+
/** {zh}
|
|
577
802
|
* @brief 错误等级。
|
|
578
803
|
*/
|
|
804
|
+
/** {en}
|
|
805
|
+
* @brief The error level.
|
|
806
|
+
*/
|
|
579
807
|
readonly level?: Level;
|
|
580
|
-
/**
|
|
808
|
+
/** {zh}
|
|
581
809
|
* @brief 错误信息。
|
|
582
810
|
*/
|
|
811
|
+
/** {en}
|
|
812
|
+
* @brief The error message.
|
|
813
|
+
*/
|
|
583
814
|
message: string;
|
|
584
|
-
/**
|
|
815
|
+
/** {zh}
|
|
585
816
|
* @brief 其他错误信息。
|
|
586
817
|
*/
|
|
818
|
+
/** {en}
|
|
819
|
+
* @brief Other error messages.
|
|
820
|
+
*/
|
|
587
821
|
readonly ext?: any;
|
|
588
|
-
/**
|
|
822
|
+
/** {zh}
|
|
823
|
+
* @hidden
|
|
824
|
+
* @param error
|
|
825
|
+
* @param i18n
|
|
826
|
+
*/
|
|
827
|
+
/** {en}
|
|
589
828
|
* @hidden
|
|
590
829
|
* @param error
|
|
591
830
|
* @param i18n
|
|
592
831
|
*/
|
|
593
832
|
constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
|
|
594
833
|
}
|
|
595
|
-
/**
|
|
834
|
+
/** {zh}
|
|
835
|
+
* @list option
|
|
836
|
+
* @kind property
|
|
837
|
+
*/
|
|
838
|
+
/** {en}
|
|
596
839
|
* @list option
|
|
597
840
|
* @kind property
|
|
598
841
|
*/
|
|
@@ -601,26 +844,46 @@ type ErrorConfig = {
|
|
|
601
844
|
* @brief 是否展示报错图片。
|
|
602
845
|
* @default true
|
|
603
846
|
*/
|
|
847
|
+
/** {en}
|
|
848
|
+
* @brief Whether to display the error image.
|
|
849
|
+
* @default true
|
|
850
|
+
*/
|
|
604
851
|
showErrorImg?: boolean;
|
|
605
852
|
/** {zh}
|
|
606
853
|
* @brief 是否展示报错提示。
|
|
607
854
|
* @default true
|
|
608
855
|
*/
|
|
856
|
+
/** {en}
|
|
857
|
+
* @brief Whether to display the error message.
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
609
860
|
showErrorTip?: boolean;
|
|
610
861
|
/** {zh}
|
|
611
862
|
* @brief 是否展示刷新按钮。
|
|
612
863
|
* @default true
|
|
613
864
|
*/
|
|
865
|
+
/** {en}
|
|
866
|
+
* @brief Whether to display the refresh button.
|
|
867
|
+
* @default true
|
|
868
|
+
*/
|
|
614
869
|
showRefresh?: boolean;
|
|
615
870
|
/** {zh}
|
|
616
871
|
* @brief 自定义报错显示。
|
|
617
872
|
* @default 无
|
|
618
873
|
*/
|
|
874
|
+
/** {en}
|
|
875
|
+
* @brief Custom error message.
|
|
876
|
+
* @default None
|
|
877
|
+
*/
|
|
619
878
|
errorTipsText?: string | Record<Lang, string>;
|
|
620
879
|
/** {zh}
|
|
621
880
|
* @brief 更多提示信息。
|
|
622
881
|
* @default 无
|
|
623
882
|
*/
|
|
883
|
+
/** {en}
|
|
884
|
+
* @brief More tips.
|
|
885
|
+
* @default None
|
|
886
|
+
*/
|
|
624
887
|
extraTips?: {
|
|
625
888
|
label: string | Record<Lang, string>;
|
|
626
889
|
value: string | Record<Lang, string>;
|
|
@@ -667,7 +930,11 @@ declare class Error extends Plugin {
|
|
|
667
930
|
private _handleRefresh;
|
|
668
931
|
private _renderRefresh;
|
|
669
932
|
}
|
|
670
|
-
/**
|
|
933
|
+
/** {zh}
|
|
934
|
+
* @list option
|
|
935
|
+
* @kind property
|
|
936
|
+
*/
|
|
937
|
+
/** {en}
|
|
671
938
|
* @list option
|
|
672
939
|
* @kind property
|
|
673
940
|
*/
|
|
@@ -676,16 +943,28 @@ interface DefinitionConfig {
|
|
|
676
943
|
* @brief 等待超时的时间阈值,单位为 ms。等待超过该值,会抛出 `DEFINITION_FALLBACK` 事件,如果 `needFallback` 为 `true` 则会提示清晰度降级。
|
|
677
944
|
* @default 5000
|
|
678
945
|
*/
|
|
946
|
+
/** {en}
|
|
947
|
+
* @brief The maximum wait time before a fallback, in milliseconds. If the wait time exceeds this value, a `DEFINITION_FALLBACK` event will occur, and if `needFallback` is set to `true`, the player will fall back to a lower resolution.
|
|
948
|
+
* @default 5000
|
|
949
|
+
*/
|
|
679
950
|
longWaitingTime?: number;
|
|
680
951
|
/** {zh}
|
|
681
952
|
* @brief 是否开启清晰度降级。
|
|
682
953
|
* @default false
|
|
683
954
|
*/
|
|
955
|
+
/** {en}
|
|
956
|
+
* @brief Whether to enable resolution fallback.
|
|
957
|
+
* @default false
|
|
958
|
+
*/
|
|
684
959
|
needFallback?: boolean;
|
|
685
960
|
/** {zh}
|
|
686
961
|
* @brief 降级顺序,按照数组顺序依次降级,数组中的元素与 playlist 中的 definition 相对应。
|
|
687
962
|
* @default ['uhd', 'hd', 'sd', 'ld', 'ao']
|
|
688
963
|
*/
|
|
964
|
+
/** {en}
|
|
965
|
+
* @brief The order of fallback. The player will fall back to each resolution according to the order of the array element. The values of the array elements should correspond to the value of the `definition` in the playlist.
|
|
966
|
+
* @default "['uhd', 'hd ',' sd ',' ld ',' ao ']"
|
|
967
|
+
*/
|
|
689
968
|
demotePriority?: string[];
|
|
690
969
|
}
|
|
691
970
|
interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
@@ -693,51 +972,85 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
693
972
|
* @brief 指定播放器容器 ID,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
694
973
|
* @default 'veplayer'
|
|
695
974
|
*/
|
|
975
|
+
/** {en}
|
|
976
|
+
* @brief The container ID of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
|
|
977
|
+
* @default 'veplayer'
|
|
978
|
+
*/
|
|
696
979
|
id?: string;
|
|
697
980
|
/** {zh}
|
|
698
981
|
* @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
699
982
|
* @default 无
|
|
700
983
|
*/
|
|
984
|
+
/** {en}
|
|
985
|
+
* @brief The container element of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
|
|
986
|
+
*/
|
|
701
987
|
el?: HTMLElement;
|
|
702
988
|
/** {zh}
|
|
703
989
|
* @brief 设置播放器宽度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 width 样式属性。
|
|
704
990
|
* @default '100%'
|
|
705
991
|
*/
|
|
992
|
+
/** {en}
|
|
993
|
+
* @brief The width of the player. If you set it to a number, the player will attach the unit "pixel" to it. If you set it to a string, the parameter value will be directly assigned to the `width` property of the player container.
|
|
994
|
+
* @default '100%'
|
|
995
|
+
*/
|
|
706
996
|
width?: number | string;
|
|
707
997
|
/** {zh}
|
|
708
998
|
* @brief 设置播放器高度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 height 样式属性。
|
|
709
999
|
* @default '100%'
|
|
710
1000
|
*/
|
|
1001
|
+
/** {en}
|
|
1002
|
+
* @brief The height of the player. If you set it to a number, the player will attach the unit "pixel" to it. If you set it to a string, the parameter value will be directly assigned to the `height` property of the player container.
|
|
1003
|
+
* @default '100%'
|
|
1004
|
+
*/
|
|
711
1005
|
height?: number | string;
|
|
712
1006
|
/** {zh}
|
|
713
1007
|
* @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
|
|
714
1008
|
* @default 无
|
|
715
1009
|
*/
|
|
1010
|
+
/** {en}
|
|
1011
|
+
* @brief The pull stream address. You can manually construct the address or use the address generator to generate one. To see how to generate an address, refer to [Generate live-stream addresses](https://docs.byteplus.com/en/byteplus-media-live/docs/generating-live-stream-addresses). You should specify either `url` or `playList`, or both.
|
|
1012
|
+
*/
|
|
716
1013
|
url?: string;
|
|
717
1014
|
/** {zh}
|
|
718
1015
|
* @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
|
|
719
1016
|
* @default 无
|
|
720
1017
|
*/
|
|
1018
|
+
/** {en}
|
|
1019
|
+
* @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
|
|
1020
|
+
*/
|
|
721
1021
|
playlist?: ExposedSource[];
|
|
722
1022
|
/** {zh}
|
|
723
1023
|
* @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
|
|
724
1024
|
* @default 无
|
|
725
1025
|
*/
|
|
1026
|
+
/** {en}
|
|
1027
|
+
* @brief The default pull stream address for the player when there are multiple addresses available. If this parameter is not specified, the first address in the playlist will become the default address.
|
|
1028
|
+
*/
|
|
726
1029
|
defaultSource?: string;
|
|
727
1030
|
/** {zh}
|
|
728
1031
|
* @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
|
|
729
1032
|
* @default 无
|
|
730
1033
|
*/
|
|
1034
|
+
/** {en}
|
|
1035
|
+
* @brief The default resolution for the player when there are multiple resolutions available. If this parameter is not specified, the first resolution in the list will become the default resolution.
|
|
1036
|
+
*/
|
|
731
1037
|
defaultDefinition?: string;
|
|
732
1038
|
/** {zh}
|
|
733
1039
|
* @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
734
1040
|
* @default 无
|
|
735
1041
|
*/
|
|
1042
|
+
/** {en}
|
|
1043
|
+
* @brief The backup pull stream address(es) for the player. You can enter multiple backup addresses. If `maxFallbackRound` is greater than `0`, when an error occurs in the main address, the player automatically switches to the backup address.
|
|
1044
|
+
*/
|
|
736
1045
|
fallbackUrls?: string[];
|
|
737
1046
|
/** {zh}
|
|
738
1047
|
* @brief 为播放器设置拉流失败时循环拉流的最大次数。
|
|
739
1048
|
* @default 0
|
|
740
1049
|
*/
|
|
1050
|
+
/** {en}
|
|
1051
|
+
* @brief The maximum number of retries the player can make if it fails to pull the stream with the default address.
|
|
1052
|
+
* @default 0
|
|
1053
|
+
*/
|
|
741
1054
|
maxFallbackRound?: number;
|
|
742
1055
|
/** {zh}
|
|
743
1056
|
* @brief 为播放器设置解码方式。
|
|
@@ -748,32 +1061,60 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
748
1061
|
* 3. 部分浏览器不支持 H.265 编码格式,如果需要播放该编码格式的视频,请开启软解。
|
|
749
1062
|
* @default 'hardware'
|
|
750
1063
|
*/
|
|
1064
|
+
/** {en}
|
|
1065
|
+
* @brief The decoding method for the player.
|
|
1066
|
+
* @listtip
|
|
1067
|
+
* When software decoding is enabled, the player uses the software decoder of the browser to decode the stream. Software decoding offers high compatibility and is suitable for various devices and browsers, but it relies on the device's CPU capacity and may have freezes or latencies when playing high-resolution or high-bitrate videos. We recommend enabling software decoding in the following scenarios:
|
|
1068
|
+
* 1. In certain Android browsers, the player can sometimes be hijacked, causing certain features to be unavailable. Enabling software decoding can address this issue.
|
|
1069
|
+
* 2. Browsers on mobile devices do not support the FLV format. To play videos in this format, you can enable software decoding.
|
|
1070
|
+
* 3. Some browsers do not support the H.265 codec. To play videos encoded with H.265, you can enable software decoding.
|
|
1071
|
+
* @default 'hardware'
|
|
1072
|
+
*/
|
|
751
1073
|
decodeType?: DecodeType;
|
|
752
1074
|
/** {zh}
|
|
753
1075
|
* @brief 为播放器设置视频的实际编码格式。如果您在degradation 设置了 `soft-first` 属性(即硬解不支持时降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
754
1076
|
* @default 'h264'
|
|
755
1077
|
*/
|
|
1078
|
+
/** {en}
|
|
1079
|
+
* @brief The actual codec of the live stream. If you specify `degradation` to `soft-first`, that is, the player should fall back to software decoding when hardware decoding is not supported, we recommend specifying the parameter so that the player does not need to detect the codec information.
|
|
1080
|
+
* @default 'h264'
|
|
1081
|
+
*/
|
|
756
1082
|
codec?: Codec;
|
|
757
1083
|
/** {zh}
|
|
758
1084
|
* @brief 为播放器设置是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
759
1085
|
* @default 'soft-first'
|
|
760
1086
|
*/
|
|
1087
|
+
/** {en}
|
|
1088
|
+
* @brief Whether to enable H.265 compatibility mode for the player. In the H.265 compatibility mode, the player will prioritize hardware decoding for decoding H.265 streams. If the device or browser does not support hardware decoding for H.265, it will automatically fall back to software decoding.
|
|
1089
|
+
* @default 'soft-first'
|
|
1090
|
+
*/
|
|
761
1091
|
degradation?: Degradation | boolean;
|
|
762
1092
|
/** {zh}
|
|
763
1093
|
* @brief 为播放器设置封面图 URL。
|
|
764
1094
|
* @default 无
|
|
765
1095
|
*/
|
|
1096
|
+
/** {en}
|
|
1097
|
+
* @brief The URL of the player's cover image.
|
|
1098
|
+
*/
|
|
766
1099
|
poster?: string;
|
|
767
1100
|
/** {zh}
|
|
768
1101
|
* @brief 为播放器设置初始显示语言,语言包不存在的情况下默认显示 'en' 语言包 。默认值为 `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`
|
|
769
1102
|
* @default -
|
|
770
1103
|
*/
|
|
1104
|
+
/** {en}
|
|
1105
|
+
* @brief The initial display language of the player. If the language pack does not exist, the 'en'language pack will be displayed by default. The default value is `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`.
|
|
1106
|
+
* @default -
|
|
1107
|
+
*/
|
|
771
1108
|
lang?: Lang;
|
|
772
1109
|
/** {zh}
|
|
773
|
-
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }
|
|
1110
|
+
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
|
|
774
1111
|
* 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
|
|
775
1112
|
* @default 无
|
|
776
1113
|
*/
|
|
1114
|
+
/** {en}
|
|
1115
|
+
* @brief Configures a custom multilingual dictionary for the player. You can set the dictionary for each language in the format { texts: { [key: string]: Object; } }. For example, { texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }}.
|
|
1116
|
+
* You can use the [default dictionary](https://docs.byteplus.com/byteplus-media-live/docs/default-dictionary_1) as a reference.
|
|
1117
|
+
*/
|
|
777
1118
|
i18n?: {
|
|
778
1119
|
texts: Record<Lang, Record<string, string>>;
|
|
779
1120
|
};
|
|
@@ -782,6 +1123,11 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
782
1123
|
* @default { muted: true }
|
|
783
1124
|
* @type {{ muted: boolean } | boolean}
|
|
784
1125
|
*/
|
|
1126
|
+
/** {en}
|
|
1127
|
+
* @brief Whether to enable autoplay for the player. If `muted` is set to `true`, the autoplay is muted.
|
|
1128
|
+
* @default { muted: true }
|
|
1129
|
+
* @type {{ muted: boolean } | boolean}
|
|
1130
|
+
*/
|
|
785
1131
|
autoplay?: {
|
|
786
1132
|
muted?: boolean;
|
|
787
1133
|
} | boolean;
|
|
@@ -789,6 +1135,10 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
789
1135
|
* @brief 为播放器设置默认音量,取值范围 [0,1]。
|
|
790
1136
|
* @default 0.6
|
|
791
1137
|
*/
|
|
1138
|
+
/** {en}
|
|
1139
|
+
* @brief The default volume for the player. Valid range: [0,1].
|
|
1140
|
+
* @default 0.6
|
|
1141
|
+
*/
|
|
792
1142
|
volume?: number;
|
|
793
1143
|
/** {zh}
|
|
794
1144
|
* @brief 为播放器设置是否显示画中画功能按钮。
|
|
@@ -796,22 +1146,42 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
796
1146
|
* - `false`:不显示。
|
|
797
1147
|
* @default false
|
|
798
1148
|
*/
|
|
1149
|
+
/** {en}
|
|
1150
|
+
* @brief Whether to display the Picture-in-Picture (PiP) button.
|
|
1151
|
+
* - `true`: Display;
|
|
1152
|
+
* - `false`: Do not display.
|
|
1153
|
+
* @default false
|
|
1154
|
+
*/
|
|
799
1155
|
pip?: boolean;
|
|
800
|
-
/**{zh}
|
|
1156
|
+
/** {zh}
|
|
801
1157
|
* @brief 为播放器设置是否显示全屏功能按钮,并进行全屏功能设置。
|
|
802
1158
|
* - `true`:显示;
|
|
803
1159
|
* - `false`:不显示。
|
|
804
1160
|
*/
|
|
1161
|
+
/** {en}
|
|
1162
|
+
* @brief Whether to display the full-screen button.
|
|
1163
|
+
* - `true`: Display;
|
|
1164
|
+
* - `false`: Do not display.
|
|
1165
|
+
* @default -
|
|
1166
|
+
*/
|
|
805
1167
|
fullscreen?: boolean | Fullscreen;
|
|
806
1168
|
/** {zh}
|
|
807
1169
|
* @brief 为播放器设置报错信息,支持配置播放异常时,播放器显示的异常文案、图片,以及是否提供刷新按钮等。
|
|
808
1170
|
* @default -
|
|
809
1171
|
*/
|
|
1172
|
+
/** {en}
|
|
1173
|
+
* @brief The error message of the player. When a playback error occurs, you can configure the error message and image displayed and whether to display the refresh button.
|
|
1174
|
+
* @default -
|
|
1175
|
+
*/
|
|
810
1176
|
error?: ErrorConfig;
|
|
811
1177
|
/** {zh}
|
|
812
1178
|
* @brief 为播放器设置清晰度的相关配置。
|
|
813
1179
|
* @default -
|
|
814
1180
|
*/
|
|
1181
|
+
/** {en}
|
|
1182
|
+
* @brief Resolution-related configurations.
|
|
1183
|
+
* @default -
|
|
1184
|
+
*/
|
|
815
1185
|
definition?: DefinitionConfig;
|
|
816
1186
|
/** {zh}
|
|
817
1187
|
* @brief 为播放器设置是否显示控制栏。
|
|
@@ -819,6 +1189,12 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
819
1189
|
* - `false`: 不显示
|
|
820
1190
|
* @default true
|
|
821
1191
|
*/
|
|
1192
|
+
/** {en}
|
|
1193
|
+
* @brief Whether to display the control bar for the player.
|
|
1194
|
+
* - `true`: Display;
|
|
1195
|
+
* - `false`: Do not display.
|
|
1196
|
+
* @default true
|
|
1197
|
+
*/
|
|
822
1198
|
controls?: boolean | {
|
|
823
1199
|
[propName: string]: any;
|
|
824
1200
|
};
|
|
@@ -826,23 +1202,39 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
826
1202
|
* @brief 为播放器设置**清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
827
1203
|
* @default 'bottom'
|
|
828
1204
|
*/
|
|
1205
|
+
/** {en}
|
|
1206
|
+
* @brief Select the panel style for resolution and line selection. This parameter takes effect on mobile devices only.
|
|
1207
|
+
* @default 'bottom'
|
|
1208
|
+
*/
|
|
829
1209
|
listType?: ListType;
|
|
830
1210
|
/** {zh}
|
|
831
1211
|
* @brief 为播放器设置是否启用内联播放模式。playsinline 属性是 HTML5 视频标签的一个属性,用于指定视频是否应在页面文档内播放。
|
|
832
1212
|
* - `true`:启用,表示视频将在页面文档内播放;
|
|
833
|
-
* - `false
|
|
834
|
-
*
|
|
1213
|
+
* - `false`:停用,默认浏览器播放行为。
|
|
835
1214
|
* 该配置项只在移动端生效,当取值为 true 的时候,会在初始化 video 或 audio 对象的时候,将 playsinline、webkit-playsinline、x5-playsinline 三个属性设置为 true,请参考 [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) 了解内联模式相关知识。
|
|
836
1215
|
* @listtip
|
|
837
1216
|
* - iOS 10 及以上系统 Safari 浏览器支持配置内联播放模式;
|
|
838
1217
|
* - iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
839
1218
|
* @default true
|
|
840
1219
|
*/
|
|
1220
|
+
/** {en}
|
|
1221
|
+
* @brief Whether to enable inline playback for the player. The `playsinline` property is a property of the `video` element in HTML5. It specifies whether the video should be played inline.
|
|
1222
|
+
* - `true`: Enable inline playback.
|
|
1223
|
+
* - `false`: Disable. The default browser playback behavior will be used.
|
|
1224
|
+
* This option only takes effect on mobile devices. When it is set to `true`, the `playsinline`, `webkit-playsinline`, and `x5-playsinline` properties are set to `true` when the video or audio objects are initialized. You can refer to [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) for more information about the inline playback.
|
|
1225
|
+
* @listtip
|
|
1226
|
+
* - Safari on iOS 10 and above supports inline playback.
|
|
1227
|
+
* - Safari on iOS versions lower than 10 does not support inline playback. The player will automatically enter fullscreen mode when playback begins.
|
|
1228
|
+
* @default true
|
|
1229
|
+
*/
|
|
841
1230
|
playsinline?: boolean;
|
|
842
1231
|
/** {zh}
|
|
843
1232
|
* @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
|
|
844
1233
|
* @default 无
|
|
845
1234
|
*/
|
|
1235
|
+
/** {en}
|
|
1236
|
+
* @brief Additional properties for the `video` element that will be applied when the `videoElement` or `audioElement` objects are initialized. Refer to [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) for supported properties.
|
|
1237
|
+
*/
|
|
846
1238
|
videoAttributes?: {
|
|
847
1239
|
[propName: string]: any;
|
|
848
1240
|
};
|
|
@@ -856,13 +1248,29 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
856
1248
|
* - 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
857
1249
|
* @default false
|
|
858
1250
|
*/
|
|
1251
|
+
/** {en}
|
|
1252
|
+
* @brief Whether to enable responsive layout for the player. If responsive layout is enabled, the player size will be auto-adjusted according to the width of the screen to ensure a proper display on different screen sizes.
|
|
1253
|
+
* - `true`: Enable
|
|
1254
|
+
* - `false`: Disable
|
|
1255
|
+
* @listtip
|
|
1256
|
+
* When responsive layout is enabled:
|
|
1257
|
+
* If `width` and `height` are of type number, the player's aspect ratio will be determined based on their values.
|
|
1258
|
+
* If `width` and `height` are not of type number, the player uses a 16:9 aspect ratio.
|
|
1259
|
+
* @default false
|
|
1260
|
+
*/
|
|
859
1261
|
fluid?: boolean;
|
|
860
1262
|
/** {zh}
|
|
861
1263
|
* @brief 为播放器设置尺寸适配方式,在视频资源初始化之后,根据获取到的 videoWidth 和 videoHeight 值对播放器容器宽高比例进行调整,可选项有:
|
|
862
1264
|
* - `fixed`: 保持容器宽/高,不做适配;
|
|
863
1265
|
* - `fixWidth`: 保持容器宽度,适配高度;
|
|
864
1266
|
* - `fixHeight`: 保持容器高度,适配宽度。
|
|
865
|
-
*
|
|
1267
|
+
* @default 'fixed'
|
|
1268
|
+
*/
|
|
1269
|
+
/** {en}
|
|
1270
|
+
* @brief The adaptation mode for the player size. After the video resource is initialized, the player container's aspect ratio is adjusted based on the obtained values of `videoWidth` and `videoHeight`. The available options include:
|
|
1271
|
+
* - `fixed`: Keep the container's width and height without adaptation;
|
|
1272
|
+
* - `fixWidth`: Keep the container's width and adjust the height;
|
|
1273
|
+
* - `fixHeight`: Keep the container's height and adjust the width.
|
|
866
1274
|
* @default 'fixed'
|
|
867
1275
|
*/
|
|
868
1276
|
fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
|
|
@@ -875,6 +1283,15 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
875
1283
|
* - `auto`: 使用浏览器默认的视频画面填充模式。
|
|
876
1284
|
* @default 'auto'
|
|
877
1285
|
*/
|
|
1286
|
+
/** {en}
|
|
1287
|
+
* @brief The fill mode of the video. The available options include:
|
|
1288
|
+
* - `fillwidth`: Fill the width of the container and crop the height if necessary.
|
|
1289
|
+
* - `fillHeight`: Fill the height of the container and crop the width if necessary.
|
|
1290
|
+
* - `fill`: Stretch the video to fill the container;
|
|
1291
|
+
* - `cover`: Fill the entire container while keeping the original aspect ratio;
|
|
1292
|
+
* - `auto`: Use the default fill mode of the browser.
|
|
1293
|
+
* @default 'auto'
|
|
1294
|
+
*/
|
|
878
1295
|
videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
|
|
879
1296
|
/** {zh}
|
|
880
1297
|
* @brief 是否开启画面和控制栏分离模式。设置为开启时,控制栏将会常驻,与视频画面不重叠。
|
|
@@ -882,11 +1299,20 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
882
1299
|
* - `false`:关闭
|
|
883
1300
|
* @default false
|
|
884
1301
|
*/
|
|
1302
|
+
/** {en}
|
|
1303
|
+
* @brief Whether to enable the separation of the video and the control bar. When enabled, the control bar will remain visible without overlapping the video content.
|
|
1304
|
+
* - `true`: Enable
|
|
1305
|
+
* - `false`: Disable
|
|
1306
|
+
* @default false
|
|
1307
|
+
*/
|
|
885
1308
|
marginControls?: boolean;
|
|
886
1309
|
/** {zh}
|
|
887
1310
|
* @brief 启用微信同层播放。
|
|
888
1311
|
* @default 无
|
|
889
1312
|
*/
|
|
1313
|
+
/** {en}
|
|
1314
|
+
* @brief Enable playing the video on the same player as WeChat.
|
|
1315
|
+
*/
|
|
890
1316
|
"x5-video-player-type"?: string;
|
|
891
1317
|
/** {zh}
|
|
892
1318
|
* @brief 是否启用微信全屏播放模式。
|
|
@@ -894,6 +1320,11 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
894
1320
|
* - `false`:停用
|
|
895
1321
|
* @default 无
|
|
896
1322
|
*/
|
|
1323
|
+
/** {en}
|
|
1324
|
+
* @brief Whether to enable full-screen playback in WeChat.
|
|
1325
|
+
* - `true`: Enable
|
|
1326
|
+
* - `false`: Disable
|
|
1327
|
+
*/
|
|
897
1328
|
"x5-video-player-fullscreen"?: boolean;
|
|
898
1329
|
/** {zh}
|
|
899
1330
|
* @brief 微信横竖屏控制,支持如下取值:
|
|
@@ -902,25 +1333,45 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
902
1333
|
* - `landscape|portrait`:跟随手机自动旋转
|
|
903
1334
|
* @default 无
|
|
904
1335
|
*/
|
|
1336
|
+
/** {en}
|
|
1337
|
+
* @brief The orientation of the video when played on WeChat. The following values are supported:
|
|
1338
|
+
* - `landscape`: Horizontal screen;
|
|
1339
|
+
* - `portrait`: Vertical screen;
|
|
1340
|
+
* - `landscape | portrait`: Rotate with the mobile.
|
|
1341
|
+
*/
|
|
905
1342
|
"x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
|
|
906
1343
|
/** {zh}
|
|
907
1344
|
* @brief 为播放器配置关键点样式。
|
|
908
1345
|
* @default 无
|
|
909
1346
|
* @hidden 直播目前没用到
|
|
910
1347
|
*/
|
|
1348
|
+
/** {en}
|
|
1349
|
+
* @brief Configures the keypoint style for the player.
|
|
1350
|
+
* @hidden
|
|
1351
|
+
*/
|
|
911
1352
|
commonStyle?: CommonStyle;
|
|
912
1353
|
/** {zh}
|
|
913
1354
|
* @brief 自定义插件列表。
|
|
914
1355
|
* @default 无
|
|
915
1356
|
*/
|
|
1357
|
+
/** {en}
|
|
1358
|
+
* @brief A list of custom plugins.
|
|
1359
|
+
*/
|
|
916
1360
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
917
1361
|
plugins?: any[];
|
|
918
1362
|
/** {zh}
|
|
919
1363
|
* @hidden
|
|
920
1364
|
*/
|
|
1365
|
+
/** {en}
|
|
1366
|
+
* @hidden
|
|
1367
|
+
*/
|
|
921
1368
|
preparePlugins?: PreparePlugins;
|
|
922
1369
|
}
|
|
923
|
-
/**
|
|
1370
|
+
/** {zh}
|
|
1371
|
+
* @list option
|
|
1372
|
+
* @kind property
|
|
1373
|
+
*/
|
|
1374
|
+
/** {en}
|
|
924
1375
|
* @list option
|
|
925
1376
|
* @kind property
|
|
926
1377
|
*/
|
|
@@ -931,6 +1382,12 @@ interface Fullscreen {
|
|
|
931
1382
|
* - `false`:不使用旋转横屏。
|
|
932
1383
|
* @default false
|
|
933
1384
|
*/
|
|
1385
|
+
/** {en}
|
|
1386
|
+
* @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a higher priority over `useCssFullscreen`.
|
|
1387
|
+
* - `true`: Enable.
|
|
1388
|
+
* - `false`: Disable.
|
|
1389
|
+
* @default false
|
|
1390
|
+
*/
|
|
934
1391
|
rotateFullscreen?: boolean;
|
|
935
1392
|
/** {zh}
|
|
936
1393
|
* @brief 是否使用页面全屏代替系统全屏功能。
|
|
@@ -938,16 +1395,37 @@ interface Fullscreen {
|
|
|
938
1395
|
* - `false`:系统全屏。
|
|
939
1396
|
* @default false
|
|
940
1397
|
*/
|
|
1398
|
+
/** {en}
|
|
1399
|
+
* @brief Whether to use full-window.
|
|
1400
|
+
* - `true`: Use full-window mode, in which the player covers the browser window.
|
|
1401
|
+
* - `false`: Use full-screen mode, in which the player covers the entire desktop.
|
|
1402
|
+
* @default false
|
|
1403
|
+
*/
|
|
941
1404
|
useCssFullscreen?: boolean;
|
|
942
|
-
/**{zh}
|
|
1405
|
+
/** {zh}
|
|
943
1406
|
* 全屏的时候是否显示右上角返回按钮,通常在移动端开启。
|
|
944
1407
|
* - `true`:显示;
|
|
945
1408
|
* - `false`:不显示。
|
|
946
1409
|
* @default false
|
|
947
1410
|
*/
|
|
1411
|
+
/** {en}
|
|
1412
|
+
* Whether to display a return button at the top-right corner when the player is in full-screen mode. This feature is usually turned on on mobile devices.
|
|
1413
|
+
* `true`: Display;
|
|
1414
|
+
* `false`: Do not display.
|
|
1415
|
+
* @default false
|
|
1416
|
+
* @brief
|
|
1417
|
+
* Whether to display a return button at the top-right corner when the player is in full-screen mode. This feature is usually turned on on mobile devices.
|
|
1418
|
+
* - `true`: Display;
|
|
1419
|
+
* - `false`: Do not display.
|
|
1420
|
+
*/
|
|
948
1421
|
needBackIcon?: boolean;
|
|
949
1422
|
}
|
|
950
|
-
/**
|
|
1423
|
+
/** {zh}
|
|
1424
|
+
* @list option
|
|
1425
|
+
* @kind property
|
|
1426
|
+
* @hidden
|
|
1427
|
+
*/
|
|
1428
|
+
/** {en}
|
|
951
1429
|
* @list option
|
|
952
1430
|
* @kind property
|
|
953
1431
|
* @hidden
|
|
@@ -957,21 +1435,34 @@ interface CommonStyle {
|
|
|
957
1435
|
* @brief 进度条底色
|
|
958
1436
|
* @default 无
|
|
959
1437
|
*/
|
|
1438
|
+
/** {en}
|
|
1439
|
+
* @brief The background color of the progress bar.
|
|
1440
|
+
*/
|
|
960
1441
|
progressColor?: string;
|
|
961
1442
|
/** {zh}
|
|
962
1443
|
* @brief 播放完成部分进度条底色
|
|
963
1444
|
* @default 无
|
|
964
1445
|
*/
|
|
1446
|
+
/** {en}
|
|
1447
|
+
* @brief The background color of the progress bar for the completed portion of video playback.
|
|
1448
|
+
*/
|
|
965
1449
|
playedColor?: string;
|
|
966
1450
|
/** {zh}
|
|
967
1451
|
* @brief 缓存部分进度条底色
|
|
968
1452
|
* @default 无
|
|
969
1453
|
*/
|
|
1454
|
+
/** {en}
|
|
1455
|
+
* @brief
|
|
1456
|
+
* @brief The background color of the progress bar for the cached portion of video playback.
|
|
1457
|
+
*/
|
|
970
1458
|
cachedColor?: string;
|
|
971
1459
|
/** {zh}
|
|
972
1460
|
* @brief 进度条滑块样式
|
|
973
1461
|
* @default 无
|
|
974
1462
|
*/
|
|
1463
|
+
/** {en}
|
|
1464
|
+
* @brief The style of the progress bar slider.
|
|
1465
|
+
*/
|
|
975
1466
|
sliderBtnStyle?: {
|
|
976
1467
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
977
1468
|
[propName: string]: any;
|
|
@@ -980,6 +1471,9 @@ interface CommonStyle {
|
|
|
980
1471
|
* @brief 音量颜色
|
|
981
1472
|
* @default 无
|
|
982
1473
|
*/
|
|
1474
|
+
/** {en}
|
|
1475
|
+
* @brief The color of the volume slider.
|
|
1476
|
+
*/
|
|
983
1477
|
volumeColor?: string;
|
|
984
1478
|
}
|
|
985
1479
|
type PrepareResult = {
|
|
@@ -988,48 +1482,80 @@ type PrepareResult = {
|
|
|
988
1482
|
plugins?: any[];
|
|
989
1483
|
};
|
|
990
1484
|
type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
|
|
991
|
-
/**
|
|
1485
|
+
/** {zh}
|
|
992
1486
|
* @detail option
|
|
993
1487
|
* @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
994
1488
|
*/
|
|
1489
|
+
/** {en}
|
|
1490
|
+
* @detail option
|
|
1491
|
+
* @brief The actual codec of the video.
|
|
1492
|
+
*/
|
|
995
1493
|
declare enum Codec {
|
|
996
1494
|
/** {zh}
|
|
997
1495
|
* @brief H.265 编码格式
|
|
998
1496
|
*/
|
|
1497
|
+
/** {en}
|
|
1498
|
+
* @brief H.265.
|
|
1499
|
+
*/
|
|
999
1500
|
H265 = "h265",
|
|
1000
1501
|
/** {zh}
|
|
1001
1502
|
* @brief H.264 编码格式
|
|
1002
1503
|
*/
|
|
1504
|
+
/** {en}
|
|
1505
|
+
* @brief H.264.
|
|
1506
|
+
*/
|
|
1003
1507
|
H264 = "h264"
|
|
1004
1508
|
}
|
|
1005
|
-
/**
|
|
1509
|
+
/** {zh}
|
|
1006
1510
|
* @detail option
|
|
1007
1511
|
* @brief 是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
1008
1512
|
*/
|
|
1513
|
+
/** {en}
|
|
1514
|
+
* @detail option
|
|
1515
|
+
* @brief Whether to use H.265 compatibility mode. In H.265 compatibility mode, the player will prioritize hardware decoding to decode H.265 video. If the device or browser does not support H.265 hardware decoding, it will automatically fall back to H.265 software decoding.
|
|
1516
|
+
*/
|
|
1009
1517
|
declare enum Degradation {
|
|
1010
1518
|
/** {zh}
|
|
1011
1519
|
* @brief 硬解不支持降级到软解
|
|
1012
1520
|
*/
|
|
1521
|
+
/** {en}
|
|
1522
|
+
* @brief The player does not support falling back to software decoding.
|
|
1523
|
+
*/
|
|
1013
1524
|
SoftFirst = "soft-first",
|
|
1014
1525
|
/** {zh}
|
|
1015
1526
|
* @brief 硬解不支持降级到h264
|
|
1016
1527
|
* @hidden
|
|
1017
1528
|
*/
|
|
1529
|
+
/** {en}
|
|
1530
|
+
* @brief The player does not support falling back to H.264.
|
|
1531
|
+
* @hidden
|
|
1532
|
+
*/
|
|
1018
1533
|
H264First = "h264-first"
|
|
1019
1534
|
}
|
|
1020
|
-
/**
|
|
1535
|
+
/** {zh}
|
|
1021
1536
|
* @detail option
|
|
1022
1537
|
* @brief 解码方式。
|
|
1023
1538
|
* @example
|
|
1024
1539
|
*/
|
|
1540
|
+
/** {en}
|
|
1541
|
+
* @detail option
|
|
1542
|
+
* @brief Decoding method.
|
|
1543
|
+
* @example
|
|
1544
|
+
*/
|
|
1025
1545
|
declare enum DecodeType {
|
|
1026
1546
|
/** {zh}
|
|
1027
1547
|
* @brief 软解
|
|
1028
1548
|
*/
|
|
1549
|
+
/** {en}
|
|
1550
|
+
* @brief Software decoding.
|
|
1551
|
+
*/
|
|
1029
1552
|
Software = "software",
|
|
1030
1553
|
/** {zh}
|
|
1031
1554
|
* @brief 硬解
|
|
1032
1555
|
*/
|
|
1556
|
+
/** {en}
|
|
1557
|
+
* @brief Hardware decoding.
|
|
1558
|
+
*/
|
|
1033
1559
|
Hardware = "hardware"
|
|
1034
1560
|
}
|
|
1035
1561
|
type Constructor<T> = new (...args: any[]) => T;
|
|
@@ -1041,11 +1567,14 @@ declare class VePlayerBase {
|
|
|
1041
1567
|
private _i18nManager;
|
|
1042
1568
|
private _events;
|
|
1043
1569
|
private _errorCallback;
|
|
1044
|
-
/**
|
|
1570
|
+
/** {zh}
|
|
1571
|
+
* @hidden
|
|
1572
|
+
*/
|
|
1573
|
+
/** {en}
|
|
1045
1574
|
* @hidden
|
|
1046
1575
|
*/
|
|
1047
1576
|
constructor(options?: VePlayerBaseOptions);
|
|
1048
|
-
/**
|
|
1577
|
+
/** {zh}
|
|
1049
1578
|
* @brief 获取视频的就绪状态,其状态枚举值、枚举名称和说明如下:
|
|
1050
1579
|
* - `0`:HAVE_NOTHING,没有关于媒体资源的可用信息
|
|
1051
1580
|
* - `1`:HAVE_METADATA,已检索到足够多的媒体资源来初始化元数据, 快进/快退不会引发异常
|
|
@@ -1053,48 +1582,87 @@ declare class VePlayerBase {
|
|
|
1053
1582
|
* - `3`:HAVE_FUTURE_DATA,当前播放位置以及未来至少一小段时间的数据是可用的(至少有两帧以上的数据)
|
|
1054
1583
|
* - `4`:HAVE_ENOUGH_DATA,有足够的数据可用,并且下载速率足够,媒体可以不间断地播放到最后
|
|
1055
1584
|
*/
|
|
1585
|
+
/** {en}
|
|
1586
|
+
* @brief Gets the readiness of the video.
|
|
1587
|
+
* - `0`: HAVE_NOTHING, which means there is no information about the media resources.
|
|
1588
|
+
* - `1`: HAVE_METADATA, which means enough media resources have been retrieved to initialize the metadata and fast-forward/rewind will not raise an exception.
|
|
1589
|
+
* - `2`: HAVE_CURRENT_DATA, which means the data for the current playback position is available, but there is not enough data to play the next frame.
|
|
1590
|
+
* - `3`: HAVE_FUTURE_DATA, which means there is enough data for the current playback position and at least a short period in the future (at least two following frames).
|
|
1591
|
+
* - `4`: HAVE_ENOUGH_DATA, which means there is enough data and the download rate is sufficient for the video to be played without interruption until the end.
|
|
1592
|
+
*/
|
|
1056
1593
|
get readyState(): 0 | 2 | 1 | 4 | 3;
|
|
1057
|
-
/**
|
|
1594
|
+
/** {zh}
|
|
1058
1595
|
* @brief 获取当前已缓冲的时间范围。
|
|
1059
1596
|
*/
|
|
1597
|
+
/** {en}
|
|
1598
|
+
* @brief Gets the currently buffered time range.
|
|
1599
|
+
*/
|
|
1060
1600
|
get buffered(): TimeRanges;
|
|
1061
|
-
/**
|
|
1601
|
+
/** {zh}
|
|
1062
1602
|
* @brief 获取已经播放的音频/视频的时间范围。
|
|
1063
1603
|
*/
|
|
1604
|
+
/** {en}
|
|
1605
|
+
* @brief Gets the time range of the audio/video that has been played.
|
|
1606
|
+
*/
|
|
1064
1607
|
get played(): TimeRanges;
|
|
1065
|
-
/**
|
|
1608
|
+
/** {zh}
|
|
1066
1609
|
* @brief 设置/获取视频当前的播放时间, 单位为 s。
|
|
1067
1610
|
*/
|
|
1611
|
+
/** {en}
|
|
1612
|
+
* @brief Sets or gets the current playback position of the video, in seconds.
|
|
1613
|
+
*/
|
|
1068
1614
|
get cumulateTime(): number;
|
|
1069
|
-
/**
|
|
1615
|
+
/** {zh}
|
|
1070
1616
|
* @brief 获取是否处于焦点状态,处于焦点状态会显示控制栏。
|
|
1071
1617
|
*/
|
|
1618
|
+
/** {en}
|
|
1619
|
+
* @brief Gets whether the player has focus. The control bar is displayed when the player has focus.
|
|
1620
|
+
*/
|
|
1072
1621
|
get isFocused(): boolean;
|
|
1073
|
-
/**
|
|
1622
|
+
/** {zh}
|
|
1074
1623
|
* @brief 获取播放器是否处于全屏状态。
|
|
1075
1624
|
*/
|
|
1625
|
+
/** {en}
|
|
1626
|
+
* @brief Gets whether the player is in full-screen mode, in which the player covers the entire desktop.
|
|
1627
|
+
*/
|
|
1076
1628
|
get isFullscreen(): boolean;
|
|
1077
|
-
/**
|
|
1629
|
+
/** {zh}
|
|
1078
1630
|
* @brief 获取播放器是否处于网页全屏状态。
|
|
1079
1631
|
*/
|
|
1632
|
+
/** {en}
|
|
1633
|
+
* @brief Gets whether the player is in full-window mode, in which the player covers the entire browser window.
|
|
1634
|
+
*/
|
|
1080
1635
|
get isCssFullscreen(): boolean;
|
|
1081
|
-
/**
|
|
1636
|
+
/** {zh}
|
|
1082
1637
|
* @brief 获取视频的网络状态,其状态枚举值、枚举名称和说明如下:
|
|
1083
1638
|
* - `0`:NETWORK_EMPTY,目前还没有数据,readyState 的值是 HAVE_NOTHING
|
|
1084
1639
|
* - `1`:NETWORK_IDLE,HTMLMediaElement 处于活动状态并已选择资源,但未使用网络
|
|
1085
1640
|
* - `2`:NETWORK_LOADING,浏览器正在下载 HTMLMediaElement 数据
|
|
1086
1641
|
* - `3`:NETWORK_NO_SOURCE,未找到 HTMLMediaElement src。
|
|
1087
1642
|
*/
|
|
1643
|
+
/** {en}
|
|
1644
|
+
* @brief Gets the network condition of the video.
|
|
1645
|
+
* - `0`: NETWORK_EMPTY, which means there is no data yet, and `readyState` is `HAVE_NOTHING`.
|
|
1646
|
+
* - `1`: NETWORK_IDLE, which means the `HTMLMediaElement` element is active and the resources have been selected, but the network is not in use.
|
|
1647
|
+
* - `2`: NETWORK_LOADING, which means the browser is downloading the data of the `HTMLMediaElement` element.
|
|
1648
|
+
* - `3`: NETWORK_NO_SOURCE, the media source is not found according to the `src` property of the `HTMLMediaElement` element.
|
|
1649
|
+
*/
|
|
1088
1650
|
get networkState(): 0 | 2 | 1 | 3;
|
|
1089
|
-
/**
|
|
1651
|
+
/** {zh}
|
|
1090
1652
|
* @brief 获取当前视频是否处于暂停状态。
|
|
1091
1653
|
*/
|
|
1654
|
+
/** {en}
|
|
1655
|
+
* @brief Gets whether the current video is suspended.
|
|
1656
|
+
*/
|
|
1092
1657
|
get paused(): boolean;
|
|
1093
|
-
/**
|
|
1658
|
+
/** {zh}
|
|
1094
1659
|
* @brief 获取当前视频是否播放结束。
|
|
1095
1660
|
*/
|
|
1661
|
+
/** {en}
|
|
1662
|
+
* @brief Gets whether the current video has finished playing.
|
|
1663
|
+
*/
|
|
1096
1664
|
get ended(): boolean;
|
|
1097
|
-
/**
|
|
1665
|
+
/** {zh}
|
|
1098
1666
|
* @brief 获取播放器当前所处的状态,其状态枚举值、枚举名称和说明如下:
|
|
1099
1667
|
* - `0`:ERROR,播放出现错误
|
|
1100
1668
|
* - `1`:INITIAL,初始化
|
|
@@ -1106,244 +1674,428 @@ declare class VePlayerBase {
|
|
|
1106
1674
|
* - `7`:ENDED,播放结束
|
|
1107
1675
|
* - `8`:DESTROYED,播放器实例处于已被销毁
|
|
1108
1676
|
*/
|
|
1677
|
+
/** {en}
|
|
1678
|
+
* @brief Gets the current state of the player.
|
|
1679
|
+
* - `0`: ERROR, which means a playback error occurred
|
|
1680
|
+
* - `1`: INITIAL, which means initialization
|
|
1681
|
+
* - `2`: READY, which means the configuration/event/plug-in has been initialized/bound/instantiated
|
|
1682
|
+
* - `3`: ATTACHING, which means the media object is being mounted.
|
|
1683
|
+
* - `4`: ATTACHED, which means the media object has been mounted in the DOM
|
|
1684
|
+
* - `5`: NOTALLOW, which means the playback is blocked
|
|
1685
|
+
* - `6`: RUNNING, which means the playback has started successfully
|
|
1686
|
+
* - `7`: ENDED, which means the playback has ended
|
|
1687
|
+
* - `8`: DESTROYED, which means the player instance is destroyed
|
|
1688
|
+
*/
|
|
1109
1689
|
get state(): number;
|
|
1110
|
-
/**
|
|
1690
|
+
/** {zh}
|
|
1111
1691
|
* 获取当前播放视频的拉流地址。
|
|
1112
1692
|
*/
|
|
1693
|
+
/** {en}
|
|
1694
|
+
* Gets the current pull stream address.
|
|
1695
|
+
*/
|
|
1113
1696
|
get url(): string | undefined;
|
|
1114
|
-
/**
|
|
1115
|
-
* @brief
|
|
1697
|
+
/** {zh}
|
|
1698
|
+
* @brief 获取当前播放视频的线路名称唯一标识(name)。
|
|
1699
|
+
*/
|
|
1700
|
+
/** {en}
|
|
1701
|
+
* @brief Gets the current playback source ID.
|
|
1116
1702
|
*/
|
|
1117
1703
|
get source(): string | undefined;
|
|
1118
|
-
/**
|
|
1704
|
+
/** {zh}
|
|
1119
1705
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
1120
1706
|
*/
|
|
1707
|
+
/** {en}
|
|
1708
|
+
* @brief Gets the current resolution ID.
|
|
1709
|
+
*/
|
|
1121
1710
|
get definition(): string;
|
|
1122
|
-
/**
|
|
1711
|
+
/** {zh}
|
|
1123
1712
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
1124
1713
|
*/
|
|
1714
|
+
/** {en}
|
|
1715
|
+
* @brief Gets the player's cross-domain configurations. For more information, refer to [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin).
|
|
1716
|
+
*/
|
|
1125
1717
|
get crossOrigin(): string;
|
|
1126
|
-
/**
|
|
1718
|
+
/** {zh}
|
|
1127
1719
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
1128
1720
|
*/
|
|
1721
|
+
/** {en}
|
|
1722
|
+
* @brief Sets the player's cross-domain configurations. For more information, refer to the [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin).
|
|
1723
|
+
*/
|
|
1129
1724
|
set crossOrigin(crossOrigin: string);
|
|
1130
|
-
/**
|
|
1725
|
+
/** {zh}
|
|
1131
1726
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
1132
1727
|
*/
|
|
1728
|
+
/** {en}
|
|
1729
|
+
* @brief Gets the volume of the video. The value range is [0,1].
|
|
1730
|
+
*/
|
|
1133
1731
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1134
1732
|
get volume(): number;
|
|
1135
|
-
/**
|
|
1733
|
+
/** {zh}
|
|
1136
1734
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
1137
1735
|
*/
|
|
1736
|
+
/** {en}
|
|
1737
|
+
* @brief Sets the volume of the video. Valid range: [0,1].
|
|
1738
|
+
*/
|
|
1138
1739
|
set volume(volume: number);
|
|
1139
|
-
/**
|
|
1740
|
+
/** {zh}
|
|
1140
1741
|
* @brief 获取和设置视频静音状态。
|
|
1141
1742
|
* - `true`:静音
|
|
1142
1743
|
* - `false`:非静音
|
|
1143
1744
|
*/
|
|
1745
|
+
/** {en}
|
|
1746
|
+
* @brief Gets whether the video is muted.
|
|
1747
|
+
* - `true`: Muted.
|
|
1748
|
+
* - `false`: Not muted.
|
|
1749
|
+
*/
|
|
1144
1750
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1145
1751
|
get muted(): boolean;
|
|
1146
|
-
/**
|
|
1752
|
+
/** {zh}
|
|
1147
1753
|
* @brief 获取和设置视频静音状态。
|
|
1148
1754
|
* - `true`:静音
|
|
1149
1755
|
* - `false`:非静音
|
|
1150
1756
|
*/
|
|
1757
|
+
/** {en}
|
|
1758
|
+
* @brief Mute or unmute the video.
|
|
1759
|
+
* - `true`: Mute the video.
|
|
1760
|
+
* - `false`: Unmute the video.
|
|
1761
|
+
*/
|
|
1151
1762
|
set muted(isMuted: boolean);
|
|
1152
|
-
/**
|
|
1763
|
+
/** {zh}
|
|
1153
1764
|
* @brief 获取和设置当前语言。
|
|
1154
1765
|
*/
|
|
1766
|
+
/** {en}
|
|
1767
|
+
* @brief Gets the current language.
|
|
1768
|
+
*/
|
|
1155
1769
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1156
1770
|
get lang(): "zh-cn" | "en" | string;
|
|
1157
|
-
/**
|
|
1771
|
+
/** {zh}
|
|
1158
1772
|
* @brief 获取和设置当前语言。
|
|
1159
1773
|
*/
|
|
1774
|
+
/** {en}
|
|
1775
|
+
* @brief Sets the current language.
|
|
1776
|
+
*/
|
|
1160
1777
|
set lang(lang: "zh-cn" | "en" | string);
|
|
1161
1778
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1162
1779
|
protected get _src(): string;
|
|
1163
|
-
/**
|
|
1780
|
+
/** {zh}
|
|
1781
|
+
* @hidden
|
|
1782
|
+
*/
|
|
1783
|
+
/** {en}
|
|
1164
1784
|
* @hidden
|
|
1165
1785
|
*/
|
|
1166
1786
|
static create<T extends VePlayerBase>(options?: VePlayerBaseOptions, Constructor?: Constructor<T>): Promise<T>;
|
|
1167
|
-
/**
|
|
1787
|
+
/** {zh}
|
|
1168
1788
|
* @brief 调用此方法切换拉流地址、线路、清晰度。
|
|
1169
1789
|
* @param target 目标地址,可以是播放地址,也可以是线路和清晰度
|
|
1170
1790
|
* @param options 更多配置信息
|
|
1171
1791
|
*/
|
|
1792
|
+
/** {en}
|
|
1793
|
+
* @brief Switches the pull stream address, playback source, or resolution.
|
|
1794
|
+
* @param target The target pull stream address, playback source, or resolution.
|
|
1795
|
+
* @param options More configurations.
|
|
1796
|
+
*/
|
|
1172
1797
|
switch(target: string | {
|
|
1173
|
-
/**
|
|
1798
|
+
/** {zh}
|
|
1174
1799
|
* @brief 清晰度的唯一标识。
|
|
1175
1800
|
* @default 无
|
|
1176
1801
|
*/
|
|
1802
|
+
/** {en}
|
|
1803
|
+
* @brief The resolution ID.
|
|
1804
|
+
*/
|
|
1177
1805
|
definition?: string;
|
|
1178
|
-
/**
|
|
1806
|
+
/** {zh}
|
|
1179
1807
|
* @brief 线路的唯一标识。
|
|
1180
1808
|
* @default 无
|
|
1181
1809
|
*/
|
|
1810
|
+
/** {en}
|
|
1811
|
+
* @brief The playback source ID.
|
|
1812
|
+
*/
|
|
1182
1813
|
source?: string;
|
|
1183
1814
|
}, options?: {
|
|
1184
|
-
/**
|
|
1815
|
+
/** {zh}
|
|
1185
1816
|
* @brief 清晰度 definition 配置无效时,是否降级到播放列表第一个清晰度地址。
|
|
1186
1817
|
* @default false
|
|
1187
1818
|
*
|
|
1188
1819
|
*/
|
|
1820
|
+
/** {en}
|
|
1821
|
+
* @brief Whether to downgrade to the first resolution in the playlist when the player cannot play with the specified resolution.
|
|
1822
|
+
* @default false
|
|
1823
|
+
*
|
|
1824
|
+
*/
|
|
1189
1825
|
fallbackToFirstDefinition?: boolean;
|
|
1190
1826
|
}): Promise<ExposedDefinition>;
|
|
1191
|
-
/**
|
|
1827
|
+
/** {zh}
|
|
1192
1828
|
* @brief 调用此方法更新拉流地址列表。
|
|
1193
1829
|
* @param playlist 要更新的播放列表。
|
|
1194
1830
|
* @param target 更新后默认播放的资源。
|
|
1195
1831
|
*/
|
|
1832
|
+
/** {en}
|
|
1833
|
+
* @brief Updates the list of pull stream addresses.
|
|
1834
|
+
* @param Playlist The updated list.
|
|
1835
|
+
* @param Target The default playback resource after the update.
|
|
1836
|
+
*/
|
|
1196
1837
|
updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
|
|
1197
|
-
/**
|
|
1838
|
+
/** {zh}
|
|
1198
1839
|
* @brief 清晰度唯一标识。
|
|
1199
1840
|
* @default 无
|
|
1200
1841
|
*
|
|
1201
1842
|
*/
|
|
1843
|
+
/** {en}
|
|
1844
|
+
* @brief The resolution ID.
|
|
1845
|
+
*
|
|
1846
|
+
*/
|
|
1202
1847
|
definition?: string;
|
|
1203
|
-
/**
|
|
1848
|
+
/** {zh}
|
|
1204
1849
|
* @brief 线路的唯一标识。
|
|
1205
1850
|
* @default 无
|
|
1206
1851
|
*
|
|
1207
1852
|
*/
|
|
1853
|
+
/** {en}
|
|
1854
|
+
* @brief The playback resource ID.
|
|
1855
|
+
*
|
|
1856
|
+
*/
|
|
1208
1857
|
source?: string;
|
|
1209
1858
|
}): Promise<void>;
|
|
1210
1859
|
// TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
|
|
1211
1860
|
/**
|
|
1861
|
+
/** {zh}
|
|
1212
1862
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
1213
1863
|
* @param event 表示事件的名称。
|
|
1214
1864
|
* @param callback 表示事件的回调函数。
|
|
1215
1865
|
*/
|
|
1866
|
+
/** {en}
|
|
1867
|
+
* @brief Listens for a specified event. The event handler is executed only once.
|
|
1868
|
+
* @param event The event name.
|
|
1869
|
+
* @param callback The callback function for the event.
|
|
1870
|
+
*/
|
|
1216
1871
|
once(event: string, callback: (data?: any) => any): void;
|
|
1217
|
-
/**
|
|
1872
|
+
/** {zh}
|
|
1218
1873
|
* @brief 调用此方法解绑或移除指定事件的事件监听。
|
|
1219
1874
|
* @param event 表示事件的名称。
|
|
1220
1875
|
* @param callback 表示事件的回调函数。
|
|
1221
1876
|
*/
|
|
1877
|
+
/** {en}
|
|
1878
|
+
* @brief Stops listening for a specified event.
|
|
1879
|
+
* @param event The event name.
|
|
1880
|
+
* @param callback The callback function for the event.
|
|
1881
|
+
*/
|
|
1222
1882
|
off(event: string, callback: (data?: any) => any): void;
|
|
1223
|
-
/**
|
|
1883
|
+
/** {zh}
|
|
1224
1884
|
* @brief 调用此方法触发指定事件。
|
|
1225
1885
|
* @param event 表示事件的名称。
|
|
1226
1886
|
* @param data 事件信息。
|
|
1227
1887
|
*/
|
|
1888
|
+
/** {en}
|
|
1889
|
+
* @brief Triggers a specified event.
|
|
1890
|
+
* @param event The event name.
|
|
1891
|
+
* @param data The event information.
|
|
1892
|
+
*/
|
|
1228
1893
|
emit(event: string, data?: any): void;
|
|
1229
|
-
/**
|
|
1894
|
+
/** {zh}
|
|
1230
1895
|
* @brief 调用此方法解绑或移除指定事件的所有事件监听。
|
|
1231
1896
|
*/
|
|
1897
|
+
/** {en}
|
|
1898
|
+
* @brief Stops listening to any player event.
|
|
1899
|
+
*/
|
|
1232
1900
|
offAll(): void;
|
|
1233
|
-
/**
|
|
1901
|
+
/** {zh}
|
|
1234
1902
|
* @brief 调用此方法监听指定事件。
|
|
1235
1903
|
* @param event 表示事件名称。
|
|
1236
1904
|
* @param callback 表示事件的回调函数。
|
|
1237
1905
|
*/
|
|
1906
|
+
/** {en}
|
|
1907
|
+
* @brief Listens for a specified event.
|
|
1908
|
+
* @param event The event name.
|
|
1909
|
+
* @param callback The callback function for the event.
|
|
1910
|
+
*/
|
|
1238
1911
|
on(event: string, callback: (data?: any) => any): void;
|
|
1239
|
-
/**
|
|
1912
|
+
/** {zh}
|
|
1240
1913
|
* @brief 调用此方法开始播放 。
|
|
1241
1914
|
*/
|
|
1915
|
+
/** {en}
|
|
1916
|
+
* @brief Starts playback.
|
|
1917
|
+
*/
|
|
1242
1918
|
play(): any;
|
|
1243
|
-
/**
|
|
1919
|
+
/** {zh}
|
|
1244
1920
|
* @brief 调用此方法暂停播放。
|
|
1245
1921
|
*/
|
|
1922
|
+
/** {en}
|
|
1923
|
+
* @brief Pauses playback.
|
|
1924
|
+
*/
|
|
1246
1925
|
pause(): void;
|
|
1247
|
-
/**
|
|
1926
|
+
/** {zh}
|
|
1248
1927
|
* @brief 调用此方法打开画中画。
|
|
1249
1928
|
*/
|
|
1929
|
+
/** {en}
|
|
1930
|
+
* @brief Turns on Picture-in-Picture (PIP).
|
|
1931
|
+
*/
|
|
1250
1932
|
requestPIP(): void;
|
|
1251
|
-
/**
|
|
1933
|
+
/** {zh}
|
|
1252
1934
|
* @brief 调用此方法关闭画中画。
|
|
1253
1935
|
*/
|
|
1936
|
+
/** {en}
|
|
1937
|
+
* @brief Turns off Picture-in-Picture (PIP).
|
|
1938
|
+
*/
|
|
1254
1939
|
exitPIP(): void;
|
|
1255
|
-
/**
|
|
1940
|
+
/** {zh}
|
|
1256
1941
|
* @brief 调用此方法重新拉流。
|
|
1257
1942
|
*/
|
|
1943
|
+
/** {en}
|
|
1944
|
+
* @brief Retries stream-pulling.
|
|
1945
|
+
*/
|
|
1258
1946
|
retry(): void;
|
|
1259
|
-
/**
|
|
1947
|
+
/** {zh}
|
|
1260
1948
|
* @brief 播放器获取焦点,调用该方法 `veplayer.isFocused` 将会变为 `true`,并触发 `PLAYER_FOCUS` 事件。
|
|
1261
1949
|
* @param data 播放器获取焦点配置信息。
|
|
1262
1950
|
*/
|
|
1951
|
+
/** {en}
|
|
1952
|
+
* @brief The player gets focus. When the method is called, `veplayer.isFocused` will become `true` and the `PLAYER_FOCUS` event will be triggered.
|
|
1953
|
+
* @param data Related configurations.
|
|
1954
|
+
*/
|
|
1263
1955
|
focus(data?: {
|
|
1264
|
-
/**
|
|
1956
|
+
/** {zh}
|
|
1265
1957
|
* @brief 是否需要自动失焦,默认为 true,即经过 delay 时长之后,会自动调用 blur() 进行失焦。
|
|
1266
1958
|
* @default true
|
|
1267
1959
|
*/
|
|
1960
|
+
/** {en}
|
|
1961
|
+
* @brief Whether to turn on automatic hide, that is, after the duration specified by `delay`, the `blur` method will be automatically called so that the player loses focus. The default is `true`.
|
|
1962
|
+
* @default true
|
|
1963
|
+
*/
|
|
1268
1964
|
autoHide?: boolean;
|
|
1269
|
-
/**
|
|
1965
|
+
/** {zh}
|
|
1270
1966
|
* @brief 自动失焦延迟时长,单位ms,autoHide 为 true 时生效。
|
|
1271
1967
|
* @default 3000
|
|
1272
1968
|
*/
|
|
1969
|
+
/** {en}
|
|
1970
|
+
* @brief The duration after which the player automatically loses focus, in milliseconds. This parameter takes effect when `autoHide` is `true`.
|
|
1971
|
+
* @default 3000
|
|
1972
|
+
*/
|
|
1273
1973
|
delay?: number;
|
|
1274
1974
|
}): void;
|
|
1275
|
-
/**
|
|
1975
|
+
/** {zh}
|
|
1276
1976
|
* @brief 播放器失去焦点,调用该方法 `veplayer.isFocused` 将会变为 `false`,并触发 `PLAYER_BLUR` 事件。
|
|
1277
1977
|
* @param data 播放器失去焦点配置信息。
|
|
1278
1978
|
*/
|
|
1979
|
+
/** {en}
|
|
1980
|
+
* @brief The player loses focus. When the method is called, `veplayer.isFocused` will become `false` and the `PLAYER_BLUR` event will be triggered.
|
|
1981
|
+
* @param data The related configurations.
|
|
1982
|
+
*/
|
|
1279
1983
|
blur(data?: {
|
|
1280
|
-
/**
|
|
1984
|
+
/** {zh}
|
|
1281
1985
|
* @brief 播放器失焦是否忽略暂停状态,默认值是 true,即默认暂停的时候不取消播放器焦点状态。
|
|
1282
1986
|
* @default false
|
|
1283
1987
|
*/
|
|
1988
|
+
/** {en}
|
|
1989
|
+
* @brief Whether to ignore the pause state. The default value is `true`, which means the player will not lose focus when the playback is paused.
|
|
1990
|
+
* @default false
|
|
1991
|
+
*/
|
|
1284
1992
|
ignorePaused?: boolean;
|
|
1285
1993
|
}): void;
|
|
1286
|
-
/**
|
|
1994
|
+
/** {zh}
|
|
1287
1995
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
1288
1996
|
* @param el 全屏作用的 DOM 节点。
|
|
1289
1997
|
*/
|
|
1998
|
+
/** {en}
|
|
1999
|
+
* @brief Turns the player into full-screen mode, in which the player covers the entire desktop. If the player is in full-window mode when the method is called, it will automatically exit full-window mode, and the `Events.FULLSCREEN_CHANGE` event will be triggered.
|
|
2000
|
+
* @param el The DOM node in which the player is displayed in full-screen mode.
|
|
2001
|
+
*/
|
|
1290
2002
|
requestFullscreen(el?: HTMLElement): Promise<void>;
|
|
1291
|
-
/**
|
|
2003
|
+
/** {zh}
|
|
1292
2004
|
* @brief 调用此方法退出系统全屏状态,调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.FULLSCREEN_CHANGE` 事件。
|
|
1293
2005
|
* @param el 全屏作用的 DOM 节点。
|
|
1294
2006
|
*/
|
|
2007
|
+
/** {en}
|
|
2008
|
+
* @brief Exits full-screen mode. After the method is called, `veplayer.isFullscreen` will become `false` and the `Events.FULLSCREEN_CHANGE` event will be triggered.
|
|
2009
|
+
* @param el The DOM node of the full screen effect.
|
|
2010
|
+
*/
|
|
1295
2011
|
exitFullscreen(el?: HTMLElement): Promise<void>;
|
|
1296
|
-
/**
|
|
2012
|
+
/** {zh}
|
|
1297
2013
|
* @brief 调用此方法进入网页样式全屏状态,播放器进入网页全屏,利用 CSS 模拟实现全屏效果。如果该接口调用的时候处于全屏状态,会自动退出全屏,下发事件 `Events.CSS_FULLSCREEN_CHANGE`。
|
|
1298
2014
|
* @param el 全屏作用的 DOM 节点。
|
|
1299
2015
|
*/
|
|
2016
|
+
/** {en}
|
|
2017
|
+
* @brief Turns the player into full-window mode, in which the player covers the entire browser window. If the player is in full-screen mode when the method is called, it will automatically exit full-screen mode, and the `Events.CSS_FULLSCREEN_CHANGE` event will be triggered.
|
|
2018
|
+
* @param el The DOM node in which the player is displayed in full-window mode.
|
|
2019
|
+
*/
|
|
1300
2020
|
requestCssFullscreen(el?: HTMLElement): void;
|
|
1301
|
-
/**
|
|
2021
|
+
/** {zh}
|
|
1302
2022
|
* @brief 调用此方法退出网页样式全屏状态。 调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.CSS_FULLSCREEN_CHANGE` 事件。
|
|
1303
2023
|
*/
|
|
2024
|
+
/** {en}
|
|
2025
|
+
* @brief Exits the full-window mode. When the method is called, `veplayer.isFullscreen` will become `false` and the `Events.CSS_FULLSCREEN_CHANGE` event will be triggered.
|
|
2026
|
+
*/
|
|
1304
2027
|
exitCssFullscreen(): void;
|
|
1305
|
-
/**
|
|
2028
|
+
/** {zh}
|
|
1306
2029
|
* @brief 调用此方法在当前播放器上注册指定插件。
|
|
1307
2030
|
* @param plugin 插件构造函数。
|
|
1308
2031
|
* @param config 插件的配置列表。
|
|
1309
2032
|
*/
|
|
2033
|
+
/** {en}
|
|
2034
|
+
* @brief Registers a specified plug-in to the current player.
|
|
2035
|
+
* @param Plugin The plugin constructor.
|
|
2036
|
+
* @param config The plugin configurations.
|
|
2037
|
+
*/
|
|
1310
2038
|
registerPlugin(plugin:
|
|
1311
2039
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1312
2040
|
Function | {
|
|
1313
|
-
/**
|
|
2041
|
+
/** {zh}
|
|
1314
2042
|
* @brief 插件构造函数。
|
|
1315
2043
|
* @default 无
|
|
1316
2044
|
*/
|
|
2045
|
+
/** {en}
|
|
2046
|
+
* @brief The plugin constructor.
|
|
2047
|
+
*/
|
|
1317
2048
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1318
2049
|
plugin: Function;
|
|
1319
|
-
/**
|
|
2050
|
+
/** {zh}
|
|
1320
2051
|
* @brief 插件配置参数。
|
|
1321
2052
|
* @default 无
|
|
1322
2053
|
*/
|
|
2054
|
+
/** {en}
|
|
2055
|
+
* @brief The plugin configurations.
|
|
2056
|
+
*/
|
|
1323
2057
|
options: object;
|
|
1324
2058
|
}, config?: {
|
|
1325
2059
|
[propName: string]: any;
|
|
1326
2060
|
}): any;
|
|
1327
|
-
/**
|
|
2061
|
+
/** {zh}
|
|
1328
2062
|
* @brief 调用此方法在当前播放器上销毁/注销指定插件。
|
|
1329
2063
|
* @param plugin 插件实例或者插件名称。
|
|
1330
2064
|
*/
|
|
2065
|
+
/** {en}
|
|
2066
|
+
* @brief Destroys or unregisters a specified plugin from the player.
|
|
2067
|
+
* @param Plugin The plugin instance or name.
|
|
2068
|
+
*/
|
|
1331
2069
|
unRegisterPlugin(plugin: any): void;
|
|
1332
|
-
/**
|
|
2070
|
+
/** {zh}
|
|
1333
2071
|
* @brief 调用此接口显示指定插件图标。
|
|
1334
2072
|
* @param pluginNames 插件名称
|
|
1335
2073
|
*/
|
|
2074
|
+
/** {en}
|
|
2075
|
+
* @brief Displays the icon of a specified plugin.
|
|
2076
|
+
* @param PluginNames The plugin name.
|
|
2077
|
+
*/
|
|
1336
2078
|
showIcon(pluginNames: string[]): void;
|
|
1337
|
-
/**
|
|
2079
|
+
/** {zh}
|
|
1338
2080
|
* @brief 调用此接口隐藏指定插件图标。
|
|
1339
2081
|
* @param pluginNames 插件名称
|
|
1340
2082
|
*/
|
|
2083
|
+
/** {en}
|
|
2084
|
+
* @brief Hides the icon of a specified plugin.
|
|
2085
|
+
* @param PluginNames The plugin name.
|
|
2086
|
+
*/
|
|
1341
2087
|
hideIcon(pluginNames: string[]): void;
|
|
1342
|
-
/**
|
|
2088
|
+
/** {zh}
|
|
1343
2089
|
* @brief 调用此方法销毁播放器实例。
|
|
1344
2090
|
*/
|
|
2091
|
+
/** {en}
|
|
2092
|
+
* @brief Destroys the player instance.
|
|
2093
|
+
*/
|
|
1345
2094
|
destroy(): void;
|
|
1346
|
-
/**
|
|
2095
|
+
/** {zh}
|
|
2096
|
+
* @hidden
|
|
2097
|
+
*/
|
|
2098
|
+
/** {en}
|
|
1347
2099
|
* @hidden
|
|
1348
2100
|
*/
|
|
1349
2101
|
prepare(url: string): Promise<{
|
|
@@ -1571,7 +2323,14 @@ declare namespace strategy {
|
|
|
1571
2323
|
set url(url: string);
|
|
1572
2324
|
next(): DefinitionUrl;
|
|
1573
2325
|
}
|
|
1574
|
-
/**
|
|
2326
|
+
/** {zh}
|
|
2327
|
+
* @list option
|
|
2328
|
+
* @kind property
|
|
2329
|
+
* @id Definition
|
|
2330
|
+
* @name Definition
|
|
2331
|
+
*
|
|
2332
|
+
*/
|
|
2333
|
+
/** {en}
|
|
1575
2334
|
* @list option
|
|
1576
2335
|
* @kind property
|
|
1577
2336
|
* @id Definition
|
|
@@ -1583,26 +2342,46 @@ declare namespace strategy {
|
|
|
1583
2342
|
* @brief 播放地址。
|
|
1584
2343
|
* @default 无
|
|
1585
2344
|
*/
|
|
2345
|
+
/** {en}
|
|
2346
|
+
* @brief The playback address.
|
|
2347
|
+
*/
|
|
1586
2348
|
url: string;
|
|
1587
2349
|
/** {zh}
|
|
1588
2350
|
* @brief 清晰度标识(唯一值)。
|
|
1589
2351
|
* @default 无
|
|
1590
2352
|
*
|
|
1591
2353
|
*/
|
|
2354
|
+
/** {en}
|
|
2355
|
+
* @brief The resolution ID. This value must be unique.
|
|
2356
|
+
*
|
|
2357
|
+
*/
|
|
1592
2358
|
definition: string;
|
|
1593
2359
|
/** {zh}
|
|
1594
2360
|
* @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
|
|
1595
2361
|
* @default 无
|
|
1596
2362
|
*/
|
|
2363
|
+
/** {en}
|
|
2364
|
+
* @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
|
|
2365
|
+
*/
|
|
1597
2366
|
text?: Record<Lang, string> | string;
|
|
1598
2367
|
/** {zh}
|
|
1599
2368
|
* @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
1600
2369
|
* @default 无
|
|
1601
2370
|
*
|
|
1602
2371
|
*/
|
|
2372
|
+
/** {en}
|
|
2373
|
+
* @brief The backup pull stream address for the current resolution. You can set multiple backup addresses. When the player fails to pull a stream from the current address, it will loop between the current and the backup addresses until it successfully pulls a stream.
|
|
2374
|
+
*
|
|
2375
|
+
*/
|
|
1603
2376
|
fallbackUrls?: string[];
|
|
1604
2377
|
}
|
|
1605
|
-
/**
|
|
2378
|
+
/** {zh}
|
|
2379
|
+
* @list option
|
|
2380
|
+
* @kind property
|
|
2381
|
+
* @id Source
|
|
2382
|
+
* @alias Source
|
|
2383
|
+
*/
|
|
2384
|
+
/** {en}
|
|
1606
2385
|
* @list option
|
|
1607
2386
|
* @kind property
|
|
1608
2387
|
* @id Source
|
|
@@ -1613,18 +2392,29 @@ declare namespace strategy {
|
|
|
1613
2392
|
* @brief 线路标识(唯一值)。
|
|
1614
2393
|
* @default 无
|
|
1615
2394
|
*/
|
|
2395
|
+
/** {en}
|
|
2396
|
+
* @brief The playback source ID. This value must be unique.
|
|
2397
|
+
*/
|
|
1616
2398
|
name?: string;
|
|
1617
2399
|
/** {zh}
|
|
1618
2400
|
* @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
|
|
1619
2401
|
* @default 无
|
|
1620
2402
|
*
|
|
1621
2403
|
*/
|
|
2404
|
+
/** {en}
|
|
2405
|
+
* @brief The display name of the live stream source. Multiple languages are supported. For example, you set it to `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`.
|
|
2406
|
+
*
|
|
2407
|
+
*/
|
|
1622
2408
|
text?: Record<Lang, string> | string;
|
|
1623
2409
|
/** {zh}
|
|
1624
2410
|
* @brief 该线路下清晰度列表。
|
|
1625
2411
|
* @default 无
|
|
1626
2412
|
*
|
|
1627
2413
|
*/
|
|
2414
|
+
/** {en}
|
|
2415
|
+
* @brief A list of resolutions of the current source.
|
|
2416
|
+
*
|
|
2417
|
+
*/
|
|
1628
2418
|
definitions: Array<ExposedDefinition | string>;
|
|
1629
2419
|
}
|
|
1630
2420
|
interface CompoundSources {
|
|
@@ -1697,27 +2487,44 @@ declare namespace strategy {
|
|
|
1697
2487
|
private _handleHide;
|
|
1698
2488
|
}
|
|
1699
2489
|
import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
|
|
1700
|
-
/**
|
|
2490
|
+
/** {zh}
|
|
1701
2491
|
* @detail option
|
|
1702
2492
|
* @brief **清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
1703
2493
|
*/
|
|
2494
|
+
/** {en}
|
|
2495
|
+
* @detail option
|
|
2496
|
+
* @brief The panel style for resolution and live stream source selection. This setting is effective on mobile devices only.
|
|
2497
|
+
*/
|
|
1704
2498
|
enum ListType {
|
|
1705
2499
|
/** {zh}
|
|
1706
2500
|
* @brief 全屏布局
|
|
1707
2501
|
* @hidden
|
|
1708
2502
|
*/
|
|
2503
|
+
/** {en}
|
|
2504
|
+
* @brief Fullscreen layout.
|
|
2505
|
+
* @hidden
|
|
2506
|
+
*/
|
|
1709
2507
|
Middle = "middle",
|
|
1710
2508
|
/** {zh}
|
|
1711
2509
|
* @brief 底部抽屉
|
|
1712
2510
|
*/
|
|
2511
|
+
/** {en}
|
|
2512
|
+
* @brief Bottom navigation drawer.
|
|
2513
|
+
*/
|
|
1713
2514
|
Bottom = "bottom",
|
|
1714
2515
|
/** {zh}
|
|
1715
2516
|
* @brief 右侧抽屉,常用于全屏时展示
|
|
1716
2517
|
*/
|
|
2518
|
+
/** {en}
|
|
2519
|
+
* @brief Right navigation drawer. This is often used for fullscreen display.
|
|
2520
|
+
*/
|
|
1717
2521
|
Fullscreen = "fullscreen",
|
|
1718
2522
|
/** {zh}
|
|
1719
2523
|
* @brief 窗口蒙层展示
|
|
1720
2524
|
*/
|
|
2525
|
+
/** {en}
|
|
2526
|
+
* @brief Overlay.
|
|
2527
|
+
*/
|
|
1721
2528
|
Inner = "inner"
|
|
1722
2529
|
}
|
|
1723
2530
|
interface ListItem {
|
|
@@ -1799,203 +2606,363 @@ declare namespace strategy {
|
|
|
1799
2606
|
render(): string;
|
|
1800
2607
|
private _getListType;
|
|
1801
2608
|
}
|
|
1802
|
-
/**
|
|
2609
|
+
/** {zh}
|
|
2610
|
+
* @detail error
|
|
2611
|
+
*/
|
|
2612
|
+
/** {en}
|
|
1803
2613
|
* @detail error
|
|
1804
2614
|
*/
|
|
1805
2615
|
enum Level {
|
|
1806
|
-
/**
|
|
2616
|
+
/** {zh}
|
|
1807
2617
|
* @brief 严重
|
|
1808
2618
|
*
|
|
1809
2619
|
*/
|
|
2620
|
+
/** {en}
|
|
2621
|
+
* @brief Fatal.
|
|
2622
|
+
*
|
|
2623
|
+
*/
|
|
1810
2624
|
Fatal = "Fatal",
|
|
1811
|
-
/**
|
|
2625
|
+
/** {zh}
|
|
1812
2626
|
* @brief 报错
|
|
1813
2627
|
*/
|
|
2628
|
+
/** {en}
|
|
2629
|
+
* @brief Error.
|
|
2630
|
+
*/
|
|
1814
2631
|
Error = "Error"
|
|
1815
2632
|
}
|
|
1816
2633
|
enum ErrorCode {
|
|
1817
|
-
/**
|
|
2634
|
+
/** {zh}
|
|
1818
2635
|
* @brief 视频解析错误
|
|
1819
2636
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1820
2637
|
*/
|
|
2638
|
+
/** {en}
|
|
2639
|
+
* @brief Video parsing error.
|
|
2640
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2641
|
+
*/
|
|
1821
2642
|
MANIFEST_HLS_ERROR = 1100,
|
|
1822
|
-
/**
|
|
2643
|
+
/** {zh}
|
|
1823
2644
|
* @brief 视频解析错误
|
|
1824
2645
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1825
2646
|
*/
|
|
2647
|
+
/** {en}
|
|
2648
|
+
* @brief Video parsing error.
|
|
2649
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2650
|
+
*/
|
|
1826
2651
|
MANIFEST_DASH_ERROR = 1200,
|
|
1827
|
-
/**
|
|
2652
|
+
/** {zh}
|
|
1828
2653
|
* @brief 网络错误
|
|
1829
2654
|
* @solution 请检查当前网络环境或播放地址是否合法。
|
|
1830
2655
|
*/
|
|
2656
|
+
/** {en}
|
|
2657
|
+
* @brief Network error.
|
|
2658
|
+
* @solution Please check the current network environment and ensure the pull stream address is valid.
|
|
2659
|
+
*/
|
|
1831
2660
|
NETWORK = 2100,
|
|
1832
|
-
/**
|
|
2661
|
+
/** {zh}
|
|
1833
2662
|
* @brief 网络请求超时
|
|
1834
2663
|
* @solution 请检查拉流地址是否合法。
|
|
1835
2664
|
*/
|
|
2665
|
+
/** {en}
|
|
2666
|
+
* @brief Network request timed out
|
|
2667
|
+
* @solution Please check whether the pull stream address is valid.
|
|
2668
|
+
*/
|
|
1836
2669
|
NETWORK_TIMEOUT = 2101,
|
|
1837
|
-
/**
|
|
2670
|
+
/** {zh}
|
|
1838
2671
|
* @brief 网络请求 403
|
|
1839
2672
|
* @solution 请检查拉流地址鉴权信息。
|
|
1840
2673
|
*/
|
|
2674
|
+
/** {en}
|
|
2675
|
+
* @brief The player received a 403 response code.
|
|
2676
|
+
* @solution Check the authentication information in the pull stream address.
|
|
2677
|
+
*/
|
|
1841
2678
|
NETWORK_FORBIDDEN = 2103,
|
|
1842
|
-
/**
|
|
2679
|
+
/** {zh}
|
|
1843
2680
|
* @brief 网络请求 404
|
|
1844
2681
|
* @solution 请检查拉流地址是否合法。
|
|
1845
2682
|
*/
|
|
2683
|
+
/** {en}
|
|
2684
|
+
* @brief The player received a 404 response code.
|
|
2685
|
+
* @solution Check whether the pull stream address is valid.
|
|
2686
|
+
*/
|
|
1846
2687
|
NETWORK_NOTFOUND = 2104,
|
|
1847
|
-
/**
|
|
2688
|
+
/** {zh}
|
|
1848
2689
|
* @brief 网络请求 206
|
|
1849
2690
|
* @solution 请检查拉流地址是否合法。
|
|
1850
2691
|
*/
|
|
2692
|
+
/** {en}
|
|
2693
|
+
* @brief The player received a 206 response code.
|
|
2694
|
+
* @solution Check whether the pull stream address is valid.
|
|
2695
|
+
*/
|
|
1851
2696
|
NETWORK_RANGE_NOT_SATISFIABLE = 2116,
|
|
1852
|
-
/**
|
|
2697
|
+
/** {zh}
|
|
1853
2698
|
* @brief 视频解析错误
|
|
1854
2699
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1855
2700
|
*/
|
|
2701
|
+
/** {en}
|
|
2702
|
+
* @brief Video parsing error.
|
|
2703
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2704
|
+
*/
|
|
1856
2705
|
DEMUX_FLV_ERROR = 3100,
|
|
1857
|
-
/**
|
|
2706
|
+
/** {zh}
|
|
1858
2707
|
* @brief 视频解析错误
|
|
1859
2708
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1860
2709
|
*/
|
|
2710
|
+
/** {en}
|
|
2711
|
+
* @brief Video parsing error.
|
|
2712
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2713
|
+
*/
|
|
1861
2714
|
DEMUX_HLS_ERROR = 3200,
|
|
1862
|
-
/**
|
|
2715
|
+
/** {zh}
|
|
1863
2716
|
* @brief 视频解析错误
|
|
1864
2717
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1865
2718
|
*
|
|
1866
2719
|
*/
|
|
2720
|
+
/** {en}
|
|
2721
|
+
* @brief Video parsing error.
|
|
2722
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2723
|
+
*
|
|
2724
|
+
*/
|
|
1867
2725
|
DEMUX_MP4_ERROR = 3300,
|
|
1868
|
-
/**
|
|
2726
|
+
/** {zh}
|
|
1869
2727
|
* @brief 视频解析错误
|
|
1870
2728
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1871
2729
|
*
|
|
1872
2730
|
*/
|
|
2731
|
+
/** {en}
|
|
2732
|
+
* @brief Video parsing error.
|
|
2733
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2734
|
+
*
|
|
2735
|
+
*/
|
|
1873
2736
|
DEMUX_FMP4_ERROR = 3400,
|
|
1874
|
-
/**
|
|
2737
|
+
/** {zh}
|
|
1875
2738
|
* @brief 视频解析错误
|
|
1876
2739
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1877
2740
|
*
|
|
1878
2741
|
*/
|
|
2742
|
+
/** {en}
|
|
2743
|
+
* @brief Video parsing error.
|
|
2744
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2745
|
+
*
|
|
2746
|
+
*/
|
|
1879
2747
|
DEMUX_SIDX_ERROR = 3410,
|
|
1880
|
-
/**
|
|
2748
|
+
/** {zh}
|
|
1881
2749
|
* @brief 视频解析错误
|
|
1882
2750
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1883
2751
|
*
|
|
1884
2752
|
*/
|
|
2753
|
+
/** {en}
|
|
2754
|
+
* @brief Video parsing error.
|
|
2755
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2756
|
+
*
|
|
2757
|
+
*/
|
|
1885
2758
|
REMUX_FMP4_ERROR = 4100,
|
|
1886
|
-
/**
|
|
2759
|
+
/** {zh}
|
|
1887
2760
|
* @brief 视频解析错误
|
|
1888
2761
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1889
2762
|
*
|
|
1890
2763
|
*/
|
|
2764
|
+
/** {en}
|
|
2765
|
+
* @brief Video parsing error.
|
|
2766
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
2767
|
+
*
|
|
2768
|
+
*/
|
|
1891
2769
|
REMUX_MP4_ERROR = 4200,
|
|
1892
|
-
/**
|
|
2770
|
+
/** {zh}
|
|
1893
2771
|
* @brief 获取数据过程被中止
|
|
1894
2772
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
1895
2773
|
*/
|
|
2774
|
+
/** {en}
|
|
2775
|
+
* @brief The process of obtaining data was aborted.
|
|
2776
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
2777
|
+
*/
|
|
1896
2778
|
MEDIA_ERR_ABORTED = 5101,
|
|
1897
|
-
/**
|
|
2779
|
+
/** {zh}
|
|
1898
2780
|
* @brief 网络发生错误,无法成功获取媒体文件
|
|
1899
2781
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
1900
2782
|
*/
|
|
2783
|
+
/** {en}
|
|
2784
|
+
* @brief A network error occurred and the media file could not be successfully obtained.
|
|
2785
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
2786
|
+
*/
|
|
1901
2787
|
MEDIA_ERR_NETWORK = 5102,
|
|
1902
|
-
/**
|
|
2788
|
+
/** {zh}
|
|
1903
2789
|
* @brief 浏览器在解码媒体资源时发生错误
|
|
1904
2790
|
* @solution
|
|
1905
2791
|
* 1. 请检查原始视频是否正常;
|
|
1906
2792
|
* 2. 重新进行转码和播放;
|
|
1907
2793
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1908
2794
|
*/
|
|
2795
|
+
/** {en}
|
|
2796
|
+
* @brief An error occurred to the browser while decoding the media resources.
|
|
2797
|
+
* @solution
|
|
2798
|
+
* 1. Check whether there is any issue with the original video.
|
|
2799
|
+
* 2. Re-transcode the video and play it again.
|
|
2800
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2801
|
+
*/
|
|
1909
2802
|
MEDIA_ERR_DECODE = 5103,
|
|
1910
|
-
/**
|
|
2803
|
+
/** {zh}
|
|
1911
2804
|
* @brief 因视频格式不支持、服务器或网络的问题造成视频无法加载
|
|
1912
2805
|
* @solution
|
|
1913
2806
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
1914
2807
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
1915
2808
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1916
2809
|
*/
|
|
2810
|
+
/** {en}
|
|
2811
|
+
* @brief The video cannot be loaded due to unsupported video format or server or network issues.
|
|
2812
|
+
* @solution
|
|
2813
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
2814
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
2815
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2816
|
+
*/
|
|
1917
2817
|
MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
|
|
1918
|
-
/**
|
|
2818
|
+
/** {zh}
|
|
1919
2819
|
* @brief 当前浏览器不支持视频解码
|
|
1920
2820
|
* @solution
|
|
1921
2821
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
1922
2822
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
1923
2823
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1924
2824
|
*/
|
|
2825
|
+
/** {en}
|
|
2826
|
+
* @brief The current browser does not support video decoding.
|
|
2827
|
+
* @solution
|
|
2828
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
2829
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
2830
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2831
|
+
*/
|
|
1925
2832
|
MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
|
|
1926
|
-
/**
|
|
2833
|
+
/** {zh}
|
|
1927
2834
|
* @brief 当前播放地址为空
|
|
1928
2835
|
* @solution 请检查必要参数 `url` 或 `playlist` 是否传入。
|
|
1929
2836
|
*/
|
|
2837
|
+
/** {en}
|
|
2838
|
+
* @brief The current pull stream address is empty.
|
|
2839
|
+
* @solution Check whether 'url' or 'playlist' is specified.
|
|
2840
|
+
*/
|
|
1930
2841
|
MEDIA_ERR_URL_EMPTY = 5106,
|
|
1931
|
-
/**
|
|
2842
|
+
/** {zh}
|
|
1932
2843
|
* @brief 播放异常
|
|
1933
2844
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1934
2845
|
*/
|
|
2846
|
+
/** {en}
|
|
2847
|
+
* @brief A playback issue occurred.
|
|
2848
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2849
|
+
*/
|
|
1935
2850
|
MEDIA_MSE_ADD_SB = 5200,
|
|
1936
|
-
/**
|
|
2851
|
+
/** {zh}
|
|
1937
2852
|
* @brief 播放异常
|
|
1938
2853
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1939
2854
|
*/
|
|
2855
|
+
/** {en}
|
|
2856
|
+
* @brief A playback issue occurred.
|
|
2857
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2858
|
+
*/
|
|
1940
2859
|
MEDIA_MSE_APPEND_BUFFER = 5201,
|
|
1941
|
-
/**
|
|
2860
|
+
/** {zh}
|
|
1942
2861
|
* @brief 播放异常
|
|
1943
2862
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1944
2863
|
*/
|
|
2864
|
+
/** {en}
|
|
2865
|
+
* @brief A playback issue occurred.
|
|
2866
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2867
|
+
*/
|
|
1945
2868
|
MEDIA_MSE_OTHER = 5202,
|
|
1946
|
-
/**
|
|
2869
|
+
/** {zh}
|
|
1947
2870
|
* @brief 播放异常
|
|
1948
2871
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1949
2872
|
*/
|
|
2873
|
+
/** {en}
|
|
2874
|
+
* @brief A playback issue occurred.
|
|
2875
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2876
|
+
*/
|
|
1950
2877
|
MEDIA_MSE_FULL = 5203,
|
|
1951
|
-
/**
|
|
2878
|
+
/** {zh}
|
|
1952
2879
|
* @brief 播放异常
|
|
1953
2880
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1954
2881
|
*/
|
|
2882
|
+
/** {en}
|
|
2883
|
+
* @brief A playback issue occurred.
|
|
2884
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2885
|
+
*/
|
|
1955
2886
|
MEDIA_MSE_HIJACK = 5204,
|
|
1956
|
-
/**
|
|
2887
|
+
/** {zh}
|
|
1957
2888
|
* @brief 播放异常
|
|
1958
2889
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1959
2890
|
*/
|
|
2891
|
+
/** {en}
|
|
2892
|
+
* @brief A playback issue occurred.
|
|
2893
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2894
|
+
*/
|
|
1960
2895
|
MEDIA_EME_HIJACK = 5301,
|
|
1961
|
-
/**
|
|
2896
|
+
/** {zh}
|
|
1962
2897
|
* @brief DRM 权限校验失败
|
|
1963
2898
|
* @hidden
|
|
1964
2899
|
*/
|
|
2900
|
+
/** {en}
|
|
2901
|
+
* @brief DRM authentication failed.
|
|
2902
|
+
* @hidden
|
|
2903
|
+
*/
|
|
1965
2904
|
DRM_LICENSE = 7100,
|
|
1966
|
-
/**
|
|
2905
|
+
/** {zh}
|
|
1967
2906
|
* @brief DRM 权限校验失败
|
|
1968
2907
|
* @hidden
|
|
1969
2908
|
*/
|
|
2909
|
+
/** {en}
|
|
2910
|
+
* @brief DRM authentication failed.
|
|
2911
|
+
* @hidden
|
|
2912
|
+
*/
|
|
1970
2913
|
DRM_CUSTOM_LICENSE = 7200,
|
|
1971
|
-
/**
|
|
2914
|
+
/** {zh}
|
|
1972
2915
|
* @brief 播放异常
|
|
1973
2916
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1974
2917
|
*/
|
|
2918
|
+
/** {en}
|
|
2919
|
+
* @brief A playback issue occurred.
|
|
2920
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2921
|
+
*/
|
|
1975
2922
|
OTHER = 8000,
|
|
1976
|
-
/**
|
|
2923
|
+
/** {zh}
|
|
1977
2924
|
* @brief 播放异常
|
|
1978
2925
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1979
2926
|
*/
|
|
2927
|
+
/** {en}
|
|
2928
|
+
* @brief A playback issue occurred.
|
|
2929
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2930
|
+
*/
|
|
1980
2931
|
RUNTIME_NO_CANPLAY_ERROR = 9001,
|
|
1981
|
-
/**
|
|
2932
|
+
/** {zh}
|
|
1982
2933
|
* @brief 播放异常
|
|
1983
2934
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1984
2935
|
*/
|
|
2936
|
+
/** {en}
|
|
2937
|
+
* @brief A playback issue occurred.
|
|
2938
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2939
|
+
*/
|
|
1985
2940
|
RUNTIME_BUFFERBREAK_ERROR = 9002,
|
|
1986
|
-
/**
|
|
2941
|
+
/** {zh}
|
|
1987
2942
|
* @brief 播放异常
|
|
1988
2943
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1989
2944
|
*/
|
|
2945
|
+
/** {en}
|
|
2946
|
+
* @brief A playback issue occurred.
|
|
2947
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
2948
|
+
*/
|
|
1990
2949
|
RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
|
|
1991
2950
|
// veplayer 报错
|
|
1992
|
-
/**
|
|
2951
|
+
/** {zh}
|
|
1993
2952
|
* @brief CDN 异步获取失败
|
|
1994
2953
|
* @solution 请刷新重试或者检查网络环境。
|
|
1995
2954
|
*
|
|
1996
2955
|
*/
|
|
2956
|
+
/** {en}
|
|
2957
|
+
* @brief CDN asynchronous fetch failed.
|
|
2958
|
+
* @solution Refresh the page or check the network environment.
|
|
2959
|
+
*
|
|
2960
|
+
*/
|
|
1997
2961
|
MODULE_LOAD_ERROR = 110,
|
|
1998
|
-
/**
|
|
2962
|
+
/** {zh}
|
|
2963
|
+
* @hidden
|
|
2964
|
+
*/
|
|
2965
|
+
/** {en}
|
|
1999
2966
|
* @hidden
|
|
2000
2967
|
*/
|
|
2001
2968
|
UNKNOWN = "UNKNOWN"
|
|
@@ -2021,31 +2988,55 @@ declare namespace strategy {
|
|
|
2021
2988
|
}
|
|
2022
2989
|
const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
|
|
2023
2990
|
const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
|
|
2024
|
-
/**
|
|
2991
|
+
/** {zh}
|
|
2025
2992
|
* @list error
|
|
2026
2993
|
* @detail error
|
|
2027
2994
|
* @brief 错误对象
|
|
2028
2995
|
* @name VeError
|
|
2029
2996
|
* @id VeError
|
|
2030
2997
|
*/
|
|
2998
|
+
/** {en}
|
|
2999
|
+
* @list error
|
|
3000
|
+
* @detail error
|
|
3001
|
+
* @brief The error object.
|
|
3002
|
+
* @name VeError
|
|
3003
|
+
* @id VeError
|
|
3004
|
+
*/
|
|
2031
3005
|
class VeError<T extends string = TextKey> extends Error {
|
|
2032
3006
|
/**
|
|
2033
|
-
* @brief
|
|
3007
|
+
* @brief 错误码。
|
|
3008
|
+
*/
|
|
3009
|
+
/** {en}
|
|
3010
|
+
* @brief The error code.
|
|
2034
3011
|
*/
|
|
2035
3012
|
readonly errorCode: ErrorCode;
|
|
2036
|
-
/**
|
|
3013
|
+
/** {zh}
|
|
2037
3014
|
* @brief 错误等级。
|
|
2038
3015
|
*/
|
|
3016
|
+
/** {en}
|
|
3017
|
+
* @brief The error level.
|
|
3018
|
+
*/
|
|
2039
3019
|
readonly level?: Level;
|
|
2040
|
-
/**
|
|
3020
|
+
/** {zh}
|
|
2041
3021
|
* @brief 错误信息。
|
|
2042
3022
|
*/
|
|
3023
|
+
/** {en}
|
|
3024
|
+
* @brief The error message.
|
|
3025
|
+
*/
|
|
2043
3026
|
message: string;
|
|
2044
|
-
/**
|
|
3027
|
+
/** {zh}
|
|
2045
3028
|
* @brief 其他错误信息。
|
|
2046
3029
|
*/
|
|
3030
|
+
/** {en}
|
|
3031
|
+
* @brief Other error messages.
|
|
3032
|
+
*/
|
|
2047
3033
|
readonly ext?: any;
|
|
2048
|
-
/**
|
|
3034
|
+
/** {zh}
|
|
3035
|
+
* @hidden
|
|
3036
|
+
* @param error
|
|
3037
|
+
* @param i18n
|
|
3038
|
+
*/
|
|
3039
|
+
/** {en}
|
|
2049
3040
|
* @hidden
|
|
2050
3041
|
* @param error
|
|
2051
3042
|
* @param i18n
|
|
@@ -2054,7 +3045,11 @@ declare namespace strategy {
|
|
|
2054
3045
|
}
|
|
2055
3046
|
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" | "DRM_LICENSE" | "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">;
|
|
2056
3047
|
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" | "DRM_LICENSE" | "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">;
|
|
2057
|
-
/**
|
|
3048
|
+
/** {zh}
|
|
3049
|
+
* @list option
|
|
3050
|
+
* @kind property
|
|
3051
|
+
*/
|
|
3052
|
+
/** {en}
|
|
2058
3053
|
* @list option
|
|
2059
3054
|
* @kind property
|
|
2060
3055
|
*/
|
|
@@ -2063,26 +3058,46 @@ declare namespace strategy {
|
|
|
2063
3058
|
* @brief 是否展示报错图片。
|
|
2064
3059
|
* @default true
|
|
2065
3060
|
*/
|
|
3061
|
+
/** {en}
|
|
3062
|
+
* @brief Whether to display the error image.
|
|
3063
|
+
* @default true
|
|
3064
|
+
*/
|
|
2066
3065
|
showErrorImg?: boolean;
|
|
2067
3066
|
/** {zh}
|
|
2068
3067
|
* @brief 是否展示报错提示。
|
|
2069
3068
|
* @default true
|
|
2070
3069
|
*/
|
|
3070
|
+
/** {en}
|
|
3071
|
+
* @brief Whether to display the error message.
|
|
3072
|
+
* @default true
|
|
3073
|
+
*/
|
|
2071
3074
|
showErrorTip?: boolean;
|
|
2072
3075
|
/** {zh}
|
|
2073
3076
|
* @brief 是否展示刷新按钮。
|
|
2074
3077
|
* @default true
|
|
2075
3078
|
*/
|
|
3079
|
+
/** {en}
|
|
3080
|
+
* @brief Whether to display the refresh button.
|
|
3081
|
+
* @default true
|
|
3082
|
+
*/
|
|
2076
3083
|
showRefresh?: boolean;
|
|
2077
3084
|
/** {zh}
|
|
2078
3085
|
* @brief 自定义报错显示。
|
|
2079
3086
|
* @default 无
|
|
2080
3087
|
*/
|
|
3088
|
+
/** {en}
|
|
3089
|
+
* @brief Custom error message.
|
|
3090
|
+
* @default None
|
|
3091
|
+
*/
|
|
2081
3092
|
errorTipsText?: string | Record<Lang, string>;
|
|
2082
3093
|
/** {zh}
|
|
2083
3094
|
* @brief 更多提示信息。
|
|
2084
3095
|
* @default 无
|
|
2085
3096
|
*/
|
|
3097
|
+
/** {en}
|
|
3098
|
+
* @brief More tips.
|
|
3099
|
+
* @default None
|
|
3100
|
+
*/
|
|
2086
3101
|
extraTips?: {
|
|
2087
3102
|
label: string | Record<Lang, string>;
|
|
2088
3103
|
value: string | Record<Lang, string>;
|
|
@@ -2129,7 +3144,11 @@ declare namespace strategy {
|
|
|
2129
3144
|
private _handleRefresh;
|
|
2130
3145
|
private _renderRefresh;
|
|
2131
3146
|
}
|
|
2132
|
-
/**
|
|
3147
|
+
/** {zh}
|
|
3148
|
+
* @list option
|
|
3149
|
+
* @kind property
|
|
3150
|
+
*/
|
|
3151
|
+
/** {en}
|
|
2133
3152
|
* @list option
|
|
2134
3153
|
* @kind property
|
|
2135
3154
|
*/
|
|
@@ -2138,16 +3157,28 @@ declare namespace strategy {
|
|
|
2138
3157
|
* @brief 等待超时的时间阈值,单位为 ms。等待超过该值,会抛出 `DEFINITION_FALLBACK` 事件,如果 `needFallback` 为 `true` 则会提示清晰度降级。
|
|
2139
3158
|
* @default 5000
|
|
2140
3159
|
*/
|
|
3160
|
+
/** {en}
|
|
3161
|
+
* @brief The maximum wait time before a fallback, in milliseconds. If the wait time exceeds this value, a `DEFINITION_FALLBACK` event will occur, and if `needFallback` is set to `true`, the player will fall back to a lower resolution.
|
|
3162
|
+
* @default 5000
|
|
3163
|
+
*/
|
|
2141
3164
|
longWaitingTime?: number;
|
|
2142
3165
|
/** {zh}
|
|
2143
3166
|
* @brief 是否开启清晰度降级。
|
|
2144
3167
|
* @default false
|
|
2145
3168
|
*/
|
|
3169
|
+
/** {en}
|
|
3170
|
+
* @brief Whether to enable resolution fallback.
|
|
3171
|
+
* @default false
|
|
3172
|
+
*/
|
|
2146
3173
|
needFallback?: boolean;
|
|
2147
3174
|
/** {zh}
|
|
2148
3175
|
* @brief 降级顺序,按照数组顺序依次降级,数组中的元素与 playlist 中的 definition 相对应。
|
|
2149
3176
|
* @default ['uhd', 'hd', 'sd', 'ld', 'ao']
|
|
2150
3177
|
*/
|
|
3178
|
+
/** {en}
|
|
3179
|
+
* @brief The order of fallback. The player will fall back to each resolution according to the order of the array element. The values of the array elements should correspond to the value of the `definition` in the playlist.
|
|
3180
|
+
* @default "['uhd', 'hd ',' sd ',' ld ',' ao ']"
|
|
3181
|
+
*/
|
|
2151
3182
|
demotePriority?: string[];
|
|
2152
3183
|
}
|
|
2153
3184
|
class DefinitionPlugin extends OptionsIcon {
|
|
@@ -2214,51 +3245,85 @@ declare namespace strategy {
|
|
|
2214
3245
|
* @brief 指定播放器容器 ID,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
2215
3246
|
* @default 'veplayer'
|
|
2216
3247
|
*/
|
|
3248
|
+
/** {en}
|
|
3249
|
+
* @brief The container ID of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
|
|
3250
|
+
* @default 'veplayer'
|
|
3251
|
+
*/
|
|
2217
3252
|
id?: string;
|
|
2218
3253
|
/** {zh}
|
|
2219
3254
|
* @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
2220
3255
|
* @default 无
|
|
2221
3256
|
*/
|
|
3257
|
+
/** {en}
|
|
3258
|
+
* @brief The container element of the player. You should specify either `id` or `el`, or both. If both are specified, the `VePlayer` object will be inserted in the container specified by `id`.
|
|
3259
|
+
*/
|
|
2222
3260
|
el?: HTMLElement;
|
|
2223
3261
|
/** {zh}
|
|
2224
3262
|
* @brief 设置播放器宽度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 width 样式属性。
|
|
2225
3263
|
* @default '100%'
|
|
2226
3264
|
*/
|
|
3265
|
+
/** {en}
|
|
3266
|
+
* @brief The width of the player. If you set it to a number, the player will attach the unit "pixel" to it. If you set it to a string, the parameter value will be directly assigned to the `width` property of the player container.
|
|
3267
|
+
* @default '100%'
|
|
3268
|
+
*/
|
|
2227
3269
|
width?: number | string;
|
|
2228
3270
|
/** {zh}
|
|
2229
3271
|
* @brief 设置播放器高度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 height 样式属性。
|
|
2230
3272
|
* @default '100%'
|
|
2231
3273
|
*/
|
|
3274
|
+
/** {en}
|
|
3275
|
+
* @brief The height of the player. If you set it to a number, the player will attach the unit "pixel" to it. If you set it to a string, the parameter value will be directly assigned to the `height` property of the player container.
|
|
3276
|
+
* @default '100%'
|
|
3277
|
+
*/
|
|
2232
3278
|
height?: number | string;
|
|
2233
3279
|
/** {zh}
|
|
2234
3280
|
* @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
|
|
2235
3281
|
* @default 无
|
|
2236
3282
|
*/
|
|
3283
|
+
/** {en}
|
|
3284
|
+
* @brief The pull stream address. You can manually construct the address or use the address generator to generate one. To see how to generate an address, refer to [Generate live-stream addresses](https://docs.byteplus.com/en/byteplus-media-live/docs/generating-live-stream-addresses). You should specify either `url` or `playList`, or both.
|
|
3285
|
+
*/
|
|
2237
3286
|
url?: string;
|
|
2238
3287
|
/** {zh}
|
|
2239
3288
|
* @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
|
|
2240
3289
|
* @default 无
|
|
2241
3290
|
*/
|
|
3291
|
+
/** {en}
|
|
3292
|
+
* @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
|
|
3293
|
+
*/
|
|
2242
3294
|
playlist?: ExposedSource[];
|
|
2243
3295
|
/** {zh}
|
|
2244
3296
|
* @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
|
|
2245
3297
|
* @default 无
|
|
2246
3298
|
*/
|
|
3299
|
+
/** {en}
|
|
3300
|
+
* @brief The default pull stream address for the player when there are multiple addresses available. If this parameter is not specified, the first address in the playlist will become the default address.
|
|
3301
|
+
*/
|
|
2247
3302
|
defaultSource?: string;
|
|
2248
3303
|
/** {zh}
|
|
2249
3304
|
* @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
|
|
2250
3305
|
* @default 无
|
|
2251
3306
|
*/
|
|
3307
|
+
/** {en}
|
|
3308
|
+
* @brief The default resolution for the player when there are multiple resolutions available. If this parameter is not specified, the first resolution in the list will become the default resolution.
|
|
3309
|
+
*/
|
|
2252
3310
|
defaultDefinition?: string;
|
|
2253
3311
|
/** {zh}
|
|
2254
3312
|
* @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
2255
3313
|
* @default 无
|
|
2256
3314
|
*/
|
|
3315
|
+
/** {en}
|
|
3316
|
+
* @brief The backup pull stream address(es) for the player. You can enter multiple backup addresses. If `maxFallbackRound` is greater than `0`, when an error occurs in the main address, the player automatically switches to the backup address.
|
|
3317
|
+
*/
|
|
2257
3318
|
fallbackUrls?: string[];
|
|
2258
3319
|
/** {zh}
|
|
2259
3320
|
* @brief 为播放器设置拉流失败时循环拉流的最大次数。
|
|
2260
3321
|
* @default 0
|
|
2261
3322
|
*/
|
|
3323
|
+
/** {en}
|
|
3324
|
+
* @brief The maximum number of retries the player can make if it fails to pull the stream with the default address.
|
|
3325
|
+
* @default 0
|
|
3326
|
+
*/
|
|
2262
3327
|
maxFallbackRound?: number;
|
|
2263
3328
|
/** {zh}
|
|
2264
3329
|
* @brief 为播放器设置解码方式。
|
|
@@ -2269,32 +3334,60 @@ declare namespace strategy {
|
|
|
2269
3334
|
* 3. 部分浏览器不支持 H.265 编码格式,如果需要播放该编码格式的视频,请开启软解。
|
|
2270
3335
|
* @default 'hardware'
|
|
2271
3336
|
*/
|
|
3337
|
+
/** {en}
|
|
3338
|
+
* @brief The decoding method for the player.
|
|
3339
|
+
* @listtip
|
|
3340
|
+
* When software decoding is enabled, the player uses the software decoder of the browser to decode the stream. Software decoding offers high compatibility and is suitable for various devices and browsers, but it relies on the device's CPU capacity and may have freezes or latencies when playing high-resolution or high-bitrate videos. We recommend enabling software decoding in the following scenarios:
|
|
3341
|
+
* 1. In certain Android browsers, the player can sometimes be hijacked, causing certain features to be unavailable. Enabling software decoding can address this issue.
|
|
3342
|
+
* 2. Browsers on mobile devices do not support the FLV format. To play videos in this format, you can enable software decoding.
|
|
3343
|
+
* 3. Some browsers do not support the H.265 codec. To play videos encoded with H.265, you can enable software decoding.
|
|
3344
|
+
* @default 'hardware'
|
|
3345
|
+
*/
|
|
2272
3346
|
decodeType?: DecodeType;
|
|
2273
3347
|
/** {zh}
|
|
2274
3348
|
* @brief 为播放器设置视频的实际编码格式。如果您在degradation 设置了 `soft-first` 属性(即硬解不支持时降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
2275
3349
|
* @default 'h264'
|
|
2276
3350
|
*/
|
|
3351
|
+
/** {en}
|
|
3352
|
+
* @brief The actual codec of the live stream. If you specify `degradation` to `soft-first`, that is, the player should fall back to software decoding when hardware decoding is not supported, we recommend specifying the parameter so that the player does not need to detect the codec information.
|
|
3353
|
+
* @default 'h264'
|
|
3354
|
+
*/
|
|
2277
3355
|
codec?: Codec;
|
|
2278
3356
|
/** {zh}
|
|
2279
3357
|
* @brief 为播放器设置是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
2280
3358
|
* @default 'soft-first'
|
|
2281
3359
|
*/
|
|
3360
|
+
/** {en}
|
|
3361
|
+
* @brief Whether to enable H.265 compatibility mode for the player. In the H.265 compatibility mode, the player will prioritize hardware decoding for decoding H.265 streams. If the device or browser does not support hardware decoding for H.265, it will automatically fall back to software decoding.
|
|
3362
|
+
* @default 'soft-first'
|
|
3363
|
+
*/
|
|
2282
3364
|
degradation?: Degradation | boolean;
|
|
2283
3365
|
/** {zh}
|
|
2284
3366
|
* @brief 为播放器设置封面图 URL。
|
|
2285
3367
|
* @default 无
|
|
2286
3368
|
*/
|
|
3369
|
+
/** {en}
|
|
3370
|
+
* @brief The URL of the player's cover image.
|
|
3371
|
+
*/
|
|
2287
3372
|
poster?: string;
|
|
2288
3373
|
/** {zh}
|
|
2289
3374
|
* @brief 为播放器设置初始显示语言,语言包不存在的情况下默认显示 'en' 语言包 。默认值为 `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`
|
|
2290
3375
|
* @default -
|
|
2291
3376
|
*/
|
|
3377
|
+
/** {en}
|
|
3378
|
+
* @brief The initial display language of the player. If the language pack does not exist, the 'en'language pack will be displayed by default. The default value is `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`.
|
|
3379
|
+
* @default -
|
|
3380
|
+
*/
|
|
2292
3381
|
lang?: Lang;
|
|
2293
3382
|
/** {zh}
|
|
2294
|
-
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }
|
|
3383
|
+
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
|
|
2295
3384
|
* 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
|
|
2296
3385
|
* @default 无
|
|
2297
3386
|
*/
|
|
3387
|
+
/** {en}
|
|
3388
|
+
* @brief Configures a custom multilingual dictionary for the player. You can set the dictionary for each language in the format { texts: { [key: string]: Object; } }. For example, { texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }}.
|
|
3389
|
+
* You can use the [default dictionary](https://docs.byteplus.com/byteplus-media-live/docs/default-dictionary_1) as a reference.
|
|
3390
|
+
*/
|
|
2298
3391
|
i18n?: {
|
|
2299
3392
|
texts: Record<Lang, Record<string, string>>;
|
|
2300
3393
|
};
|
|
@@ -2303,6 +3396,11 @@ declare namespace strategy {
|
|
|
2303
3396
|
* @default { muted: true }
|
|
2304
3397
|
* @type {{ muted: boolean } | boolean}
|
|
2305
3398
|
*/
|
|
3399
|
+
/** {en}
|
|
3400
|
+
* @brief Whether to enable autoplay for the player. If `muted` is set to `true`, the autoplay is muted.
|
|
3401
|
+
* @default { muted: true }
|
|
3402
|
+
* @type {{ muted: boolean } | boolean}
|
|
3403
|
+
*/
|
|
2306
3404
|
autoplay?: {
|
|
2307
3405
|
muted?: boolean;
|
|
2308
3406
|
} | boolean;
|
|
@@ -2310,6 +3408,10 @@ declare namespace strategy {
|
|
|
2310
3408
|
* @brief 为播放器设置默认音量,取值范围 [0,1]。
|
|
2311
3409
|
* @default 0.6
|
|
2312
3410
|
*/
|
|
3411
|
+
/** {en}
|
|
3412
|
+
* @brief The default volume for the player. Valid range: [0,1].
|
|
3413
|
+
* @default 0.6
|
|
3414
|
+
*/
|
|
2313
3415
|
volume?: number;
|
|
2314
3416
|
/** {zh}
|
|
2315
3417
|
* @brief 为播放器设置是否显示画中画功能按钮。
|
|
@@ -2317,22 +3419,42 @@ declare namespace strategy {
|
|
|
2317
3419
|
* - `false`:不显示。
|
|
2318
3420
|
* @default false
|
|
2319
3421
|
*/
|
|
3422
|
+
/** {en}
|
|
3423
|
+
* @brief Whether to display the Picture-in-Picture (PiP) button.
|
|
3424
|
+
* - `true`: Display;
|
|
3425
|
+
* - `false`: Do not display.
|
|
3426
|
+
* @default false
|
|
3427
|
+
*/
|
|
2320
3428
|
pip?: boolean;
|
|
2321
|
-
/**{zh}
|
|
3429
|
+
/** {zh}
|
|
2322
3430
|
* @brief 为播放器设置是否显示全屏功能按钮,并进行全屏功能设置。
|
|
2323
3431
|
* - `true`:显示;
|
|
2324
3432
|
* - `false`:不显示。
|
|
2325
3433
|
*/
|
|
3434
|
+
/** {en}
|
|
3435
|
+
* @brief Whether to display the full-screen button.
|
|
3436
|
+
* - `true`: Display;
|
|
3437
|
+
* - `false`: Do not display.
|
|
3438
|
+
* @default -
|
|
3439
|
+
*/
|
|
2326
3440
|
fullscreen?: boolean | Fullscreen;
|
|
2327
3441
|
/** {zh}
|
|
2328
3442
|
* @brief 为播放器设置报错信息,支持配置播放异常时,播放器显示的异常文案、图片,以及是否提供刷新按钮等。
|
|
2329
3443
|
* @default -
|
|
2330
3444
|
*/
|
|
3445
|
+
/** {en}
|
|
3446
|
+
* @brief The error message of the player. When a playback error occurs, you can configure the error message and image displayed and whether to display the refresh button.
|
|
3447
|
+
* @default -
|
|
3448
|
+
*/
|
|
2331
3449
|
error?: ErrorConfig;
|
|
2332
3450
|
/** {zh}
|
|
2333
3451
|
* @brief 为播放器设置清晰度的相关配置。
|
|
2334
3452
|
* @default -
|
|
2335
3453
|
*/
|
|
3454
|
+
/** {en}
|
|
3455
|
+
* @brief Resolution-related configurations.
|
|
3456
|
+
* @default -
|
|
3457
|
+
*/
|
|
2336
3458
|
definition?: DefinitionConfig;
|
|
2337
3459
|
/** {zh}
|
|
2338
3460
|
* @brief 为播放器设置是否显示控制栏。
|
|
@@ -2340,6 +3462,12 @@ declare namespace strategy {
|
|
|
2340
3462
|
* - `false`: 不显示
|
|
2341
3463
|
* @default true
|
|
2342
3464
|
*/
|
|
3465
|
+
/** {en}
|
|
3466
|
+
* @brief Whether to display the control bar for the player.
|
|
3467
|
+
* - `true`: Display;
|
|
3468
|
+
* - `false`: Do not display.
|
|
3469
|
+
* @default true
|
|
3470
|
+
*/
|
|
2343
3471
|
controls?: boolean | {
|
|
2344
3472
|
[propName: string]: any;
|
|
2345
3473
|
};
|
|
@@ -2347,23 +3475,39 @@ declare namespace strategy {
|
|
|
2347
3475
|
* @brief 为播放器设置**清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
2348
3476
|
* @default 'bottom'
|
|
2349
3477
|
*/
|
|
3478
|
+
/** {en}
|
|
3479
|
+
* @brief Select the panel style for resolution and line selection. This parameter takes effect on mobile devices only.
|
|
3480
|
+
* @default 'bottom'
|
|
3481
|
+
*/
|
|
2350
3482
|
listType?: ListType;
|
|
2351
3483
|
/** {zh}
|
|
2352
3484
|
* @brief 为播放器设置是否启用内联播放模式。playsinline 属性是 HTML5 视频标签的一个属性,用于指定视频是否应在页面文档内播放。
|
|
2353
3485
|
* - `true`:启用,表示视频将在页面文档内播放;
|
|
2354
|
-
* - `false
|
|
2355
|
-
*
|
|
3486
|
+
* - `false`:停用,默认浏览器播放行为。
|
|
2356
3487
|
* 该配置项只在移动端生效,当取值为 true 的时候,会在初始化 video 或 audio 对象的时候,将 playsinline、webkit-playsinline、x5-playsinline 三个属性设置为 true,请参考 [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) 了解内联模式相关知识。
|
|
2357
3488
|
* @listtip
|
|
2358
3489
|
* - iOS 10 及以上系统 Safari 浏览器支持配置内联播放模式;
|
|
2359
3490
|
* - iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
2360
3491
|
* @default true
|
|
2361
3492
|
*/
|
|
3493
|
+
/** {en}
|
|
3494
|
+
* @brief Whether to enable inline playback for the player. The `playsinline` property is a property of the `video` element in HTML5. It specifies whether the video should be played inline.
|
|
3495
|
+
* - `true`: Enable inline playback.
|
|
3496
|
+
* - `false`: Disable. The default browser playback behavior will be used.
|
|
3497
|
+
* This option only takes effect on mobile devices. When it is set to `true`, the `playsinline`, `webkit-playsinline`, and `x5-playsinline` properties are set to `true` when the video or audio objects are initialized. You can refer to [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) for more information about the inline playback.
|
|
3498
|
+
* @listtip
|
|
3499
|
+
* - Safari on iOS 10 and above supports inline playback.
|
|
3500
|
+
* - Safari on iOS versions lower than 10 does not support inline playback. The player will automatically enter fullscreen mode when playback begins.
|
|
3501
|
+
* @default true
|
|
3502
|
+
*/
|
|
2362
3503
|
playsinline?: boolean;
|
|
2363
3504
|
/** {zh}
|
|
2364
3505
|
* @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
|
|
2365
3506
|
* @default 无
|
|
2366
3507
|
*/
|
|
3508
|
+
/** {en}
|
|
3509
|
+
* @brief Additional properties for the `video` element that will be applied when the `videoElement` or `audioElement` objects are initialized. Refer to [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) for supported properties.
|
|
3510
|
+
*/
|
|
2367
3511
|
videoAttributes?: {
|
|
2368
3512
|
[propName: string]: any;
|
|
2369
3513
|
};
|
|
@@ -2377,13 +3521,29 @@ declare namespace strategy {
|
|
|
2377
3521
|
* - 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
2378
3522
|
* @default false
|
|
2379
3523
|
*/
|
|
3524
|
+
/** {en}
|
|
3525
|
+
* @brief Whether to enable responsive layout for the player. If responsive layout is enabled, the player size will be auto-adjusted according to the width of the screen to ensure a proper display on different screen sizes.
|
|
3526
|
+
* - `true`: Enable
|
|
3527
|
+
* - `false`: Disable
|
|
3528
|
+
* @listtip
|
|
3529
|
+
* When responsive layout is enabled:
|
|
3530
|
+
* If `width` and `height` are of type number, the player's aspect ratio will be determined based on their values.
|
|
3531
|
+
* If `width` and `height` are not of type number, the player uses a 16:9 aspect ratio.
|
|
3532
|
+
* @default false
|
|
3533
|
+
*/
|
|
2380
3534
|
fluid?: boolean;
|
|
2381
3535
|
/** {zh}
|
|
2382
3536
|
* @brief 为播放器设置尺寸适配方式,在视频资源初始化之后,根据获取到的 videoWidth 和 videoHeight 值对播放器容器宽高比例进行调整,可选项有:
|
|
2383
3537
|
* - `fixed`: 保持容器宽/高,不做适配;
|
|
2384
3538
|
* - `fixWidth`: 保持容器宽度,适配高度;
|
|
2385
3539
|
* - `fixHeight`: 保持容器高度,适配宽度。
|
|
2386
|
-
*
|
|
3540
|
+
* @default 'fixed'
|
|
3541
|
+
*/
|
|
3542
|
+
/** {en}
|
|
3543
|
+
* @brief The adaptation mode for the player size. After the video resource is initialized, the player container's aspect ratio is adjusted based on the obtained values of `videoWidth` and `videoHeight`. The available options include:
|
|
3544
|
+
* - `fixed`: Keep the container's width and height without adaptation;
|
|
3545
|
+
* - `fixWidth`: Keep the container's width and adjust the height;
|
|
3546
|
+
* - `fixHeight`: Keep the container's height and adjust the width.
|
|
2387
3547
|
* @default 'fixed'
|
|
2388
3548
|
*/
|
|
2389
3549
|
fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
|
|
@@ -2396,6 +3556,15 @@ declare namespace strategy {
|
|
|
2396
3556
|
* - `auto`: 使用浏览器默认的视频画面填充模式。
|
|
2397
3557
|
* @default 'auto'
|
|
2398
3558
|
*/
|
|
3559
|
+
/** {en}
|
|
3560
|
+
* @brief The fill mode of the video. The available options include:
|
|
3561
|
+
* - `fillwidth`: Fill the width of the container and crop the height if necessary.
|
|
3562
|
+
* - `fillHeight`: Fill the height of the container and crop the width if necessary.
|
|
3563
|
+
* - `fill`: Stretch the video to fill the container;
|
|
3564
|
+
* - `cover`: Fill the entire container while keeping the original aspect ratio;
|
|
3565
|
+
* - `auto`: Use the default fill mode of the browser.
|
|
3566
|
+
* @default 'auto'
|
|
3567
|
+
*/
|
|
2399
3568
|
videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
|
|
2400
3569
|
/** {zh}
|
|
2401
3570
|
* @brief 是否开启画面和控制栏分离模式。设置为开启时,控制栏将会常驻,与视频画面不重叠。
|
|
@@ -2403,11 +3572,20 @@ declare namespace strategy {
|
|
|
2403
3572
|
* - `false`:关闭
|
|
2404
3573
|
* @default false
|
|
2405
3574
|
*/
|
|
3575
|
+
/** {en}
|
|
3576
|
+
* @brief Whether to enable the separation of the video and the control bar. When enabled, the control bar will remain visible without overlapping the video content.
|
|
3577
|
+
* - `true`: Enable
|
|
3578
|
+
* - `false`: Disable
|
|
3579
|
+
* @default false
|
|
3580
|
+
*/
|
|
2406
3581
|
marginControls?: boolean;
|
|
2407
3582
|
/** {zh}
|
|
2408
3583
|
* @brief 启用微信同层播放。
|
|
2409
3584
|
* @default 无
|
|
2410
3585
|
*/
|
|
3586
|
+
/** {en}
|
|
3587
|
+
* @brief Enable playing the video on the same player as WeChat.
|
|
3588
|
+
*/
|
|
2411
3589
|
"x5-video-player-type"?: string;
|
|
2412
3590
|
/** {zh}
|
|
2413
3591
|
* @brief 是否启用微信全屏播放模式。
|
|
@@ -2415,6 +3593,11 @@ declare namespace strategy {
|
|
|
2415
3593
|
* - `false`:停用
|
|
2416
3594
|
* @default 无
|
|
2417
3595
|
*/
|
|
3596
|
+
/** {en}
|
|
3597
|
+
* @brief Whether to enable full-screen playback in WeChat.
|
|
3598
|
+
* - `true`: Enable
|
|
3599
|
+
* - `false`: Disable
|
|
3600
|
+
*/
|
|
2418
3601
|
"x5-video-player-fullscreen"?: boolean;
|
|
2419
3602
|
/** {zh}
|
|
2420
3603
|
* @brief 微信横竖屏控制,支持如下取值:
|
|
@@ -2423,25 +3606,45 @@ declare namespace strategy {
|
|
|
2423
3606
|
* - `landscape|portrait`:跟随手机自动旋转
|
|
2424
3607
|
* @default 无
|
|
2425
3608
|
*/
|
|
3609
|
+
/** {en}
|
|
3610
|
+
* @brief The orientation of the video when played on WeChat. The following values are supported:
|
|
3611
|
+
* - `landscape`: Horizontal screen;
|
|
3612
|
+
* - `portrait`: Vertical screen;
|
|
3613
|
+
* - `landscape | portrait`: Rotate with the mobile.
|
|
3614
|
+
*/
|
|
2426
3615
|
"x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
|
|
2427
3616
|
/** {zh}
|
|
2428
3617
|
* @brief 为播放器配置关键点样式。
|
|
2429
3618
|
* @default 无
|
|
2430
3619
|
* @hidden 直播目前没用到
|
|
2431
3620
|
*/
|
|
3621
|
+
/** {en}
|
|
3622
|
+
* @brief Configures the keypoint style for the player.
|
|
3623
|
+
* @hidden
|
|
3624
|
+
*/
|
|
2432
3625
|
commonStyle?: CommonStyle;
|
|
2433
3626
|
/** {zh}
|
|
2434
3627
|
* @brief 自定义插件列表。
|
|
2435
3628
|
* @default 无
|
|
2436
3629
|
*/
|
|
3630
|
+
/** {en}
|
|
3631
|
+
* @brief A list of custom plugins.
|
|
3632
|
+
*/
|
|
2437
3633
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2438
3634
|
plugins?: any[];
|
|
2439
3635
|
/** {zh}
|
|
2440
3636
|
* @hidden
|
|
2441
3637
|
*/
|
|
3638
|
+
/** {en}
|
|
3639
|
+
* @hidden
|
|
3640
|
+
*/
|
|
2442
3641
|
preparePlugins?: PreparePlugins;
|
|
2443
3642
|
}
|
|
2444
|
-
/**
|
|
3643
|
+
/** {zh}
|
|
3644
|
+
* @list option
|
|
3645
|
+
* @kind property
|
|
3646
|
+
*/
|
|
3647
|
+
/** {en}
|
|
2445
3648
|
* @list option
|
|
2446
3649
|
* @kind property
|
|
2447
3650
|
*/
|
|
@@ -2452,6 +3655,12 @@ declare namespace strategy {
|
|
|
2452
3655
|
* - `false`:不使用旋转横屏。
|
|
2453
3656
|
* @default false
|
|
2454
3657
|
*/
|
|
3658
|
+
/** {en}
|
|
3659
|
+
* @brief Whether to play the video in landscape mode when the video enters full-screen mode. This feature is usually used on mobile devices. Once enabled, when the video enters fullscreen mode, the player will be rotated from portrait mode by 90 degrees to landscape mode. This property has a higher priority over `useCssFullscreen`.
|
|
3660
|
+
* - `true`: Enable.
|
|
3661
|
+
* - `false`: Disable.
|
|
3662
|
+
* @default false
|
|
3663
|
+
*/
|
|
2455
3664
|
rotateFullscreen?: boolean;
|
|
2456
3665
|
/** {zh}
|
|
2457
3666
|
* @brief 是否使用页面全屏代替系统全屏功能。
|
|
@@ -2459,16 +3668,37 @@ declare namespace strategy {
|
|
|
2459
3668
|
* - `false`:系统全屏。
|
|
2460
3669
|
* @default false
|
|
2461
3670
|
*/
|
|
3671
|
+
/** {en}
|
|
3672
|
+
* @brief Whether to use full-window.
|
|
3673
|
+
* - `true`: Use full-window mode, in which the player covers the browser window.
|
|
3674
|
+
* - `false`: Use full-screen mode, in which the player covers the entire desktop.
|
|
3675
|
+
* @default false
|
|
3676
|
+
*/
|
|
2462
3677
|
useCssFullscreen?: boolean;
|
|
2463
|
-
/**{zh}
|
|
3678
|
+
/** {zh}
|
|
2464
3679
|
* 全屏的时候是否显示右上角返回按钮,通常在移动端开启。
|
|
2465
3680
|
* - `true`:显示;
|
|
2466
3681
|
* - `false`:不显示。
|
|
2467
3682
|
* @default false
|
|
2468
3683
|
*/
|
|
3684
|
+
/** {en}
|
|
3685
|
+
* Whether to display a return button at the top-right corner when the player is in full-screen mode. This feature is usually turned on on mobile devices.
|
|
3686
|
+
* `true`: Display;
|
|
3687
|
+
* `false`: Do not display.
|
|
3688
|
+
* @default false
|
|
3689
|
+
* @brief
|
|
3690
|
+
* Whether to display a return button at the top-right corner when the player is in full-screen mode. This feature is usually turned on on mobile devices.
|
|
3691
|
+
* - `true`: Display;
|
|
3692
|
+
* - `false`: Do not display.
|
|
3693
|
+
*/
|
|
2469
3694
|
needBackIcon?: boolean;
|
|
2470
3695
|
}
|
|
2471
|
-
/**
|
|
3696
|
+
/** {zh}
|
|
3697
|
+
* @list option
|
|
3698
|
+
* @kind property
|
|
3699
|
+
* @hidden
|
|
3700
|
+
*/
|
|
3701
|
+
/** {en}
|
|
2472
3702
|
* @list option
|
|
2473
3703
|
* @kind property
|
|
2474
3704
|
* @hidden
|
|
@@ -2478,21 +3708,34 @@ declare namespace strategy {
|
|
|
2478
3708
|
* @brief 进度条底色
|
|
2479
3709
|
* @default 无
|
|
2480
3710
|
*/
|
|
3711
|
+
/** {en}
|
|
3712
|
+
* @brief The background color of the progress bar.
|
|
3713
|
+
*/
|
|
2481
3714
|
progressColor?: string;
|
|
2482
3715
|
/** {zh}
|
|
2483
3716
|
* @brief 播放完成部分进度条底色
|
|
2484
3717
|
* @default 无
|
|
2485
3718
|
*/
|
|
3719
|
+
/** {en}
|
|
3720
|
+
* @brief The background color of the progress bar for the completed portion of video playback.
|
|
3721
|
+
*/
|
|
2486
3722
|
playedColor?: string;
|
|
2487
3723
|
/** {zh}
|
|
2488
3724
|
* @brief 缓存部分进度条底色
|
|
2489
3725
|
* @default 无
|
|
2490
3726
|
*/
|
|
3727
|
+
/** {en}
|
|
3728
|
+
* @brief
|
|
3729
|
+
* @brief The background color of the progress bar for the cached portion of video playback.
|
|
3730
|
+
*/
|
|
2491
3731
|
cachedColor?: string;
|
|
2492
3732
|
/** {zh}
|
|
2493
3733
|
* @brief 进度条滑块样式
|
|
2494
3734
|
* @default 无
|
|
2495
3735
|
*/
|
|
3736
|
+
/** {en}
|
|
3737
|
+
* @brief The style of the progress bar slider.
|
|
3738
|
+
*/
|
|
2496
3739
|
sliderBtnStyle?: {
|
|
2497
3740
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2498
3741
|
[propName: string]: any;
|
|
@@ -2501,6 +3744,9 @@ declare namespace strategy {
|
|
|
2501
3744
|
* @brief 音量颜色
|
|
2502
3745
|
* @default 无
|
|
2503
3746
|
*/
|
|
3747
|
+
/** {en}
|
|
3748
|
+
* @brief The color of the volume slider.
|
|
3749
|
+
*/
|
|
2504
3750
|
volumeColor?: string;
|
|
2505
3751
|
}
|
|
2506
3752
|
type PrepareResult = {
|
|
@@ -2509,48 +3755,80 @@ declare namespace strategy {
|
|
|
2509
3755
|
plugins?: any[];
|
|
2510
3756
|
};
|
|
2511
3757
|
type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
|
|
2512
|
-
/**
|
|
3758
|
+
/** {zh}
|
|
2513
3759
|
* @detail option
|
|
2514
3760
|
* @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
2515
3761
|
*/
|
|
3762
|
+
/** {en}
|
|
3763
|
+
* @detail option
|
|
3764
|
+
* @brief The actual codec of the video.
|
|
3765
|
+
*/
|
|
2516
3766
|
enum Codec {
|
|
2517
3767
|
/** {zh}
|
|
2518
3768
|
* @brief H.265 编码格式
|
|
2519
3769
|
*/
|
|
3770
|
+
/** {en}
|
|
3771
|
+
* @brief H.265.
|
|
3772
|
+
*/
|
|
2520
3773
|
H265 = "h265",
|
|
2521
3774
|
/** {zh}
|
|
2522
3775
|
* @brief H.264 编码格式
|
|
2523
3776
|
*/
|
|
3777
|
+
/** {en}
|
|
3778
|
+
* @brief H.264.
|
|
3779
|
+
*/
|
|
2524
3780
|
H264 = "h264"
|
|
2525
3781
|
}
|
|
2526
|
-
/**
|
|
3782
|
+
/** {zh}
|
|
2527
3783
|
* @detail option
|
|
2528
3784
|
* @brief 是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
2529
3785
|
*/
|
|
3786
|
+
/** {en}
|
|
3787
|
+
* @detail option
|
|
3788
|
+
* @brief Whether to use H.265 compatibility mode. In H.265 compatibility mode, the player will prioritize hardware decoding to decode H.265 video. If the device or browser does not support H.265 hardware decoding, it will automatically fall back to H.265 software decoding.
|
|
3789
|
+
*/
|
|
2530
3790
|
enum Degradation {
|
|
2531
3791
|
/** {zh}
|
|
2532
3792
|
* @brief 硬解不支持降级到软解
|
|
2533
3793
|
*/
|
|
3794
|
+
/** {en}
|
|
3795
|
+
* @brief The player does not support falling back to software decoding.
|
|
3796
|
+
*/
|
|
2534
3797
|
SoftFirst = "soft-first",
|
|
2535
3798
|
/** {zh}
|
|
2536
3799
|
* @brief 硬解不支持降级到h264
|
|
2537
3800
|
* @hidden
|
|
2538
3801
|
*/
|
|
3802
|
+
/** {en}
|
|
3803
|
+
* @brief The player does not support falling back to H.264.
|
|
3804
|
+
* @hidden
|
|
3805
|
+
*/
|
|
2539
3806
|
H264First = "h264-first"
|
|
2540
3807
|
}
|
|
2541
|
-
/**
|
|
3808
|
+
/** {zh}
|
|
2542
3809
|
* @detail option
|
|
2543
3810
|
* @brief 解码方式。
|
|
2544
3811
|
* @example
|
|
2545
3812
|
*/
|
|
3813
|
+
/** {en}
|
|
3814
|
+
* @detail option
|
|
3815
|
+
* @brief Decoding method.
|
|
3816
|
+
* @example
|
|
3817
|
+
*/
|
|
2546
3818
|
enum DecodeType {
|
|
2547
3819
|
/** {zh}
|
|
2548
3820
|
* @brief 软解
|
|
2549
3821
|
*/
|
|
3822
|
+
/** {en}
|
|
3823
|
+
* @brief Software decoding.
|
|
3824
|
+
*/
|
|
2550
3825
|
Software = "software",
|
|
2551
3826
|
/** {zh}
|
|
2552
3827
|
* @brief 硬解
|
|
2553
3828
|
*/
|
|
3829
|
+
/** {en}
|
|
3830
|
+
* @brief Hardware decoding.
|
|
3831
|
+
*/
|
|
2554
3832
|
Hardware = "hardware"
|
|
2555
3833
|
}
|
|
2556
3834
|
/// <reference types="./loader" />
|
|
@@ -2803,203 +4081,363 @@ declare namespace error {
|
|
|
2803
4081
|
normalize(text?: string | Record<Lang, string>): string;
|
|
2804
4082
|
getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
|
|
2805
4083
|
}
|
|
2806
|
-
/**
|
|
4084
|
+
/** {zh}
|
|
4085
|
+
* @detail error
|
|
4086
|
+
*/
|
|
4087
|
+
/** {en}
|
|
2807
4088
|
* @detail error
|
|
2808
4089
|
*/
|
|
2809
4090
|
enum Level {
|
|
2810
|
-
/**
|
|
4091
|
+
/** {zh}
|
|
2811
4092
|
* @brief 严重
|
|
2812
4093
|
*
|
|
2813
4094
|
*/
|
|
4095
|
+
/** {en}
|
|
4096
|
+
* @brief Fatal.
|
|
4097
|
+
*
|
|
4098
|
+
*/
|
|
2814
4099
|
Fatal = "Fatal",
|
|
2815
|
-
/**
|
|
4100
|
+
/** {zh}
|
|
2816
4101
|
* @brief 报错
|
|
2817
4102
|
*/
|
|
4103
|
+
/** {en}
|
|
4104
|
+
* @brief Error.
|
|
4105
|
+
*/
|
|
2818
4106
|
Error = "Error"
|
|
2819
4107
|
}
|
|
2820
4108
|
enum ErrorCode {
|
|
2821
|
-
/**
|
|
4109
|
+
/** {zh}
|
|
2822
4110
|
* @brief 视频解析错误
|
|
2823
4111
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2824
4112
|
*/
|
|
4113
|
+
/** {en}
|
|
4114
|
+
* @brief Video parsing error.
|
|
4115
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4116
|
+
*/
|
|
2825
4117
|
MANIFEST_HLS_ERROR = 1100,
|
|
2826
|
-
/**
|
|
4118
|
+
/** {zh}
|
|
2827
4119
|
* @brief 视频解析错误
|
|
2828
4120
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2829
4121
|
*/
|
|
4122
|
+
/** {en}
|
|
4123
|
+
* @brief Video parsing error.
|
|
4124
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4125
|
+
*/
|
|
2830
4126
|
MANIFEST_DASH_ERROR = 1200,
|
|
2831
|
-
/**
|
|
4127
|
+
/** {zh}
|
|
2832
4128
|
* @brief 网络错误
|
|
2833
4129
|
* @solution 请检查当前网络环境或播放地址是否合法。
|
|
2834
4130
|
*/
|
|
4131
|
+
/** {en}
|
|
4132
|
+
* @brief Network error.
|
|
4133
|
+
* @solution Please check the current network environment and ensure the pull stream address is valid.
|
|
4134
|
+
*/
|
|
2835
4135
|
NETWORK = 2100,
|
|
2836
|
-
/**
|
|
4136
|
+
/** {zh}
|
|
2837
4137
|
* @brief 网络请求超时
|
|
2838
4138
|
* @solution 请检查拉流地址是否合法。
|
|
2839
4139
|
*/
|
|
4140
|
+
/** {en}
|
|
4141
|
+
* @brief Network request timed out
|
|
4142
|
+
* @solution Please check whether the pull stream address is valid.
|
|
4143
|
+
*/
|
|
2840
4144
|
NETWORK_TIMEOUT = 2101,
|
|
2841
|
-
/**
|
|
4145
|
+
/** {zh}
|
|
2842
4146
|
* @brief 网络请求 403
|
|
2843
4147
|
* @solution 请检查拉流地址鉴权信息。
|
|
2844
4148
|
*/
|
|
4149
|
+
/** {en}
|
|
4150
|
+
* @brief The player received a 403 response code.
|
|
4151
|
+
* @solution Check the authentication information in the pull stream address.
|
|
4152
|
+
*/
|
|
2845
4153
|
NETWORK_FORBIDDEN = 2103,
|
|
2846
|
-
/**
|
|
4154
|
+
/** {zh}
|
|
2847
4155
|
* @brief 网络请求 404
|
|
2848
4156
|
* @solution 请检查拉流地址是否合法。
|
|
2849
4157
|
*/
|
|
4158
|
+
/** {en}
|
|
4159
|
+
* @brief The player received a 404 response code.
|
|
4160
|
+
* @solution Check whether the pull stream address is valid.
|
|
4161
|
+
*/
|
|
2850
4162
|
NETWORK_NOTFOUND = 2104,
|
|
2851
|
-
/**
|
|
4163
|
+
/** {zh}
|
|
2852
4164
|
* @brief 网络请求 206
|
|
2853
4165
|
* @solution 请检查拉流地址是否合法。
|
|
2854
4166
|
*/
|
|
4167
|
+
/** {en}
|
|
4168
|
+
* @brief The player received a 206 response code.
|
|
4169
|
+
* @solution Check whether the pull stream address is valid.
|
|
4170
|
+
*/
|
|
2855
4171
|
NETWORK_RANGE_NOT_SATISFIABLE = 2116,
|
|
2856
|
-
/**
|
|
4172
|
+
/** {zh}
|
|
2857
4173
|
* @brief 视频解析错误
|
|
2858
4174
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2859
4175
|
*/
|
|
4176
|
+
/** {en}
|
|
4177
|
+
* @brief Video parsing error.
|
|
4178
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4179
|
+
*/
|
|
2860
4180
|
DEMUX_FLV_ERROR = 3100,
|
|
2861
|
-
/**
|
|
4181
|
+
/** {zh}
|
|
2862
4182
|
* @brief 视频解析错误
|
|
2863
4183
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2864
4184
|
*/
|
|
4185
|
+
/** {en}
|
|
4186
|
+
* @brief Video parsing error.
|
|
4187
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4188
|
+
*/
|
|
2865
4189
|
DEMUX_HLS_ERROR = 3200,
|
|
2866
|
-
/**
|
|
4190
|
+
/** {zh}
|
|
2867
4191
|
* @brief 视频解析错误
|
|
2868
4192
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2869
4193
|
*
|
|
2870
4194
|
*/
|
|
4195
|
+
/** {en}
|
|
4196
|
+
* @brief Video parsing error.
|
|
4197
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4198
|
+
*
|
|
4199
|
+
*/
|
|
2871
4200
|
DEMUX_MP4_ERROR = 3300,
|
|
2872
|
-
/**
|
|
4201
|
+
/** {zh}
|
|
2873
4202
|
* @brief 视频解析错误
|
|
2874
4203
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2875
4204
|
*
|
|
2876
4205
|
*/
|
|
4206
|
+
/** {en}
|
|
4207
|
+
* @brief Video parsing error.
|
|
4208
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4209
|
+
*
|
|
4210
|
+
*/
|
|
2877
4211
|
DEMUX_FMP4_ERROR = 3400,
|
|
2878
|
-
/**
|
|
4212
|
+
/** {zh}
|
|
2879
4213
|
* @brief 视频解析错误
|
|
2880
4214
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2881
4215
|
*
|
|
2882
4216
|
*/
|
|
4217
|
+
/** {en}
|
|
4218
|
+
* @brief Video parsing error.
|
|
4219
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4220
|
+
*
|
|
4221
|
+
*/
|
|
2883
4222
|
DEMUX_SIDX_ERROR = 3410,
|
|
2884
|
-
/**
|
|
4223
|
+
/** {zh}
|
|
2885
4224
|
* @brief 视频解析错误
|
|
2886
4225
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2887
4226
|
*
|
|
2888
4227
|
*/
|
|
4228
|
+
/** {en}
|
|
4229
|
+
* @brief Video parsing error.
|
|
4230
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4231
|
+
*
|
|
4232
|
+
*/
|
|
2889
4233
|
REMUX_FMP4_ERROR = 4100,
|
|
2890
|
-
/**
|
|
4234
|
+
/** {zh}
|
|
2891
4235
|
* @brief 视频解析错误
|
|
2892
4236
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2893
4237
|
*
|
|
2894
4238
|
*/
|
|
4239
|
+
/** {en}
|
|
4240
|
+
* @brief Video parsing error.
|
|
4241
|
+
* @solution Check whether the pull stream address is valid, or contact [technical support](https://www.byteplus.com/en/support).
|
|
4242
|
+
*
|
|
4243
|
+
*/
|
|
2895
4244
|
REMUX_MP4_ERROR = 4200,
|
|
2896
|
-
/**
|
|
4245
|
+
/** {zh}
|
|
2897
4246
|
* @brief 获取数据过程被中止
|
|
2898
4247
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
2899
4248
|
*/
|
|
4249
|
+
/** {en}
|
|
4250
|
+
* @brief The process of obtaining data was aborted.
|
|
4251
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
4252
|
+
*/
|
|
2900
4253
|
MEDIA_ERR_ABORTED = 5101,
|
|
2901
|
-
/**
|
|
4254
|
+
/** {zh}
|
|
2902
4255
|
* @brief 网络发生错误,无法成功获取媒体文件
|
|
2903
4256
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
2904
4257
|
*/
|
|
4258
|
+
/** {en}
|
|
4259
|
+
* @brief A network error occurred and the media file could not be successfully obtained.
|
|
4260
|
+
* @solution Check whether the request is correct and then try to pull the stream again.
|
|
4261
|
+
*/
|
|
2905
4262
|
MEDIA_ERR_NETWORK = 5102,
|
|
2906
|
-
/**
|
|
4263
|
+
/** {zh}
|
|
2907
4264
|
* @brief 浏览器在解码媒体资源时发生错误
|
|
2908
4265
|
* @solution
|
|
2909
4266
|
* 1. 请检查原始视频是否正常;
|
|
2910
4267
|
* 2. 重新进行转码和播放;
|
|
2911
4268
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2912
4269
|
*/
|
|
4270
|
+
/** {en}
|
|
4271
|
+
* @brief An error occurred to the browser while decoding the media resources.
|
|
4272
|
+
* @solution
|
|
4273
|
+
* 1. Check whether there is any issue with the original video.
|
|
4274
|
+
* 2. Re-transcode the video and play it again.
|
|
4275
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4276
|
+
*/
|
|
2913
4277
|
MEDIA_ERR_DECODE = 5103,
|
|
2914
|
-
/**
|
|
4278
|
+
/** {zh}
|
|
2915
4279
|
* @brief 因视频格式不支持、服务器或网络的问题造成视频无法加载
|
|
2916
4280
|
* @solution
|
|
2917
4281
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
2918
4282
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
2919
4283
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2920
4284
|
*/
|
|
4285
|
+
/** {en}
|
|
4286
|
+
* @brief The video cannot be loaded due to unsupported video format or server or network issues.
|
|
4287
|
+
* @solution
|
|
4288
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
4289
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
4290
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4291
|
+
*/
|
|
2921
4292
|
MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
|
|
2922
|
-
/**
|
|
4293
|
+
/** {zh}
|
|
2923
4294
|
* @brief 当前浏览器不支持视频解码
|
|
2924
4295
|
* @solution
|
|
2925
4296
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
2926
4297
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
2927
4298
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2928
4299
|
*/
|
|
4300
|
+
/** {en}
|
|
4301
|
+
* @brief The current browser does not support video decoding.
|
|
4302
|
+
* @solution
|
|
4303
|
+
* 1. Check whether there is any issue with the browser's request.
|
|
4304
|
+
* 2. Check whether the browser and the current page support the video format.
|
|
4305
|
+
* 3. If the error persists, please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4306
|
+
*/
|
|
2929
4307
|
MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
|
|
2930
|
-
/**
|
|
4308
|
+
/** {zh}
|
|
2931
4309
|
* @brief 当前播放地址为空
|
|
2932
4310
|
* @solution 请检查必要参数 `url` 或 `playlist` 是否传入。
|
|
2933
4311
|
*/
|
|
4312
|
+
/** {en}
|
|
4313
|
+
* @brief The current pull stream address is empty.
|
|
4314
|
+
* @solution Check whether 'url' or 'playlist' is specified.
|
|
4315
|
+
*/
|
|
2934
4316
|
MEDIA_ERR_URL_EMPTY = 5106,
|
|
2935
|
-
/**
|
|
4317
|
+
/** {zh}
|
|
2936
4318
|
* @brief 播放异常
|
|
2937
4319
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2938
4320
|
*/
|
|
4321
|
+
/** {en}
|
|
4322
|
+
* @brief A playback issue occurred.
|
|
4323
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4324
|
+
*/
|
|
2939
4325
|
MEDIA_MSE_ADD_SB = 5200,
|
|
2940
|
-
/**
|
|
4326
|
+
/** {zh}
|
|
2941
4327
|
* @brief 播放异常
|
|
2942
4328
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2943
4329
|
*/
|
|
4330
|
+
/** {en}
|
|
4331
|
+
* @brief A playback issue occurred.
|
|
4332
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4333
|
+
*/
|
|
2944
4334
|
MEDIA_MSE_APPEND_BUFFER = 5201,
|
|
2945
|
-
/**
|
|
4335
|
+
/** {zh}
|
|
2946
4336
|
* @brief 播放异常
|
|
2947
4337
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2948
4338
|
*/
|
|
4339
|
+
/** {en}
|
|
4340
|
+
* @brief A playback issue occurred.
|
|
4341
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4342
|
+
*/
|
|
2949
4343
|
MEDIA_MSE_OTHER = 5202,
|
|
2950
|
-
/**
|
|
4344
|
+
/** {zh}
|
|
2951
4345
|
* @brief 播放异常
|
|
2952
4346
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2953
4347
|
*/
|
|
4348
|
+
/** {en}
|
|
4349
|
+
* @brief A playback issue occurred.
|
|
4350
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4351
|
+
*/
|
|
2954
4352
|
MEDIA_MSE_FULL = 5203,
|
|
2955
|
-
/**
|
|
4353
|
+
/** {zh}
|
|
2956
4354
|
* @brief 播放异常
|
|
2957
4355
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2958
4356
|
*/
|
|
4357
|
+
/** {en}
|
|
4358
|
+
* @brief A playback issue occurred.
|
|
4359
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4360
|
+
*/
|
|
2959
4361
|
MEDIA_MSE_HIJACK = 5204,
|
|
2960
|
-
/**
|
|
4362
|
+
/** {zh}
|
|
2961
4363
|
* @brief 播放异常
|
|
2962
4364
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2963
4365
|
*/
|
|
4366
|
+
/** {en}
|
|
4367
|
+
* @brief A playback issue occurred.
|
|
4368
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4369
|
+
*/
|
|
2964
4370
|
MEDIA_EME_HIJACK = 5301,
|
|
2965
|
-
/**
|
|
4371
|
+
/** {zh}
|
|
2966
4372
|
* @brief DRM 权限校验失败
|
|
2967
4373
|
* @hidden
|
|
2968
4374
|
*/
|
|
4375
|
+
/** {en}
|
|
4376
|
+
* @brief DRM authentication failed.
|
|
4377
|
+
* @hidden
|
|
4378
|
+
*/
|
|
2969
4379
|
DRM_LICENSE = 7100,
|
|
2970
|
-
/**
|
|
4380
|
+
/** {zh}
|
|
2971
4381
|
* @brief DRM 权限校验失败
|
|
2972
4382
|
* @hidden
|
|
2973
4383
|
*/
|
|
4384
|
+
/** {en}
|
|
4385
|
+
* @brief DRM authentication failed.
|
|
4386
|
+
* @hidden
|
|
4387
|
+
*/
|
|
2974
4388
|
DRM_CUSTOM_LICENSE = 7200,
|
|
2975
|
-
/**
|
|
4389
|
+
/** {zh}
|
|
2976
4390
|
* @brief 播放异常
|
|
2977
4391
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2978
4392
|
*/
|
|
4393
|
+
/** {en}
|
|
4394
|
+
* @brief A playback issue occurred.
|
|
4395
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4396
|
+
*/
|
|
2979
4397
|
OTHER = 8000,
|
|
2980
|
-
/**
|
|
4398
|
+
/** {zh}
|
|
2981
4399
|
* @brief 播放异常
|
|
2982
4400
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2983
4401
|
*/
|
|
4402
|
+
/** {en}
|
|
4403
|
+
* @brief A playback issue occurred.
|
|
4404
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4405
|
+
*/
|
|
2984
4406
|
RUNTIME_NO_CANPLAY_ERROR = 9001,
|
|
2985
|
-
/**
|
|
4407
|
+
/** {zh}
|
|
2986
4408
|
* @brief 播放异常
|
|
2987
4409
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2988
4410
|
*/
|
|
4411
|
+
/** {en}
|
|
4412
|
+
* @brief A playback issue occurred.
|
|
4413
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4414
|
+
*/
|
|
2989
4415
|
RUNTIME_BUFFERBREAK_ERROR = 9002,
|
|
2990
|
-
/**
|
|
4416
|
+
/** {zh}
|
|
2991
4417
|
* @brief 播放异常
|
|
2992
4418
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2993
4419
|
*/
|
|
4420
|
+
/** {en}
|
|
4421
|
+
* @brief A playback issue occurred.
|
|
4422
|
+
* @solution Check the live stream source or contact your [technical support](https://www.byteplus.com/en/support).
|
|
4423
|
+
*/
|
|
2994
4424
|
RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
|
|
2995
4425
|
// veplayer 报错
|
|
2996
|
-
/**
|
|
4426
|
+
/** {zh}
|
|
2997
4427
|
* @brief CDN 异步获取失败
|
|
2998
4428
|
* @solution 请刷新重试或者检查网络环境。
|
|
2999
4429
|
*
|
|
3000
4430
|
*/
|
|
4431
|
+
/** {en}
|
|
4432
|
+
* @brief CDN asynchronous fetch failed.
|
|
4433
|
+
* @solution Refresh the page or check the network environment.
|
|
4434
|
+
*
|
|
4435
|
+
*/
|
|
3001
4436
|
MODULE_LOAD_ERROR = 110,
|
|
3002
|
-
/**
|
|
4437
|
+
/** {zh}
|
|
4438
|
+
* @hidden
|
|
4439
|
+
*/
|
|
4440
|
+
/** {en}
|
|
3003
4441
|
* @hidden
|
|
3004
4442
|
*/
|
|
3005
4443
|
UNKNOWN = "UNKNOWN"
|
|
@@ -3025,31 +4463,55 @@ declare namespace error {
|
|
|
3025
4463
|
}
|
|
3026
4464
|
const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
|
|
3027
4465
|
const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
|
|
3028
|
-
/**
|
|
4466
|
+
/** {zh}
|
|
3029
4467
|
* @list error
|
|
3030
4468
|
* @detail error
|
|
3031
4469
|
* @brief 错误对象
|
|
3032
4470
|
* @name VeError
|
|
3033
4471
|
* @id VeError
|
|
3034
4472
|
*/
|
|
4473
|
+
/** {en}
|
|
4474
|
+
* @list error
|
|
4475
|
+
* @detail error
|
|
4476
|
+
* @brief The error object.
|
|
4477
|
+
* @name VeError
|
|
4478
|
+
* @id VeError
|
|
4479
|
+
*/
|
|
3035
4480
|
class VeError<T extends string = TextKey> extends Error {
|
|
3036
4481
|
/**
|
|
3037
|
-
* @brief
|
|
4482
|
+
* @brief 错误码。
|
|
4483
|
+
*/
|
|
4484
|
+
/** {en}
|
|
4485
|
+
* @brief The error code.
|
|
3038
4486
|
*/
|
|
3039
4487
|
readonly errorCode: ErrorCode;
|
|
3040
|
-
/**
|
|
4488
|
+
/** {zh}
|
|
3041
4489
|
* @brief 错误等级。
|
|
3042
4490
|
*/
|
|
4491
|
+
/** {en}
|
|
4492
|
+
* @brief The error level.
|
|
4493
|
+
*/
|
|
3043
4494
|
readonly level?: Level;
|
|
3044
|
-
/**
|
|
4495
|
+
/** {zh}
|
|
3045
4496
|
* @brief 错误信息。
|
|
3046
4497
|
*/
|
|
4498
|
+
/** {en}
|
|
4499
|
+
* @brief The error message.
|
|
4500
|
+
*/
|
|
3047
4501
|
message: string;
|
|
3048
|
-
/**
|
|
4502
|
+
/** {zh}
|
|
3049
4503
|
* @brief 其他错误信息。
|
|
3050
4504
|
*/
|
|
4505
|
+
/** {en}
|
|
4506
|
+
* @brief Other error messages.
|
|
4507
|
+
*/
|
|
3051
4508
|
readonly ext?: any;
|
|
3052
|
-
/**
|
|
4509
|
+
/** {zh}
|
|
4510
|
+
* @hidden
|
|
4511
|
+
* @param error
|
|
4512
|
+
* @param i18n
|
|
4513
|
+
*/
|
|
4514
|
+
/** {en}
|
|
3053
4515
|
* @hidden
|
|
3054
4516
|
* @param error
|
|
3055
4517
|
* @param i18n
|