HTML and CSS Reference
file is loaded.
Firefox plays the .ogg file.
Internet Explorer plays the .mp3 file.
it to the <audio> element as an attribute, and add a <div id="source"></
div> after the <audio> element to display the output:
.innerHTML = 'Playing file ' +
This code is executed in the loadeddata event, which means after the
browser has loaded identifying information about the file. You'll learn
the section “The <video> element.”
Audio is fine, but it lacks visual impact. Let's move on to
embedding video. In the next section, you'll see that adding
video to a page in HTML5 is just as simple as adding audio.
The <video> element
For the many people who don't obsessively read standards groups'
mailing lists, the first time they became aware of HTML5 was when
they found out that Flash video doesn't work on the iPhone but
HTML5 video does. As you saw in the introduction, the goal of the
HTML5 <video> element is to make embedding video in your pages as
easy as embedding images. This section looks at the details of making it
work. We'll follow a pattern similar to the previous section: first the