Instance Method


Applies automatic selection criteria for media that has the specified media characteristic.


func setMediaSelectionCriteria(_ criteria: AVPlayerMediaSelectionCriteria?, forMediaCharacteristic mediaCharacteristic: AVMediaCharacteristic)



An instance of AVPlayerMediaSelectionCriteria that specifies the selection criteria.


The media characteristic for which the selection criteria are to be applied. Supported values include audible, legible, and visual. See Media Characteristics in the AVFoundation Constants.


Criteria will be applied to an AVPlayerItem instance when:

  • It is made ready to play.

  • Specific media selections are made by the AVPlayerItem instance using the method select(_:in:) in a different group. The automatic choice in one group may be influenced by a specific selection in another group.

  • Underlying system preferences change, e.g. system language, accessibility captions.

Specific selections made by the AVPlayerItem instance using the method select(_:in:) method within any group will override automatic selection in that group until the player item receives a selectMediaOptionAutomatically(in:) message.

See Also

Configuring Media Selection Criteria Settings

var appliesMediaSelectionCriteriaAutomatically: Bool

A Boolean value that indicates whether the receiver should apply the current selection criteria automatically to player items.

func mediaSelectionCriteria(forMediaCharacteristic: AVMediaCharacteristic) -> AVPlayerMediaSelectionCriteria?

Returns the automatic selection criteria for media items with the specified media characteristic.