loadTracks(withMediaCharacteristic:completionHandler:)
Loads tracks that contain media of a specified characteristic.
Declaration
func loadTracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic, completionHandler: @escaping @Sendable ([AVMutableCompositionTrack]?, (any Error)?) -> Void)func loadTracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) async throws -> [AVMutableCompositionTrack]Parameters
- mediaCharacteristic:
The media characteristic of the tracks to load.
- completionHandler:
A callback that the system invokes after it finishes the loading request. It passes the completion handler the following parameters:
- tracks
An array of tracks, which may be empty if no tracks with the specified media characteristic exist. The value is
nilif an error occurs.- error
An error object if the request fails; otherwise,
nil.