- first,I create a webpage,and in this page has a button linked to the html5 video player page(this is another page)
- and then, I want to achieve that when click the button, the next
page(html5 video player page)can automatic full screen.
I want it to run in IPhone
I try it use the code
window.load=function(){
myVideo=document.getElementById('video')[0];
if(!myVideo.webkitDisplayingFullscreen){
goFullscreen();
}
function goFullScreen(){ myVideo.webkitEnterFullscreen();}
}
and the chrome said: Uncaught InvalidStateError:Failed to execute'webkitEnterFullscreen' on 'HTMLVideoElement': This element may only enter fullscreen mode in response to a user gesture
so is there some other solutions to get the fullscreen mode automatically??