@volcengine/veplayer 2.5.0-rc.1 → 2.6.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2991,8 +2991,8 @@ class Logger extends Plugin$2 {
2991
2991
  device_id: this._deviceId,
2992
2992
  ext: {
2993
2993
  veplayer_version: "2.3.1-rc.1",
2994
- flv_version: "3.0.19-rc.0",
2995
- hls_version: "3.0.20-alpha.2",
2994
+ flv_version: "3.0.21-rc.3",
2995
+ hls_version: "3.0.21-rc.3",
2996
2996
  rts_version: "0.2.1-alpha.0"
2997
2997
  }
2998
2998
  });
@@ -3361,7 +3361,9 @@ VeI18n.extend([
3361
3361
  }
3362
3362
  ]);
3363
3363
  const LIVE_DEFAULT_OPTIONS = {
3364
- autoplay: { muted: true }
3364
+ autoplay: {
3365
+ muted: true
3366
+ }
3365
3367
  };
3366
3368
  const LIVE_DEFAULT_PLUGINS = [...DEFAULT_PLUGINS, Refresh, Logger, InfoPanel];
3367
3369
  var RTMCodec = /* @__PURE__ */ ((RTMCodec2) => {
@@ -3381,7 +3383,10 @@ class VePlayerLive extends VePlayerBase {
3381
3383
  super(options);
3382
3384
  }
3383
3385
  /** {zh}
3384
- * @brief 获取已经播放的时间
3386
+ * @brief 获取已经播放的时长,不包含暂停和等待时间,单位为秒。
3387
+ */
3388
+ /** {en}
3389
+ * @brief Obtain the duration that has been played, excluding pause and waiting time, with the unit of seconds.
3385
3390
  */
3386
3391
  get playTime() {
3387
3392
  var _a, _b, _c, _d;
@@ -3440,7 +3445,10 @@ class VePlayerLive extends VePlayerBase {
3440
3445
  (_a = this._player.plugins) == null ? void 0 : _a.infopanel.close();
3441
3446
  }
3442
3447
  /** {zh}
3443
- * @brief 打开 Abr
3448
+ * @brief 打开码率自适应(ABR)切换功能。
3449
+ */
3450
+ /** {en}
3451
+ * @brief Enable the Adaptive Bitrate Streaming (ABR) switching feature.
3444
3452
  */
3445
3453
  openAbr() {
3446
3454
  var _a, _b, _c, _d;
@@ -3454,7 +3462,10 @@ class VePlayerLive extends VePlayerBase {
3454
3462
  }
3455
3463
  }
3456
3464
  /** {zh}
3457
- * @brief 关闭 Abr
3465
+ * @brief 关闭码率自适应(ABR)切换功能。
3466
+ */
3467
+ /** {en}
3468
+ * @brief Disable the Adaptive Bitrate Streaming (ABR) switching feature.
3458
3469
  */
3459
3470
  closeAbr() {
3460
3471
  var _a, _b, _c, _d;
@@ -3468,18 +3479,25 @@ class VePlayerLive extends VePlayerBase {
3468
3479
  }
3469
3480
  }
3470
3481
  /** {zh}
3471
- * @brief 调用此方法更新 DRM 鉴权配置。
3472
- * @hidden
3482
+ * @brief 调用此方法更新 DRM 配置。
3483
+ */
3484
+ /** {en}
3485
+ * @brief Use this method to update DRM configuration.
3486
+ * @param config
3473
3487
  */
3474
3488
  updateDrmConfig(config) {
3475
3489
  var _a, _b, _c;
3476
3490
  (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.drm) == null ? void 0 : _c.updateDrmConfig(config);
3477
3491
  }
3478
3492
  /** {zh}
3479
- * @brief 切换 flv Abr
3480
- * @param options 切换 Abr 的配置。
3493
+ * @brief 修改 ABR 配置,包含修改是否开启 ABR 功能,和修改其他清晰度。
3494
+ * @param options ABR 的配置。
3481
3495
  * @returns
3482
3496
  */
3497
+ /** {en}
3498
+ * @brief Modify ABR configuration, including enabling or disabling the ABR feature and adjusting other resolutions.
3499
+ * @param options Configuration of ABR.
3500
+ */
3483
3501
  switchAbr(options) {
3484
3502
  var _a, _b;
3485
3503
  if (!((_a = this._player.plugins) == null ? void 0 : _a.abr)) {
@@ -3490,7 +3508,9 @@ class VePlayerLive extends VePlayerBase {
3490
3508
  if (!url) {
3491
3509
  return;
3492
3510
  }
3493
- this.switch(url, { seamless: true });
3511
+ this.switch(url, {
3512
+ seamless: true
3513
+ });
3494
3514
  this._player.plugins.abr.bitrate = options.bitrate;
3495
3515
  }
3496
3516
  if (typeof (options == null ? void 0 : options.enable) !== "undefined") {
@@ -3498,25 +3518,34 @@ class VePlayerLive extends VePlayerBase {
3498
3518
  }
3499
3519
  }
3500
3520
  /** {zh}
3501
- * @brief 获取 RTM 的网络相关信息
3521
+ * @brief 获取 RTM 拉流的网络评估信息。
3502
3522
  * @returns
3503
3523
  */
3524
+ /** {en}
3525
+ * @brief Obtain the network assessment information of RTM pull streaming.
3526
+ */
3504
3527
  getRTMNetWorkInfo() {
3505
3528
  var _a, _b, _c;
3506
3529
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getNetWorkInfo();
3507
3530
  }
3508
3531
  /** {zh}
3509
- * @brief 获取 RTM 播放信息
3532
+ * @brief 获取 RTM 拉流的播放信息。
3510
3533
  * @returns
3511
3534
  */
3535
+ /** {en}
3536
+ * @brief Obtain the playback information of RTM pull stream.
3537
+ */
3512
3538
  async getRTMStats() {
3513
3539
  var _a, _b, _c;
3514
3540
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.rts) == null ? void 0 : _c.getStatsSnapshoot();
3515
3541
  }
3516
3542
  /** {zh}
3517
- * @brief 获取 FLV 播放信息
3543
+ * @brief 获取 FLV 拉流的播放信息。
3518
3544
  * @returns
3519
3545
  */
3546
+ /** {en}
3547
+ * @brief Obtain the playback information of FLV pull streaming.
3548
+ */
3520
3549
  getFLVStats() {
3521
3550
  var _a, _b, _c;
3522
3551
  return (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.flv) == null ? void 0 : _c.getStats();
@@ -3528,7 +3557,10 @@ async function createLivePlayer(options) {
3528
3557
  if (!options || !options.url && !options.playlist) {
3529
3558
  throw create(ErrorCode.INVALID_PARAMETER, new VeI18n());
3530
3559
  }
3531
- const i18n = new VeI18n({ lang: options == null ? void 0 : options.lang, i18n: options == null ? void 0 : options.i18n });
3560
+ const i18n = new VeI18n({
3561
+ lang: options == null ? void 0 : options.lang,
3562
+ i18n: options == null ? void 0 : options.i18n
3563
+ });
3532
3564
  const finalOptions = {
3533
3565
  ...options,
3534
3566
  plugins: [...LIVE_DEFAULT_PLUGINS, ...options.plugins ?? []]
@@ -3546,9 +3578,24 @@ async function createLivePlayer(options) {
3546
3578
  },
3547
3579
  async preparePlugins(url) {
3548
3580
  const [typeStrategy, drmStrategy, abrStrategy] = await Promise.all([
3549
- getTypeStrategy({ ...finalOptions, url }, player),
3550
- getDrmStrategy({ ...finalOptions, url }, player),
3551
- getAbrStrategy({ ...finalOptions, url })
3581
+ getTypeStrategy(
3582
+ {
3583
+ ...finalOptions,
3584
+ url
3585
+ },
3586
+ player
3587
+ ),
3588
+ getDrmStrategy(
3589
+ {
3590
+ ...finalOptions,
3591
+ url
3592
+ },
3593
+ player
3594
+ ),
3595
+ getAbrStrategy({
3596
+ ...finalOptions,
3597
+ url
3598
+ })
3552
3599
  ]);
3553
3600
  const { options: options2, plugins } = typeStrategy ?? {};
3554
3601
  const { options: drmOptions, plugins: drmPlugins } = drmStrategy ?? {};