Using the Fullscreen API in web browsers

The user could, for instance, exit fullscreen, something that might be
good for you to know. For that we have a fullscreenchange event, that
you can apply both to the element that requested fullscreen, but also
to the document. Then we just detect the fullscreen state and take act
accordingly, like this: