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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.