Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Video and Audio Media Basics The Audio Element

Umair Abid
Umair Abid
Courses Plus Student 4,463 Points

Audio is not displaying

I have typed the same code as in the video but it is not displaying in the webpage. this is the link to the workspace : https://w.trhou.se/1nvhwqu7vf

1 Answer

Steven Parker
Steven Parker
218,692 Points

The video element was written as a self-closing tag, with "/>" at the end of a single tag.

It should be a conventional tag with a separate start and end instead:

      <video src="http://treehouse-code-samples.s3.amazonaws.com/html-video-and-audio/bridge.mp4"
             type="video/mp4" controls>

It is shown two ways in the videos, but apparently the single-tag form is a bug in the video, as according to the MDN <video> Documentation:

both the starting and ending tag are mandatory

You might want to report this bug to Support.

Umair Abid
Umair Abid
Courses Plus Student 4,463 Points

Yes you are right! When i tried the other method it worked. Thanks for the help.