Video is not available... Embedded is previous playlist.
Add muted
after autoplay
to let your audio file start playing automatically (but muted):
<!DOCTYPE html>
<html>
<body>
<h2>Audio Element - Autoplay and muted</h2>
<audio controls autoplay muted>
<source src="/html/audio/audio_song.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>
The HTML DOM defines methods, properties, and events for the <audio>
element.
This allows you to load, play, and pause audios, as well as set duration and volume.
There are also DOM events that can notify you when an audio begins to play, is paused, etc.
File Format | Media Type |
---|---|
MP3 | audio/mpeg |
OGG | audio/ogg |
WAV | audio/wav |
Tag | Description |
---|---|
<audio> | Defines sound content |
<source> | Defines multiple media resources for media elements, such as <video> and <audio> |