jquery - html5 video tag to play full screen with Android -


I am creating a mobile site, where I have a video that I click on a link when I play Want to:

  & lt; Div id = "player" & gt; & Lt; / Div & gt; & Lt; A href = "#" onclick = "duplicate (' gt; & lt; / video & gt;"); Mydiv.append (MyVideo); } And {$ ('# myfileplayer'). Attr ("src", theUrl); }} & Lt; / Script & gt;   

With the iPhone, it works great, I click on the video and it comes full screen Android also works but for that you need to click on the video , Then click on full screen. Can you access full screen like iPhone during playback?

This should work, with plain javascript:

  var MyVideo = document.getElementById ('myVideoTag'); MyVideo.play (); If (typef (myVideo.webkitEnterFullscreen)! = "Undefined") {// This is for myroid.webkitEnterFullscreen () for Android stock; } And if (typef (myVideo.webkitRequestFullscreen)! = "Undefined") {// it is for Chrome myVideo.webkitRequestFullscreen (); } And if (typef (myVideo.mozRequestFullScreen)! = "Undefined") {myVideo.mozRequestFullScreen (); }   

You have to trigger play () before the fullscreen instruction, otherwise it will go full screen in the Android browser, but it will not start playing. Tested with the latest version of Android Browser, Chrome, Safari

Comments