Contents

track(withTrackID:)

Retrieves a track in the movie that contains the specified identifier.

Declaration

func track(withTrackID trackID: CMPersistentTrackID) -> AVFragmentedMovieTrack?

Parameters

  • trackID:

    The persistent track identifier.

Return Value

A movie track, or nil if there is no track with the identifier.

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.

See Also

Accessing tracks