Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-10694): Ima post roll overrides the post bumper #378

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/common/controllers/ads-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,18 +324,17 @@ class AdsController extends FakeEventTarget implements IAdsController {
}
const bumperCtrl = this._adsPluginControllers.find(controller => this._isBumper(controller));
const adCtrl = this._adsPluginControllers.find(controller => !this._isBumper(controller));
const bumperCompletePromise = bumperCtrl && typeof bumperCtrl.onPlaybackEnded === 'function' ? bumperCtrl.onPlaybackEnded() : Promise.resolve();
const adCompletePromise = adCtrl && typeof adCtrl.onPlaybackEnded === 'function' ? adCtrl.onPlaybackEnded() : Promise.resolve();
const bumperCompleted =
bumperCtrl && typeof bumperCtrl.onPlaybackEnded === 'function' ? () => bumperCtrl.onPlaybackEnded() : () => Promise.resolve();
const adCompleted = adCtrl && typeof adCtrl.onPlaybackEnded === 'function' ? () => adCtrl.onPlaybackEnded() : () => Promise.resolve();
if (!(this._adBreaksLayout.includes(-1) || this._adBreaksLayout.includes('100%'))) {
this._allAdsCompleted = true;
} else {
const playbackEndedHandler = () => this._handleConfiguredPostroll();
// $FlowFixMe
bumperCompletePromise.finally(() => {
// $FlowFixMe
adCompletePromise.finally(playbackEndedHandler);
});
}
// $FlowFixMe
bumperCompleted().finally(() => {
// $FlowFixMe
adCompleted().finally(() => this._handleConfiguredPostroll());
});
}

_onPlaybackEnded(): void {
Expand Down