Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

QuickTime XML Importers

QuickTime XML importers create movies based on the contents of certain kinds of XML files saved with the .mov file extension. XML files with the .mov file extension are treated by networks and operating systems as QuickTime movies. For example, these XML files can be embedded in Web pages for the QuickTime browser plug-in or double-clicked from the desktop to invoke QuickTime Player.

Because XML is text-based, these XML files can be created by any application that can output text, such as a text editor or server-side script.

XML importers are invoked automatically when a .mov file is opened in QuickTime Player, the QuickTime plug-in, or by other applications (using functions such as NewMovieFromFile or NewMovieFromDataRef). QuickTime automatically detects the XML header and reads the XML type. If an importer is available for that XML type, QuickTime attempts to create a movie from it.

To work with QuickTime XML importers, XML files must have the following initial syntax:

<?xml version="1.0">
<?quicktime type="xxxx/xxxx"?>

where "xxxx/xxxx" is the XML type, such as "application/smil" or "application/x-quicktime-media-link".

For the movie to open, the XML type must be one for which a QuickTime XML importer is installed.

There are importers for three XML types currently built into QuickTime.

Note that XML importers were introduced and initially documented as part of QuickTime 5. This section provides more complete information about their use and features.

In this section:

SMIL Importer
QuickTime Media Link Importer
Component Preflight Importer
Writing XML Importers


SMIL Importer

The SMIL importer opens SMIL files (.smil) that have a .mov file extension or are delivered over a network with the video/quicktime MIME type. This allows you to direct SMIL files to QuickTime for display (files with the .smil extension are commonly handled by multiple applications, and it is hard to predict which one will be chosen by a given browser or operating system). Note that the XML header information must be prepended to the SMIL file:

<?xml version="1.0">
<?quicktime type="application/smil"?>

For more information about the QuickTime SMIL importer implementation, and the logic behind this implementation, refer to

http://developer.apple.com/techpubs/quicktime/qtdevdocs/REF/QT41_HTML/QT41WhatsNew-13.html

QuickTime Media Link Importer

The QuickTime media link importer opens media link files (.qtl) that have a .mov file extension or video/quicktime MIME type.

QuickTime media link files contain a movie URL and an optional set of parameters, such as loop and full-screen. When delivered over a network, these files are normally directed to QuickTime Player, bypassing the QuickTime browser plug-in because of their file extension (.smil) and MIME type: "application/x-quicktimeplayer". Note that their MIME type is different from their XML type, which is "application/x-quicktime-media-link".

The XML importer for QuickTime media links allows you to open these files using the QuickTime plug-in, because the file extension and MIME type are now .mov and "video/quicktime". This allows you to specify a movie URL for the QuickTime plug-in as part of an external text file which can be modified independently of HTML or any movie. This can be a useful alternative to using alternate movies or SRC= and QTSRC= .

When opened locally from the desktop, rather than over a network or through a browser, both .mov and .qtl files should open in QuickTime Player. The .qtl file extension and MIME type are relatively new, however, and not all Windows or Mac OS systems know what to do with a .qtl file. Changing a file extension from .qtl to .mov can solve this problem by way of the XML importer.

The syntax of QuickTime media link files is always:

<?xml version="1.0">
<?quicktime type="application/x-quicktime-media-link"?>
<embed src="URL" />

The embed tag in a .qtl file can contain additional parameters, such as loop and autoplay. It supports only a few of the parameters that can be specified in the HTML embed tag, however. If you are targeting the QuickTime plug-in, check to be sure you haven’t included unsupported attributes, such as volume.

Two supported .qtl parameters, fullscreen and quitwhendone, are applicable only to QuickTime Player. The QuickTime plug-in ignores them.

For more about QuickTime media links, refer to

http://developer.apple.com/techpubs/quicktime/qtdevdocs/REF/whatsnewqt5/Max.2b.htm

Component Preflight Importer

The component preflight importer works with files of XML type "application/x-qtpreflight". A component preflight XML file should always have the .mov file extension and "video/quicktime" MIME type.

You can use the component preflight importer to test for the presence of specific QuickTime components. QuickTime will offer to automatically download and install any that are needed. This can be a useful filter if your website includes movies that use components not included in the mimimal QuickTime installation or components introduced in a recent release of QuickTime.

The syntax for a component preflight XML file is:

<?xml version="1.0"?>
<?quicktime type="application/x-qtpreflight"?>
<qtpreflight>
<component type="ctyp" subtype="subt"/>
</qtpreflight>

where "ctyp" and "subt" are the actual four-character codes for a component’s type and subtype.

The first three lines are always the same. They let QuickTime know that this is an XML file of type qtpreflight. The last line is always the same. It closes the <qtpreflight> element. In between is the list of components to check for. You can have multiple <component /> elements in your file, and QuickTime will test for all of them.

For example, here’s an XML file that checks for the Sorenson 3 video decompressor and the QuickTime for Java component:

<?xml version="1.0"?>
<?quicktime type="application/x-qtpreflight"?>
<qtpreflight>
<component type="imdc" subtype="SVQ3"/>
<component type="null" subtype="qtj "/>
</qtpreflight>

Note that the type and subtype are four-character codes. They are case-sensitive and a blank space is a significant character. These values must be exactly four characters long, including any spaces.

If any specified components are missing, QuickTime will check to see if they are available for download on Apple’s servers. QuickTime will then open a dialog box, either offering to download and install the missing components or informing the user that the software QuickTime needs in order to play this movie is not available.

All Apple-supplied components, and all approved third-party download components, are available on the Apple servers. An “unavailable software” dialog box is normally the result of an incorrect type or subtype code, or use of a third-party component not registered with Apple.

Components are typically packaged in groups for download. If a component is needed, its parent package is downloaded and installed. For example, the text importer is currently part of the authoring package, so all the authoring components are downloaded and installed if the text importer is needed. While you need to be aware of this, you should not assume that any particular component will be downloaded because another is. The organization and content of download packages is subject to periodic change. It’s a good idea to test for all the components that you need. Don’t worry; if you specify several components in the same package, the package downloads only once.

Typical content creators and website developers have no easy way to determine which components their movies rely on. An application that took a movie or folder of movies as input, and produced a list of required components as an output, would be useful for this purpose, but as of this writing no such application is available.

Following is a list of some components that you might want to check for. Note that the type field identifies the kind of operation the component performs, and the subtype generally identifies the kind of data it operates on. For example, all image decompressors are of type "imdc", and all image compressors are of type "imco". A JPEG compressor or decompressor is of subtype "jpeg", while a Sorenson 3 compressor or decompressor is of subtype "SVQ3".

Component

Type

Subtype

Sorenson 3 video

"imdc"

"SVQ3"

QDesign Music 2 audio

"sdec"

"QDM2

MPEG-4 video

"imdc"

"mp4v"

Lens Flare effect

"imdc"

"lens"

Blur effect (effects generally)*

"imdc"

"blur"

Text importer*

"eat "

"TEXT"

MIDI or QuickTime Music*

"mhlr"

"musi"

ZyGoVideo video*

"imdc"

"ZyGo"

QuickTime for Java*

"null"

"qtj "

*Not in minimum installation

The component preflight importer opens an empty movie. The user is unlikely to know what to do with this, so it’s best to open it in an unobtrusive place. One good solution is to embed it in a Web page in a 2-pixel by 2-pixel rectangle, which is effectively invisible.

Note: The dialog boxes do not rely on the height and width allocated to the plug-in on a Web page, so loading the empty movie in a 2 x 2 rectangle does not affect them.

Writing XML Importers

It is certainly possible to write your own XML import components. Documentation on this is forthcoming.



< Previous PageNext Page > Hide TOC


Last updated: 2002-07-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice