Next.js Discord

Discord Forum

video tag doesn't work source from link

Unanswered
Ashy Storm-Petrel posted this in #help-forum
Open in Discord
Ashy Storm-PetrelOP
hello am trying to play video using video tag in v14 but it doesn't load anything but it would work fine in html

13 Replies

Ashy Storm-PetrelOP
      <video controls>
        <source src='https://dhaka.b-cdn.net/f608b4f4-9107-4497-8945-efb34fcd1cd1.mp4' />
      </video>
This is the general basis for the <video> tag that I found on the NextJS [documentation](https://nextjs.org/docs/app/building-your-application/optimizing/videos):

export function Video() {
  return (
    <video width="320" height="240" controls preload="none">
      <source src="/path/to/video.mp4" type="video/mp4" />
      <track
        src="/path/to/captions.vtt"
        kind="subtitles"
        srcLang="en"
        label="English"
      />
      Your browser does not support the video tag.
    </video>
  )
}
I think you're missing width and height
also, are there any serverside or client side errors that come up?
my video is in mp4 format hosted in server
i works fine on videos tags on normal html but not in next
and on IDM it shows download button and it does indeed get the right file but for some reason it doesn't work
hmm
try this NextJS video component @Ashy Storm-Petrel
https://next-video.dev/