Fullscreen API: requestFullscreen Playground

Play the class film fullscreen: requestFullscreen() inside your click or as the page opens, an Esc the viewer presses, and fullscreenchange: does your code’s…

Why it matters

Video players, image viewers, presentations, games and editor focus modes all use this. Knowing that fullscreen is per element, needs a user gesture, and can end through Esc without your code puts the call in the right place and keeps your UI honest.

The key idea

Fullscreen is per element, needs a gesture, and is ended by the browser

Common mistakes

Try it in this playground