How to display a local video in Next JS? [closed]

I tried multiple ways to display a local video from assets folder but I’m getting the same error

./assets/videos/video.mp4 Module parse failed: Unexpected character '' (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.

I tried to add it like this <video src={require("./../assets/videos/video.mp4").default} /> but it didn’t work.

Answer

You must put your video file inside the public folder and then you can play it in your component like this :

 <video controls src={"/filename.mp4"} style={{ width: "400px", height"400px" }} />