1

I am using MPVolumeView to add the airplay button in my app, I am using the following code.

myVolumeView =
    [[MPVolumeView alloc]initWithFrame:CGRectMake(self.view.frame.size.width-130, 25,20,20 )];
    [myVolumeView setShowsVolumeSlider:NO];
    [myVolumeView setShowsRouteButton:YES];
    [self.view addSubview:myVolumeView];

I am able to see the route button, but when I click on it, it showing "iPhone" as only one item in device list. But when I swipe up in iOS 7, and click on Airplay option then I can see multiple routing devices using airplay, I am stuck here, why this happening? Logically if the app unable to detect the airplay device the route button should not visible, but it is visible then why it not showing any device, but system default airplay detect and listed the airplay device.

Thanks in advance for your suggestions.

prabhu
  • 684
  • 11
  • 27

1 Answers1

1

Are you using AVAudioSessionCategoryPlayAndRecord session category? Replace AVAudioSessionCategoryPlayAndRecord with AVAudioSessionCategoryPlayback category and ArPlay picker will allow you to change output source. AirPlay device can't record, that's why it's not showing in your AirPlay picker.

MJN
  • 10,748
  • 1
  • 23
  • 32
Michael
  • 101
  • 1
  • 4