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 committed Sep 25, 2024
1 parent c3c18ee commit 25eb8c0
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 @@ -1336,7 +1336,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 25eb8c0

Please sign in to comment.