Instance Method

tracks(withMediaType:)

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

Declaration

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

Parameters

mediaType

The media type according to which the asset filters its tracks. For valid values, see AVMediaType.

Return Value

An array of AVAssetTrack objects of a specific media type.

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(withMediaCharacteristic: AVMediaCharacteristic) -> [AVAssetTrack]

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

func unusedTrackID() -> CMPersistentTrackID

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