Skip to content

Commit

Permalink
fix(UI): Allow pause non-linear video ads (#7699)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Dec 4, 2024
1 parent cc7c738 commit 8633980
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
8 changes: 5 additions & 3 deletions ui/play_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8633980

Please sign in to comment.