Skip to content

Commit cc11605

Browse files
committed
fix(UI): Allow pause non-linear video ads (#7699)
1 parent c0e6322 commit cc11605

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

ui/controls.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1638,11 +1638,13 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
16381638

16391639
/** @private */
16401640
onPlayPauseClick_() {
1641-
if (this.ad_ && this.ad_.isLinear()) {
1641+
if (this.ad_) {
16421642
this.playPauseAd();
1643-
} else {
1644-
this.playPausePresentation();
1643+
if (this.ad_.isLinear()) {
1644+
return;
1645+
}
16451646
}
1647+
this.playPausePresentation();
16461648
}
16471649

16481650
/** @private */

ui/play_button.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ shaka.ui.PlayButton = class extends shaka.ui.Element {
7777
});
7878

7979
this.eventManager.listen(this.button, 'click', () => {
80-
if (this.ad && this.ad.isLinear()) {
80+
if (this.ad) {
8181
this.controls.playPauseAd();
82-
} else {
83-
this.controls.playPausePresentation();
82+
if (this.ad.isLinear()) {
83+
return;
84+
}
8485
}
86+
this.controls.playPausePresentation();
8587
});
8688

8789
if (this.ad) {

0 commit comments

Comments
 (0)