mirror of
https://github.com/videojs/video.js.git
synced 2025-01-10 23:30:03 +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',
|
'fullscreenElement',
|
||||||
'fullscreenEnabled',
|
'fullscreenEnabled',
|
||||||
'fullscreenchange',
|
'fullscreenchange',
|
||||||
'fullscreenerror'
|
'fullscreenerror',
|
||||||
|
'fullscreen'
|
||||||
],
|
],
|
||||||
// WebKit
|
// WebKit
|
||||||
[
|
[
|
||||||
@ -31,16 +32,8 @@ const apiMap = [
|
|||||||
'webkitFullscreenElement',
|
'webkitFullscreenElement',
|
||||||
'webkitFullscreenEnabled',
|
'webkitFullscreenEnabled',
|
||||||
'webkitfullscreenchange',
|
'webkitfullscreenchange',
|
||||||
'webkitfullscreenerror'
|
'webkitfullscreenerror',
|
||||||
],
|
'-webkit-full-screen'
|
||||||
// Old WebKit (Safari 5.1)
|
|
||||||
[
|
|
||||||
'webkitRequestFullScreen',
|
|
||||||
'webkitCancelFullScreen',
|
|
||||||
'webkitCurrentFullScreenElement',
|
|
||||||
'webkitCancelFullScreen',
|
|
||||||
'webkitfullscreenchange',
|
|
||||||
'webkitfullscreenerror'
|
|
||||||
],
|
],
|
||||||
// Mozilla
|
// Mozilla
|
||||||
[
|
[
|
||||||
@ -49,7 +42,8 @@ const apiMap = [
|
|||||||
'mozFullScreenElement',
|
'mozFullScreenElement',
|
||||||
'mozFullScreenEnabled',
|
'mozFullScreenEnabled',
|
||||||
'mozfullscreenchange',
|
'mozfullscreenchange',
|
||||||
'mozfullscreenerror'
|
'mozfullscreenerror',
|
||||||
|
'-moz-full-screen'
|
||||||
],
|
],
|
||||||
// Microsoft
|
// Microsoft
|
||||||
[
|
[
|
||||||
@ -58,7 +52,8 @@ const apiMap = [
|
|||||||
'msFullscreenElement',
|
'msFullscreenElement',
|
||||||
'msFullscreenEnabled',
|
'msFullscreenEnabled',
|
||||||
'MSFullscreenChange',
|
'MSFullscreenChange',
|
||||||
'MSFullscreenError'
|
'MSFullscreenError',
|
||||||
|
'-ms-fullscreen'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1989,7 +1989,7 @@ class Player extends Component {
|
|||||||
documentFullscreenChange_(e) {
|
documentFullscreenChange_(e) {
|
||||||
const fsApi = FullscreenApi;
|
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 cancelling fullscreen, remove event listener.
|
||||||
if (this.isFullscreen() === false) {
|
if (this.isFullscreen() === false) {
|
||||||
|
Loading…
Reference in New Issue
Block a user