---
title: "selectedMediaOption(in:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avplayeritem/selectedmediaoption(in:)"
---

# selectedMediaOption(in:)

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

## Declaration

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

## Parameters

- `mediaSelectionGroup`: A media selection group obtained from the player item’s asset.

## Return Value

Return Value An instance of AVMediaSelectionOption that describes the currently selected option in the group.

## Discussion

Discussion If the value of the allowsEmptySelection property of mediaSelectionGroup is true, the currently selected option in the group may be nil.
