Skip to content

Commit

Permalink
fix: Call startLinearAdMode on post-rolls. Fixes an issue where contr…
Browse files Browse the repository at this point in the history
…ib-ads thought we were timing out on all post-rolls.\Fixes #620. (#631)
  • Loading branch information
shawnbuso committed May 31, 2018
1 parent b6dbc62 commit 6088f86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/controller.js
Expand Up @@ -294,7 +294,7 @@ Controller.prototype.onAdError = function(adErrorEvent) {
* @param {Object} adEvent The event fired by the IMA SDK.
*/
Controller.prototype.onAdBreakStart = function(adEvent) {
this.playerWrapper.onAdBreakStart(adEvent);
this.playerWrapper.onAdBreakStart();
this.adUi.onAdBreakStart(adEvent);
};

Expand Down
9 changes: 2 additions & 7 deletions src/player-wrapper.js
Expand Up @@ -456,16 +456,11 @@ PlayerWrapper.prototype.onAdError = function(adErrorEvent) {

/**
* Handles ad break starting.
*
* @param {Object} adEvent The event fired by the IMA SDK.
*/
PlayerWrapper.prototype.onAdBreakStart = function(adEvent) {
PlayerWrapper.prototype.onAdBreakStart = function() {
this.contentSource = this.vjsPlayer.currentSrc();
this.vjsPlayer.off('contentended', this.boundContentEndedListener);
if (adEvent.getAd().getAdPodInfo().getPodIndex() != -1) {
// Skip this call for post-roll ads
this.vjsPlayer.ads.startLinearAdMode();
}
this.vjsPlayer.ads.startLinearAdMode();
this.vjsControls.hide();
this.vjsPlayer.pause();
};
Expand Down

0 comments on commit 6088f86

Please sign in to comment.