Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Video and Audio Media Basics The Audio Element

Umair Abid
PLUS
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
231,236 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>
      </video>

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.