<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
video{
width:100%;
height:330px
}
</style>
</head>
<body>
<video controls>
<source src="/hawk.mp4" type="video/mp4">
</video>
<p>Click on the button to request fullscreen of the video.</p>
<button onclick="myFunction()">Click Me</button>
<p><strong>Note</strong>: 'requestFullscreen()' method can only be initiated by a user gesture, not by a programmer himself.</p>
<script>
var elem = document.getElementsByTagName("video")[0];
function myFunction(){
elem.requestFullscreen().catch(err => {
alert("Unable to display in fullscreen");
});
}
</script> </body>
</html>