Chapter 4. Audio and video

 

This chapter covers

  • Why audio and video are important on the web
  • Adding audio and video to your web pages
  • Encoding audio and video files for the web
  • Integrating video with other web platform features and content

Native media support is one of the best known as well as one of the most controversial HTML5 features. In this chapter, you’ll learn why HTML5 media support is great, why it’s frustrating, and the practical factors you need to consider when using it.

Audio and video on the modern web

Audio and video are key parts of the modern web. For many sites, video and audio are parts of the content as integral as the text and pictures—and in some cases, they’re more important.

Despite their rising importance, HTML4 offers no built-in method for adding audio or video to a web page. This makes embedding audio and video relatively complex. Compare the markup required to add an image to a web page with that typically required to add a video.

The <audio> element

The <video> element

Controlling audio and video with JavaScript

Integrating media with other content

Browser support

Summary

sitemap