Skip to content

Commit

Permalink
fix(UI): Don't try to add MediaSessionHandler for PiP when it's not a…
Browse files Browse the repository at this point in the history
…vailable (#7376)
  • Loading branch information
avelad authored Sep 25, 2024
1 parent 6884721 commit e71dca2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,10 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
addMediaSessionHandler('seekforward', commonHandler);
addMediaSessionHandler('seekto', commonHandler);
addMediaSessionHandler('stop', commonHandler);
addMediaSessionHandler('enterpictureinpicture', commonHandler);
if ('documentPictureInPicture' in window ||
document.pictureInPictureEnabled) {
addMediaSessionHandler('enterpictureinpicture', commonHandler);
}

this.eventManager_.listen(this.video_, 'timeupdate', () => {
updatePositionState();
Expand Down

0 comments on commit e71dca2

Please sign in to comment.