Skip to content

Commit

Permalink
fix(FEC-12335): Side Panel Item gets refreshed in every 'change media' (
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanTGold committed Aug 25, 2022
1 parent fd3876b commit 1c452c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/common/playlist/playlist-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ class PlaylistManager {
this._playlist.activeItemIndex = index;
if (activeItem.isPlayable()) {
this._resetProviderPluginsConfig();
this._player.reset();
const mergedPluginsConfigAndFromApp = mergeProviderPluginsConfig(activeItem.plugins, this._player.config.plugins);
const providerPlugins = mergedPluginsConfigAndFromApp[0];
this._appPluginConfig = mergedPluginsConfigAndFromApp[1];
Expand All @@ -293,7 +292,6 @@ class PlaylistManager {
} else {
if (this._mediaInfoList[index]) {
this._resetProviderPluginsConfig();
this._player.reset();
const media = ({sources: activeItem.sources}: any);
this._player.setMedia(media);
return this._player.loadMedia(this._mediaInfoList[index]).then(mediaConfig => {
Expand Down
6 changes: 3 additions & 3 deletions src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class KalturaPlayer extends FakeEventTarget {

setMedia(mediaConfig: KPMediaConfig): void {
KalturaPlayer._logger.debug('setMedia', mediaConfig);
this.reset();
this.reset(true);
const playerConfig = Utils.Object.copyDeep(mediaConfig);
//merge the current sources from player to keep the sources passed from constructor earlier
const sources = Utils.Object.mergeDeep({}, playerConfig.sources, this._localPlayer.sources);
Expand Down Expand Up @@ -344,7 +344,7 @@ class KalturaPlayer extends FakeEventTarget {
return this._localPlayer.getVideoElement();
}

reset(): void {
reset(isChangeMedia: boolean = false): void {
if (!this._reset) {
this._reset = true;
this._firstPlay = true;
Expand All @@ -356,7 +356,7 @@ class KalturaPlayer extends FakeEventTarget {
this._resetProviderPluginsConfig();
this._pluginManager.reset();
this._cuepointManager.reset();
this._localPlayer.reset();
this._localPlayer.reset(isChangeMedia);
this._thumbnailManager?.destroy();
}
}
Expand Down

0 comments on commit 1c452c0

Please sign in to comment.