full keyboard control in fullscreen using chrome in sharing #1881

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-08-27 15:12:05 +01:00
parent f95dbdd404
commit bf00de4425
1 changed files with 2 additions and 0 deletions

View File

@ -812,6 +812,7 @@
// Enter browser fullscreen
function enterBrowserFullscreen(elem) {
if (navigator.keyboard && navigator.keyboard.lock) { navigator.keyboard.lock(); }
if (elem.requestFullscreen) { elem.requestFullscreen(); }
else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); }
else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); }
@ -824,6 +825,7 @@
else if (document.msExitFullscreen) { document.msExitFullscreen(); }
else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); }
else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); }
if (navigator.keyboard && navigator.keyboard.unlock) { navigator.keyboard.unlock(); }
}
// Return true if the browser is fullscreen. This is a delayed method that will return true/false late. Not very useful.