Returns an array of asset tracks associated with an asset for the specified media type.
SDKs
- iOS 4.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 6.0+
Framework
- AVFoundation
Declaration
- (NSArray<AVAsset Track *> *)tracksWithMediaType:(AVMedia Type)mediaType;
Parameters
mediaType
The media type according to which the asset filters its tracks. For valid values, see
AVMedia
.Type
Return Value
An array of AVAsset
objects of a specific media type.
Discussion
You can call this method without blocking when the data in the tracks
property is already loaded.