@volcengine/veplayer 2.4.0-rc.0 → 2.4.0-rc.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.
@@ -1851,6 +1851,7 @@ declare class VePlayerBase {
1851
1851
  *
1852
1852
  */
1853
1853
  fallbackToFirstDefinition?: boolean;
1854
+ seamless?: boolean;
1854
1855
  }): Promise<ExposedDefinition>;
1855
1856
  /** {zh}
1856
1857
  * @brief 调用此方法更新拉流地址列表。
@@ -2019,6 +2020,7 @@ declare class VePlayerBase {
2019
2020
  */
2020
2021
  ignorePaused?: boolean;
2021
2022
  }): void;
2023
+ canPlayType(type: string): boolean;
2022
2024
  /** {zh}
2023
2025
  * @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
2024
2026
  * @param el 全屏作用的 DOM 节点。
@@ -13707,7 +13707,7 @@ class VePlayerBase {
13707
13707
  var _a, _b;
13708
13708
  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) {
13709
13709
  this._sourceManager.updateSources(target);
13710
- await this._switchUrl(target);
13710
+ await this._switchUrl(target, { seamless: options == null ? void 0 : options.seamless });
13711
13711
  return this._sourceManager.definition;
13712
13712
  }
13713
13713
  const targetDefinition = this._sourceManager.find(target, options);
@@ -13893,6 +13893,9 @@ class VePlayerBase {
13893
13893
  blur(data) {
13894
13894
  return this._player.blur(data);
13895
13895
  }
13896
+ canPlayType(type) {
13897
+ return this._player.canPlayType(type);
13898
+ }
13896
13899
  /** {zh}
13897
13900
  * @brief 调用此方法进入系统全屏状态。如果该方法调用的时候处于网页全屏状态会自动退出网页全屏,下发事件 `Events.FULLSCREEN_CHANGE`。
13898
13901
  * @param el 全屏作用的 DOM 节点。
@@ -14090,14 +14093,16 @@ class VePlayerBase {
14090
14093
  this._player.changeDefinition(targetDefinition, preDefinition);
14091
14094
  }
14092
14095
  }
14093
- async _switchUrl(url) {
14096
+ async _switchUrl(url, config) {
14094
14097
  const { plugins: newPlugins, options } = await this.prepare(url) || {};
14095
14098
  const newUrl = (options == null ? void 0 : options.url) ?? url;
14096
14099
  this._sourceManager.url = newUrl;
14097
14100
  if (newPlugins == null ? void 0 : newPlugins.length) {
14098
14101
  this._callBeforePlayerInitForUrl(newPlugins, newUrl);
14099
14102
  } else {
14100
- const res = this._player.switchURL(newUrl, false);
14103
+ const res = this._player.switchURL(newUrl, {
14104
+ seamless: config == null ? void 0 : config.seamless
14105
+ });
14101
14106
  const curTime = this._player.currentTime;
14102
14107
  if (res && res.then) {
14103
14108
  return res;