Merge pull request #469 from isymchych/fix-fullscreen
fix issue with fullscreen in Safari in jitsi-meet-new
This commit is contained in:
commit
2ccfc30813
|
@ -101,23 +101,34 @@ function setupToolbars() {
|
||||||
/**
|
/**
|
||||||
* Toggles the application in and out of full screen mode
|
* Toggles the application in and out of full screen mode
|
||||||
* (a.k.a. presentation mode in Chrome).
|
* (a.k.a. presentation mode in Chrome).
|
||||||
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API
|
||||||
*/
|
*/
|
||||||
function toggleFullScreen () {
|
function toggleFullScreen () {
|
||||||
let fsElement = document.documentElement;
|
let isNotFullScreen = !document.fullscreenElement && // alternative standard method
|
||||||
|
|
||||||
if (!document.mozFullScreen && !document.webkitIsFullScreen) {
|
!document.mozFullScreenElement && // current working methods
|
||||||
//Enter Full Screen
|
!document.webkitFullscreenElement &&
|
||||||
if (fsElement.mozRequestFullScreen) {
|
!document.msFullscreenElement;
|
||||||
fsElement.mozRequestFullScreen();
|
|
||||||
} else {
|
if (isNotFullScreen) {
|
||||||
fsElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);
|
if (document.documentElement.requestFullscreen) {
|
||||||
|
document.documentElement.requestFullscreen();
|
||||||
|
} else if (document.documentElement.msRequestFullscreen) {
|
||||||
|
document.documentElement.msRequestFullscreen();
|
||||||
|
} else if (document.documentElement.mozRequestFullScreen) {
|
||||||
|
document.documentElement.mozRequestFullScreen();
|
||||||
|
} else if (document.documentElement.webkitRequestFullscreen) {
|
||||||
|
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Exit Full Screen
|
if (document.exitFullscreen) {
|
||||||
if (document.mozCancelFullScreen) {
|
document.exitFullscreen();
|
||||||
|
} else if (document.msExitFullscreen) {
|
||||||
|
document.msExitFullscreen();
|
||||||
|
} else if (document.mozCancelFullScreen) {
|
||||||
document.mozCancelFullScreen();
|
document.mozCancelFullScreen();
|
||||||
} else {
|
} else if (document.webkitExitFullscreen) {
|
||||||
document.webkitCancelFullScreen();
|
document.webkitExitFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue