@volcengine/veplayer 2.3.0-rc.0 → 2.3.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +1681 -219
- package/esm/veplayer.biz.live.development.js +18 -1
- package/esm/veplayer.d.ts +3585 -494
- package/esm/veplayer.development.js +274 -54
- package/esm/veplayer.live.d.ts +3585 -494
- package/esm/veplayer.live.development.js +274 -54
- package/esm/veplayer.live.production.js +2 -2
- package/esm/veplayer.production.js +2 -2
- package/esm/veplayer.vod.d.ts +1681 -219
- package/esm/veplayer.vod.development.js +255 -52
- package/esm/veplayer.vod.production.js +1 -1
- package/package.json +1 -1
- package/umd/index.d.ts +1681 -219
- package/umd/veplayer.biz.live.development.js +18 -1
- package/umd/veplayer.d.ts +3585 -494
- package/umd/veplayer.development.js +274 -54
- package/umd/veplayer.live.d.ts +3585 -494
- package/umd/veplayer.live.development.js +274 -54
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +1681 -219
- package/umd/veplayer.vod.development.js +255 -52
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +3585 -494
- package/veplayer.live.d.ts +3585 -494
- package/veplayer.vod.d.ts +1681 -219
|
@@ -6619,7 +6619,12 @@ var __publicField = (obj, key, value) => {
|
|
|
6619
6619
|
}
|
|
6620
6620
|
};
|
|
6621
6621
|
let VeError$1 = class VeError extends Error {
|
|
6622
|
-
/**
|
|
6622
|
+
/** {zh}
|
|
6623
|
+
* @hidden
|
|
6624
|
+
* @param error
|
|
6625
|
+
* @param i18n
|
|
6626
|
+
*/
|
|
6627
|
+
/** {en}
|
|
6623
6628
|
* @hidden
|
|
6624
6629
|
* @param error
|
|
6625
6630
|
* @param i18n
|
|
@@ -6632,16 +6637,25 @@ var __publicField = (obj, key, value) => {
|
|
|
6632
6637
|
const message = (i18n == null ? void 0 : i18n.getText(errorInfo == null ? void 0 : errorInfo.messageTextKey)) ?? (errorInfo == null ? void 0 : errorInfo.message) ?? ((_a = errorInfo == null ? void 0 : errorInfo.error) == null ? void 0 : _a.message) ?? (i18n == null ? void 0 : i18n.getText("UNKNOWN"));
|
|
6633
6638
|
super(message);
|
|
6634
6639
|
/**
|
|
6635
|
-
* @brief
|
|
6640
|
+
* @brief 错误码。
|
|
6641
|
+
*/
|
|
6642
|
+
/** {en}
|
|
6643
|
+
* @brief The error code.
|
|
6636
6644
|
*/
|
|
6637
6645
|
__publicField(this, "errorCode");
|
|
6638
|
-
/**
|
|
6646
|
+
/** {zh}
|
|
6639
6647
|
* @brief 错误等级。
|
|
6640
6648
|
*/
|
|
6649
|
+
/** {en}
|
|
6650
|
+
* @brief The error level.
|
|
6651
|
+
*/
|
|
6641
6652
|
__publicField(this, "level");
|
|
6642
|
-
/**
|
|
6653
|
+
/** {zh}
|
|
6643
6654
|
* @brief 其他错误信息。
|
|
6644
6655
|
*/
|
|
6656
|
+
/** {en}
|
|
6657
|
+
* @brief Other error messages.
|
|
6658
|
+
*/
|
|
6645
6659
|
__publicField(this, "ext");
|
|
6646
6660
|
this.errorCode = (errorInfo == null ? void 0 : errorInfo.errorCode) ?? "UNKNOWN";
|
|
6647
6661
|
this.level = (errorInfo == null ? void 0 : errorInfo.level) ?? "Error";
|
|
@@ -13390,7 +13404,10 @@ var __publicField = (obj, key, value) => {
|
|
|
13390
13404
|
return xgOptions;
|
|
13391
13405
|
};
|
|
13392
13406
|
class VePlayerBase {
|
|
13393
|
-
/**
|
|
13407
|
+
/** {zh}
|
|
13408
|
+
* @hidden
|
|
13409
|
+
*/
|
|
13410
|
+
/** {en}
|
|
13394
13411
|
* @hidden
|
|
13395
13412
|
*/
|
|
13396
13413
|
constructor(options = {}) {
|
|
@@ -13443,7 +13460,7 @@ var __publicField = (obj, key, value) => {
|
|
|
13443
13460
|
this._errorCallback = (err) => this._handleFallback(err);
|
|
13444
13461
|
this._player.on(ERROR, this._errorCallback);
|
|
13445
13462
|
}
|
|
13446
|
-
/**
|
|
13463
|
+
/** {zh}
|
|
13447
13464
|
* @brief 获取视频的就绪状态,其状态枚举值、枚举名称和说明如下:
|
|
13448
13465
|
* - `0`:HAVE_NOTHING,没有关于媒体资源的可用信息
|
|
13449
13466
|
* - `1`:HAVE_METADATA,已检索到足够多的媒体资源来初始化元数据, 快进/快退不会引发异常
|
|
@@ -13451,68 +13468,107 @@ var __publicField = (obj, key, value) => {
|
|
|
13451
13468
|
* - `3`:HAVE_FUTURE_DATA,当前播放位置以及未来至少一小段时间的数据是可用的(至少有两帧以上的数据)
|
|
13452
13469
|
* - `4`:HAVE_ENOUGH_DATA,有足够的数据可用,并且下载速率足够,媒体可以不间断地播放到最后
|
|
13453
13470
|
*/
|
|
13471
|
+
/** {en}
|
|
13472
|
+
* @brief Gets the readiness of the video.
|
|
13473
|
+
* - `0`: HAVE_NOTHING, which means there is no information about the media resources.
|
|
13474
|
+
* - `1`: HAVE_METADATA, which means enough media resources have been retrieved to initialize the metadata and fast-forward/rewind will not raise an exception.
|
|
13475
|
+
* - `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.
|
|
13476
|
+
* - `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).
|
|
13477
|
+
* - `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.
|
|
13478
|
+
*/
|
|
13454
13479
|
get readyState() {
|
|
13455
13480
|
return this._player.readyState;
|
|
13456
13481
|
}
|
|
13457
|
-
/**
|
|
13482
|
+
/** {zh}
|
|
13458
13483
|
* @brief 获取当前已缓冲的时间范围。
|
|
13459
13484
|
*/
|
|
13485
|
+
/** {en}
|
|
13486
|
+
* @brief Gets the currently buffered time range.
|
|
13487
|
+
*/
|
|
13460
13488
|
get buffered() {
|
|
13461
13489
|
return this._player.buffered;
|
|
13462
13490
|
}
|
|
13463
|
-
/**
|
|
13491
|
+
/** {zh}
|
|
13464
13492
|
* @brief 获取已经播放的音频/视频的时间范围。
|
|
13465
13493
|
*/
|
|
13494
|
+
/** {en}
|
|
13495
|
+
* @brief Gets the time range of the audio/video that has been played.
|
|
13496
|
+
*/
|
|
13466
13497
|
get played() {
|
|
13467
13498
|
return this._player.played;
|
|
13468
13499
|
}
|
|
13469
|
-
/**
|
|
13500
|
+
/** {zh}
|
|
13470
13501
|
* @brief 设置/获取视频当前的播放时间, 单位为 s。
|
|
13471
13502
|
*/
|
|
13503
|
+
/** {en}
|
|
13504
|
+
* @brief Sets or gets the current playback position of the video, in seconds.
|
|
13505
|
+
*/
|
|
13472
13506
|
get cumulateTime() {
|
|
13473
13507
|
return this._player.cumulateTime;
|
|
13474
13508
|
}
|
|
13475
|
-
/**
|
|
13509
|
+
/** {zh}
|
|
13476
13510
|
* @brief 获取是否处于焦点状态,处于焦点状态会显示控制栏。
|
|
13477
13511
|
*/
|
|
13512
|
+
/** {en}
|
|
13513
|
+
* @brief Gets whether the player has focus. The control bar is displayed when the player has focus.
|
|
13514
|
+
*/
|
|
13478
13515
|
get isFocused() {
|
|
13479
13516
|
return this._player.isActive;
|
|
13480
13517
|
}
|
|
13481
|
-
/**
|
|
13518
|
+
/** {zh}
|
|
13482
13519
|
* @brief 获取播放器是否处于全屏状态。
|
|
13483
13520
|
*/
|
|
13521
|
+
/** {en}
|
|
13522
|
+
* @brief Gets whether the player is in full-screen mode, in which the player covers the entire desktop.
|
|
13523
|
+
*/
|
|
13484
13524
|
get isFullscreen() {
|
|
13485
13525
|
return this._player.isFullscreen;
|
|
13486
13526
|
}
|
|
13487
|
-
/**
|
|
13527
|
+
/** {zh}
|
|
13488
13528
|
* @brief 获取播放器是否处于网页全屏状态。
|
|
13489
13529
|
*/
|
|
13530
|
+
/** {en}
|
|
13531
|
+
* @brief Gets whether the player is in full-window mode, in which the player covers the entire browser window.
|
|
13532
|
+
*/
|
|
13490
13533
|
get isCssFullscreen() {
|
|
13491
13534
|
return this._player.isCssfullScreen;
|
|
13492
13535
|
}
|
|
13493
|
-
/**
|
|
13536
|
+
/** {zh}
|
|
13494
13537
|
* @brief 获取视频的网络状态,其状态枚举值、枚举名称和说明如下:
|
|
13495
13538
|
* - `0`:NETWORK_EMPTY,目前还没有数据,readyState 的值是 HAVE_NOTHING
|
|
13496
13539
|
* - `1`:NETWORK_IDLE,HTMLMediaElement 处于活动状态并已选择资源,但未使用网络
|
|
13497
13540
|
* - `2`:NETWORK_LOADING,浏览器正在下载 HTMLMediaElement 数据
|
|
13498
13541
|
* - `3`:NETWORK_NO_SOURCE,未找到 HTMLMediaElement src。
|
|
13499
13542
|
*/
|
|
13543
|
+
/** {en}
|
|
13544
|
+
* @brief Gets the network condition of the video.
|
|
13545
|
+
* - `0`: NETWORK_EMPTY, which means there is no data yet, and `readyState` is `HAVE_NOTHING`.
|
|
13546
|
+
* - `1`: NETWORK_IDLE, which means the `HTMLMediaElement` element is active and the resources have been selected, but the network is not in use.
|
|
13547
|
+
* - `2`: NETWORK_LOADING, which means the browser is downloading the data of the `HTMLMediaElement` element.
|
|
13548
|
+
* - `3`: NETWORK_NO_SOURCE, the media source is not found according to the `src` property of the `HTMLMediaElement` element.
|
|
13549
|
+
*/
|
|
13500
13550
|
get networkState() {
|
|
13501
13551
|
return this._player.networkState;
|
|
13502
13552
|
}
|
|
13503
|
-
/**
|
|
13553
|
+
/** {zh}
|
|
13504
13554
|
* @brief 获取当前视频是否处于暂停状态。
|
|
13505
13555
|
*/
|
|
13556
|
+
/** {en}
|
|
13557
|
+
* @brief Gets whether the current video is suspended.
|
|
13558
|
+
*/
|
|
13506
13559
|
get paused() {
|
|
13507
13560
|
return this._player.paused;
|
|
13508
13561
|
}
|
|
13509
|
-
/**
|
|
13562
|
+
/** {zh}
|
|
13510
13563
|
* @brief 获取当前视频是否播放结束。
|
|
13511
13564
|
*/
|
|
13565
|
+
/** {en}
|
|
13566
|
+
* @brief Gets whether the current video has finished playing.
|
|
13567
|
+
*/
|
|
13512
13568
|
get ended() {
|
|
13513
13569
|
return this._player.ended;
|
|
13514
13570
|
}
|
|
13515
|
-
/**
|
|
13571
|
+
/** {zh}
|
|
13516
13572
|
* @brief 获取播放器当前所处的状态,其状态枚举值、枚举名称和说明如下:
|
|
13517
13573
|
* - `0`:ERROR,播放出现错误
|
|
13518
13574
|
* - `1`:INITIAL,初始化
|
|
@@ -13524,81 +13580,130 @@ var __publicField = (obj, key, value) => {
|
|
|
13524
13580
|
* - `7`:ENDED,播放结束
|
|
13525
13581
|
* - `8`:DESTROYED,播放器实例处于已被销毁
|
|
13526
13582
|
*/
|
|
13583
|
+
/** {en}
|
|
13584
|
+
* @brief Gets the current state of the player.
|
|
13585
|
+
* - `0`: ERROR, which means a playback error occurred
|
|
13586
|
+
* - `1`: INITIAL, which means initialization
|
|
13587
|
+
* - `2`: READY, which means the configuration/event/plug-in has been initialized/bound/instantiated
|
|
13588
|
+
* - `3`: ATTACHING, which means the media object is being mounted.
|
|
13589
|
+
* - `4`: ATTACHED, which means the media object has been mounted in the DOM
|
|
13590
|
+
* - `5`: NOTALLOW, which means the playback is blocked
|
|
13591
|
+
* - `6`: RUNNING, which means the playback has started successfully
|
|
13592
|
+
* - `7`: ENDED, which means the playback has ended
|
|
13593
|
+
* - `8`: DESTROYED, which means the player instance is destroyed
|
|
13594
|
+
*/
|
|
13527
13595
|
get state() {
|
|
13528
13596
|
return this._player.state;
|
|
13529
13597
|
}
|
|
13530
|
-
/**
|
|
13598
|
+
/** {zh}
|
|
13531
13599
|
* 获取当前播放视频的拉流地址。
|
|
13532
13600
|
*/
|
|
13601
|
+
/** {en}
|
|
13602
|
+
* Gets the current pull stream address.
|
|
13603
|
+
*/
|
|
13533
13604
|
get url() {
|
|
13534
13605
|
return this._player.config.url;
|
|
13535
13606
|
}
|
|
13536
|
-
/**
|
|
13537
|
-
* @brief
|
|
13607
|
+
/** {zh}
|
|
13608
|
+
* @brief 获取当前播放视频的线路名称唯一标识(name)。
|
|
13609
|
+
*/
|
|
13610
|
+
/** {en}
|
|
13611
|
+
* @brief Gets the current playback source ID.
|
|
13538
13612
|
*/
|
|
13539
13613
|
get source() {
|
|
13540
13614
|
var _a;
|
|
13541
13615
|
return (_a = this._sourceManager.source) == null ? void 0 : _a.name;
|
|
13542
13616
|
}
|
|
13543
|
-
/**
|
|
13617
|
+
/** {zh}
|
|
13544
13618
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
13545
13619
|
*/
|
|
13620
|
+
/** {en}
|
|
13621
|
+
* @brief Gets the current resolution ID.
|
|
13622
|
+
*/
|
|
13546
13623
|
get definition() {
|
|
13547
13624
|
var _a;
|
|
13548
13625
|
return (_a = this._sourceManager.definition) == null ? void 0 : _a.definition;
|
|
13549
13626
|
}
|
|
13550
|
-
/**
|
|
13627
|
+
/** {zh}
|
|
13551
13628
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
13552
13629
|
*/
|
|
13630
|
+
/** {en}
|
|
13631
|
+
* @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).
|
|
13632
|
+
*/
|
|
13553
13633
|
get crossOrigin() {
|
|
13554
13634
|
return this._player.crossOrigin;
|
|
13555
13635
|
}
|
|
13556
|
-
/**
|
|
13636
|
+
/** {zh}
|
|
13557
13637
|
* @brief 获取和设置播放器的跨域配置信息,更多信息参考 [crossorigin](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) 属性介绍。
|
|
13558
13638
|
*/
|
|
13639
|
+
/** {en}
|
|
13640
|
+
* @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).
|
|
13641
|
+
*/
|
|
13559
13642
|
set crossOrigin(crossOrigin) {
|
|
13560
13643
|
this._player.crossOrigin = crossOrigin;
|
|
13561
13644
|
}
|
|
13562
|
-
/**
|
|
13645
|
+
/** {zh}
|
|
13563
13646
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
13564
13647
|
*/
|
|
13648
|
+
/** {en}
|
|
13649
|
+
* @brief Gets the volume of the video. The value range is [0,1].
|
|
13650
|
+
*/
|
|
13565
13651
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
13566
13652
|
get volume() {
|
|
13567
13653
|
return this._player.volume;
|
|
13568
13654
|
}
|
|
13569
|
-
/**
|
|
13655
|
+
/** {zh}
|
|
13570
13656
|
* @brief 获取和设置视频的音量,取值范围为 [0,1]。
|
|
13571
13657
|
*/
|
|
13658
|
+
/** {en}
|
|
13659
|
+
* @brief Sets the volume of the video. Valid range: [0,1].
|
|
13660
|
+
*/
|
|
13572
13661
|
set volume(volume) {
|
|
13573
13662
|
this._player.volume = volume;
|
|
13574
13663
|
}
|
|
13575
|
-
/**
|
|
13664
|
+
/** {zh}
|
|
13576
13665
|
* @brief 获取和设置视频静音状态。
|
|
13577
13666
|
* - `true`:静音
|
|
13578
13667
|
* - `false`:非静音
|
|
13579
13668
|
*/
|
|
13669
|
+
/** {en}
|
|
13670
|
+
* @brief Gets whether the video is muted.
|
|
13671
|
+
* - `true`: Muted.
|
|
13672
|
+
* - `false`: Not muted.
|
|
13673
|
+
*/
|
|
13580
13674
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
13581
13675
|
get muted() {
|
|
13582
13676
|
return this._player.muted;
|
|
13583
13677
|
}
|
|
13584
|
-
/**
|
|
13678
|
+
/** {zh}
|
|
13585
13679
|
* @brief 获取和设置视频静音状态。
|
|
13586
13680
|
* - `true`:静音
|
|
13587
13681
|
* - `false`:非静音
|
|
13588
13682
|
*/
|
|
13683
|
+
/** {en}
|
|
13684
|
+
* @brief Mute or unmute the video.
|
|
13685
|
+
* - `true`: Mute the video.
|
|
13686
|
+
* - `false`: Unmute the video.
|
|
13687
|
+
*/
|
|
13589
13688
|
set muted(isMuted) {
|
|
13590
13689
|
this._player.muted = isMuted;
|
|
13591
13690
|
}
|
|
13592
|
-
/**
|
|
13691
|
+
/** {zh}
|
|
13593
13692
|
* @brief 获取和设置当前语言。
|
|
13594
13693
|
*/
|
|
13694
|
+
/** {en}
|
|
13695
|
+
* @brief Gets the current language.
|
|
13696
|
+
*/
|
|
13595
13697
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
13596
13698
|
get lang() {
|
|
13597
13699
|
return this._i18nManager.getLang();
|
|
13598
13700
|
}
|
|
13599
|
-
/**
|
|
13701
|
+
/** {zh}
|
|
13600
13702
|
* @brief 获取和设置当前语言。
|
|
13601
13703
|
*/
|
|
13704
|
+
/** {en}
|
|
13705
|
+
* @brief Sets the current language.
|
|
13706
|
+
*/
|
|
13602
13707
|
set lang(lang) {
|
|
13603
13708
|
var _a, _b;
|
|
13604
13709
|
if (this._player.lang === lang) {
|
|
@@ -13620,7 +13725,10 @@ var __publicField = (obj, key, value) => {
|
|
|
13620
13725
|
get _src() {
|
|
13621
13726
|
return this._player.currentSrc;
|
|
13622
13727
|
}
|
|
13623
|
-
/**
|
|
13728
|
+
/** {zh}
|
|
13729
|
+
* @hidden
|
|
13730
|
+
*/
|
|
13731
|
+
/** {en}
|
|
13624
13732
|
* @hidden
|
|
13625
13733
|
*/
|
|
13626
13734
|
static async create(options = {}, Constructor) {
|
|
@@ -13650,11 +13758,16 @@ var __publicField = (obj, key, value) => {
|
|
|
13650
13758
|
sourceManager
|
|
13651
13759
|
});
|
|
13652
13760
|
}
|
|
13653
|
-
/**
|
|
13761
|
+
/** {zh}
|
|
13654
13762
|
* @brief 调用此方法切换拉流地址、线路、清晰度。
|
|
13655
13763
|
* @param target 目标地址,可以是播放地址,也可以是线路和清晰度
|
|
13656
13764
|
* @param options 更多配置信息
|
|
13657
13765
|
*/
|
|
13766
|
+
/** {en}
|
|
13767
|
+
* @brief Switches the pull stream address, playback source, or resolution.
|
|
13768
|
+
* @param target The target pull stream address, playback source, or resolution.
|
|
13769
|
+
* @param options More configurations.
|
|
13770
|
+
*/
|
|
13658
13771
|
async switch(target, options) {
|
|
13659
13772
|
var _a, _b;
|
|
13660
13773
|
if (typeof target === "string" && this._sourceManager.sources.length === 1 && ((_b = (_a = this._sourceManager.sources) == null ? void 0 : _a[0].definitions) == null ? void 0 : _b.length) === 1) {
|
|
@@ -13671,21 +13784,32 @@ var __publicField = (obj, key, value) => {
|
|
|
13671
13784
|
await this._switch(targetDefinition);
|
|
13672
13785
|
return targetDefinition;
|
|
13673
13786
|
}
|
|
13674
|
-
/**
|
|
13787
|
+
/** {zh}
|
|
13675
13788
|
* @brief 调用此方法更新拉流地址列表。
|
|
13676
13789
|
* @param playlist 要更新的播放列表。
|
|
13677
13790
|
* @param target 更新后默认播放的资源。
|
|
13678
13791
|
*/
|
|
13792
|
+
/** {en}
|
|
13793
|
+
* @brief Updates the list of pull stream addresses.
|
|
13794
|
+
* @param Playlist The updated list.
|
|
13795
|
+
* @param Target The default playback resource after the update.
|
|
13796
|
+
*/
|
|
13679
13797
|
updatePlaylist(playlist, target) {
|
|
13680
13798
|
const sourceManager = this._sourceManager.updateSources(playlist, target);
|
|
13681
13799
|
return this._switch(sourceManager.definition);
|
|
13682
13800
|
}
|
|
13683
13801
|
// TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
|
|
13684
13802
|
/**
|
|
13803
|
+
/** {zh}
|
|
13685
13804
|
* @brief 调用此方法监听指定事件,事件处理函数只执行一次。
|
|
13686
13805
|
* @param event 表示事件的名称。
|
|
13687
13806
|
* @param callback 表示事件的回调函数。
|
|
13688
13807
|
*/
|
|
13808
|
+
/** {en}
|
|
13809
|
+
* @brief Listens for a specified event. The event handler is executed only once.
|
|
13810
|
+
* @param event The event name.
|
|
13811
|
+
* @param callback The callback function for the event.
|
|
13812
|
+
*/
|
|
13689
13813
|
once(event, callback) {
|
|
13690
13814
|
var _a;
|
|
13691
13815
|
const { xgCallback, xgEventName } = this._transformEvent(event, callback);
|
|
@@ -13697,11 +13821,16 @@ var __publicField = (obj, key, value) => {
|
|
|
13697
13821
|
this._player.once(xgEventName, xgCallback);
|
|
13698
13822
|
}
|
|
13699
13823
|
}
|
|
13700
|
-
/**
|
|
13824
|
+
/** {zh}
|
|
13701
13825
|
* @brief 调用此方法解绑或移除指定事件的事件监听。
|
|
13702
13826
|
* @param event 表示事件的名称。
|
|
13703
13827
|
* @param callback 表示事件的回调函数。
|
|
13704
13828
|
*/
|
|
13829
|
+
/** {en}
|
|
13830
|
+
* @brief Stops listening for a specified event.
|
|
13831
|
+
* @param event The event name.
|
|
13832
|
+
* @param callback The callback function for the event.
|
|
13833
|
+
*/
|
|
13705
13834
|
off(event, callback) {
|
|
13706
13835
|
var _a;
|
|
13707
13836
|
const xgCallback = (_a = this._events[event]) == null ? void 0 : _a.get(callback);
|
|
@@ -13711,27 +13840,40 @@ var __publicField = (obj, key, value) => {
|
|
|
13711
13840
|
this._events[event].delete(callback);
|
|
13712
13841
|
}
|
|
13713
13842
|
}
|
|
13714
|
-
/**
|
|
13843
|
+
/** {zh}
|
|
13715
13844
|
* @brief 调用此方法触发指定事件。
|
|
13716
13845
|
* @param event 表示事件的名称。
|
|
13717
13846
|
* @param data 事件信息。
|
|
13718
13847
|
*/
|
|
13848
|
+
/** {en}
|
|
13849
|
+
* @brief Triggers a specified event.
|
|
13850
|
+
* @param event The event name.
|
|
13851
|
+
* @param data The event information.
|
|
13852
|
+
*/
|
|
13719
13853
|
emit(event, data) {
|
|
13720
13854
|
const { xgEventName } = this._transformEvent(event);
|
|
13721
13855
|
this._player.emit(xgEventName, data);
|
|
13722
13856
|
}
|
|
13723
|
-
/**
|
|
13857
|
+
/** {zh}
|
|
13724
13858
|
* @brief 调用此方法解绑或移除指定事件的所有事件监听。
|
|
13725
13859
|
*/
|
|
13860
|
+
/** {en}
|
|
13861
|
+
* @brief Stops listening to any player event.
|
|
13862
|
+
*/
|
|
13726
13863
|
offAll() {
|
|
13727
13864
|
this._events = {};
|
|
13728
13865
|
this._player.offAll();
|
|
13729
13866
|
}
|
|
13730
|
-
/**
|
|
13867
|
+
/** {zh}
|
|
13731
13868
|
* @brief 调用此方法监听指定事件。
|
|
13732
13869
|
* @param event 表示事件名称。
|
|
13733
13870
|
* @param callback 表示事件的回调函数。
|
|
13734
13871
|
*/
|
|
13872
|
+
/** {en}
|
|
13873
|
+
* @brief Listens for a specified event.
|
|
13874
|
+
* @param event The event name.
|
|
13875
|
+
* @param callback The callback function for the event.
|
|
13876
|
+
*/
|
|
13735
13877
|
on(event, callback) {
|
|
13736
13878
|
var _a;
|
|
13737
13879
|
const { xgCallback, xgEventName } = this._transformEvent(event, callback);
|
|
@@ -13743,102 +13885,153 @@ var __publicField = (obj, key, value) => {
|
|
|
13743
13885
|
this._player.on(xgEventName, xgCallback);
|
|
13744
13886
|
}
|
|
13745
13887
|
}
|
|
13746
|
-
/**
|
|
13888
|
+
/** {zh}
|
|
13747
13889
|
* @brief 调用此方法开始播放 。
|
|
13748
13890
|
*/
|
|
13891
|
+
/** {en}
|
|
13892
|
+
* @brief Starts playback.
|
|
13893
|
+
*/
|
|
13749
13894
|
play() {
|
|
13750
13895
|
/* istanbul ignore next -- @preserve */
|
|
13751
13896
|
return this._player.play();
|
|
13752
13897
|
}
|
|
13753
|
-
/**
|
|
13898
|
+
/** {zh}
|
|
13754
13899
|
* @brief 调用此方法暂停播放。
|
|
13755
13900
|
*/
|
|
13901
|
+
/** {en}
|
|
13902
|
+
* @brief Pauses playback.
|
|
13903
|
+
*/
|
|
13756
13904
|
pause() {
|
|
13757
13905
|
/* istanbul ignore next -- @preserve */
|
|
13758
13906
|
return this._player.pause();
|
|
13759
13907
|
}
|
|
13760
|
-
/**
|
|
13908
|
+
/** {zh}
|
|
13761
13909
|
* @brief 调用此方法打开画中画。
|
|
13762
13910
|
*/
|
|
13911
|
+
/** {en}
|
|
13912
|
+
* @brief Turns on Picture-in-Picture (PIP).
|
|
13913
|
+
*/
|
|
13763
13914
|
requestPIP() {
|
|
13764
13915
|
var _a;
|
|
13765
13916
|
/* istanbul ignore next -- @preserve */
|
|
13766
13917
|
(_a = this._player.plugins.pip) == null ? void 0 : _a.requestPIP();
|
|
13767
13918
|
}
|
|
13768
|
-
/**
|
|
13919
|
+
/** {zh}
|
|
13769
13920
|
* @brief 调用此方法关闭画中画。
|
|
13770
13921
|
*/
|
|
13922
|
+
/** {en}
|
|
13923
|
+
* @brief Turns off Picture-in-Picture (PIP).
|
|
13924
|
+
*/
|
|
13771
13925
|
exitPIP() {
|
|
13772
13926
|
var _a;
|
|
13773
13927
|
/* istanbul ignore next -- @preserve */
|
|
13774
13928
|
(_a = this._player.plugins.pip) == null ? void 0 : _a.exitPIP();
|
|
13775
13929
|
}
|
|
13776
|
-
/**
|
|
13930
|
+
/** {zh}
|
|
13777
13931
|
* @brief 调用此方法重新拉流。
|
|
13778
13932
|
*/
|
|
13933
|
+
/** {en}
|
|
13934
|
+
* @brief Retries stream-pulling.
|
|
13935
|
+
*/
|
|
13779
13936
|
retry() {
|
|
13780
13937
|
return this._player.retry();
|
|
13781
13938
|
}
|
|
13782
|
-
/**
|
|
13939
|
+
/** {zh}
|
|
13783
13940
|
* @brief 播放器获取焦点,调用该方法 `veplayer.isFocused` 将会变为 `true`,并触发 `PLAYER_FOCUS` 事件。
|
|
13784
13941
|
* @param data 播放器获取焦点配置信息。
|
|
13785
13942
|
*/
|
|
13943
|
+
/** {en}
|
|
13944
|
+
* @brief The player gets focus. When the method is called, `veplayer.isFocused` will become `true` and the `PLAYER_FOCUS` event will be triggered.
|
|
13945
|
+
* @param data Related configurations.
|
|
13946
|
+
*/
|
|
13786
13947
|
focus(data) {
|
|
13787
13948
|
return this._player.focus(data);
|
|
13788
13949
|
}
|
|
13789
|
-
/**
|
|
13950
|
+
/** {zh}
|
|
13790
13951
|
* @brief 播放器失去焦点,调用该方法 `veplayer.isFocused` 将会变为 `false`,并触发 `PLAYER_BLUR` 事件。
|
|
13791
13952
|
* @param data 播放器失去焦点配置信息。
|
|
13792
13953
|
*/
|
|
13954
|
+
/** {en}
|
|
13955
|
+
* @brief The player loses focus. When the method is called, `veplayer.isFocused` will become `false` and the `PLAYER_BLUR` event will be triggered.
|
|
13956
|
+
* @param data The related configurations.
|
|
13957
|
+
*/
|
|
13793
13958
|
blur(data) {
|
|
13794
13959
|
return this._player.blur(data);
|
|
13795
13960
|
}
|
|
13796
|
-
/**
|
|
13961
|
+
/** {zh}
|
|
13797
13962
|
* @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
|
|
13798
13963
|
* @param el 全屏作用的 DOM 节点。
|
|
13799
13964
|
*/
|
|
13965
|
+
/** {en}
|
|
13966
|
+
* @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.
|
|
13967
|
+
* @param el The DOM node in which the player is displayed in full-screen mode.
|
|
13968
|
+
*/
|
|
13800
13969
|
requestFullscreen(el) {
|
|
13801
13970
|
return this._player.getFullscreen(el);
|
|
13802
13971
|
}
|
|
13803
|
-
/**
|
|
13972
|
+
/** {zh}
|
|
13804
13973
|
* @brief 调用此方法退出系统全屏状态,调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.FULLSCREEN_CHANGE` 事件。
|
|
13805
13974
|
* @param el 全屏作用的 DOM 节点。
|
|
13806
13975
|
*/
|
|
13976
|
+
/** {en}
|
|
13977
|
+
* @brief Exits full-screen mode. After the method is called, `veplayer.isFullscreen` will become `false` and the `Events.FULLSCREEN_CHANGE` event will be triggered.
|
|
13978
|
+
* @param el The DOM node of the full screen effect.
|
|
13979
|
+
*/
|
|
13807
13980
|
exitFullscreen(el) {
|
|
13808
13981
|
return this._player.exitFullscreen(el);
|
|
13809
13982
|
}
|
|
13810
|
-
/**
|
|
13983
|
+
/** {zh}
|
|
13811
13984
|
* @brief 调用此方法进入网页样式全屏状态,播放器进入网页全屏,利用 CSS 模拟实现全屏效果。如果该接口调用的时候处于全屏状态,会自动退出全屏,下发事件 `Events.CSS_FULLSCREEN_CHANGE`。
|
|
13812
13985
|
* @param el 全屏作用的 DOM 节点。
|
|
13813
13986
|
*/
|
|
13987
|
+
/** {en}
|
|
13988
|
+
* @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.
|
|
13989
|
+
* @param el The DOM node in which the player is displayed in full-window mode.
|
|
13990
|
+
*/
|
|
13814
13991
|
requestCssFullscreen(el) {
|
|
13815
13992
|
return this._player.getCssFullscreen(el);
|
|
13816
13993
|
}
|
|
13817
|
-
/**
|
|
13994
|
+
/** {zh}
|
|
13818
13995
|
* @brief 调用此方法退出网页样式全屏状态。 调用该方法 `veplayer.isFullscreen` 将会变为 `false`,并触发 `Events.CSS_FULLSCREEN_CHANGE` 事件。
|
|
13819
13996
|
*/
|
|
13997
|
+
/** {en}
|
|
13998
|
+
* @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.
|
|
13999
|
+
*/
|
|
13820
14000
|
exitCssFullscreen() {
|
|
13821
14001
|
return this._player.exitCssFullscreen();
|
|
13822
14002
|
}
|
|
13823
|
-
/**
|
|
14003
|
+
/** {zh}
|
|
13824
14004
|
* @brief 调用此方法在当前播放器上注册指定插件。
|
|
13825
14005
|
* @param plugin 插件构造函数。
|
|
13826
14006
|
* @param config 插件的配置列表。
|
|
13827
14007
|
*/
|
|
14008
|
+
/** {en}
|
|
14009
|
+
* @brief Registers a specified plug-in to the current player.
|
|
14010
|
+
* @param Plugin The plugin constructor.
|
|
14011
|
+
* @param config The plugin configurations.
|
|
14012
|
+
*/
|
|
13828
14013
|
registerPlugin(plugin, config) {
|
|
13829
14014
|
return this._player.registerPlugin(plugin, config);
|
|
13830
14015
|
}
|
|
13831
|
-
/**
|
|
14016
|
+
/** {zh}
|
|
13832
14017
|
* @brief 调用此方法在当前播放器上销毁/注销指定插件。
|
|
13833
14018
|
* @param plugin 插件实例或者插件名称。
|
|
13834
14019
|
*/
|
|
14020
|
+
/** {en}
|
|
14021
|
+
* @brief Destroys or unregisters a specified plugin from the player.
|
|
14022
|
+
* @param Plugin The plugin instance or name.
|
|
14023
|
+
*/
|
|
13835
14024
|
unRegisterPlugin(plugin) {
|
|
13836
14025
|
return this._player.unRegisterPlugin(plugin);
|
|
13837
14026
|
}
|
|
13838
|
-
/**
|
|
14027
|
+
/** {zh}
|
|
13839
14028
|
* @brief 调用此接口显示指定插件图标。
|
|
13840
14029
|
* @param pluginNames 插件名称
|
|
13841
14030
|
*/
|
|
14031
|
+
/** {en}
|
|
14032
|
+
* @brief Displays the icon of a specified plugin.
|
|
14033
|
+
* @param PluginNames The plugin name.
|
|
14034
|
+
*/
|
|
13842
14035
|
showIcon(pluginNames) {
|
|
13843
14036
|
const morePlugin = this._player.getPlugin("more");
|
|
13844
14037
|
pluginNames.forEach((pluginName) => {
|
|
@@ -13852,10 +14045,14 @@ var __publicField = (obj, key, value) => {
|
|
|
13852
14045
|
}
|
|
13853
14046
|
});
|
|
13854
14047
|
}
|
|
13855
|
-
/**
|
|
14048
|
+
/** {zh}
|
|
13856
14049
|
* @brief 调用此接口隐藏指定插件图标。
|
|
13857
14050
|
* @param pluginNames 插件名称
|
|
13858
14051
|
*/
|
|
14052
|
+
/** {en}
|
|
14053
|
+
* @brief Hides the icon of a specified plugin.
|
|
14054
|
+
* @param PluginNames The plugin name.
|
|
14055
|
+
*/
|
|
13859
14056
|
hideIcon(pluginNames) {
|
|
13860
14057
|
const morePlugin = this._player.getPlugin("more");
|
|
13861
14058
|
pluginNames.forEach((pluginName) => {
|
|
@@ -13869,14 +14066,20 @@ var __publicField = (obj, key, value) => {
|
|
|
13869
14066
|
}
|
|
13870
14067
|
});
|
|
13871
14068
|
}
|
|
13872
|
-
/**
|
|
14069
|
+
/** {zh}
|
|
13873
14070
|
* @brief 调用此方法销毁播放器实例。
|
|
13874
14071
|
*/
|
|
14072
|
+
/** {en}
|
|
14073
|
+
* @brief Destroys the player instance.
|
|
14074
|
+
*/
|
|
13875
14075
|
destroy() {
|
|
13876
14076
|
this._player.off(ERROR, this._errorCallback);
|
|
13877
14077
|
this._player.destroy();
|
|
13878
14078
|
}
|
|
13879
|
-
/**
|
|
14079
|
+
/** {zh}
|
|
14080
|
+
* @hidden
|
|
14081
|
+
*/
|
|
14082
|
+
/** {en}
|
|
13880
14083
|
* @hidden
|
|
13881
14084
|
*/
|
|
13882
14085
|
async prepare(url) {
|
|
@@ -21590,7 +21793,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21590
21793
|
user_id: this._userId,
|
|
21591
21794
|
device_id: this._deviceId,
|
|
21592
21795
|
ext: {
|
|
21593
|
-
veplayer_version: "2.3.0-rc.
|
|
21796
|
+
veplayer_version: "2.3.0-rc.2",
|
|
21594
21797
|
flv_version: "3.0.12",
|
|
21595
21798
|
hls_version: "3.0.12",
|
|
21596
21799
|
rts_version: "0.2.0-alpha.5"
|
|
@@ -21906,7 +22109,11 @@ var __publicField = (obj, key, value) => {
|
|
|
21906
22109
|
return RTMCodec2;
|
|
21907
22110
|
})(RTMCodec || {});
|
|
21908
22111
|
class VePlayerLive extends VePlayerBase {
|
|
21909
|
-
/**
|
|
22112
|
+
/** {zh}
|
|
22113
|
+
* @hidden
|
|
22114
|
+
* @param options
|
|
22115
|
+
*/
|
|
22116
|
+
/** {en}
|
|
21910
22117
|
* @hidden
|
|
21911
22118
|
* @param options
|
|
21912
22119
|
*/
|
|
@@ -21916,6 +22123,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21916
22123
|
/** {zh}
|
|
21917
22124
|
* @brief 调用此方法开启直播日志上报。
|
|
21918
22125
|
*/
|
|
22126
|
+
/** {en}
|
|
22127
|
+
* @brief Enables log upload.
|
|
22128
|
+
*/
|
|
21919
22129
|
openLog() {
|
|
21920
22130
|
var _a;
|
|
21921
22131
|
(_a = this._player.plugins) == null ? void 0 : _a.logger.open();
|
|
@@ -21923,6 +22133,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21923
22133
|
/** {zh}
|
|
21924
22134
|
* @brief 调用此方法关闭直播日志上报。
|
|
21925
22135
|
*/
|
|
22136
|
+
/** {en}
|
|
22137
|
+
* @brief Disables log upload.
|
|
22138
|
+
*/
|
|
21926
22139
|
closeLog() {
|
|
21927
22140
|
var _a;
|
|
21928
22141
|
(_a = this._player.plugins) == null ? void 0 : _a.logger.close();
|
|
@@ -21930,6 +22143,9 @@ var __publicField = (obj, key, value) => {
|
|
|
21930
22143
|
/** {zh}
|
|
21931
22144
|
* @brief 调用此方法将打开直播信息面板,面板将展示拉流格式、帧率、码率、GOP、视频分辨率、编码方式、Buffer 水位、播放进度等基础信息。如果当前是软解,还会显示软解解码效率和解码消耗。
|
|
21932
22145
|
*/
|
|
22146
|
+
/** {en}
|
|
22147
|
+
* @brief Turns on the information panel, which displays basic information including stream format, frame rate, bitrate, GOP, video resolution, codec, buffer time, and playback progress. If software decoding is used, the software decoding efficiency and CPU consumption will also be displayed.
|
|
22148
|
+
*/
|
|
21933
22149
|
openInfoPanel() {
|
|
21934
22150
|
var _a;
|
|
21935
22151
|
(_a = this._player.plugins) == null ? void 0 : _a.infopanel.open();
|
|
@@ -21938,6 +22154,10 @@ var __publicField = (obj, key, value) => {
|
|
|
21938
22154
|
* @brief 调用此方法关闭直播信息面板。
|
|
21939
22155
|
*
|
|
21940
22156
|
*/
|
|
22157
|
+
/** {en}
|
|
22158
|
+
* @brief Turns off the information panel.
|
|
22159
|
+
*
|
|
22160
|
+
*/
|
|
21941
22161
|
closeInfoPanel() {
|
|
21942
22162
|
var _a;
|
|
21943
22163
|
(_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
|