HTML5 Audio Element

The audio element is used to play sound files or an audio stream.

Audio Element Attributes:


<audio controls="controls">
  <source src="one.ogg" type="audio/ogg" />
  <source src="two.mp3" type="audio/mpeg" />
Your browser does not support the audio element.


autoplay: It specifies that the audio will start pla ying as soon as it is ready to play and its value is "autoplay"
loop: It specifies that controls that the audio will start playing again when it reaches the end.
preload:The audio will be loaded at page load and ready to run.
url: specify the url of the audio.
control: It is used for adding play, pause, and volume controls.

Ebook Download
View all
View all