Airplay from iPad - a separate UIView to display on Apple TV
Asked Answered
S

1

8

I want to use Airplay to send images in high definition to a Apple TV.

Airplay works fine on my iPad 2 with iOS 5.0.1.

When I start my app, my UIScreen screens array only has 1 item in it. (the iPad of course). I register for the notification for more screens, it never comes unless i bring up the multitasking bar and select my Apple TV. I don't want to do this.

I want an in app pop over where I can select the Apple TV or any other airplay device in the list.

I used MPVolumeView, which did give me that list - and did let me select the Apple TV - but I stil don't get the call back notification that the Apple TV has been selected - so that I can setup my UIWindow for the new view! (but the multitask bar does confirm that the Apple TV is now ticked and the icon from MPVolumeView does go blue too).

I've tried the externalDisplay sample app too, and this too only shows one screen in the list of UIScreens when the app starts.

What am I missing?

Thanks

Sandstrom answered 21/12, 2011 at 8:58 Comment(0)
D
4

Unfortunately, I believe the behavior you are describing is accurate and by-design. When you're talking about accessing your Apple TV as another UIScreen, you're talking about "mirroring" and enabling mirroring requires the specific end-user action you describe: going to the multitasking bar and turning mirroring on.

It would be nice to be able to enable mirroring from within an app - I hope somebody corrects me if I'm wrong because I would like this for my app!

Deprivation answered 18/1, 2012 at 1:56 Comment(4)
No, you're right. I've spoken with a couple of guys at Apple and they confirm this is the current behaviour but also agree that this behaviour is flawed for the best user experience, and are going to suggest a change. So be prepared for a future release where this desired behaviour is available.Sandstrom
Thanks a lot, that's good to know. BTW, I just learned that AirServer now supports mirroring an AirPlay signal on a Mac. This is a nice additional thing to debug with (and will actually give users of my app a viable benefit). Unfortunately, the current incarnation of that app is also limited to 720p mirroring. I submitted a support ticket with them to feel out their intentions for boosting it to 1080p. Cheers.Deprivation
Just in case it suits you, mirroring may be enabled from within an app using private APIs. spin.atomicobject.com/2012/04/23/…Joab
Thanks Roland - very interesting read, and kind of a tease - I would love to see Apple expose those APIs. I believe they hesitate because typical consumer users (non-geeks) struggle to get their heads around AirPlay, and so they want to tightly control the implementation. I bet they will give us more control soon though, albeit probably an abstraction of these APIs and more limited (something akin to what you get with MPVolumeView but with mirroring control).Deprivation

© 2022 - 2024 — McMap. All rights reserved.