Lesson 2: Playing audio CHAPTER 11 443
■■It’s best to provide multiple video sources to be compatible with most browsers.
■■Use the autoplay attribute to start playing immediately.
■■Use the poster attribute to specify an image to display when not playing the video.
■■You can provide captions in WebVTT or TTML format.
Lesson review
Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.
- You want to include a video on your webpage that has an .avi file extension. If you sup-
ply the codec information, what will be displayed in browsers that support the - You don’t want to supply an .ogg video because you find that the .ogg format is
choppy and low quality. What other video formats can you include to be compatible
with most browsers? (Choose all that apply.)
A. .webm
B. .avi
C. .mpg
D. .mp4
E. .mjpg - The W3C standardized using which format for video?
A. .webm
B. .avi
C. .mpg
D. .mp4
E. No standard has been selected.
Lesson 2: Playing audio
The W3C introduced the <audio> element for the purpose of playing music and sounds. Like
the introduction of the <video> element, the intent was to offer a standard way to play multi-
media on the web without requiring plug-ins.