---
title: "playerViewController(_:didSelect:in:)"
framework: avkit
role: symbol
role_heading: Instance Method
path: "avkit/avplayerviewcontrollerdelegate/playerviewcontroller(_:didselect:in:)"
---

# playerViewController(_:didSelect:in:)

Tells the delegate when the user selects a media option from a media selection group.

## Declaration

```swift
optional func playerViewController(_ playerViewController: AVPlayerViewController, didSelect mediaSelectionOption: AVMediaSelectionOption?, in mediaSelectionGroup: AVMediaSelectionGroup)
```

## Parameters

- `playerViewController`: The player view controller.
- `mediaSelectionOption`: The user’s selected media option, which may be nil.
- `mediaSelectionGroup`: The media selection group in which the selected media option exists.
