JSFiddle - React, Tailwind, and code Playground
HTML
<video id="moodvideo" autoplay loop>
<source src="moodvideo.mp4" type='video/mp4'>
<img id="alternative" src="alternative.jpg" />
</video>
CSS
#moodvideo, #alternative {
width: 100vw;
/* Could also use width: 100%; */
height: 100vh;
object-fit: cover;
position: fixed;
/* Change position to absolute if you don't want it to take up the whole page */
left: 0px;
top: 0px;
z-index: -1;
}