HTML and CSS Reference
In-Depth Information
A sample page using the <object> element to display a video can be found in the stu-
dent files at Chapter11/video.html and is shown in Figure 11.4. Depending on your
browser plug-ins, the video may not display on this page using the <object> tag. The
sample pages were tested using the QuickTime plug-in for .mov files. This plug-in issue
can be a problem for video components. Testing with your target audience in mind as
well as giving your visitors hints on the most appropriate plug-ins will help.
Figure 11.4
The title attribute
text is displayed by
the Opera browser
in the status bar and
also as a tooltip.
Embedding video on a Web page using an <object> tag is similar to embedding audio.
You'll use Castro's technique ( http://www.alistapart.com/articles/byebyeembed) of cod-
ing two <object> tags and using Internet Explorer conditional comments. The code to
play the sparky.mov video with QuickTime is shown below:
<object data="sparky.mov" height="150" width="160"
type="video/quicktime"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab"
title="Video of a cute Pekingese dog barking">
<param name="src" value="sparky.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<!--[if !IE]>-->
<object data="sparky.mov" height="150" width="160"
type="video/quicktime"
title="Video of a cute Pekingese dog barking" >
<param name="src" value="sparky.mov" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<p>A video of a cute Pekingese dog barking.</p>
</object>
<!--<![endif]-->
</object>
Focus on Accessibility
What happens if a browser or other user agent cannot display the video? Carefully
review the code and notice that there is a descriptive phrase coded before each closing
<object> tag. This phrase will display on the Web page if the object (in this case the
WWW
 
Search WWH ::




Custom Search