4

The following code enables AirPlay and adds an AirPlay icon to the AVPlayer view:

        playerViewController.player?.allowsExternalPlayback = true

        var volumeView = MPVolumeView()
        volumeView.showsVolumeSlider = false
        volumeView.sizeToFit()

        playerViewController.view.addSubview(volumeView)

        playerViewController.player!.play()

However, it does it in the wrong location - the AirPlay icon appears in the top left. How can I ensure it appears next to the volume controls?

Gaurav Sharma
  • 2,680
  • 3
  • 26
  • 36
  • 1
    Did you ever find an answer to your question I have the exact same thing. It appears in the top left corner instead of next to the controls. – Mark Apr 19 '17 at 17:07

0 Answers0