@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.
@@ -1457,7 +1457,7 @@ var sniffer$1 = {
1457
1457
  }
1458
1458
  }
1459
1459
  };
1460
- var version = "3.0.20-alpha.4";
1460
+ var version = "3.0.21-rc.2";
1461
1461
  var ERROR_TYPE_MAP = {
1462
1462
  1: "media",
1463
1463
  2: "media",
@@ -2808,6 +2808,18 @@ var BasePlugin = /* @__PURE__ */ function() {
2808
2808
  }
2809
2809
  }
2810
2810
  }
2811
+ }, {
2812
+ key: "defineMethod",
2813
+ value: function defineMethod(Obj, map) {
2814
+ for (var key in map) {
2815
+ if (Object.prototype.hasOwnProperty.call(map, key) && typeof map[key] === "function") {
2816
+ Object.defineProperty(Obj, key, {
2817
+ configurable: true,
2818
+ value: map[key]
2819
+ });
2820
+ }
2821
+ }
2822
+ }
2811
2823
  }, {
2812
2824
  key: "defaultConfig",
2813
2825
  get: function get() {
@@ -3453,7 +3465,7 @@ var ResizeObserver = /* @__PURE__ */ function() {
3453
3465
  if (!this.observer) {
3454
3466
  return;
3455
3467
  }
3456
- this.observer && this.observer.observe(target);
3468
+ this.observer.observe(target);
3457
3469
  var _pid = target.getAttribute(PLATER_ID);
3458
3470
  var __handlers = this.__handlers;
3459
3471
  var index = -1;
@@ -3482,16 +3494,17 @@ var ResizeObserver = /* @__PURE__ */ function() {
3482
3494
  }
3483
3495
  });
3484
3496
  try {
3485
- this.observer && this.observer.unobserve(target);
3497
+ var _this$observer;
3498
+ (_this$observer = this.observer) === null || _this$observer === void 0 ? void 0 : _this$observer.unobserve(target);
3486
3499
  } catch (e3) {
3487
3500
  }
3488
- this.observer && this.observer.unobserve(target);
3489
3501
  i2 > -1 && this.__handlers.splice(i2, 1);
3490
3502
  }
3491
3503
  }, {
3492
3504
  key: "destroyObserver",
3493
3505
  value: function destroyObserver() {
3494
- this.observer && this.observer.disconnect();
3506
+ var _this$observer2;
3507
+ (_this$observer2 = this.observer) === null || _this$observer2 === void 0 ? void 0 : _this$observer2.disconnect();
3495
3508
  this.observer = null;
3496
3509
  this.__handlers = null;
3497
3510
  }
@@ -3523,7 +3536,8 @@ function addObserver(target, handler) {
3523
3536
  return resizeObserver;
3524
3537
  }
3525
3538
  function unObserver(target, handler) {
3526
- resizeObserver.unObserver(target, handler);
3539
+ var _resizeObserver;
3540
+ (_resizeObserver = resizeObserver) === null || _resizeObserver === void 0 ? void 0 : _resizeObserver.unObserver(target, handler);
3527
3541
  }
3528
3542
  var pluginsManager = {
3529
3543
  pluginGroup: {},
@@ -5115,7 +5129,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5115
5129
  if (!url) {
5116
5130
  url = _this8.url || _this8.config.url;
5117
5131
  }
5118
- var _furl = _this8._preProcessUrl(url);
5132
+ var _furl = _this8.preProcessUrl(url);
5119
5133
  var ret = _this8._startInit(_furl.url);
5120
5134
  return ret;
5121
5135
  }).catch(function(e3) {
@@ -5133,7 +5147,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5133
5147
  if (util$1.typeOf(url) === "Object") {
5134
5148
  _src = url.url;
5135
5149
  }
5136
- _src = this._preProcessUrl(_src).url;
5150
+ _src = this.preProcessUrl(_src).url;
5137
5151
  var curTime = this.currentTime;
5138
5152
  this.__startTime = curTime;
5139
5153
  var isPaused = this.paused && !this.isError;
@@ -5474,7 +5488,7 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
5474
5488
  runHooks(this, "retry", function() {
5475
5489
  var cur = _this20.currentTime;
5476
5490
  var url = _this20.config.url;
5477
- var _srcRet = !util$1.isMSE(_this20.media) ? _this20._preProcessUrl(url) : {
5491
+ var _srcRet = !util$1.isMSE(_this20.media) ? _this20.preProcessUrl(url) : {
5478
5492
  url
5479
5493
  };
5480
5494
  _this20.src = _srcRet.url;
@@ -6130,11 +6144,11 @@ var Player = /* @__PURE__ */ function(_MediaProxy) {
6130
6144
  this._state = newState;
6131
6145
  }
6132
6146
  }, {
6133
- key: "_preProcessUrl",
6134
- value: function _preProcessUrl(url, ext) {
6135
- var _this$config7 = this.config, preProcessUrl = _this$config7.preProcessUrl, preProcessUrlOptions = _this$config7.preProcessUrlOptions;
6147
+ key: "preProcessUrl",
6148
+ value: function preProcessUrl(url, ext) {
6149
+ var _this$config7 = this.config, preProcessUrl2 = _this$config7.preProcessUrl, preProcessUrlOptions = _this$config7.preProcessUrlOptions;
6136
6150
  var processUrlOptions = Object.assign({}, preProcessUrlOptions, ext);
6137
- return !util$1.isBlob(url) && typeof preProcessUrl === "function" ? preProcessUrl(url, processUrlOptions) : {
6151
+ return !util$1.isBlob(url) && typeof preProcessUrl2 === "function" ? preProcessUrl2(url, processUrlOptions) : {
6138
6152
  url
6139
6153
  };
6140
6154
  }
@@ -6716,11 +6730,11 @@ let VeError$1 = class VeError extends Error {
6716
6730
  } : error2;
6717
6731
  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"));
6718
6732
  super(message);
6719
- /**
6733
+ /** {zh}
6720
6734
  * @brief 错误码。
6721
6735
  */
6722
6736
  /** {en}
6723
- * @brief The error code.
6737
+ * @brief Error code.
6724
6738
  */
6725
6739
  __publicField(this, "errorCode");
6726
6740
  /** {zh}
@@ -8506,7 +8520,7 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8506
8520
  }
8507
8521
  this.on(DURATION_CHANGE, function() {
8508
8522
  var player2 = _this2.player, config2 = _this2.config;
8509
- if (player2.duration * 1e3 < config2.moveDuration) {
8523
+ if (player2.duration > 0 && player2.duration * 1e3 < config2.moveDuration) {
8510
8524
  config2.moveDuration = player2.duration * 1e3;
8511
8525
  }
8512
8526
  });
@@ -8820,10 +8834,13 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8820
8834
  }, {
8821
8835
  key: "updateBrightness",
8822
8836
  value: function updateBrightness(percent) {
8837
+ var pos = this.pos, config = this.config, xgMask = this.xgMask;
8838
+ if (!config.darkness) {
8839
+ return;
8840
+ }
8823
8841
  if (this.player.rotateDeg) {
8824
8842
  percent = -percent;
8825
8843
  }
8826
- var pos = this.pos, config = this.config, xgMask = this.xgMask;
8827
8844
  var light = pos.light + 0.8 * percent;
8828
8845
  light = light > config.maxDarkness ? config.maxDarkness : light < 0 ? 0 : light;
8829
8846
  if (xgMask) {
@@ -8884,12 +8901,12 @@ var MobilePlugin = /* @__PURE__ */ function(_Plugin) {
8884
8901
  }, {
8885
8902
  key: "disableGesture",
8886
8903
  value: function disableGesture() {
8887
- this.config.disableGesture = false;
8904
+ this.config.disableGesture = true;
8888
8905
  }
8889
8906
  }, {
8890
8907
  key: "enableGesture",
8891
8908
  value: function enableGesture() {
8892
- this.config.disableGesture = true;
8909
+ this.config.disableGesture = false;
8893
8910
  }
8894
8911
  }, {
8895
8912
  key: "destroy",
@@ -9758,7 +9775,7 @@ var Fullscreen = /* @__PURE__ */ function(_IconPlugin) {
9758
9775
  }, {
9759
9776
  key: "toggleFullScreen",
9760
9777
  value: function toggleFullScreen(e3) {
9761
- if (e3) {
9778
+ if (e3 instanceof Event) {
9762
9779
  e3.preventDefault();
9763
9780
  e3.stopPropagation();
9764
9781
  }
@@ -10441,7 +10458,7 @@ var PIP = /* @__PURE__ */ function(_IconPlugin) {
10441
10458
  key: "isPIPAvailable",
10442
10459
  value: function isPIPAvailable() {
10443
10460
  var video = this.player.media;
10444
- var _isEnabled = util$1.typeOf(document.pictureInPictureEnabled) === "Boolean" ? document.pictureInPictureEnabled : true;
10461
+ var _isEnabled = util$1.typeOf(document.pictureInPictureEnabled) === "Boolean" ? document.pictureInPictureEnabled : false;
10445
10462
  return _isEnabled && (util$1.typeOf(video.disablePictureInPicture) === "Boolean" && !video.disablePictureInPicture || video.webkitSupportsPresentationMode && util$1.typeOf(video.webkitSetPresentationMode) === "Function") || this.isDocPIPAvailable();
10446
10463
  }
10447
10464
  }, {
@@ -12896,11 +12913,15 @@ async function isSoftDecodeSupported$1() {
12896
12913
  const { XGVideoPlugin } = await load(DynamicModule.PluginXgvideo);
12897
12914
  return XGVideoPlugin == null ? void 0 : XGVideoPlugin.isSupported();
12898
12915
  }
12916
+ function isMMSSupported$1() {
12917
+ return typeof ManagedMediaSource !== "undefined";
12918
+ }
12899
12919
  const util = {
12900
12920
  ...util$1,
12901
12921
  getStreamType,
12902
12922
  isMseSupported: isMseSupported$1,
12903
12923
  isSoftDecodeSupported: isSoftDecodeSupported$1,
12924
+ isMMSSupported: isMMSSupported$1,
12904
12925
  appendSearchParams,
12905
12926
  getUrlObject
12906
12927
  };
@@ -13113,7 +13134,6 @@ class Autoplay extends Plugin {
13113
13134
  }
13114
13135
  // 有音量修改,取消静音
13115
13136
  handleVolumechange() {
13116
- this._state.mode = this.player.muted ? 1 : 0;
13117
13137
  if (!this._state.showUnmuteBt)
13118
13138
  return;
13119
13139
  this._state.showUnmuteBt = false;
@@ -13573,28 +13593,33 @@ const DEFAULT_OPTIONS = {
13573
13593
  useCssFullscreen: false
13574
13594
  }
13575
13595
  };
13576
- const transformOption = (options) => {
13577
- const { autoplay: autoplay2, ...rest } = options;
13578
- const xgOptions = rest;
13579
- if (xgOptions.poster) {
13580
- xgOptions.poster = escapeHtml(xgOptions.poster);
13581
- }
13582
- xgOptions.icons = {
13583
- ...DEFAULT_ICONS,
13584
- ...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
13585
- };
13586
- xgOptions.autoplay = Boolean(autoplay2);
13587
- if (autoplay2 && typeof autoplay2 !== "boolean") {
13588
- xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
13589
- xgOptions.videoAttributes = {
13590
- ...xgOptions.videoAttributes ?? {},
13591
- muted: autoplay2 == null ? void 0 : autoplay2.muted
13596
+ const transformOption = (
13597
+ /** {zh}
13598
+ * @param options 更多配置信息。
13599
+ */
13600
+ (options) => {
13601
+ const { autoplay: autoplay2, ...rest } = options;
13602
+ const xgOptions = rest;
13603
+ if (xgOptions.poster) {
13604
+ xgOptions.poster = escapeHtml(xgOptions.poster);
13605
+ }
13606
+ xgOptions.icons = {
13607
+ ...DEFAULT_ICONS,
13608
+ ...xgOptions.icons ? escapeIcons(xgOptions.icons) : {}
13592
13609
  };
13593
- xgOptions.autoplayPlugin = autoplay2;
13610
+ xgOptions.autoplay = Boolean(autoplay2);
13611
+ if (autoplay2 && typeof autoplay2 !== "boolean") {
13612
+ xgOptions.autoplayMuted = autoplay2 == null ? void 0 : autoplay2.muted;
13613
+ xgOptions.videoAttributes = {
13614
+ ...xgOptions.videoAttributes ?? {},
13615
+ muted: autoplay2 == null ? void 0 : autoplay2.muted
13616
+ };
13617
+ xgOptions.autoplayPlugin = autoplay2;
13618
+ }
13619
+ delete xgOptions.i18n;
13620
+ return xgOptions;
13594
13621
  }
13595
- delete xgOptions.i18n;
13596
- return xgOptions;
13597
- };
13622
+ );
13598
13623
  class VePlayerBase {
13599
13624
  /** {zh}
13600
13625
  * @hidden
@@ -13614,7 +13639,9 @@ class VePlayerBase {
13614
13639
  this._sourceManager = options.sourceManager;
13615
13640
  this._preparePlugins = options.preparePlugins;
13616
13641
  this._previousPrepareResult = options.prepareResult;
13617
- this._i18nManager = options.i18nManager ?? new VeI18n({ i18n: options.i18n });
13642
+ this._i18nManager = options.i18nManager ?? new VeI18n({
13643
+ i18n: options.i18n
13644
+ });
13618
13645
  const xgOptions = transformOption({
13619
13646
  ...options,
13620
13647
  ...(_a = this._previousPrepareResult) == null ? void 0 : _a.options
@@ -13809,9 +13836,14 @@ class VePlayerBase {
13809
13836
  /** {zh}
13810
13837
  * 获取播放器版本号
13811
13838
  * @returns
13839
+ * @brief
13840
+ * 获取播放器 SDK 版本号。
13841
+ */
13842
+ /** {en}
13843
+ * @brief Retrieve the player SDK version number.
13812
13844
  */
13813
13845
  get playerVersion() {
13814
- return "2.5.0-rc.0";
13846
+ return "2.5.0";
13815
13847
  }
13816
13848
  /** {zh}
13817
13849
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -13959,8 +13991,8 @@ class VePlayerBase {
13959
13991
  }
13960
13992
  /** {zh}
13961
13993
  * @brief 调用此方法切换拉流地址、线路、清晰度。
13962
- * @param target 目标地址,可以是播放地址,也可以是线路和清晰度
13963
- * @param options 更多配置信息
13994
+ * @param target 目标地址,可以是播放地址,也可以是线路和清晰度。
13995
+ * @param options 更多配置信息。
13964
13996
  */
13965
13997
  /** {en}
13966
13998
  * @brief Switches the pull stream address, playback source, or resolution.
@@ -13971,7 +14003,9 @@ class VePlayerBase {
13971
14003
  var _a, _b;
13972
14004
  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) {
13973
14005
  this._sourceManager.updateSources(target);
13974
- await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
14006
+ await this._switchUrl(target, {
14007
+ seamless: options == null ? void 0 : options.seamless
14008
+ });
13975
14009
  return this._sourceManager.definition;
13976
14010
  }
13977
14011
  const targetDefinition = this._sourceManager.find(target, options);
@@ -13998,16 +14032,15 @@ class VePlayerBase {
13998
14032
  return this._switch(sourceManager.definition);
13999
14033
  }
14000
14034
  // TODO: 等西瓜播放器完善错误码后增加函数重载以提供更好的类型
14001
- /**
14002
14035
  /** {zh}
14003
14036
  * @brief 调用此方法监听指定事件,事件处理函数只执行一次。
14004
14037
  * @param event 表示事件的名称。
14005
14038
  * @param callback 表示事件的回调函数。
14006
14039
  */
14007
14040
  /** {en}
14008
- * @brief Add a one-time listener function for the specified event.
14009
- * @param event The event name.
14010
- * @param callback The callback function for the event.
14041
+ * @brief Call this method to listen for the specified event. The event handler is executed only once.
14042
+ * @param event The name representing the event.
14043
+ * @param callback Callback functions representing events.
14011
14044
  */
14012
14045
  once(event, callback) {
14013
14046
  var _a;
@@ -14158,10 +14191,14 @@ class VePlayerBase {
14158
14191
  return this._player.blur(data);
14159
14192
  }
14160
14193
  /** {zh}
14161
- * @brief 判断浏览器是否支持播放格式
14162
- * @param type 播放格式
14194
+ * @brief 判断浏览器是否支持播放格式。
14195
+ * @param type 播放格式。
14163
14196
  * @returns
14164
14197
  */
14198
+ /** {en}
14199
+ * @brief Determine whether the browser supports the playback format.
14200
+ * @param type The playback format.
14201
+ */
14165
14202
  canPlayType(type) {
14166
14203
  return this._player.canPlayType(type);
14167
14204
  }
@@ -14233,7 +14270,7 @@ class VePlayerBase {
14233
14270
  }
14234
14271
  /** {zh}
14235
14272
  * @brief 调用此接口显示指定插件图标。
14236
- * @param pluginNames 插件名称
14273
+ * @param pluginNames 插件名称。
14237
14274
  */
14238
14275
  /** {en}
14239
14276
  * @brief Displays the icon of a specified plugin.
@@ -14254,7 +14291,7 @@ class VePlayerBase {
14254
14291
  }
14255
14292
  /** {zh}
14256
14293
  * @brief 调用此接口隐藏指定插件图标。
14257
- * @param pluginNames 插件名称
14294
+ * @param pluginNames 插件名称。
14258
14295
  */
14259
14296
  /** {en}
14260
14297
  * @brief Hides the icon of a specified plugin.
@@ -14326,7 +14363,14 @@ class VePlayerBase {
14326
14363
  this._player.once("canplay", () => {
14327
14364
  this._sourceManager.resetFallback();
14328
14365
  });
14329
- this.emit(Events$1.FALLBACK, { from: { url: preUrl }, to: { url } });
14366
+ this.emit(Events$1.FALLBACK, {
14367
+ from: {
14368
+ url: preUrl
14369
+ },
14370
+ to: {
14371
+ url
14372
+ }
14373
+ });
14330
14374
  this._switchUrl(url);
14331
14375
  }
14332
14376
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -18935,6 +18979,8 @@ const getFlvStrategy = async (options) => {
18935
18979
  }
18936
18980
  if (codec === "unknown" ? isMseSupported$1(Codec.H264) : isMseSupported$1(codec)) {
18937
18981
  mseStrategy = createFlvMseStrategy(options);
18982
+ } else if (isMMSSupported$1()) {
18983
+ mseStrategy = createFlvMssStrategy(options);
18938
18984
  }
18939
18985
  if (!mseStrategy && !softStrategy) {
18940
18986
  return {};
@@ -18987,24 +19033,38 @@ const getHlsStrategy = async (options) => {
18987
19033
  plugins: (mseModule == null ? void 0 : mseModule.HlsPlugin) ? [mseModule.HlsPlugin] : []
18988
19034
  };
18989
19035
  };
18990
- const createFlvMseStrategy = (options) => {
19036
+ const getDefaultFlvOptions = (options) => {
18991
19037
  var _a;
18992
19038
  return {
18993
- options: {
18994
- flv: {
18995
- retryCount: 0,
18996
- disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0,
18997
- ...(options == null ? void 0 : options.flv) ?? {}
18998
- }
18999
- },
19000
- module: DynamicModule.PluginFlv
19039
+ retryCount: 0,
19040
+ disconnectRetryCount: ((_a = options == null ? void 0 : options.flv) == null ? void 0 : _a.retryCount) ?? void 0
19001
19041
  };
19002
19042
  };
19043
+ const createFlvMseStrategy = (options) => ({
19044
+ options: {
19045
+ flv: {
19046
+ ...getDefaultFlvOptions(options),
19047
+ ...(options == null ? void 0 : options.flv) ?? {}
19048
+ }
19049
+ },
19050
+ module: DynamicModule.PluginFlv
19051
+ });
19052
+ const createFlvMssStrategy = (options) => ({
19053
+ options: {
19054
+ flv: {
19055
+ preferMMS: true,
19056
+ ...getDefaultFlvOptions(options),
19057
+ ...(options == null ? void 0 : options.flv) ?? {}
19058
+ }
19059
+ },
19060
+ module: DynamicModule.PluginFlv
19061
+ });
19003
19062
  const createHlsMseStrategy = (options) => ({
19004
19063
  options: {
19005
19064
  hls: {
19006
19065
  retryCount: 0,
19007
19066
  pollRetryCount: 0,
19067
+ allowedStreamTrackChange: false,
19008
19068
  ...(options == null ? void 0 : options.hls) ?? {}
19009
19069
  }
19010
19070
  },
@@ -22063,10 +22123,10 @@ class Logger extends Plugin {
22063
22123
  user_id: this._userId,
22064
22124
  device_id: this._deviceId,
22065
22125
  ext: {
22066
- veplayer_version: "2.5.0-rc.0",
22067
- flv_version: "3.0.19-rc.0",
22068
- hls_version: "3.0.20-alpha.2",
22069
- rts_version: "0.2.1-alpha.0"
22126
+ veplayer_version: "2.5.0",
22127
+ flv_version: "3.0.21-rc.2",
22128
+ hls_version: "3.0.21-rc.2",
22129
+ rts_version: "0.2.1-alpha.12"
22070
22130
  }
22071
22131
  });
22072
22132
  }
@@ -22394,7 +22454,9 @@ VeI18n.extend([
22394
22454
  }
22395
22455
  ]);
22396
22456
  const LIVE_DEFAULT_OPTIONS = {
22397
- autoplay: { muted: true }
22457
+ autoplay: {
22458
+ muted: true
22459
+ }
22398
22460
  };
22399
22461
  const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
22400
22462
  var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
@@ -22414,7 +22476,10 @@ class VePlayerLive extends VePlayerBase {
22414
22476
  super(options);
22415
22477
  }
22416
22478
  /** {zh}
22417
- * @brief 获取已经播放的时间
22479
+ * @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
22480
+ */
22481
+ /** {en}
22482
+ * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
22418
22483
  */
22419
22484
  get playTime() {
22420
22485
  var _a, _b, _c, _d;
@@ -22473,7 +22538,10 @@ class VePlayerLive extends VePlayerBase {
22473
22538
  (_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
22474
22539
  }
22475
22540
  /** {zh}
22476
- * @brief 打开 Abr
22541
+ * @brief 打开码率自适应(ABR)切换功能。
22542
+ */
22543
+ /** {en}
22544
+ * @brief Enable the Adaptive Bitrate Streaming (ABR) switching feature.
22477
22545
  */
22478
22546
  openAbr() {
22479
22547
  var _a, _b, _c, _d;
@@ -22487,7 +22555,10 @@ class VePlayerLive extends VePlayerBase {
22487
22555
  }
22488
22556
  }
22489
22557
  /** {zh}
22490
- * @brief 关闭 Abr
22558
+ * @brief 关闭码率自适应(ABR)切换功能。
22559
+ */
22560
+ /** {en}
22561
+ * @brief Disable the Adaptive Bitrate Streaming (ABR) switching feature.
22491
22562
  */
22492
22563
  closeAbr() {
22493
22564
  var _a, _b, _c, _d;
@@ -22501,18 +22572,25 @@ class VePlayerLive extends VePlayerBase {
22501
22572
  }
22502
22573
  }
22503
22574
  /** {zh}
22504
- * @brief 调用此方法更新 DRM 鉴权配置。
22505
- * @hidden
22575
+ * @brief 调用此方法更新 DRM 配置。
22576
+ */
22577
+ /** {en}
22578
+ * @brief Use this method to update DRM configuration.
22579
+ * @param config
22506
22580
  */
22507
22581
  updateDrmConfig(config) {
22508
22582
  var _a, _b, _c;
22509
22583
  (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
22510
22584
  }
22511
22585
  /** {zh}
22512
- * @brief 切换 flv Abr
22513
- * @param options 切换 Abr 的配置。
22586
+ * @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
22587
+ * @param options ABR 的配置。
22514
22588
  * @returns
22515
22589
  */
22590
+ /** {en}
22591
+ * @brief Modify ABR configuration, including enabling or disabling the ABR feature and adjusting other resolutions.
22592
+ * @param options Configuration of ABR.
22593
+ */
22516
22594
  switchAbr(options) {
22517
22595
  var _a, _b;
22518
22596
  if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
@@ -22523,7 +22601,9 @@ class VePlayerLive extends VePlayerBase {
22523
22601
  if (!url) {
22524
22602
  return;
22525
22603
  }
22526
- this.switch(url, { seamless: true });
22604
+ this.switch(url, {
22605
+ seamless: true
22606
+ });
22527
22607
  this._player.plugins.abr.bitrate = options.bitrate;
22528
22608
  }
22529
22609
  if (typeof (options == null ? void 0 : options.enable) !== "undefined") {
@@ -22531,25 +22611,34 @@ class VePlayerLive extends VePlayerBase {
22531
22611
  }
22532
22612
  }
22533
22613
  /** {zh}
22534
- * @brief 获取 RTM 的网络相关信息
22614
+ * @brief 获取 RTM 拉流的网络评估信息。
22535
22615
  * @returns
22536
22616
  */
22617
+ /** {en}
22618
+ * @brief Obtain the network assessment information of RTM pull streaming.
22619
+ */
22537
22620
  getRTMNetWorkInfo() {
22538
22621
  var _a, _b, _c;
22539
22622
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
22540
22623
  }
22541
22624
  /** {zh}
22542
- * @brief 获取 RTM 播放信息
22625
+ * @brief 获取 RTM 拉流的播放信息。
22543
22626
  * @returns
22544
22627
  */
22628
+ /** {en}
22629
+ * @brief Obtain the playback information of RTM pull stream.
22630
+ */
22545
22631
  async getRTMStats() {
22546
22632
  var _a, _b, _c;
22547
22633
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot();
22548
22634
  }
22549
22635
  /** {zh}
22550
- * @brief 获取 FLV 播放信息
22636
+ * @brief 获取 FLV 拉流的播放信息。
22551
22637
  * @returns
22552
22638
  */
22639
+ /** {en}
22640
+ * @brief Obtain the playback information of FLV pull streaming.
22641
+ */
22553
22642
  getFLVStats() {
22554
22643
  var _a, _b, _c;
22555
22644
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
@@ -22561,7 +22650,10 @@ async function createLivePlayer(options) {
22561
22650
  if (!options || !options.url && !options.playlist) {
22562
22651
  throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
22563
22652
  }
22564
- const i18n = new VeI18n({ lang: options == null ? void 0 : options.lang, i18n: options == null ? void 0 : options.i18n });
22653
+ const i18n = new VeI18n({
22654
+ lang: options == null ? void 0 : options.lang,
22655
+ i18n: options == null ? void 0 : options.i18n
22656
+ });
22565
22657
  const finalOptions = {
22566
22658
  ...options,
22567
22659
  plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
@@ -22579,9 +22671,24 @@ async function createLivePlayer(options) {
22579
22671
  },
22580
22672
  async preparePlugins(url) {
22581
22673
  const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
22582
- getTypeStrategy({ ...finalOptions, url }, player),
22583
- getDrmStrategy({ ...finalOptions, url }, player),
22584
- getAbrStrategy({ ...finalOptions, url })
22674
+ getTypeStrategy(
22675
+ {
22676
+ ...finalOptions,
22677
+ url
22678
+ },
22679
+ player
22680
+ ),
22681
+ getDrmStrategy(
22682
+ {
22683
+ ...finalOptions,
22684
+ url
22685
+ },
22686
+ player
22687
+ ),
22688
+ getAbrStrategy({
22689
+ ...finalOptions,
22690
+ url
22691
+ })
22585
22692
  ]);
22586
22693
  const { options: options2, plugins } = typeStrategy ?? {};
22587
22694
  const { options: drmOptions, plugins: drmPlugins } = drmStrategy ?? {};
@@ -22612,6 +22719,9 @@ async function createLivePlayer(options) {
22612
22719
  }
22613
22720
  return player;
22614
22721
  }
22722
+ function isFLVSupported() {
22723
+ return isMseSupported$1() || isMMSSupported$1();
22724
+ }
22615
22725
  var live = /* @__PURE__ */ Object.freeze({
22616
22726
  __proto__: null,
22617
22727
  ErrorCode,
@@ -22620,6 +22730,7 @@ var live = /* @__PURE__ */ Object.freeze({
22620
22730
  setModuleSystem("esm");
22621
22731
  const isMseSupported = util.isMseSupported;
22622
22732
  const isSoftDecodeSupported = util.isSoftDecodeSupported;
22733
+ const isMMSSupported = util.isMMSSupported;
22623
22734
  export {
22624
22735
  Codec,
22625
22736
  DecodeType,
@@ -22633,6 +22744,8 @@ export {
22633
22744
  sniffer$1 as Sniffer,
22634
22745
  ZH_CN$1 as ZH_CN,
22635
22746
  createLivePlayer,
22747
+ isFLVSupported,
22748
+ isMMSSupported,
22636
22749
  isMseSupported,
22637
22750
  isRTMSupportCodec,
22638
22751
  isRTMSupported,