I have started using MPVolumeView
in my app, however the Air Play button doesn't appear at all. Even though I have more than one Air Play device available to send my AVPlayer
audio to on the network. These can be seen if checking Air Play from the Control Center for example.
Here is the code I have:
myVolumeView = [MPVolumeView new];
[myVolumeView setShowsVolumeSlider:YES];
[myVolumeView setShowsRouteButton:YES];
myVolumeView.frame = _volumePanel.bounds;
[myVolumeView sizeToFit];
_myVolumeView.autoresizingMask = UIAutoresizingFlexibleWidth;
[_volumePanel addSubview:myVolumeView];
Pretty simple stuff. I have an AVPlayer
that runs some music and that's it. Interestingly, if I select another Air Play device from the Control Center it forces the Air Play button to appear in app on my MPVolumeView
, but it is kind of glitchy.
If in Xcode I click the Debug Hierarchy Mode button above the console I can see the Air Play button in my UI, however it's Alpha is 0.