tracks(withMediaType:)
Returns tracks that present media of a specified type.
Declaration
func tracks(withMediaType mediaType: AVMediaType) -> [AVFragmentedAssetTrack]Parameters
- mediaType:
The media type according to which the asset filters its tracks. For valid values see Avmediatype.
Return Value
An array of tracks of a specific media characteristic.
Discussion
Apple discourages the use of this method in iOS 15, tvOS 15, and macOS 12 or later. Load tracks asynchronously using loadTracks(withMediaType:completionHandler:) instead.
You may call this method without blocking the current thread after you’ve asynchronously loaded the tracks property.