@volcengine/veplayer 2.2.1-rc.0 → 2.3.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/esm/index.d.ts +1752 -294
- package/esm/veplayer.biz.live.development.js +122 -28
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +3888 -648
- package/esm/veplayer.development.css +1 -1
- package/esm/veplayer.development.js +729 -194
- package/esm/veplayer.live.d.ts +3888 -648
- package/esm/veplayer.live.development.css +1 -1
- package/esm/veplayer.live.development.js +729 -194
- package/esm/veplayer.live.production.css +1 -1
- package/esm/veplayer.live.production.js +3 -3
- package/esm/veplayer.production.css +1 -1
- package/esm/veplayer.production.js +3 -3
- package/esm/veplayer.vod.d.ts +1752 -294
- package/esm/veplayer.vod.development.css +1 -1
- package/esm/veplayer.vod.development.js +620 -176
- package/esm/veplayer.vod.production.css +1 -1
- package/esm/veplayer.vod.production.js +2 -2
- package/package.json +1 -1
- package/umd/index.d.ts +1752 -294
- package/umd/veplayer.biz.live.development.js +125 -31
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.biz.vod.development.js +3 -2
- package/umd/veplayer.biz.vod.production.js +1 -1
- package/umd/veplayer.d.ts +3888 -648
- package/umd/veplayer.development.css +1 -1
- package/umd/veplayer.development.js +728 -193
- package/umd/veplayer.live.d.ts +3888 -648
- package/umd/veplayer.live.development.css +1 -1
- package/umd/veplayer.live.development.js +731 -196
- package/umd/veplayer.live.production.css +1 -1
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.css +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +1752 -294
- package/umd/veplayer.vod.development.css +1 -1
- package/umd/veplayer.vod.development.js +625 -181
- package/umd/veplayer.vod.production.css +1 -1
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +3888 -648
- package/veplayer.live.d.ts +3888 -648
- package/veplayer.vod.d.ts +1752 -294
package/veplayer.vod.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ declare const EN: {
|
|
|
26
26
|
MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
|
|
27
27
|
MEDIA_ERR_URL_EMPTY: string;
|
|
28
28
|
DRM: string;
|
|
29
|
+
DRM_LICENSE: string;
|
|
29
30
|
OTHER: string;
|
|
30
31
|
RUNTIME: string;
|
|
31
32
|
MODULE_LOAD_ERROR: string;
|
|
@@ -109,61 +110,98 @@ declare class Definition implements XGDefinition {
|
|
|
109
110
|
set url(url: string);
|
|
110
111
|
next(): DefinitionUrl;
|
|
111
112
|
}
|
|
112
|
-
/**
|
|
113
|
+
/** {zh}
|
|
113
114
|
* @list option
|
|
114
115
|
* @kind property
|
|
115
116
|
* @id Definition
|
|
116
117
|
* @name Definition
|
|
117
118
|
*
|
|
118
119
|
*/
|
|
120
|
+
/** {en}
|
|
121
|
+
* @list option
|
|
122
|
+
* @kind property
|
|
123
|
+
* @id Definition
|
|
124
|
+
* @alias Definition
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
119
127
|
interface ExposedDefinition {
|
|
120
128
|
/** {zh}
|
|
121
129
|
* @brief 播放地址。
|
|
122
130
|
* @default 无
|
|
123
131
|
*/
|
|
132
|
+
/** {en}
|
|
133
|
+
* @brief The playback address.
|
|
134
|
+
*/
|
|
124
135
|
url: string;
|
|
125
136
|
/** {zh}
|
|
126
|
-
* @brief
|
|
137
|
+
* @brief 清晰度标识(唯一值)。
|
|
127
138
|
* @default 无
|
|
128
139
|
*
|
|
129
140
|
*/
|
|
141
|
+
/** {en}
|
|
142
|
+
* @brief The resolution ID. This value must be unique.
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
130
145
|
definition: string;
|
|
131
146
|
/** {zh}
|
|
132
147
|
* @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
|
|
133
148
|
* @default 无
|
|
134
149
|
*/
|
|
150
|
+
/** {en}
|
|
151
|
+
* @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
|
|
152
|
+
*/
|
|
135
153
|
text?: Record<Lang, string> | string;
|
|
136
154
|
/** {zh}
|
|
137
155
|
* @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
138
156
|
* @default 无
|
|
139
157
|
*
|
|
140
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
|
+
*/
|
|
141
163
|
fallbackUrls?: string[];
|
|
142
164
|
}
|
|
143
|
-
/**
|
|
165
|
+
/** {zh}
|
|
166
|
+
* @list option
|
|
167
|
+
* @kind property
|
|
168
|
+
* @id Source
|
|
169
|
+
* @alias Source
|
|
170
|
+
*/
|
|
171
|
+
/** {en}
|
|
144
172
|
* @list option
|
|
145
|
-
* @brief 线路数据配置。一个线路包含当前线路的 name ,展示名称,及线路下的清晰度列表。
|
|
146
173
|
* @kind property
|
|
147
174
|
* @id Source
|
|
148
|
-
* @
|
|
175
|
+
* @alias Source
|
|
149
176
|
*/
|
|
150
177
|
interface ExposedSource {
|
|
151
178
|
/** {zh}
|
|
152
|
-
* @brief
|
|
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,36 +776,66 @@ interface ErrorInfo<T = TextKey> {
|
|
|
561
776
|
ext?: any;
|
|
562
777
|
error?: Error;
|
|
563
778
|
}
|
|
564
|
-
/**
|
|
779
|
+
/** {zh}
|
|
780
|
+
* @list error
|
|
565
781
|
* @detail error
|
|
566
|
-
* @
|
|
567
|
-
* @
|
|
782
|
+
* @brief 错误对象
|
|
783
|
+
* @name VeError
|
|
784
|
+
* @id VeError
|
|
785
|
+
*/
|
|
786
|
+
/** {en}
|
|
787
|
+
* @list error
|
|
788
|
+
* @detail error
|
|
789
|
+
* @brief The error object.
|
|
790
|
+
* @name VeError
|
|
791
|
+
* @id VeError
|
|
568
792
|
*/
|
|
569
793
|
declare class VeError<T extends string = TextKey> extends Error {
|
|
570
794
|
/**
|
|
571
|
-
* @brief
|
|
795
|
+
* @brief 错误码。
|
|
796
|
+
*/
|
|
797
|
+
/** {en}
|
|
798
|
+
* @brief The error code.
|
|
572
799
|
*/
|
|
573
800
|
readonly errorCode: ErrorCode;
|
|
574
|
-
/**
|
|
801
|
+
/** {zh}
|
|
575
802
|
* @brief 错误等级。
|
|
576
803
|
*/
|
|
804
|
+
/** {en}
|
|
805
|
+
* @brief The error level.
|
|
806
|
+
*/
|
|
577
807
|
readonly level?: Level;
|
|
578
|
-
/**
|
|
808
|
+
/** {zh}
|
|
579
809
|
* @brief 错误信息。
|
|
580
810
|
*/
|
|
811
|
+
/** {en}
|
|
812
|
+
* @brief The error message.
|
|
813
|
+
*/
|
|
581
814
|
message: string;
|
|
582
|
-
/**
|
|
815
|
+
/** {zh}
|
|
583
816
|
* @brief 其他错误信息。
|
|
584
817
|
*/
|
|
818
|
+
/** {en}
|
|
819
|
+
* @brief Other error messages.
|
|
820
|
+
*/
|
|
585
821
|
readonly ext?: any;
|
|
586
|
-
/**
|
|
822
|
+
/** {zh}
|
|
823
|
+
* @hidden
|
|
824
|
+
* @param error
|
|
825
|
+
* @param i18n
|
|
826
|
+
*/
|
|
827
|
+
/** {en}
|
|
587
828
|
* @hidden
|
|
588
829
|
* @param error
|
|
589
830
|
* @param i18n
|
|
590
831
|
*/
|
|
591
832
|
constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
|
|
592
833
|
}
|
|
593
|
-
/**
|
|
834
|
+
/** {zh}
|
|
835
|
+
* @list option
|
|
836
|
+
* @kind property
|
|
837
|
+
*/
|
|
838
|
+
/** {en}
|
|
594
839
|
* @list option
|
|
595
840
|
* @kind property
|
|
596
841
|
*/
|
|
@@ -599,26 +844,46 @@ type ErrorConfig = {
|
|
|
599
844
|
* @brief 是否展示报错图片。
|
|
600
845
|
* @default true
|
|
601
846
|
*/
|
|
847
|
+
/** {en}
|
|
848
|
+
* @brief Whether to display the error image.
|
|
849
|
+
* @default true
|
|
850
|
+
*/
|
|
602
851
|
showErrorImg?: boolean;
|
|
603
852
|
/** {zh}
|
|
604
853
|
* @brief 是否展示报错提示。
|
|
605
854
|
* @default true
|
|
606
855
|
*/
|
|
856
|
+
/** {en}
|
|
857
|
+
* @brief Whether to display the error message.
|
|
858
|
+
* @default true
|
|
859
|
+
*/
|
|
607
860
|
showErrorTip?: boolean;
|
|
608
861
|
/** {zh}
|
|
609
862
|
* @brief 是否展示刷新按钮。
|
|
610
863
|
* @default true
|
|
611
864
|
*/
|
|
865
|
+
/** {en}
|
|
866
|
+
* @brief Whether to display the refresh button.
|
|
867
|
+
* @default true
|
|
868
|
+
*/
|
|
612
869
|
showRefresh?: boolean;
|
|
613
870
|
/** {zh}
|
|
614
871
|
* @brief 自定义报错显示。
|
|
615
872
|
* @default 无
|
|
616
873
|
*/
|
|
874
|
+
/** {en}
|
|
875
|
+
* @brief Custom error message.
|
|
876
|
+
* @default None
|
|
877
|
+
*/
|
|
617
878
|
errorTipsText?: string | Record<Lang, string>;
|
|
618
879
|
/** {zh}
|
|
619
880
|
* @brief 更多提示信息。
|
|
620
881
|
* @default 无
|
|
621
882
|
*/
|
|
883
|
+
/** {en}
|
|
884
|
+
* @brief More tips.
|
|
885
|
+
* @default None
|
|
886
|
+
*/
|
|
622
887
|
extraTips?: {
|
|
623
888
|
label: string | Record<Lang, string>;
|
|
624
889
|
value: string | Record<Lang, string>;
|
|
@@ -665,7 +930,11 @@ declare class Error extends Plugin {
|
|
|
665
930
|
private _handleRefresh;
|
|
666
931
|
private _renderRefresh;
|
|
667
932
|
}
|
|
668
|
-
/**
|
|
933
|
+
/** {zh}
|
|
934
|
+
* @list option
|
|
935
|
+
* @kind property
|
|
936
|
+
*/
|
|
937
|
+
/** {en}
|
|
669
938
|
* @list option
|
|
670
939
|
* @kind property
|
|
671
940
|
*/
|
|
@@ -674,15 +943,27 @@ interface DefinitionConfig {
|
|
|
674
943
|
* @brief 等待超时的时间阈值,单位为 ms。等待超过该值,会抛出 `DEFINITION_FALLBACK` 事件,如果 `needFallback` 为 `true` 则会提示清晰度降级。
|
|
675
944
|
* @default 5000
|
|
676
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
|
+
*/
|
|
677
950
|
longWaitingTime?: number;
|
|
678
951
|
/** {zh}
|
|
679
952
|
* @brief 是否开启清晰度降级。
|
|
680
953
|
* @default false
|
|
681
954
|
*/
|
|
955
|
+
/** {en}
|
|
956
|
+
* @brief Whether to enable resolution fallback.
|
|
957
|
+
* @default false
|
|
958
|
+
*/
|
|
682
959
|
needFallback?: boolean;
|
|
683
960
|
/** {zh}
|
|
684
961
|
* @brief 降级顺序,按照数组顺序依次降级,数组中的元素与 playlist 中的 definition 相对应。
|
|
685
|
-
* @default
|
|
962
|
+
* @default ['uhd', 'hd', 'sd', 'ld', 'ao']
|
|
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 ']"
|
|
686
967
|
*/
|
|
687
968
|
demotePriority?: string[];
|
|
688
969
|
}
|
|
@@ -691,51 +972,85 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
691
972
|
* @brief 指定播放器容器 ID,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
692
973
|
* @default 'veplayer'
|
|
693
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
|
+
*/
|
|
694
979
|
id?: string;
|
|
695
980
|
/** {zh}
|
|
696
981
|
* @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
697
982
|
* @default 无
|
|
698
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
|
+
*/
|
|
699
987
|
el?: HTMLElement;
|
|
700
988
|
/** {zh}
|
|
701
989
|
* @brief 设置播放器宽度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 width 样式属性。
|
|
702
990
|
* @default '100%'
|
|
703
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
|
+
*/
|
|
704
996
|
width?: number | string;
|
|
705
997
|
/** {zh}
|
|
706
998
|
* @brief 设置播放器高度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 height 样式属性。
|
|
707
999
|
* @default '100%'
|
|
708
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
|
+
*/
|
|
709
1005
|
height?: number | string;
|
|
710
1006
|
/** {zh}
|
|
711
1007
|
* @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
|
|
712
1008
|
* @default 无
|
|
713
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
|
+
*/
|
|
714
1013
|
url?: string;
|
|
715
1014
|
/** {zh}
|
|
716
1015
|
* @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
|
|
717
1016
|
* @default 无
|
|
718
1017
|
*/
|
|
1018
|
+
/** {en}
|
|
1019
|
+
* @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
|
|
1020
|
+
*/
|
|
719
1021
|
playlist?: ExposedSource[];
|
|
720
1022
|
/** {zh}
|
|
721
1023
|
* @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
|
|
722
1024
|
* @default 无
|
|
723
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
|
+
*/
|
|
724
1029
|
defaultSource?: string;
|
|
725
1030
|
/** {zh}
|
|
726
1031
|
* @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
|
|
727
1032
|
* @default 无
|
|
728
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
|
+
*/
|
|
729
1037
|
defaultDefinition?: string;
|
|
730
1038
|
/** {zh}
|
|
731
1039
|
* @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
732
1040
|
* @default 无
|
|
733
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
|
+
*/
|
|
734
1045
|
fallbackUrls?: string[];
|
|
735
1046
|
/** {zh}
|
|
736
1047
|
* @brief 为播放器设置拉流失败时循环拉流的最大次数。
|
|
737
1048
|
* @default 0
|
|
738
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
|
+
*/
|
|
739
1054
|
maxFallbackRound?: number;
|
|
740
1055
|
/** {zh}
|
|
741
1056
|
* @brief 为播放器设置解码方式。
|
|
@@ -746,32 +1061,60 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
746
1061
|
* 3. 部分浏览器不支持 H.265 编码格式,如果需要播放该编码格式的视频,请开启软解。
|
|
747
1062
|
* @default 'hardware'
|
|
748
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
|
+
*/
|
|
749
1073
|
decodeType?: DecodeType;
|
|
750
1074
|
/** {zh}
|
|
751
1075
|
* @brief 为播放器设置视频的实际编码格式。如果您在degradation 设置了 `soft-first` 属性(即硬解不支持时降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
752
1076
|
* @default 'h264'
|
|
753
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
|
+
*/
|
|
754
1082
|
codec?: Codec;
|
|
755
1083
|
/** {zh}
|
|
756
1084
|
* @brief 为播放器设置是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
757
1085
|
* @default 'soft-first'
|
|
758
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
|
+
*/
|
|
759
1091
|
degradation?: Degradation | boolean;
|
|
760
1092
|
/** {zh}
|
|
761
1093
|
* @brief 为播放器设置封面图 URL。
|
|
762
1094
|
* @default 无
|
|
763
1095
|
*/
|
|
1096
|
+
/** {en}
|
|
1097
|
+
* @brief The URL of the player's cover image.
|
|
1098
|
+
*/
|
|
764
1099
|
poster?: string;
|
|
765
1100
|
/** {zh}
|
|
766
1101
|
* @brief 为播放器设置初始显示语言,语言包不存在的情况下默认显示 'en' 语言包 。默认值为 `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`
|
|
767
1102
|
* @default -
|
|
768
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
|
+
*/
|
|
769
1108
|
lang?: Lang;
|
|
770
1109
|
/** {zh}
|
|
771
|
-
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }
|
|
1110
|
+
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
|
|
772
1111
|
* 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
|
|
773
1112
|
* @default 无
|
|
774
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
|
+
*/
|
|
775
1118
|
i18n?: {
|
|
776
1119
|
texts: Record<Lang, Record<string, string>>;
|
|
777
1120
|
};
|
|
@@ -780,6 +1123,11 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
780
1123
|
* @default { muted: true }
|
|
781
1124
|
* @type {{ muted: boolean } | boolean}
|
|
782
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
|
+
*/
|
|
783
1131
|
autoplay?: {
|
|
784
1132
|
muted?: boolean;
|
|
785
1133
|
} | boolean;
|
|
@@ -787,6 +1135,10 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
787
1135
|
* @brief 为播放器设置默认音量,取值范围 [0,1]。
|
|
788
1136
|
* @default 0.6
|
|
789
1137
|
*/
|
|
1138
|
+
/** {en}
|
|
1139
|
+
* @brief The default volume for the player. Valid range: [0,1].
|
|
1140
|
+
* @default 0.6
|
|
1141
|
+
*/
|
|
790
1142
|
volume?: number;
|
|
791
1143
|
/** {zh}
|
|
792
1144
|
* @brief 为播放器设置是否显示画中画功能按钮。
|
|
@@ -794,11 +1146,22 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
794
1146
|
* - `false`:不显示。
|
|
795
1147
|
* @default false
|
|
796
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
|
+
*/
|
|
797
1155
|
pip?: boolean;
|
|
798
|
-
/**{zh}
|
|
1156
|
+
/** {zh}
|
|
799
1157
|
* @brief 为播放器设置是否显示全屏功能按钮,并进行全屏功能设置。
|
|
800
1158
|
* - `true`:显示;
|
|
801
1159
|
* - `false`:不显示。
|
|
1160
|
+
*/
|
|
1161
|
+
/** {en}
|
|
1162
|
+
* @brief Whether to display the full-screen button.
|
|
1163
|
+
* - `true`: Display;
|
|
1164
|
+
* - `false`: Do not display.
|
|
802
1165
|
* @default -
|
|
803
1166
|
*/
|
|
804
1167
|
fullscreen?: boolean | Fullscreen;
|
|
@@ -806,11 +1169,19 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
806
1169
|
* @brief 为播放器设置报错信息,支持配置播放异常时,播放器显示的异常文案、图片,以及是否提供刷新按钮等。
|
|
807
1170
|
* @default -
|
|
808
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
|
+
*/
|
|
809
1176
|
error?: ErrorConfig;
|
|
810
1177
|
/** {zh}
|
|
811
1178
|
* @brief 为播放器设置清晰度的相关配置。
|
|
812
1179
|
* @default -
|
|
813
1180
|
*/
|
|
1181
|
+
/** {en}
|
|
1182
|
+
* @brief Resolution-related configurations.
|
|
1183
|
+
* @default -
|
|
1184
|
+
*/
|
|
814
1185
|
definition?: DefinitionConfig;
|
|
815
1186
|
/** {zh}
|
|
816
1187
|
* @brief 为播放器设置是否显示控制栏。
|
|
@@ -818,6 +1189,12 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
818
1189
|
* - `false`: 不显示
|
|
819
1190
|
* @default true
|
|
820
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
|
+
*/
|
|
821
1198
|
controls?: boolean | {
|
|
822
1199
|
[propName: string]: any;
|
|
823
1200
|
};
|
|
@@ -825,6 +1202,10 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
825
1202
|
* @brief 为播放器设置**清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
826
1203
|
* @default 'bottom'
|
|
827
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
|
+
*/
|
|
828
1209
|
listType?: ListType;
|
|
829
1210
|
/** {zh}
|
|
830
1211
|
* @brief 为播放器设置是否启用内联播放模式。playsinline 属性是 HTML5 视频标签的一个属性,用于指定视频是否应在页面文档内播放。
|
|
@@ -832,8 +1213,18 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
832
1213
|
* - `false`:停用,默认浏览器播放行为。
|
|
833
1214
|
* 该配置项只在移动端生效,当取值为 true 的时候,会在初始化 video 或 audio 对象的时候,将 playsinline、webkit-playsinline、x5-playsinline 三个属性设置为 true,请参考 [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) 了解内联模式相关知识。
|
|
834
1215
|
* @listtip
|
|
835
|
-
* iOS 10 及以上系统 Safari
|
|
836
|
-
* iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
1216
|
+
* - iOS 10 及以上系统 Safari 浏览器支持配置内联播放模式;
|
|
1217
|
+
* - iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
1218
|
+
* @default true
|
|
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.
|
|
837
1228
|
* @default true
|
|
838
1229
|
*/
|
|
839
1230
|
playsinline?: boolean;
|
|
@@ -841,6 +1232,9 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
841
1232
|
* @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
|
|
842
1233
|
* @default 无
|
|
843
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
|
+
*/
|
|
844
1238
|
videoAttributes?: {
|
|
845
1239
|
[propName: string]: any;
|
|
846
1240
|
};
|
|
@@ -850,8 +1244,18 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
850
1244
|
* - `false`:停用
|
|
851
1245
|
* @listtip
|
|
852
1246
|
* 启用流式布局时:
|
|
853
|
-
* 如果 `width` 和 `height` 是 `Number` 类型,则按照其数值计算播放器宽高比;
|
|
854
|
-
* 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
1247
|
+
* - 如果 `width` 和 `height` 是 `Number` 类型,则按照其数值计算播放器宽高比;
|
|
1248
|
+
* - 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
1249
|
+
* @default false
|
|
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.
|
|
855
1259
|
* @default false
|
|
856
1260
|
*/
|
|
857
1261
|
fluid?: boolean;
|
|
@@ -860,7 +1264,13 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
860
1264
|
* - `fixed`: 保持容器宽/高,不做适配;
|
|
861
1265
|
* - `fixWidth`: 保持容器宽度,适配高度;
|
|
862
1266
|
* - `fixHeight`: 保持容器高度,适配宽度。
|
|
863
|
-
*
|
|
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.
|
|
864
1274
|
* @default 'fixed'
|
|
865
1275
|
*/
|
|
866
1276
|
fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
|
|
@@ -873,6 +1283,15 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
873
1283
|
* - `auto`: 使用浏览器默认的视频画面填充模式。
|
|
874
1284
|
* @default 'auto'
|
|
875
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
|
+
*/
|
|
876
1295
|
videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
|
|
877
1296
|
/** {zh}
|
|
878
1297
|
* @brief 是否开启画面和控制栏分离模式。设置为开启时,控制栏将会常驻,与视频画面不重叠。
|
|
@@ -880,11 +1299,20 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
880
1299
|
* - `false`:关闭
|
|
881
1300
|
* @default false
|
|
882
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
|
+
*/
|
|
883
1308
|
marginControls?: boolean;
|
|
884
1309
|
/** {zh}
|
|
885
1310
|
* @brief 启用微信同层播放。
|
|
886
1311
|
* @default 无
|
|
887
1312
|
*/
|
|
1313
|
+
/** {en}
|
|
1314
|
+
* @brief Enable playing the video on the same player as WeChat.
|
|
1315
|
+
*/
|
|
888
1316
|
"x5-video-player-type"?: string;
|
|
889
1317
|
/** {zh}
|
|
890
1318
|
* @brief 是否启用微信全屏播放模式。
|
|
@@ -892,6 +1320,11 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
892
1320
|
* - `false`:停用
|
|
893
1321
|
* @default 无
|
|
894
1322
|
*/
|
|
1323
|
+
/** {en}
|
|
1324
|
+
* @brief Whether to enable full-screen playback in WeChat.
|
|
1325
|
+
* - `true`: Enable
|
|
1326
|
+
* - `false`: Disable
|
|
1327
|
+
*/
|
|
895
1328
|
"x5-video-player-fullscreen"?: boolean;
|
|
896
1329
|
/** {zh}
|
|
897
1330
|
* @brief 微信横竖屏控制,支持如下取值:
|
|
@@ -900,52 +1333,99 @@ interface VePlayerBaseOptions extends Omit<PlayerOptions, "autoplay" | "i18n"> {
|
|
|
900
1333
|
* - `landscape|portrait`:跟随手机自动旋转
|
|
901
1334
|
* @default 无
|
|
902
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
|
+
*/
|
|
903
1342
|
"x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
|
|
904
1343
|
/** {zh}
|
|
905
1344
|
* @brief 为播放器配置关键点样式。
|
|
906
1345
|
* @default 无
|
|
907
1346
|
* @hidden 直播目前没用到
|
|
908
1347
|
*/
|
|
1348
|
+
/** {en}
|
|
1349
|
+
* @brief Configures the keypoint style for the player.
|
|
1350
|
+
* @hidden
|
|
1351
|
+
*/
|
|
909
1352
|
commonStyle?: CommonStyle;
|
|
910
1353
|
/** {zh}
|
|
911
1354
|
* @brief 自定义插件列表。
|
|
912
1355
|
* @default 无
|
|
913
1356
|
*/
|
|
1357
|
+
/** {en}
|
|
1358
|
+
* @brief A list of custom plugins.
|
|
1359
|
+
*/
|
|
914
1360
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
915
1361
|
plugins?: any[];
|
|
916
1362
|
/** {zh}
|
|
917
1363
|
* @hidden
|
|
918
1364
|
*/
|
|
1365
|
+
/** {en}
|
|
1366
|
+
* @hidden
|
|
1367
|
+
*/
|
|
919
1368
|
preparePlugins?: PreparePlugins;
|
|
920
1369
|
}
|
|
921
|
-
/**
|
|
1370
|
+
/** {zh}
|
|
1371
|
+
* @list option
|
|
1372
|
+
* @kind property
|
|
1373
|
+
*/
|
|
1374
|
+
/** {en}
|
|
922
1375
|
* @list option
|
|
923
1376
|
* @kind property
|
|
924
1377
|
*/
|
|
925
1378
|
interface Fullscreen {
|
|
926
1379
|
/** {zh}
|
|
927
1380
|
* @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级高于 useCssFullscreen。
|
|
928
|
-
* `true`:使用旋转横屏;
|
|
929
|
-
* `false`:不使用旋转横屏。
|
|
1381
|
+
* - `true`:使用旋转横屏;
|
|
1382
|
+
* - `false`:不使用旋转横屏。
|
|
1383
|
+
* @default false
|
|
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.
|
|
930
1389
|
* @default false
|
|
931
1390
|
*/
|
|
932
1391
|
rotateFullscreen?: boolean;
|
|
933
1392
|
/** {zh}
|
|
934
1393
|
* @brief 是否使用页面全屏代替系统全屏功能。
|
|
935
|
-
* `true`:页面全屏;
|
|
936
|
-
* `false`:系统全屏。
|
|
1394
|
+
* - `true`:页面全屏;
|
|
1395
|
+
* - `false`:系统全屏。
|
|
1396
|
+
* @default false
|
|
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.
|
|
937
1402
|
* @default false
|
|
938
1403
|
*/
|
|
939
1404
|
useCssFullscreen?: boolean;
|
|
940
|
-
/**{zh}
|
|
1405
|
+
/** {zh}
|
|
941
1406
|
* 全屏的时候是否显示右上角返回按钮,通常在移动端开启。
|
|
942
|
-
* `true`:显示;
|
|
943
|
-
* `false`:不显示。
|
|
1407
|
+
* - `true`:显示;
|
|
1408
|
+
* - `false`:不显示。
|
|
1409
|
+
* @default false
|
|
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.
|
|
944
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.
|
|
945
1420
|
*/
|
|
946
1421
|
needBackIcon?: boolean;
|
|
947
1422
|
}
|
|
948
|
-
/**
|
|
1423
|
+
/** {zh}
|
|
1424
|
+
* @list option
|
|
1425
|
+
* @kind property
|
|
1426
|
+
* @hidden
|
|
1427
|
+
*/
|
|
1428
|
+
/** {en}
|
|
949
1429
|
* @list option
|
|
950
1430
|
* @kind property
|
|
951
1431
|
* @hidden
|
|
@@ -955,21 +1435,34 @@ interface CommonStyle {
|
|
|
955
1435
|
* @brief 进度条底色
|
|
956
1436
|
* @default 无
|
|
957
1437
|
*/
|
|
1438
|
+
/** {en}
|
|
1439
|
+
* @brief The background color of the progress bar.
|
|
1440
|
+
*/
|
|
958
1441
|
progressColor?: string;
|
|
959
1442
|
/** {zh}
|
|
960
1443
|
* @brief 播放完成部分进度条底色
|
|
961
1444
|
* @default 无
|
|
962
1445
|
*/
|
|
1446
|
+
/** {en}
|
|
1447
|
+
* @brief The background color of the progress bar for the completed portion of video playback.
|
|
1448
|
+
*/
|
|
963
1449
|
playedColor?: string;
|
|
964
1450
|
/** {zh}
|
|
965
1451
|
* @brief 缓存部分进度条底色
|
|
966
1452
|
* @default 无
|
|
967
1453
|
*/
|
|
1454
|
+
/** {en}
|
|
1455
|
+
* @brief
|
|
1456
|
+
* @brief The background color of the progress bar for the cached portion of video playback.
|
|
1457
|
+
*/
|
|
968
1458
|
cachedColor?: string;
|
|
969
1459
|
/** {zh}
|
|
970
1460
|
* @brief 进度条滑块样式
|
|
971
1461
|
* @default 无
|
|
972
1462
|
*/
|
|
1463
|
+
/** {en}
|
|
1464
|
+
* @brief The style of the progress bar slider.
|
|
1465
|
+
*/
|
|
973
1466
|
sliderBtnStyle?: {
|
|
974
1467
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
975
1468
|
[propName: string]: any;
|
|
@@ -978,6 +1471,9 @@ interface CommonStyle {
|
|
|
978
1471
|
* @brief 音量颜色
|
|
979
1472
|
* @default 无
|
|
980
1473
|
*/
|
|
1474
|
+
/** {en}
|
|
1475
|
+
* @brief The color of the volume slider.
|
|
1476
|
+
*/
|
|
981
1477
|
volumeColor?: string;
|
|
982
1478
|
}
|
|
983
1479
|
type PrepareResult = {
|
|
@@ -986,60 +1482,80 @@ type PrepareResult = {
|
|
|
986
1482
|
plugins?: any[];
|
|
987
1483
|
};
|
|
988
1484
|
type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
|
|
989
|
-
/**
|
|
1485
|
+
/** {zh}
|
|
990
1486
|
* @detail option
|
|
991
1487
|
* @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
992
1488
|
*/
|
|
1489
|
+
/** {en}
|
|
1490
|
+
* @detail option
|
|
1491
|
+
* @brief The actual codec of the video.
|
|
1492
|
+
*/
|
|
993
1493
|
declare enum Codec {
|
|
994
1494
|
/** {zh}
|
|
995
|
-
* @brief
|
|
1495
|
+
* @brief H.265 编码格式
|
|
1496
|
+
*/
|
|
1497
|
+
/** {en}
|
|
1498
|
+
* @brief H.265.
|
|
996
1499
|
*/
|
|
997
1500
|
H265 = "h265",
|
|
998
1501
|
/** {zh}
|
|
999
|
-
* @brief
|
|
1502
|
+
* @brief H.264 编码格式
|
|
1503
|
+
*/
|
|
1504
|
+
/** {en}
|
|
1505
|
+
* @brief H.264.
|
|
1000
1506
|
*/
|
|
1001
1507
|
H264 = "h264"
|
|
1002
1508
|
}
|
|
1003
|
-
/**
|
|
1509
|
+
/** {zh}
|
|
1004
1510
|
* @detail option
|
|
1005
1511
|
* @brief 是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
1006
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
|
+
*/
|
|
1007
1517
|
declare enum Degradation {
|
|
1008
1518
|
/** {zh}
|
|
1009
1519
|
* @brief 硬解不支持降级到软解
|
|
1010
1520
|
*/
|
|
1521
|
+
/** {en}
|
|
1522
|
+
* @brief The player does not support falling back to software decoding.
|
|
1523
|
+
*/
|
|
1011
1524
|
SoftFirst = "soft-first",
|
|
1012
1525
|
/** {zh}
|
|
1013
1526
|
* @brief 硬解不支持降级到h264
|
|
1014
1527
|
* @hidden
|
|
1015
1528
|
*/
|
|
1529
|
+
/** {en}
|
|
1530
|
+
* @brief The player does not support falling back to H.264.
|
|
1531
|
+
* @hidden
|
|
1532
|
+
*/
|
|
1016
1533
|
H264First = "h264-first"
|
|
1017
1534
|
}
|
|
1018
|
-
/**
|
|
1535
|
+
/** {zh}
|
|
1019
1536
|
* @detail option
|
|
1020
1537
|
* @brief 解码方式。
|
|
1021
1538
|
* @example
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1027
|
-
* veplayer.on(VePlayer.live.Events.CANPLAY, function () {
|
|
1028
|
-
* console.log('监听到 canplay 事件')
|
|
1029
|
-
* });
|
|
1030
|
-
* }).catch(error => {
|
|
1031
|
-
* console.log('创建播放器失败,报错信息:', error);
|
|
1032
|
-
* });;
|
|
1033
|
-
* ```
|
|
1539
|
+
*/
|
|
1540
|
+
/** {en}
|
|
1541
|
+
* @detail option
|
|
1542
|
+
* @brief Decoding method.
|
|
1543
|
+
* @example
|
|
1034
1544
|
*/
|
|
1035
1545
|
declare enum DecodeType {
|
|
1036
1546
|
/** {zh}
|
|
1037
1547
|
* @brief 软解
|
|
1038
1548
|
*/
|
|
1549
|
+
/** {en}
|
|
1550
|
+
* @brief Software decoding.
|
|
1551
|
+
*/
|
|
1039
1552
|
Software = "software",
|
|
1040
1553
|
/** {zh}
|
|
1041
1554
|
* @brief 硬解
|
|
1042
1555
|
*/
|
|
1556
|
+
/** {en}
|
|
1557
|
+
* @brief Hardware decoding.
|
|
1558
|
+
*/
|
|
1043
1559
|
Hardware = "hardware"
|
|
1044
1560
|
}
|
|
1045
1561
|
type Constructor<T> = new (...args: any[]) => T;
|
|
@@ -1051,11 +1567,14 @@ declare class VePlayerBase {
|
|
|
1051
1567
|
private _i18nManager;
|
|
1052
1568
|
private _events;
|
|
1053
1569
|
private _errorCallback;
|
|
1054
|
-
/**
|
|
1570
|
+
/** {zh}
|
|
1571
|
+
* @hidden
|
|
1572
|
+
*/
|
|
1573
|
+
/** {en}
|
|
1055
1574
|
* @hidden
|
|
1056
1575
|
*/
|
|
1057
1576
|
constructor(options?: VePlayerBaseOptions);
|
|
1058
|
-
/**
|
|
1577
|
+
/** {zh}
|
|
1059
1578
|
* @brief 获取视频的就绪状态,其状态枚举值、枚举名称和说明如下:
|
|
1060
1579
|
* - `0`:HAVE_NOTHING,没有关于媒体资源的可用信息
|
|
1061
1580
|
* - `1`:HAVE_METADATA,已检索到足够多的媒体资源来初始化元数据, 快进/快退不会引发异常
|
|
@@ -1063,48 +1582,87 @@ declare class VePlayerBase {
|
|
|
1063
1582
|
* - `3`:HAVE_FUTURE_DATA,当前播放位置以及未来至少一小段时间的数据是可用的(至少有两帧以上的数据)
|
|
1064
1583
|
* - `4`:HAVE_ENOUGH_DATA,有足够的数据可用,并且下载速率足够,媒体可以不间断地播放到最后
|
|
1065
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
|
+
*/
|
|
1066
1593
|
get readyState(): 0 | 2 | 1 | 4 | 3;
|
|
1067
|
-
/**
|
|
1594
|
+
/** {zh}
|
|
1068
1595
|
* @brief 获取当前已缓冲的时间范围。
|
|
1069
1596
|
*/
|
|
1597
|
+
/** {en}
|
|
1598
|
+
* @brief Gets the currently buffered time range.
|
|
1599
|
+
*/
|
|
1070
1600
|
get buffered(): TimeRanges;
|
|
1071
|
-
/**
|
|
1601
|
+
/** {zh}
|
|
1072
1602
|
* @brief 获取已经播放的音频/视频的时间范围。
|
|
1073
1603
|
*/
|
|
1604
|
+
/** {en}
|
|
1605
|
+
* @brief Gets the time range of the audio/video that has been played.
|
|
1606
|
+
*/
|
|
1074
1607
|
get played(): TimeRanges;
|
|
1075
|
-
/**
|
|
1608
|
+
/** {zh}
|
|
1076
1609
|
* @brief 设置/获取视频当前的播放时间, 单位为 s。
|
|
1077
1610
|
*/
|
|
1611
|
+
/** {en}
|
|
1612
|
+
* @brief Sets or gets the current playback position of the video, in seconds.
|
|
1613
|
+
*/
|
|
1078
1614
|
get cumulateTime(): number;
|
|
1079
|
-
/**
|
|
1615
|
+
/** {zh}
|
|
1080
1616
|
* @brief 获取是否处于焦点状态,处于焦点状态会显示控制栏。
|
|
1081
1617
|
*/
|
|
1618
|
+
/** {en}
|
|
1619
|
+
* @brief Gets whether the player has focus. The control bar is displayed when the player has focus.
|
|
1620
|
+
*/
|
|
1082
1621
|
get isFocused(): boolean;
|
|
1083
|
-
/**
|
|
1622
|
+
/** {zh}
|
|
1084
1623
|
* @brief 获取播放器是否处于全屏状态。
|
|
1085
1624
|
*/
|
|
1625
|
+
/** {en}
|
|
1626
|
+
* @brief Gets whether the player is in full-screen mode, in which the player covers the entire desktop.
|
|
1627
|
+
*/
|
|
1086
1628
|
get isFullscreen(): boolean;
|
|
1087
|
-
/**
|
|
1629
|
+
/** {zh}
|
|
1088
1630
|
* @brief 获取播放器是否处于网页全屏状态。
|
|
1089
1631
|
*/
|
|
1632
|
+
/** {en}
|
|
1633
|
+
* @brief Gets whether the player is in full-window mode, in which the player covers the entire browser window.
|
|
1634
|
+
*/
|
|
1090
1635
|
get isCssFullscreen(): boolean;
|
|
1091
|
-
/**
|
|
1636
|
+
/** {zh}
|
|
1092
1637
|
* @brief 获取视频的网络状态,其状态枚举值、枚举名称和说明如下:
|
|
1093
1638
|
* - `0`:NETWORK_EMPTY,目前还没有数据,readyState 的值是 HAVE_NOTHING
|
|
1094
1639
|
* - `1`:NETWORK_IDLE,HTMLMediaElement 处于活动状态并已选择资源,但未使用网络
|
|
1095
1640
|
* - `2`:NETWORK_LOADING,浏览器正在下载 HTMLMediaElement 数据
|
|
1096
1641
|
* - `3`:NETWORK_NO_SOURCE,未找到 HTMLMediaElement src。
|
|
1097
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
|
+
*/
|
|
1098
1650
|
get networkState(): 0 | 2 | 1 | 3;
|
|
1099
|
-
/**
|
|
1651
|
+
/** {zh}
|
|
1100
1652
|
* @brief 获取当前视频是否处于暂停状态。
|
|
1101
1653
|
*/
|
|
1654
|
+
/** {en}
|
|
1655
|
+
* @brief Gets whether the current video is suspended.
|
|
1656
|
+
*/
|
|
1102
1657
|
get paused(): boolean;
|
|
1103
|
-
/**
|
|
1658
|
+
/** {zh}
|
|
1104
1659
|
* @brief 获取当前视频是否播放结束。
|
|
1105
1660
|
*/
|
|
1661
|
+
/** {en}
|
|
1662
|
+
* @brief Gets whether the current video has finished playing.
|
|
1663
|
+
*/
|
|
1106
1664
|
get ended(): boolean;
|
|
1107
|
-
/**
|
|
1665
|
+
/** {zh}
|
|
1108
1666
|
* @brief 获取播放器当前所处的状态,其状态枚举值、枚举名称和说明如下:
|
|
1109
1667
|
* - `0`:ERROR,播放出现错误
|
|
1110
1668
|
* - `1`:INITIAL,初始化
|
|
@@ -1116,244 +1674,428 @@ declare class VePlayerBase {
|
|
|
1116
1674
|
* - `7`:ENDED,播放结束
|
|
1117
1675
|
* - `8`:DESTROYED,播放器实例处于已被销毁
|
|
1118
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
|
+
*/
|
|
1119
1689
|
get state(): number;
|
|
1120
|
-
/**
|
|
1690
|
+
/** {zh}
|
|
1121
1691
|
* 获取当前播放视频的拉流地址。
|
|
1122
1692
|
*/
|
|
1693
|
+
/** {en}
|
|
1694
|
+
* Gets the current pull stream address.
|
|
1695
|
+
*/
|
|
1123
1696
|
get url(): string | undefined;
|
|
1124
|
-
/**
|
|
1125
|
-
* @brief
|
|
1697
|
+
/** {zh}
|
|
1698
|
+
* @brief 获取当前播放视频的线路名称唯一标识(name)。
|
|
1699
|
+
*/
|
|
1700
|
+
/** {en}
|
|
1701
|
+
* @brief Gets the current playback source ID.
|
|
1126
1702
|
*/
|
|
1127
1703
|
get source(): string | undefined;
|
|
1128
|
-
/**
|
|
1704
|
+
/** {zh}
|
|
1129
1705
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
1130
1706
|
*/
|
|
1707
|
+
/** {en}
|
|
1708
|
+
* @brief Gets the current resolution ID.
|
|
1709
|
+
*/
|
|
1131
1710
|
get definition(): string;
|
|
1132
|
-
/**
|
|
1711
|
+
/** {zh}
|
|
1133
1712
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
1134
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
|
+
*/
|
|
1135
1717
|
get crossOrigin(): string;
|
|
1136
|
-
/**
|
|
1718
|
+
/** {zh}
|
|
1137
1719
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
1138
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
|
+
*/
|
|
1139
1724
|
set crossOrigin(crossOrigin: string);
|
|
1140
|
-
/**
|
|
1725
|
+
/** {zh}
|
|
1141
1726
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
1142
1727
|
*/
|
|
1728
|
+
/** {en}
|
|
1729
|
+
* @brief Gets the volume of the video. The value range is [0,1].
|
|
1730
|
+
*/
|
|
1143
1731
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1144
1732
|
get volume(): number;
|
|
1145
|
-
/**
|
|
1733
|
+
/** {zh}
|
|
1146
1734
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
1147
1735
|
*/
|
|
1736
|
+
/** {en}
|
|
1737
|
+
* @brief Sets the volume of the video. Valid range: [0,1].
|
|
1738
|
+
*/
|
|
1148
1739
|
set volume(volume: number);
|
|
1149
|
-
/**
|
|
1740
|
+
/** {zh}
|
|
1150
1741
|
* @brief 获取和设置视频静音状态。
|
|
1151
1742
|
* - `true`:静音
|
|
1152
1743
|
* - `false`:非静音
|
|
1153
1744
|
*/
|
|
1745
|
+
/** {en}
|
|
1746
|
+
* @brief Gets whether the video is muted.
|
|
1747
|
+
* - `true`: Muted.
|
|
1748
|
+
* - `false`: Not muted.
|
|
1749
|
+
*/
|
|
1154
1750
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1155
1751
|
get muted(): boolean;
|
|
1156
|
-
/**
|
|
1752
|
+
/** {zh}
|
|
1157
1753
|
* @brief 获取和设置视频静音状态。
|
|
1158
1754
|
* - `true`:静音
|
|
1159
1755
|
* - `false`:非静音
|
|
1160
1756
|
*/
|
|
1757
|
+
/** {en}
|
|
1758
|
+
* @brief Mute or unmute the video.
|
|
1759
|
+
* - `true`: Mute the video.
|
|
1760
|
+
* - `false`: Unmute the video.
|
|
1761
|
+
*/
|
|
1161
1762
|
set muted(isMuted: boolean);
|
|
1162
|
-
/**
|
|
1763
|
+
/** {zh}
|
|
1163
1764
|
* @brief 获取和设置当前语言。
|
|
1164
1765
|
*/
|
|
1766
|
+
/** {en}
|
|
1767
|
+
* @brief Gets the current language.
|
|
1768
|
+
*/
|
|
1165
1769
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1166
1770
|
get lang(): "zh-cn" | "en" | string;
|
|
1167
|
-
/**
|
|
1771
|
+
/** {zh}
|
|
1168
1772
|
* @brief 获取和设置当前语言。
|
|
1169
1773
|
*/
|
|
1774
|
+
/** {en}
|
|
1775
|
+
* @brief Sets the current language.
|
|
1776
|
+
*/
|
|
1170
1777
|
set lang(lang: "zh-cn" | "en" | string);
|
|
1171
1778
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1172
1779
|
protected get _src(): string;
|
|
1173
|
-
/**
|
|
1780
|
+
/** {zh}
|
|
1781
|
+
* @hidden
|
|
1782
|
+
*/
|
|
1783
|
+
/** {en}
|
|
1174
1784
|
* @hidden
|
|
1175
1785
|
*/
|
|
1176
1786
|
static create<T extends VePlayerBase>(options?: VePlayerBaseOptions, Constructor?: Constructor<T>): Promise<T>;
|
|
1177
|
-
/**
|
|
1787
|
+
/** {zh}
|
|
1178
1788
|
* @brief 调用此方法切换拉流地址、线路、清晰度。
|
|
1179
1789
|
* @param target 目标地址,可以是播放地址,也可以是线路和清晰度
|
|
1180
1790
|
* @param options 更多配置信息
|
|
1181
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
|
+
*/
|
|
1182
1797
|
switch(target: string | {
|
|
1183
|
-
/**
|
|
1798
|
+
/** {zh}
|
|
1184
1799
|
* @brief 清晰度的唯一标识。
|
|
1185
1800
|
* @default 无
|
|
1186
1801
|
*/
|
|
1802
|
+
/** {en}
|
|
1803
|
+
* @brief The resolution ID.
|
|
1804
|
+
*/
|
|
1187
1805
|
definition?: string;
|
|
1188
|
-
/**
|
|
1806
|
+
/** {zh}
|
|
1189
1807
|
* @brief 线路的唯一标识。
|
|
1190
1808
|
* @default 无
|
|
1191
1809
|
*/
|
|
1810
|
+
/** {en}
|
|
1811
|
+
* @brief The playback source ID.
|
|
1812
|
+
*/
|
|
1192
1813
|
source?: string;
|
|
1193
1814
|
}, options?: {
|
|
1194
|
-
/**
|
|
1815
|
+
/** {zh}
|
|
1195
1816
|
* @brief 清晰度 definition 配置无效时,是否降级到播放列表第一个清晰度地址。
|
|
1196
1817
|
* @default false
|
|
1197
1818
|
*
|
|
1198
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
|
+
*/
|
|
1199
1825
|
fallbackToFirstDefinition?: boolean;
|
|
1200
1826
|
}): Promise<ExposedDefinition>;
|
|
1201
|
-
/**
|
|
1827
|
+
/** {zh}
|
|
1202
1828
|
* @brief 调用此方法更新拉流地址列表。
|
|
1203
1829
|
* @param playlist 要更新的播放列表。
|
|
1204
1830
|
* @param target 更新后默认播放的资源。
|
|
1205
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
|
+
*/
|
|
1206
1837
|
updatePlaylist(playlist: ExposedSource[] | string, target?: string | {
|
|
1207
|
-
/**
|
|
1838
|
+
/** {zh}
|
|
1208
1839
|
* @brief 清晰度唯一标识。
|
|
1209
1840
|
* @default 无
|
|
1210
1841
|
*
|
|
1211
1842
|
*/
|
|
1843
|
+
/** {en}
|
|
1844
|
+
* @brief The resolution ID.
|
|
1845
|
+
*
|
|
1846
|
+
*/
|
|
1212
1847
|
definition?: string;
|
|
1213
|
-
/**
|
|
1848
|
+
/** {zh}
|
|
1214
1849
|
* @brief 线路的唯一标识。
|
|
1215
1850
|
* @default 无
|
|
1216
1851
|
*
|
|
1217
1852
|
*/
|
|
1853
|
+
/** {en}
|
|
1854
|
+
* @brief The playback resource ID.
|
|
1855
|
+
*
|
|
1856
|
+
*/
|
|
1218
1857
|
source?: string;
|
|
1219
1858
|
}): Promise<void>;
|
|
1220
1859
|
// TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
|
|
1221
1860
|
/**
|
|
1861
|
+
/** {zh}
|
|
1222
1862
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
1223
1863
|
* @param event 表示事件的名称。
|
|
1224
|
-
* @param callback
|
|
1864
|
+
* @param callback 表示事件的回调函数。
|
|
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.
|
|
1225
1870
|
*/
|
|
1226
1871
|
once(event: string, callback: (data?: any) => any): void;
|
|
1227
|
-
/**
|
|
1872
|
+
/** {zh}
|
|
1228
1873
|
* @brief 调用此方法解绑或移除指定事件的事件监听。
|
|
1229
1874
|
* @param event 表示事件的名称。
|
|
1230
|
-
* @param callback
|
|
1875
|
+
* @param callback 表示事件的回调函数。
|
|
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.
|
|
1231
1881
|
*/
|
|
1232
1882
|
off(event: string, callback: (data?: any) => any): void;
|
|
1233
|
-
/**
|
|
1883
|
+
/** {zh}
|
|
1234
1884
|
* @brief 调用此方法触发指定事件。
|
|
1235
1885
|
* @param event 表示事件的名称。
|
|
1236
1886
|
* @param data 事件信息。
|
|
1237
1887
|
*/
|
|
1888
|
+
/** {en}
|
|
1889
|
+
* @brief Triggers a specified event.
|
|
1890
|
+
* @param event The event name.
|
|
1891
|
+
* @param data The event information.
|
|
1892
|
+
*/
|
|
1238
1893
|
emit(event: string, data?: any): void;
|
|
1239
|
-
/**
|
|
1894
|
+
/** {zh}
|
|
1240
1895
|
* @brief 调用此方法解绑或移除指定事件的所有事件监听。
|
|
1241
1896
|
*/
|
|
1897
|
+
/** {en}
|
|
1898
|
+
* @brief Stops listening to any player event.
|
|
1899
|
+
*/
|
|
1242
1900
|
offAll(): void;
|
|
1243
|
-
/**
|
|
1901
|
+
/** {zh}
|
|
1244
1902
|
* @brief 调用此方法监听指定事件。
|
|
1245
|
-
* @param event
|
|
1246
|
-
* @param callback
|
|
1903
|
+
* @param event 表示事件名称。
|
|
1904
|
+
* @param callback 表示事件的回调函数。
|
|
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.
|
|
1247
1910
|
*/
|
|
1248
1911
|
on(event: string, callback: (data?: any) => any): void;
|
|
1249
|
-
/**
|
|
1912
|
+
/** {zh}
|
|
1250
1913
|
* @brief 调用此方法开始播放 。
|
|
1251
1914
|
*/
|
|
1915
|
+
/** {en}
|
|
1916
|
+
* @brief Starts playback.
|
|
1917
|
+
*/
|
|
1252
1918
|
play(): any;
|
|
1253
|
-
/**
|
|
1919
|
+
/** {zh}
|
|
1254
1920
|
* @brief 调用此方法暂停播放。
|
|
1255
1921
|
*/
|
|
1922
|
+
/** {en}
|
|
1923
|
+
* @brief Pauses playback.
|
|
1924
|
+
*/
|
|
1256
1925
|
pause(): void;
|
|
1257
|
-
/**
|
|
1926
|
+
/** {zh}
|
|
1258
1927
|
* @brief 调用此方法打开画中画。
|
|
1259
1928
|
*/
|
|
1929
|
+
/** {en}
|
|
1930
|
+
* @brief Turns on Picture-in-Picture (PIP).
|
|
1931
|
+
*/
|
|
1260
1932
|
requestPIP(): void;
|
|
1261
|
-
/**
|
|
1933
|
+
/** {zh}
|
|
1262
1934
|
* @brief 调用此方法关闭画中画。
|
|
1263
1935
|
*/
|
|
1936
|
+
/** {en}
|
|
1937
|
+
* @brief Turns off Picture-in-Picture (PIP).
|
|
1938
|
+
*/
|
|
1264
1939
|
exitPIP(): void;
|
|
1265
|
-
/**
|
|
1940
|
+
/** {zh}
|
|
1266
1941
|
* @brief 调用此方法重新拉流。
|
|
1267
1942
|
*/
|
|
1943
|
+
/** {en}
|
|
1944
|
+
* @brief Retries stream-pulling.
|
|
1945
|
+
*/
|
|
1268
1946
|
retry(): void;
|
|
1269
|
-
/**
|
|
1947
|
+
/** {zh}
|
|
1270
1948
|
* @brief 播放器获取焦点,调用该方法 `veplayer.isFocused` 将会变为 `true`,并触发 `PLAYER_FOCUS` 事件。
|
|
1271
1949
|
* @param data 播放器获取焦点配置信息。
|
|
1272
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
|
+
*/
|
|
1273
1955
|
focus(data?: {
|
|
1274
|
-
/**
|
|
1956
|
+
/** {zh}
|
|
1275
1957
|
* @brief 是否需要自动失焦,默认为 true,即经过 delay 时长之后,会自动调用 blur() 进行失焦。
|
|
1276
1958
|
* @default true
|
|
1277
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
|
+
*/
|
|
1278
1964
|
autoHide?: boolean;
|
|
1279
|
-
/**
|
|
1965
|
+
/** {zh}
|
|
1280
1966
|
* @brief 自动失焦延迟时长,单位ms,autoHide 为 true 时生效。
|
|
1281
1967
|
* @default 3000
|
|
1282
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
|
+
*/
|
|
1283
1973
|
delay?: number;
|
|
1284
1974
|
}): void;
|
|
1285
|
-
/**
|
|
1975
|
+
/** {zh}
|
|
1286
1976
|
* @brief 播放器失去焦点,调用该方法 `veplayer.isFocused` 将会变为 `false`,并触发 `PLAYER_BLUR` 事件。
|
|
1287
1977
|
* @param data 播放器失去焦点配置信息。
|
|
1288
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
|
+
*/
|
|
1289
1983
|
blur(data?: {
|
|
1290
|
-
/**
|
|
1984
|
+
/** {zh}
|
|
1291
1985
|
* @brief 播放器失焦是否忽略暂停状态,默认值是 true,即默认暂停的时候不取消播放器焦点状态。
|
|
1292
1986
|
* @default false
|
|
1293
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
|
+
*/
|
|
1294
1992
|
ignorePaused?: boolean;
|
|
1295
1993
|
}): void;
|
|
1296
|
-
/**
|
|
1994
|
+
/** {zh}
|
|
1297
1995
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
1298
1996
|
* @param el 全屏作用的 DOM 节点。
|
|
1299
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
|
+
*/
|
|
1300
2002
|
requestFullscreen(el?: HTMLElement): Promise<void>;
|
|
1301
|
-
/**
|
|
2003
|
+
/** {zh}
|
|
1302
2004
|
* @brief 调用此方法退出系统全屏状态,调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.FULLSCREEN_CHANGE` 事件。
|
|
1303
2005
|
* @param el 全屏作用的 DOM 节点。
|
|
1304
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
|
+
*/
|
|
1305
2011
|
exitFullscreen(el?: HTMLElement): Promise<void>;
|
|
1306
|
-
/**
|
|
2012
|
+
/** {zh}
|
|
1307
2013
|
* @brief 调用此方法进入网页样式全屏状态,播放器进入网页全屏,利用 CSS 模拟实现全屏效果。如果该接口调用的时候处于全屏状态,会自动退出全屏,下发事件 `Events.CSS_FULLSCREEN_CHANGE`。
|
|
1308
2014
|
* @param el 全屏作用的 DOM 节点。
|
|
1309
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
|
+
*/
|
|
1310
2020
|
requestCssFullscreen(el?: HTMLElement): void;
|
|
1311
|
-
/**
|
|
2021
|
+
/** {zh}
|
|
1312
2022
|
* @brief 调用此方法退出网页样式全屏状态。 调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.CSS_FULLSCREEN_CHANGE` 事件。
|
|
1313
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
|
+
*/
|
|
1314
2027
|
exitCssFullscreen(): void;
|
|
1315
|
-
/**
|
|
2028
|
+
/** {zh}
|
|
1316
2029
|
* @brief 调用此方法在当前播放器上注册指定插件。
|
|
1317
2030
|
* @param plugin 插件构造函数。
|
|
1318
2031
|
* @param config 插件的配置列表。
|
|
1319
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
|
+
*/
|
|
1320
2038
|
registerPlugin(plugin:
|
|
1321
2039
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1322
2040
|
Function | {
|
|
1323
|
-
/**
|
|
2041
|
+
/** {zh}
|
|
1324
2042
|
* @brief 插件构造函数。
|
|
1325
2043
|
* @default 无
|
|
1326
2044
|
*/
|
|
2045
|
+
/** {en}
|
|
2046
|
+
* @brief The plugin constructor.
|
|
2047
|
+
*/
|
|
1327
2048
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
1328
2049
|
plugin: Function;
|
|
1329
|
-
/**
|
|
2050
|
+
/** {zh}
|
|
1330
2051
|
* @brief 插件配置参数。
|
|
1331
2052
|
* @default 无
|
|
1332
2053
|
*/
|
|
2054
|
+
/** {en}
|
|
2055
|
+
* @brief The plugin configurations.
|
|
2056
|
+
*/
|
|
1333
2057
|
options: object;
|
|
1334
2058
|
}, config?: {
|
|
1335
2059
|
[propName: string]: any;
|
|
1336
2060
|
}): any;
|
|
1337
|
-
/**
|
|
2061
|
+
/** {zh}
|
|
1338
2062
|
* @brief 调用此方法在当前播放器上销毁/注销指定插件。
|
|
1339
2063
|
* @param plugin 插件实例或者插件名称。
|
|
1340
2064
|
*/
|
|
2065
|
+
/** {en}
|
|
2066
|
+
* @brief Destroys or unregisters a specified plugin from the player.
|
|
2067
|
+
* @param Plugin The plugin instance or name.
|
|
2068
|
+
*/
|
|
1341
2069
|
unRegisterPlugin(plugin: any): void;
|
|
1342
|
-
/**
|
|
2070
|
+
/** {zh}
|
|
1343
2071
|
* @brief 调用此接口显示指定插件图标。
|
|
1344
2072
|
* @param pluginNames 插件名称
|
|
1345
2073
|
*/
|
|
2074
|
+
/** {en}
|
|
2075
|
+
* @brief Displays the icon of a specified plugin.
|
|
2076
|
+
* @param PluginNames The plugin name.
|
|
2077
|
+
*/
|
|
1346
2078
|
showIcon(pluginNames: string[]): void;
|
|
1347
|
-
/**
|
|
2079
|
+
/** {zh}
|
|
1348
2080
|
* @brief 调用此接口隐藏指定插件图标。
|
|
1349
2081
|
* @param pluginNames 插件名称
|
|
1350
2082
|
*/
|
|
2083
|
+
/** {en}
|
|
2084
|
+
* @brief Hides the icon of a specified plugin.
|
|
2085
|
+
* @param PluginNames The plugin name.
|
|
2086
|
+
*/
|
|
1351
2087
|
hideIcon(pluginNames: string[]): void;
|
|
1352
|
-
/**
|
|
2088
|
+
/** {zh}
|
|
1353
2089
|
* @brief 调用此方法销毁播放器实例。
|
|
1354
2090
|
*/
|
|
2091
|
+
/** {en}
|
|
2092
|
+
* @brief Destroys the player instance.
|
|
2093
|
+
*/
|
|
1355
2094
|
destroy(): void;
|
|
1356
|
-
/**
|
|
2095
|
+
/** {zh}
|
|
2096
|
+
* @hidden
|
|
2097
|
+
*/
|
|
2098
|
+
/** {en}
|
|
1357
2099
|
* @hidden
|
|
1358
2100
|
*/
|
|
1359
2101
|
prepare(url: string): Promise<{
|
|
@@ -1396,7 +2138,8 @@ declare enum DynamicModule {
|
|
|
1396
2138
|
PluginHls = "plugin:hls",
|
|
1397
2139
|
PluginShaka = "plugin:shaka",
|
|
1398
2140
|
PluginRtm = "plugin:rtm",
|
|
1399
|
-
PluginXgvideo = "plugin:xgvideo"
|
|
2141
|
+
PluginXgvideo = "plugin:xgvideo",
|
|
2142
|
+
PluginDrm = "plugin:drm"
|
|
1400
2143
|
}
|
|
1401
2144
|
type ModulesMap = {
|
|
1402
2145
|
[DynamicModule.BizVod]: Exports;
|
|
@@ -1407,12 +2150,13 @@ type ModulesMap = {
|
|
|
1407
2150
|
[DynamicModule.PluginShaka]: Exports;
|
|
1408
2151
|
[DynamicModule.PluginRtm]: Exports;
|
|
1409
2152
|
[DynamicModule.PluginXgvideo]: Exports;
|
|
2153
|
+
[DynamicModule.PluginDrm]: Exports;
|
|
1410
2154
|
};
|
|
1411
|
-
declare const register: (
|
|
2155
|
+
declare const register: (exports: {
|
|
1412
2156
|
[x: string]: any;
|
|
1413
|
-
}) => {
|
|
2157
|
+
}[]) => {
|
|
1414
2158
|
[x: string]: any;
|
|
1415
|
-
};
|
|
2159
|
+
}[];
|
|
1416
2160
|
declare function load<T extends DynamicModule>(name: T, src?: string): Promise<ModulesMap[T]>;
|
|
1417
2161
|
declare module MobilePlayerPanelWrapper {
|
|
1418
2162
|
export { MobilePlayerPanel };
|
|
@@ -1434,6 +2178,7 @@ declare namespace strategy {
|
|
|
1434
2178
|
MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
|
|
1435
2179
|
MEDIA_ERR_URL_EMPTY: string;
|
|
1436
2180
|
DRM: string;
|
|
2181
|
+
DRM_LICENSE: string;
|
|
1437
2182
|
OTHER: string;
|
|
1438
2183
|
RUNTIME: string;
|
|
1439
2184
|
MODULE_LOAD_ERROR: string;
|
|
@@ -1493,6 +2238,7 @@ declare namespace strategy {
|
|
|
1493
2238
|
MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
|
|
1494
2239
|
MEDIA_ERR_URL_EMPTY: string;
|
|
1495
2240
|
DRM: string;
|
|
2241
|
+
DRM_LICENSE: string;
|
|
1496
2242
|
OTHER: string;
|
|
1497
2243
|
RUNTIME: string;
|
|
1498
2244
|
MODULE_LOAD_ERROR: string;
|
|
@@ -1577,61 +2323,98 @@ declare namespace strategy {
|
|
|
1577
2323
|
set url(url: string);
|
|
1578
2324
|
next(): DefinitionUrl;
|
|
1579
2325
|
}
|
|
1580
|
-
/**
|
|
2326
|
+
/** {zh}
|
|
1581
2327
|
* @list option
|
|
1582
2328
|
* @kind property
|
|
1583
2329
|
* @id Definition
|
|
1584
2330
|
* @name Definition
|
|
1585
2331
|
*
|
|
1586
2332
|
*/
|
|
2333
|
+
/** {en}
|
|
2334
|
+
* @list option
|
|
2335
|
+
* @kind property
|
|
2336
|
+
* @id Definition
|
|
2337
|
+
* @alias Definition
|
|
2338
|
+
*
|
|
2339
|
+
*/
|
|
1587
2340
|
interface ExposedDefinition {
|
|
1588
2341
|
/** {zh}
|
|
1589
2342
|
* @brief 播放地址。
|
|
1590
2343
|
* @default 无
|
|
1591
2344
|
*/
|
|
2345
|
+
/** {en}
|
|
2346
|
+
* @brief The playback address.
|
|
2347
|
+
*/
|
|
1592
2348
|
url: string;
|
|
1593
2349
|
/** {zh}
|
|
1594
|
-
* @brief
|
|
2350
|
+
* @brief 清晰度标识(唯一值)。
|
|
1595
2351
|
* @default 无
|
|
1596
2352
|
*
|
|
1597
2353
|
*/
|
|
2354
|
+
/** {en}
|
|
2355
|
+
* @brief The resolution ID. This value must be unique.
|
|
2356
|
+
*
|
|
2357
|
+
*/
|
|
1598
2358
|
definition: string;
|
|
1599
2359
|
/** {zh}
|
|
1600
2360
|
* @brief 清晰度展示名称。可设置多语言 `{text: {'zh-cn': '高清', 'en': 'HD'}}`。
|
|
1601
2361
|
* @default 无
|
|
1602
2362
|
*/
|
|
2363
|
+
/** {en}
|
|
2364
|
+
* @brief The display name of the resolution. Multiple languages are supported, such as `{text: {'zh-cn': '高清', 'en': 'HD'}}`.
|
|
2365
|
+
*/
|
|
1603
2366
|
text?: Record<Lang, string> | string;
|
|
1604
2367
|
/** {zh}
|
|
1605
2368
|
* @brief 为当前清晰度地址设置备路拉流地址,支持设置多个备路拉流地址。当前清晰度地址拉流失败时,会在当前清晰度地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
1606
2369
|
* @default 无
|
|
1607
2370
|
*
|
|
1608
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
|
+
*/
|
|
1609
2376
|
fallbackUrls?: string[];
|
|
1610
2377
|
}
|
|
1611
|
-
/**
|
|
2378
|
+
/** {zh}
|
|
2379
|
+
* @list option
|
|
2380
|
+
* @kind property
|
|
2381
|
+
* @id Source
|
|
2382
|
+
* @alias Source
|
|
2383
|
+
*/
|
|
2384
|
+
/** {en}
|
|
1612
2385
|
* @list option
|
|
1613
|
-
* @brief 线路数据配置。一个线路包含当前线路的 name ,展示名称,及线路下的清晰度列表。
|
|
1614
2386
|
* @kind property
|
|
1615
2387
|
* @id Source
|
|
1616
|
-
* @
|
|
2388
|
+
* @alias Source
|
|
1617
2389
|
*/
|
|
1618
2390
|
interface ExposedSource {
|
|
1619
2391
|
/** {zh}
|
|
1620
|
-
* @brief
|
|
2392
|
+
* @brief 线路标识(唯一值)。
|
|
1621
2393
|
* @default 无
|
|
1622
2394
|
*/
|
|
2395
|
+
/** {en}
|
|
2396
|
+
* @brief The playback source ID. This value must be unique.
|
|
2397
|
+
*/
|
|
1623
2398
|
name?: string;
|
|
1624
2399
|
/** {zh}
|
|
1625
2400
|
* @brief 线路展示名称。可设置多语言 `{text: {'zh-cn': '线路一', 'en': 'LineOne'}}`。
|
|
1626
2401
|
* @default 无
|
|
1627
2402
|
*
|
|
1628
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
|
+
*/
|
|
1629
2408
|
text?: Record<Lang, string> | string;
|
|
1630
2409
|
/** {zh}
|
|
1631
2410
|
* @brief 该线路下清晰度列表。
|
|
1632
2411
|
* @default 无
|
|
1633
2412
|
*
|
|
1634
2413
|
*/
|
|
2414
|
+
/** {en}
|
|
2415
|
+
* @brief A list of resolutions of the current source.
|
|
2416
|
+
*
|
|
2417
|
+
*/
|
|
1635
2418
|
definitions: Array<ExposedDefinition | string>;
|
|
1636
2419
|
}
|
|
1637
2420
|
interface CompoundSources {
|
|
@@ -1704,27 +2487,44 @@ declare namespace strategy {
|
|
|
1704
2487
|
private _handleHide;
|
|
1705
2488
|
}
|
|
1706
2489
|
import MobilePanel = MobilePlayerPanelWrapper.MobilePlayerPanel;
|
|
1707
|
-
/**
|
|
2490
|
+
/** {zh}
|
|
1708
2491
|
* @detail option
|
|
1709
2492
|
* @brief **清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
1710
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
|
+
*/
|
|
1711
2498
|
enum ListType {
|
|
1712
2499
|
/** {zh}
|
|
1713
2500
|
* @brief 全屏布局
|
|
1714
2501
|
* @hidden
|
|
1715
2502
|
*/
|
|
2503
|
+
/** {en}
|
|
2504
|
+
* @brief Fullscreen layout.
|
|
2505
|
+
* @hidden
|
|
2506
|
+
*/
|
|
1716
2507
|
Middle = "middle",
|
|
1717
2508
|
/** {zh}
|
|
1718
2509
|
* @brief 底部抽屉
|
|
1719
2510
|
*/
|
|
2511
|
+
/** {en}
|
|
2512
|
+
* @brief Bottom navigation drawer.
|
|
2513
|
+
*/
|
|
1720
2514
|
Bottom = "bottom",
|
|
1721
2515
|
/** {zh}
|
|
1722
2516
|
* @brief 右侧抽屉,常用于全屏时展示
|
|
1723
2517
|
*/
|
|
2518
|
+
/** {en}
|
|
2519
|
+
* @brief Right navigation drawer. This is often used for fullscreen display.
|
|
2520
|
+
*/
|
|
1724
2521
|
Fullscreen = "fullscreen",
|
|
1725
2522
|
/** {zh}
|
|
1726
2523
|
* @brief 窗口蒙层展示
|
|
1727
2524
|
*/
|
|
2525
|
+
/** {en}
|
|
2526
|
+
* @brief Overlay.
|
|
2527
|
+
*/
|
|
1728
2528
|
Inner = "inner"
|
|
1729
2529
|
}
|
|
1730
2530
|
interface ListItem {
|
|
@@ -1806,203 +2606,363 @@ declare namespace strategy {
|
|
|
1806
2606
|
render(): string;
|
|
1807
2607
|
private _getListType;
|
|
1808
2608
|
}
|
|
1809
|
-
/**
|
|
2609
|
+
/** {zh}
|
|
2610
|
+
* @detail error
|
|
2611
|
+
*/
|
|
2612
|
+
/** {en}
|
|
1810
2613
|
* @detail error
|
|
1811
2614
|
*/
|
|
1812
2615
|
enum Level {
|
|
1813
|
-
/**
|
|
2616
|
+
/** {zh}
|
|
1814
2617
|
* @brief 严重
|
|
1815
2618
|
*
|
|
1816
2619
|
*/
|
|
2620
|
+
/** {en}
|
|
2621
|
+
* @brief Fatal.
|
|
2622
|
+
*
|
|
2623
|
+
*/
|
|
1817
2624
|
Fatal = "Fatal",
|
|
1818
|
-
/**
|
|
2625
|
+
/** {zh}
|
|
1819
2626
|
* @brief 报错
|
|
1820
2627
|
*/
|
|
2628
|
+
/** {en}
|
|
2629
|
+
* @brief Error.
|
|
2630
|
+
*/
|
|
1821
2631
|
Error = "Error"
|
|
1822
2632
|
}
|
|
1823
2633
|
enum ErrorCode {
|
|
1824
|
-
/**
|
|
2634
|
+
/** {zh}
|
|
1825
2635
|
* @brief 视频解析错误
|
|
1826
2636
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1827
2637
|
*/
|
|
2638
|
+
/** {en}
|
|
2639
|
+
* @brief Video parsing error.
|
|
2640
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2641
|
+
*/
|
|
1828
2642
|
MANIFEST_HLS_ERROR = 1100,
|
|
1829
|
-
/**
|
|
2643
|
+
/** {zh}
|
|
1830
2644
|
* @brief 视频解析错误
|
|
1831
2645
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1832
2646
|
*/
|
|
2647
|
+
/** {en}
|
|
2648
|
+
* @brief Video parsing error.
|
|
2649
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
2650
|
+
*/
|
|
1833
2651
|
MANIFEST_DASH_ERROR = 1200,
|
|
1834
|
-
/**
|
|
2652
|
+
/** {zh}
|
|
1835
2653
|
* @brief 网络错误
|
|
1836
2654
|
* @solution 请检查当前网络环境或播放地址是否合法。
|
|
1837
2655
|
*/
|
|
2656
|
+
/** {en}
|
|
2657
|
+
* @brief Network error.
|
|
2658
|
+
* @solution Please check the current network environment and ensure the pull stream address is valid.
|
|
2659
|
+
*/
|
|
1838
2660
|
NETWORK = 2100,
|
|
1839
|
-
/**
|
|
2661
|
+
/** {zh}
|
|
1840
2662
|
* @brief 网络请求超时
|
|
1841
2663
|
* @solution 请检查拉流地址是否合法。
|
|
1842
2664
|
*/
|
|
2665
|
+
/** {en}
|
|
2666
|
+
* @brief Network request timed out
|
|
2667
|
+
* @solution Please check whether the pull stream address is valid.
|
|
2668
|
+
*/
|
|
1843
2669
|
NETWORK_TIMEOUT = 2101,
|
|
1844
|
-
/**
|
|
2670
|
+
/** {zh}
|
|
1845
2671
|
* @brief 网络请求 403
|
|
1846
2672
|
* @solution 请检查拉流地址鉴权信息。
|
|
1847
2673
|
*/
|
|
2674
|
+
/** {en}
|
|
2675
|
+
* @brief The player received a 403 response code.
|
|
2676
|
+
* @solution Check the authentication information in the pull stream address.
|
|
2677
|
+
*/
|
|
1848
2678
|
NETWORK_FORBIDDEN = 2103,
|
|
1849
|
-
/**
|
|
2679
|
+
/** {zh}
|
|
1850
2680
|
* @brief 网络请求 404
|
|
1851
2681
|
* @solution 请检查拉流地址是否合法。
|
|
1852
2682
|
*/
|
|
2683
|
+
/** {en}
|
|
2684
|
+
* @brief The player received a 404 response code.
|
|
2685
|
+
* @solution Check whether the pull stream address is valid.
|
|
2686
|
+
*/
|
|
1853
2687
|
NETWORK_NOTFOUND = 2104,
|
|
1854
|
-
/**
|
|
2688
|
+
/** {zh}
|
|
1855
2689
|
* @brief 网络请求 206
|
|
1856
2690
|
* @solution 请检查拉流地址是否合法。
|
|
1857
2691
|
*/
|
|
2692
|
+
/** {en}
|
|
2693
|
+
* @brief The player received a 206 response code.
|
|
2694
|
+
* @solution Check whether the pull stream address is valid.
|
|
2695
|
+
*/
|
|
1858
2696
|
NETWORK_RANGE_NOT_SATISFIABLE = 2116,
|
|
1859
|
-
/**
|
|
2697
|
+
/** {zh}
|
|
1860
2698
|
* @brief 视频解析错误
|
|
1861
2699
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1862
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
|
+
*/
|
|
1863
2705
|
DEMUX_FLV_ERROR = 3100,
|
|
1864
|
-
/**
|
|
2706
|
+
/** {zh}
|
|
1865
2707
|
* @brief 视频解析错误
|
|
1866
2708
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1867
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
|
+
*/
|
|
1868
2714
|
DEMUX_HLS_ERROR = 3200,
|
|
1869
|
-
/**
|
|
2715
|
+
/** {zh}
|
|
1870
2716
|
* @brief 视频解析错误
|
|
1871
2717
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1872
2718
|
*
|
|
1873
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
|
+
*/
|
|
1874
2725
|
DEMUX_MP4_ERROR = 3300,
|
|
1875
|
-
/**
|
|
2726
|
+
/** {zh}
|
|
1876
2727
|
* @brief 视频解析错误
|
|
1877
2728
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1878
2729
|
*
|
|
1879
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
|
+
*/
|
|
1880
2736
|
DEMUX_FMP4_ERROR = 3400,
|
|
1881
|
-
/**
|
|
2737
|
+
/** {zh}
|
|
1882
2738
|
* @brief 视频解析错误
|
|
1883
2739
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1884
2740
|
*
|
|
1885
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
|
+
*/
|
|
1886
2747
|
DEMUX_SIDX_ERROR = 3410,
|
|
1887
|
-
/**
|
|
2748
|
+
/** {zh}
|
|
1888
2749
|
* @brief 视频解析错误
|
|
1889
2750
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1890
2751
|
*
|
|
1891
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
|
+
*/
|
|
1892
2758
|
REMUX_FMP4_ERROR = 4100,
|
|
1893
|
-
/**
|
|
2759
|
+
/** {zh}
|
|
1894
2760
|
* @brief 视频解析错误
|
|
1895
2761
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1896
2762
|
*
|
|
1897
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
|
+
*/
|
|
1898
2769
|
REMUX_MP4_ERROR = 4200,
|
|
1899
|
-
/**
|
|
2770
|
+
/** {zh}
|
|
1900
2771
|
* @brief 获取数据过程被中止
|
|
1901
2772
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
1902
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
|
+
*/
|
|
1903
2778
|
MEDIA_ERR_ABORTED = 5101,
|
|
1904
|
-
/**
|
|
2779
|
+
/** {zh}
|
|
1905
2780
|
* @brief 网络发生错误,无法成功获取媒体文件
|
|
1906
2781
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
1907
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
|
+
*/
|
|
1908
2787
|
MEDIA_ERR_NETWORK = 5102,
|
|
1909
|
-
/**
|
|
2788
|
+
/** {zh}
|
|
1910
2789
|
* @brief 浏览器在解码媒体资源时发生错误
|
|
1911
2790
|
* @solution
|
|
1912
2791
|
* 1. 请检查原始视频是否正常;
|
|
1913
2792
|
* 2. 重新进行转码和播放;
|
|
1914
2793
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1915
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
|
+
*/
|
|
1916
2802
|
MEDIA_ERR_DECODE = 5103,
|
|
1917
|
-
/**
|
|
2803
|
+
/** {zh}
|
|
1918
2804
|
* @brief 因视频格式不支持、服务器或网络的问题造成视频无法加载
|
|
1919
2805
|
* @solution
|
|
1920
2806
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
1921
2807
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
1922
2808
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1923
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
|
+
*/
|
|
1924
2817
|
MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
|
|
1925
|
-
/**
|
|
2818
|
+
/** {zh}
|
|
1926
2819
|
* @brief 当前浏览器不支持视频解码
|
|
1927
2820
|
* @solution
|
|
1928
2821
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
1929
2822
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
1930
2823
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1931
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
|
+
*/
|
|
1932
2832
|
MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
|
|
1933
|
-
/**
|
|
2833
|
+
/** {zh}
|
|
1934
2834
|
* @brief 当前播放地址为空
|
|
1935
2835
|
* @solution 请检查必要参数 `url` 或 `playlist` 是否传入。
|
|
1936
2836
|
*/
|
|
2837
|
+
/** {en}
|
|
2838
|
+
* @brief The current pull stream address is empty.
|
|
2839
|
+
* @solution Check whether 'url' or 'playlist' is specified.
|
|
2840
|
+
*/
|
|
1937
2841
|
MEDIA_ERR_URL_EMPTY = 5106,
|
|
1938
|
-
/**
|
|
2842
|
+
/** {zh}
|
|
1939
2843
|
* @brief 播放异常
|
|
1940
2844
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1941
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
|
+
*/
|
|
1942
2850
|
MEDIA_MSE_ADD_SB = 5200,
|
|
1943
|
-
/**
|
|
2851
|
+
/** {zh}
|
|
1944
2852
|
* @brief 播放异常
|
|
1945
2853
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1946
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
|
+
*/
|
|
1947
2859
|
MEDIA_MSE_APPEND_BUFFER = 5201,
|
|
1948
|
-
/**
|
|
2860
|
+
/** {zh}
|
|
1949
2861
|
* @brief 播放异常
|
|
1950
2862
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1951
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
|
+
*/
|
|
1952
2868
|
MEDIA_MSE_OTHER = 5202,
|
|
1953
|
-
/**
|
|
2869
|
+
/** {zh}
|
|
1954
2870
|
* @brief 播放异常
|
|
1955
2871
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1956
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
|
+
*/
|
|
1957
2877
|
MEDIA_MSE_FULL = 5203,
|
|
1958
|
-
/**
|
|
2878
|
+
/** {zh}
|
|
1959
2879
|
* @brief 播放异常
|
|
1960
2880
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1961
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
|
+
*/
|
|
1962
2886
|
MEDIA_MSE_HIJACK = 5204,
|
|
1963
|
-
/**
|
|
2887
|
+
/** {zh}
|
|
1964
2888
|
* @brief 播放异常
|
|
1965
2889
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1966
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
|
+
*/
|
|
1967
2895
|
MEDIA_EME_HIJACK = 5301,
|
|
1968
|
-
/**
|
|
2896
|
+
/** {zh}
|
|
1969
2897
|
* @brief DRM 权限校验失败
|
|
1970
2898
|
* @hidden
|
|
1971
2899
|
*/
|
|
2900
|
+
/** {en}
|
|
2901
|
+
* @brief DRM authentication failed.
|
|
2902
|
+
* @hidden
|
|
2903
|
+
*/
|
|
1972
2904
|
DRM_LICENSE = 7100,
|
|
1973
|
-
/**
|
|
2905
|
+
/** {zh}
|
|
1974
2906
|
* @brief DRM 权限校验失败
|
|
1975
2907
|
* @hidden
|
|
1976
2908
|
*/
|
|
2909
|
+
/** {en}
|
|
2910
|
+
* @brief DRM authentication failed.
|
|
2911
|
+
* @hidden
|
|
2912
|
+
*/
|
|
1977
2913
|
DRM_CUSTOM_LICENSE = 7200,
|
|
1978
|
-
/**
|
|
2914
|
+
/** {zh}
|
|
1979
2915
|
* @brief 播放异常
|
|
1980
2916
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1981
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
|
+
*/
|
|
1982
2922
|
OTHER = 8000,
|
|
1983
|
-
/**
|
|
2923
|
+
/** {zh}
|
|
1984
2924
|
* @brief 播放异常
|
|
1985
2925
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1986
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
|
+
*/
|
|
1987
2931
|
RUNTIME_NO_CANPLAY_ERROR = 9001,
|
|
1988
|
-
/**
|
|
2932
|
+
/** {zh}
|
|
1989
2933
|
* @brief 播放异常
|
|
1990
2934
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1991
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
|
+
*/
|
|
1992
2940
|
RUNTIME_BUFFERBREAK_ERROR = 9002,
|
|
1993
|
-
/**
|
|
2941
|
+
/** {zh}
|
|
1994
2942
|
* @brief 播放异常
|
|
1995
2943
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
1996
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
|
+
*/
|
|
1997
2949
|
RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
|
|
1998
2950
|
// veplayer 报错
|
|
1999
|
-
/**
|
|
2951
|
+
/** {zh}
|
|
2000
2952
|
* @brief CDN 异步获取失败
|
|
2001
2953
|
* @solution 请刷新重试或者检查网络环境。
|
|
2002
2954
|
*
|
|
2003
2955
|
*/
|
|
2956
|
+
/** {en}
|
|
2957
|
+
* @brief CDN asynchronous fetch failed.
|
|
2958
|
+
* @solution Refresh the page or check the network environment.
|
|
2959
|
+
*
|
|
2960
|
+
*/
|
|
2004
2961
|
MODULE_LOAD_ERROR = 110,
|
|
2005
|
-
/**
|
|
2962
|
+
/** {zh}
|
|
2963
|
+
* @hidden
|
|
2964
|
+
*/
|
|
2965
|
+
/** {en}
|
|
2006
2966
|
* @hidden
|
|
2007
2967
|
*/
|
|
2008
2968
|
UNKNOWN = "UNKNOWN"
|
|
@@ -2028,38 +2988,68 @@ declare namespace strategy {
|
|
|
2028
2988
|
}
|
|
2029
2989
|
const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
|
|
2030
2990
|
const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
|
|
2031
|
-
/**
|
|
2991
|
+
/** {zh}
|
|
2992
|
+
* @list error
|
|
2993
|
+
* @detail error
|
|
2994
|
+
* @brief 错误对象
|
|
2995
|
+
* @name VeError
|
|
2996
|
+
* @id VeError
|
|
2997
|
+
*/
|
|
2998
|
+
/** {en}
|
|
2999
|
+
* @list error
|
|
2032
3000
|
* @detail error
|
|
2033
|
-
* @
|
|
2034
|
-
* @
|
|
3001
|
+
* @brief The error object.
|
|
3002
|
+
* @name VeError
|
|
3003
|
+
* @id VeError
|
|
2035
3004
|
*/
|
|
2036
3005
|
class VeError<T extends string = TextKey> extends Error {
|
|
2037
3006
|
/**
|
|
2038
|
-
* @brief
|
|
3007
|
+
* @brief 错误码。
|
|
3008
|
+
*/
|
|
3009
|
+
/** {en}
|
|
3010
|
+
* @brief The error code.
|
|
2039
3011
|
*/
|
|
2040
3012
|
readonly errorCode: ErrorCode;
|
|
2041
|
-
/**
|
|
3013
|
+
/** {zh}
|
|
2042
3014
|
* @brief 错误等级。
|
|
2043
3015
|
*/
|
|
3016
|
+
/** {en}
|
|
3017
|
+
* @brief The error level.
|
|
3018
|
+
*/
|
|
2044
3019
|
readonly level?: Level;
|
|
2045
|
-
/**
|
|
3020
|
+
/** {zh}
|
|
2046
3021
|
* @brief 错误信息。
|
|
2047
3022
|
*/
|
|
3023
|
+
/** {en}
|
|
3024
|
+
* @brief The error message.
|
|
3025
|
+
*/
|
|
2048
3026
|
message: string;
|
|
2049
|
-
/**
|
|
3027
|
+
/** {zh}
|
|
2050
3028
|
* @brief 其他错误信息。
|
|
2051
3029
|
*/
|
|
3030
|
+
/** {en}
|
|
3031
|
+
* @brief Other error messages.
|
|
3032
|
+
*/
|
|
2052
3033
|
readonly ext?: any;
|
|
2053
|
-
/**
|
|
3034
|
+
/** {zh}
|
|
3035
|
+
* @hidden
|
|
3036
|
+
* @param error
|
|
3037
|
+
* @param i18n
|
|
3038
|
+
*/
|
|
3039
|
+
/** {en}
|
|
2054
3040
|
* @hidden
|
|
2055
3041
|
* @param error
|
|
2056
3042
|
* @param i18n
|
|
2057
3043
|
*/
|
|
2058
3044
|
constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
|
|
2059
3045
|
}
|
|
2060
|
-
function create(errorCode: ErrorCode, info?: ErrorInfo, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
|
|
2061
|
-
function transform(xgErr: XGError, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
|
|
2062
|
-
/**
|
|
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">;
|
|
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">;
|
|
3048
|
+
/** {zh}
|
|
3049
|
+
* @list option
|
|
3050
|
+
* @kind property
|
|
3051
|
+
*/
|
|
3052
|
+
/** {en}
|
|
2063
3053
|
* @list option
|
|
2064
3054
|
* @kind property
|
|
2065
3055
|
*/
|
|
@@ -2068,26 +3058,46 @@ declare namespace strategy {
|
|
|
2068
3058
|
* @brief 是否展示报错图片。
|
|
2069
3059
|
* @default true
|
|
2070
3060
|
*/
|
|
3061
|
+
/** {en}
|
|
3062
|
+
* @brief Whether to display the error image.
|
|
3063
|
+
* @default true
|
|
3064
|
+
*/
|
|
2071
3065
|
showErrorImg?: boolean;
|
|
2072
3066
|
/** {zh}
|
|
2073
3067
|
* @brief 是否展示报错提示。
|
|
2074
3068
|
* @default true
|
|
2075
3069
|
*/
|
|
3070
|
+
/** {en}
|
|
3071
|
+
* @brief Whether to display the error message.
|
|
3072
|
+
* @default true
|
|
3073
|
+
*/
|
|
2076
3074
|
showErrorTip?: boolean;
|
|
2077
3075
|
/** {zh}
|
|
2078
3076
|
* @brief 是否展示刷新按钮。
|
|
2079
3077
|
* @default true
|
|
2080
3078
|
*/
|
|
3079
|
+
/** {en}
|
|
3080
|
+
* @brief Whether to display the refresh button.
|
|
3081
|
+
* @default true
|
|
3082
|
+
*/
|
|
2081
3083
|
showRefresh?: boolean;
|
|
2082
3084
|
/** {zh}
|
|
2083
3085
|
* @brief 自定义报错显示。
|
|
2084
3086
|
* @default 无
|
|
2085
3087
|
*/
|
|
3088
|
+
/** {en}
|
|
3089
|
+
* @brief Custom error message.
|
|
3090
|
+
* @default None
|
|
3091
|
+
*/
|
|
2086
3092
|
errorTipsText?: string | Record<Lang, string>;
|
|
2087
3093
|
/** {zh}
|
|
2088
3094
|
* @brief 更多提示信息。
|
|
2089
3095
|
* @default 无
|
|
2090
3096
|
*/
|
|
3097
|
+
/** {en}
|
|
3098
|
+
* @brief More tips.
|
|
3099
|
+
* @default None
|
|
3100
|
+
*/
|
|
2091
3101
|
extraTips?: {
|
|
2092
3102
|
label: string | Record<Lang, string>;
|
|
2093
3103
|
value: string | Record<Lang, string>;
|
|
@@ -2134,7 +3144,11 @@ declare namespace strategy {
|
|
|
2134
3144
|
private _handleRefresh;
|
|
2135
3145
|
private _renderRefresh;
|
|
2136
3146
|
}
|
|
2137
|
-
/**
|
|
3147
|
+
/** {zh}
|
|
3148
|
+
* @list option
|
|
3149
|
+
* @kind property
|
|
3150
|
+
*/
|
|
3151
|
+
/** {en}
|
|
2138
3152
|
* @list option
|
|
2139
3153
|
* @kind property
|
|
2140
3154
|
*/
|
|
@@ -2143,15 +3157,27 @@ declare namespace strategy {
|
|
|
2143
3157
|
* @brief 等待超时的时间阈值,单位为 ms。等待超过该值,会抛出 `DEFINITION_FALLBACK` 事件,如果 `needFallback` 为 `true` 则会提示清晰度降级。
|
|
2144
3158
|
* @default 5000
|
|
2145
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
|
+
*/
|
|
2146
3164
|
longWaitingTime?: number;
|
|
2147
3165
|
/** {zh}
|
|
2148
3166
|
* @brief 是否开启清晰度降级。
|
|
2149
3167
|
* @default false
|
|
2150
3168
|
*/
|
|
3169
|
+
/** {en}
|
|
3170
|
+
* @brief Whether to enable resolution fallback.
|
|
3171
|
+
* @default false
|
|
3172
|
+
*/
|
|
2151
3173
|
needFallback?: boolean;
|
|
2152
3174
|
/** {zh}
|
|
2153
3175
|
* @brief 降级顺序,按照数组顺序依次降级,数组中的元素与 playlist 中的 definition 相对应。
|
|
2154
|
-
* @default
|
|
3176
|
+
* @default ['uhd', 'hd', 'sd', 'ld', 'ao']
|
|
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 ']"
|
|
2155
3181
|
*/
|
|
2156
3182
|
demotePriority?: string[];
|
|
2157
3183
|
}
|
|
@@ -2219,51 +3245,85 @@ declare namespace strategy {
|
|
|
2219
3245
|
* @brief 指定播放器容器 ID,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
2220
3246
|
* @default 'veplayer'
|
|
2221
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
|
+
*/
|
|
2222
3252
|
id?: string;
|
|
2223
3253
|
/** {zh}
|
|
2224
3254
|
* @brief 指定播放器容器元素,VePlayer 将被插入在该容器中。id 和 el 需至少传入 1 个。如果同时传入,则优先将播放器插入 id 容器中。
|
|
2225
3255
|
* @default 无
|
|
2226
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
|
+
*/
|
|
2227
3260
|
el?: HTMLElement;
|
|
2228
3261
|
/** {zh}
|
|
2229
3262
|
* @brief 设置播放器宽度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 width 样式属性。
|
|
2230
3263
|
* @default '100%'
|
|
2231
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
|
+
*/
|
|
2232
3269
|
width?: number | string;
|
|
2233
3270
|
/** {zh}
|
|
2234
3271
|
* @brief 设置播放器高度,传入 number 类型参数则播放器内部默认添加单位px,传入 string 类型参数则直接赋值给播放器容器 height 样式属性。
|
|
2235
3272
|
* @default '100%'
|
|
2236
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
|
+
*/
|
|
2237
3278
|
height?: number | string;
|
|
2238
3279
|
/** {zh}
|
|
2239
3280
|
* @brief 为播放器配置直播拉流地址。您可手动拼接或使用地址生成器生成拉流地址,生成方法请参见[生成直播地址](https://www.volcengine.com/docs/6469/107759)。url 和 playList 需至少传入 1 个。
|
|
2240
3281
|
* @default 无
|
|
2241
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
|
+
*/
|
|
2242
3286
|
url?: string;
|
|
2243
3287
|
/** {zh}
|
|
2244
3288
|
* @brief 为播放器配置直播拉流地址列表。url 和 playlist 需至少传入 1 个。
|
|
2245
3289
|
* @default 无
|
|
2246
3290
|
*/
|
|
3291
|
+
/** {en}
|
|
3292
|
+
* @brief A list of live stream sources for the player. You should specify either `url` or `playList`, or both.
|
|
3293
|
+
*/
|
|
2247
3294
|
playlist?: ExposedSource[];
|
|
2248
3295
|
/** {zh}
|
|
2249
3296
|
* @brief 当存在多个直播线路时,为播放器设置默认直播线路,不传则默认列表第一个。
|
|
2250
3297
|
* @default 无
|
|
2251
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
|
+
*/
|
|
2252
3302
|
defaultSource?: string;
|
|
2253
3303
|
/** {zh}
|
|
2254
3304
|
* @brief 为播放器设置默认直播清晰度,不传则默认列表第一个。
|
|
2255
3305
|
* @default 无
|
|
2256
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
|
+
*/
|
|
2257
3310
|
defaultDefinition?: string;
|
|
2258
3311
|
/** {zh}
|
|
2259
3312
|
* @brief 为播放器设置备路拉流地址,支持设置多个备路拉流地址,在 `maxFallbackRound` 大于 `0` 时有效。当您使用配置的直播拉流地址拉流失败时,会在直播地址和备路直播地址之间循环拉流,直到拉流成功。
|
|
2260
3313
|
* @default 无
|
|
2261
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
|
+
*/
|
|
2262
3318
|
fallbackUrls?: string[];
|
|
2263
3319
|
/** {zh}
|
|
2264
3320
|
* @brief 为播放器设置拉流失败时循环拉流的最大次数。
|
|
2265
3321
|
* @default 0
|
|
2266
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
|
+
*/
|
|
2267
3327
|
maxFallbackRound?: number;
|
|
2268
3328
|
/** {zh}
|
|
2269
3329
|
* @brief 为播放器设置解码方式。
|
|
@@ -2274,32 +3334,60 @@ declare namespace strategy {
|
|
|
2274
3334
|
* 3. 部分浏览器不支持 H.265 编码格式,如果需要播放该编码格式的视频,请开启软解。
|
|
2275
3335
|
* @default 'hardware'
|
|
2276
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
|
+
*/
|
|
2277
3346
|
decodeType?: DecodeType;
|
|
2278
3347
|
/** {zh}
|
|
2279
3348
|
* @brief 为播放器设置视频的实际编码格式。如果您在degradation 设置了 `soft-first` 属性(即硬解不支持时降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
2280
3349
|
* @default 'h264'
|
|
2281
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
|
+
*/
|
|
2282
3355
|
codec?: Codec;
|
|
2283
3356
|
/** {zh}
|
|
2284
3357
|
* @brief 为播放器设置是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
2285
3358
|
* @default 'soft-first'
|
|
2286
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
|
+
*/
|
|
2287
3364
|
degradation?: Degradation | boolean;
|
|
2288
3365
|
/** {zh}
|
|
2289
3366
|
* @brief 为播放器设置封面图 URL。
|
|
2290
3367
|
* @default 无
|
|
2291
3368
|
*/
|
|
3369
|
+
/** {en}
|
|
3370
|
+
* @brief The URL of the player's cover image.
|
|
3371
|
+
*/
|
|
2292
3372
|
poster?: string;
|
|
2293
3373
|
/** {zh}
|
|
2294
3374
|
* @brief 为播放器设置初始显示语言,语言包不存在的情况下默认显示 'en' 语言包 。默认值为 `document.documentElement.getAttribute('lang') || navigator.language || 'zh-cn'`
|
|
2295
3375
|
* @default -
|
|
2296
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
|
+
*/
|
|
2297
3381
|
lang?: Lang;
|
|
2298
3382
|
/** {zh}
|
|
2299
|
-
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }
|
|
3383
|
+
* @brief 为播放器设置自定义的多语言词典,可设置每个语种的词典,格式为 { texts: { [key: string]: Object; } }。
|
|
2300
3384
|
* 例如,{ texts: { 'zh-cn': { PIP: '画中画' }, en: { PIP: 'pip' } }} ,格式请参考[默认词典](https://www.volcengine.com/docs/6469/127529)。
|
|
2301
3385
|
* @default 无
|
|
2302
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
|
+
*/
|
|
2303
3391
|
i18n?: {
|
|
2304
3392
|
texts: Record<Lang, Record<string, string>>;
|
|
2305
3393
|
};
|
|
@@ -2308,6 +3396,11 @@ declare namespace strategy {
|
|
|
2308
3396
|
* @default { muted: true }
|
|
2309
3397
|
* @type {{ muted: boolean } | boolean}
|
|
2310
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
|
+
*/
|
|
2311
3404
|
autoplay?: {
|
|
2312
3405
|
muted?: boolean;
|
|
2313
3406
|
} | boolean;
|
|
@@ -2315,6 +3408,10 @@ declare namespace strategy {
|
|
|
2315
3408
|
* @brief 为播放器设置默认音量,取值范围 [0,1]。
|
|
2316
3409
|
* @default 0.6
|
|
2317
3410
|
*/
|
|
3411
|
+
/** {en}
|
|
3412
|
+
* @brief The default volume for the player. Valid range: [0,1].
|
|
3413
|
+
* @default 0.6
|
|
3414
|
+
*/
|
|
2318
3415
|
volume?: number;
|
|
2319
3416
|
/** {zh}
|
|
2320
3417
|
* @brief 为播放器设置是否显示画中画功能按钮。
|
|
@@ -2322,11 +3419,22 @@ declare namespace strategy {
|
|
|
2322
3419
|
* - `false`:不显示。
|
|
2323
3420
|
* @default false
|
|
2324
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
|
+
*/
|
|
2325
3428
|
pip?: boolean;
|
|
2326
|
-
/**{zh}
|
|
3429
|
+
/** {zh}
|
|
2327
3430
|
* @brief 为播放器设置是否显示全屏功能按钮,并进行全屏功能设置。
|
|
2328
3431
|
* - `true`:显示;
|
|
2329
3432
|
* - `false`:不显示。
|
|
3433
|
+
*/
|
|
3434
|
+
/** {en}
|
|
3435
|
+
* @brief Whether to display the full-screen button.
|
|
3436
|
+
* - `true`: Display;
|
|
3437
|
+
* - `false`: Do not display.
|
|
2330
3438
|
* @default -
|
|
2331
3439
|
*/
|
|
2332
3440
|
fullscreen?: boolean | Fullscreen;
|
|
@@ -2334,11 +3442,19 @@ declare namespace strategy {
|
|
|
2334
3442
|
* @brief 为播放器设置报错信息,支持配置播放异常时,播放器显示的异常文案、图片,以及是否提供刷新按钮等。
|
|
2335
3443
|
* @default -
|
|
2336
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
|
+
*/
|
|
2337
3449
|
error?: ErrorConfig;
|
|
2338
3450
|
/** {zh}
|
|
2339
3451
|
* @brief 为播放器设置清晰度的相关配置。
|
|
2340
3452
|
* @default -
|
|
2341
3453
|
*/
|
|
3454
|
+
/** {en}
|
|
3455
|
+
* @brief Resolution-related configurations.
|
|
3456
|
+
* @default -
|
|
3457
|
+
*/
|
|
2342
3458
|
definition?: DefinitionConfig;
|
|
2343
3459
|
/** {zh}
|
|
2344
3460
|
* @brief 为播放器设置是否显示控制栏。
|
|
@@ -2346,6 +3462,12 @@ declare namespace strategy {
|
|
|
2346
3462
|
* - `false`: 不显示
|
|
2347
3463
|
* @default true
|
|
2348
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
|
+
*/
|
|
2349
3471
|
controls?: boolean | {
|
|
2350
3472
|
[propName: string]: any;
|
|
2351
3473
|
};
|
|
@@ -2353,6 +3475,10 @@ declare namespace strategy {
|
|
|
2353
3475
|
* @brief 为播放器设置**清晰度选择**或**线路选择**时的**选择面板样式**,仅在移动端有效。
|
|
2354
3476
|
* @default 'bottom'
|
|
2355
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
|
+
*/
|
|
2356
3482
|
listType?: ListType;
|
|
2357
3483
|
/** {zh}
|
|
2358
3484
|
* @brief 为播放器设置是否启用内联播放模式。playsinline 属性是 HTML5 视频标签的一个属性,用于指定视频是否应在页面文档内播放。
|
|
@@ -2360,8 +3486,18 @@ declare namespace strategy {
|
|
|
2360
3486
|
* - `false`:停用,默认浏览器播放行为。
|
|
2361
3487
|
* 该配置项只在移动端生效,当取值为 true 的时候,会在初始化 video 或 audio 对象的时候,将 playsinline、webkit-playsinline、x5-playsinline 三个属性设置为 true,请参考 [New Policies for iOS](https://webkit.org/blog/6784/new-video-policies-for-ios/) 了解内联模式相关知识。
|
|
2362
3488
|
* @listtip
|
|
2363
|
-
* iOS 10 及以上系统 Safari
|
|
2364
|
-
* iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
3489
|
+
* - iOS 10 及以上系统 Safari 浏览器支持配置内联播放模式;
|
|
3490
|
+
* - iOS 10 以下系统 Safari 浏览器不支持配置内联播放模式 ,默认播放即进入系统全屏。
|
|
3491
|
+
* @default true
|
|
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.
|
|
2365
3501
|
* @default true
|
|
2366
3502
|
*/
|
|
2367
3503
|
playsinline?: boolean;
|
|
@@ -2369,6 +3505,9 @@ declare namespace strategy {
|
|
|
2369
3505
|
* @brief 为播放器设置 video 标签扩展属性,初始化时会设置在 videoElement 或 audioElement 对象上,请参考 [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement#properties) 查看其支持的属性配置。
|
|
2370
3506
|
* @default 无
|
|
2371
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
|
+
*/
|
|
2372
3511
|
videoAttributes?: {
|
|
2373
3512
|
[propName: string]: any;
|
|
2374
3513
|
};
|
|
@@ -2378,8 +3517,18 @@ declare namespace strategy {
|
|
|
2378
3517
|
* - `false`:停用
|
|
2379
3518
|
* @listtip
|
|
2380
3519
|
* 启用流式布局时:
|
|
2381
|
-
* 如果 `width` 和 `height` 是 `Number` 类型,则按照其数值计算播放器宽高比;
|
|
2382
|
-
* 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
3520
|
+
* - 如果 `width` 和 `height` 是 `Number` 类型,则按照其数值计算播放器宽高比;
|
|
3521
|
+
* - 如果 `width` 和 `height` 不是 `Number` 类型,默认使用 16:9 比例。
|
|
3522
|
+
* @default false
|
|
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.
|
|
2383
3532
|
* @default false
|
|
2384
3533
|
*/
|
|
2385
3534
|
fluid?: boolean;
|
|
@@ -2388,7 +3537,13 @@ declare namespace strategy {
|
|
|
2388
3537
|
* - `fixed`: 保持容器宽/高,不做适配;
|
|
2389
3538
|
* - `fixWidth`: 保持容器宽度,适配高度;
|
|
2390
3539
|
* - `fixHeight`: 保持容器高度,适配宽度。
|
|
2391
|
-
*
|
|
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.
|
|
2392
3547
|
* @default 'fixed'
|
|
2393
3548
|
*/
|
|
2394
3549
|
fitVideoSize?: "fixWidth" | "fixHeight" | "fixed";
|
|
@@ -2401,6 +3556,15 @@ declare namespace strategy {
|
|
|
2401
3556
|
* - `auto`: 使用浏览器默认的视频画面填充模式。
|
|
2402
3557
|
* @default 'auto'
|
|
2403
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
|
+
*/
|
|
2404
3568
|
videoFillMode?: "auto" | "fillHeight" | "fillWidth" | "fill" | "cover";
|
|
2405
3569
|
/** {zh}
|
|
2406
3570
|
* @brief 是否开启画面和控制栏分离模式。设置为开启时,控制栏将会常驻,与视频画面不重叠。
|
|
@@ -2408,11 +3572,20 @@ declare namespace strategy {
|
|
|
2408
3572
|
* - `false`:关闭
|
|
2409
3573
|
* @default false
|
|
2410
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
|
+
*/
|
|
2411
3581
|
marginControls?: boolean;
|
|
2412
3582
|
/** {zh}
|
|
2413
3583
|
* @brief 启用微信同层播放。
|
|
2414
3584
|
* @default 无
|
|
2415
3585
|
*/
|
|
3586
|
+
/** {en}
|
|
3587
|
+
* @brief Enable playing the video on the same player as WeChat.
|
|
3588
|
+
*/
|
|
2416
3589
|
"x5-video-player-type"?: string;
|
|
2417
3590
|
/** {zh}
|
|
2418
3591
|
* @brief 是否启用微信全屏播放模式。
|
|
@@ -2420,6 +3593,11 @@ declare namespace strategy {
|
|
|
2420
3593
|
* - `false`:停用
|
|
2421
3594
|
* @default 无
|
|
2422
3595
|
*/
|
|
3596
|
+
/** {en}
|
|
3597
|
+
* @brief Whether to enable full-screen playback in WeChat.
|
|
3598
|
+
* - `true`: Enable
|
|
3599
|
+
* - `false`: Disable
|
|
3600
|
+
*/
|
|
2423
3601
|
"x5-video-player-fullscreen"?: boolean;
|
|
2424
3602
|
/** {zh}
|
|
2425
3603
|
* @brief 微信横竖屏控制,支持如下取值:
|
|
@@ -2428,52 +3606,99 @@ declare namespace strategy {
|
|
|
2428
3606
|
* - `landscape|portrait`:跟随手机自动旋转
|
|
2429
3607
|
* @default 无
|
|
2430
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
|
+
*/
|
|
2431
3615
|
"x5-video-orientation"?: "landscape" | "portrait" | "landscape|portrait";
|
|
2432
3616
|
/** {zh}
|
|
2433
3617
|
* @brief 为播放器配置关键点样式。
|
|
2434
3618
|
* @default 无
|
|
2435
3619
|
* @hidden 直播目前没用到
|
|
2436
3620
|
*/
|
|
3621
|
+
/** {en}
|
|
3622
|
+
* @brief Configures the keypoint style for the player.
|
|
3623
|
+
* @hidden
|
|
3624
|
+
*/
|
|
2437
3625
|
commonStyle?: CommonStyle;
|
|
2438
3626
|
/** {zh}
|
|
2439
3627
|
* @brief 自定义插件列表。
|
|
2440
3628
|
* @default 无
|
|
2441
3629
|
*/
|
|
3630
|
+
/** {en}
|
|
3631
|
+
* @brief A list of custom plugins.
|
|
3632
|
+
*/
|
|
2442
3633
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2443
3634
|
plugins?: any[];
|
|
2444
3635
|
/** {zh}
|
|
2445
3636
|
* @hidden
|
|
2446
3637
|
*/
|
|
3638
|
+
/** {en}
|
|
3639
|
+
* @hidden
|
|
3640
|
+
*/
|
|
2447
3641
|
preparePlugins?: PreparePlugins;
|
|
2448
3642
|
}
|
|
2449
|
-
/**
|
|
3643
|
+
/** {zh}
|
|
3644
|
+
* @list option
|
|
3645
|
+
* @kind property
|
|
3646
|
+
*/
|
|
3647
|
+
/** {en}
|
|
2450
3648
|
* @list option
|
|
2451
3649
|
* @kind property
|
|
2452
3650
|
*/
|
|
2453
3651
|
interface Fullscreen {
|
|
2454
3652
|
/** {zh}
|
|
2455
3653
|
* @brief 切换全屏时,是否旋转为横屏播放,通常在移动端使用。如果开启横屏播放,切换全屏时,将在竖屏状态下把播放器旋转 90 度,实现横屏效果。该配置优先级高于 useCssFullscreen。
|
|
2456
|
-
* `true`:使用旋转横屏;
|
|
2457
|
-
* `false`:不使用旋转横屏。
|
|
3654
|
+
* - `true`:使用旋转横屏;
|
|
3655
|
+
* - `false`:不使用旋转横屏。
|
|
3656
|
+
* @default false
|
|
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.
|
|
2458
3662
|
* @default false
|
|
2459
3663
|
*/
|
|
2460
3664
|
rotateFullscreen?: boolean;
|
|
2461
3665
|
/** {zh}
|
|
2462
3666
|
* @brief 是否使用页面全屏代替系统全屏功能。
|
|
2463
|
-
* `true`:页面全屏;
|
|
2464
|
-
* `false`:系统全屏。
|
|
3667
|
+
* - `true`:页面全屏;
|
|
3668
|
+
* - `false`:系统全屏。
|
|
3669
|
+
* @default false
|
|
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.
|
|
2465
3675
|
* @default false
|
|
2466
3676
|
*/
|
|
2467
3677
|
useCssFullscreen?: boolean;
|
|
2468
|
-
/**{zh}
|
|
3678
|
+
/** {zh}
|
|
2469
3679
|
* 全屏的时候是否显示右上角返回按钮,通常在移动端开启。
|
|
2470
|
-
* `true`:显示;
|
|
2471
|
-
* `false`:不显示。
|
|
3680
|
+
* - `true`:显示;
|
|
3681
|
+
* - `false`:不显示。
|
|
3682
|
+
* @default false
|
|
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.
|
|
2472
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.
|
|
2473
3693
|
*/
|
|
2474
3694
|
needBackIcon?: boolean;
|
|
2475
3695
|
}
|
|
2476
|
-
/**
|
|
3696
|
+
/** {zh}
|
|
3697
|
+
* @list option
|
|
3698
|
+
* @kind property
|
|
3699
|
+
* @hidden
|
|
3700
|
+
*/
|
|
3701
|
+
/** {en}
|
|
2477
3702
|
* @list option
|
|
2478
3703
|
* @kind property
|
|
2479
3704
|
* @hidden
|
|
@@ -2483,21 +3708,34 @@ declare namespace strategy {
|
|
|
2483
3708
|
* @brief 进度条底色
|
|
2484
3709
|
* @default 无
|
|
2485
3710
|
*/
|
|
3711
|
+
/** {en}
|
|
3712
|
+
* @brief The background color of the progress bar.
|
|
3713
|
+
*/
|
|
2486
3714
|
progressColor?: string;
|
|
2487
3715
|
/** {zh}
|
|
2488
3716
|
* @brief 播放完成部分进度条底色
|
|
2489
3717
|
* @default 无
|
|
2490
3718
|
*/
|
|
3719
|
+
/** {en}
|
|
3720
|
+
* @brief The background color of the progress bar for the completed portion of video playback.
|
|
3721
|
+
*/
|
|
2491
3722
|
playedColor?: string;
|
|
2492
3723
|
/** {zh}
|
|
2493
3724
|
* @brief 缓存部分进度条底色
|
|
2494
3725
|
* @default 无
|
|
2495
3726
|
*/
|
|
3727
|
+
/** {en}
|
|
3728
|
+
* @brief
|
|
3729
|
+
* @brief The background color of the progress bar for the cached portion of video playback.
|
|
3730
|
+
*/
|
|
2496
3731
|
cachedColor?: string;
|
|
2497
3732
|
/** {zh}
|
|
2498
3733
|
* @brief 进度条滑块样式
|
|
2499
3734
|
* @default 无
|
|
2500
3735
|
*/
|
|
3736
|
+
/** {en}
|
|
3737
|
+
* @brief The style of the progress bar slider.
|
|
3738
|
+
*/
|
|
2501
3739
|
sliderBtnStyle?: {
|
|
2502
3740
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2503
3741
|
[propName: string]: any;
|
|
@@ -2506,6 +3744,9 @@ declare namespace strategy {
|
|
|
2506
3744
|
* @brief 音量颜色
|
|
2507
3745
|
* @default 无
|
|
2508
3746
|
*/
|
|
3747
|
+
/** {en}
|
|
3748
|
+
* @brief The color of the volume slider.
|
|
3749
|
+
*/
|
|
2509
3750
|
volumeColor?: string;
|
|
2510
3751
|
}
|
|
2511
3752
|
type PrepareResult = {
|
|
@@ -2514,60 +3755,80 @@ declare namespace strategy {
|
|
|
2514
3755
|
plugins?: any[];
|
|
2515
3756
|
};
|
|
2516
3757
|
type PreparePlugins = (url: string) => Promise<PrepareResult> | undefined;
|
|
2517
|
-
/**
|
|
3758
|
+
/** {zh}
|
|
2518
3759
|
* @detail option
|
|
2519
3760
|
* @brief 视频的实际编码格式。如果您在degradation 设置了 SoftFirst 属性(即硬解不支持降级软解),建议您传入该参数,省去探测实际编码格式的操作。
|
|
2520
3761
|
*/
|
|
3762
|
+
/** {en}
|
|
3763
|
+
* @detail option
|
|
3764
|
+
* @brief The actual codec of the video.
|
|
3765
|
+
*/
|
|
2521
3766
|
enum Codec {
|
|
2522
3767
|
/** {zh}
|
|
2523
|
-
* @brief
|
|
3768
|
+
* @brief H.265 编码格式
|
|
3769
|
+
*/
|
|
3770
|
+
/** {en}
|
|
3771
|
+
* @brief H.265.
|
|
2524
3772
|
*/
|
|
2525
3773
|
H265 = "h265",
|
|
2526
3774
|
/** {zh}
|
|
2527
|
-
* @brief
|
|
3775
|
+
* @brief H.264 编码格式
|
|
3776
|
+
*/
|
|
3777
|
+
/** {en}
|
|
3778
|
+
* @brief H.264.
|
|
2528
3779
|
*/
|
|
2529
3780
|
H264 = "h264"
|
|
2530
3781
|
}
|
|
2531
|
-
/**
|
|
3782
|
+
/** {zh}
|
|
2532
3783
|
* @detail option
|
|
2533
3784
|
* @brief 是否开启 H.265 兼容模式。在 H.265 兼容模式下,播放器会优先使用硬解来解码 H.265 直播流。如果设备或浏览器不支持 H.265 硬解,则自动降级为 H.265 软解。
|
|
2534
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
|
+
*/
|
|
2535
3790
|
enum Degradation {
|
|
2536
3791
|
/** {zh}
|
|
2537
3792
|
* @brief 硬解不支持降级到软解
|
|
2538
3793
|
*/
|
|
3794
|
+
/** {en}
|
|
3795
|
+
* @brief The player does not support falling back to software decoding.
|
|
3796
|
+
*/
|
|
2539
3797
|
SoftFirst = "soft-first",
|
|
2540
3798
|
/** {zh}
|
|
2541
3799
|
* @brief 硬解不支持降级到h264
|
|
2542
3800
|
* @hidden
|
|
2543
3801
|
*/
|
|
3802
|
+
/** {en}
|
|
3803
|
+
* @brief The player does not support falling back to H.264.
|
|
3804
|
+
* @hidden
|
|
3805
|
+
*/
|
|
2544
3806
|
H264First = "h264-first"
|
|
2545
3807
|
}
|
|
2546
|
-
/**
|
|
3808
|
+
/** {zh}
|
|
2547
3809
|
* @detail option
|
|
2548
3810
|
* @brief 解码方式。
|
|
2549
3811
|
* @example
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
*
|
|
2553
|
-
*
|
|
2554
|
-
*
|
|
2555
|
-
* veplayer.on(VePlayer.live.Events.CANPLAY, function () {
|
|
2556
|
-
* console.log('监听到 canplay 事件')
|
|
2557
|
-
* });
|
|
2558
|
-
* }).catch(error => {
|
|
2559
|
-
* console.log('创建播放器失败,报错信息:', error);
|
|
2560
|
-
* });;
|
|
2561
|
-
* ```
|
|
3812
|
+
*/
|
|
3813
|
+
/** {en}
|
|
3814
|
+
* @detail option
|
|
3815
|
+
* @brief Decoding method.
|
|
3816
|
+
* @example
|
|
2562
3817
|
*/
|
|
2563
3818
|
enum DecodeType {
|
|
2564
3819
|
/** {zh}
|
|
2565
3820
|
* @brief 软解
|
|
2566
3821
|
*/
|
|
3822
|
+
/** {en}
|
|
3823
|
+
* @brief Software decoding.
|
|
3824
|
+
*/
|
|
2567
3825
|
Software = "software",
|
|
2568
3826
|
/** {zh}
|
|
2569
3827
|
* @brief 硬解
|
|
2570
3828
|
*/
|
|
3829
|
+
/** {en}
|
|
3830
|
+
* @brief Hardware decoding.
|
|
3831
|
+
*/
|
|
2571
3832
|
Hardware = "hardware"
|
|
2572
3833
|
}
|
|
2573
3834
|
/// <reference types="./loader" />
|
|
@@ -2580,6 +3841,7 @@ declare namespace strategy {
|
|
|
2580
3841
|
readonly "plugin:shaka": "veplayer.plugin.shaka.[env].[ext]";
|
|
2581
3842
|
readonly "plugin:rtm": "veplayer.plugin.rtm.[env].[ext]";
|
|
2582
3843
|
readonly "plugin:xgvideo": "veplayer.plugin.xgvideo.[env].[ext]";
|
|
3844
|
+
readonly "plugin:drm": "veplayer.plugin.drm.[env].[ext]";
|
|
2583
3845
|
};
|
|
2584
3846
|
const enum State {
|
|
2585
3847
|
Fetching = 0,
|
|
@@ -2608,7 +3870,8 @@ declare namespace strategy {
|
|
|
2608
3870
|
PluginHls = "plugin:hls",
|
|
2609
3871
|
PluginShaka = "plugin:shaka",
|
|
2610
3872
|
PluginRtm = "plugin:rtm",
|
|
2611
|
-
PluginXgvideo = "plugin:xgvideo"
|
|
3873
|
+
PluginXgvideo = "plugin:xgvideo",
|
|
3874
|
+
PluginDrm = "plugin:drm"
|
|
2612
3875
|
}
|
|
2613
3876
|
type ModulesMap = {
|
|
2614
3877
|
[DynamicModule.BizVod]: Exports;
|
|
@@ -2619,6 +3882,7 @@ declare namespace strategy {
|
|
|
2619
3882
|
[DynamicModule.PluginShaka]: Exports;
|
|
2620
3883
|
[DynamicModule.PluginRtm]: Exports;
|
|
2621
3884
|
[DynamicModule.PluginXgvideo]: Exports;
|
|
3885
|
+
[DynamicModule.PluginDrm]: Exports;
|
|
2622
3886
|
};
|
|
2623
3887
|
class Loader {
|
|
2624
3888
|
readonly modules: Record<string, Module>;
|
|
@@ -2631,14 +3895,20 @@ declare namespace strategy {
|
|
|
2631
3895
|
setModuleSystem(moduleSystem: ModuleSystem): void;
|
|
2632
3896
|
setBaseUrl(url: string): void;
|
|
2633
3897
|
load: <T extends DynamicModule>(name: T, src?: string) => Promise<ModulesMap[T]>;
|
|
2634
|
-
|
|
3898
|
+
registerPlugin: (name: string, exports: Exports) => Exports;
|
|
3899
|
+
register: (exports: Exports[]) => Exports[];
|
|
2635
3900
|
private _mount;
|
|
2636
3901
|
}
|
|
2637
|
-
const
|
|
3902
|
+
const registerPlugin: (name: string, exports: {
|
|
2638
3903
|
[x: string]: any;
|
|
2639
3904
|
}) => {
|
|
2640
3905
|
[x: string]: any;
|
|
2641
3906
|
};
|
|
3907
|
+
const register: (exports: {
|
|
3908
|
+
[x: string]: any;
|
|
3909
|
+
}[]) => {
|
|
3910
|
+
[x: string]: any;
|
|
3911
|
+
}[];
|
|
2642
3912
|
function setModuleSystem(moduleSystem: ModuleSystem): void;
|
|
2643
3913
|
function setBaseUrl(url: string): void;
|
|
2644
3914
|
function getBaseUrl(): string;
|
|
@@ -2689,6 +3959,7 @@ declare namespace error {
|
|
|
2689
3959
|
MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
|
|
2690
3960
|
MEDIA_ERR_URL_EMPTY: string;
|
|
2691
3961
|
DRM: string;
|
|
3962
|
+
DRM_LICENSE: string;
|
|
2692
3963
|
OTHER: string;
|
|
2693
3964
|
RUNTIME: string;
|
|
2694
3965
|
MODULE_LOAD_ERROR: string;
|
|
@@ -2748,6 +4019,7 @@ declare namespace error {
|
|
|
2748
4019
|
MEDIA_ERR_CODEC_NOT_SUPPORTED: string;
|
|
2749
4020
|
MEDIA_ERR_URL_EMPTY: string;
|
|
2750
4021
|
DRM: string;
|
|
4022
|
+
DRM_LICENSE: string;
|
|
2751
4023
|
OTHER: string;
|
|
2752
4024
|
RUNTIME: string;
|
|
2753
4025
|
MODULE_LOAD_ERROR: string;
|
|
@@ -2809,203 +4081,363 @@ declare namespace error {
|
|
|
2809
4081
|
normalize(text?: string | Record<Lang, string>): string;
|
|
2810
4082
|
getText(textKey?: T | string): Record<string | T, string>[string | T] | undefined;
|
|
2811
4083
|
}
|
|
2812
|
-
/**
|
|
4084
|
+
/** {zh}
|
|
4085
|
+
* @detail error
|
|
4086
|
+
*/
|
|
4087
|
+
/** {en}
|
|
2813
4088
|
* @detail error
|
|
2814
4089
|
*/
|
|
2815
4090
|
enum Level {
|
|
2816
|
-
/**
|
|
4091
|
+
/** {zh}
|
|
2817
4092
|
* @brief 严重
|
|
2818
4093
|
*
|
|
2819
4094
|
*/
|
|
4095
|
+
/** {en}
|
|
4096
|
+
* @brief Fatal.
|
|
4097
|
+
*
|
|
4098
|
+
*/
|
|
2820
4099
|
Fatal = "Fatal",
|
|
2821
|
-
/**
|
|
4100
|
+
/** {zh}
|
|
2822
4101
|
* @brief 报错
|
|
2823
4102
|
*/
|
|
4103
|
+
/** {en}
|
|
4104
|
+
* @brief Error.
|
|
4105
|
+
*/
|
|
2824
4106
|
Error = "Error"
|
|
2825
4107
|
}
|
|
2826
4108
|
enum ErrorCode {
|
|
2827
|
-
/**
|
|
4109
|
+
/** {zh}
|
|
2828
4110
|
* @brief 视频解析错误
|
|
2829
4111
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2830
4112
|
*/
|
|
4113
|
+
/** {en}
|
|
4114
|
+
* @brief Video parsing error.
|
|
4115
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4116
|
+
*/
|
|
2831
4117
|
MANIFEST_HLS_ERROR = 1100,
|
|
2832
|
-
/**
|
|
4118
|
+
/** {zh}
|
|
2833
4119
|
* @brief 视频解析错误
|
|
2834
4120
|
* @solution 请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2835
4121
|
*/
|
|
4122
|
+
/** {en}
|
|
4123
|
+
* @brief Video parsing error.
|
|
4124
|
+
* @solution Please contact your [technical support](https://www.byteplus.com/en/support).
|
|
4125
|
+
*/
|
|
2836
4126
|
MANIFEST_DASH_ERROR = 1200,
|
|
2837
|
-
/**
|
|
4127
|
+
/** {zh}
|
|
2838
4128
|
* @brief 网络错误
|
|
2839
4129
|
* @solution 请检查当前网络环境或播放地址是否合法。
|
|
2840
4130
|
*/
|
|
4131
|
+
/** {en}
|
|
4132
|
+
* @brief Network error.
|
|
4133
|
+
* @solution Please check the current network environment and ensure the pull stream address is valid.
|
|
4134
|
+
*/
|
|
2841
4135
|
NETWORK = 2100,
|
|
2842
|
-
/**
|
|
4136
|
+
/** {zh}
|
|
2843
4137
|
* @brief 网络请求超时
|
|
2844
4138
|
* @solution 请检查拉流地址是否合法。
|
|
2845
4139
|
*/
|
|
4140
|
+
/** {en}
|
|
4141
|
+
* @brief Network request timed out
|
|
4142
|
+
* @solution Please check whether the pull stream address is valid.
|
|
4143
|
+
*/
|
|
2846
4144
|
NETWORK_TIMEOUT = 2101,
|
|
2847
|
-
/**
|
|
4145
|
+
/** {zh}
|
|
2848
4146
|
* @brief 网络请求 403
|
|
2849
4147
|
* @solution 请检查拉流地址鉴权信息。
|
|
2850
4148
|
*/
|
|
4149
|
+
/** {en}
|
|
4150
|
+
* @brief The player received a 403 response code.
|
|
4151
|
+
* @solution Check the authentication information in the pull stream address.
|
|
4152
|
+
*/
|
|
2851
4153
|
NETWORK_FORBIDDEN = 2103,
|
|
2852
|
-
/**
|
|
4154
|
+
/** {zh}
|
|
2853
4155
|
* @brief 网络请求 404
|
|
2854
4156
|
* @solution 请检查拉流地址是否合法。
|
|
2855
4157
|
*/
|
|
4158
|
+
/** {en}
|
|
4159
|
+
* @brief The player received a 404 response code.
|
|
4160
|
+
* @solution Check whether the pull stream address is valid.
|
|
4161
|
+
*/
|
|
2856
4162
|
NETWORK_NOTFOUND = 2104,
|
|
2857
|
-
/**
|
|
4163
|
+
/** {zh}
|
|
2858
4164
|
* @brief 网络请求 206
|
|
2859
4165
|
* @solution 请检查拉流地址是否合法。
|
|
2860
4166
|
*/
|
|
4167
|
+
/** {en}
|
|
4168
|
+
* @brief The player received a 206 response code.
|
|
4169
|
+
* @solution Check whether the pull stream address is valid.
|
|
4170
|
+
*/
|
|
2861
4171
|
NETWORK_RANGE_NOT_SATISFIABLE = 2116,
|
|
2862
|
-
/**
|
|
4172
|
+
/** {zh}
|
|
2863
4173
|
* @brief 视频解析错误
|
|
2864
4174
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2865
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
|
+
*/
|
|
2866
4180
|
DEMUX_FLV_ERROR = 3100,
|
|
2867
|
-
/**
|
|
4181
|
+
/** {zh}
|
|
2868
4182
|
* @brief 视频解析错误
|
|
2869
4183
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2870
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
|
+
*/
|
|
2871
4189
|
DEMUX_HLS_ERROR = 3200,
|
|
2872
|
-
/**
|
|
4190
|
+
/** {zh}
|
|
2873
4191
|
* @brief 视频解析错误
|
|
2874
4192
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2875
4193
|
*
|
|
2876
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
|
+
*/
|
|
2877
4200
|
DEMUX_MP4_ERROR = 3300,
|
|
2878
|
-
/**
|
|
4201
|
+
/** {zh}
|
|
2879
4202
|
* @brief 视频解析错误
|
|
2880
4203
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2881
4204
|
*
|
|
2882
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
|
+
*/
|
|
2883
4211
|
DEMUX_FMP4_ERROR = 3400,
|
|
2884
|
-
/**
|
|
4212
|
+
/** {zh}
|
|
2885
4213
|
* @brief 视频解析错误
|
|
2886
4214
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2887
4215
|
*
|
|
2888
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
|
+
*/
|
|
2889
4222
|
DEMUX_SIDX_ERROR = 3410,
|
|
2890
|
-
/**
|
|
4223
|
+
/** {zh}
|
|
2891
4224
|
* @brief 视频解析错误
|
|
2892
4225
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2893
4226
|
*
|
|
2894
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
|
+
*/
|
|
2895
4233
|
REMUX_FMP4_ERROR = 4100,
|
|
2896
|
-
/**
|
|
4234
|
+
/** {zh}
|
|
2897
4235
|
* @brief 视频解析错误
|
|
2898
4236
|
* @solution 请检查拉流地址是否合法或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2899
4237
|
*
|
|
2900
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
|
+
*/
|
|
2901
4244
|
REMUX_MP4_ERROR = 4200,
|
|
2902
|
-
/**
|
|
4245
|
+
/** {zh}
|
|
2903
4246
|
* @brief 获取数据过程被中止
|
|
2904
4247
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
2905
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
|
+
*/
|
|
2906
4253
|
MEDIA_ERR_ABORTED = 5101,
|
|
2907
|
-
/**
|
|
4254
|
+
/** {zh}
|
|
2908
4255
|
* @brief 网络发生错误,无法成功获取媒体文件
|
|
2909
4256
|
* @solution 请检查浏览器网络请求是否正常,再尝试重新拉流。
|
|
2910
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
|
+
*/
|
|
2911
4262
|
MEDIA_ERR_NETWORK = 5102,
|
|
2912
|
-
/**
|
|
4263
|
+
/** {zh}
|
|
2913
4264
|
* @brief 浏览器在解码媒体资源时发生错误
|
|
2914
4265
|
* @solution
|
|
2915
4266
|
* 1. 请检查原始视频是否正常;
|
|
2916
4267
|
* 2. 重新进行转码和播放;
|
|
2917
4268
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2918
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
|
+
*/
|
|
2919
4277
|
MEDIA_ERR_DECODE = 5103,
|
|
2920
|
-
/**
|
|
4278
|
+
/** {zh}
|
|
2921
4279
|
* @brief 因视频格式不支持、服务器或网络的问题造成视频无法加载
|
|
2922
4280
|
* @solution
|
|
2923
4281
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
2924
4282
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
2925
4283
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2926
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
|
+
*/
|
|
2927
4292
|
MEDIA_ERR_SRC_NOT_SUPPORTED = 5104,
|
|
2928
|
-
/**
|
|
4293
|
+
/** {zh}
|
|
2929
4294
|
* @brief 当前浏览器不支持视频解码
|
|
2930
4295
|
* @solution
|
|
2931
4296
|
* 1. 检查浏览器视频数据请求是否正常;
|
|
2932
4297
|
* 2. 检查浏览器和页面环境是否支持要播放的视频格式;
|
|
2933
4298
|
* 3. 如仍未解决请联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2934
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
|
+
*/
|
|
2935
4307
|
MEDIA_ERR_CODEC_NOT_SUPPORTED = 5105,
|
|
2936
|
-
/**
|
|
4308
|
+
/** {zh}
|
|
2937
4309
|
* @brief 当前播放地址为空
|
|
2938
4310
|
* @solution 请检查必要参数 `url` 或 `playlist` 是否传入。
|
|
2939
4311
|
*/
|
|
4312
|
+
/** {en}
|
|
4313
|
+
* @brief The current pull stream address is empty.
|
|
4314
|
+
* @solution Check whether 'url' or 'playlist' is specified.
|
|
4315
|
+
*/
|
|
2940
4316
|
MEDIA_ERR_URL_EMPTY = 5106,
|
|
2941
|
-
/**
|
|
4317
|
+
/** {zh}
|
|
2942
4318
|
* @brief 播放异常
|
|
2943
4319
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2944
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
|
+
*/
|
|
2945
4325
|
MEDIA_MSE_ADD_SB = 5200,
|
|
2946
|
-
/**
|
|
4326
|
+
/** {zh}
|
|
2947
4327
|
* @brief 播放异常
|
|
2948
4328
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2949
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
|
+
*/
|
|
2950
4334
|
MEDIA_MSE_APPEND_BUFFER = 5201,
|
|
2951
|
-
/**
|
|
4335
|
+
/** {zh}
|
|
2952
4336
|
* @brief 播放异常
|
|
2953
4337
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2954
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
|
+
*/
|
|
2955
4343
|
MEDIA_MSE_OTHER = 5202,
|
|
2956
|
-
/**
|
|
4344
|
+
/** {zh}
|
|
2957
4345
|
* @brief 播放异常
|
|
2958
4346
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2959
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
|
+
*/
|
|
2960
4352
|
MEDIA_MSE_FULL = 5203,
|
|
2961
|
-
/**
|
|
4353
|
+
/** {zh}
|
|
2962
4354
|
* @brief 播放异常
|
|
2963
4355
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2964
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
|
+
*/
|
|
2965
4361
|
MEDIA_MSE_HIJACK = 5204,
|
|
2966
|
-
/**
|
|
4362
|
+
/** {zh}
|
|
2967
4363
|
* @brief 播放异常
|
|
2968
4364
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2969
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
|
+
*/
|
|
2970
4370
|
MEDIA_EME_HIJACK = 5301,
|
|
2971
|
-
/**
|
|
4371
|
+
/** {zh}
|
|
2972
4372
|
* @brief DRM 权限校验失败
|
|
2973
4373
|
* @hidden
|
|
2974
4374
|
*/
|
|
4375
|
+
/** {en}
|
|
4376
|
+
* @brief DRM authentication failed.
|
|
4377
|
+
* @hidden
|
|
4378
|
+
*/
|
|
2975
4379
|
DRM_LICENSE = 7100,
|
|
2976
|
-
/**
|
|
4380
|
+
/** {zh}
|
|
2977
4381
|
* @brief DRM 权限校验失败
|
|
2978
4382
|
* @hidden
|
|
2979
4383
|
*/
|
|
4384
|
+
/** {en}
|
|
4385
|
+
* @brief DRM authentication failed.
|
|
4386
|
+
* @hidden
|
|
4387
|
+
*/
|
|
2980
4388
|
DRM_CUSTOM_LICENSE = 7200,
|
|
2981
|
-
/**
|
|
4389
|
+
/** {zh}
|
|
2982
4390
|
* @brief 播放异常
|
|
2983
4391
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2984
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
|
+
*/
|
|
2985
4397
|
OTHER = 8000,
|
|
2986
|
-
/**
|
|
4398
|
+
/** {zh}
|
|
2987
4399
|
* @brief 播放异常
|
|
2988
4400
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2989
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
|
+
*/
|
|
2990
4406
|
RUNTIME_NO_CANPLAY_ERROR = 9001,
|
|
2991
|
-
/**
|
|
4407
|
+
/** {zh}
|
|
2992
4408
|
* @brief 播放异常
|
|
2993
4409
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2994
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
|
+
*/
|
|
2995
4415
|
RUNTIME_BUFFERBREAK_ERROR = 9002,
|
|
2996
|
-
/**
|
|
4416
|
+
/** {zh}
|
|
2997
4417
|
* @brief 播放异常
|
|
2998
4418
|
* @solution 请检查播放源或联系[技术支持](https://console.volcengine.com/workorder/create?step=2&SubProductID=P00000076)。
|
|
2999
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
|
+
*/
|
|
3000
4424
|
RUNTIME_BWAITING_TIMEOUT_ERROR = 9002,
|
|
3001
4425
|
// veplayer 报错
|
|
3002
|
-
/**
|
|
4426
|
+
/** {zh}
|
|
3003
4427
|
* @brief CDN 异步获取失败
|
|
3004
4428
|
* @solution 请刷新重试或者检查网络环境。
|
|
3005
4429
|
*
|
|
3006
4430
|
*/
|
|
4431
|
+
/** {en}
|
|
4432
|
+
* @brief CDN asynchronous fetch failed.
|
|
4433
|
+
* @solution Refresh the page or check the network environment.
|
|
4434
|
+
*
|
|
4435
|
+
*/
|
|
3007
4436
|
MODULE_LOAD_ERROR = 110,
|
|
3008
|
-
/**
|
|
4437
|
+
/** {zh}
|
|
4438
|
+
* @hidden
|
|
4439
|
+
*/
|
|
4440
|
+
/** {en}
|
|
3009
4441
|
* @hidden
|
|
3010
4442
|
*/
|
|
3011
4443
|
UNKNOWN = "UNKNOWN"
|
|
@@ -3031,37 +4463,63 @@ declare namespace error {
|
|
|
3031
4463
|
}
|
|
3032
4464
|
const ERROR_INFO: Partial<Record<ErrorCode, ErrorInfo>>;
|
|
3033
4465
|
const ERROR_TYPE_INFO: Record<ErrorType, ErrorInfo>;
|
|
3034
|
-
/**
|
|
4466
|
+
/** {zh}
|
|
4467
|
+
* @list error
|
|
4468
|
+
* @detail error
|
|
4469
|
+
* @brief 错误对象
|
|
4470
|
+
* @name VeError
|
|
4471
|
+
* @id VeError
|
|
4472
|
+
*/
|
|
4473
|
+
/** {en}
|
|
4474
|
+
* @list error
|
|
3035
4475
|
* @detail error
|
|
3036
|
-
* @
|
|
3037
|
-
* @
|
|
4476
|
+
* @brief The error object.
|
|
4477
|
+
* @name VeError
|
|
4478
|
+
* @id VeError
|
|
3038
4479
|
*/
|
|
3039
4480
|
class VeError<T extends string = TextKey> extends Error {
|
|
3040
4481
|
/**
|
|
3041
|
-
* @brief
|
|
4482
|
+
* @brief 错误码。
|
|
4483
|
+
*/
|
|
4484
|
+
/** {en}
|
|
4485
|
+
* @brief The error code.
|
|
3042
4486
|
*/
|
|
3043
4487
|
readonly errorCode: ErrorCode;
|
|
3044
|
-
/**
|
|
4488
|
+
/** {zh}
|
|
3045
4489
|
* @brief 错误等级。
|
|
3046
4490
|
*/
|
|
4491
|
+
/** {en}
|
|
4492
|
+
* @brief The error level.
|
|
4493
|
+
*/
|
|
3047
4494
|
readonly level?: Level;
|
|
3048
|
-
/**
|
|
4495
|
+
/** {zh}
|
|
3049
4496
|
* @brief 错误信息。
|
|
3050
4497
|
*/
|
|
4498
|
+
/** {en}
|
|
4499
|
+
* @brief The error message.
|
|
4500
|
+
*/
|
|
3051
4501
|
message: string;
|
|
3052
|
-
/**
|
|
4502
|
+
/** {zh}
|
|
3053
4503
|
* @brief 其他错误信息。
|
|
3054
4504
|
*/
|
|
4505
|
+
/** {en}
|
|
4506
|
+
* @brief Other error messages.
|
|
4507
|
+
*/
|
|
3055
4508
|
readonly ext?: any;
|
|
3056
|
-
/**
|
|
4509
|
+
/** {zh}
|
|
4510
|
+
* @hidden
|
|
4511
|
+
* @param error
|
|
4512
|
+
* @param i18n
|
|
4513
|
+
*/
|
|
4514
|
+
/** {en}
|
|
3057
4515
|
* @hidden
|
|
3058
4516
|
* @param error
|
|
3059
4517
|
* @param i18n
|
|
3060
4518
|
*/
|
|
3061
4519
|
constructor(error?: string | ErrorInfo<T>, i18n?: VeI18n<T>);
|
|
3062
4520
|
}
|
|
3063
|
-
function create(errorCode: ErrorCode, info?: ErrorInfo, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
|
|
3064
|
-
function transform(xgErr: XGError, i18n?: VeI18n): VeError<"DEFINITION_FALLBACK_TOAST" | "DEFINITION_SWITCHING" | "ERROR_REFRESH" | "UNMUTE" | "MANIFEST" | "NETWORK" | "NETWORK_TIMEOUT" | "NETWORK_FORBIDDEN" | "NETWORK_NOTFOUND" | "DEMUX" | "REMUX" | "MEDIA" | "MEDIA_ERR_CODEC_NOT_SUPPORTED" | "MEDIA_ERR_URL_EMPTY" | "DRM" | "OTHER" | "RUNTIME" | "MODULE_LOAD_ERROR" | "UNKNOWN" | "ERROR_TYPES" | "HAVE_NOTHING" | "HAVE_METADATA" | "HAVE_CURRENT_DATA" | "HAVE_FUTURE_DATA" | "HAVE_ENOUGH_DATA" | "NETWORK_EMPTY" | "NETWORK_IDLE" | "NETWORK_LOADING" | "NETWORK_NO_SOURCE" | "MEDIA_ERR_ABORTED" | "MEDIA_ERR_NETWORK" | "MEDIA_ERR_DECODE" | "MEDIA_ERR_SRC_NOT_SUPPORTED" | "REPLAY" | "ERROR" | "PLAY_TIPS" | "PAUSE_TIPS" | "PLAYNEXT_TIPS" | "DOWNLOAD_TIPS" | "ROTATE_TIPS" | "RELOAD_TIPS" | "FULLSCREEN_TIPS" | "EXITFULLSCREEN_TIPS" | "CSSFULLSCREEN_TIPS" | "EXITCSSFULLSCREEN_TIPS" | "TEXTTRACK" | "PIP" | "SCREENSHOT" | "LIVE" | "OFF" | "OPEN" | "MINI_DRAG" | "MINISCREEN" | "REFRESH_TIPS" | "REFRESH" | "FORWARD" | "LIVE_TIP">;
|
|
4521
|
+
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">;
|
|
4522
|
+
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">;
|
|
3065
4523
|
}
|
|
3066
4524
|
declare namespace event {
|
|
3067
4525
|
const BaseEvents: {
|