QuickTime 4.1
Apple Technical Publications
January 2000
Apple Computer, Inc. Apple, the Apple logo, FireWire, Mac, LIMITED WARRANTY ON MEDIA AND © 2000 Apple Computer, Inc. Macintosh, and QuickTime are REPLACEMENT All rights reserved. trademarks of Apple Computer, Inc., ALL IMPLIED WARRANTIES ON THIS No part of this publication or the registered in the United States and other MANUAL, INCLUDING IMPLIED software described in it may be countries. WARRANTIES OF MERCHANTABILITY reproduced, stored in a retrieval system, The QuickTime logo is a trademark of AND FITNESS FOR A PARTICULAR or transmitted, in any form or by any Apple Computer, Inc. PURPOSE, ARE LIMITED IN DURATION means, mechanical, electronic, Adobe, Acrobat, Photoshop, and TO NINETY (90) DAYS FROM THE DATE photocopying, recording, or otherwise, PostScript are trademarks of Adobe OF DISTRIBUTION OF THIS PRODUCT. without prior written permission of Systems Incorporated or its subsidiaries Even though Apple has reviewed this Apple Computer, Inc., except in the and may be registered in certain manual, APPLE MAKES NO WARRANTY normal use of the software or to make a jurisdictions. OR REPRESENTATION, EITHER EXPRESS backup copy of the software or Flash is a trademark of Macromedia OR IMPLIED, WITH RESPECT TO THIS documentation. The same proprietary Incorporated. MANUAL, ITS QUALITY, ACCURACY, and copyright notices must be affixed to MacPaint is a trademark of Apple MERCHANTABILITY, OR FITNESS FOR A any permitted copies as were affixed to Computer, Inc., registered in the U.S. PARTICULAR PURPOSE. AS A RESULT, the original. This exception does not and other countries. THIS MANUAL IS DISTRIBUTED “AS IS,” allow copies to be made for others, AND YOU ARE ASSUMING THE ENTIRE whether or not sold, but all of the Helvetica and Palatino are registered trademarks of Linotype-Hell AG and/or RISK AS TO ITS QUALITY AND material purchased (with all backup ACCURACY. copies) may be sold, given, or loaned to its subsidiaries. another person. Under the law, copying Indeo and Intel are registered IN NO EVENT WILL APPLE BE LIABLE includes translating into another trademarks of Intel. FOR DIRECT, INDIRECT, SPECIAL, language or format. You may use the ITC Zapf Dingbats is a registered INCIDENTAL, OR CONSEQUENTIAL software on any computer owned by trademark of International Typeface DAMAGES RESULTING FROM ANY you, but extra copies cannot be made for Corporation. DEFECT OR INACCURACY IN THIS this purpose. MANUAL, even if advised of the possibility of such damages. The Apple logo is a trademark of Apple PowerPC and the PowerPC logo are Computer, Inc. Use of the “keyboard” trademarks of International Business THE WARRANTY AND REMEDIES SET Apple logo (Option-Shift-K) for Machines Corporation, used under FORTH ABOVE ARE EXCLUSIVE AND IN commercial purposes without the prior license therefrom. LIEU OF ALL OTHERS, ORAL OR written consent of Apple may constitute WRITTEN, EXPRESS OR IMPLIED. No trademark infringement and unfair Apple dealer, agent, or employee is competition in violation of federal and Simultaneously published in the United authorized to make any modification, state laws. States and Canada. extension, or addition to this warranty. No licenses, express or implied, are Printed in the United States of America. Some states do not allow the exclusion or granted with respect to any of the limitation of implied warranties or liability technology described in this book. for incidental or consequential damages, so Apple retains all intellectual property the above limitation or exclusion may not rights associated with the technology apply to you. This warranty gives you described in this book. Every effort has specific legal rights, and you may also have been made to ensure that the other rights which vary from state to state. information in this manual is accurate. Apple is not responsible for printing or clerical errors. Apple Computer, Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010
Contents
Summary of Changes and Enhancements 9 SMIL Support 11 SMIL Usage 11 A Simple Sequence 12 A Sequence with HREF, Region and Background Text 13 QuickTime SMIL Extensions 14 Namespace Specification 15 SMIL Root Element Attributes 15 Media Object Attributes 17 Anchor-Tag and A-Tag Attributes 19 References 19 SMIL Importer Implementation 20 How It Works 20 Not Instantiating Media at Import Time 20 A New Movie Media Track 21 Movie Media Track Usage 21 Movie Media Handler 22 Sample Description 22 Sample Format 22 New Movie Media Handler APIs 28 New Movie Media Handler APIs to Handle Data References 30 Movie Media Handler Tasks 31 Using the Streaming Media Handler 32 A Note to Authors of Media Handlers 32 Support for Data URLs 33 URLs in Text Tracks 35 New Embed Tags 35 URLSUBSTITUTE Embed Tag 36 How It Works 36 AUTOHREF Embed Tag 37
3
QTSRCDONTUSEBROWSER Embed Tag 37 Support for an HTML Importer 37 How It Works 38 Additional Notes 39 Support for HTTP Streaming 40 New HTTP Streaming Functionality 40 Additional Cookie Support 42 64-bit File Offset Support for Mac OS 9 43 New Features For Creating More Interactive Movies 44 Introducing Embedded Movies 44 Creating New Types of QuickTime Movies 44 Using Embedded Movies 45 Dynamically Loading New Embedded Movies from URLs 46 Triggering Wired Actions When an Embedded Movie is Loaded 47 Targeting Elements of Embedded Movies with All Existing Wired Actions 47 New Movie Track and Movie Wired Actions 49 New Wired QT Event 50 Extended Wired Operand Functionality 50 Wired Actions and JavaScript 50 Added Flash Support 51 New Target Type Atoms for Hierarchical Movies 51 Example #1 53 Example #2 53 New Movie Property Atom Toolbox Routines 54 New Movie Controller Actions 54 Custom Wired Actions 55 Custom Action Handler Usage 56 Authoring Custom Wired Actions 57 Extension to Wired Movie Format: Executing Custom Actions 57 New Wired Actions 57 New Wired Operands 58
4
Writing a Custom Action Handler Component 58 The Action Being Executed 60 Fetching the Parameters 60 API Additions 62 Support for Playback of VBR Audio 62 Changes to Graphics Importers 62 New Anchor Data Reference 63 A New Data Handler Routine 63 Support for M3U Playlists and .CEL Files 64 JavaScript Support 64 Movie Commands 64 Movie Properties 65 Track Properties 72 Sprite Track Properties 72 QuickTime VR Movie Properties 73 Plug-in Properties 73 QuickTime Properties 74 Sample JavaScript Usage 75 Introduction of Asynchronous Movie Loading 77 A Change in the Loading Model 79 GetMovieStatus Updated 81 Other API Additions 82 Support for Playback of VBR Audio 82 Background 82 VBR-Supported Features 83 New Sound Manager APIs 83 Working with SoundConverterFillBuffer 86 Writing the SoundConverterFillBufferData Routine 88 Sound.h Updated 89 SoundMediaGetSource 89 API Changes 89 ExtendedSoundComponentData 90 ExtendedSoundParamBlock 91 ExtendedScheduledSoundHeader 92
5
Changes to QuickTime for Java 95 Deprecation of AWT Dependencies 95 A New Event Model and Suite of New Classes 96 New Mouse Controllers 97 New DragAdaptor and TranslateMatrix Classes 97 The quicktime.app.ui Package 98 New QTButton Sample Code 98 Support for QuickTime 4 APIs 98 New Additions 99 Support for Text Drawing 99 AppleScript Support 100 QuickTime Player Standard Suite terms 100 The close command 101 The count command 101 The exists command 102 The open command 102 The print command 103 The quit command 103 The save command 103 QuickTime Player Suite terms 104 The can export command 104 The export command 105 The find command 107 The open location command 107 The play command 108 The present command 108 The rewind command 109 The select command 109 The select all command 109 The select none command 110 The step backward command 110 The step forward command 110 The stop command 111 QuickTime Player Classes 111 The annotation class 111 The application class 113 The favorite class 115
6
The file class 116 The internet location class 117 The movie class 117 The track class 122 The window class 125
7
8
What’s New in QuickTime 4.1 1
This document provides you with a list of changes from QuickTime 4 to QuickTime 4.1, as well as new features and capabilities available in this software release. It is intended to supplement the information provided in the QuickTime 4 API Reference. If you are a QuickTime API-level developer or a QuickTime content creator or provider, you should read this document. For QuickTime developer documentation, refer to
Summary of Changes and Enhancements 1
The primary focus of the QuickTime 4.1 release is to provide advertising insertion capability for QuickTime content providers and firewall support for QuickTime end users. A number of additional features and enhancements have also been included in this release. These are intended to benefit both content providers and end users. In brief, QuickTime 4.1 includes the following changes: Added 64-bit file support for Mac OS 9, which enables recording and playback of movie files larger than 2 gigabytes (2G) on Mac OS 9. Added support for Synchronized Multimedia Integration Language (SMIL), a simple, text-based format defined by W3C
Summary of Changes and Enhancements 9
RELEASE 1.0
What’s New in QuickTime 4.1
insert advertising content in a sequence of streams, using QuickTime 4.1’s implementation of the SMIL standard. Added the capability of movies to embed other movies as a track, which means that movies may now contain other movies which may have independent clocks. This is accomplished by means of a new Movie Media Handler API. The addition of variable bit rate (VBR) support for MP3 and MP3 playlists via M3U files. Improved navigation through firewalls. The QuickTime Settings control panel has additional options for Streaming Proxy settings and a new Streaming Transport panel. Users may click the Auto Configure button in the Streaming Transport panel. AppleScript support (on Mac OS). Developers and scripters can now use AppleScript and QuickTime Player to automate tasks. AppleScript support provides Macintosh content creators with the capability to automate distribution and playback of QuickTime content. Access to sites requiring authentication, e.g., pay-per-view sites. New wired actions and events for creating more advanced, interactive wired movies. Additions and changes to QuickTime for Java, including deprecation of AWT dependencies and the addition of two new packages. Changes to the QuickTime VR controller, so that buttons now match the standard QuickTime controller. JavaScript support now includes the capability of accessing the QuickTime Plug-in, thus enabling you to control the Plug-in via JavaScript methods. Elimination of support for 68K Macintosh computers. However, QuickTime movies running under 68K Macintosh computers still work. QuickTime 4.1 now only supports Power PC computers and Mac OS 7.5.5 or later, in addition to Windows 95, Windows 98, and Windows NT. Note that QuickTime 4.1 is still backward compatible and plays all existing QuickTime movies.
10 Apple Summary of Changes and Enhancements
RELEASE 1.0
What’s New in QuickTime 4.1
SMIL Support 1
SMIL is a simple, text-based language that allows content creators and providers to mix and synchronize multimedia elements. This capability, now supported in QuickTime 4.1, enables content authors and developers to incorporate, for example, advertising clips into stored and live streams of QuickTime movies. SMIL, derived from XML, describes the temporal and spatial layouts of media clips within media presentations. It also allows the optional specification of hyperlinks for each clip. Because SMIL elegantly describes simple sequences and because it uses a familiar HTML-like syntax for specifying hyperlinks, it is ideal for the purpose of advertising insertion.
Note The complete SMIL specification is available at
SMIL Usage 1 Using the SMIL capability provided in QuickTime 4.1, you can generate a SMIL document that will trigger a sequence to play audio, video, animated GIFs, or any other QuickTime-supported media. This sequence can be used for advertising messages. An ad can be, for example, an audio clip, a video clip, an animated GIF, a fast-start QuickTime movie, or a streamed movie. Any media type that QuickTime can import is allowable as an ad. A sequence of media content, including ads and either the stored or live stream, is described within a SMIL document.
SMIL Support 11
RELEASE 1.0
What’s New in QuickTime 4.1
Playback and performance of media clips are designed to be as smooth as possible. Whenever there is sufficient network bandwidth to handle the requirements of the content used, transitions between different media are seamless. QuickTime delays opening the connection to the media on the server until as late as possible before displaying the media, so that servers can reliably count the hits. From a server-side application, SMIL documents can be customized for a particular user. You can also define the content of the sequence dynamically. This capability is similar to a playlist, but unlike playlists, you can specify the spatial and temporal characteristics of the sequence. For example, SMIL may be used in the following context. An end user clicks on a link in a Web browser or in a movie in QuickTime Player and then a server decides what will be the right sequence of media to present. In order to accomplish this, the server may generate a SMIL document via CGI or some other mechanism. The SMIL document may be a sequence of media, such as an advertisement followed by other content.
A Simple Sequence 1 In the example in Listing 1, an image starts by displaying a logo in JPEG format for five seconds. It then plays streaming video, which is a stored stream. This particular SMIL document does not specify the duration, which means that it will play for its entire length. Once it has finished, it will display the very same JPEG image at the end. Using this simple sequence, you could wrap or bracket a stream, for example, with your company logo.
Listing 1 A SMIL file displaying a JPEG image for five seconds, then playing a VOD stream to the end of the movie, followed by displaying a JPEG image without duration
12 Apple SMIL Support
RELEASE 1.0
What’s New in QuickTime 4.1
Simple sequences are very easy to create. In the body of a SMIL document, you can explicitly state that this is a sequence by using the
A Sequence with HREF, Region and Background Text 1 In the example in Listing 2, a streamed video of known duration that is hyperlinked is displayed for its entire duration, followed by a live video stream. In this more complex example, you specify a background color that defines a single region with a width and height. This one defines several regions and is more elaborate about the layout. It tells you that the overall presentation should be a certain size, the background color should be a certain value, and within the root layout you have several other regions which you use in playback. In this example, the playback is at 100 percent of the width and height. The result is an iBook commercial that appears first via RTSP. If you click in the content region during its duration, you invoke the URL in a browser window, launching the browser if it is not already open. Once the iBook commercial is finished, it is followed by the Apple PowerMac G4 tanks commercial via RTSP.
SMIL Support 13
RELEASE 1.0
What’s New in QuickTime 4.1
Listing 2 A SMIL file displaying a streamed video of known duration, which is click- through enabled (hyperlinked), followed by a live video stream
It is possible to extend these examples and introduce more elaborate spatial and temporal layouts, so that you can make more than one thing happen at a time. You can have sequences within hierarchies, for example.
QuickTime SMIL Extensions 1
This section discusses the extensions to SMIL (Synchronized Multimedia Integration Language) 1 that are implemented as part of the SMIL support provided in QuickTime 4.1. SMIL being an XML markup language 2, it describes the XML Namespace 3 under which the extensions are grouped; it also describes the extensions themselves –– grouped according to the SMIL
14 Apple QuickTime SMIL Extensions
RELEASE 1.0
What’s New in QuickTime 4.1
elements they may be used in conjunction with –– their syntax, and example usage. The QuickTime SMIL Extensions allow an author to optionally specify richer behaviors which are supported by QuickTime but do not have an SMIL equivalent; they also give the author tighter control over the behavior of the playback of SMIL presentations across bandwidth-constrained network connections.
Namespace Specification 1 These extensions to SMIL are described in a separate namespace from SMIL and must be referenced explicitly by any SMIL document that wants to take advantage of them. The namespace URL is
which must be used as an attribute to any SMIL element. Nsprefix (the selected namespace prefix) may be any character string which conforms to the requirements for an XML name. Once the namespace has been referenced by a SMIL element, that element itself or any elements within it may legally use the names defined in the namespace, and the usage is as follows: nsprefix:qt_attribute = attribute_value
In general, it is simplest to place the xmlns reference as the first attribute in the root
SMIL Root Element Attributes 1 The QuickTime SMIL Extensions define the following additional attributes for the
QuickTime SMIL Extensions 15
RELEASE 1.0
What’s New in QuickTime 4.1