@volcengine/veplayer 2.10.1 → 2.10.2-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/esm/index.d.ts +1 -1
- package/esm/veplayer.biz.live.development.js +51 -19
- package/esm/veplayer.biz.live.production.js +1 -1
- package/esm/veplayer.d.ts +18 -2
- package/esm/veplayer.development.js +87 -22
- package/esm/veplayer.live.d.ts +18 -2
- package/esm/veplayer.live.development.js +87 -22
- package/esm/veplayer.live.production.js +3 -5
- package/esm/veplayer.production.js +3 -5
- package/esm/veplayer.vod.d.ts +1 -1
- package/esm/veplayer.vod.development.js +36 -3
- package/esm/veplayer.vod.production.js +2 -4
- package/package.json +1 -1
- package/umd/index.d.ts +1 -1
- package/umd/veplayer.biz.live.development.js +51 -19
- package/umd/veplayer.biz.live.production.js +1 -1
- package/umd/veplayer.d.ts +18 -2
- package/umd/veplayer.development.js +87 -22
- package/umd/veplayer.live.d.ts +18 -2
- package/umd/veplayer.live.development.js +87 -22
- package/umd/veplayer.live.production.js +1 -1
- package/umd/veplayer.production.js +1 -1
- package/umd/veplayer.vod.d.ts +1 -1
- package/umd/veplayer.vod.development.js +36 -3
- package/umd/veplayer.vod.production.js +1 -1
- package/veplayer.d.ts +18 -2
- package/veplayer.live.d.ts +18 -2
- package/veplayer.vod.d.ts +1 -1
package/umd/veplayer.d.ts
CHANGED
|
@@ -2275,7 +2275,7 @@ declare class VePlayerBase {
|
|
|
2275
2275
|
/** {en}
|
|
2276
2276
|
* @brief Starts playback.
|
|
2277
2277
|
*/
|
|
2278
|
-
play(): any
|
|
2278
|
+
play(): Promise<any>;
|
|
2279
2279
|
/** {zh}
|
|
2280
2280
|
* @brief 调用此方法暂停播放。
|
|
2281
2281
|
*/
|
|
@@ -5871,6 +5871,7 @@ declare abstract class BaseProtocol {
|
|
|
5871
5871
|
// 是否支持播放
|
|
5872
5872
|
abstract canPlay(): Promise<{
|
|
5873
5873
|
canPlay: boolean;
|
|
5874
|
+
extraInfo?: any;
|
|
5874
5875
|
}>;
|
|
5875
5876
|
abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
|
|
5876
5877
|
player?: VePlayerBase;
|
|
@@ -5897,9 +5898,16 @@ declare class ProtocolManager {
|
|
|
5897
5898
|
private _selector?;
|
|
5898
5899
|
private _protocol;
|
|
5899
5900
|
private _playlistMap;
|
|
5901
|
+
// 存储每个协议的 canPlay 检查结果
|
|
5902
|
+
private _protocolCanPlayResults;
|
|
5900
5903
|
constructor(options: LiveVePlayerOptions);
|
|
5901
5904
|
get enableSelector(): boolean;
|
|
5902
5905
|
get protocol(): BaseProtocol | undefined;
|
|
5906
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
5907
|
+
get protocolCanPlayResults(): Record<string, {
|
|
5908
|
+
canPlay: boolean;
|
|
5909
|
+
extra?: any;
|
|
5910
|
+
}>;
|
|
5903
5911
|
get queue(): string[] | undefined;
|
|
5904
5912
|
get playlist(): ExposedSource[] | undefined;
|
|
5905
5913
|
static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
|
|
@@ -9795,7 +9803,7 @@ declare namespace live {
|
|
|
9795
9803
|
/** {en}
|
|
9796
9804
|
* @brief Starts playback.
|
|
9797
9805
|
*/
|
|
9798
|
-
play(): any
|
|
9806
|
+
play(): Promise<any>;
|
|
9799
9807
|
/** {zh}
|
|
9800
9808
|
* @brief 调用此方法暂停播放。
|
|
9801
9809
|
*/
|
|
@@ -10783,6 +10791,7 @@ declare namespace live {
|
|
|
10783
10791
|
// 是否支持播放
|
|
10784
10792
|
abstract canPlay(): Promise<{
|
|
10785
10793
|
canPlay: boolean;
|
|
10794
|
+
extraInfo?: any;
|
|
10786
10795
|
}>;
|
|
10787
10796
|
abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
|
|
10788
10797
|
player?: VePlayerBase;
|
|
@@ -10809,9 +10818,16 @@ declare namespace live {
|
|
|
10809
10818
|
private _selector?;
|
|
10810
10819
|
private _protocol;
|
|
10811
10820
|
private _playlistMap;
|
|
10821
|
+
// 存储每个协议的 canPlay 检查结果
|
|
10822
|
+
private _protocolCanPlayResults;
|
|
10812
10823
|
constructor(options: LiveVePlayerOptions);
|
|
10813
10824
|
get enableSelector(): boolean;
|
|
10814
10825
|
get protocol(): BaseProtocol | undefined;
|
|
10826
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
10827
|
+
get protocolCanPlayResults(): Record<string, {
|
|
10828
|
+
canPlay: boolean;
|
|
10829
|
+
extra?: any;
|
|
10830
|
+
}>;
|
|
10815
10831
|
get queue(): string[] | undefined;
|
|
10816
10832
|
get playlist(): ExposedSource[] | undefined;
|
|
10817
10833
|
static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
|
|
@@ -13722,11 +13722,17 @@ var __publicField = (obj, key, value) => {
|
|
|
13722
13722
|
}
|
|
13723
13723
|
// 自动播放失败事件回调
|
|
13724
13724
|
handleAutoplayPrevented() {
|
|
13725
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l;
|
|
13725
13726
|
if (this._state.mode === 0) {
|
|
13726
13727
|
console.warn("unmute autoplay fail");
|
|
13727
13728
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13728
13729
|
mode: "unmute"
|
|
13729
13730
|
});
|
|
13731
|
+
(_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({
|
|
13732
|
+
event_key: "autoplay_error",
|
|
13733
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13734
|
+
mode: "unmute"
|
|
13735
|
+
});
|
|
13730
13736
|
if (isAndroid$1 && isWeixin) {
|
|
13731
13737
|
this._state.mode = 2;
|
|
13732
13738
|
return;
|
|
@@ -13742,12 +13748,22 @@ var __publicField = (obj, key, value) => {
|
|
|
13742
13748
|
mode: "mute"
|
|
13743
13749
|
});
|
|
13744
13750
|
this._state.mode = 2;
|
|
13751
|
+
(_h = (_g = (_f = (_e2 = this.player) == null ? void 0 : _e2.config) == null ? void 0 : _f.teaTracker) == null ? void 0 : _g.liveLogger) == null ? void 0 : _h.sendLog({
|
|
13752
|
+
event_key: "autoplay_error",
|
|
13753
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13754
|
+
mode: "mute"
|
|
13755
|
+
});
|
|
13745
13756
|
return;
|
|
13746
13757
|
}
|
|
13747
13758
|
if (this._state.mode === 2) {
|
|
13748
13759
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13749
13760
|
mode: "noSupport"
|
|
13750
13761
|
});
|
|
13762
|
+
(_l = (_k = (_j = (_i2 = this.player) == null ? void 0 : _i2.config) == null ? void 0 : _j.teaTracker) == null ? void 0 : _k.liveLogger) == null ? void 0 : _l.sendLog({
|
|
13763
|
+
event_key: "autoplay_error",
|
|
13764
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13765
|
+
mode: "noSupport"
|
|
13766
|
+
});
|
|
13751
13767
|
console.warn("not support autoplay");
|
|
13752
13768
|
return;
|
|
13753
13769
|
}
|
|
@@ -14564,7 +14580,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14564
14580
|
* @brief Retrieve the player SDK version number.
|
|
14565
14581
|
*/
|
|
14566
14582
|
get playerVersion() {
|
|
14567
|
-
return "2.10.1";
|
|
14583
|
+
return "2.10.2-rc.1";
|
|
14568
14584
|
}
|
|
14569
14585
|
/** {zh}
|
|
14570
14586
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14844,9 +14860,26 @@ var __publicField = (obj, key, value) => {
|
|
|
14844
14860
|
/** {en}
|
|
14845
14861
|
* @brief Starts playback.
|
|
14846
14862
|
*/
|
|
14847
|
-
play() {
|
|
14863
|
+
async play() {
|
|
14864
|
+
var _a, _b, _c, _d, _e2, _f;
|
|
14848
14865
|
/* istanbul ignore next -- @preserve */
|
|
14849
|
-
|
|
14866
|
+
try {
|
|
14867
|
+
if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
|
|
14868
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14869
|
+
event_key: "play_method_call"
|
|
14870
|
+
});
|
|
14871
|
+
}
|
|
14872
|
+
const result = await this._player.play();
|
|
14873
|
+
return result;
|
|
14874
|
+
} catch (error2) {
|
|
14875
|
+
if ((_f = (_e2 = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.liveLogger) {
|
|
14876
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14877
|
+
event_key: "play_method_call_error",
|
|
14878
|
+
error: error2.message || String(error2)
|
|
14879
|
+
});
|
|
14880
|
+
}
|
|
14881
|
+
throw error2;
|
|
14882
|
+
}
|
|
14850
14883
|
}
|
|
14851
14884
|
/** {zh}
|
|
14852
14885
|
* @brief 调用此方法暂停播放。
|
|
@@ -55386,10 +55419,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
55386
55419
|
device_id: deviceId,
|
|
55387
55420
|
error_report_stop: true,
|
|
55388
55421
|
ext: {
|
|
55389
|
-
veplayer_version: "2.10.1",
|
|
55422
|
+
veplayer_version: "2.10.2-rc.1",
|
|
55390
55423
|
flv_version: "3.0.23-rc.6",
|
|
55391
55424
|
hls_version: "3.0.21-rc.21",
|
|
55392
|
-
rts_version: "0.2.1-alpha.
|
|
55425
|
+
rts_version: "0.2.1-alpha.53"
|
|
55393
55426
|
}
|
|
55394
55427
|
});
|
|
55395
55428
|
}
|
|
@@ -55898,7 +55931,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
55898
55931
|
}
|
|
55899
55932
|
async canPlay() {
|
|
55900
55933
|
return {
|
|
55901
|
-
canPlay: isFLVSupported()
|
|
55934
|
+
canPlay: isFLVSupported(),
|
|
55935
|
+
extraInfo: {
|
|
55936
|
+
isFLVSupported: isFLVSupported()
|
|
55937
|
+
}
|
|
55902
55938
|
};
|
|
55903
55939
|
}
|
|
55904
55940
|
shouldFallbackWhenStall() {
|
|
@@ -56366,7 +56402,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
56366
56402
|
isRTMSupportCodec()
|
|
56367
56403
|
]);
|
|
56368
56404
|
return {
|
|
56369
|
-
canPlay: isSupported && isSupportCodec
|
|
56405
|
+
canPlay: isSupported && isSupportCodec,
|
|
56406
|
+
extraInfo: {
|
|
56407
|
+
isRTMSupported: isSupported,
|
|
56408
|
+
isRTMSupportCodec: isSupportCodec
|
|
56409
|
+
}
|
|
56370
56410
|
};
|
|
56371
56411
|
}
|
|
56372
56412
|
shouldFallbackWhenStall() {
|
|
@@ -56422,16 +56462,20 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
56422
56462
|
this.current = this._getStartProtocol();
|
|
56423
56463
|
}
|
|
56424
56464
|
// 获取最终返回的播放类型和参数。
|
|
56425
|
-
async getProtocol() {
|
|
56465
|
+
async getProtocol(protocolCanPlayResults = {}) {
|
|
56426
56466
|
if (!this.current) {
|
|
56427
56467
|
return;
|
|
56428
56468
|
}
|
|
56429
|
-
const { canPlay } = await this.current.canPlay() ?? {};
|
|
56469
|
+
const { canPlay, extraInfo } = await this.current.canPlay() ?? {};
|
|
56470
|
+
protocolCanPlayResults[this.current.protocolType] = {
|
|
56471
|
+
canPlay,
|
|
56472
|
+
...extraInfo
|
|
56473
|
+
};
|
|
56430
56474
|
if (canPlay) {
|
|
56431
56475
|
return this.current;
|
|
56432
56476
|
}
|
|
56433
56477
|
this.next();
|
|
56434
|
-
return this.getProtocol();
|
|
56478
|
+
return this.getProtocol(protocolCanPlayResults);
|
|
56435
56479
|
}
|
|
56436
56480
|
// 降级时,将指针指到上次结束的位置
|
|
56437
56481
|
next() {
|
|
@@ -62298,6 +62342,8 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62298
62342
|
__publicField(this, "_selector");
|
|
62299
62343
|
__publicField(this, "_protocol");
|
|
62300
62344
|
__publicField(this, "_playlistMap", {});
|
|
62345
|
+
// 存储每个协议的 canPlay 检查结果
|
|
62346
|
+
__publicField(this, "_protocolCanPlayResults", {});
|
|
62301
62347
|
this._options = options;
|
|
62302
62348
|
this._init({
|
|
62303
62349
|
url: options.url,
|
|
@@ -62310,6 +62356,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62310
62356
|
get protocol() {
|
|
62311
62357
|
return this._protocol;
|
|
62312
62358
|
}
|
|
62359
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
62360
|
+
get protocolCanPlayResults() {
|
|
62361
|
+
return this._protocolCanPlayResults;
|
|
62362
|
+
}
|
|
62313
62363
|
get queue() {
|
|
62314
62364
|
var _a;
|
|
62315
62365
|
return (_a = this._selector) == null ? void 0 : _a._queue;
|
|
@@ -62357,8 +62407,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62357
62407
|
return { protocolMap, playlistMap };
|
|
62358
62408
|
}
|
|
62359
62409
|
async getProtocol() {
|
|
62410
|
+
this._protocolCanPlayResults = {};
|
|
62360
62411
|
if (this._selector) {
|
|
62361
|
-
this._protocol = await this._selector.getProtocol(
|
|
62412
|
+
this._protocol = await this._selector.getProtocol(
|
|
62413
|
+
this._protocolCanPlayResults
|
|
62414
|
+
);
|
|
62362
62415
|
}
|
|
62363
62416
|
return this._protocol;
|
|
62364
62417
|
}
|
|
@@ -62463,7 +62516,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62463
62516
|
__publicField(this, "player");
|
|
62464
62517
|
__publicField(this, "protocolManager");
|
|
62465
62518
|
__publicField(this, "beforeFallbackError", async (error2) => {
|
|
62466
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2;
|
|
62519
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2, _o;
|
|
62467
62520
|
if (!((_b = (_a = this.protocolManager) == null ? void 0 : _a.protocol) == null ? void 0 : _b.shouldFallbackWhenError({ error: error2 })) || !((_d = (_c = this.protocolManager) == null ? void 0 : _c.protocol) == null ? void 0 : _d.nextProtocol)) {
|
|
62468
62521
|
return { canEmitError: true };
|
|
62469
62522
|
}
|
|
@@ -62484,13 +62537,22 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62484
62537
|
}
|
|
62485
62538
|
});
|
|
62486
62539
|
this.fallback();
|
|
62487
|
-
|
|
62540
|
+
let canplayStr = "";
|
|
62541
|
+
try {
|
|
62542
|
+
canplayStr = JSON.stringify((_l = this.protocolManager) == null ? void 0 : _l.protocolCanPlayResults);
|
|
62543
|
+
canplayStr = `json:${canplayStr}`;
|
|
62544
|
+
} catch (e2) {
|
|
62545
|
+
console.warn("Failed to stringify protocolCanPlayResults:", e2);
|
|
62546
|
+
canplayStr = "json:{}";
|
|
62547
|
+
}
|
|
62548
|
+
(_o = teaTracker.liveLogger) == null ? void 0 : _o.sendLog({
|
|
62488
62549
|
event_key: "fallback",
|
|
62489
62550
|
playlist: this.protocolManager.playlist,
|
|
62490
62551
|
code: error2.errorCode,
|
|
62491
62552
|
message: error2.message,
|
|
62492
62553
|
// 降级的协议
|
|
62493
|
-
protocol: (
|
|
62554
|
+
protocol: (_n2 = (_m = this.protocolManager) == null ? void 0 : _m.protocol) == null ? void 0 : _n2.protocolType,
|
|
62555
|
+
canplay: canplayStr
|
|
62494
62556
|
});
|
|
62495
62557
|
return { canEmitError: false };
|
|
62496
62558
|
});
|
|
@@ -72718,9 +72780,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72718
72780
|
logger: options.logger,
|
|
72719
72781
|
appId: ((_c = options.logger) == null ? void 0 : _c.appId) || 654925,
|
|
72720
72782
|
syncWaitSettings: false,
|
|
72721
|
-
strategies: {
|
|
72722
|
-
rtmAdaptiveBuffer: true
|
|
72723
|
-
}
|
|
72783
|
+
strategies: {}
|
|
72724
72784
|
});
|
|
72725
72785
|
if (!teaTracker.tea) {
|
|
72726
72786
|
teaTracker.init(options.logger);
|
|
@@ -72768,6 +72828,14 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72768
72828
|
},
|
|
72769
72829
|
VePlayerLive
|
|
72770
72830
|
);
|
|
72831
|
+
let canplayStr = "";
|
|
72832
|
+
try {
|
|
72833
|
+
canplayStr = JSON.stringify(protocolManager.protocolCanPlayResults);
|
|
72834
|
+
canplayStr = `json:${canplayStr}`;
|
|
72835
|
+
} catch (e2) {
|
|
72836
|
+
console.warn("Failed to stringify protocolCanPlayResults:", e2);
|
|
72837
|
+
canplayStr = "json:{}";
|
|
72838
|
+
}
|
|
72771
72839
|
(_h = teaTracker.liveLogger) == null ? void 0 : _h.sendLog({
|
|
72772
72840
|
event_key: "initial_info",
|
|
72773
72841
|
// 是否开启多 Source
|
|
@@ -72778,10 +72846,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72778
72846
|
// 初始化 protocol
|
|
72779
72847
|
protocol: (_g = protocolManager.protocol) == null ? void 0 : _g.protocolType
|
|
72780
72848
|
},
|
|
72781
|
-
|
|
72782
|
-
isRTMSupportCodec: await isRTMSupportCodec(),
|
|
72783
|
-
isRTMSupported: await isRTMSupported(),
|
|
72784
|
-
isFLVSupported: isFLVSupported()
|
|
72849
|
+
canplay: canplayStr
|
|
72785
72850
|
});
|
|
72786
72851
|
player._protocolManager = protocolManager;
|
|
72787
72852
|
fallback.initErrorFallback(player, protocolManager);
|
|
@@ -72817,7 +72882,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72817
72882
|
}
|
|
72818
72883
|
await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
|
|
72819
72884
|
...options,
|
|
72820
|
-
playerVersion: "2.10.1",
|
|
72885
|
+
playerVersion: "2.10.2-rc.1",
|
|
72821
72886
|
type: "LIVE"
|
|
72822
72887
|
}));
|
|
72823
72888
|
return liveVeStrategy.veStrategyManager;
|
package/umd/veplayer.live.d.ts
CHANGED
|
@@ -2275,7 +2275,7 @@ declare class VePlayerBase {
|
|
|
2275
2275
|
/** {en}
|
|
2276
2276
|
* @brief Starts playback.
|
|
2277
2277
|
*/
|
|
2278
|
-
play(): any
|
|
2278
|
+
play(): Promise<any>;
|
|
2279
2279
|
/** {zh}
|
|
2280
2280
|
* @brief 调用此方法暂停播放。
|
|
2281
2281
|
*/
|
|
@@ -5871,6 +5871,7 @@ declare abstract class BaseProtocol {
|
|
|
5871
5871
|
// 是否支持播放
|
|
5872
5872
|
abstract canPlay(): Promise<{
|
|
5873
5873
|
canPlay: boolean;
|
|
5874
|
+
extraInfo?: any;
|
|
5874
5875
|
}>;
|
|
5875
5876
|
abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
|
|
5876
5877
|
player?: VePlayerBase;
|
|
@@ -5897,9 +5898,16 @@ declare class ProtocolManager {
|
|
|
5897
5898
|
private _selector?;
|
|
5898
5899
|
private _protocol;
|
|
5899
5900
|
private _playlistMap;
|
|
5901
|
+
// 存储每个协议的 canPlay 检查结果
|
|
5902
|
+
private _protocolCanPlayResults;
|
|
5900
5903
|
constructor(options: LiveVePlayerOptions);
|
|
5901
5904
|
get enableSelector(): boolean;
|
|
5902
5905
|
get protocol(): BaseProtocol | undefined;
|
|
5906
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
5907
|
+
get protocolCanPlayResults(): Record<string, {
|
|
5908
|
+
canPlay: boolean;
|
|
5909
|
+
extra?: any;
|
|
5910
|
+
}>;
|
|
5903
5911
|
get queue(): string[] | undefined;
|
|
5904
5912
|
get playlist(): ExposedSource[] | undefined;
|
|
5905
5913
|
static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
|
|
@@ -9795,7 +9803,7 @@ declare namespace live {
|
|
|
9795
9803
|
/** {en}
|
|
9796
9804
|
* @brief Starts playback.
|
|
9797
9805
|
*/
|
|
9798
|
-
play(): any
|
|
9806
|
+
play(): Promise<any>;
|
|
9799
9807
|
/** {zh}
|
|
9800
9808
|
* @brief 调用此方法暂停播放。
|
|
9801
9809
|
*/
|
|
@@ -10783,6 +10791,7 @@ declare namespace live {
|
|
|
10783
10791
|
// 是否支持播放
|
|
10784
10792
|
abstract canPlay(): Promise<{
|
|
10785
10793
|
canPlay: boolean;
|
|
10794
|
+
extraInfo?: any;
|
|
10786
10795
|
}>;
|
|
10787
10796
|
abstract getProtocolStrategy(options: VePlayerBaseOptions, config?: {
|
|
10788
10797
|
player?: VePlayerBase;
|
|
@@ -10809,9 +10818,16 @@ declare namespace live {
|
|
|
10809
10818
|
private _selector?;
|
|
10810
10819
|
private _protocol;
|
|
10811
10820
|
private _playlistMap;
|
|
10821
|
+
// 存储每个协议的 canPlay 检查结果
|
|
10822
|
+
private _protocolCanPlayResults;
|
|
10812
10823
|
constructor(options: LiveVePlayerOptions);
|
|
10813
10824
|
get enableSelector(): boolean;
|
|
10814
10825
|
get protocol(): BaseProtocol | undefined;
|
|
10826
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
10827
|
+
get protocolCanPlayResults(): Record<string, {
|
|
10828
|
+
canPlay: boolean;
|
|
10829
|
+
extra?: any;
|
|
10830
|
+
}>;
|
|
10815
10831
|
get queue(): string[] | undefined;
|
|
10816
10832
|
get playlist(): ExposedSource[] | undefined;
|
|
10817
10833
|
static create(options: LiveVePlayerOptions): Promise<ProtocolManager>;
|
|
@@ -13722,11 +13722,17 @@ var __publicField = (obj, key, value) => {
|
|
|
13722
13722
|
}
|
|
13723
13723
|
// 自动播放失败事件回调
|
|
13724
13724
|
handleAutoplayPrevented() {
|
|
13725
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l;
|
|
13725
13726
|
if (this._state.mode === 0) {
|
|
13726
13727
|
console.warn("unmute autoplay fail");
|
|
13727
13728
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13728
13729
|
mode: "unmute"
|
|
13729
13730
|
});
|
|
13731
|
+
(_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({
|
|
13732
|
+
event_key: "autoplay_error",
|
|
13733
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13734
|
+
mode: "unmute"
|
|
13735
|
+
});
|
|
13730
13736
|
if (isAndroid$1 && isWeixin) {
|
|
13731
13737
|
this._state.mode = 2;
|
|
13732
13738
|
return;
|
|
@@ -13742,12 +13748,22 @@ var __publicField = (obj, key, value) => {
|
|
|
13742
13748
|
mode: "mute"
|
|
13743
13749
|
});
|
|
13744
13750
|
this._state.mode = 2;
|
|
13751
|
+
(_h = (_g = (_f = (_e2 = this.player) == null ? void 0 : _e2.config) == null ? void 0 : _f.teaTracker) == null ? void 0 : _g.liveLogger) == null ? void 0 : _h.sendLog({
|
|
13752
|
+
event_key: "autoplay_error",
|
|
13753
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13754
|
+
mode: "mute"
|
|
13755
|
+
});
|
|
13745
13756
|
return;
|
|
13746
13757
|
}
|
|
13747
13758
|
if (this._state.mode === 2) {
|
|
13748
13759
|
this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
|
|
13749
13760
|
mode: "noSupport"
|
|
13750
13761
|
});
|
|
13762
|
+
(_l = (_k = (_j = (_i2 = this.player) == null ? void 0 : _i2.config) == null ? void 0 : _j.teaTracker) == null ? void 0 : _k.liveLogger) == null ? void 0 : _l.sendLog({
|
|
13763
|
+
event_key: "autoplay_error",
|
|
13764
|
+
message: BaseEvents.AUTOPLAY_FAIL,
|
|
13765
|
+
mode: "noSupport"
|
|
13766
|
+
});
|
|
13751
13767
|
console.warn("not support autoplay");
|
|
13752
13768
|
return;
|
|
13753
13769
|
}
|
|
@@ -14564,7 +14580,7 @@ var __publicField = (obj, key, value) => {
|
|
|
14564
14580
|
* @brief Retrieve the player SDK version number.
|
|
14565
14581
|
*/
|
|
14566
14582
|
get playerVersion() {
|
|
14567
|
-
return "2.10.1";
|
|
14583
|
+
return "2.10.2-rc.1";
|
|
14568
14584
|
}
|
|
14569
14585
|
/** {zh}
|
|
14570
14586
|
* @brief 获取当前播放视频的清晰度唯一标识(definition)。
|
|
@@ -14844,9 +14860,26 @@ var __publicField = (obj, key, value) => {
|
|
|
14844
14860
|
/** {en}
|
|
14845
14861
|
* @brief Starts playback.
|
|
14846
14862
|
*/
|
|
14847
|
-
play() {
|
|
14863
|
+
async play() {
|
|
14864
|
+
var _a, _b, _c, _d, _e2, _f;
|
|
14848
14865
|
/* istanbul ignore next -- @preserve */
|
|
14849
|
-
|
|
14866
|
+
try {
|
|
14867
|
+
if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
|
|
14868
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14869
|
+
event_key: "play_method_call"
|
|
14870
|
+
});
|
|
14871
|
+
}
|
|
14872
|
+
const result = await this._player.play();
|
|
14873
|
+
return result;
|
|
14874
|
+
} catch (error2) {
|
|
14875
|
+
if ((_f = (_e2 = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.liveLogger) {
|
|
14876
|
+
this._player.config.teaTracker.liveLogger.sendLog({
|
|
14877
|
+
event_key: "play_method_call_error",
|
|
14878
|
+
error: error2.message || String(error2)
|
|
14879
|
+
});
|
|
14880
|
+
}
|
|
14881
|
+
throw error2;
|
|
14882
|
+
}
|
|
14850
14883
|
}
|
|
14851
14884
|
/** {zh}
|
|
14852
14885
|
* @brief 调用此方法暂停播放。
|
|
@@ -55386,10 +55419,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
55386
55419
|
device_id: deviceId,
|
|
55387
55420
|
error_report_stop: true,
|
|
55388
55421
|
ext: {
|
|
55389
|
-
veplayer_version: "2.10.1",
|
|
55422
|
+
veplayer_version: "2.10.2-rc.1",
|
|
55390
55423
|
flv_version: "3.0.23-rc.6",
|
|
55391
55424
|
hls_version: "3.0.21-rc.21",
|
|
55392
|
-
rts_version: "0.2.1-alpha.
|
|
55425
|
+
rts_version: "0.2.1-alpha.53"
|
|
55393
55426
|
}
|
|
55394
55427
|
});
|
|
55395
55428
|
}
|
|
@@ -55898,7 +55931,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
55898
55931
|
}
|
|
55899
55932
|
async canPlay() {
|
|
55900
55933
|
return {
|
|
55901
|
-
canPlay: isFLVSupported()
|
|
55934
|
+
canPlay: isFLVSupported(),
|
|
55935
|
+
extraInfo: {
|
|
55936
|
+
isFLVSupported: isFLVSupported()
|
|
55937
|
+
}
|
|
55902
55938
|
};
|
|
55903
55939
|
}
|
|
55904
55940
|
shouldFallbackWhenStall() {
|
|
@@ -56366,7 +56402,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
56366
56402
|
isRTMSupportCodec()
|
|
56367
56403
|
]);
|
|
56368
56404
|
return {
|
|
56369
|
-
canPlay: isSupported && isSupportCodec
|
|
56405
|
+
canPlay: isSupported && isSupportCodec,
|
|
56406
|
+
extraInfo: {
|
|
56407
|
+
isRTMSupported: isSupported,
|
|
56408
|
+
isRTMSupportCodec: isSupportCodec
|
|
56409
|
+
}
|
|
56370
56410
|
};
|
|
56371
56411
|
}
|
|
56372
56412
|
shouldFallbackWhenStall() {
|
|
@@ -56422,16 +56462,20 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
56422
56462
|
this.current = this._getStartProtocol();
|
|
56423
56463
|
}
|
|
56424
56464
|
// 获取最终返回的播放类型和参数。
|
|
56425
|
-
async getProtocol() {
|
|
56465
|
+
async getProtocol(protocolCanPlayResults = {}) {
|
|
56426
56466
|
if (!this.current) {
|
|
56427
56467
|
return;
|
|
56428
56468
|
}
|
|
56429
|
-
const { canPlay } = await this.current.canPlay() ?? {};
|
|
56469
|
+
const { canPlay, extraInfo } = await this.current.canPlay() ?? {};
|
|
56470
|
+
protocolCanPlayResults[this.current.protocolType] = {
|
|
56471
|
+
canPlay,
|
|
56472
|
+
...extraInfo
|
|
56473
|
+
};
|
|
56430
56474
|
if (canPlay) {
|
|
56431
56475
|
return this.current;
|
|
56432
56476
|
}
|
|
56433
56477
|
this.next();
|
|
56434
|
-
return this.getProtocol();
|
|
56478
|
+
return this.getProtocol(protocolCanPlayResults);
|
|
56435
56479
|
}
|
|
56436
56480
|
// 降级时,将指针指到上次结束的位置
|
|
56437
56481
|
next() {
|
|
@@ -62298,6 +62342,8 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62298
62342
|
__publicField(this, "_selector");
|
|
62299
62343
|
__publicField(this, "_protocol");
|
|
62300
62344
|
__publicField(this, "_playlistMap", {});
|
|
62345
|
+
// 存储每个协议的 canPlay 检查结果
|
|
62346
|
+
__publicField(this, "_protocolCanPlayResults", {});
|
|
62301
62347
|
this._options = options;
|
|
62302
62348
|
this._init({
|
|
62303
62349
|
url: options.url,
|
|
@@ -62310,6 +62356,10 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62310
62356
|
get protocol() {
|
|
62311
62357
|
return this._protocol;
|
|
62312
62358
|
}
|
|
62359
|
+
// 获取协议选择过程中每个协议的 canPlay 检查结果
|
|
62360
|
+
get protocolCanPlayResults() {
|
|
62361
|
+
return this._protocolCanPlayResults;
|
|
62362
|
+
}
|
|
62313
62363
|
get queue() {
|
|
62314
62364
|
var _a;
|
|
62315
62365
|
return (_a = this._selector) == null ? void 0 : _a._queue;
|
|
@@ -62357,8 +62407,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62357
62407
|
return { protocolMap, playlistMap };
|
|
62358
62408
|
}
|
|
62359
62409
|
async getProtocol() {
|
|
62410
|
+
this._protocolCanPlayResults = {};
|
|
62360
62411
|
if (this._selector) {
|
|
62361
|
-
this._protocol = await this._selector.getProtocol(
|
|
62412
|
+
this._protocol = await this._selector.getProtocol(
|
|
62413
|
+
this._protocolCanPlayResults
|
|
62414
|
+
);
|
|
62362
62415
|
}
|
|
62363
62416
|
return this._protocol;
|
|
62364
62417
|
}
|
|
@@ -62463,7 +62516,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62463
62516
|
__publicField(this, "player");
|
|
62464
62517
|
__publicField(this, "protocolManager");
|
|
62465
62518
|
__publicField(this, "beforeFallbackError", async (error2) => {
|
|
62466
|
-
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2;
|
|
62519
|
+
var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2, _o;
|
|
62467
62520
|
if (!((_b = (_a = this.protocolManager) == null ? void 0 : _a.protocol) == null ? void 0 : _b.shouldFallbackWhenError({ error: error2 })) || !((_d = (_c = this.protocolManager) == null ? void 0 : _c.protocol) == null ? void 0 : _d.nextProtocol)) {
|
|
62468
62521
|
return { canEmitError: true };
|
|
62469
62522
|
}
|
|
@@ -62484,13 +62537,22 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
62484
62537
|
}
|
|
62485
62538
|
});
|
|
62486
62539
|
this.fallback();
|
|
62487
|
-
|
|
62540
|
+
let canplayStr = "";
|
|
62541
|
+
try {
|
|
62542
|
+
canplayStr = JSON.stringify((_l = this.protocolManager) == null ? void 0 : _l.protocolCanPlayResults);
|
|
62543
|
+
canplayStr = `json:${canplayStr}`;
|
|
62544
|
+
} catch (e2) {
|
|
62545
|
+
console.warn("Failed to stringify protocolCanPlayResults:", e2);
|
|
62546
|
+
canplayStr = "json:{}";
|
|
62547
|
+
}
|
|
62548
|
+
(_o = teaTracker.liveLogger) == null ? void 0 : _o.sendLog({
|
|
62488
62549
|
event_key: "fallback",
|
|
62489
62550
|
playlist: this.protocolManager.playlist,
|
|
62490
62551
|
code: error2.errorCode,
|
|
62491
62552
|
message: error2.message,
|
|
62492
62553
|
// 降级的协议
|
|
62493
|
-
protocol: (
|
|
62554
|
+
protocol: (_n2 = (_m = this.protocolManager) == null ? void 0 : _m.protocol) == null ? void 0 : _n2.protocolType,
|
|
62555
|
+
canplay: canplayStr
|
|
62494
62556
|
});
|
|
62495
62557
|
return { canEmitError: false };
|
|
62496
62558
|
});
|
|
@@ -72724,9 +72786,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72724
72786
|
logger: options.logger,
|
|
72725
72787
|
appId: ((_c = options.logger) == null ? void 0 : _c.appId) || 654925,
|
|
72726
72788
|
syncWaitSettings: false,
|
|
72727
|
-
strategies: {
|
|
72728
|
-
rtmAdaptiveBuffer: true
|
|
72729
|
-
}
|
|
72789
|
+
strategies: {}
|
|
72730
72790
|
});
|
|
72731
72791
|
if (!teaTracker.tea) {
|
|
72732
72792
|
teaTracker.init(options.logger);
|
|
@@ -72774,6 +72834,14 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72774
72834
|
},
|
|
72775
72835
|
VePlayerLive
|
|
72776
72836
|
);
|
|
72837
|
+
let canplayStr = "";
|
|
72838
|
+
try {
|
|
72839
|
+
canplayStr = JSON.stringify(protocolManager.protocolCanPlayResults);
|
|
72840
|
+
canplayStr = `json:${canplayStr}`;
|
|
72841
|
+
} catch (e2) {
|
|
72842
|
+
console.warn("Failed to stringify protocolCanPlayResults:", e2);
|
|
72843
|
+
canplayStr = "json:{}";
|
|
72844
|
+
}
|
|
72777
72845
|
(_h = teaTracker.liveLogger) == null ? void 0 : _h.sendLog({
|
|
72778
72846
|
event_key: "initial_info",
|
|
72779
72847
|
// 是否开启多 Source
|
|
@@ -72784,10 +72852,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72784
72852
|
// 初始化 protocol
|
|
72785
72853
|
protocol: (_g = protocolManager.protocol) == null ? void 0 : _g.protocolType
|
|
72786
72854
|
},
|
|
72787
|
-
|
|
72788
|
-
isRTMSupportCodec: await isRTMSupportCodec(),
|
|
72789
|
-
isRTMSupported: await isRTMSupported(),
|
|
72790
|
-
isFLVSupported: isFLVSupported()
|
|
72855
|
+
canplay: canplayStr
|
|
72791
72856
|
});
|
|
72792
72857
|
player._protocolManager = protocolManager;
|
|
72793
72858
|
fallback.initErrorFallback(player, protocolManager);
|
|
@@ -72823,7 +72888,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
|
|
|
72823
72888
|
}
|
|
72824
72889
|
await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
|
|
72825
72890
|
...options,
|
|
72826
|
-
playerVersion: "2.10.1",
|
|
72891
|
+
playerVersion: "2.10.2-rc.1",
|
|
72827
72892
|
type: "LIVE"
|
|
72828
72893
|
}));
|
|
72829
72894
|
return liveVeStrategy.veStrategyManager;
|