6

I have written an app for iPhones and for the 4S I want to support screen mirroring of the application over AirPlay.

Using the System AirPlay picker the and with Mirroring turned on it will mirror the app without any issues.

I would like to offer this picker in the app and have used the following basic code:

MPVolumeView *volumeView = [ [MPVolumeView alloc] init] ;
[volumeView setShowsVolumeSlider:NO];
[volumeView sizeToFit];
[self.view addSubview:volumeView];

This provides an AirPlay picker and I can select the Apple TV. However it does not mirror the content over AirPlay. When I go to the system picker it shows that the AppleTV is selected, and to enable mirroring I have to use the switch here.

So the question is, how can I turn on mirroring in the app when a user selects AirPlay using the app picker?

Thanks

Pfitz
  • 7,336
  • 4
  • 38
  • 51
Mike Ullrich
  • 233
  • 3
  • 11

2 Answers2

5

The only way to programmatically enable mirroring is to use private APIs. See here

justice
  • 400
  • 1
  • 5
  • 6
1

I am pretty sure mirroring can only be enabled from the system supplied menu in the multitasking bar.

Ross Kimes
  • 1,234
  • 1
  • 12
  • 34
  • Thanks for your response Ross. I hope thats not the case. I would see no benefit in adding an AirPlay icon to an app, if you could not also enable mirroring at the same time. – Mike Ullrich Jan 17 '12 at 20:22
  • Your best bet would be to file a bug report. In the meantime, maybe supply a UI in your app that would direct users on how to enable the mirroring. Luckily, they can do this without having to leave your app. It's kinda ugly, but that is probably your best option. – Ross Kimes Jan 17 '12 at 23:58
  • I have followed your suggestion and raised a bug report. Unfortunately, I think it will be too confusing for many of my users to select mirrors via the system picker. Thanks – Mike Ullrich Jan 24 '12 at 07:06