0

I setup my iPhone with AirPlay connected to my AppleTV.

I run this method and unfortunately have only 1 screen (main screen) where I should get 2 on an actual device.

Note: this works with the simulator.

Any idea?

-(void)airplayInit {

    NSArray *screens = [UIScreen screens];

    NSLog(@"Airplay screens #%d", screens.count-1);
}
Stéphane de Luca
  • 12,745
  • 9
  • 57
  • 95

1 Answers1

0

The Airplay screen only appears in the UIScreen array if you enable Airplay Mirroring on the iPhone.

On the other hand you can playback video on your Apple TV with the MediaPicker by letting the user tap on the Airplay icon on the standard player control. If you want to provide custom content on your Apple TV, the user has to enable mirroring.

It's hard to read from the documentation, but unfortunately this is how Apple believes it should be.

pmau
  • 154
  • 3