Next.js Discord

Discord Forum

Nextjs video help

Answered
In&Out posted this in #help-forum
Open in Discord
Avatar
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

Avatar
But it doesnt work, video is in same folder as the component
Avatar
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
Avatar
Ahhh will try thanks
Avatar
Still the same
Image
Avatar
Selkirk Rex
Are you sure that this is the src problem
i mean what you see
when app is running
Avatar
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?
Image
Avatar
Selkirk Rex
yep thats what i was thinking
dunno is not it browser feature
Avatar
ugh okay