Adding video to a web page
Adding video to a web page is as easy to do as adding audio: just add a <video>
tag to the HTML with an embedded <source>
tag specifying src
and type
, and Dartium renders this nicely (see video01.html
):
<video poster="wildlife.jpg" controls> <source src="wildlife.ogv" type='video/ogg; codecs="theora, vorbis"' /> <source src="wildlife.webm" type='video/webm; codecs="vp8, vorbis"' /> The video tag is not supported in your browser. Download the video <a href="wildlife.webm">here</a>. </video>
Note
For code file of this section, refer to chapter 7\video\
in the code bundle.
The poster
attribute from <video>
serves to provide the initial image, see the following screenshot:
The three important formats you should care about are WEBM, MP4, and OGV. For MP4, use the following type:
type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'
Both <audio>
and <video...