Tell us what’s happening:
I’m having difficulties when doing the Lab, “Build an HTML Audio and Video Player” in the “Basic HTML" section.
In this lab, it says, “You should have an audio element with the controls and loop attributes, and a src attribute that points to an audio file.”
I tried the solutions on the forum but it keeps saying “The audio element should have a src attribute pointing to an audio file.”
How can I solve this?
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 Lab Session</h1>
<section>
<h2> Video Section</h2>
<video controls width="640" src="">
<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>Audio Section</h2>
<audio src="https://cdn.freecodecamp.org/curriculum/js-music-player/sailing-away.mp3." type="audio/mpeg" controls loop >
</audio>
</section>
</body>
</html>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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