开发者

Mobile Safari video question

I'm playing with the iPhone's Safari HTML5 <video> tag and I was wondering if there's a way to programmatically quit fullscreen mode once the video is done playing?

You start 开发者_如何学Pythonfullscreen mode using the play()-function, but how do you end it?

Thanks in advance, Thomas


Use the "ended" event and the webkitExitFullScreen() method.

If you are using jQuery this is how you would do that:

// #video is the ID of the <video> element.    
$('#video').bind('ended', function() 
    {   
       var videoEl = document.getElementById('video');  
       videoEl.webkitExitFullScreen()

    });

The trick is sending video into fullscreen mode and playing the video all with one click on a thumbnail. For the life of me I can't figure that out!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜