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

# selectedMediaOption(in:)

Returns the media selection option that’s currently selected from the specified group.

```
func selectedMediaOption(in mediaSelectionGroup: AVMediaSelectionGroup) -> AVMediaSelectionOption?
```

## Parameters

`mediaSelectionGroup`

A media selection group obtained from the player item’s asset.

## Return Value

An instance of [`AVMediaSelectionOption`](/documentation/AVFoundation/AVMediaSelectionOption) that describes the currently selected option in the group.

## Discussion

If the value of the [`allowsEmptySelection`](/documentation/AVFoundation/AVMediaSelectionGroup/allowsEmptySelection) property of `mediaSelectionGroup` is <doc://com.apple.documentation/documentation/Swift/true>, the currently selected option in the group may be `nil`.

---

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)