| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/QTKit.framework |
| Availability | Available in Mac OS X v10.4 and later. |
| Declared in | QTMedia.h |
| Related sample code |
The QTMedia class represents a QuickTime media (of type Media). QTMedia objects are associated with QTTrack objects and support methods for getting and setting the media properties. If necessary, you can retrieve the media identifier associated with a QTMedia object by calling its quickTimeMedia method.
– track
– hasCharacteristic:
– attributeForKey:
– setAttribute:forKey:
– mediaAttributes
– setMediaAttributes:
Creates a new QTMedia object with QuickTime media data.
+ (id)mediaWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr
The QuickTime media data with which to initialize the media object.
On return, if the media object could not be created, a pointer to an error indicating the reason for the failure.
The newly created media object.
QTMedia.hReturns the value of the specified media attribute.
- (id)attributeForKey:(NSString *)attributeKey
The key for the desired attribute. Possible attribute keys are listed in “Media Attributes.”
The value of the specified attribute.
QTMedia.hReturns whether the media has the specified characteristic.
- (BOOL)hasCharacteristic:(NSString *)characteristic
The characteristic being tested. Possible characteristics are listed in “Media Characteristics.”
YES if the media has the specified characteristic, NO otherwise.
QTMedia.hInitializes a new QTMedia object with QuickTime media data.
- (id)initWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr
The QuickTime media data with which to initialize the media object.
On return, if the media object could not be created, a pointer to an error indicating the reason for the failure.
The newly initialized media object.
QTMedia.hReturns a dictionary containing all of the media’s attributes.
- (NSDictionary *)mediaAttributes
A dictionary containing all of the media’s attributes.
Possible attribute keys are listed in “Media Attributes.”
QTMedia.hReturns the QuickTime media associated with the media object.
- (Media)quickTimeMedia
The QuickTime media associated with the media object.
QTMedia.hSets the value of the specified media attribute.
- (void)setAttribute:(id)value forKey:(NSString *)attributeKey
The new value for the specified attribute.
The key for the attribute to set. Possible attribute keys are listed in “Media Attributes.”
QTMedia.hSets the media’s attributes using the values from the supplied dictionary.
- (void)setMediaAttributes:(NSDictionary *)attributes
A dictionary containing the new attribute keys and values.
Possible attribute keys are listed in “Media Attributes.”
QTMedia.hReturns the QTTrack object that contains the media.
- (QTTrack *)track
The QTTrack object that contains the media.
QTMedia.hConstants for different media types. Compare these constants with the value associated with the QTMediaTypeAttribute key.
NSString * const QTMediaTypeVideo; NSString * const QTMediaTypeSound; NSString * const QTMediaTypeText; NSString * const QTMediaTypeBase; NSString * const QTMediaTypeMPEG; NSString * const QTMediaTypeMusic; NSString * const QTMediaTypeTimeCode; NSString * const QTMediaTypeSprite; NSString * const QTMediaTypeFlash; NSString * const QTMediaTypeMovie; NSString * const QTMediaTypeTween; NSString * const QTMediaType3D; NSString * const QTMediaTypeSkin; NSString * const QTMediaTypeQTVR; NSString * const QTMediaTypeHint; NSString * const QTMediaTypeStream; NSString * const QTMediaTypeMuxed; NSString * const QTMediaTypeQuartzComposer;
QTMediaTypeVideoVideo media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeSoundSound media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeTextText media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeBaseBase media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeMPEGMPEG media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeMusicMusic media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeTimeCodeTimecode media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeSpriteSprite media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeFlashFlash media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeMovieMovie media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeTweenTween media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaType3D3D media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeSkinSkin media
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeQTVRQuickTime VR media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeHintHint media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeStreamStream media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeMuxedMultiplexed audio and video media.
Available in Mac OS X v10.5 and later.
Declared in QTMedia.h.
QTMediaTypeQuartzComposerQuartz Composer media.
Available in Mac OS X v10.5 and later.
Declared in QTMedia.h.
Characteristics of a given media. You can query for these characteristics using the hasCharacteristic: method.
NSString * const QTMediaCharacteristicVisual; NSString * const QTMediaCharacteristicAudio; NSString * const QTMediaCharacteristicCanSendVideo; NSString * const QTMediaCharacteristicProvidesActions; NSString * const QTMediaCharacteristicNonLinear; NSString * const QTMediaCharacteristicCanStep; NSString * const QTMediaCharacteristicHasNoDuration; NSString * const QTMediaCharacteristicHasSkinData; NSString * const QTMediaCharacteristicProvidesKeyFocus; NSString * const QTMediaCharacteristicHasVideoFrameRate;
QTMediaCharacteristicVisualThe media has video data.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicAudioThe media has audio data.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicCanSendVideoThe media can send visual data to another track.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicProvidesActionsThe media has actions.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicNonLinearThe media is non-linear.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicCanStepThe media can step.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicHasNoDurationThe media has no duration.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicHasSkinDataThe media has skin data.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicProvidesKeyFocusKey events can be focused at the media.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaCharacteristicHasVideoFrameRateThe media has a video frame rate.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
The following constants are keys for the media attributes that you can get and set using the mediaAttributes and setMediaAttributes: methods. To get or set a single attribute, use attributeForKey: or setAttribute:forKey:.
NSString * const QTMediaCreationTimeAttribute; NSString * const QTMediaDurationAttribute; NSString * const QTMediaModificationTimeAttribute; NSString * const QTMediaSampleCountAttribute; NSString * const QTMediaQualityAttribute; NSString * const QTMediaTimeScaleAttribute; NSString * const QTMediaTypeAttribute;
QTMediaCreationTimeAttributeThe creation time. The value for this key is of type NSDate.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaDurationAttributeThe duration. The value for this key is of type NSValue, interpreted as a QTTime.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaModificationTimeAttributeThe modification time. The value for this key is of type NSDate.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaSampleCountAttributeThe media sample count. The value for this key is of type NSNumber, interpreted as a long.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaQualityAttributeThe media quality. The value for this key is of type NSNumber, interpreted as a short.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTimeScaleAttributeThe media time scale. The value for this key is of type NSNumber, interpreted as a long.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
QTMediaTypeAttributeThe media type. The value for this key is of type NSString. See “Media Types” for the values this attribute can return.
Available in Mac OS X v10.3 and later.
Declared in QTMedia.h.
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-04)