Build an HTML Audio and Video Player - Build an HTML Audio and Video Player

Tell us what’s happening:

I’m having some issues with the audio and video elements and their attributes. It looks and works fine on the preview, but the tests aren’t accepting the code.

I think I’m misunderstanding how the elements are meant to be formatted, or something basic here, but I’ve looked through every forum post, re-read the theory page and tried W3/GeeksforGeeks. I even tried some of the solutions on the forums, and that worked a little (for the video element), but I still don’t understand why that helped or what it did, and that takes half of the fun of learning it out :[

Your code so far

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>HTML Audio and Video Lab</title>
</head>

<body>
  <h1> HTML Audio and Video Player
  <!-- Section One -->
<section>
 <h2> The Map Method </h2>
 <video controls width="640">
 <source src="https://cdn.freecodecamp.org/curriculum/labs/What is the map method and how does it work.mp4" type="video/mp4"> </source>
</video>

  <!-- Section Two -->
<section>
<h2> Sailing Away </h2>
<audio controls loop>
<src="https://cdn.freecodecamp.org/curriculum/js-music-player/sailing-away.mp3" type="audio/mp3"/> 
</audio>

</section>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0

Challenge Information:

Build an HTML Audio and Video Player - Build an HTML Audio and Video Player

Hi there!

  1. Where is your closing section tag for the first section element?
  2. Take a look again at src, is it in the right place?

Is it not? Is it meant to go in the audio tag as well?

1 Like

Also, apologies for the delay, my computer died ^^”

1 Like

Yes, correct, just move it there to fix the issue

Thank you! I can’t believe it worked that time; last time, it was an error :[

1 Like

You’re welcome and happy coding!

1 Like