Closed Dishwasha closed 1 year ago
How could be then full-screen mode exited? By pressing F11 again?
https://wicg.github.io/keyboard-lock/#fullscreen-considerations explains that F11 is a user-initiated fullscreen which isn't compatible with Keyboard API. It only works with javascript initiated fullscreen API calls (i.e. via the fullscreen "fa-expand" onscreen button). The browser message will actually change from "Press Esc to exit fullscreen" to "Press and hold Esc to exit fullscreen", so the user has to hold down the Escape key rather than just press it. Alternatively if they move the mouse to the top of the screen the big circle X still appears which they can click on to exit fullscreen mode as well.
Looks good. I'd rather be, if lock and unlock function were in the same file. E.g. in video.vue
inside requestFullscreen()
function.
Makes sense. How's this change look? Re-tested and it works.
Looks much better, thank you!
When using fullscreen mode, hitting the escape key will exit out of fullscreen mode. To stay in fullscreen mode but pass the escape key through, we can use the Keyboard API to require the escape key be held down https://wicg.github.io/keyboard-lock/#escape-key.
Tested in Chrome which supports Keyboard API and Firefox which does not https://caniuse.com/?search=navigator.keyboard with no errors in either case.