Using MPVolumeView
I wanted to create an AirPlay output button for the app's audio.
MPVolumeView *volumeView = [ [MPVolumeView alloc] initWithFrame:CGRectMake(20, 20, 220, 20)];
[volumeView setShowsVolumeSlider:NO];
[volumeView setShowsRouteButton:YES];
[volumeView sizeToFit];
[self.view addSubview:volumeView];
[volumeView release];
Errors / issues none but it doesn't show up, any ideas?
Thanks!
It may be that you're placing your VolumeView against a white background. The Airplay route button is white before it's used (i.e.: when it's not routing via AirPlay), so if you put the control against a white background, you won't see it but it'll respond to taps. Change the background to something like red, as above, and it shows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With