What's New in QuickTime 4.1
| Previous | Chapter Contents | Chapter Top | Next |
QuickTime 4.1 introduces the mechanism of asynchronous movie loading.
There are a number of advantages to using this mechanism. With asynchronous movie loading, the QuickTime Player allows the command Open URL... to return almost immediately. Then, as the URL data becomes available, the movie becomes playable. To the user, the introduction of asynchronous movie loading can mean a more responsive system. To the developer, it can mean more time to do things while a movie loads over a slow link.
With movies loading asynchronously, the difference in user experience within QuickTime Player centers on the time before the movie data has actually been located and processed. Instead of a fully formed movie being immediately available and playable, the Player window displays the message Loading... until such time as the movie resource is actually located or the file has been imported. At that point, the window can resize, auto play can occur if necessary, and other choices about the movie and the controller can be made.
The Movie Media Handler also takes advantage of this feature.
In the context of asynchronous movie loading, the following items should be noted:
While the loading of the local reference movie is quick, the total movie loading process will use asynchronous loading, since portions of the loading process require it.
Aside from a more responsive system, the fundamental change for the developer that asynchronous loading brings is that the NewMovieFrom ... function will return a valid movie, but that movie may be completely empty, i.e., it may contain no tracks, user data, and so on. At some point, when the movie resource is found or the file has been imported all of this information is then available. Typically, a developer may need to defer querying of the movie for properties, userdata, and other characteristics until that time.
To enable asynchronous loading when opening a movie, you pass the additional flag
newMovieAsyncOK = 1 << 8
to NewMovieFromDataRef , NewMovieFromFile , and so on. Passing this flag does not require that the loading be performed asynchronously, but only allows it to be so.
Without newMovieAsyncOK , calling one of the NewMovieFrom ... calls either returns a fully formed movie or an error -- blocking until either can be satisfied. With newMovieAsyncOK , there is a period between the return from NewMovieFrom ... and the time when the movie is fully formed.
| Previous | Chapter Contents | Chapter Top | Next |