mirror of
https://github.com/videojs/video.js.git
synced 2025-01-27 11:22:06 +02:00
fix: Safari picture-in-picture triggers fullscreenchange (#4437)
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. On `webkitbeginfullscreen` check whether the presentation mode is `picture-in-picture` before proxying `fullscreenchange` event.
This commit is contained in:
parent
77ba3d13d9
commit
b63666379d
@ -432,9 +432,12 @@ class Html5 extends Tech {
|
||||
};
|
||||
|
||||
const beginFn = function() {
|
||||
if ('webkitPresentationMode' in this.el_ &&
|
||||
this.el_.webkitPresentationMode !== 'picture-in-picture') {
|
||||
this.one('webkitendfullscreen', endFn);
|
||||
|
||||
this.trigger('fullscreenchange', { isFullscreen: true });
|
||||
}
|
||||
};
|
||||
|
||||
this.on('webkitbeginfullscreen', beginFn);
|
||||
|
Loading…
x
Reference in New Issue
Block a user