|< 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 mymovie.mov with a height and width of 320x240, you could use the following:
<OBJECT CLASS WIDTH="320" HEIGHT="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"> <PARAM name="SRC" VALUE="mymovie.mov"> <PARAM name="AUTOPLAY" VALUE="true"> <PARAM name="CONTROLLER" VALUE="true"> <EMBED src="/books/4/382/1/html/2/mymovie.mov" WIDTH="320" HEIGHT="256" AUTOPLAY="true" CONTROLLER="true"PLUGINSPAGE="http://www.apple.com/quicktime/download/"> </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/mymovie.mov" and name="SRC" VALUE="mymovie.mov", 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 http://www.apple.com/quicktime/authoring/embed2.html, but the most useful are provided in Table 25.3.
|< Day Day Up >|