1

I have nearly completed a mobile Web site which leverages the jquery mobile framework but have run into a few problems regarding the videos I am serving. Both iPhone and Android open a video in their respective device’s native player. Once the video ends the screen goes black. I would like, however, the player to close and then make the browser page they selected the video from visible again. Is there a way to simply close the player dynamically once the video has completed? I have looked at this post as well as this post but there does not seem to be a clear answer. My test site is here.

Is it easier to close the iPhone/Android video player or do a redirect back to page? Or is this really the same action but simply stated differently?

Community
  • 1
  • 1
emags
  • 721
  • 5
  • 6

1 Answers1

1

when using Android, the video closed automatically for me without any extra code.

I used the following code for iOS to close the video player (using jquery to bind event):


    if(isiPhone){
        $('#video_element').bind('ended', function(){
            document.getElementById('video_element').webkitExitFullScreen();
        });
    }

Check out the following url for details: http://developer.apple.com/library/safari/#documentation/AudioVideo/Reference/HTMLVideoElementClassReference/HTMLVideoElement/HTMLVideoElement.html#//apple_ref/doc/uid/TP40009356

codefly
  • 640
  • 1
  • 5
  • 8