Contents

setMediaSelectionCriteria(_:forMediaCharacteristic:)

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

Declaration

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

Parameters

  • criteria:

    An instance of Avplayermediaselectioncriteria that specifies the selection criteria.

  • mediaCharacteristic:

    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.

Discussion

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