Skip to content

Commit

Permalink
fix: Safari picture-in-picture triggers fullscreenchange (#4442)
Browse files Browse the repository at this point in the history
When picture-in-picture mode is entered on Safari, `webkitbeginfullscreen` is triggered which results in a proxied `fullscreenchange` event and adding the fullscreen class to the player. That causes the tech element to collapse to zero height so that the "this video is playing in picture in picture" placeholder is not visible.

As with #4437 for v6, on `webkitbeginfullscreen` check whether the presentation mode is picture-in-picture' before proxying a `fullscreenchange` event.
  • Loading branch information
mister-ben authored and gkatsev committed Jul 4, 2017
1 parent a1763dc commit c17c003
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,12 @@ class Html5 extends Tech {
};

const beginFn = function() {
this.one('webkitendfullscreen', endFn);
if ('webkitPresentationMode' in this.el_ &&
this.el_.webkitPresentationMode !== 'picture-in-picture') {
this.one('webkitendfullscreen', endFn);

this.trigger('fullscreenchange', { isFullscreen: true });
this.trigger('fullscreenchange', { isFullscreen: true });
}
};

this.on('webkitbeginfullscreen', beginFn);
Expand Down

0 comments on commit c17c003

Please sign in to comment.