track(withTrackID:)
Returns a track that contains the specified identifier.
Declaration
func track(withTrackID trackID: CMPersistentTrackID) -> AVCompositionTrack?Parameters
- trackID:
The identifier of the track to retrieve.
Return Value
A composition track, or nil if no track with the identifier exists.
Discussion
Apple discourages using this method in iOS 15, tvOS 15, macOS 12, and watchOS 8 or later. Load a track asynchronously using loadTrack(withTrackID:completionHandler:) instead.