Skip to content

Commit

Permalink
fix(FEC-11757): V3: live with Ad: UI wrong state (Video is paused) af…
Browse files Browse the repository at this point in the history
…ter closing the new opened Ad tab
  • Loading branch information
JonathanTGold committed Jan 19, 2022
1 parent 4ba1273 commit 005f01b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ dist: xenial
language: node_js
node_js:
- 'node'
env:
global:
- NODE_OPTIONS="--openssl-legacy-provider"

addons:
chrome: stable
Expand Down
8 changes: 8 additions & 0 deletions src/ima-dai.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ class ImaDAI extends BasePlugin implements IAdsControllerProvider, IEngineDecora
this._streamManager.addEventListener(this._sdk.api.StreamEvent.Type.THIRD_QUARTILE, () => this._onAdThirdQuartile());
this._streamManager.addEventListener(this._sdk.api.StreamEvent.Type.COMPLETE, () => this._onAdCompleteFromSDK());
this._streamManager.addEventListener(this._sdk.api.StreamEvent.Type.CLICK, () => this._onAdClickFromSDK());
this._streamManager.addEventListener(this._sdk.api.StreamEvent.Type.PAUSED, () => this._onAdPause());
}

_requestVODStream(): void {
Expand Down Expand Up @@ -565,9 +566,16 @@ class ImaDAI extends BasePlugin implements IAdsControllerProvider, IEngineDecora
this.player.pause();
this.pauseAd();
}
} else if (this._state === ImaDAIState.PAUSED) {
this.player.play();
this.resumeAd();
}
}

_onAdPause() {
this.pauseAd();
}

_onAdBreakEnded(): void {
if (this._adBreak) {
this._adBreak = false;
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1886,9 +1886,9 @@ camelcase@^6.0.0:
integrity sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==

caniuse-lite@^1.0.30001093:
version "1.0.30001105"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001105.tgz#d2cb0b31e5cf2f3ce845033b61c5c01566549abf"
integrity sha512-JupOe6+dGMr7E20siZHIZQwYqrllxotAhiaej96y6x00b/48rPt42o+SzOSCPbrpsDWvRja40Hwrj0g0q6LZJg==
version "1.0.30001292"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001292.tgz"
integrity sha512-jnT4Tq0Q4ma+6nncYQVe7d73kmDmE9C3OGTx3MvW7lBM/eY1S1DZTMBON7dqV481RhNiS5OxD7k9JQvmDOTirw==

chai@^4.2.0:
version "4.2.0"
Expand Down

0 comments on commit 005f01b

Please sign in to comment.