In my project using next.js, typescript, and tailwindcss, I encountered an issue while creating the Masthead for my website. I wanted to set a video as the background, but for some reason, the video was not being recognized. I tried moving it to different directories, importing it with
import Background "./material-bg.mp4"
, and even converting the file from mp4 to webm. However, the problem persisted. I tested with a jpg file and it worked fine, but when it came to videos, there seemed to be an issue with recognition. This led me to believe that the problem lies in the system's ability to recognize videos, as other video files were also not being detected. Any help on this matter would be greatly appreciated!
<video autoPlay loop muted playsInline className='absolute w-full h-full object-cover'>
<source src="./material-bg.webm" type='video/webm; codecs=vp9'/>
</video>