diff --git a/ui/controls.js b/ui/controls.js index eb803dc109..3ef1cfc78f 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -1614,11 +1614,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) {