HTML and CSS Reference
In-Depth Information
Figure 7-26
attributes of the object element
Attribute
Description
data=” url
Specifies the source of the file used in the object
form=” name
Specifies the name of the form that the object belongs to (HTML5)
height=” value
Sets the height of the object in pixels
name=” name
Provides a unique name for the object
type=” mime
Identifies the MIME type of the data within the object
usemap=” url
Associates the object with a client-side image map
width=” value
Sets the width of the object in pixels
For example, the following object element could be used in place of the embed ele-
ment you used earlier to insert the overture.mp3 audio clip:
<object data=”overture.mp3” type=”audio/mpeg”
height=”20” width=”250”>
</object>
Most objects also use parameters that define how users interact with the object; you
declare these parameters with the element
<param name=” name ” value=” value ” />
where the name attribute is the name of the parameter and the value attribute provides
the parameter's value. To embed a QuickTime Player using the object element, you
could define the source of the audio clip by adding the following param element:
<object data=”overture.mp3” type=”audio/mpeg”
height=”20” width=”250”>
<param name=”src” value=”overture.mp3” />
</object>
Note that the filename is provided twice—once as an attribute of the object element,
and a second time with the param element. This is because browsers differ on whether
they use the data attribute or the param element. Also note that there is no standard list
of HTML parameter names and values. They differ based on the object being embedded
and the browsers you need to support in your Web page. However, the name parameter
should be supported by most browsers.
Working with Flash
Maxine will use the object element to place a Flash video in her Web page. There are
two main file formats involved in creating a Flash video. The first is the Flv or Flash
video file that contains a video clip that will be displayed by adobe Flash Player . The
Flash Video file is often embedded within a Shockwave Flash file. A shockwave Flash or
swF file contains the video, audio, animations, interactive scripts, program controls, and
other features that provide real-time interactive animation for the viewer. One advantage
of a SWF file is that programmers can create their own players, containing video controls
tailored to the specific needs of their Web site. It's not uncommon to observe Web sites
containing players reflecting the Web site's content or design. For example, video played
with YouTube's player displays the YouTube logo in the lower-right corner of each frame.
Search WWH ::




Custom Search