Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

437


Chapter 11 HTML5 supports multimedia


CHAPTER 11 HTML5 supports multimedia


O


ne of the most popular features of HTML5 is its support for multimedia. In the past, you
needed to load a plug-in to play video or audio. Probably the most popular multimedia
plug-in is Flash. This chapter examines the HTML5 support for playing audio and video.

Lessons in this chapter:
■■Lesson 1: Playing video 437
■■Lesson 2: Playing audio 443
■■Lesson 3: Using the HTMLMediaElement object 447

Before you begin


To complete this book, you must have some understanding of web development. This
chapter requires the hardware and software listed in the “System requirements” section in
the book’s Introduction.

Lesson 1: Playing video


The World Wide Web Consortium (W3C) introduced the video element for the purpose of
playing videos and movies. The intent was to offer a standard way to play video on the web
without requiring plug-ins. This goal has been circumvented by lack of agreement about
which video formats should be supported in web browsers.
Currently, the W3C does not specify which video formats browsers should support.
Browsers can decide which format they want to support, so the developer must provide
formats that are available across most browsers.

After this lesson, you will be able to:
■■Describe the common video formats available on the Internet.
■■Implement the <video> element.

Estimated lesson time: 20 minutes
Free download pdf