()
| 48 | } |
| 49 | |
| 50 | export async function enterFullscreen() { |
| 51 | await document.documentElement.requestFullscreen(); |
| 52 | |
| 53 | const keyboardLockApiSupported = navigator.keyboard !== undefined && "lock" in navigator.keyboard; |
| 54 | |
| 55 | if (keyboardLockApiSupported && navigator.keyboard) { |
| 56 | await navigator.keyboard.lock(["ControlLeft", "ControlRight"]); |
| 57 | |
| 58 | update((state) => { |
| 59 | state.keyboardLocked = true; |
| 60 | return state; |
| 61 | }); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | export async function exitFullscreen() { |
| 66 | await document.exitFullscreen(); |
no test coverage detected