Skip to content

Commit

Permalink
fix: Resolve dangling endLinearAdMode call in onAdBreakEnd. (#574)
Browse files Browse the repository at this point in the history
We don't want this call to happen after post-rolls. This fixes that.
  • Loading branch information
shawnbuso committed Mar 27, 2018
1 parent a82c421 commit 2158ba0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/player-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ PlayerWrapper.prototype.onAdBreakStart = function(adEvent) {
*/
PlayerWrapper.prototype.onAdBreakEnd = function() {
this.vjsPlayer.on('contentended', this.boundContentEndedListener);
this.vjsPlayer.ads.endLinearAdMode();
if (this.vjsPlayer.ads.inAdBreak()) {
this.vjsPlayer.ads.endLinearAdMode();
}
this.vjsControls.show();
};

Expand Down

0 comments on commit 2158ba0

Please sign in to comment.