Reputation: 2449
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 of listeners as IN THIS DOC Also tried with webkitfullscreenchange and with all events in this URL. the "ended" event works but I need to detect also when the user goes back and exits the video.
Particulary my problem is in android 2.3.5 when user clicks on play, autmatically goes to fullscreen, then change the orientation of the video, and then clicks on back. at that point my page is all screwed, as it doesnt fire the onorientationchange event once inside the video and thats why I need to rezise my layers. If someone knows or faced a similar problem please let me know how you solved it, thanks
EDIT I would also like to know if there is any solution for the poster being reduced its size once the video played
Upvotes: 2
Views: 1923
Reputation: 696
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.
Upvotes: 1