Horje
How to Add muted after autoplay

Add muted after autoplay to let your audio file start playing automatically (but muted):


Example of Audio Player Mute After Auto Playing

Follow the Example
index.html
Example: HTML
 <audio controls autoplay muted>
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio> 

Full Example of Audio Player Mute After Auto Playing

Follow the Example
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<audio controls autoplay muted>
  <source src="https://www.w3schools.com/html/horse.ogg" type="audio/ogg">
  <source src="https://www.w3schools.com/html/horse.ogg" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

</body>
</html>

Output should be:

Full Example of Audio Player Mute After Auto Playing

Browser Support

The numbers in the table specify the first browser version that fully supports the <audio> element.

Element chrome edge firefox opera safari
<audio> 4.0 9.0 3.5 4.0 10.5





Related Articles
What is HTML Audio HTML Audio
How It Works HTML Audio HTML Audio
How to set HTML <audio> Autoplay HTML Audio
How to Add muted after autoplay HTML Audio
What are the HTML Audio Formats HTML Audio
What are the HTML Audio - Media Types HTML Audio
What are the HTML Audio - Methods, Properties, and Events HTML Audio

Single Articles
Example of Audio Player Mute After Auto PlayingHTML Audio
Full Example of Audio Player Mute After Auto PlayingHTML Audio
Browser SupportHTML Audio

Read Full:
HTML Audio
Category:
Web Tutorial
Sub Category:
HTML Audio
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
61


Reffered: https://www.w3schools.com/html/html5_audio.asp

Share on: