(^464) ❘ CHAPTER 21 WORKING WITH HTML5 AUDIO AND VIDEO
that the user will play the media. The actual control is indicated by the value of the optional preload
attribute of the
Following are the possible values:
➤ (^) (no preload attribute specified)—Enables the browser to determine whether the media
data should be preloaded.
➤ (^) none—No media data should be preloaded. A poster image attribute or option for video
content would be recommended unless you prefer that the user sees a solid, black frame until
content playback activates.
➤ (^) metadata—Metadata for the content should be downloaded, but the media data should not
be preloaded. This value enables the element to display the content’s fi rst frame, duration,
and track information and is a recommended minimum value.
➤ (^) auto (also a blank value or attribute with no value) —The full media data should be
downloaded.
You might have noticed the word “should” in each value defi nition. The HTML specifi cation states
that browsers should consider these values as hints instead of requirements. For instance, mobile
device browsers often avoid preloading data regardless of the value.
Summary
In this chapter, you learned about the MediaElement plugin and how to use it to enable consistent
audio and video content in browsers. You learned about the HTML5 <video> and <audio> elements.You learned about the three video formats supported by the HTML5 <video> element in various
browsers. You learned more about one of these formats, h.264, and wrote code to display this
video format.You learned about additional MediaElement plugins to support Flash and Silverlight content and
saw how multiple <source> elements enable browser fallback to a supported format.Finally, you learned about common confi guration options for the MediaElement plugin and the
ability to request control of content download timing with the preload attribute.