Next.js Discord

Discord Forum

Nextjs video help

Answered
In&Out posted this in #help-forum
Open in Discord
Hello, i am trying to put a video on my page, this is the code
        <video className={styles.video} preload="none">
          <source
            src="/video.mp4"
            type="video/mp4"
            autoPlay
            loop
            muted
            playsInline
          />
          Your browser does not support the video tag.
        </video>
Answered by Selkirk Rex
As I remember, if you want to import something relative to the domain, you need to place it in the public folder. Otherwise, use the import statement.
View full answer

15 Replies

But it doesnt work, video is in same folder as the component
@In&Out But it doesnt work, video is in same folder as the component
Selkirk Rex
As I remember, if you want to import something relative to the domain, you need to place it in the public folder. Otherwise, use the import statement.
Answer
Selkirk Rex
Are you sure that this is the src problem
i mean what you see
when app is running
@Selkirk Rex when app is running
nevermind, for some dumb reason i had to put width and height property, even tho they are ignored because i have classname
it works, thanks
tho, how ot remove this?
@In&Out it works, thanks
Selkirk Rex
dunno is not it browser feature
ugh okay