Skip to content

Commit

Permalink
fix(FEC-8698): when ui is disabled, playNext() called even when playl…
Browse files Browse the repository at this point in the history
…ist isn't configured (#177)

do not call to `addBindings` if playlist isn't configured
  • Loading branch information
yairans authored Nov 19, 2018
1 parent 9d9fd60 commit 7a70147
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions samples/ovp/cast.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
},
plugins: {
ima: {
adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator='

adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator=[timestamp]'
}
},
cast: {
Expand Down
4 changes: 2 additions & 2 deletions src/common/playlist/playlist-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ class PlaylistManager {
constructor(player: KalturaPlayer, options: KPOptionsObject) {
this._player = player;
this._eventManager = new EventManager();
this._playlist = new Playlist();
this._options = {autoContinue: true};
this._countdown = {duration: 10, showing: true};
this._playerOptions = options;
this._addBindings();
}

/**
Expand All @@ -45,6 +43,7 @@ class PlaylistManager {
Utils.Object.mergeDeep(this._countdown, config.countdown);
if (config.items && config.items.find(item => !!item.sources)) {
this._player.dispatchEvent(new FakeEvent(PlaylistEventType.PLAYLIST_LOADED, {playlist: this}));
this._addBindings();
this.playNext();
}
}
Expand All @@ -58,6 +57,7 @@ class PlaylistManager {
* @private
*/
reset() {
this._eventManager.removeAll();
this._playlist = new Playlist();
}

Expand Down
3 changes: 1 addition & 2 deletions src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class KalturaPlayer extends FakeEventTarget {
loadPlaylist(playlistInfo: ProviderPlaylistInfoObject, playlistCustomConfig: KPPlaylistConfigObject): Promise<*> {
this._logger.debug('loadPlaylist', playlistInfo);
this._uiWrapper.setLoadingSpinnerState(true);
this._playlistManager.reset();
return this._provider
.getPlaylistConfig(playlistInfo)
.then(playlistConfig => this._mergePlaylistConfigAndSet(playlistConfig, playlistCustomConfig))
Expand All @@ -99,7 +98,6 @@ class KalturaPlayer extends FakeEventTarget {
loadPlaylistByEntryList(entryList: ProviderEntryListObject, playlistCustomConfig: KPPlaylistConfigObject): Promise<*> {
this._logger.debug('loadPlaylistByEntryList', entryList);
this._uiWrapper.setLoadingSpinnerState(true);
this._playlistManager.reset();
return this._provider
.getEntryListConfig(entryList)
.then(playlistConfig => this._mergePlaylistConfigAndSet(playlistConfig, playlistCustomConfig))
Expand All @@ -116,6 +114,7 @@ class KalturaPlayer extends FakeEventTarget {
// $FlowFixMe
evaluatePluginsConfig(config);
this._localPlayer.configure({plugins: config.plugins});
this._playlistManager.reset();
this._playlistManager.configure(config.playlist);
}

Expand Down

0 comments on commit 7a70147

Please sign in to comment.