full screen button in video tag html5

Solutions on MaxInterview for full screen button in video tag html5 by the best coders in the world

showing results for - "full screen button in video tag html5"
Malak
18 May 2019
1<script type="text/javascript">
2function goFullscreen(id) {
3  var element = document.getElementById(id);       
4  if (element.mozRequestFullScreen) {
5    element.mozRequestFullScreen();
6  } else if (element.webkitRequestFullScreen) {
7    element.webkitRequestFullScreen();
8  }  
9}
10</script>
11
12
13//Html code:
14
15<video class="video_player" id="player" width="100%" controls="controls" autoplay="autoplay">
16  <source src="INPUT VIDEO URL HERE"/>
17  Your browser does not support the HTML5 video tag.  Use a better browser!
18</video>
19<button onclick="goFullscreen('player'); return false">
20  View Fullscreen!
21</button>