loadTrack(withTrackID:completionHandler:)
Loads a track that contains the specified identifier.
Declaration
func loadTrack(withTrackID trackID: CMPersistentTrackID, completionHandler: @escaping @Sendable (AVMutableCompositionTrack?, (any Error)?) -> Void)func loadTrack(withTrackID trackID: CMPersistentTrackID) async throws -> AVMutableCompositionTrack?Parameters
- trackID:
The identifier of the track to load.
- completionHandler:
A callback that the system invokes after it finishes the loading request. It passes the completion handler the following parameters:
- track
The loaded track, or
nilif no track with the specified identifier exists or if an error occurs.- error
An error object if the request fails; otherwise,
nil.