Home Tutorial Html Html5 HTML5 audio autoplay, Use of autoplay attribute in audio tag.

 
 

Share on Google+Share on Google+
HTML5 audio autoplay, Use of autoplay attribute in audio tag.
Posted on: September 3, 2010 at 12:00 AM
Advertisement
you will see the use of autoplay attribute of audio tag.

HTML5 audio autoplay, Use of autoplay attribute in audio tag.

Introduction:

The autoplay is an audio tag attribute. It is only supported by HTML5. When it is present in audio tag, the music file will begin itself.
or
After loading web page, music will start automatically .

autoplay attribute:
Attribute Value Description
autoplay Boolean If it is presented in audio tag. Music will start itself.

Declaration Syntax :

Declaration syntax of autoplay attribute  in HTML5.

                       <audio src="URL" autoplay controls>Content</audio>

Example of <audio> in HTML5:

Code:
AudioAutoplay.html
<!DOCTYPE html >
<html >
<head>
<title>Audio Tag </title>
</head>
<body>
<p><b>Example of audio tag in HTML5.</b></p>
<audio autoplay controls>
<source src="a1.mp3" type="audio/mp3" />
Browser does not support audio tag.
</audio>
</body>
</html>
Output:

Download this code

Difference Between HTML5 and HTML4.01:

The audio tag  is only available in HTML5. It is not available in HTML4.01.

Advertisement

Related Tags for HTML5 audio autoplay, Use of autoplay attribute in audio tag.:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: September 3, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com