November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can play sound files in HTML5 just as you can movie files. Because the structure and implementation of <audio> and <video> are so close together, collectively they are referred to as the media elements. There are some attributes found in <video> that do not apply to <audio>, such as height, width, and poster, but everything else, including ensuring that you have the proper encoding of your sound files for each web browser, is basically the same idea:
<audio controls preload> <source src='music.mp3' type='audio/mpeg'> <source src='music.ogg' type='audio/ogg; codecs="vorbis"'> Insert fallback content here. </audio>
Additional Boolean attributes that you can specify include controls, for the browser ...
Read now
Unlock full access