Writing HTML


iWeb makes it extremely easy to publish movies to the Web, but you may already have a site set up, you aren't a .Mac member, or you just like to dig into the code out of pure textual geeky joy.

This, of course, isn't a book about HTML, so I'm going to assume that you know the basics about coding Web pages, and that you have an application (such as Bare Bones Software's BBEdit, or even TextEdit) that you use to build pages. If that's not the case, check out Elizabeth Castro's book HTML for the World Wide Web with XHTML and CSS: Visual QuickStart Guide, which remains the best HTML guide I've read.

That said, there are two ways of going about it: you can copy the file to your Web directory (provided by your Internet service provider) then link directly to it; or you can embed the movie on a Web page so that it's part of the page's layout.

To link to a QuickTime movie file:

1.

In your HTML editing application, enter the following code where you want your movie link to appear. The user will see only the linked text; clicking it will download the movie.

<a href="http://www.youraddress.com/sample.mov">Click here</a>


2.

Insert the real names of your Web address and movie filename in place of youraddress.com and sample.mov (Figure 17.14). For example, a movie on my Web site would look like this (go ahead and put the URL below into your Web browser to view the movie).

<a href="http://www.necoffee.com/imovievqs/secretmovie.mov">Is it really a secret?</a>


Figure 17.14. Add a simple Web link that points to your QuickTime movie file. The HTML text in the top window creates the Web page in the bottom window.


Embed a Headache

If you know how to embed an object already, you may be wondering why the example on the next page contains so much other information. In late 2001, Microsoft stopped supporting the plug-in architecture used by Web browsers since long before Microsoft even got into the browser business (when a QuickTime movie appears on a page, a QuickTime plug-innot the browser by itselfis doing the work of playing it back correctly). Instead, Microsoft switched to its own ActiveX architecturebut only under Internet Explorer 5.5 and later for Windows. So although movies added using the regular method of embedding objects still work on your Mac, anyone with a recent version of Windows likely won't be able to see it. Find more information at developer.apple.com/quicktime/compatibility.html.


To embed the movie on a page:

  • In your HTML editing application, enter the following code where you want the movie to appear. Be sure to change the two instances of sample.mov to your actual filename, plus the two instances where the width and height are defined.

    <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="160" HEIGHT="144" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"> <PARAM name="SRC" VALUE="sample.mov"> <PARAM name="AUTOPLAY" VALUE="true"> <PARAM name="CONTROLLER" VALUE="false"> <EMBED SRC="sample.mov" WIDTH="160" HEIGHT="144" AUTOPLAY="true" CONTROLLER="false" PLUGINSPAGE= "http://www.apple.com/quicktime/download/"> </EMBED> </OBJECT>

    Note that the unintelligible gobbledygook following CLASSID= must be entered exactly as shown; it's required for viewing the page properly in Microsoft Internet Explorer 5.5 and later under Windows (see the sidebar on the opposite page).

Deciphering HTML Attributes

So what is all that junk I threw in there? Here's a breakdown of the tag attributes:

OBJECT CLASSID: To work properly under Windows, a QuickTime movie must be defined as an object. The CLASSID value identifies the content as a QuickTime movie.

WIDTH and HEIGHT: These values tell the browser the width and height of your movie in pixels.

CODEBASE: This URL gives Internet Explorer for Windows some necessary information about the QuickTime format.

PARAM: This is a parameter of the object, which consists of a name and a value. SRC is the URL that points to your movie file; AUTOPLAY tells the browser whether to automatically play the movie when it loads (in this case "true" means yes); CONTROLLER tells the browser whether to display the QuickTime controller beneath the movie (in this case "false" means no).

EMBED: This is the tag that actually puts your QuickTime movie on the page. It includes the same attributes as PARAM, though in a slightly more compact fashion. A Web page that contains only this tag will display the movie correctly in all Web browsers except Internet Explorer 5.5 and later for Windows.

PLUGINSPAGE: This tells the browser where to go in the event that the QuickTime plug-in is not installed.

</EMBED> and </OBJECT>: These are closing tags, indicating the end of the commands.





iMovie HD 6 & iDVD 6 for Mac OS X (Visual QuickStart Guide Series)
iMovie HD 6 and iDVD 6 for Mac OS X
ISBN: 0321423275
EAN: 2147483647
Year: 2004
Pages: 197
Authors: Jeff Carlson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net