Book Image

Learning Dart, Second Edition - Second Edition

By : Ivo Balbaert
Book Image

Learning Dart, Second Edition - Second Edition

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Learning Dart Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 will render 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 the 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, as shown in the following screenshot:

The poster image with the <video> tag

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 ...