Video in HTML

I am practising HTML code after completing the course and I am unable to add a video to my test script.
If I copy and paste a link from the course it works ok but when I try a link from a website it is just blank with the controls, what am I doing wrong?

thanks

You might be infringing copyrights, for example. Just linking from another website won’t work unless the source allows you to embed their videos through an iframe, like Youtube, for example. You need to save the video file on the server that hosts your website – or locally, if you run a website from your computer.

Thanks Mirja, that make sense, cheers

I am trying to pick up a video from my chromebook but it will not insert the video.

It is difficult obtaining the URL to the videos on a chromebook

Any suggestions on how to insert videos coding on a chromebook?
thanks

What is the source code? Please post it here – properly formatted (mark code and press </>)

video src=“Myfiles/Camera/IMG_1147.MOV” controls></video
I have removed the < & > so that it is visible

Please format the code as described above - then it is visible and complete.
How is your file structure? Can you post a screenshot of it?

<!DOCTYPE html>

<html>
    <body>
  <h1>Paws & Claws</h1>
  <main>
    <h2>This is a brief description of what we offer</h2>
    <video src="https://content.codecademy.com/courses/SemanticHTML/dog-video.mp4" controls></video>
    <video src="Myfiles/Camera/IMG_1147.MOV" controls></video>
  </main>
 
  <nav>
    <ul>
      <li><a href="#introduction">Introduction</a></li>
      <li><a href="#habitat">Habitat</a></li>
      <li><a href="#media">Media</a></li>
    </ul>
  </nav>
  </body>
  </html>

type or paste code here

You have a relative path. That should work - given the file path is correct - which I cannot judge without seeing it.
I your html located in the directory Myfiles?

1 Like


My html code is the HMTL Course folder in My Drive and the video I would like to link is in My Files

You used a relative path. That means the path starts where your html file is. In the folder HTML Course is no folder named Myfiles. So the video will not be found.
Also – your html file names should contain spaces.

2 Likes

Mirja, you are a superstar!! I have moved the file to the HTML saved work and now have linked the video
thanks
stewart

1 Like