<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayer/setMediaSelectionCriteria(_:forMediaCharacteristic:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayer(im)setMediaSelectionCriteria:forMediaCharacteristic:"
  },
  "title" : "setMediaSelectionCriteria(_:forMediaCharacteristic:)"
}
-->

# setMediaSelectionCriteria(_:forMediaCharacteristic:)

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

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

## Parameters

`criteria`

An instance of [`AVPlayerMediaSelectionCriteria`](/documentation/AVFoundation/AVPlayerMediaSelectionCriteria) that specifies the selection criteria.

`mediaCharacteristic`

The media characteristic for which the selection criteria are to be applied. Supported values include [`audible`](/documentation/AVFoundation/AVMediaCharacteristic/audible), [`legible`](/documentation/AVFoundation/AVMediaCharacteristic/legible), and [`visual`](/documentation/AVFoundation/AVMediaCharacteristic/visual). See Media Characteristics in the `AVFoundation Constants`.

## Discussion

Criteria will be applied to an [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem) instance when:

- It is made ready to play.
- Specific media selections are made by the [`AVPlayerItem`](/documentation/AVFoundation/AVPlayerItem) instance using the method [`select(_:in:)`](/documentation/AVFoundation/AVPlayerItem/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`](/documentation/AVFoundation/AVPlayerItem) instance using the method [`select(_:in:)`](/documentation/AVFoundation/AVPlayerItem/select(_:in:)) method within any group will override automatic selection in that group until the player item receives a [`selectMediaOptionAutomatically(in:)`](/documentation/AVFoundation/AVPlayerItem/selectMediaOptionAutomatically(in:)) message.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)