Chapter 5Basics: Multimedia, Audio and Video

Perhaps the biggest change in HTML5 is its multimedia capabilities. HTML5 brings with it native audio and video, and almost replaces the plugins of the old web. I say "almost" because browser vendors have yet to agree on a default format for web audio and video.

We’ll talk about cross-browser support later in this chapter. First let’s look at the bare minimum necessary to add video to your web page: a video tag and a src attribute.

<video src="path_to_file.video"></video>

In HTML5, that closing tag is required. If you’re using XHTML syntax, you can self-close it instead like so: <video src="path_to_file.video" />. The audio element is almost the same. All that’s required is the opening audio tag, a ...

Get Jump Start HTML5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.