Skip to content

Commit

Permalink
fix: Picture in Picture visible while Fullscreened
Browse files Browse the repository at this point in the history
Picture in Picture remains open if entering fullscreen. This disables Picture in Picture when entering fullscreen.

Closes videojs#7921
  • Loading branch information
ThorTJ committed Oct 2, 2022
1 parent 5bcf4d1 commit 92760fc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -2918,6 +2918,11 @@ class Player extends Component {

if (promise) {
promise.then(() => this.isFullscreen(true), () => this.isFullscreen(false));
// When entering fullscreen disable picture in picture
// This is done with promises when supported
if (this.isInPictureInPicture()) {
promise.then(this.exitPictureInPicture());
}
}

return promise;
Expand All @@ -2930,6 +2935,10 @@ class Player extends Component {
// fill the viewport
this.enterFullWindow();
}
// When entering fullscreen disable picture in picture
if (this.isInPictureInPicture()) {
this.exitPictureInPicture();
}
}

/**
Expand Down

0 comments on commit 92760fc

Please sign in to comment.