HTML <audio> Element
<audio
src="audioUrl">
</audio>
Commonly Used Attributes
- autoplay
if specified, the audio will automatically begin playback as
soon as it can do so.
- controls
If this attribute is present, the browser will offer
controls to allow the user to control audio playback,
including volume, seeking, and pause/resume playback.
- loop
if specified, will automatically seek back to the start upon
reaching the end of the audio.
- muted
If specified,indicates whether the audio will be initially
silenced. Its default value is false.
- preload
This enumerated attribute is intended direct the browser
what, or what not to preload:
- none: indicates that the audio should not be preloaded;
- metadata: indicates that only audio metadata (e.g.
length) is fetched;
- auto: indicates that the whole audio file could be
downloaded, even if the user is not expected to use it;
- empty string: synonym of the auto value.
- src
The URL of the audio to embed.
- volume
The playback volume, in the range 0.0 (silent) to 1.0
(loudest).
HTML <source> Element - Provide
Alternate Files
You may wish to have more than
one src URL listed in case a user's browser doesn't support
the audio type of your file.
<audio>
<source src="url1" />
<source src="url2" />
</audio>