Jonas Grumann
Jonas Grumann

Reputation: 10786

Force Chrome (38) to exit full screen mode

I have a webpage that uses the history api to navigate between pages without complete page refreshs. It all worked great on desktop and mobiles until the last chrome update (38.0.2125.102) on Android (4.4.2).

The problem is with the full screen mode of the browser: when the user comes to our site there's a link to a video gallery, he clicks it and a lightbox opens up with a vimeo embedded video in it. He then taps the video to watch it and it goes fullsceen (a message appears on top that the browser is in fullscreen mode). If the user closes the video like suggested (by dragging down from the top) everything works as expected, but if he taps the devices 'back' button, the browser kinda closes the video (I can still hear it play somewhere) but doesn't really leave the full screen mode (messing up stuff until the user drags from the top).

I'm able to detect when the user has tapped that button, and my question is can I force the browser to leave the fullscreen mode through javascript?

Thanks

Upvotes: 1

Views: 1660

Answers (1)

MarcoL
MarcoL

Reputation: 9989

As stated on the comment above:

On back button click you can check if the current document is in full screen (document.webkitIsFullScreen) and in case cancel it (document.webkitCancelFullScreen();).

Upvotes: 4

Related Questions