1
votes

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

1
Completely deactivating full screen mode would also be an option - Jonas Grumann
On back button click you can check if the current document is in full screen (document.webkitIsFullScreen) and in case cancel it (document.webkitCancelFullScreen();). Just be careful to catch also other vendors code. - MarcoL
It worked like a charme. I don't think I need to catch other vendors code as it's a chrome only issue. If you write it as an answer I'll mark it as accepted. - Jonas Grumann
How did you track the back button event in the fullscreen mode? - Georgy

1 Answers

3
votes

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();).