Run a video in html5 in full screen

3

I'm using this solution to load an html that has a js that loads a url of an encrypted video. Everything is fine however, I need to give the first play in the video (click on the webview) the video to be executed in fullscreen immediately. Is it possible?

    
asked by anonymous 03.08.2015 / 17:33

1 answer

1

Try this:

<video controls id="myvideo">
  <source src="somevideo.webm"></source>
  <source src="somevideo.mp4"></source>
</video>

In javascript:

var elem = document.getElementById("myvideo");
if (elem.requestFullscreen) {
  elem.requestFullscreen();
} else if (elem.mozRequestFullScreen) {
  elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
  elem.webkitRequestFullscreen();
}
    
04.08.2015 / 18:53