@volcengine/veplayer 2.10.2-rc.0 → 2.10.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/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>;
@@ -13427,7 +13427,7 @@ curry.placeholder = {};
13427
13427
  var lodash_curry = curry;
13428
13428
  var curry$1 = /* @__PURE__ */ getDefaultExportFromCjs$3(lodash_curry);
13429
13429
  const src = import.meta.url;
13430
- const baseUrl = src == null ? void 0 : src.slice(0, src == null ? void 0 : src.lastIndexOf("/"));
13430
+ const baseUrl = src.slice(0, src.lastIndexOf("/"));
13431
13431
  const loader = new Loader({
13432
13432
  baseUrl
13433
13433
  });
@@ -13718,11 +13718,17 @@ class Autoplay extends Plugin {
13718
13718
  }
13719
13719
  // 自动播放失败事件回调
13720
13720
  handleAutoplayPrevented() {
13721
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l;
13721
13722
  if (this._state.mode === 0) {
13722
13723
  console.warn("unmute autoplay fail");
13723
13724
  this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
13724
13725
  mode: "unmute"
13725
13726
  });
13727
+ (_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({
13728
+ event_key: "autoplay_error",
13729
+ message: BaseEvents.AUTOPLAY_FAIL,
13730
+ mode: "unmute"
13731
+ });
13726
13732
  if (isAndroid$1 && isWeixin) {
13727
13733
  this._state.mode = 2;
13728
13734
  return;
@@ -13738,12 +13744,22 @@ class Autoplay extends Plugin {
13738
13744
  mode: "mute"
13739
13745
  });
13740
13746
  this._state.mode = 2;
13747
+ (_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({
13748
+ event_key: "autoplay_error",
13749
+ message: BaseEvents.AUTOPLAY_FAIL,
13750
+ mode: "mute"
13751
+ });
13741
13752
  return;
13742
13753
  }
13743
13754
  if (this._state.mode === 2) {
13744
13755
  this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
13745
13756
  mode: "noSupport"
13746
13757
  });
13758
+ (_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({
13759
+ event_key: "autoplay_error",
13760
+ message: BaseEvents.AUTOPLAY_FAIL,
13761
+ mode: "noSupport"
13762
+ });
13747
13763
  console.warn("not support autoplay");
13748
13764
  return;
13749
13765
  }
@@ -14560,7 +14576,7 @@ class VePlayerBase {
14560
14576
  * @brief Retrieve the player SDK version number.
14561
14577
  */
14562
14578
  get playerVersion() {
14563
- return "2.10.2-rc.0";
14579
+ return "2.10.2";
14564
14580
  }
14565
14581
  /** {zh}
14566
14582
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -14840,9 +14856,26 @@ class VePlayerBase {
14840
14856
  /** {en}
14841
14857
  * @brief Starts playback.
14842
14858
  */
14843
- play() {
14859
+ async play() {
14860
+ var _a, _b, _c, _d, _e2, _f;
14844
14861
  /* istanbul ignore next -- @preserve */
14845
- return this._player.play();
14862
+ try {
14863
+ if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
14864
+ this._player.config.teaTracker.liveLogger.sendLog({
14865
+ event_key: "play_method_call"
14866
+ });
14867
+ }
14868
+ const result = await this._player.play();
14869
+ return result;
14870
+ } catch (error2) {
14871
+ if ((_f = (_e2 = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.liveLogger) {
14872
+ this._player.config.teaTracker.liveLogger.sendLog({
14873
+ event_key: "play_method_call_error",
14874
+ error: error2.message || String(error2)
14875
+ });
14876
+ }
14877
+ throw error2;
14878
+ }
14846
14879
  }
14847
14880
  /** {zh}
14848
14881
  * @brief 调用此方法暂停播放。
@@ -55382,10 +55415,10 @@ let Logger$1 = class Logger2 extends Plugin {
55382
55415
  device_id: deviceId,
55383
55416
  error_report_stop: true,
55384
55417
  ext: {
55385
- veplayer_version: "2.10.2-rc.0",
55418
+ veplayer_version: "2.10.2",
55386
55419
  flv_version: "3.0.23-rc.6",
55387
55420
  hls_version: "3.0.21-rc.21",
55388
- rts_version: "0.2.1-alpha.51"
55421
+ rts_version: "0.2.1-alpha.53"
55389
55422
  }
55390
55423
  });
55391
55424
  }
@@ -55894,7 +55927,10 @@ class FlvProtocol extends BaseProtocol {
55894
55927
  }
55895
55928
  async canPlay() {
55896
55929
  return {
55897
- canPlay: isFLVSupported()
55930
+ canPlay: isFLVSupported(),
55931
+ extraInfo: {
55932
+ isFLVSupported: isFLVSupported()
55933
+ }
55898
55934
  };
55899
55935
  }
55900
55936
  shouldFallbackWhenStall() {
@@ -56362,7 +56398,11 @@ class RtmProtocol extends BaseProtocol {
56362
56398
  isRTMSupportCodec()
56363
56399
  ]);
56364
56400
  return {
56365
- canPlay: isSupported && isSupportCodec
56401
+ canPlay: isSupported && isSupportCodec,
56402
+ extraInfo: {
56403
+ isRTMSupported: isSupported,
56404
+ isRTMSupportCodec: isSupportCodec
56405
+ }
56366
56406
  };
56367
56407
  }
56368
56408
  shouldFallbackWhenStall() {
@@ -56418,16 +56458,20 @@ class ProtocolSelector {
56418
56458
  this.current = this._getStartProtocol();
56419
56459
  }
56420
56460
  // 获取最终返回的播放类型和参数。
56421
- async getProtocol() {
56461
+ async getProtocol(protocolCanPlayResults = {}) {
56422
56462
  if (!this.current) {
56423
56463
  return;
56424
56464
  }
56425
- const { canPlay } = await this.current.canPlay() ?? {};
56465
+ const { canPlay, extraInfo } = await this.current.canPlay() ?? {};
56466
+ protocolCanPlayResults[this.current.protocolType] = {
56467
+ canPlay,
56468
+ ...extraInfo
56469
+ };
56426
56470
  if (canPlay) {
56427
56471
  return this.current;
56428
56472
  }
56429
56473
  this.next();
56430
- return this.getProtocol();
56474
+ return this.getProtocol(protocolCanPlayResults);
56431
56475
  }
56432
56476
  // 降级时,将指针指到上次结束的位置
56433
56477
  next() {
@@ -62294,6 +62338,8 @@ const _ProtocolManager = class {
62294
62338
  __publicField(this, "_selector");
62295
62339
  __publicField(this, "_protocol");
62296
62340
  __publicField(this, "_playlistMap", {});
62341
+ // 存储每个协议的 canPlay 检查结果
62342
+ __publicField(this, "_protocolCanPlayResults", {});
62297
62343
  this._options = options;
62298
62344
  this._init({
62299
62345
  url: options.url,
@@ -62306,6 +62352,10 @@ const _ProtocolManager = class {
62306
62352
  get protocol() {
62307
62353
  return this._protocol;
62308
62354
  }
62355
+ // 获取协议选择过程中每个协议的 canPlay 检查结果
62356
+ get protocolCanPlayResults() {
62357
+ return this._protocolCanPlayResults;
62358
+ }
62309
62359
  get queue() {
62310
62360
  var _a;
62311
62361
  return (_a = this._selector) == null ? void 0 : _a._queue;
@@ -62353,8 +62403,11 @@ const _ProtocolManager = class {
62353
62403
  return { protocolMap, playlistMap };
62354
62404
  }
62355
62405
  async getProtocol() {
62406
+ this._protocolCanPlayResults = {};
62356
62407
  if (this._selector) {
62357
- this._protocol = await this._selector.getProtocol();
62408
+ this._protocol = await this._selector.getProtocol(
62409
+ this._protocolCanPlayResults
62410
+ );
62358
62411
  }
62359
62412
  return this._protocol;
62360
62413
  }
@@ -62459,7 +62512,7 @@ class Fallback {
62459
62512
  __publicField(this, "player");
62460
62513
  __publicField(this, "protocolManager");
62461
62514
  __publicField(this, "beforeFallbackError", async (error2) => {
62462
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2;
62515
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2, _o;
62463
62516
  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)) {
62464
62517
  return { canEmitError: true };
62465
62518
  }
@@ -62480,13 +62533,22 @@ class Fallback {
62480
62533
  }
62481
62534
  });
62482
62535
  this.fallback();
62483
- (_n2 = teaTracker.liveLogger) == null ? void 0 : _n2.sendLog({
62536
+ let canplayStr = "";
62537
+ try {
62538
+ canplayStr = JSON.stringify((_l = this.protocolManager) == null ? void 0 : _l.protocolCanPlayResults);
62539
+ canplayStr = `json:${canplayStr}`;
62540
+ } catch (e2) {
62541
+ console.warn("Failed to stringify protocolCanPlayResults:", e2);
62542
+ canplayStr = "json:{}";
62543
+ }
62544
+ (_o = teaTracker.liveLogger) == null ? void 0 : _o.sendLog({
62484
62545
  event_key: "fallback",
62485
62546
  playlist: this.protocolManager.playlist,
62486
62547
  code: error2.errorCode,
62487
62548
  message: error2.message,
62488
62549
  // 降级的协议
62489
- protocol: (_m = (_l = this.protocolManager) == null ? void 0 : _l.protocol) == null ? void 0 : _m.protocolType
62550
+ protocol: (_n2 = (_m = this.protocolManager) == null ? void 0 : _m.protocol) == null ? void 0 : _n2.protocolType,
62551
+ canplay: canplayStr
62490
62552
  });
62491
62553
  return { canEmitError: false };
62492
62554
  });
@@ -72714,9 +72776,7 @@ async function createLivePlayer(options) {
72714
72776
  logger: options.logger,
72715
72777
  appId: ((_c = options.logger) == null ? void 0 : _c.appId) || 654925,
72716
72778
  syncWaitSettings: false,
72717
- strategies: {
72718
- rtmAdaptiveBuffer: true
72719
- }
72779
+ strategies: {}
72720
72780
  });
72721
72781
  if (!teaTracker.tea) {
72722
72782
  teaTracker.init(options.logger);
@@ -72764,6 +72824,14 @@ async function createLivePlayer(options) {
72764
72824
  },
72765
72825
  VePlayerLive
72766
72826
  );
72827
+ let canplayStr = "";
72828
+ try {
72829
+ canplayStr = JSON.stringify(protocolManager.protocolCanPlayResults);
72830
+ canplayStr = `json:${canplayStr}`;
72831
+ } catch (e2) {
72832
+ console.warn("Failed to stringify protocolCanPlayResults:", e2);
72833
+ canplayStr = "json:{}";
72834
+ }
72767
72835
  (_h = teaTracker.liveLogger) == null ? void 0 : _h.sendLog({
72768
72836
  event_key: "initial_info",
72769
72837
  // 是否开启多 Source
@@ -72774,10 +72842,7 @@ async function createLivePlayer(options) {
72774
72842
  // 初始化 protocol
72775
72843
  protocol: (_g = protocolManager.protocol) == null ? void 0 : _g.protocolType
72776
72844
  },
72777
- // 协议支持相关
72778
- isRTMSupportCodec: await isRTMSupportCodec(),
72779
- isRTMSupported: await isRTMSupported(),
72780
- isFLVSupported: isFLVSupported()
72845
+ canplay: canplayStr
72781
72846
  });
72782
72847
  player._protocolManager = protocolManager;
72783
72848
  fallback.initErrorFallback(player, protocolManager);
@@ -72813,7 +72878,7 @@ async function prepare(options) {
72813
72878
  }
72814
72879
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
72815
72880
  ...options,
72816
- playerVersion: "2.10.2-rc.0",
72881
+ playerVersion: "2.10.2",
72817
72882
  type: "LIVE"
72818
72883
  }));
72819
72884
  return liveVeStrategy.veStrategyManager;
@@ -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>;
@@ -13427,7 +13427,7 @@ curry.placeholder = {};
13427
13427
  var lodash_curry = curry;
13428
13428
  var curry$1 = /* @__PURE__ */ getDefaultExportFromCjs$3(lodash_curry);
13429
13429
  const src = import.meta.url;
13430
- const baseUrl = src == null ? void 0 : src.slice(0, src == null ? void 0 : src.lastIndexOf("/"));
13430
+ const baseUrl = src.slice(0, src.lastIndexOf("/"));
13431
13431
  const loader = new Loader({
13432
13432
  baseUrl
13433
13433
  });
@@ -13718,11 +13718,17 @@ class Autoplay extends Plugin {
13718
13718
  }
13719
13719
  // 自动播放失败事件回调
13720
13720
  handleAutoplayPrevented() {
13721
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l;
13721
13722
  if (this._state.mode === 0) {
13722
13723
  console.warn("unmute autoplay fail");
13723
13724
  this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
13724
13725
  mode: "unmute"
13725
13726
  });
13727
+ (_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({
13728
+ event_key: "autoplay_error",
13729
+ message: BaseEvents.AUTOPLAY_FAIL,
13730
+ mode: "unmute"
13731
+ });
13726
13732
  if (isAndroid$1 && isWeixin) {
13727
13733
  this._state.mode = 2;
13728
13734
  return;
@@ -13738,12 +13744,22 @@ class Autoplay extends Plugin {
13738
13744
  mode: "mute"
13739
13745
  });
13740
13746
  this._state.mode = 2;
13747
+ (_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({
13748
+ event_key: "autoplay_error",
13749
+ message: BaseEvents.AUTOPLAY_FAIL,
13750
+ mode: "mute"
13751
+ });
13741
13752
  return;
13742
13753
  }
13743
13754
  if (this._state.mode === 2) {
13744
13755
  this.player.emit(BaseEvents.AUTOPLAY_FAIL, {
13745
13756
  mode: "noSupport"
13746
13757
  });
13758
+ (_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({
13759
+ event_key: "autoplay_error",
13760
+ message: BaseEvents.AUTOPLAY_FAIL,
13761
+ mode: "noSupport"
13762
+ });
13747
13763
  console.warn("not support autoplay");
13748
13764
  return;
13749
13765
  }
@@ -14560,7 +14576,7 @@ class VePlayerBase {
14560
14576
  * @brief Retrieve the player SDK version number.
14561
14577
  */
14562
14578
  get playerVersion() {
14563
- return "2.10.2-rc.0";
14579
+ return "2.10.2";
14564
14580
  }
14565
14581
  /** {zh}
14566
14582
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -14840,9 +14856,26 @@ class VePlayerBase {
14840
14856
  /** {en}
14841
14857
  * @brief Starts playback.
14842
14858
  */
14843
- play() {
14859
+ async play() {
14860
+ var _a, _b, _c, _d, _e2, _f;
14844
14861
  /* istanbul ignore next -- @preserve */
14845
- return this._player.play();
14862
+ try {
14863
+ if ((_c = (_b = (_a = this._player) == null ? void 0 : _a.config) == null ? void 0 : _b.teaTracker) == null ? void 0 : _c.liveLogger) {
14864
+ this._player.config.teaTracker.liveLogger.sendLog({
14865
+ event_key: "play_method_call"
14866
+ });
14867
+ }
14868
+ const result = await this._player.play();
14869
+ return result;
14870
+ } catch (error2) {
14871
+ if ((_f = (_e2 = (_d = this._player) == null ? void 0 : _d.config) == null ? void 0 : _e2.teaTracker) == null ? void 0 : _f.liveLogger) {
14872
+ this._player.config.teaTracker.liveLogger.sendLog({
14873
+ event_key: "play_method_call_error",
14874
+ error: error2.message || String(error2)
14875
+ });
14876
+ }
14877
+ throw error2;
14878
+ }
14846
14879
  }
14847
14880
  /** {zh}
14848
14881
  * @brief 调用此方法暂停播放。
@@ -55382,10 +55415,10 @@ let Logger$1 = class Logger2 extends Plugin {
55382
55415
  device_id: deviceId,
55383
55416
  error_report_stop: true,
55384
55417
  ext: {
55385
- veplayer_version: "2.10.2-rc.0",
55418
+ veplayer_version: "2.10.2",
55386
55419
  flv_version: "3.0.23-rc.6",
55387
55420
  hls_version: "3.0.21-rc.21",
55388
- rts_version: "0.2.1-alpha.51"
55421
+ rts_version: "0.2.1-alpha.53"
55389
55422
  }
55390
55423
  });
55391
55424
  }
@@ -55900,7 +55933,10 @@ class FlvProtocol extends BaseProtocol {
55900
55933
  }
55901
55934
  async canPlay() {
55902
55935
  return {
55903
- canPlay: isFLVSupported()
55936
+ canPlay: isFLVSupported(),
55937
+ extraInfo: {
55938
+ isFLVSupported: isFLVSupported()
55939
+ }
55904
55940
  };
55905
55941
  }
55906
55942
  shouldFallbackWhenStall() {
@@ -56368,7 +56404,11 @@ class RtmProtocol extends BaseProtocol {
56368
56404
  isRTMSupportCodec()
56369
56405
  ]);
56370
56406
  return {
56371
- canPlay: isSupported && isSupportCodec
56407
+ canPlay: isSupported && isSupportCodec,
56408
+ extraInfo: {
56409
+ isRTMSupported: isSupported,
56410
+ isRTMSupportCodec: isSupportCodec
56411
+ }
56372
56412
  };
56373
56413
  }
56374
56414
  shouldFallbackWhenStall() {
@@ -56424,16 +56464,20 @@ class ProtocolSelector {
56424
56464
  this.current = this._getStartProtocol();
56425
56465
  }
56426
56466
  // 获取最终返回的播放类型和参数。
56427
- async getProtocol() {
56467
+ async getProtocol(protocolCanPlayResults = {}) {
56428
56468
  if (!this.current) {
56429
56469
  return;
56430
56470
  }
56431
- const { canPlay } = await this.current.canPlay() ?? {};
56471
+ const { canPlay, extraInfo } = await this.current.canPlay() ?? {};
56472
+ protocolCanPlayResults[this.current.protocolType] = {
56473
+ canPlay,
56474
+ ...extraInfo
56475
+ };
56432
56476
  if (canPlay) {
56433
56477
  return this.current;
56434
56478
  }
56435
56479
  this.next();
56436
- return this.getProtocol();
56480
+ return this.getProtocol(protocolCanPlayResults);
56437
56481
  }
56438
56482
  // 降级时,将指针指到上次结束的位置
56439
56483
  next() {
@@ -62300,6 +62344,8 @@ const _ProtocolManager = class {
62300
62344
  __publicField(this, "_selector");
62301
62345
  __publicField(this, "_protocol");
62302
62346
  __publicField(this, "_playlistMap", {});
62347
+ // 存储每个协议的 canPlay 检查结果
62348
+ __publicField(this, "_protocolCanPlayResults", {});
62303
62349
  this._options = options;
62304
62350
  this._init({
62305
62351
  url: options.url,
@@ -62312,6 +62358,10 @@ const _ProtocolManager = class {
62312
62358
  get protocol() {
62313
62359
  return this._protocol;
62314
62360
  }
62361
+ // 获取协议选择过程中每个协议的 canPlay 检查结果
62362
+ get protocolCanPlayResults() {
62363
+ return this._protocolCanPlayResults;
62364
+ }
62315
62365
  get queue() {
62316
62366
  var _a;
62317
62367
  return (_a = this._selector) == null ? void 0 : _a._queue;
@@ -62359,8 +62409,11 @@ const _ProtocolManager = class {
62359
62409
  return { protocolMap, playlistMap };
62360
62410
  }
62361
62411
  async getProtocol() {
62412
+ this._protocolCanPlayResults = {};
62362
62413
  if (this._selector) {
62363
- this._protocol = await this._selector.getProtocol();
62414
+ this._protocol = await this._selector.getProtocol(
62415
+ this._protocolCanPlayResults
62416
+ );
62364
62417
  }
62365
62418
  return this._protocol;
62366
62419
  }
@@ -62465,7 +62518,7 @@ class Fallback {
62465
62518
  __publicField(this, "player");
62466
62519
  __publicField(this, "protocolManager");
62467
62520
  __publicField(this, "beforeFallbackError", async (error2) => {
62468
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2;
62521
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i2, _j, _k, _l, _m, _n2, _o;
62469
62522
  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)) {
62470
62523
  return { canEmitError: true };
62471
62524
  }
@@ -62486,13 +62539,22 @@ class Fallback {
62486
62539
  }
62487
62540
  });
62488
62541
  this.fallback();
62489
- (_n2 = teaTracker.liveLogger) == null ? void 0 : _n2.sendLog({
62542
+ let canplayStr = "";
62543
+ try {
62544
+ canplayStr = JSON.stringify((_l = this.protocolManager) == null ? void 0 : _l.protocolCanPlayResults);
62545
+ canplayStr = `json:${canplayStr}`;
62546
+ } catch (e2) {
62547
+ console.warn("Failed to stringify protocolCanPlayResults:", e2);
62548
+ canplayStr = "json:{}";
62549
+ }
62550
+ (_o = teaTracker.liveLogger) == null ? void 0 : _o.sendLog({
62490
62551
  event_key: "fallback",
62491
62552
  playlist: this.protocolManager.playlist,
62492
62553
  code: error2.errorCode,
62493
62554
  message: error2.message,
62494
62555
  // 降级的协议
62495
- protocol: (_m = (_l = this.protocolManager) == null ? void 0 : _l.protocol) == null ? void 0 : _m.protocolType
62556
+ protocol: (_n2 = (_m = this.protocolManager) == null ? void 0 : _m.protocol) == null ? void 0 : _n2.protocolType,
62557
+ canplay: canplayStr
62496
62558
  });
62497
62559
  return { canEmitError: false };
62498
62560
  });
@@ -72720,9 +72782,7 @@ async function createLivePlayer(options) {
72720
72782
  logger: options.logger,
72721
72783
  appId: ((_c = options.logger) == null ? void 0 : _c.appId) || 654925,
72722
72784
  syncWaitSettings: false,
72723
- strategies: {
72724
- rtmAdaptiveBuffer: true
72725
- }
72785
+ strategies: {}
72726
72786
  });
72727
72787
  if (!teaTracker.tea) {
72728
72788
  teaTracker.init(options.logger);
@@ -72770,6 +72830,14 @@ async function createLivePlayer(options) {
72770
72830
  },
72771
72831
  VePlayerLive
72772
72832
  );
72833
+ let canplayStr = "";
72834
+ try {
72835
+ canplayStr = JSON.stringify(protocolManager.protocolCanPlayResults);
72836
+ canplayStr = `json:${canplayStr}`;
72837
+ } catch (e2) {
72838
+ console.warn("Failed to stringify protocolCanPlayResults:", e2);
72839
+ canplayStr = "json:{}";
72840
+ }
72773
72841
  (_h = teaTracker.liveLogger) == null ? void 0 : _h.sendLog({
72774
72842
  event_key: "initial_info",
72775
72843
  // 是否开启多 Source
@@ -72780,10 +72848,7 @@ async function createLivePlayer(options) {
72780
72848
  // 初始化 protocol
72781
72849
  protocol: (_g = protocolManager.protocol) == null ? void 0 : _g.protocolType
72782
72850
  },
72783
- // 协议支持相关
72784
- isRTMSupportCodec: await isRTMSupportCodec(),
72785
- isRTMSupported: await isRTMSupported(),
72786
- isFLVSupported: isFLVSupported()
72851
+ canplay: canplayStr
72787
72852
  });
72788
72853
  player._protocolManager = protocolManager;
72789
72854
  fallback.initErrorFallback(player, protocolManager);
@@ -72819,7 +72884,7 @@ async function prepare(options) {
72819
72884
  }
72820
72885
  await ((_a = liveVeStrategy.veStrategyManager) == null ? void 0 : _a.init({
72821
72886
  ...options,
72822
- playerVersion: "2.10.2-rc.0",
72887
+ playerVersion: "2.10.2",
72823
72888
  type: "LIVE"
72824
72889
  }));
72825
72890
  return liveVeStrategy.veStrategyManager;