1
0
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:
Richard Bushell 2019-04-11 18:57:19 +01:00 committed by Pat O'Neill
parent cd073417ed
commit 22d0514257
2 changed files with 9 additions and 14 deletions

View File

@ -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'
]
];

View File

@ -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) {