Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closing iPhone Video Player using Javascript

Tags:

html

iphone

video

I have a web page with several html5 tags, offering users a number of posters/thumbnails for videos they can choose to play. When a user touches one of the them the iPhone video player opens and the video plays. I want to be able to automatically close the video player after the video has finished and return the user to the thumbnails.

I have set the event listener for the "ended" event and I can detect that the video has finished, but I can't figure out how to close the video player and return to the thumbnails. It just waits for the user to touch the "done" button. Is there any way of doing this in Javascript??

like image 712
Phil John Avatar asked Jul 04 '10 18:07

Phil John


1 Answers

jQuery -

$('video').get(0).webkitExitFullscreen();

Uncertain what iOS version this was supported. See The correct method is webkitExitFullscreen. See https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode for full support

like image 77
Mark Avatar answered Sep 28 '22 16:09

Mark