Le opzioni in html per Quicktime
Javascript per Quicktime

Sample Chapter


    Special Delivery: QuickTime+HTML

    By this time you should have the basics under your belt: you know what a QuickTime movie is, you can convert existing multimedia into QuickTime movies, and you can embed a movie in a Web page.

    Now it starts to get interesting. Let's look at some advanced techniques for embedding QuickTime in a Web page, taking advantage of the QuickTime Plug-in and the HTML-friendly features of QuickTime movies.

    This chapter covers


    Special Features of the QuickTime Plug-in

    The QuickTime Plug-in has a lot of special features that you can control from HTML. You can tell the QuickTime Plug-in to start playing a movie automatically or to wait until the user clicks the Play button. Or you can tell the QuickTime Plug-in not to let users save the movie to disk, giving you some basic copy-protection. Or you can hide the movie controller, set the default audio volume, have the plug-in play a series of movies one after another... but wait! There's more!

    The QuickTime Plug-in has over 25 special features that can be controlled from HTML, and these features can be combined in hundreds of ways. You control the special features by inserting parameters in the <EMBED> tag. (The basic technique of putting a QuickTime movie in a Web page using the <EMBED> tag, and the <EMBED> parameters that control the browser, are described in Chapter 4, "Basic Training: Putting QuickTime in a Web Page.")

    This section describes some particularly cool features of the plug-in in detail, then lists all the parameters that the QuickTime Plug-in understands.

    Some Particularly Cool Features

    Autoplay

    As John Brunner once wrote, "It's supposed to be automatic, but actually you have to push this button." You can simplify the user interface by having the QuickTime movie start playing automatically. The user doesn't have to do anything. People are singularly amazed when they click into a website and it just starts talking.

    AUTOPLAY="True" | "False" (the default is "False" )

    Example: <EMBED SRC="My.mov" HEIGHT="256" WIDTH="320"
    AUTOPLAY="True">

    People can set their own default value for autoplay using their QuickTime settings, so set this to False if you want to be 100% certain that the movie won't start until the user clicks a button.

    Note: If your Web page opens the movie in QuickTime Player, as described in Click Here, Play There , you can make the movie autoplay by clicking the Auto Play Enabled checkbox in the movie's Info window, as described in Settings You Can Save .

    Hide the Controller

    Hiding the controller is normally a bad idea, because the user can't stop or rewind the movie--if you haven't set AUTOPLAY="True" , they can't even start the movie. But for a background sound, a hidden controller can be just the ticket. For background sound, you normally combine QuickTime's CONTROLLER and AUTOPLAY parameters with the browser's HIDDEN parameter.

    CONTROLLER="True" | "False" (default is "True" except for .swf files)

    Example: <EMBED SRC="Sound.mov" HEIGHT="2" WIDTH="2"
    AUTOPLAY="True" HIDDEN="True" CONTROLLER="False">

    You also want to disable the controller when showing a poster movie or when the movie is controlled by wired sprites or a Flash track. (We'll get into poster movies, wired sprites, and Flash tracks later.)

    Audio Volume

    By default, the QuickTime Plug-in plays audio at full volume, which is 100% of the loudness the user has selected in the computer's Sound control panel. You can use the VOLUME parameter to create quiet background music or barely perceptible whispering. Note that MIDI is generally louder than recorded sound, so setting the volume to 75% is a good way to play MIDI sounds at the expected level.

    VOLUME=" Percent " (0-300)

    Example: <EMBED SRC="MyMIDI.mov" HEIGHT="16" WIDTH="180"
    AUTOPLAY="True" VOLUME="75">

    Values of greater than 100 can be used to overdrive the audio. This should be done cautiously because it can create distortion and clipping, not to mention annoyance.

    Tip: If you choose to include looping background music on your site, set a low volume. That way, fewer people will want to strangle you.

    Play Something Else, Man

    You can tell the QuickTime Plug-in to play a different file than the one specified by the SRC parameter of the <EMBED> tag. This is crucial, because the browser uses the SRC parameter to decide which plug-in to use. If the SRC parameter specifies a QuickTime image ( .qti ), the browser will choose the QuickTime Plug-in. You can then use the QTSRC parameter to tell the plug-in to play a QuickTime movie, Flash .swf , MIDI, MP3, or other file type. This is discussed in more detail in Chapter 3, "Bust a .Mov."

    QTSRC=" Filename "

    Example: <EMBED SRC="UNeedQT4.qti" TYPE="image/x-quicktime" HEIGHT="16" WIDTH="180" QTSRC="Hot.mp3">

    Set QTSRC to the name of the file you really want the plug-in to play. You can include a relative path or the full URL.

    Another important feature of the QTSRC parameter is that the QuickTime Plug-in gets the specified file using its own HTTP, RTSP, or file handling processes. This means that it works properly with RTSP URLs used for streaming movies and with local files that the browser itself might mishandle. It also means you can set a maximum download speed with the QTSRCCHOKESPEED parameter, described next.

    The browser still downloads the file indicated by the SRC parameter, even though the plug-in ignores it. This is basically wasted bandwidth, so specify a small throw-away image in the SRC parameter. A good choice is UNeedQT4.qti , which you can find in the BasicTraining folder of the CD. By the way, the SRC parameter has to point to a real file, or the browser gets confused.

    Slow Down!

    Okay, normally you want the movie to download faster, not slower. But a large movie can bring your server to its knees when someone downloads it using a T1 connection, even though twenty people could watch the same movie simultaneously using 56K modems. That's because the viewer with the T1 connection is using 1.5 megabits per second of bandwidth, the same as twenty-four 56K modems.

    So if a movie has a data rate of less than 56,000 bits per second, for example, you want to limit the download speed to 56K--people can still watch the movie as it downloads, but someone with a fast Internet connection won't hog all your server's bandwidth.

    You limit the bandwidth for a movie by setting its choke speed. The parameter is QTSRCCHOKESPEED . It applies only to movies specified by the QTSRC parameter, as described in Play Something Else, Man .

    QTSRCCHOKESPEED=" MaxSpeed " (in bits per second)

    Example: <EMBED SRC="UNeedQT4.qti" TYPE="image/x-quicktime" HEIGHT="16" WIDTH="180" QTSRC="Hot.mp3"
    QTSRCCHOKESPEED="130000">

    Use a choke speed setting a little higher than the data rate of the movie to allow for network overhead. For a 128 Kbit/sec MP3, for example, set the choke speed to 130000 so people with fast connections can hear it in real time, but people with really fast connections won't use up all your Web server's bandwidth.

    You can also set QTSRCCHOKESPEED="movierate" and QuickTime will do its best to use only as much bandwidth as needed to play the movie smoothly.

    You also want to set the choke speed when delivering movies that mix streaming and nonstreaming tracks, so you can reserve some bandwidth for the streaming parts. For details, see Chapter 17, "Mixing It Up: Streaming and Nonstreaming."

    Tip: As of this writing (QuickTime 4.1.2), QTSRCCHOKESPEED only limits the download speed of the actual movie file specified by QTSRC . Any data contained in external files, including alternate movies, is unaffected. For now, use QTSRCCHOKESPEED with self-contained movies.

    Click Here, Play There

    You can associate a URL with a QuickTime movie, so the URL loads when someone clicks inside the movie's display area. This lets you do a lot of interesting things. The URL can specify a Web page, a JavaScript function, or a second movie. If the URL specifies a Web page, that page can include an embedded movie of its own.

    You can specify a target for the URL, so it loads in another frame or another window. You can also target the URL to replace the current movie in the QuickTime Plug-in, or to load in the QuickTime Player application, launching it if necessary.

    This last is particularly useful. You see, you can't directly tell the browser to launch an application using HTML; that's an Internet no-no. So if you want a movie to launch in QuickTime Player, this is how you do it. You embed a movie for the plug-in, typically a single image with no controller, and tell the plug-in to launch a different movie in QuickTime Player when someone clicks the image. An example of this is Poster2.htm (in the Special Delivery folder on the CD), shown on the next page.

    HREF=" url " TARGET=" FrameName " TARGETCACHE="True" | "False"

    Example: <EMBED SRC="Poster.mov" HEIGHT="256" WIDTH="320"
    CONTROLLER="False" HREF="Actual.mov"
    TARGET="quicktimeplayer">

     

    The TARGET parameter is optional. It works just like the TARGET parameter in an <A HREF> tag; it can specify a frame or a window, and it can be used to create a new window with a given name. It also supports three special values:

    • myself --causes the URL to replace the current movie in the plug-in
    • quicktimeplayer --loads the URL in the player application
    • browser --loads the URL in the default browser window, even if the movie is playing in QuickTime Player

    IMPORTANT
    The special values are case-sensitive in some versions of QuickTime, so use all lowercase.

    If you set TARGET="myself" , the image is transformed into a movie when the user clicks it.

    You can also use the HREF parameter to trigger a JavaScript function and pass data to it when someone clicks the movie:
    <EMBED SRC="ClickMe.mov" HEIGHT="256" WIDTH="320"
    HREF="javascript:openMovie('HugeMovie1.htm')">

    If you want the URL specified in the HREF parameter to load automatically, instead of waiting for a mouse click, include the AUTOHREF="True" parameter. (The AUTOHREF parameter requires QuickTime 4.1 or later.)
    <EMBED SRC="UNeedQT4.qti" TYPE="image/x-quicktime"
    HEIGHT="2" WIDTH="2" HIDDEN="True"
    HREF="Actual.mov" TARGET="quicktimeplayer" AUTOHREF="True" >

    Start and End Times

    You can tell the plug-in to play just part of a movie by setting the start time, the end time, or both. You might do this to create a series of buttons, each of which plays a different clip from the same movie. This technique is particularly useful with streaming movies.

    STARTTIME=" StartTime " ENDTIME=" EndTime "

    Example: <EMBED SRC="Long.mov" HEIGHT="176" WIDTH="120"
    STARTTIME="00:01:10.0" ENDTIME="00:02:10.0"
    AUTOPLAY="True">

    Times are in Hours:Minutes:Seconds.Fractions relative to the start of the movie ( 00:00:00.0 ). The Fractions are expressed in 1/30ths of a second. For 30 frames-per-second video, each fractional time unit is one frame. The example above plays one minute of Long.mov , starting one minute and ten seconds into the movie. You can specify just a start time or just an end time.

    You normally want to set AUTOPLAY="True" when you specify a start or end time, so the clip just plays; otherwise the user might try to position the controller to play a different clip.

    Note: Setting start and end times for a clip is useful for real-time streaming movies or local movies on a disk--it's less useful for Fast Start movies over the Internet because the whole movie downloads, not just the specified clip.

    Play a Series of Movies

    You can tell the QuickTime Plug-in to play a series of movies, one after the other. When the current movie finishes, the next movie in the list starts. This can be a good way to deliver a long movie; users never need to store more than a small piece of it on their computers at any time.
    QTNEXT n ="< Filename > T< Target >" or "GOTO n "

    Example: <EMBED SRC="First.mov" HEIGHT="176" WIDTH="120" QTNEXT1="<Second.mov> T<myself>"
    QTNEXT2="<Third.mov> T<myself>">

    You have to append a number between 1 and 255 to each QTNEXT . They execute in numerical order.

    Note that you must place angle brackets around the < Filename > and T< Target > values, and quotes must surround both values jointly:
    "< Filename > T< Target >" .

    Set < Filename > to the name of the file you want to play next. You can include a relative path or the full URL.

    The T< Target > parameter is optional. It specifies where the movie plays. If it's not specified, the next movie replaces the current browser window or frame, and any subsequent QTNEXT statements are lost. The special value of T<myself> targets the QuickTime Plug-in, and is normally the value you want; the next movie replaces the current movie, and subsequent QTNEXT statements are executed in turn. The target can also be the name of a browser window or frame. If no window or frame of that name exists, a new browser window with that name is created. You can also specify T<quicktimeplayer> as a target, which opens the movie in QuickTime Player.

    IMPORTANT
    The special targets T<myself> and T<quicktimeplayer> are
    case-sensitive in some versions of QuickTime. Use all lowercase.

    Each QTNEXT statement has an index number, which is the order in which the movies play. If you specify a QTNEXT1 , then a QTNEXT5 , and then a QTNEXT10 , for example, the three of them execute in numerical order, and their index numbers are 1, 5, and 10. Want to keep your sanity? Number the QTNEXT statements in simple numerical order: 1, 2, 3...

    The special index value of 0 is assigned to the original movie named in the SRC parameter (or the QTSRC parameter, if it was specified).

    Why have index numbers? Because instead of a filename, you can specify <GOTO n > , where n is the index of the QTNEXT you want to go to. You normally do this to create a simple loop:
    <EMBED SRC="First.mov" HEIGHT="176" WIDTH="120"
    QTNEXT1="<Second.mov> T<myself>"
    QTNEXT2="<Third.mov> T<myself>"
    QTNEXT3="<GOTO0>">

    This example plays First.mov , then Second.mov , then Third.mov , then goes back to First.mov (index 0), in an endless loop. You can use values other than 0 to cause QTNEXT statements to play in arbitrary order, or to start looping from some midpoint. For example,
    <EMBED SRC="Intro.mov" HEIGHT="176" WIDTH="120"
    QTNEXT1="<First.mov> T<myself>"
    QTNEXT2="<Second.mov> T<myself>"
    QTNEXT3="<GOTO1>">
    would play the Intro.mov just once, then play First.mov and Second.mov in an endless loop.

    Note: A bug in QuickTime 4.1 caused GOTO0 to play the most recent movie instead of the first movie in the sequence, although any subsequent movies in the sequence played correctly. The workaround is to specify the original movie at the beginning and end of the loop, and use GOTO1 instead:
    <EMBED SRC="First.mov" HEIGHT="176" WIDTH="120"
    QTNEXT1="<Second.mov> T<myself>"
    QTNEXT2="<Third.mov> T<myself>"
    QTNEXT3="<First.mov> T<myself>"
    QTNEXT3="<GOTO1>"
    This sequence plays correctly whether the bug is present or not.

    Save It Right

    The QuickTime Plug-in has a couple of options that control how viewers can save movies, or not save them: KIOSKMODE and DONTFLATTENWHENSAVING .

    You can provide basic copy protection for your movie by setting KIOSKMODE to True . The plug-in disables its Save as Source and Save as QuickTime Movie commands, and doesn't allow drag-and-drop saving to the desktop.

    Of course, this isn't foolproof protection, but it will stop honest people and discourage opportunists. You can get stronger protection using Plug-in Helper, as described in Copy-Protecting Movies with Plug-In Helper .

    KIOSKMODE="True" | "False"

    Example: <EMBED SRC="DontCopyMy.mov" HEIGHT="176" WIDTH="120" KIOSKMODE="True">

    That's it for KIOSKMODE .

    The DONTFLATTENWHENSAVING parameter is a little more complicated because you have to understand movie flattening. It's like this: movies can contain references that point to their media data; that data can be in an external file, or it can be data stored in the movie file itself. Movies can contain multiple references to a single chunk of data. When a movie is flattened, all the references are replaced with actual copies of the data. If the data is copied from external files into the movie file, this makes the movie self-contained. If the references are to data already inside the movie file, flattening replaces internal references with internal copies. In either case, it makes the movie file larger.

    Unless you've copy-protected a movie, your viewers can save a copy of your movie using the QuickTime Plug-in. You can control whether or not the QuickTime Plug-in saves a flattened copy of the movie. By default, the Save As Source command saves without flattening, and the Save As QuickTime Movie command saves and flattens. The DONTFLATTENWHENSAVING parameter prevents flattening.

    DONTFLATTENWHENSAVING

    Example: <EMBED SRC="DontCopyMy.mov" HEIGHT="176" WIDTH="120"
    DONTFLATTENWHENSAVING>

    If the movie on your Web server isn't self-contained, you can prevent people from making a working copy of the movie by setting the DONTFLATTENWHENSAVING parameter. If the movie is saved with this parameter set, data in external files isn't copied. The saved movie won't play unless those files are present on the user's computer (which they won't be).

    If you've created a movie with a lot of internal references, you should set the DONTFLATTENWHENSAVING parameter for a different reason. If it isn't set, all the references will turn into copies when the movie is saved, resulting in a huge file. For example, let's say you've made a movie using a 60 Kbyte audio sample that's referenced two hundred times. With internal references, the file is a little over 60 Kbytes in size; flattened, it swells to 12 megabytes. So tell the plug-in DONTFLATTENWHENSAVING .

    Background Color

    You allot space on your Web page for the QuickTime Plug-in using the HEIGHT and WIDTH parameters. If you allot exactly enough space for the movie, the background doesn't show through, so its color doesn't matter.

    But if you're showing a movie that plays at different sizes for different speed connections, or you're playing a series of movies that are different sizes, you need to allot enough space for the biggest movie. When a smaller movie is playing, the plug-in's background shows. So set a background color that looks good on your Web page.

    You should also set the background color if the movie has a transparent background or if it changes size as it plays.

    BGCOLOR= "# rrggbb " (or one of the named colors listed in the next section)

    Example: <EMBED SRC="MultiSize.mov" HEIGHT="336" WIDTH="240"
    BGCOLOR="#0000FF">

    The color is specified using a hexadecimal value made up of three 1-byte values: 1 byte each for red, green, and blue, with each value having a range of 00 to FF . This is identical to the way you specify the BGCOLOR parameter in the HTML <BODY> tag. Alternately, you can specify some colors by name, such as Black or Red . The named colors are listed in Summary of QuickTime Plug-in Parameters .

    Combined Operations

    You can combine plug-in features in an almost unlimited number of ways. For example, let's say you want a movie to play in QuickTime Player without requiring the viewer to click a poster movie, and you'd like to precede the movie with a little fanfare of trumpets. You can do this by combining the HIDDEN , CONTROLLER , AUTOPLAY , and QTNEXT parameters.

    Example: <EMBED SRC="Fanfare.mov" HEIGHT="2" WIDTH="2"
    HIDDEN="True" AUTOPLAY="True" CONTROLLER="False"
    QTNEXT1="<Player.mov> T<quicktimeplayer>">

    This causes Fanfare.mov to play automatically in the background when the HTML page loads in a browser. As soon as Fanfare.mov finishes, Player.mov loads in the QuickTime Player application, outside the browser.

    Summary of QuickTime Plug-in Parameters

    The QuickTime Plug-in accepts the following parameters. Many of them are discussed in detail in the previous section, Some Particularly Cool Features .

    • AUTOHREF="True" | "False" (default is False )
      If True , causes any URL specified in the HREF parameter to load immediately, without waiting for a mouse click.
    • AUTOPLAY="True" | "False" (Default depends on user settings)
      Sets the movie to automatically start when the web page loads.
    • BGCOLOR= "# rrggbb " | " ColorName "
      If the rectangle specified by HEIGHT and WIDTH is larger than the movie, this sets the background color for the rectangle. You can specify the color as a hexadecimal triplet of red, green, and blue values.

    QuickTime 4 and later also accepts names in place of some RGB values:

    Color name   RGB value
    BLACK #000000
    GREEN #008000
    SILVER #COCOCO
    LIME #00FF00
    GRAY #808080
    OLIVE #808000
    WHITE #FFFFFF
    YELLOW #FFFF00
    MAROON #800000
    NAVY #000080
    RED #FF0000
    BLUE #0000FF
    PURPLE #800080
    TEAL #008080
    FUCHSIA #FF00FF
    AQUA

    #00FFFF

    • CONTROLLER "True" | "False"
      Include a controller with the movie (or not). Default is True unless the movie is a .swf (Flash animation) file or a VR movie (a panorama or object movie).
    • CORRECTION="None" | "Full" (VR only, default is Full )
      Shows a VR panorama with no correction for warping (fastest), or provides full correction for horizontal and vertical warping.

    Note: The CORRECTION value "Partial" is no longer supported, and maps to "Full" in QuickTime 4 and later.

    • DONTFLATTENWHENSAVING
      If specified, the plug-in does not make copies of data that is included in the movie by reference. If the movie is on a Web server and references external media, this prevents viewers from saving a working copy of the movie using the plug-in. If a movie contains internal references, such as the same audio clip referenced hundreds of times, setting this flag prevents the movie from swelling up like a tick when saved.
    • ENABLEJAVASCRIPT="True" | "False" (default is "False" )
      If you want to control a QuickTime movie using JavaScript functions, you need to enable JavaScript for that movie by setting ENABLEJAVA-SCRIPT="True" . For details, see "QuickTime and JavaScript" (page 465).
    • ENDTIME=" Time " ( Hours : Minutes : Seconds . Thirtieths )
      If set, causes the movie to stop playing at the specified point in the movie. See also STARTTIME .
    • FOV=" Angle " (VR only)
      Sets the initial field of view in degrees (and therefore sets the zoom) for a VR movie. The valid range for " Angle " is dependent on the movie.
    • GOTO n
      See QTNEXT
    • HOTSPOT n =" Url " TARGET n =" FrameName " (VR only)
      Links the specified VR hot spot to a URL. The TARGET parameter is optional. See TARGET .
    • HREF=" Url "
      Clicking in the display area of the movie loads the specified URL. The URL can be a Web page, a QuickTime movie, or a JavaScript function. You can use this in conjunction with the TARGET parameter to cause the URL to load in another frame or window, in the QuickTime Plug-in itself, or in the QuickTime Player application. See TARGET .
    • KIOSKMODE="True" | "False"
      If true, the plug-in does not allow the user to save a copy of the movie.
    • LOOP="True" | "False" | "Palindrome" (Default is False )
      If True , the movie loops endlessly. If Palindrome , the movie loops back and forth, first playing forward, then backward.
    • MOVIEID=" n " (integer value)
      Assigns an integer ID to the movie. This permits the movie to be targeted by wired actions in another movie. Similar to MOVIENAME , but MOVIEID allows the movie to be targeted from a movie that doesn't know this movie's name. A number is also easy to create as the result of a calculation.
    • MOVIENAME=" Name "
      Assigns a name to a movie. This permits the movie to be targeted by wired actions in another movie. For example, one movie can act as a controller for other movies, starting them, stopping them, skipping to a particular time, activating certain tracks, and so on.

    Note: MOVIENAME is not the same as the NAME parameter. Use NAME to target an embedded movie by name for a JavaScript function; use MOVIENAME to target wired sprite actions between movies.

    • NODE=" n " (VR only)
      Specifies the initial node for a multinode VR movie.
    • PAN=" Angle " (VR only)
      Sets the initial pan angle, in degrees, for a VR movie. The valid range depends on the movie, and is 0-360 for full panoramas.
    • PLAYEVERYFRAME= "True" | "False" (Default is False , except for .swf )
      If True , the plug-in does not drop frames, even if it gets behind. The movie may play at a slower than normal rate, but it plays every frame. The sound is muted when PLAYEVERYFRAME is True .
    • QTNEXT n = "< url > T< Target >" ( n = 1-255) or "GOTO x " ( x = 0-255)
      Specifies a list of movies to play, with an optional target. The target can be a frame, a window, <myself> , or <quicktimeplayer> . Both < url > and T< Target > must be enclosed by angle brackets. If a target is specified, the target and the URL together must be surrounded by quotes. Multiple QTNEXT n statements can be included in a single <EMBED> tag. The value of n is an integer from 1 to 255. Each QTNEXT n executes in numerical order. The GOTO x statement causes a branch to the matching QTNEXT n . To branch to the original movie named in the SRC or QTSRC parameter, specify GOTO0 .
    • QTSRC=" url "
      Causes the plug-in to ignore the file specified by the SRC parameter and to play the file specified by " url " . Useful for playing non-movie files with the QuickTime Plug-in, and for specifying rtsp:// URLs. You can use the QTSRCCHOKESPEED parameter to limit the HTTP or FTP bandwidth used by a file specified with QTSRC . Note that the browser still downloads the file specified in the SRC parameter, but the plug-in ignores it.
    • QTSRCCHOKESPEED=" MaxSpeed " (in bits per second) or "movierate"
      Specifies the maximum HTTP or FTP bandwidth used to download a file specified in the QTSRC parameter. Useful to limit server load when a large movie is downloaded by viewers with fast Internet connections. Also useful for reserving bandwidth for RTP streaming when loading a movie over HTTP that contains both streaming and nonstreaming tracks. As of this writing (QuickTime 4.1.2), QTSRCCHOKESPEED limits the download speed of data only in self-contained movies. Any data contained in external files, including alternate movies, is unaffected.
    • QTSRCDONTUSEBROWSER="True" | "False" (default is False )
      If True, the URL specified in the QTSRC parameter is loaded using QuickTime's internal methods, instead of using the browser to fetch the file. This prevents the browser from caching the file, which speeds access to local movies and can help prevent copying movies over the Web.
    • SCALE="ToFit" | "Aspect" | " n " (default is 1)
      Scales movie to fit the rectangle allocated in the <EMBED> tag, or scales to the best fit while keeping the movie's aspect ratio, or scales by a factor of n . For example, to play a movie at double its normal size, set SCALE="2" ; to play a movie at half size, set scale="0.5" .
    • STARTTIME=" Time " ( Hours : Minutes : Seconds . Thirtieths )
      If set, causes the movie to start playing at the specified offset into the movie's timeline. See also ENDTIME .
    • TARGET[ n ]=" FrameName "
      (or "myself" , "quicktimeplayer" , or "webbrowser")
      Causes the URL associated with a HOTSPOT or HREF to load in the named frame. If you match a TARGET with a HOTSPOT , append the same value n to TARGET that you used to identify the hot spot. If set to myself , the URL replaces the current movie. If set to quicktimeplayer , the URL loads in the QuickTime Player application. If set to webbrowser , the URL loads in the default browser window, launching the default browser if necessary. See also HOTSPOT , HREF , TARGETCACHE.
    • TARGETCACHE="True" | "False"
      If set to True , a URL loaded using the TARGET parameter is stored in cache.
    • TILT=" Angle " (VR only)
      Sets the initial vertical tilt angle, in degrees, for a VR movie. The valid range is dependent on the movie, but is typically -42.5 to +42.5.
    • URLSUBSTITUTE n ="< String >:< SubstituteURL >"
      Replaces every instance of String with SubstituteURL inside any HREF tracks, sprite action URLs, or VR hotspot URLs. Both String and SubstituteURL must be surrounded by angle brackets, and the two must be separated by a colon. The value n may be any integer from 1 to 999, and may be omitted if only one URLSUBSTITUTE parameter is specified. Use this parameter to repurpose QuickTime movies with embedded URLs without editing the movies.
    • VOLUME=" Percent " (0-300)
      Sets audio volume from 0 to 300% of the user's sound setting. Values greater than 100 may cause distortion and clipping.


    Plug-in Helper

    Plug-in Helper is a tool that enhances QuickTime movies for the Internet. You can use Plug-in Helper to copy-protect movies or add clickable URLs to video tracks, but its main purpose is to put plug-in parameters, such as AUTOPLAY and CONTROLLER , inside a movie. When the QuickTime Plug-in plays that movie, it's just as if you had put the parameters in an <EMBED> statement.

    That's nice, because you can put only one set of parameters in an <EMBED> statement, but with HREF and QTNEXT you can specify more than one movie. With Plug-in Helper, each movie can have its own set of plug-in parameters, so you can set CONTROLLER="False" in a poster movie, for example, and CONTROLLER="True" in the movie it links to.

    It's also nice to move some settings out of the highly visible HTML and put them inside the movie structure for privacy. For example, you can put QTNEXT1="../Secret/Next.mov" inside a movie without ever putting the URL of Next.mov in your HTML.

    Bear in mind that you can use Plug-in Helper to set the <EMBED> parameters that the QuickTime Plug-in understands, but not the parameters that the browser itself understands. So you can set QTSRC , CONTROLLER , and BGCOLOR , for example, but not SRC , HIDDEN , HEIGHT , or WIDTH .

    There are two versions of Plug-in Helper, one for the Mac OS and one for Windows. Use the version that's right for you. They're both in the Tools folder on the CD.

    You can open a movie in Plug-in Helper by choosing Open from the File menu, or you can drag the movie onto Plug-in Helper. There's a checkbox for copy-protecting the movie, a text-entry box for plug-in settings, and a pair of text-entry boxes for HREF links. It's pretty easy to use.

    When you're ready to save your changes, click the Export button. You have to give the movie a new name or a new location at this point. If you try to overwrite the movie you just opened, it doesn't work (Plug-in Helper just beeps).

    The checkbox for copy-protection and the HREF text boxes apply to a movie whether it's played by the plug-in, QuickTime Player, or any other QuickTime application.

    The parameters you enter in the Plugin Settings text box affect only the QuickTime Plug-in; they won't affect a movie when it's played by QuickTime Player. The only exceptions are MOVIENAME and MOVIEID , which QuickTime Player also recognizes. If you need to store <EMBED> parameters in a movie that's targeted to QuickTime Player, see Settings You Can Save .

    Making a Poster Movie

    Here's a practical example. Suppose you want to embed a still image in your Web page that loads and plays a movie when someone clicks the image. Suppose further that you want the movie to load and play right where the image is. You can do this, but you need Plug-in Helper to get it right. Here's how:

    1. Make a QuickTime movie that contains just the still image. Let's call it Poster.mov . You can do this by opening an image in QuickTime Player and saving it as a self-contained movie.
    2. Embed the poster movie in your Web page and set the HREF and TARGET parameters so the real movie loads when someone clicks the image:
      <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120
      HREF="Other.mov" TARGET="myself">

    The problem now is that you don't want the poster movie to have a controller; you want people to click it, not try to play it. But you do want the second movie to have a controller, and you want it to autoplay. So:

    1. Pass the CONTROLLER="False" parameter in the <EMBED> tag for the poster movie:
      <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120
      HREF="Other.mov" TARGET="myself" CONTROLLER="False">
    2. Use Plug-in Helper to put the CONTROLLER="True" and AUTOPLAY="True" parameters inside the other movie, as shown in the following illustration:
     

    The resulting Web page has a poster movie with no controller, linked to a movie that plays automatically and has a controller. You can see an example by using your browser to open Poster.htm in the SpecialDelivery folder of the CD.

     

    You can't set a separate height or width for the two movies using Plug-in Helper; the HEIGHT and WIDTH settings specify how much space the browser provides to the plug-in, and the plug-in itself can't change them. So you have to choose one setting that works for both the poster and the movie.

    Remember that the controller adds 16 pixels to the height of the movie, so set HEIGHT equal to at least the movie height plus 16. Ideally, the poster image should be exactly 16 pixels taller than the movie. If the poster is larger or smaller than the movie plus the controller, set HEIGHT and WIDTH to the larger dimensions and set an appropriate background color using the BGCOLOR parameter in the <EMBED> tag. Black is an effective background color for most movies.

    If you want the second movie to load in the QuickTime Player application instead of replacing the image in the Web page, set the TARGET parameter to quicktimeplayer instead of myself .

    Copy-Protecting Movies with Plug-In Helper

    There are several things you can do to copy-protect your movies using Plug-in Helper. You can set a movie characteristic that prevents the movie from being edited or saved by any QuickTime application, you can conceal a movie's URL by embedding it inside a poster movie, or you can conceal a movie's URL by embedding it in a decoy movie. You can combine these methods by copy-protecting the poster or decoy movie as well.

    A Word to the Wise

    There's a lot of interest in securing movies and, yes, there are a lot of useful tricks, but, no, there is no 100% foolproof method--someone can always point a movie camera at the screen.

    Sometimes the best answer is jujitsu; instead of fighting the force, redirect it to your benefit. Add your logo to the movie and include a live link back to your website. QuickTime makes it easy to do both. Every copy becomes free advertising. If every copy of your rock video is a clickable link to buy the CD. . .

    People love to copy things. Use viral marketing to make this force of nature your friend.

    Ahem, that said. . .

    Copy Protection

    Clicking the "Disallow saving from plugin" checkbox in Plug-in Helper is similar to setting KIOSKMODE="True" in the <EMBED> tag, but it's more secure.

    For example, if someone looks at your HTML source and sees:
    <EMBED SRC="DontCopyMy.mov" KIOSKMODE="True">
    it's no trouble for them to write their own Web page that says:
    <EMBED SRC="http://yourserver/DontCopyMy.mov" KIOSKMODE="False">
    They can then use the plug-in to copy your movie from their Web page.

    But the QuickTime Plug-in won't copy a movie if the Disallow Saving checkbox is set with Plug-in Helper, no matter what Web page it's embedded in. In fact, all QuickTime applications, including QuickTime Player and Plug-in Helper, recognize this setting, and will not copy or save the movie once it is set.

    IMPORTANT
    Make a backup copy of your movie before you turn copy-protection on using Plug-in Helper. You cannot edit and save the movie afterward.

    Concealing the URL with a Poster Movie

    You can get additional protection by using Plug-in Helper to conceal a movie's URL from viewers. Your HTML source can be simply :
    <EMBED SRC="Poster.mov" HEIGHT=176 WIDTH=120>
    The poster movie links to the real movie with an HREF parameter set by Plug-in Helper. The real movie's URL doesn't appear in your HTML.

    Tip: To prevent a copy of your movie from appearing in the browser's cache, include the QTSRCDONTUSEBROWSER="True" parameter along with the HREF parameter.

    If the poster movie is also copy-protected, it's difficult for people to find out the name or location of your real movie. Again, it won't stop a truly determined thief, but it puts a barbed wire fence behind the "No Trespassing" sign. The illustration on the next page shows how to use Plug-in Helper to embed a URL in a copy-protected poster movie.

    The poster movie in the illustration is copy-protected and displays without a controller, because the "Disallow saving from plugin" checkbox is selected and the Plugin Settings include CONTROLLER="False" .

     

    When the viewer clicks the poster movie, it is replaced by the actual movie because Movie URL is set to Actual.mov and the Plugin Settings include TARGET="myself" . The actual movie should have a controller by default, but you can add CONTROLLER="True" to the actual movie, using Plug-in Helper, to be sure.

    IMPORTANT
    If you enter a relative URL with Plug-in Helper, it must be relative to the movie, not relative to the HTML page that holds the movie. If the movie and the Web page are in different folders, this distinction is crucial.

    Use Plug-in Helper to copy-protect the actual movie as well.

    Concealing the URL with a Decoy Movie

    You can use Plug-in Helper to automatically link one movie to another using the QTNEXT parameter. Putting the QTNEXT parameter inside the first movie, instead of putting it in the <EMBED> tag, conceals the URL of the second movie without requiring the user to click a poster.

    Instead of a poster movie, create a very short movie, such as a single black frame with a duration of 1/10 second. Let's call this a decoy movie. Use Plug-in Helper to copy-protect the decoy movie, set AUTOPLAY="True" , and set QTNEXT1 to the actual movie with T<myself> . This makes the decoy movie play automatically, then replace itself with another movie whose URL does not appear in your HTML.

    .

    Tip: If you set CONTROLLER="False" in a decoy movie, you need to use Plug-in Helper to set CONTROLLER="True" in the actual movie. That's because a poster movie uses HREF , which resets the default controller, while a decoy movie uses QTNEXT , which doesn't reset the controller.

    As an alternative to using QTNEXT in a decoy movie, you can use HREF combined with the AUTOHREF parameter. So
    QTNEXT1="<Actual.mov> T<myself>"
    becomes
    HREF="Actual.mov" TARGET="myself" AUTOHREF="True"

    If you use QTNEXT , the decoy movie plays before the next movie loads. If you use HREF and AUTOHREF , the next movie loads immediately. The AUTOHREF parameter requires QuickTime 4.1 or later.

    Okay, enough about copy-protection. Let's look at some other things you can do with Plug-in Helper.

    Loading a URL from a Movie

    You can embed links to various URLs inside a movie using Plug-in Helper. This makes the links independent of any HTML, so multiple movies specified by a single <EMBED> tag can each have their own links.

    It also allows you to create links that work when a movie is playing in QuickTime Player. QuickTime Player can load the URL itself, without going through a browser, or it can open the URL in a browser window, launching the browser if necessary.

    The URL can specify a movie, a Web page, or some other file. It can be targeted to load in a window or frame of the browser, to replace the current movie, or to load in QuickTime Player.

    There are three areas in the Plug-in Helper window where you can add URLs: the Plugin Settings text box, the Movie URL text box, or the Track URL text box. Each has a different behavior.

    Plugin Settings Text Box

    You add a URL in the Plugin Settings box using this syntax:
    HREF="< Url > T< Target >"

    Note: An HREF command in the Plugin Settings window is only active when the movie is played by the QuickTime Plug-in. QuickTime Player ignores it (after all, it's a plug-in setting).

    The specified URL can be relative or absolute. If a relative URL is used, it must be relative to the movie, not relative to the Web page the movie is embedded in. Absolute URLs can use http:// , ftp:// , rtsp:// , or file:/// protocols.

    The T< Target > parameter is optional. If no target is specified, the URL loads in the current browser window or frame, replacing the current movie and any Web page it's embedded in.

    If a target is specified, it can be a browser window, a frame, or the special values quicktimeplayer or myself . If the window or frame specified doesn't exist, a new browser window of that name is created. If the target specified is quicktimeplayer , the URL is opened in the QuickTime Player application. If the target is myself , the URL replaces the current movie inside the plug-in.

    If you enter a URL in the Plugin Settings, the URL loads when someone clicks anywhere in the display area of the movie. This could be the display area of any video track, sprite track, or text track. It doesn't work with audio-only movies. Clicking the movie controller doesn't load the URL.

    If you also specify AUTOHREF="True" the URL loads immediately, without playing the current movie or waiting for a mouse click.

    Movie URL Text Box

    The syntax for adding a URL in the Movie URL text box is different than in the Plugin Settings text box. Enter just the URL into the Movie URL box--don't include an HREF= string. For example, enter:
    http://www.server.com/path/filename
    not
    HREF="http://www.server.com/path/filename"

    If you specify a target for the URL, you need to use angle brackets and quotes:
    "< http://www.server.com/path/filename> T<myself>"

    If you enter a URL in the Movie URL text box, the URL loads when someone clicks anywhere in the display area of the movie. This could be the display area of any video track, sprite track, or text track. It doesn't work with audio-only movies. Clicking the movie controller doesn't load the URL.

    Adding a URL in the Movie URL box creates a link that works in the QuickTime Plug-in or QuickTime Player, but the two sometimes behave differently.

    If the movie is playing in QuickTime Player, the URL must be absolute; QuickTime Player ignores relative URLs. So include a protocol identifier and the full path, such as
    HTTP://webserver.com/path/filename or
    RTSP://streamserver/path/filename

    The plug-in can handle absolute or relative URLs. Relative URLs must be relative to the movie, not relative to the HTML page that contains the movie.

    The optional T< Target > parameter affects the plug-in and QuickTime Player differently.

    • QuickTime Player
    • If no target is specified, or the target is quicktimeplayer , the URL loads in a new QuickTime Player window. The current movie continues to play.
    • If the target is myself , the URL replaces the current movie. The URL should point to a QuickTime movie, a SMIL presentation, or some other file that QuickTime can play.
    • If the target is webbrowser , the URL loads in the default browser window, launching the default browser if necessary. The current movie continues to play.
    • If some other target is specified, and the default browser has an open window or frame with that name, the URL loads there. Otherwise, a browser window with that name is created, launching the default browser if necessary. The target name is passed to the browser, so targets such as _blank or _top can have special meaning. The current movie continues to play.
    • QuickTime Plug-in
    • If no target is specified, or the target is webbrowser , the URL loads in the current browser window or frame, replacing the current movie and any Web page that contains it.
    • If the target is myself , the new URL replaces the current movie in the QuickTime Plug-in. The URL should point to a QuickTime movie or some other file that QuickTime can play.
    • If the target is quicktimeplayer , the new URL opens in QuickTime Player, launching it if necessary. If QuickTime Player is already active, the URL opens in a new player window. The movie in the plug-in continues to play.
    • If some other target is specified, and the browser has an open window or frame with that name, the URL loads there. Otherwise, a browser window with that name is created. This is useful for opening an adjunct Web page or image in another frame. The target name is passed to the browser, so targets such as _blank or _parent can have special meaning. The current movie continues to play.

    Track URL Text Box

    A track URL is similar to a movie URL, but you can enter a different track URL for every video track in the movie, whereas you can have only one movie URL. The syntax for a track URL is the same as for a movie URL. It's just that the track URL is activated when someone clicks inside the display area of a particular video track, rather than anywhere in the movie. The video tracks appear by name in a scrolling list--click one to associate a URL with it, then enter the URL.

    Since tracks can be arranged in time and space, this lets you activate a different URL depending on where or when the user clicks. Track URLs work only with video tracks, not with sprite or text tracks.

    The QuickTime Plug-in and QuickTime Player respond to track URLs just as they do to a movie URL.

    Remember: QuickTime Player ignores relative URLs, but they work in the QuickTime Plug-in; relative URLs must be relative to the movie, not relative to the Web page that holds the movie. The same TARGET parameter can cause different behavior by the QuickTime Plug-in and QuickTime Player; even the default target is different.

    You can't combine track URLs with a movie URL. Choose one or the other. If you specify both, the movie URL takes precedence and any track URLs are ignored.


    Saving Movies

    When you save a QuickTime movie, you have to give it a name and choose whether to make it self-contained. On your own computer, the movie probably plays equally well whether it's self-contained or not, and no matter what you name it. But these decisions have important consequences for the Web.

    What's in a Name?

    On your computer, a file may be allowed to have blank spaces or characters other than numbers and letters in its name. But a movie intended for the Web must have a name that doesn't confuse the Web server's file system, the viewer's file system, or any browsers.

    For example, a movie named My Movie cannot be used on most Web servers, and a link to <A HREF="My Movie"> will fail on a variety of browsers and operating systems. One problem is the blank space, another is the lack of a file extension. Use MyMovie.mov instead.

    As another example, Macintosh computers are not case-sensitive--you can name a file MyMovie.Mov ,and link to it with <A HREF="mymovie.mov"> . This works fine locally, but the link will fail on a Windows CD or a UNIX Web server.

    Here are some useful rules for naming movies:

    • Use a short name and a three-letter file extension separated by a period; for example: MyMovie.mov .
    • Use lowercase .mov for the file extension.
    • Use only one period ( . ) in the filename, the one before the file extension.
    • Use only letters ( a-z ) and numbers ( 0-9 ) in the actual name.
    • Never begin a filename with a number; use Movie1.mov rather than 1Movie.mov .
    • Never include a blank space, a colon ( : ), a vertical bar ( | ), a forward slash ( / ), or a backslash ( \ ) in a filename.
    • If you capitalize any letters in the filename, be sure all links to the movie use exactly the same capitalization. MyMovie.mov is not equal to mymovie.mov .

    Making Movies Self-Contained

    Generally speaking, you want to make your movies self-contained for Web delivery.

    Remember that a movie is made of tracks. Tracks contain references to media samples such as sound or video. When you make a movie self-contained, any references to data in external files are resolved, and copies of the data are stored inside the movie file itself. What's more, the data samples are interleaved for smooth delivery.

    If you don't make a movie self-contained, it stores references to the external files (the filenames and the relative path to the files). It also stores the byte offset into the files for each media sample. For such a movie to work, the data files cannot be edited, moved relative to the movie file, or renamed. Any directory names in the relative path must also remain unchanged.

    For such a movie to work over the Web, there are additional requirements: the external files and any directories in the relative path must also exist on the Web server, they must have exactly the same names they had on the original computer, and these must be legal file and directory names in the Web server's file system.

    There are so many ways to screw this up that it isn't even funny. As a general rule, you should just make the movie self-contained and not worry about it.

    Still, there are times when you don't want to make a movie self-contained, as we'll describe in the next section. If you don't make a movie self-contained, you improve your chances of survival by doing the following:

    • Make sure that the data files have only lowercase letters in their filenames; don't mix uppercase and lowercase.
    • Put all the data files in one directory, and save the movie to the same directory when you create it; that way there are no directory names in the path to the files.

    Flattening

    Making a movie self-contained is sometimes called "flattening" the movie. That's unfortunate, because flattening is really something more. Flattening a movie means that all references to media data are resolved and copies of the data are stored in the movie file. If the references are to data in external files, that does make the movie self-contained. But flattening also resolves internal references.

    Remember, a track can contain multiple references to the same media data. What's more, the same data can be referenced by multiple tracks. If that data is already stored in the movie file, the movie is already self-contained. The references are to internal data.

    When you flatten a movie, all references are resolved, and any referenced data is copied into the movie file. Internal references are resolved by making internal copies of the data. That makes the movie file larger, sometimes much larger, but it also optimizes the movie for smooth playback.

    Note: Macintosh files can have both a data fork and a resource fork, but Windows and UNIX files don't have resource forks. In the ancient days of QuickTime 1.0, the header data for a movie was stored in the movie file's resource fork. Before you could put a movie on a UNIX Web server or a Windows CD, you had to move some things into the data fork. There was a utility program named FlattenMoov that did this, so using it was often called "flattening" a movie as well. QuickTime now stores the movie header in the data fork by default, so movies no longer need to be flattened in this old sense.

    Currently, clicking the "Make movie self-contained" checkbox when you save a movie in QuickTime Player flattens the movie. Sometimes you want to make a movie self-contained without flattening it, which can be tricky.

    Here's an example. Open any self-contained movie in QuickTime Player. Select All. Copy. Paste. Paste. Paste. Now when you play the movie, it repeats all the data three times. If you choose Save from the File menu, then look at the file size, you'll find that the movie file has grown by only a few bytes. That's because it makes three references to the same set of data. It's self-contained, but not flattened.

    But if you choose Save As from the File menu to make a new copy of the movie, you'll see that making the file self-contained triples its original size, while saving normally (allowing dependencies) uses only 1K.

     

    Since Save As creates a new file, your choice is to have no copies of the data (leaving the data in its original file) or to have three copies. Remember: QuickTime Player automatically flattens a movie when you choose "Make movie self-contained." Movies created using Save As never contain internal references.

    Why would you want to make a movie with internal references? So you could repeat some of the data several times, even hundreds of times, without making a large file. Making the file self-contained isn't necessary, but it's convenient to have everything in one place.

    If you want to make a self-contained movie with internal references, start with a self-contained movie. Edit the movie by copying and pasting within the movie, so you add only internal references, and save using the Save command, not the Save As command.

    IMPORTANT
    When you choose Save from the File menu, the movie is always saved normally (allowing dependencies). Movies saved using the Save command do not always fast start on the Internet. A movie without the Fast Start feature must download completely before it can play.

    If you need to use internal references, use the Save command. If the movie must fast start on the Internet, use Save As.

    There is currently no way to save a movie with internal references that is guaranteed to fast start. However, you can easily create a movie with internal references, save it using the Save command, then save a second version using Save As (allowing dependencies). The second version will be very small (typically 1K). The second version is guaranteed to be a Fast Start movie and can play over the Web, but you need to keep both versions together because the second version depends on data in the first version. Save them in the same folder and upload them to your Web server together.

    And that's probably more than you really wanted to know about flattening. But it will come in handy later. Trust me.

    Settings You Can Save

    Some of the user settings that you can choose in QuickTime Player's Movie menu are saved along with the movie. You can use these settings to control the way a movie is displayed when you target the QuickTime Player, much the same way you use Plug-in Helper to control the way a movie is displayed by the QuickTime Plug-in.

     

    These settings are part of the movie only if the movie is played in QuickTime Player:

    • Loop--equivalent to setting LOOP="True" for the plug-in.
    • Loop Back and Forth--equivalent to setting LOOP="Palindrome" for the plug-in.
    • Play Selection Only--selecting part of the movie in QuickTime Player and choosing Play Selection Only is equivalent to setting STARTTIME and ENDTIME for the plug-in.
    • Play All Frames--equivalent to setting PLAYEVERYFRAME="True" for the plug-in.

    The following settings are part of the movie whether it's played in the QuickTime Plug-in or QuickTime Player:

    • Half Size--equivalent to setting SCALE="0.5" for the plug-in.
    • Double Size--equivalent to setting SCALE="2" for the plug-in. For movies compressed with the Sorenson or H.263 video codecs, this is a good way to increase the display size of the movie without increasing its data rate or file size.
    • Fill Screen--this has no equivalent for the plug-in. When you choose it, QuickTime Player scales the movie up to fill your entire screen. However, choosing Fill Screen scales the movie up to fill your screen. Viewers with larger or smaller screens get a big movie, but not necessarily the size of their full screen.

    You can guarantee a large-screen movie, and still be confident it will fit on almost any viewer's screen, by setting your screen resolution to 640x480, choosing Fill Screen, and saving the movie. For an example of a full-screen movie launched from a Web page, point your browser at BigMovie.htm in the Special Delivery folder of the CD.

    The Half Size, Double Size, and Fill Screen settings also affect movie playback in the plug-in, but the plug-in gets its display area from the browser, so be sure to allocate the right amount of space in the HEIGHT and WIDTH parameters.

    Tip: To make a QuickTime movie autoplay even when it's launched in QuickTime Player (equivalent to AUTOPLAY="True" for the plug-in), open the Info window, choose Auto Play from the right pop-up menu, and click the checkbox. This setting is saved with the movie.


    Putting Multiple Movies on a Page

    Sometimes you want to put multiple QuickTime movies on a single Web page. This presents a problem. Like most problems, there's a way to solve it that's simple, obvious, and wrong:

    <EMBED SRC="HugeMovie1.mov" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="HugeMovie2.mov" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="HugeMovie3.mov" HEIGHT=136 WIDTH=160>

    Don't do this. If you put multiple movies on your Web page using multiple <EMBED> tags you'll run into the following problems:

    • Every <EMBED> tag on the page loads a copy of the plug-in, which requires its own block of memory. It adds up.
    • All the movies download at once, right along with your Web page. It takes forever.
    • All the movies try to load into memory at once. Oops.

    To see an example of this approach, load MultiMovie1.htm (in the SpecialDelivery folder on the CD).

     

    You might use this approach successfully for a page with a few small movies or in a controlled environment--two or three short audio loops, for example, or short movie clips on an intranet page for users with a known amount of RAM.

    For pages with several large movies or MP3 files, delivered over the Internet, this is a recipe for trouble.

    Fortunately, there are other solutions. You can use poster movies, target the movies to QuickTime Player, target the movies to a common frame or window, or you can use a little JavaScript.

    Poster Movies

    Poster movies are described in Making a Poster Movie and Click Here, Play There . To embed multiple poster movies on a page, try this:

    <EMBED SRC="Poster1.mov" HREF="HugeMovie1.mov" TARGET="myself"
    HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster2.mov" HREF="HugeMovie2.mov" TARGET="myself"
    HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster3.mov" HREF="HugeMovie3.mov" TARGET="myself"
    HEIGHT=136 WIDTH=160> <BR>

    This still loads multiple copies of the plug-in, but each copy initially shows an image rather than a whole movie. This shortens the load time for your page and doesn't require a lot of RAM initially.

    To see an example of this approach, load MultiMovie2.htm (in the SpecialDelivery folder on the CD). It's shown on the next page.

     

    Unfortunately, each movie loads into RAM when the user clicks a poster and continues to use RAM after it's done playing. After the second or third movie, there may not be enough RAM to play any others, and there's no easy way for the user to close the open movies.

    You can get around this by having each movie turn back into a poster when it finishes. You do this by embedding a QTNEXT statement into the actual movie (not the poster movie) using Plug-in Helper:

    QTNEXT1="<Poster.mov> T<myself>"

    where <Poster.mov> specifies the poster for that movie.

     

    Embedding parameters in a movie using Plug-in Helper is described in Plug-in Helper . You'll probably want to add a CONTROLLER="False" statement to each poster movie using Plug-in Helper as well:

     

    To see an example of this approach, load MultiMovie3.htm (in the SpecialDelivery folder on the CD)

     

    Targeting QuickTime Player

    Alternately, you can have your poster movies target QuickTime Player. A user who runs short on RAM can simply close any open movies. The HTML looks like this:

    <EMBED SRC="Poster1.mov" HREF="HugeMovie1.mov"
    TARGET="quicktimeplayer" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster2.mov" HREF="HugeMovie2.mov"
    TARGET="quicktimeplayer" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster3.mov" HREF="HugeMovie3.mov"
    TARGET="quicktimeplayer" HEIGHT=136 WIDTH=160> <BR>

    To see an example of this approach, load MultiMovie4.htm (in the SpecialDelivery folder on the CD).

     

    One nice thing about this approach is that the movie can be larger than the space allocated to the plug-in or even larger than the browser window.

    Targeting a Frame or a Window

    QuickTime Player has a distinctive visual interface, which may or may not be what you want. The plug-in has a more neutral interface, and you can customize the Web page around it (or hide the controller altogether). If you prefer to use the plug-in, you can target a frame or a window instead of targeting QuickTime Player. If each poster targets the same frame or window, only one movie loads into memory at any time.

    You can either create a frameset with a designated frame for playing movies, or you can let the browser create a new window to play movies in.

    In either case, write a small HTML page for each movie, with that movie embedded in it:

    <HTML>
    <HEAD>
    <TITLE>Movie In Window</TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="Center">
    <H1>Huge Movie 1</H1>
    <EMBED SRC="HugeMovie1.mov" HEIGHT=136 WIDTH=160 AUTOPLAY="True">
    </DIV>
    </BODY>
    </HTML>

    Use the URL of the page you just wrote in the poster movie's HREF tag, and target a frame or a window. Specify the same target for all the movies:

    <EMBED SRC="Poster1.mov" HREF="HugeMovie1.htm"
    TARGET="MovieFrame" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster2.mov" HREF="HugeMovie2.htm"
    TARGET="MovieFrame" HEIGHT=136 WIDTH=160> <BR>
    <EMBED SRC="Poster3.mov" HREF="HugeMovie3.htm"
    TARGET="MovieFrame" HEIGHT=136 WIDTH=160> <BR>

    When the user clicks a poster, the HTML page with the corresponding movie loads and plays in the named frame. If there is no frame with that name, the browser creates a new window. When the user clicks a different poster, a new movie plays in the same place. The old movie and the old copy of the plug-in are dismissed from memory, so only the current movie uses any RAM.

    To see an example of this approach, load MultiMovie5.htm (in the SpecialDelivery folder on the CD).

     

    If you use this technique, you can reduce memory requirements and speed up page loading even further by using ordinary HREF anchors instead of poster movies. The links can be text:

    <A HREF="HugeMovie1.htm" TARGET="MovieFrame">Play Movie 1</A>
    <BR>
    <A HREF="HugeMovie2.htm" TARGET="MovieFrame">Play Movie 2</A>
    <BR>
    <A HREF="HugeMovie3.htm" TARGET="MovieFrame">Play Movie 3</A>
    <BR>

    or images:

    <A HREF="HugeMovie1.htm" TARGET="MovieFrame">
    <IMG SRC="Movie1.gif"></A> <BR>
    <A HREF="HugeMovie2.htm" TARGET="MovieFrame">
    <IMG SRC="Movie2.gif"></A> <BR>
    <A HREF="HugeMovie3.htm" TARGET="MovieFrame">
    <IMG SRC="Movie3.gif"></A> <BR>

    If you're using a frameset, and MovieFrame is an existing frame, that's where each movie plays. To see an example of this approach, load MultiMovie6.htm (in the SpecialDelivery folder on the CD).

     

    If there is no frame named MovieFrame , a new window is created with that name. The movies play in this window. To see an example of this approach, load MultiMovie7.htm (in the SpecialDelivery folder on the CD), shown on the next page.

    Unfortunately, you cannot control the size or the attributes of a window created from the HTML TARGET parameter. The window will have the size and characteristics of the default window for the user's browser, which may not be what you had in mind at all.

     

    If you want your movies to play in a floating window whose size and characteristics you control, you need to use JavaScript.

    Creating a Window with JavaScript

    The script that specifies the size and attributes of the target window goes in the head of your main HTML page. Here's an example page:

    <html>
    <head>
    <title>JavaScript Movie Page</title>
    <script language="JavaScript">
    <!-- hide from old browsers
    function openMovie(url) {
    windOptions = "toolbar=0,location=0,directories=0,status=0," +

    "menubar=0,scrollbars=0,resizable=0,width=320,height=240";
    moviewin = window.open(url, "movie", windOptions);
    moviewin.focus();
    }
    // -->
    </script>
    </head>
    <body>
    <a href="javascript:openMovie('HugeMovie1.htm')">Movie1</a><BR>
    <a href="javascript:openMovie('HugeMovie2.htm')">Movie2</a><BR>
    <a href="javascript:openMovie('HugeMovie2.htm')">Movie3</a>
    </body>
    </html>

    The JavaScript function openMovie(url) opens a 320 x 240 window with no distracting bells and whistles: no Back or Home buttons, no What's Cool button, no scroll bars, no nothing; just a simple window. The window is named moviewin , and it's opened on top of any existing windows. The window is created only when someone clicks one of the movie links. It's filled with the specified HTML page, which should contain an embedded movie.

    The movie links can be text, as shown in the example above, or GIF or JPEG images. To see an example of this approach, load MultiMovie8.htm .

     


    Detecting the QuickTime Plug-in

    Experiencing your website depends on the QuickTime Plug-in, so you want to be sure your visitors have it. If they don't, you want to redirect them to a download page or to alternate content pages.

    Detecting browser plug-ins tends to be a black art, due to inconsistencies among browsers, operating systems, ActiveX, JavaScript, and VBScript. The easy and reliable way is to use QuickTime to detect itself.

    You can do this by embedding a QuickTime movie in your main page that automatically redirects people with QuickTime to the desired content page. Add a refresh tag to your Web page to automatically redirect people without QuickTime--either to a download page or an alternate content page.

    Here's a small HTML page (in the SpecialDelivery folder of the CD as Redirect.htm ) that detects whether the viewer has QuickTime 4 or later and redirects the browser accordingly. It works with Internet Explorer or Netscape browsers, versions 3 and later, on Mac OS or Windows (95/98/NT/2000).

    <HTML>
    <HEAD>
    <TITLE>Detect QuickTime</TITLE>
    <META HTTP-EQUIV="Refresh" CONTENT="8;URL=GetQT4.htm">
    </HEAD>

    <BODY>
    <DIV ALIGN="Center">

    <EMBED SRC="GetQT4.qti" TYPE="image/x-quicktime"
    HEIGHT="120" WIDTH="160"
    ALT="You need QuickTime: www.apple.com/quicktime/download"
    QTSRC="Letsgo.mov" HREF="HasQT.htm"
    CONTROLLER="False" AUTOPLAY="True"
    QTNEXT1="HasQT.htm"
    PLUGINSPAGE="http://www.apple.com/quicktime/">

    <P>
    If you have QuickTime 4 or later, you should automatically be taken to our<A HREF="HasQT.htm>main page</A> in 1-2 seconds.
    </P>
    <P>
    If you need to install or configure QuickTime, you should automatically be redirected to our
    <A HREF="GetQT4.htm">download page</A> within 10 seconds...
    </P>
    </DIV>
    </BODY>
    </HTML>

    What it Does

    If viewers have QuickTime 4 or later, this page displays Letsgo.mov for half a second, then loads HasQT.htm in the current browser window.

    If viewers don't have QuickTime, the browser should alert them and offer to take them to www.apple.com/quicktime/download/ .

    If viewers have an old version of QuickTime, they should see UNeedQT4.qti for a few seconds, then be automatically redirected to the GetQT4.htm Web page.

    If viewers get impatient waiting for the redirect, those with QuickTime 4 or later can click the Letsgo.mov movie and jump to the main content page; those who need to get QuickTime can click the text link to the GetQT4.htm page.

    How it Works

    If viewers have QuickTime 4 or later, the QuickTime Plug-in will correctly interpret the parameters
    QTSRC="Letsgo.mov"
    CONTROLLER="False" AUTOPLAY="True"
    QTNEXT1="HasQT.htm"
    to load Letsgo.mov , play it automatically without a controller, then load HasQT.htm in the default browser window.

    Letsgo.mov is a one-frame movie only 1 kilobyte in size and a half-second in duration, so this should happen in the blink of an eye. If not, viewers can click the Letsgo.mov movie; the QuickTime Plug-in will interpret the
    HREF="HasQT.htm"
    parameter and load HasQT.htm in the default browser window immediately.

    If viewers don't have QuickTime, the PLUGINSPAGE parameter should cause the browser to bring up an alert window offering to take them to
    www.apple.com/quicktime/download/ .

    If viewers have an older version of QuickTime, all the <EMBED> parameters will be ignored except SRC , HEIGHT , and WIDTH , so the plug-in should display GetQT4.qti instead of Letsgo.mov .

    GetQT4.qti is an image that directs viewers to the QuickTime download site.

    The <META HTTP-EQUIV="Refresh" CONTENT="8;URL=GetQT4.htm"> tag in the page header should automatically redirect viewers to the GetQT4.htm Web page after 8 seconds, whether they can see UNeedQT4.qti or not. This also acts as a fallback in case the browser ignores the PLUGINSPAGE parameter.

    The 8-second delay before the refresh makes sure that viewers who do have QuickTime 4 have ample time for Letsgo.mov to load and play, even if there's congestion on the network.

    The manual link at the bottom of the page gives impatient viewers a quick way to the download page if they don't have QuickTime, and it acts as a fallback in case the browser fails to execute the automatic refresh.

    Despite being only 25 lines of HTML, this page provides belt-and-suspenders redundancy. I have yet to see it fail under any circumstances.

    GetQT4.qti and Letsgo.mov can both be found in the SpecialDelivery folder of the CD. You're welcome to use them on your own website or CD.

    Variations

    The example page redirects viewers who have QuickTime 4 to a page named HasQT.htm . You should edit both instances of HasQT.htm to point to your main content page.

    The example page redirects viewers who need QuickTime 4 to a page named GetQT4.htm . This is a short Web page which explains that the viewer needs QuickTime 4 or later to experience your website, explains that it's a free download, and includes a link to the Apple download site. It also has help for people who already have QuickTime 4 but were redirected because of a browser problem. GetQT4.htm is also in the SpecialDelivery folder of the CD. You're welcome to use it as-is or edit it to look better in your website.

    Alternately, you can edit the example to point to your own version of a download page, or to an alternate version of your main page that doesn't use QuickTime content, or directly to Apple's QuickTime download page.

    If you're redirecting viewers without QuickTime to a non-QuickTime page, delete the PLUGINSPAGE parameter from the <EMBED> tag.

    It's also possible to use a combination of JavaScript and VBScript to detect QuickTime, but it's somewhat dependent on the user's browser, operating system, and QuickTime version. For details, see "Useful JavaScripts" (page 139).