Retired Document
Important: This document may not represent best practices for current development. Links to downloads and other resources may no longer be valid.
Movies - Saving movie playback hints
Q:
I'd like my application to offer the user an option to turn on/off the High Quality preference for the Video Track and save the preference so QuickTime player will respect it when these movies are later opened. Using SetMoviePlayHints
doesn't seem to do this.
A: There's four APIs you'll need to use to do this. They are SetMediaPlayHints
, GetTrackLoadSettings
, SetTrackLoadSettings
and UpdateMovieInStorage
(or UpdateMovieResource
on Windows).
Listing 1 Turning High Quality on and off.
// toggle HQ on/off - remember to update the Movie storage to save the setting |
void ToggleHighQualityOnOff(Track inTrack) |
{ |
long trackHints; |
long ignore1, ignore2, ignore3; |
GetTrackLoadSettings(inTrack, &ignore1, &ignore2, &ignore3, &trackHints); |
trackHints ^= hintsHighQuality; // on/off and so on or off |
SetTrackLoadSettings(inTrack, ignore1, ignore2, ignore3, trackHints); |
SetMediaPlayHints(GetTrackMedia(inTrack), trackHints, hintsHighQuality); |
} |
The above listing will toggle the High Quality hint for playback and modify the load settings but will not save the setting. To actually save the setting, you'll need to update the Movie by calling UpdateMovieInStorage
or UpdateMovieResource
sometime after calling this function as is appropriate for your application.
Document Revision History
Date | Notes |
---|---|
2004-09-14 | New document that explains how to save and load media play hints from Movie files. |
Copyright © 2004 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2004-09-14