There are four ways you can embed a SMIL document in a Web page so that it plays in QuickTime Player or the QuickTime plug-in:
Use the QTSRC parameter.
Save the SMIL document as a .mov file.
Make a Fast Start reference movie.
Target the SMIL document to QuickTime Player using HREF or QTNEXT.
Important: Other browser plug-ins, such as RealPlayer and Windows Media Player, also use SMIL, but support a different set of media elements. The viewer’s browser may be configured to use any of these plug-ins for .sml files. To be sure that QuickTime handles your SMIL document, use one of the techniques described in this section.
It’s also important for your webmaster to configure your Web server to associate the .sml file extension with the MIME type application/smil. Otherwise, the browser may treat the SMIL document as a text file. This is a fairly common problem, because SMIL documents are text files.
Using QTSRC
Saving a SMIL Document as a .mov File
QuickTime Media Links XML Importer
Making a Fast Start Reference Movie
Targeting QuickTime Player
The <EMBED> tag’s QTSRC parameter is the ideal way to pass a SMIL document to QuickTime. The SRC parameter should point to a small movie consisting of a single image that says “You need QuickTime 4.1 or later to see this movie.”
The HTML looks like this:
<EMBED SRC="UNeedQT41.mov" HEIGHT=256 WIDTH=320 |
QTSRC="smil1.smi"> |
Set the height and width to the dimensions of your SMIL presentation, adding 16 to the height for the movie controller. The usual plug-in parameters, such as AUTOSTART="True" and CONTROLLER="False", work normally.
Remember, the movie controller won’t have a Time slider unless you specify one using qt:time-slider="true" in the SMIL presentation. See “QuickTime SMIL Extensions” for details.
If your SMIL presentation is a different height or width from the movie specified in the SRC parameter, use the larger dimensions as your height and width, and set a background color using the BGCOLOR parameter to fill any gaps.
As long as the viewer’s browser is configured to use QuickTime for .mov files, the QuickTime plug-in is called when a .mov file is specified in the SRC parameter. If the viewer has a current version of the QuickTime plug-in, QuickTime plays the SMIL presentation specified in the QTSRC parameter. If the viewer has an older version of QuickTime, or the viewer’s browser is configured to use a different plug-in for .mov files, the viewer sees the single image movie instead.
A SMIL document is really a text file. Saving it with the .sml file extension is a way to let the Web server and the browser know that it describes a SMIL presentation. Saving or renaming the same file with the .mov file extension normally causes the browser to use the QuickTime plug-in to handle the file. Add the eight-character string SMILtext to the beginning of the file so QuickTime knows what it is.
Important: The first eight characters of the file must be SMILtext in order for QuickTime to successfully import a SMIL file saved with the .mov file extension: <smil> becomes SMILtext <smil>.
The HTML looks like this:
<EMBED SRC="smil1.mov" HEIGHT=256 WIDTH=320> |
Set the height and width to the dimensions of your SMIL presentation, adding 16 to the height for the movie controller. All the optional parameters work normally.
The main disadvantage to this technique is that there’s no fallback movie if the viewer doesn’t have QuickTime 4.1 or later installed, or has Windows Media Player configured to handle .mov files.
Make sure your Web page has a “Get QuickTime” button if you use this method, and this shouldn’t be too much of a problem.
QuickTime 5 introduces support for a new XML importer––QuickTime Media Links. This is a small XML file that has similar attributes to the embed tag in HTML used for the plug-in, but targets QuickTime Player instead of the plug-in. This section discusses the supported attributes and values, and how to create the file.
To work with the new QuickTime Media Links XML importer, you create a text file with the following two lines at the top of the file:
<?xml version="1.0"?> |
<?quicktime type="application/x-quicktime-media-link"?> |
Next, you add the embed tag itself:
<embed src="http://somewhere.com/Movies/test.mov" /> |
The following attributes and values are supported:
autoplay - true/false |
controller - true/false |
fullscreen - normal/double/half/current/full |
href - url |
kioskmode - true/false |
loop - true/false/palindrome |
movieid - integer |
moviename - string |
playeveryframe - true/false |
qtnext - url |
quitwhendone - true/false |
src - url (required) |
type - mime type |
volume - 0 (mute) - 100 (max) |
Note the following:
The qtnext attribute only supports one URL (unlike the plug-in).
All attributes require values (unlike the plug-in). Thus, the following is valid:
<embed src="http://somewhere.com/Movies/test.mov" autoplay="true" /> |
while this (although valid in HTML) is not:
<embed src="http://somewhere.com/Movies/test.mov" autoplay /> |
Only a subset of the possible attributes, however, need to be specified at once.
Support for the XML importer is packaged in a movie importer ('eat ' component) and is designed to work in any QuickTime-aware application. However, there is currently no file type or file extension associated with this type. Instead, the importer is found by using the MIME type when embedded in a XML movie. The MIME type is found in the line:
<?quicktime type="application/x-quicktime-reference"?> |
The purpose of this embed format is to serve as a text link that can be opened in QuickTime Player. Currently, the text link format (.qtl) is configured by the MIME settings panel to be specially routed to QuickTime Player and is never seen by the plug-in.
This format allows QuickTime Player to basically open the reference file and then set the appropriate attributes. There is no movie media involved as there is with SMIL.
The format can be used to author a movie with the specified options. Thus, in order to create a movie with the fullscreen and autoplay options set, you could create a file like the following, import it, and then save the resulting movie self-contained:
<?xml version="1.0"?> |
<?quicktime type="application/x-quicktime-media-link"?> |
<embed src="http://somewhere.com/Movies/test.mov" autoplay="true" |
fullscreen="double"/> |
Keep in mind that this is XML, and not HTML. Don’t forget the trailing "/>" in the embed line.
You can open a SMIL document in QuickTime Player and save it as a self-contained movie. This creates a Fast Start movie that you can double-click from the desktop or embed in a Web page.
A Fast Start movie created this way typically has several tracks. The display area defined in the SMIL document’s root-layout element becomes a video track with the specified background color, and each media element in the SMIL document becomes a movie track with a URL data reference. The tracks are arranged in time and space as the SMIL document describes.
The media elements are not copied into the Fast Start movie, only their URLs. If your SMIL document uses relative URLs, you need to maintain the same relative path between the Fast Start movie and its media elements as existed between the original SMIL document and the media elements.
When the Fast Start movie is played in the QuickTime plug-in or QuickTime Player, each URL is resolved as needed. Embed it in a Web page as you would any Fast Start movie:
<EMBED SRC="smil1.mov" HEIGHT=256 WIDTH=320> |
Set the height and width to the dimensions of the movie, adding 16 to the height for the movie controller. All the optional parameters work normally.
The main advantage to this technique is that you can manipulate the SMIL presentation as a QuickTime movie in all the usual ways; set it to autoplay or play at double size in QuickTime Player, add locally stored tracks, or use Plug-in Helper to copy-protect the movie. In addition, the URLs of your media elements are concealed from the casual observer (it’s possible to ferret them out by doing an ASCII dump of the movie file, but they’re no longer in plain text).
Note: If you want to edit the movie using QuickTime Player’s editing features—to add a chapter list for example—you must set qt:time-slider="true" in the SMIL document before importing it. QuickTime Player’s editing features rely on the Time slider.
The main disadvantage of using a Fast Start movie is that you can’t edit or create it using a text editor or the text output of a script. You need to edit or create the SMIL document, import it into QuickTime Player, and save it. It’s an extra step.
The other disadvantage is the lack of a fallback movie for people with versions of QuickTime prior to 4.1.
You can specify an ordinary QuickTime movie in the SRC parameter and link it to a SMIL document using the HREF or QTNEXT parameter. As long as you specify TARGET="quicktimeplayer", the URL is handled directly by QuickTime, so the browser won’t misdirect it to a different player.
If you use a poster movie and the HREF parameter, the HTML looks like this:
<EMBED SRC="poster.mov" HEIGHT=160 WIDTH=120 |
AUTOSTART="False" CONTROLLER="False" |
HREF="smil1.smi" TARGET="quicktimeplayer"> |
Set the height and width to the dimensions of the poster. When someone clicks the poster, the SMIL document loads in QuickTime Player as a movie. Playing the movie causes QuickTime Player to fetch the media elements as needed.
If you want to launch a SMIL presentation in QuickTime Player without making the viewer click a poster, you can use QTNEXT instead of HREF. The HTML looks like this:
<EMBED SRC="Launch.mov" HEIGHT=320 WIDTH=240 |
AUTOSTART="True" CONTROLLER="False" |
QTNEXT1="smil1.smi" TARGET="quicktimeplayer" > |
Set the height and width to the dimensions of Launch.mov, which can optionally be an audio-only movie, and hidden (HIDDEN="True"). Launch.mov automatically plays in the QuickTime browser plug-in, then launches the SMIL presentation in QuickTime Player, outside the browser.
The main advantage to this approach is that the SMIL presentation takes place outside the browser, so you’re not constrained by the size or appearance of the browser window.
The main disadvantage to this technique is the lack of a fallback movie.
Last updated: 2002-10-01