@volcengine/veplayer 2.8.2 → 2.9.0-rc.1

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.
@@ -14379,7 +14379,7 @@ class VePlayerBase {
14379
14379
  * @brief Retrieve the player SDK version number.
14380
14380
  */
14381
14381
  get playerVersion() {
14382
- return "2.8.2";
14382
+ return "2.9.0-rc.1";
14383
14383
  }
14384
14384
  /** {zh}
14385
14385
  * @brief 获取当前播放视频的清晰度唯一标识(definition)。
@@ -14563,7 +14563,7 @@ class VePlayerBase {
14563
14563
  * @param Playlist The updated list.
14564
14564
  * @param Target The default playback resource after the update.
14565
14565
  */
14566
- updatePlaylist(playlist, target) {
14566
+ async updatePlaylist(playlist, target) {
14567
14567
  const sourceManager = this._sourceManager.updateSources(playlist, target);
14568
14568
  return this._switch(sourceManager.definition);
14569
14569
  }
@@ -14954,6 +14954,7 @@ class VePlayerBase {
14954
14954
  (_c = (_b = (_a = this._player) == null ? void 0 : _a.plugins) == null ? void 0 : _b.sources) == null ? void 0 : _c.renderItemList();
14955
14955
  (_f = (_e = (_d = this._player) == null ? void 0 : _d.plugins) == null ? void 0 : _e.definition) == null ? void 0 : _f.renderItemList();
14956
14956
  const isSourceSwitching = ((_g = targetDefinition == null ? void 0 : targetDefinition.source) == null ? void 0 : _g.name) !== ((_h = preDefinition == null ? void 0 : preDefinition.source) == null ? void 0 : _h.name);
14957
+ const isDefinitionSwitching = (targetDefinition == null ? void 0 : targetDefinition.definition) !== (preDefinition == null ? void 0 : preDefinition.definition);
14957
14958
  this._player.config.url = targetDefinition.url;
14958
14959
  if (isSameProtocol) {
14959
14960
  if (isSourceSwitching) {
@@ -14963,16 +14964,18 @@ class VePlayerBase {
14963
14964
  this._player.changeDefinition(targetDefinition, preDefinition);
14964
14965
  }
14965
14966
  } else {
14966
- this.emit(
14967
- isSourceSwitching ? Events.SOURCE_CHANGE : Events.DEFINITION_CHANGE
14968
- );
14967
+ if (isDefinitionSwitching || isSourceSwitching) {
14968
+ this.emit(
14969
+ isSourceSwitching ? Events.SOURCE_CHANGE : Events.DEFINITION_CHANGE
14970
+ );
14971
+ }
14969
14972
  await this._switchDifferentProtocolUrl(
14970
14973
  newPlugins,
14971
14974
  targetDefinition.url,
14972
14975
  isPaused,
14973
14976
  useSrc
14974
14977
  );
14975
- !isSourceSwitching && this.emit(Events.AFTER_DEFINITION_CHANGE);
14978
+ isDefinitionSwitching && this.emit(Events.AFTER_DEFINITION_CHANGE);
14976
14979
  }
14977
14980
  }
14978
14981
  async _switchDifferentProtocolUrl(plugins, url, isPaused, useSrc) {