Skip to content

Commit

Permalink
fix(FEC-10680): back-end bumper: the app should decide what bumper wi…
Browse files Browse the repository at this point in the history
…ll be displayed when also set user bumper (#392)

consider the app plugins config before the provider's

Solves FEC-10680
  • Loading branch information
yairans authored Dec 29, 2020
1 parent 28fed28 commit a062427
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class KalturaPlayer extends FakeEventTarget {
}
mediaConfig.sources = Utils.Object.mergeDeep(mediaConfig.sources, mediaOptions);
}
mediaConfig.plugins = this._mergeProviderPluginsConfig(mediaConfig.plugins);
this.configure(getDefaultRedirectOptions(this.config, mediaConfig));
this.setMedia(mediaConfig);
},
Expand Down Expand Up @@ -773,6 +774,18 @@ class KalturaPlayer extends FakeEventTarget {
this._localPlayer.detachMediaSource();
}

_mergeProviderPluginsConfig(providerPluginsConfig: KPPluginsConfigObject): KPPluginsConfigObject {
const mergePluginConfig: KPPluginsConfigObject = {};
Object.entries(providerPluginsConfig).forEach(([pluginName, pluginConfig]: [string, Object]) => {
mergePluginConfig[pluginName] = {};
Object.entries(pluginConfig).forEach(([key, providerValue]) => {
const appValue = Utils.Object.getPropertyPath(this.config.plugins[pluginName], key);
mergePluginConfig[pluginName][key] = appValue || providerValue;
});
});
return mergePluginConfig;
}

/**
* Set crossOrigin attribute.
* @param {?string} crossOrigin - 'anonymous', 'use-credentials' or null to remove attribute
Expand Down

0 comments on commit a062427

Please sign in to comment.