<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
video{
width:100%;
height:330px
}
</style>
</head>
<body>
<video id="myVideo" controls>
<source src="/hawk.mp4" type="video/mp4">
</video>
<button onclick="myFunction()">Fullscreen</button>
<p><strong>Note</strong>: Open your console and then click on 'Fullscreen' button and then 'Esc'.</p>
<script>
var x = document.getElementById("myVideo");
function myFunction(){
x.requestFullscreen();
}
x.onfullscreenchange = function(event){
if(document.fullscreenElement)
console.log("Video is in fullscreen");
else
console.log("Video is not in fullscreen");
};
</script> </body>
</html>