Skip to content

Commit

Permalink
fix: bumper and ima-dai integration (#245)
Browse files Browse the repository at this point in the history
set bumper config 
```
disableMediaPreload: true,
position: [0]
```
to avoid conflicts with dai plugin
  • Loading branch information
yairans authored Jun 16, 2019
1 parent ea6fc9a commit 27d7b4b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/common/utils/setup-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function getDefaultOptions(options: PartialKPOptionsObject): KPOptionsObject {
configureVrDefaultOptions(defaultOptions);
configureLGTVDefaultOptions(defaultOptions);
configureDAIDefaultOptions(defaultOptions);
configureBumperDefaultOptions(defaultOptions);
configureExternalStreamRedirect(defaultOptions);
maybeSetDefaultUiComponents(defaultOptions);
return defaultOptions;
Expand Down Expand Up @@ -367,6 +368,27 @@ function configureDAIDefaultOptions(options: KPOptionsObject): void {
}
}

/**
* Sets default config option for bumper plugin when ima-dai enabled
* @private
* @param {KPOptionsObject} options - kaltura player options
* @returns {void}
*/
function configureBumperDefaultOptions(options: KPOptionsObject): void {
const bumperPlugin = Utils.Object.getPropertyPath(options, 'plugins.bumper');
const daiPlugin = Utils.Object.getPropertyPath(options, 'plugins.imadai');
if (bumperPlugin && !bumperPlugin.disable && daiPlugin && !daiPlugin.disable) {
Utils.Object.mergeDeep(options, {
plugins: {
bumper: {
position: [0],
disableMediaPreload: true
}
}
});
}
}

/**
* Transform options structure from legacy structure to new structure.
* @private
Expand Down

0 comments on commit 27d7b4b

Please sign in to comment.