Why <audio controls> instead of <audio> tag?

Tell us what’s happening:
I didn’t understand the reason of adding controls in the audio tag?What is it’s purpose?

Your code so far


<body>
 <header>
   <h1>Real Coding Ninjas</h1>
 </header>
 <main>

   <p>A sound clip of Zersiax's screen reader in action.</p>
<audio controls>
<source src="https://s3.amazonaws.com/freecodecamp/screen-reader.mp3" type= "audio/mpeg">
 
</audio> 


 </main>
</body>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36.

Challenge: Improve Accessibility of Audio Content with the audio Element

Link to the challenge:

Adding a control on a video or audio tag means you’re giving the controls for that audio or video. So you can Pause, Resume, or Skip. There is a way to remove that so the user can’t control it. But the control just makes sure that there is control there for the user. You know like Youtube controls. So if you want the audio to play without the user being able to pause it just do

<audio autoplay>
</audio>
2 Likes

In addition, if the controls attribute is included in an audio tag, the controls will be displayed along side the audio element. If the controls attribute is removed, the controls will be hidden. Control is the interface for Pause, Resume e.t.c as described above.

2 Likes