Calling any NewMovieFrom... function initiates a series of events that you can monitor by making calls to GetMovieLoadState. The initial load state is always kMovieLoadStateLoading, at least briefly. Eventually the load state changes to either kMovieLoadStateComplete or kMovieLoadStateError. There are often additional intermediate load states.
All NewMovieFrom... functions support asynchronous movie loading. This is controlled by passing a flag when calling the function. When asynchronous loading is enabled, the NewMovieFrom... function returns almost immediately, so that your application is not blocked while QuickTime locates the movie data source, resolves its media sample data references, downloads any necessary files, or performs any necessary import. You need to monitor the progress of the movie loading process by checking the load state periodically by calling GetMovieLoadState.
All NewMovieFrom... functions, including NewMovieFromProperties, load asynchronously only if the newMovieAsyncOK flag is passed (when calling NewMovieFromProperties, this flag is passed in the NewMovieProperties property).
If asynchronous loading is not used, any NewMovieFrom... function blocks until the movie finds and loads all referenced data or the process fails, and the load state resolves to either kMovieLoadStateComplete or kMovieLoadStateError.
The possible load states during asynchronous movie loading are these:
kMovieLoadStateLoading—QuickTime still instantiating the movie.
kMovieLoadStatePlayable—movie fully formed and can be played; media data still downloading.
kMovieLoadStatePlaythroughOK—media data still downloading, but all data is expected to arrive before it is needed.
kMovieLoadStateComplete—all media data is available.
kMovieLoadStateError—movie loading failed; a movie may have been created, but it is not playable.
The Download Sequence
Example of Getting a Movie and Monitoring the Load State
Last updated: 2005-08-11