Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

How It Works 


To play an audio file in HTML5, this is all you need:
<audio src="song.ogg" controls="controls">
</audio>
The control attribute is for adding play, pause, and volume controls.

Insert content between the <audio> and </audio> tags for browsers that do not support the audio element:
<audio src="song.ogg" controls="controls"> Your browser does not support the audio element. </audio>
The example above uses an Ogg file, and will work in Firefox, Opera and Chrome.

To make the audio work in Safari, the audio file must be of type MP3 or Wav.

The audio element allows multiple source elements. Source elements can link to different audio files. The browser will use the first recognized format:
<audio controls="controls">
  <source src="song.ogg" type="audio/ogg" />
  <source src="song.mp3" type="audio/mpeg" />
Your browser does not support the audio element.
</audio>
More Tutorial
  1. HTML5 - Audio on the Web
  2. HTML5 - Audio Formats
  3. HTML5 - How It Works
  4. HTML5 - <audio> Attributes

Tutorial


References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References