Chapter 3. Audio and video controls

 

This chapter covers

  • Using audio and video controls with no code
  • Integrating JavaScript controls with audio and video
  • Simple binding techniques for controlling audio and video
  • Understanding audio and video formats

It wasn’t so long ago that the only way to play video content was to embed a Quick-Time, Flash, Silverlight, or other custom-installed program inside your HTML page with <object> tags. These elements had very little interactivity with the surrounding page and were, for all intents, islands of media on the page. Audio content was only a little better and, in some cases, worse. When was the last time you visited a page that played a song in the background? From the user’s perspective, it’s the height of annoyance that you can’t do anything with that page other than turn down your computer’s volume or navigate away. This chapter will show you how to fix all those problems with HTML5.

HTML5 brings two new tags to the table: <audio> and <video>. Both of these tags implement the same API interface, so while the internal implementations are different, the external interfaces are identical. Furthermore, neither tag requires any additional supporting downloads to work in supported browsers. You just add the tag, supply the source content, and your users can see and hear your media. It really is that simple!

3.1. Building a site to play audio and video

 
 
 

3.2. Audio and video tags

 
 
 

3.3. Controlling audio and video playback with JavaScript

 
 
 

3.4. Updating media types for open source content

 
 
 

3.5. Summary

 
 
 
 

3.6. Complete code listings

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest