<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVPlayerItem/select(_:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVPlayerItem(im)selectMediaOption:inMediaSelectionGroup:"
  },
  "title" : "select(_:in:)"
}
-->

# select(_:in:)

Selects a media option in a given media selection group and deselects all other options in that group.

```
nonisolated func select(_ mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup)
```

## Parameters

`mediaSelectionOption`

The option to select.

    If the value of the [`allowsEmptySelection`](/documentation/AVFoundation/AVMediaSelectionGroup/allowsEmptySelection)     property of     `mediaSelectionGroup`     is     <doc://com.apple.documentation/documentation/Swift/true>    , you can pass     `nil`     to deselect all media selection options in the group.

`mediaSelectionGroup`

The media selection group, obtained from the receiver’s asset, that contains `mediaSelectionOption`.

## Discussion

If `mediaSelectionOption` isn’t a member of the `mediaSelectionGroup`, no change in presentation state will result.

If multiple options within a group meet your criteria for selection according to locale or other considerations, and if these options are otherwise indistinguishable to you according to media characteristics that are meaningful for your application, content is typically authored so that the first available option that meets your criteria is appropriate for selection.

---

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)