AirPlay button not visible in iOS 11.

Using MPVolumeView code is as below


let airplay = MPVolumeView(frame:CGRect(x: 0, y: 5, width: 50, height: 25))

airplay.showsRouteButton = true

airplay.showsVolumeSlider = false

airplayView.addSubview(airplay)


Airplay route button is visible for iOS 10.x but not visible in iOS 11. Is it a bug in iOS 11 or we need to change code.

Replies

I have noticed a similar thing. Airplay icon appears on load then dissapears. In latest simulator my Airplay icon appears and remains but i get an message in the log when I touch the airplay button.


MPMediaControlsRemoteViewController Dismissing because view service terminated


Try AVRoutePickerView

https://developer.apple.com/documentation/avkit/avroutepickerview?language=objc