HTML and CSS Reference
In-Depth Information
What this means for you as a Web page author is that currently under HTML5, you
need two versions of your video files: one in MP4 format and the other in either WebM
or Ogg Theora. This situation is reminiscent of the battle between Betamax and VHS in
the 1980s for dominance of the home video market. Unfortunately, these differences in
format support make it more difficult for the Web to quickly move to the HTML5 stan-
dard for embedded video.
Using the HTML5
video
Element
Maxine has decided to go ahead with using HTML5 to embed the video clip from
Royal
Wedding
in her Web page. She has created versions of the clip in MP4 format and in
WebM format. To add a video to a Web page in HTML5, the code is similar to what you
used with the
audio
element
<video>
<source src=”
url1
” />
<source src=”
url2
” />
…
</video>
where
url1
,
url2
, etc. are the possible sources of the video clip. As with sources for the
audio
element, a browser uses the first source it finds in a format it supports.
Adding Video in HTML5
• To add a video clip with HTML5 use
<video>
<source src=”
url1
” />
<source src=”
url2
” />
…
</video>
where
url1
,
url2
, etc. are the possible sources of the video clip.
You'll add the
Royal Wedding
video to Maxine's page now.