Contents

tracks(withMediaCharacteristic:)

Returns tracks that present media of a specified characteristic.

Declaration

func tracks(withMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic) -> [AVFragmentedAssetTrack]

Parameters

  • mediaCharacteristic:

    The media characteristic according to which the asset filters its asset tracks. For valid values, see Avmediacharacteristic.

Return Value

An array of tracks of a specific media characteristic.

Discussion

Apple discourages the use of this method in iOS 15, tvOS 15, and macOS 12 or later. Load tracks asynchronously using loadTracks(withMediaCharacteristic:completionHandler:) instead.

You may call this method without blocking the current thread after you’ve asynchronously loaded the tracks property.

See Also

Accessing tracks