---
title: "setMediaSelectionCriteria(_:forMediaCharacteristic:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayer/setmediaselectioncriteria(_:formediacharacteristic:)"
---

# setMediaSelectionCriteria(_:forMediaCharacteristic:)

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

## Declaration

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

## Parameters

- `criteria`: An instance of doc://com.apple.avfoundation/documentation/AVFoundation/AVPlayerMediaSelectionCriteria that specifies the selection criteria.
- `mediaCharacteristic`: The media characteristic for which the selection criteria are to be applied. Supported values include doc://com.apple.avfoundation/documentation/AVFoundation/AVMediaCharacteristic/audible, doc://com.apple.avfoundation/documentation/AVFoundation/AVMediaCharacteristic/legible, and doc://com.apple.avfoundation/documentation/AVFoundation/AVMediaCharacteristic/visual. See Media Characteristics in the AVFoundation Constants.

## Discussion

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

- [appliesMediaSelectionCriteriaAutomatically](avfoundation/avplayer/appliesmediaselectioncriteriaautomatically.md)
- [mediaSelectionCriteria(forMediaCharacteristic:)](avfoundation/avplayer/mediaselectioncriteria(formediacharacteristic:).md)
