Saturday, June 9, 2012

HTML5 | Audio tag


HTML5 <audio> tag:

<audio> element is used to play audio file in web page. Audio element contains multiple source elements with different audio format files. Browser will use the first which is recognized by browser.

Below are properties of Audio tag:


Attribute
Value
Description
autoplay
Specifies that the audio will start playing as soon as it is ready
controls
Specifies that audio controls should be displayed (such as a play/pause button etc).
loop
Specifies that the audio will start again, every time it is finished
auto
metadata
none
Specifies if and how the user thinks the audio should be loaded when the page loads
URL
Specifies the URL of the audio file


Example:
<!DOCTYPE HTML>
<HTML lang="en">
<head>

</head>
<body>

<audio controls="controls">
<source src="11 Fill Up Your Life.mp3" type="audio/mpeg"/>
<source src="song.ogg" type="audio/ogg" />
Your browser does not support the audio element.
</audio>
</br>
</body>
</html>


No comments:

Post a Comment