Java Reference
In-Depth Information
figure 15-3  
Bupkis. But you can skirt around this issue by providing the same video in different formats. Firefox
has complete support for WebM, and you can accommodate other WebM‐supporting browsers by
adding another <source/> element, like this:
<video>
<source src="bbb.mp4" />
<source src="bbb.webm" />
<a href="bbb.mp4">Download this video.</a>
</video>
Browsers will read each source in the order in which it appears in the HTML. They download the
video's metadata to determine which video to load, and they load the first video that it supports.
Chrome supports both H.264 and WebM; so, if Chrome were to load a page with this code, it
would load the .mp4 file.
You can prevent the browser from downloading a video's metadata by providing the MIME type for
each <source/> element. You do this with the type attribute, as shown here:
<video>
<source src="bbb.mp4" type="video/mp4" />
<source src="bbb.webm" type="video/webm" />
<a href="bbb.mp4">Download this video.</a>
</video>
You can also provide the codec information in the type attribute to allow the browser to make more
intelligent decisions like this:
<video>
<source src="bbb.mp4"
type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"' />
 
<source src="bbb.webm" type'video/webm; codecs="vp8.0, vorbis"' />
Search WWH ::




Custom Search