Skip to content

Commit

Permalink
Revert "[PBW-7945] (#314)" (#315)
Browse files Browse the repository at this point in the history
This reverts commit 65d9b57.
  • Loading branch information
ooyala-amohnatkin authored and zelibobla committed May 8, 2019
1 parent 65d9b57 commit 295bb53
Show file tree
Hide file tree
Showing 2 changed files with 1,261 additions and 1,249 deletions.
17 changes: 6 additions & 11 deletions js/google_ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,6 @@ require('../html5-common/js/utils/utils.js');
// don't have ad object associated.
const eventType = google.ima.AdEvent.Type;
const ad = adEvent.getAd();

// Retrieve the ad data as well.
// Some events will not have ad data associated.
const adData = adEvent.getAdData();
Expand All @@ -1604,9 +1603,7 @@ require('../html5-common/js/utils/utils.js');
if (_amc.ui.useSingleVideoElement) {
_amc.focusAdVideo();
}
if (ad) {
this.currentMedia = ad.getMediaUrl();
}
this.currentMedia = ad.getMediaUrl();
_resetUIContainerStyle();
break;
case eventType.STARTED:
Expand All @@ -1626,7 +1623,7 @@ require('../html5-common/js/utils/utils.js');
}

this.adPlaybackStarted = true;
if (ad && ad.isLinear()) {
if (ad.isLinear()) {
_linearAdIsPlaying = true;

if (!_amc.ui.useSingleVideoElement) {
Expand Down Expand Up @@ -1654,7 +1651,7 @@ require('../html5-common/js/utils/utils.js');
_onSizeChanged();
_tryStartAd();
if (this.videoControllerWrapper) {
if (ad && ad.isLinear()) {
if (ad.isLinear()) {
this.videoControllerWrapper.raisePlayEvent();
}
this.videoControllerWrapper.raiseTimeUpdate(this.getCurrentTime(), this.getDuration());
Expand All @@ -1663,13 +1660,13 @@ require('../html5-common/js/utils/utils.js');
// Non-linear ad rules or VMAP ads will not be started by _tryStartAd()
// because there'll be no AMC ad pod. We start them here after the time update event
// in order to prevent the progress bar from flashing
if (_usingAdRules && ad && !ad.isLinear()) {
if (_usingAdRules && !ad.isLinear()) {
_startNonLinearAdRulesOverlay();
}
break;
case eventType.RESUMED:
if (this.videoControllerWrapper) {
if (ad && ad.isLinear()) {
if (ad.isLinear()) {
this.videoControllerWrapper.raisePlayEvent();
}
}
Expand Down Expand Up @@ -2138,10 +2135,8 @@ require('../html5-common/js/utils/utils.js');
} else {
_endCurrentAdPod(true);
}
} else if (forceEndAdPod) {
_resetAdsState();
}

_resetUIContainerStyle();
this.currentIMAAd = null;
this.adPlaybackStarted = false;
Expand Down
Loading

0 comments on commit 295bb53

Please sign in to comment.