<!--
{
  "availability" : [
    "tvOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVKit",
  "identifier" : "/documentation/AVKit/AVPlayerViewControllerDelegate/playerViewController(_:didSelect:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVKit"
    ],
    "preciseIdentifier" : "c:objc(pl)AVPlayerViewControllerDelegate(im)playerViewController:didSelectMediaSelectionOption:inMediaSelectionGroup:"
  },
  "title" : "playerViewController(_:didSelect:in:)"
}
-->

# playerViewController(_:didSelect:in:)

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

```
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.

## Discussion

---

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)