@volcengine/veplayer 2.5.0-rc.0 → 2.5.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.
@@ -1461,7 +1461,7 @@ var __publicField = (obj, key, value) => {
1461
1461
  }
1462
1462
  }
1463
1463
  };
1464
- var version = "3.0.20-alpha.4";
1464
+ var version = "3.0.21-rc.2";
1465
1465
  var ERROR_TYPE_MAP = {
1466
1466
  1: "media",
1467
1467
  2: "media",
@@ -2812,6 +2812,18 @@ var __publicField = (obj, key, value) => {
2812
2812
  }
2813
2813
  }
2814
2814
  }
2815
+ }, {
2816
+ key: "defineMethod",
2817
+ value: function defineMethod(Obj, map) {
2818
+ for (var key in map) {
2819
+ if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
2820
+ Object.defineProperty(Obj, key, {
2821
+ configurable: true,
2822
+ value: map[key]
2823
+ });
2824
+ }
2825
+ }
2826
+ }
2815
2827
  }, {
2816
2828
  key: "defaultConfig",
2817
2829
  get: function get() {
@@ -3457,7 +3469,7 @@ var __publicField = (obj, key, value) => {
3457
3469
  if (!this.observer) {
3458
3470
  return;
3459
3471
  }
3460
- this.observer && this.observer.observe(target);
3472
+ this.observer.observe(target);
3461
3473
  var _pid = target.getAttribute(PLATER_ID);
3462
3474
  var __handlers = this.__handlers;
3463
3475
  var index = -1;
@@ -3486,16 +3498,17 @@ var __publicField = (obj, key, value) => {
3486
3498
  }
3487
3499
  });
3488
3500
  try {
3489
- this.observer && this.observer.unobserve(target);
3501
+ var _this$observer;
3502
+ (_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
3490
3503
  } catch (e2) {
3491
3504
  }
3492
- this.observer && this.observer.unobserve(target);
3493
3505
  i2 > -1 && this.__handlers.splice(i2, 1);
3494
3506
  }
3495
3507
  }, {
3496
3508
  key: "destroyObserver",
3497
3509
  value: function destroyObserver() {
3498
- this.observer && this.observer.disconnect();
3510
+ var _this$observer2;
3511
+ (_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
3499
3512
  this.observer = null;
3500
3513
  this.__handlers = null;
3501
3514
  }
@@ -3527,7 +3540,8 @@ var __publicField = (obj, key, value) => {
3527
3540
  return resizeObserver;
3528
3541
  }
3529
3542
  function unObserver(target, handler) {
3530
- resizeObserver.unObserver(target, handler);
3543
+ var _resizeObserver;
3544
+ (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
3531
3545
  }
3532
3546
  var pluginsManager = {
3533
3547
  pluginGroup: {},
@@ -5119,7 +5133,7 @@ var __publicField = (obj, key, value) => {
5119
5133
  if (!url) {
5120
5134
  url = _this8.url || _this8.config.url;
5121
5135
  }
5122
- var _furl = _this8._preProcessUrl(url);
5136
+ var _furl = _this8.preProcessUrl(url);
5123
5137
  var ret = _this8._startInit(_furl.url);
5124
5138
  return ret;
5125
5139
  }).catch(function(e2) {
@@ -5137,7 +5151,7 @@ var __publicField = (obj, key, value) => {
5137
5151
  if (util$1.typeOf(url) === "Object") {
5138
5152
  _src = url.url;
5139
5153
  }
5140
- _src = this._preProcessUrl(_src).url;
5154
+ _src = this.preProcessUrl(_src).url;
5141
5155
  var curTime = this.currentTime;
5142
5156
  this.__startTime = curTime;
5143
5157
  var isPaused = this.paused && !this.isError;
@@ -5478,7 +5492,7 @@ var __publicField = (obj, key, value) => {
5478
5492
  runHooks(this, "retry", function() {
5479
5493
  var cur = _this20.currentTime;
5480
5494
  var url = _this20.config.url;
5481
- var _srcRet = !util$1.isMSE(_this20.media) ? _this20._preProcessUrl(url) : {
5495
+ var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
5482
5496
  url
5483
5497
  };
5484
5498
  _this20.src = _srcRet.url;
@@ -6134,11 +6148,11 @@ var __publicField = (obj, key, value) => {
6134
6148
  this._state = newState;
6135
6149
  }
6136
6150
  }, {
6137
- key: "_preProcessUrl",
6138
- value: function _preProcessUrl(url, ext) {
6139
- var _this$config7 = this.config, preProcessUrl = _this$config7.preProcessUrl, preProcessUrlOptions = _this$config7.preProcessUrlOptions;
6151
+ key: "preProcessUrl",
6152
+ value: function preProcessUrl(url, ext) {
6153
+ var _this$config7 = this.config, preProcessUrl2 = _this$config7.preProcessUrl, preProcessUrlOptions = _this$config7.preProcessUrlOptions;
6140
6154
  var processUrlOptions = Object.assign({}, preProcessUrlOptions, ext);
6141
- return !util$1.isBlob(url) && typeof preProcessUrl === "function" ? preProcessUrl(url, processUrlOptions) : {
6155
+ return !util$1.isBlob(url) && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, processUrlOptions) : {
6142
6156
  url
6143
6157
  };
6144
6158
  }
@@ -6720,11 +6734,11 @@ var __publicField = (obj, key, value) => {
6720
6734
  } : error2;
6721
6735
  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"));
6722
6736
  super(message);
6723
- /**
6737
+ /** {zh}
6724
6738
  * @brief 错误码。
6725
6739
  */
6726
6740
  /** {en}
6727
- * @brief The error code.
6741
+ * @brief Error code.
6728
6742
  */
6729
6743
  __publicField(this, "errorCode");
6730
6744
  /** {zh}
@@ -8510,7 +8524,7 @@ var __publicField = (obj, key, value) => {
8510
8524
  }
8511
8525
  this.on(DURATION_CHANGE, function() {
8512
8526
  var player2 = _this2.player, config2 = _this2.config;
8513
- if (player2.duration * 1e3 < config2.moveDuration) {
8527
+ if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
8514
8528
  config2.moveDuration = player2.duration * 1e3;
8515
8529
  }
8516
8530
  });
@@ -8824,10 +8838,13 @@ var __publicField = (obj, key, value) => {
8824
8838
  }, {
8825
8839
  key: "updateBrightness",
8826
8840
  value: function updateBrightness(percent) {
8841
+ var pos = this.pos, config = this.config, xgMask = this.xgMask;
8842
+ if (!config.darkness) {
8843
+ return;
8844
+ }
8827
8845
  if (this.player.rotateDeg) {
8828
8846
  percent = -percent;
8829
8847
  }
8830
- var pos = this.pos, config = this.config, xgMask = this.xgMask;
8831
8848
  var light = pos.light + 0.8 * percent;
8832
8849
  light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
8833
8850
  if (xgMask) {
@@ -8888,12 +8905,12 @@ var __publicField = (obj, key, value) => {
8888
8905
  }, {
8889
8906
  key: "disableGesture",
8890
8907
  value: function disableGesture() {
8891
- this.config.disableGesture = false;
8908
+ this.config.disableGesture = true;
8892
8909
  }
8893
8910
  }, {
8894
8911
  key: "enableGesture",
8895
8912
  value: function enableGesture() {
8896
- this.config.disableGesture = true;
8913
+ this.config.disableGesture = false;
8897
8914
  }
8898
8915
  }, {
8899
8916
  key: "destroy",
@@ -9762,7 +9779,7 @@ var __publicField = (obj, key, value) => {
9762
9779
  }, {
9763
9780
  key: "toggleFullScreen",
9764
9781
  value: function toggleFullScreen(e2) {
9765
- if (e2) {
9782
+ if (e2 instanceof Event) {
9766
9783
  e2.preventDefault();
9767
9784
  e2.stopPropagation();
9768
9785
  }
@@ -10445,7 +10462,7 @@ var __publicField = (obj, key, value) => {
10445
10462
  key: "isPIPAvailable",
10446
10463
  value: function isPIPAvailable() {
10447
10464
  var video = this.player.media;
10448
- var _isEnabled = util$1.typeOf(document.pictureInPictureEnabled) === "Boolean" ? document.pictureInPictureEnabled : true;
10465
+ var _isEnabled = util$1.typeOf(document.pictureInPictureEnabled) === "Boolean" ? document.pictureInPictureEnabled : false;
10449
10466
  return _isEnabled && (util$1.typeOf(video.disablePictureInPicture) === "Boolean" && !video.disablePictureInPicture || video.webkitSupportsPresentationMode && util$1.typeOf(video.webkitSetPresentationMode) === "Function") || this.isDocPIPAvailable();
10450
10467
  }
10451
10468
  }, {
@@ -12900,11 +12917,15 @@ var __publicField = (obj, key, value) => {
12900
12917
  const { XGVideoPlugin } = await load(DynamicModule.PluginXgvideo);
12901
12918
  return XGVideoPlugin == null ? void 0 : XGVideoPlugin.isSupported();
12902
12919
  }
12920
+ function isMMSSupported$1() {
12921
+ return typeof ManagedMediaSource !== "undefined";
12922
+ }
12903
12923
  const util = {
12904
12924
  ...util$1,
12905
12925
  getStreamType,
12906
12926
  isMseSupported: isMseSupported$1,
12907
12927
  isSoftDecodeSupported: isSoftDecodeSupported$1,
12928
+ isMMSSupported: isMMSSupported$1,
12908
12929
  appendSearchParams,
12909
12930
  getUrlObject
12910
12931
  };
@@ -13117,7 +13138,6 @@ var __publicField = (obj, key, value) => {
13117
13138
  }
13118
13139
  // 有音量修改,取消静音
13119
13140
  handleVolumechange() {
13120
- this._state.mode = this.player.muted ? 1 : 0;
13121
13141
  if (!this._state.showUnmuteBt)
13122
13142
  return;
13123
13143
  this._state.showUnmuteBt = false;
@@ -13577,28 +13597,33 @@ var __publicField = (obj, key, value) => {
13577
13597
  useCssFullscreen: false
13578
13598
  }
13579
13599
  };
13580
- const transformOption = (options) => {
13581
- const { autoplay: autoplay2, ...rest } = options;
13582
- const xgOptions = rest;
13583
- if (xgOptions.poster) {
13584
- xgOptions.poster = escapeHtml(xgOptions.poster);
13585
- }
13586
- xgOptions.icons = {
13587
- ...DEFAULT_ICONS,
13588
- ...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
13589
- };
13590
- xgOptions.autoplay = Boolean(autoplay2);
13591
- if (autoplay2 && typeof autoplay2 !== "boolean") {
13592
- xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
13593
- xgOptions.videoAttributes = {
13594
- ...xgOptions.videoAttributes ?? {},
13595
- muted: autoplay2 == null ? void 0 : autoplay2.muted
13600
+ const transformOption = (
13601
+ /** {zh}
13602
+ * @param options 更多配置信息。
13603
+ */
13604
+ (options) => {
13605
+ const { autoplay: autoplay2, ...rest } = options;
13606
+ const xgOptions = rest;
13607
+ if (xgOptions.poster) {
13608
+ xgOptions.poster = escapeHtml(xgOptions.poster);
13609
+ }
13610
+ xgOptions.icons = {
13611
+ ...DEFAULT_ICONS,
13612
+ ...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
13596
13613
  };
13597
- xgOptions.autoplayPlugin = autoplay2;
13614
+ xgOptions.autoplay = Boolean(autoplay2);
13615
+ if (autoplay2 && typeof autoplay2 !== "boolean") {
13616
+ xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
13617
+ xgOptions.videoAttributes = {
13618
+ ...xgOptions.videoAttributes ?? {},
13619
+ muted: autoplay2 == null ? void 0 : autoplay2.muted
13620
+ };
13621
+ xgOptions.autoplayPlugin = autoplay2;
13622
+ }
13623
+ delete xgOptions.i18n;
13624
+ return xgOptions;
13598
13625
  }
13599
- delete xgOptions.i18n;
13600
- return xgOptions;
13601
- };
13626
+ );
13602
13627
  class VePlayerBase {
13603
13628
  /** {zh}
13604
13629
  * @hidden
@@ -13618,7 +13643,9 @@ var __publicField = (obj, key, value) => {
13618
13643
  this._sourceManager = options.sourceManager;
13619
13644
  this._preparePlugins = options.preparePlugins;
13620
13645
  this._previousPrepareResult = options.prepareResult;
13621
- this._i18nManager = options.i18nManager ?? new VeI18n({ i18n: options.i18n });
13646
+ this._i18nManager = options.i18nManager ?? new VeI18n({
13647
+ i18n: options.i18n
13648
+ });
13622
13649
  const xgOptions = transformOption({
13623
13650
  ...options,
13624
13651
  ...(_a = this._previousPrepareResult) == null ? void 0 : _a.options
@@ -13813,9 +13840,14 @@ var __publicField = (obj, key, value) => {
13813
13840
  /** {zh}
13814
13841
  * 获取播放器版本号
13815
13842
  * @returns
13843
+ * @brief
13844
+ * 获取播放器 SDK 版本号。
13845
+ */
13846
+ /** {en}
13847
+ * @brief Retrieve the player SDK version number.
13816
13848
  */
13817
13849
  get playerVersion() {
13818
- return "2.5.0-rc.0";
13850
+ return "2.5.0";
13819
13851
  }
13820
13852
  /** {zh}
13821
13853
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -13963,8 +13995,8 @@ var __publicField = (obj, key, value) => {
13963
13995
  }
13964
13996
  /** {zh}
13965
13997
  * @brief 调用此方法切换拉流地址、线路、清晰度。
13966
- * @param target 目标地址,可以是播放地址,也可以是线路和清晰度
13967
- * @param options 更多配置信息
13998
+ * @param target 目标地址,可以是播放地址,也可以是线路和清晰度。
13999
+ * @param options 更多配置信息。
13968
14000
  */
13969
14001
  /** {en}
13970
14002
  * @brief Switches the pull stream address, playback source, or resolution.
@@ -13975,7 +14007,9 @@ var __publicField = (obj, key, value) => {
13975
14007
  var _a, _b;
13976
14008
  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) {
13977
14009
  this._sourceManager.updateSources(target);
13978
- await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
14010
+ await this._switchUrl(target, {
14011
+ seamless: options == null ? void 0 : options.seamless
14012
+ });
13979
14013
  return this._sourceManager.definition;
13980
14014
  }
13981
14015
  const targetDefinition = this._sourceManager.find(target, options);
@@ -14002,16 +14036,15 @@ var __publicField = (obj, key, value) => {
14002
14036
  return this._switch(sourceManager.definition);
14003
14037
  }
14004
14038
  // TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
14005
- /**
14006
14039
  /** {zh}
14007
14040
  * @brief 调用此方法监听指定事件,事件处理函数只执行一次。
14008
14041
  * @param event 表示事件的名称。
14009
14042
  * @param callback 表示事件的回调函数。
14010
14043
  */
14011
14044
  /** {en}
14012
- * @brief Add a one-time listener function for the specified event.
14013
- * @param event The event name.
14014
- * @param callback The callback function for the event.
14045
+ * @brief Call this method to listen for the specified event. The event handler is executed only once.
14046
+ * @param event The name representing the event.
14047
+ * @param callback Callback functions representing events.
14015
14048
  */
14016
14049
  once(event, callback) {
14017
14050
  var _a;
@@ -14162,10 +14195,14 @@ var __publicField = (obj, key, value) => {
14162
14195
  return this._player.blur(data);
14163
14196
  }
14164
14197
  /** {zh}
14165
- * @brief 判断浏览器是否支持播放格式
14166
- * @param type 播放格式
14198
+ * @brief 判断浏览器是否支持播放格式。
14199
+ * @param type 播放格式。
14167
14200
  * @returns
14168
14201
  */
14202
+ /** {en}
14203
+ * @brief Determine whether the browser supports the playback format.
14204
+ * @param type The playback format.
14205
+ */
14169
14206
  canPlayType(type) {
14170
14207
  return this._player.canPlayType(type);
14171
14208
  }
@@ -14237,7 +14274,7 @@ var __publicField = (obj, key, value) => {
14237
14274
  }
14238
14275
  /** {zh}
14239
14276
  * @brief 调用此接口显示指定插件图标。
14240
- * @param pluginNames 插件名称
14277
+ * @param pluginNames 插件名称。
14241
14278
  */
14242
14279
  /** {en}
14243
14280
  * @brief Displays the icon of a specified plugin.
@@ -14258,7 +14295,7 @@ var __publicField = (obj, key, value) => {
14258
14295
  }
14259
14296
  /** {zh}
14260
14297
  * @brief 调用此接口隐藏指定插件图标。
14261
- * @param pluginNames 插件名称
14298
+ * @param pluginNames 插件名称。
14262
14299
  */
14263
14300
  /** {en}
14264
14301
  * @brief Hides the icon of a specified plugin.
@@ -14330,7 +14367,14 @@ var __publicField = (obj, key, value) => {
14330
14367
  this._player.once("canplay", () => {
14331
14368
  this._sourceManager.resetFallback();
14332
14369
  });
14333
- this.emit(Events$1.FALLBACK, { from: { url: preUrl }, to: { url } });
14370
+ this.emit(Events$1.FALLBACK, {
14371
+ from: {
14372
+ url: preUrl
14373
+ },
14374
+ to: {
14375
+ url
14376
+ }
14377
+ });
14334
14378
  this._switchUrl(url);
14335
14379
  }
14336
14380
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -18939,6 +18983,8 @@ var __publicField = (obj, key, value) => {
18939
18983
  }
18940
18984
  if (codec === "unknown" ? isMseSupported$1(Codec.H264) : isMseSupported$1(codec)) {
18941
18985
  mseStrategy = createFlvMseStrategy(options);
18986
+ } else if (isMMSSupported$1()) {
18987
+ mseStrategy = createFlvMssStrategy(options);
18942
18988
  }
18943
18989
  if (!mseStrategy && !softStrategy) {
18944
18990
  return {};
@@ -18991,24 +19037,38 @@ var __publicField = (obj, key, value) => {
18991
19037
  plugins: (mseModule == null ? void 0 : mseModule.HlsPlugin) ? [mseModule.HlsPlugin] : []
18992
19038
  };
18993
19039
  };
18994
- const createFlvMseStrategy = (options) => {
19040
+ const getDefaultFlvOptions = (options) => {
18995
19041
  var _a;
18996
19042
  return {
18997
- options: {
18998
- flv: {
18999
- retryCount: 0,
19000
- disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0,
19001
- ...(options == null ? void 0 : options.flv) ?? {}
19002
- }
19003
- },
19004
- module: DynamicModule.PluginFlv
19043
+ retryCount: 0,
19044
+ disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0
19005
19045
  };
19006
19046
  };
19047
+ const createFlvMseStrategy = (options) => ({
19048
+ options: {
19049
+ flv: {
19050
+ ...getDefaultFlvOptions(options),
19051
+ ...(options == null ? void 0 : options.flv) ?? {}
19052
+ }
19053
+ },
19054
+ module: DynamicModule.PluginFlv
19055
+ });
19056
+ const createFlvMssStrategy = (options) => ({
19057
+ options: {
19058
+ flv: {
19059
+ preferMMS: true,
19060
+ ...getDefaultFlvOptions(options),
19061
+ ...(options == null ? void 0 : options.flv) ?? {}
19062
+ }
19063
+ },
19064
+ module: DynamicModule.PluginFlv
19065
+ });
19007
19066
  const createHlsMseStrategy = (options) => ({
19008
19067
  options: {
19009
19068
  hls: {
19010
19069
  retryCount: 0,
19011
19070
  pollRetryCount: 0,
19071
+ allowedStreamTrackChange: false,
19012
19072
  ...(options == null ? void 0 : options.hls) ?? {}
19013
19073
  }
19014
19074
  },
@@ -22067,10 +22127,10 @@ var __publicField = (obj, key, value) => {
22067
22127
  user_id: this._userId,
22068
22128
  device_id: this._deviceId,
22069
22129
  ext: {
22070
- veplayer_version: "2.5.0-rc.0",
22071
- flv_version: "3.0.19-rc.0",
22072
- hls_version: "3.0.20-alpha.2",
22073
- rts_version: "0.2.1-alpha.0"
22130
+ veplayer_version: "2.5.0",
22131
+ flv_version: "3.0.21-rc.2",
22132
+ hls_version: "3.0.21-rc.2",
22133
+ rts_version: "0.2.1-alpha.12"
22074
22134
  }
22075
22135
  });
22076
22136
  }
@@ -22398,7 +22458,9 @@ var __publicField = (obj, key, value) => {
22398
22458
  }
22399
22459
  ]);
22400
22460
  const LIVE_DEFAULT_OPTIONS = {
22401
- autoplay: { muted: true }
22461
+ autoplay: {
22462
+ muted: true
22463
+ }
22402
22464
  };
22403
22465
  const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
22404
22466
  var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
@@ -22418,7 +22480,10 @@ var __publicField = (obj, key, value) => {
22418
22480
  super(options);
22419
22481
  }
22420
22482
  /** {zh}
22421
- * @brief 获取已经播放的时间
22483
+ * @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
22484
+ */
22485
+ /** {en}
22486
+ * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
22422
22487
  */
22423
22488
  get playTime() {
22424
22489
  var _a, _b, _c, _d;
@@ -22477,7 +22542,10 @@ var __publicField = (obj, key, value) => {
22477
22542
  (_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
22478
22543
  }
22479
22544
  /** {zh}
22480
- * @brief 打开 Abr
22545
+ * @brief 打开码率自适应(ABR)切换功能。
22546
+ */
22547
+ /** {en}
22548
+ * @brief Enable the Adaptive Bitrate Streaming (ABR) switching feature.
22481
22549
  */
22482
22550
  openAbr() {
22483
22551
  var _a, _b, _c, _d;
@@ -22491,7 +22559,10 @@ var __publicField = (obj, key, value) => {
22491
22559
  }
22492
22560
  }
22493
22561
  /** {zh}
22494
- * @brief 关闭 Abr
22562
+ * @brief 关闭码率自适应(ABR)切换功能。
22563
+ */
22564
+ /** {en}
22565
+ * @brief Disable the Adaptive Bitrate Streaming (ABR) switching feature.
22495
22566
  */
22496
22567
  closeAbr() {
22497
22568
  var _a, _b, _c, _d;
@@ -22505,18 +22576,25 @@ var __publicField = (obj, key, value) => {
22505
22576
  }
22506
22577
  }
22507
22578
  /** {zh}
22508
- * @brief 调用此方法更新 DRM 鉴权配置。
22509
- * @hidden
22579
+ * @brief 调用此方法更新 DRM 配置。
22580
+ */
22581
+ /** {en}
22582
+ * @brief Use this method to update DRM configuration.
22583
+ * @param config
22510
22584
  */
22511
22585
  updateDrmConfig(config) {
22512
22586
  var _a, _b, _c;
22513
22587
  (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
22514
22588
  }
22515
22589
  /** {zh}
22516
- * @brief 切换 flv Abr
22517
- * @param options 切换 Abr 的配置。
22590
+ * @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
22591
+ * @param options ABR 的配置。
22518
22592
  * @returns
22519
22593
  */
22594
+ /** {en}
22595
+ * @brief Modify ABR configuration, including enabling or disabling the ABR feature and adjusting other resolutions.
22596
+ * @param options Configuration of ABR.
22597
+ */
22520
22598
  switchAbr(options) {
22521
22599
  var _a, _b;
22522
22600
  if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
@@ -22527,7 +22605,9 @@ var __publicField = (obj, key, value) => {
22527
22605
  if (!url) {
22528
22606
  return;
22529
22607
  }
22530
- this.switch(url, { seamless: true });
22608
+ this.switch(url, {
22609
+ seamless: true
22610
+ });
22531
22611
  this._player.plugins.abr.bitrate = options.bitrate;
22532
22612
  }
22533
22613
  if (typeof (options == null ? void 0 : options.enable) !== "undefined") {
@@ -22535,25 +22615,34 @@ var __publicField = (obj, key, value) => {
22535
22615
  }
22536
22616
  }
22537
22617
  /** {zh}
22538
- * @brief 获取 RTM 的网络相关信息
22618
+ * @brief 获取 RTM 拉流的网络评估信息。
22539
22619
  * @returns
22540
22620
  */
22621
+ /** {en}
22622
+ * @brief Obtain the network assessment information of RTM pull streaming.
22623
+ */
22541
22624
  getRTMNetWorkInfo() {
22542
22625
  var _a, _b, _c;
22543
22626
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
22544
22627
  }
22545
22628
  /** {zh}
22546
- * @brief 获取 RTM 播放信息
22629
+ * @brief 获取 RTM 拉流的播放信息。
22547
22630
  * @returns
22548
22631
  */
22632
+ /** {en}
22633
+ * @brief Obtain the playback information of RTM pull stream.
22634
+ */
22549
22635
  async getRTMStats() {
22550
22636
  var _a, _b, _c;
22551
22637
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot();
22552
22638
  }
22553
22639
  /** {zh}
22554
- * @brief 获取 FLV 播放信息
22640
+ * @brief 获取 FLV 拉流的播放信息。
22555
22641
  * @returns
22556
22642
  */
22643
+ /** {en}
22644
+ * @brief Obtain the playback information of FLV pull streaming.
22645
+ */
22557
22646
  getFLVStats() {
22558
22647
  var _a, _b, _c;
22559
22648
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
@@ -22565,7 +22654,10 @@ var __publicField = (obj, key, value) => {
22565
22654
  if (!options || !options.url && !options.playlist) {
22566
22655
  throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
22567
22656
  }
22568
- const i18n = new VeI18n({ lang: options == null ? void 0 : options.lang, i18n: options == null ? void 0 : options.i18n });
22657
+ const i18n = new VeI18n({
22658
+ lang: options == null ? void 0 : options.lang,
22659
+ i18n: options == null ? void 0 : options.i18n
22660
+ });
22569
22661
  const finalOptions = {
22570
22662
  ...options,
22571
22663
  plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
@@ -22583,9 +22675,24 @@ var __publicField = (obj, key, value) => {
22583
22675
  },
22584
22676
  async preparePlugins(url) {
22585
22677
  const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
22586
- getTypeStrategy({ ...finalOptions, url }, player),
22587
- getDrmStrategy({ ...finalOptions, url }, player),
22588
- getAbrStrategy({ ...finalOptions, url })
22678
+ getTypeStrategy(
22679
+ {
22680
+ ...finalOptions,
22681
+ url
22682
+ },
22683
+ player
22684
+ ),
22685
+ getDrmStrategy(
22686
+ {
22687
+ ...finalOptions,
22688
+ url
22689
+ },
22690
+ player
22691
+ ),
22692
+ getAbrStrategy({
22693
+ ...finalOptions,
22694
+ url
22695
+ })
22589
22696
  ]);
22590
22697
  const { options: options2, plugins } = typeStrategy ?? {};
22591
22698
  const { options: drmOptions, plugins: drmPlugins } = drmStrategy ?? {};
@@ -22616,6 +22723,9 @@ var __publicField = (obj, key, value) => {
22616
22723
  }
22617
22724
  return player;
22618
22725
  }
22726
+ function isFLVSupported() {
22727
+ return isMseSupported$1() || isMMSSupported$1();
22728
+ }
22619
22729
  var live = /* @__PURE__ */ Object.freeze({
22620
22730
  __proto__: null,
22621
22731
  ErrorCode,
@@ -22624,6 +22734,7 @@ var __publicField = (obj, key, value) => {
22624
22734
  setModuleSystem("umd");
22625
22735
  const isMseSupported = util.isMseSupported;
22626
22736
  const isSoftDecodeSupported = util.isSoftDecodeSupported;
22737
+ const isMMSSupported = util.isMMSSupported;
22627
22738
  if (typeof VePlayer.registerPlugin !== "undefined") {
22628
22739
  VePlayer.registerPlugin(DynamicModule.BizLive, {
22629
22740
  createLivePlayer
@@ -22645,6 +22756,8 @@ var __publicField = (obj, key, value) => {
22645
22756
  exports2.Sniffer = sniffer$1;
22646
22757
  exports2.ZH_CN = ZH_CN$1;
22647
22758
  exports2.createLivePlayer = createLivePlayer;
22759
+ exports2.isFLVSupported = isFLVSupported;
22760
+ exports2.isMMSSupported = isMMSSupported;
22648
22761
  exports2.isMseSupported = isMseSupported;
22649
22762
  exports2.isRTMSupportCodec = isRTMSupportCodec;
22650
22763
  exports2.isRTMSupported = isRTMSupported;