HTML and CSS Reference
In-Depth Information
< source src = ”someVid.mp4” >
< source src = ”someVid.ogv” >
< source src = ”someVid.webm” >
</ video >
Figure 11-1: Viewing a simple video on the Safari browser.
Although many dif erent formats are around for digital video, the ones that will be used for
illustration and discussed in this chapter are the following:
217
H.264: .mp4 and .mov
OGG: .ogv
WebM: .webm
3GP: .3gp
At the time of this writing (and quite possibly for the future) dif erent formats are going to
run on dif erent browsers. However, using the <source> tag, you can easily reference several
dif erent browsers. For example, the following code ( SimpleVideoSource.html in this
chapter's folder at www.wiley.com/go/smashinghtml5 ) plays the same video on any of
the browsers tested, including two mobile browsers.
<! DOCTYPE HTML >
< html >
< head >
< meta http - equiv = ”Content-Type” content = ”text/html; charset=UTF-8” >
< title > Selective Video </ title >
</ head >
< body >
< video controls preload = ”auto” >
< source src = ”multiformats/mbAux1.3gp” >
< source src = ”multiformats/mbAux1small.mp4” >
 
Search WWH ::




Custom Search