<!--
{
  "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/AVPlayerItem/selectMediaOptionAutomatically(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerItem(im)selectMediaOptionAutomaticallyInMediaSelectionGroup:"
  },
  "title" : "selectMediaOptionAutomatically(in:)"
}
-->

# selectMediaOptionAutomatically(in:)

Selects the media option in the specified media selection group that best matches the receiver’s automatic selection criteria.

```
nonisolated func selectMediaOptionAutomatically(in mediaSelectionGroup: AVMediaSelectionGroup)
```

## Parameters

`mediaSelectionGroup`

The media selection group, obtained from the receiver’s [`asset`](/documentation/AVFoundation/AVPlayerItem/asset), that contains the specified option.

## Discussion

This method has no effect unless the [`appliesMediaSelectionCriteriaAutomatically`](/documentation/AVFoundation/AVPlayer/appliesMediaSelectionCriteriaAutomatically) property of the associated [`AVPlayer`](/documentation/AVFoundation/AVPlayer) is <doc://com.apple.documentation/documentation/Swift/true> and unless automatic media selection has previously been overridden by invoking [`select(_:in:)`](/documentation/AVFoundation/AVPlayerItem/select(_:in:)).

---

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)