I have been working on an HTML background video page, and everything seems to be working perfectly on desktop. However, when it comes to mobile, the video does not cover the full screen. Only half of the video is visible on the mobile screen.
Here is the HTML code I have used:
<div style="max-width:100vw;height:100vh;overflow:hidden;">
<video autoplay muted loop id="myVideo">
<source src="video.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</div>
And here is the CSS code for the video:
#myVideo {
min-width: 100%;
min-height: 100%;
z-index: 0;
width: 100%;
height: 100%;
object-fit: cover;
}