Skip to content Skip to sidebar Skip to footer

Detect Exit Fullscreen Html Video

When I open a html5 video from my Android and automatically goes to full screen, I want to detect when the user taps on back button and gets out of the video, I had tried a bunch o

Solution 1:

I cannot think of a direct solution to your problem, however there's a work-around I just thought of. Try this:

When a user clicks the video to start playing it, you can trigger a little JavaScript function that handles your display/page re-size. Have the function repeat every second or so. This function could check the screen width to determine if the display is in landscape mode and then re-size your layers accordingly. When the video is done, your page layout would have been reset already. The function could continue listening for an orientation change back to portrait, at which time it will simply re-size your layers and then stop calling/repeating itself.

I realize some devices may kill/stop any JS processes on you page once you click the movie, in which case you can simply interrupt the user's click, execute your re-size, then call the movie via JavaScript.

I hope this helps. Good Luck.

Post a Comment for "Detect Exit Fullscreen Html Video"