Instance Method

tracks(withMediaCharacteristic:)

Returns an array of asset tracks associated with an asset for the specified characteristic.

Declaration

func tracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> [AVAssetTrack]

Parameters

mediaCharacteristic

The media characteristic according to which receiver filters its asset tracks. For valid values, see AVMediaCharacteristic.

Return Value

An array of AVAssetTrack objects of a specific media characteristic, or an empty array if no tracks with the specified characteristic are available.

Discussion

You can call this method without blocking when the data in the tracks property is already loaded.

See Also

Accessing Tracks

var tracks: [AVAssetTrack]

The collection of all tracks contained by the asset.

var trackGroups: [AVAssetTrackGroup]

An array containing all of the track groups in the asset.

func track(withTrackID: CMPersistentTrackID) -> AVAssetTrack?

Returns the track associated with a specified track identifier.

func tracks(withMediaType: AVMediaType) -> [AVAssetTrack]

Returns an array of asset tracks associated with an asset for the specified media type.

func unusedTrackID() -> CMPersistentTrackID

Returns an ID that's unused by any of the tracks in the asset.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software