Skip to content

Commit

Permalink
fix(FEC-10583): IMA image ad is not functional
Browse files Browse the repository at this point in the history
Description of the Changes
When user clicks through a linear ad, only pause it if it's a video ad
Fixes FEC-10583
  • Loading branch information
SivanA-Kaltura authored Nov 3, 2021
1 parent 22411b0 commit 28fb6c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ima-state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,13 @@ function onAdStarted(options: Object, adEvent: any): void {
function onAdClicked(options: Object, adEvent: any): void {
this.logger.debug(adEvent.type.toUpperCase());
if (this._currentAd.isLinear()) {
this._maybeIgnoreClickOnAd();
if (this._stateMachine.is(State.PLAYING)) {
this._adsManager.pause();
if (this._isVideoAd()) {
this._maybeIgnoreClickOnAd();
if (this._stateMachine.is(State.PLAYING)) {
this._adsManager.pause();
}
this._setToggleAdsCover(true);
}
this._setToggleAdsCover(true);
} else {
if (!this.player.paused) {
this.player.pause();
Expand Down
4 changes: 4 additions & 0 deletions src/ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,10 @@ class Ima extends BasePlugin implements IMiddlewareProvider, IAdsControllerProvi
_playAdByConfig(): boolean {
return !!(this.config.adTagUrl || this.config.adsResponse);
}

_isVideoAd(): boolean {
return this._currentAd && this._currentAd.getContentType().startsWith('video');
}
}

export {Ima};

0 comments on commit 28fb6c3

Please sign in to comment.