mirror of
https://github.com/videojs/video.js.git
synced 2025-01-08 07:00:10 +02:00
fix: fix fullscreen detection when player is nested within document fullscreen (#5912)
This commit is contained in:
parent
cd073417ed
commit
22d0514257
@ -22,7 +22,8 @@ const apiMap = [
|
||||
'fullscreenElement',
|
||||
'fullscreenEnabled',
|
||||
'fullscreenchange',
|
||||
'fullscreenerror'
|
||||
'fullscreenerror',
|
||||
'fullscreen'
|
||||
],
|
||||
// WebKit
|
||||
[
|
||||
@ -31,16 +32,8 @@ const apiMap = [
|
||||
'webkitFullscreenElement',
|
||||
'webkitFullscreenEnabled',
|
||||
'webkitfullscreenchange',
|
||||
'webkitfullscreenerror'
|
||||
],
|
||||
// Old WebKit (Safari 5.1)
|
||||
[
|
||||
'webkitRequestFullScreen',
|
||||
'webkitCancelFullScreen',
|
||||
'webkitCurrentFullScreenElement',
|
||||
'webkitCancelFullScreen',
|
||||
'webkitfullscreenchange',
|
||||
'webkitfullscreenerror'
|
||||
'webkitfullscreenerror',
|
||||
'-webkit-full-screen'
|
||||
],
|
||||
// Mozilla
|
||||
[
|
||||
@ -49,7 +42,8 @@ const apiMap = [
|
||||
'mozFullScreenElement',
|
||||
'mozFullScreenEnabled',
|
||||
'mozfullscreenchange',
|
||||
'mozfullscreenerror'
|
||||
'mozfullscreenerror',
|
||||
'-moz-full-screen'
|
||||
],
|
||||
// Microsoft
|
||||
[
|
||||
@ -58,7 +52,8 @@ const apiMap = [
|
||||
'msFullscreenElement',
|
||||
'msFullscreenEnabled',
|
||||
'MSFullscreenChange',
|
||||
'MSFullscreenError'
|
||||
'MSFullscreenError',
|
||||
'-ms-fullscreen'
|
||||
]
|
||||
];
|
||||
|
||||
|
@ -1989,7 +1989,7 @@ class Player extends Component {
|
||||
documentFullscreenChange_(e) {
|
||||
const fsApi = FullscreenApi;
|
||||
|
||||
this.isFullscreen(document[fsApi.fullscreenElement] === this.el());
|
||||
this.isFullscreen(document[fsApi.fullscreenElement] === this.el() || this.el().matches(':' + fsApi.fullscreen));
|
||||
|
||||
// If cancelling fullscreen, remove event listener.
|
||||
if (this.isFullscreen() === false) {
|
||||
|
Loading…
Reference in New Issue
Block a user