Skip to Main Content
HTML5 Developer’s Cookbook
book

HTML5 Developer’s Cookbook

by Chuck Hudson, Tom Leadbetter
December 2011
Intermediate to advanced content levelIntermediate to advanced
480 pages
10h 42m
English
Addison-Wesley Professional
Content preview from HTML5 Developer’s Cookbook

8. Embedding Audio with HTML5

Like the new video element, the new audio element allows you to embed an audio file into the page without the need for an additional plug-in like Flash. No longer having to rely on these third-party plug-ins, audio plays natively in modern web browsers, including browsers on many mobile devices.

In this chapter, you will learn the basics of the audio element and then look at ways to solve cross-browser issues. Then you will learn about the API available to see how you can create your own audio player.

Beginner Recipe: Including Audio with the audio Element

For a basic example of how to put audio on a page using the new audio element, take a look at the code in Listing 8.1. The controls attribute has been added; otherwise, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Cookbook

HTML5 Cookbook

Christopher Schmitt, Kyle Simpson
HTML5 in Action

HTML5 in Action

Greg Wanish, Rob Crowther, Joe Lennon, Charles Brindle

Publisher Resources

ISBN: 9780132697361Purchase book