Contents

tracks(withMediaType:)

Returns tracks that contain media of a specified type.

Declaration

func tracks(withMediaType mediaType: AVMediaType) -> [AVCompositionTrack]

Parameters

  • mediaType:

    The media type of the tracks to return.

Return Value

An array of tracks, which is empty if no tracks with the media type exist.

Discussion

Apple discourages using this method in iOS 15, tvOS 15, macOS 12, and watchOS 8 or later. Load tracks asynchronously using loadTracks(withMediaType:completionHandler:) instead.

See Also

Accessing tracks