Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

QTMedia Class Reference

Inherits from
Conforms to
Framework
QTKit.framework
Availability
Available in Mac OS X v10.4 and later.
Declared in
QTMedia.h

Overview

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. Note that a track has a single media.

Tasks

Creating a QTMedia

Initializing a QTMedia

Getting Media Properties

Setting Media Properties

Getting QTMedia Primitives

Class Methods

mediaWithQuickTimeMedia:error:

+ (id)mediaWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr

Discussion

Creates a QTMedia object with data from the QuickTime media media. If a QTMedia object cannot be created, an NSError object is returned in the location pointed to by errorPtr. Pass NIL if you do not want an NSError object returned.

Availability
Declared In
QTMedia.h

Instance Methods

attributeForKey:

- (id)attributeForKey:(NSString *)attributeKey

Discussion

Returns the current value of the media attribute attributeKey. A list of supported media attributes and their acceptable values can be found in “Constants.”

Availability
Declared In
QTMedia.h

hasCharacteristic:

- (BOOL)hasCharacteristic:(NSString *)characteristic

Discussion

Returns YES if a QTMedia object has the specified characteristic. See the list of constants given in “Constants” for the characteristics you can query.

Availability
Declared In
QTMedia.h

initWithQuickTimeMedia:error:

- (id)initWithQuickTimeMedia:(Media)media error:(NSError **)errorPtr

Discussion

Initializes a newly created QTMedia object with data from the QuickTime media media. If a QTMedia object cannot be created, an NSError object is returned in the location pointed to by errorPtr. Pass NIL if you do not want an NSError object returned.

Availability
Declared In
QTMedia.h

mediaAttributes

- (NSDictionary *)mediaAttributes

Discussion

Returns a dictionary containing the current values of all defined media attributes. A list of supported media attributes and their acceptable values can be found in “Constants.”

Availability
Declared In
QTMedia.h

quickTimeMedia

- (Media)quickTimeMedia

Discussion

Returns the QuickTime media associated with a QTMedia object.

Availability
Declared In
QTMedia.h

setAttribute:forKey:

- (void)setAttribute:(id)value forKey:(NSString *)attributeKey

Discussion

Set the media attribute attributeKey to the value specified by the value parameter. A list of supported media attributes and their acceptable values can be found in “Constants.”

Availability
Declared In
QTMedia.h

setMediaAttributes:

- (void)setMediaAttributes:(NSDictionary *)attributes

Discussion

Set the media attributes using the key-value pairs specified in the dictionary attributes. A list of supported media attributes and their acceptable values can be found in “Constants.”

Availability
Declared In
QTMedia.h

track

- (QTTrack *)track

Discussion

Returns the QTTrack that contains a QTMedia object.

Availability
Declared In
QTMedia.h

Constants

The following constants specify 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:.

Note: The QTMediaTypeAttribute attribute indicates the type of media data contained in a QTMedia object. These constants are used to indicate media types, as shown in the portion of the table beginning with the QTMediaTypeVideo constant.

Constant

Description

QTMediaCreationTimeAttribute

The creation time of a QTMedia object; the value for this key is of type NSDate.

QTMediaDurationAttribute

The duration of a QTMedia object; the value for this key is of type NSValue, interpreted as a QTTime.

QTMediaModificationTimeAttribute

The modification time of a QTMedia object; the value for this key is of type NSDate.

QTMediaSampleCountAttribute

The media sample count; the value for this key is of type NSNumber, interpreted as a long.

QTMediaQualityAttribute

The media quality; the value for this key is of type NSNumber, interpreted as a short.

QTMediaTimeScaleAttribute

The media time scale; the value for this key is of type NSNumber, interpreted as a long.

QTMediaTypeAttribute

The media type; the value for this key is of type NSString; see below for the values this attribute can return.

QTMediaTypeVideo

Video media.

QTMediaTypeSound

Sound media.

QTMediaTypeText

Text media.

QTMediaTypeBase

Base media.

QTMediaTypeMPEG

MPEG media

QTMediaTypeMusic

Music media

QTMediaTypeTimeCode

Timecode media.

QTMediaTypeSprite

Sprite media.

QTMediaTypeFlash

Flash media.

QTMediaTypeMovie

Movie media.

QTMediaTypeTween

Tween media.

QTMediaType3D

3D media.

QTMediaTypeSkin

Skin media

QTMediaTypeQTVR

QuickTime VR media.

QTMediaTypeHint

Hint media.

QTMediaTypeStream

Stream media.

Note: The constants beginning with QTMediaCharacteristic indicate the characteristics of a media that you can query using the hasCharacteristic method.

Constant

Description

QTMediaCharacteristicVisual

The media has video data. This is a BOOL.

QTMediaCharacteristicAudio

The media has audio data. This is a BOOL.

QTMediaCharacteristicCanSendVideo

The media can send visual data to another track. This is a BOOL.

QTMediaCharacteristicProvidesActions

The media has actions. This is a BOOL.

QTMediaCharacteristicNonLinear

The media is non-linear. This is a BOOL.

QTMediaCharacteristicCanStep

The media can step. This is a BOOL.

QTMediaCharacteristicHasNoDuration

The media has no duration. This is a BOOL.

QTMediaCharacteristicHasSkinData

The media has skin data. This is a BOOL.

QTMediaCharacteristicProvidesKeyFocus

Key events can be focused at the media. This is a BOOL.

QTMediaCharacteristicHasVideoFrameRate

The media has a video frame rate. This is a BOOL.



Next Page > Hide TOC


Last updated: 2006-05-23




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice