Skip to content
Permalink
Browse files

Merge pull request #3466 from jwplayer/bugfix/jw8-10170_pauseAds

[JW8-10170] Resolve pauseAds issues
  • Loading branch information...
waxidiotic committed Aug 14, 2019
2 parents 5d2f627 + c0cb6df commit dc4034b8fe77d6d707ac05bb479b1fe3c51b1ed3
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/js/controller/instream-adapter.js
@@ -403,6 +403,16 @@ const InstreamAdapter = function(_controller, _model, _view, _mediaPool) {
* @return {void}
*/
this.skipAd = function(event) {
const autoPauseAds = _model.get('autoPause').pauseAds;
const didAutostart = _model.get('playReason') === 'autostart';
const viewable = _model.get('viewable');
if (autoPauseAds && !didAutostart && !viewable) {
// If autoPause.pauseAds is enabled and player is not viewable
// when skipAd() is called, do not resume playback unless player
// was autostarted out of view and never came in to view
this.noResume = true;
}

const skipAdType = AD_SKIPPED;
this.trigger(skipAdType, event);
_skipAd.call(this, {
@@ -469,9 +479,7 @@ const InstreamAdapter = function(_controller, _model, _view, _mediaPool) {
// when instream was inited and the player was not destroyed\
_controller.attachMedia();

const autoPauseAds = _model.get('autoPause').pauseAds;
const playerState = _model.get('state');
if (this.noResume || (playerState === STATE_PAUSED) && autoPauseAds) {
if (this.noResume) {
return;
}

0 comments on commit dc4034b

Please sign in to comment.
You can’t perform that action at this time.