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

Tell us what’s happening:

this is my audio element:

code camp is saying i dont pass this:
18. The audio element should have a src attribute pointing to an audio file.

i have a src attribute and the audio element works in the preview. i dont know why it wont let me pass

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>Main title of page</h1>
  <section>
    <h2>title of video playing</h2>
    <video width="640" controls>
      <source src="https://cdn.freecodecamp.org/curriculum/labs/what-is-the-map-method-and-how-does-it-work.mp4" type="video/mp4">
    </video>
  </section>
  <section>
    <h2>title of second song</h2>
    <audio controls loop>
      <source src="https://cdn.freecodecamp.org/curriculum/js-music-player/sailing-away.mp3" type="audio/mpeg">
    </audio>
  </section>
</body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36

Challenge Information:

Build an HTML Audio and Video Player - Build an HTML Audio and Video Player
https://www.freecodecamp.org/learn/full-stack-developer/lab-html-audio-and-video-player/build-an-html-audio-and-video-player

Welcome to the forum @masae1263

The audio element does not have a source element.

Happy coding

Your src ends with mp3 while your type ends with mpeg.

If your src ends with mp3, the type should also end with mp3.

All the best!

1 Like

i dont get it what do you mean im new to coding by the way so pls dont mind me and thanks

if you need help with your code please use the HELP button in the lab or workshop you are working on