diff --git a/ui/controls.js b/ui/controls.js index 8d1e00195a..280566e2d9 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -1638,11 +1638,13 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget { /** @private */ onPlayPauseClick_() { - if (this.ad_ && this.ad_.isLinear()) { + if (this.ad_) { this.playPauseAd(); - } else { - this.playPausePresentation(); + if (this.ad_.isLinear()) { + return; + } } + this.playPausePresentation(); } /** @private */ diff --git a/ui/play_button.js b/ui/play_button.js index 5eea9b4099..b2b062c98d 100644 --- a/ui/play_button.js +++ b/ui/play_button.js @@ -77,11 +77,13 @@ shaka.ui.PlayButton = class extends shaka.ui.Element { }); this.eventManager.listen(this.button, 'click', () => { - if (this.ad && this.ad.isLinear()) { + if (this.ad) { this.controls.playPauseAd(); - } else { - this.controls.playPausePresentation(); + if (this.ad.isLinear()) { + return; + } } + this.controls.playPausePresentation(); }); if (this.ad) {