@byteplus/veplayer 2.10.0 → 2.10.2-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.d.ts +2 -1
- package/esm/veplayer.biz.live.development.js +16367 -4259
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +20 -2
- package/esm/veplayer.development.js +11308 -5745
- package/esm/veplayer.live.d.ts +20 -2
- package/esm/veplayer.live.development.js +11308 -5745
- package/esm/veplayer.live.production.js +3 -5
- package/esm/veplayer.production.js +3 -5
- package/esm/veplayer.vod.d.ts +2 -1
- package/esm/veplayer.vod.development.js +45 -3
- package/esm/veplayer.vod.production.js +3 -5
- package/package.json +1 -1
- package/umd/index.d.ts +2 -1
- package/umd/veplayer.biz.live.development.js +14261 -2153
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +20 -2
- package/umd/veplayer.development.js +8740 -3177
- package/umd/veplayer.live.d.ts +20 -2
- package/umd/veplayer.live.development.js +8746 -3183
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +2 -1
- package/umd/veplayer.vod.development.js +45 -3
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +20 -2
- package/veplayer.live.d.ts +20 -2
- package/veplayer.vod.d.ts +2 -1
package/esm/veplayer.vod.d.ts
CHANGED
|
@@ -2092,7 +2092,7 @@ declare class VePlayerBase {
|
|
|
2092
2092
|
/** {en}
|
|
2093
2093
|
* @brief Starts playback.
|
|
2094
2094
|
*/
|
|
2095
|
-
play(): any
|
|
2095
|
+
play(): Promise<any>;
|
|
2096
2096
|
/** {zh}
|
|
2097
2097
|
* @brief 调用此方法暂停播放。
|
|
2098
2098
|
*/
|
|
@@ -2297,6 +2297,7 @@ declare class VePlayerBase {
|
|
|
2297
2297
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2298
2298
|
private _transformEvent;
|
|
2299
2299
|
private _switch;
|
|
2300
|
+
private _restartLiveLogger;
|
|
2300
2301
|
private _switchDifferentProtocolUrl;
|
|
2301
2302
|
private _switchUrl;
|
|
2302
2303
|
private _callBeforePlayerInitForUrl;
|
|
@@ -13609,11 +13609,17 @@ class Autoplay extends Plugin {
|
|
|
13609
13609
|
}
|
|
13610
13610
|
// 自动播放失败事件回调
|
|
13611
13611
|
handleAutoplayPrevented() {
|
|
13612
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
13612
13613
|
if (this._state.mode === 0) {
|
|
13613
13614
|
console.warn("unmute autoplay fail");
|
|
13614
13615
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13615
13616
|
mode: "unmute"
|
|
13616
13617
|
});
|
|
13618
|
+
(_d = (_c = (_b = (_a = this.player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) == null ? void 0 : _d.sendLog({
|
|
13619
|
+
event_key: "autoplay_error",
|
|
13620
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13621
|
+
mode: "unmute"
|
|
13622
|
+
});
|
|
13617
13623
|
if (isAndroid && isWeixin) {
|
|
13618
13624
|
this._state.mode = 2;
|
|
13619
13625
|
return;
|
|
@@ -13629,12 +13635,22 @@ class Autoplay extends Plugin {
|
|
|
13629
13635
|
mode: "mute"
|
|
13630
13636
|
});
|
|
13631
13637
|
this._state.mode = 2;
|
|
13638
|
+
(_h = (_g = (_f = (_e = this.player) == null ? void 0 : _e.config) == null ? void 0 : _f.teaTracker) == null ? void 0 : _g.liveLogger) == null ? void 0 : _h.sendLog({
|
|
13639
|
+
event_key: "autoplay_error",
|
|
13640
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13641
|
+
mode: "mute"
|
|
13642
|
+
});
|
|
13632
13643
|
return;
|
|
13633
13644
|
}
|
|
13634
13645
|
if (this._state.mode === 2) {
|
|
13635
13646
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13636
13647
|
mode: "noSupport"
|
|
13637
13648
|
});
|
|
13649
|
+
(_l = (_k = (_j = (_i = this.player) == null ? void 0 : _i.config) == null ? void 0 : _j.teaTracker) == null ? void 0 : _k.liveLogger) == null ? void 0 : _l.sendLog({
|
|
13650
|
+
event_key: "autoplay_error",
|
|
13651
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13652
|
+
mode: "noSupport"
|
|
13653
|
+
});
|
|
13638
13654
|
console.warn("not support autoplay");
|
|
13639
13655
|
return;
|
|
13640
13656
|
}
|
|
@@ -14379,7 +14395,7 @@ class VePlayerBase {
|
|
|
14379
14395
|
* @brief Retrieve the player SDK version number.
|
|
14380
14396
|
*/
|
|
14381
14397
|
get playerVersion() {
|
|
14382
|
-
return "2.10.0";
|
|
14398
|
+
return "2.10.2-rc.0";
|
|
14383
14399
|
}
|
|
14384
14400
|
/** {zh}
|
|
14385
14401
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14659,9 +14675,26 @@ class VePlayerBase {
|
|
|
14659
14675
|
/** {en}
|
|
14660
14676
|
* @brief Starts playback.
|
|
14661
14677
|
*/
|
|
14662
|
-
play() {
|
|
14678
|
+
async play() {
|
|
14679
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14663
14680
|
/* istanbul ignore next -- @preserve */
|
|
14664
|
-
|
|
14681
|
+
try {
|
|
14682
|
+
if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
|
|
14683
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14684
|
+
event_key: "play_method_call"
|
|
14685
|
+
});
|
|
14686
|
+
}
|
|
14687
|
+
const result = await this._player.play();
|
|
14688
|
+
return result;
|
|
14689
|
+
} catch (error2) {
|
|
14690
|
+
if ((_f = (_e = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e.teaTracker) == null ? void 0 : _f.liveLogger) {
|
|
14691
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14692
|
+
event_key: "play_method_call_error",
|
|
14693
|
+
error: error2.message || String(error2)
|
|
14694
|
+
});
|
|
14695
|
+
}
|
|
14696
|
+
throw error2;
|
|
14697
|
+
}
|
|
14665
14698
|
}
|
|
14666
14699
|
/** {zh}
|
|
14667
14700
|
* @brief 调用此方法暂停播放。
|
|
@@ -14941,6 +14974,7 @@ class VePlayerBase {
|
|
|
14941
14974
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14942
14975
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
14943
14976
|
const isPaused = this._player.paused && !this._player.isError;
|
|
14977
|
+
this._restartLiveLogger();
|
|
14944
14978
|
const {
|
|
14945
14979
|
plugins: newPlugins,
|
|
14946
14980
|
options,
|
|
@@ -14978,6 +15012,13 @@ class VePlayerBase {
|
|
|
14978
15012
|
isDefinitionSwitching && this.emit(Events.AFTER_DEFINITION_CHANGE);
|
|
14979
15013
|
}
|
|
14980
15014
|
}
|
|
15015
|
+
_restartLiveLogger() {
|
|
15016
|
+
var _a, _b, _c, _d;
|
|
15017
|
+
const liveLogger = (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.logger) == null ? void 0 : _c._liveLogger;
|
|
15018
|
+
if ((_d = liveLogger == null ? void 0 : liveLogger.logger) == null ? void 0 : _d.destroyed) {
|
|
15019
|
+
liveLogger == null ? void 0 : liveLogger.restart(false);
|
|
15020
|
+
}
|
|
15021
|
+
}
|
|
14981
15022
|
async _switchDifferentProtocolUrl(plugins, url, isPaused, useSrc) {
|
|
14982
15023
|
var _a, _b;
|
|
14983
15024
|
if (useSrc && this._player.media) {
|
|
@@ -15014,6 +15055,7 @@ class VePlayerBase {
|
|
|
15014
15055
|
}
|
|
15015
15056
|
async _switchUrl(url, config) {
|
|
15016
15057
|
const isPaused = this._player.paused && !this._player.isError;
|
|
15058
|
+
this._restartLiveLogger();
|
|
15017
15059
|
const {
|
|
15018
15060
|
plugins: newPlugins,
|
|
15019
15061
|
options,
|