@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/umd/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;
|
|
@@ -13613,11 +13613,17 @@ var __publicField = (obj, key, value) => {
|
|
|
13613
13613
|
}
|
|
13614
13614
|
// 自动播放失败事件回调
|
|
13615
13615
|
handleAutoplayPrevented() {
|
|
13616
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
13616
13617
|
if (this._state.mode === 0) {
|
|
13617
13618
|
console.warn("unmute autoplay fail");
|
|
13618
13619
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13619
13620
|
mode: "unmute"
|
|
13620
13621
|
});
|
|
13622
|
+
(_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({
|
|
13623
|
+
event_key: "autoplay_error",
|
|
13624
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13625
|
+
mode: "unmute"
|
|
13626
|
+
});
|
|
13621
13627
|
if (isAndroid && isWeixin) {
|
|
13622
13628
|
this._state.mode = 2;
|
|
13623
13629
|
return;
|
|
@@ -13633,12 +13639,22 @@ var __publicField = (obj, key, value) => {
|
|
|
13633
13639
|
mode: "mute"
|
|
13634
13640
|
});
|
|
13635
13641
|
this._state.mode = 2;
|
|
13642
|
+
(_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({
|
|
13643
|
+
event_key: "autoplay_error",
|
|
13644
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13645
|
+
mode: "mute"
|
|
13646
|
+
});
|
|
13636
13647
|
return;
|
|
13637
13648
|
}
|
|
13638
13649
|
if (this._state.mode === 2) {
|
|
13639
13650
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13640
13651
|
mode: "noSupport"
|
|
13641
13652
|
});
|
|
13653
|
+
(_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({
|
|
13654
|
+
event_key: "autoplay_error",
|
|
13655
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13656
|
+
mode: "noSupport"
|
|
13657
|
+
});
|
|
13642
13658
|
console.warn("not support autoplay");
|
|
13643
13659
|
return;
|
|
13644
13660
|
}
|
|
@@ -14383,7 +14399,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14383
14399
|
* @brief Retrieve the player SDK version number.
|
|
14384
14400
|
*/
|
|
14385
14401
|
get playerVersion() {
|
|
14386
|
-
return "2.10.0";
|
|
14402
|
+
return "2.10.2-rc.0";
|
|
14387
14403
|
}
|
|
14388
14404
|
/** {zh}
|
|
14389
14405
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14663,9 +14679,26 @@ var __publicField = (obj, key, value) => {
|
|
|
14663
14679
|
/** {en}
|
|
14664
14680
|
* @brief Starts playback.
|
|
14665
14681
|
*/
|
|
14666
|
-
play() {
|
|
14682
|
+
async play() {
|
|
14683
|
+
var _a, _b, _c, _d, _e, _f;
|
|
14667
14684
|
/* istanbul ignore next -- @preserve */
|
|
14668
|
-
|
|
14685
|
+
try {
|
|
14686
|
+
if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
|
|
14687
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14688
|
+
event_key: "play_method_call"
|
|
14689
|
+
});
|
|
14690
|
+
}
|
|
14691
|
+
const result = await this._player.play();
|
|
14692
|
+
return result;
|
|
14693
|
+
} catch (error2) {
|
|
14694
|
+
if ((_f = (_e = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e.teaTracker) == null ? void 0 : _f.liveLogger) {
|
|
14695
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14696
|
+
event_key: "play_method_call_error",
|
|
14697
|
+
error: error2.message || String(error2)
|
|
14698
|
+
});
|
|
14699
|
+
}
|
|
14700
|
+
throw error2;
|
|
14701
|
+
}
|
|
14669
14702
|
}
|
|
14670
14703
|
/** {zh}
|
|
14671
14704
|
* @brief 调用此方法暂停播放。
|
|
@@ -14945,6 +14978,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14945
14978
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14946
14979
|
const preDefinition = clonedeep(this._sourceManager.definition);
|
|
14947
14980
|
const isPaused = this._player.paused && !this._player.isError;
|
|
14981
|
+
this._restartLiveLogger();
|
|
14948
14982
|
const {
|
|
14949
14983
|
plugins: newPlugins,
|
|
14950
14984
|
options,
|
|
@@ -14982,6 +15016,13 @@ var __publicField = (obj, key, value) => {
|
|
|
14982
15016
|
isDefinitionSwitching && this.emit(Events.AFTER_DEFINITION_CHANGE);
|
|
14983
15017
|
}
|
|
14984
15018
|
}
|
|
15019
|
+
_restartLiveLogger() {
|
|
15020
|
+
var _a, _b, _c, _d;
|
|
15021
|
+
const liveLogger = (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.logger) == null ? void 0 : _c._liveLogger;
|
|
15022
|
+
if ((_d = liveLogger == null ? void 0 : liveLogger.logger) == null ? void 0 : _d.destroyed) {
|
|
15023
|
+
liveLogger == null ? void 0 : liveLogger.restart(false);
|
|
15024
|
+
}
|
|
15025
|
+
}
|
|
14985
15026
|
async _switchDifferentProtocolUrl(plugins, url, isPaused, useSrc) {
|
|
14986
15027
|
var _a, _b;
|
|
14987
15028
|
if (useSrc && this._player.media) {
|
|
@@ -15018,6 +15059,7 @@ var __publicField = (obj, key, value) => {
|
|
|
15018
15059
|
}
|
|
15019
15060
|
async _switchUrl(url, config) {
|
|
15020
15061
|
const isPaused = this._player.paused && !this._player.isError;
|
|
15062
|
+
this._restartLiveLogger();
|
|
15021
15063
|
const {
|
|
15022
15064
|
plugins: newPlugins,
|
|
15023
15065
|
options,
|