< Day Day Up > 

Embedding QuickTime into Web Pages

To finish this chapter, let's quickly look at how you can embed streaming movies into a web page. Although you already know how to load them in QuickTime Player, chances are good that not all of your audience will know how. Providing access to content by simply visiting a web page is a far simpler approach to streaming to the masses.

For example, to embed a single movie named with a height and width of 320x240, you could use the following:

<OBJECT CLASS WIDTH="320" HEIGHT="256" CODEBASE=""> <PARAM name="SRC" VALUE=""> <PARAM name="AUTOPLAY" VALUE="true"> <PARAM name="CONTROLLER" VALUE="true"> <EMBED src="/books/4/382/1/html/2/" WIDTH="320" HEIGHT="256" AUTOPLAY="true" CONTROLLER="true"PLUGINSPAGE=""> </EMBED> </OBJECT>

As you look at this sample, you'll probably notice several unusual things about the code. First, the height is set to 256 instead of 240. This is to provide 16 pixels for the display of the movie controller (activated by setting the CONTROLLER="true" attribute). Second, you'll notice that the code appears to provide the same information twice (src="/books/4/382/1/html/2/" and name="SRC" VALUE="", for example). This repetition is necessary to create an embedded movie that is compatible with both Netscape/Mozilla browsers (the EMBED tag portion) and the current releases of Internet Explorer on Mac OS X and Windows platforms (the OBJECT tag section). Lovely, isn't it?

Within the code, the CLASSID, CODEBASE, and PLUGINSPAGE attributes should never change. The additional attributes, such as SRC, AUTOPLAY, and CONTROLLER are used, respectively, to set the movie source, whether it should play automatically, and whether the movie controller should display as well. For each movie attribute, you must include it within the OBJECT and the EMBED tag. For example, the attribute CONTROLLER (if used) must appear as a line like this within the OBJECT tags:

 <PARAM name="CONTROLLER" VALUE="[true|false]"> 

and as an attribute within the EMBED tag:

 <EMBED ... CONTROLLER="[true|false]"... > 

There are many attributes available for use when embedding a movie. The entire list is documented at, but the most useful are provided in Table 25.3.

Table 25.3. Attributes for Controlling the Appearance and Function of an Embedded QuickTime Player



href="<movie URL>"

Provides a link to a movie that will be played when the SRC-specified movie is clicked. When using the href attribute, the SRC movie is usually created as a single-frame still image.


When set to true, this attribute causes the player to automatically play the referenced SRC movie.

bgcolor="<html color>"

Sets a color to be used for the background of any space not taken up by an embedded movie.


Used to toggle the display of the QuickTime controller. If the controller is displayed, you must add 16 pixels to the height of the movie.

height="<height in pixels>"

The height tag is a required attribute that specifies the height in pixels of the embedded movie display area.

width="<width in pixels>"

A required attribute the sets the width, in pixels, of the embedded movie display area.


If set to true, this attribute causes a movie to loop continuously. When set to palindrome, the movie will play forward and backward, repeatedly.


This attribute, when TRue, forces the player to display every frame of the referenced video, regardless of the speed issues this might cause.


Sets the page to which browsers are directed if they do not have the QuickTime plug-in.


Scales the video output to the height and width tags (tofit), to the specified height and width while maintaining the aspect ratio (aspect), or, to a scaling value (2 for double size, and so on).


The URL for the source material to display. The source can be a movie file, SDP file, or a reference movie.


If set, the movie will be launched in QuickTime Player rather than the browser.


Sets the initial volume for the movie playback, with 0 being mute and 100 being the loudest.

     < Day Day Up > 

    Mac OS X Tiger Unleashed
    Mac OS X Tiger Unleashed
    ISBN: 0672327465
    EAN: 2147483647
    Year: 2005
    Pages: 251 © 2008-2017.
    If you may any questions please contact us: