Search code examples
iosuser-interfaceairplay

Detecting iOS AirPlay screen mirroring capabilities


I've developed a user experience in my iOS app for displaying a different view on an external screen connected via AirPlay screen mirroring or HDMI out. I have a setting to enable/disable this feature, allowing the user to choose between this mode and true mirroring (i.e. same experience on both screens).

Since many iOS devices don't even support external displays (iPhone 3GS and earlier, iPod touches) and some only support HDMI out (iPhone 4, iPad 1, iPad 2 with iOS4), I'd like to tailor the settings UI for each category of device.

I know it's good practice to detect capabilities whenever possible and not to avoid checking the version of the device itself. However, I haven't found anything online about detecting AirPlay support, just how to code for it.

Is it possible to detect AirPlay/HDMI support in the SDK?

(Apple's documentation on developing for external screens: http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingWindows/CreatingWindows.html)


Solution

  • No, not directly and in a summary fashion.

    I think you would probably be best off detecting the device version and using that as the basis of your UI.

    If you really believe that is bad practice, I suggest you explore Erica Sadun's UIDevice extensions - you might be able to find in there the code necessary to query enough specific capabilities to create an abstraction that would let you know if a device is AirPlay/HDMI capable. If you do that, I hope you share it!

    UIDevice-extension: https://github.com/erica/uidevice-extension

    As a side note, don't forget about the VGA adapter. I have tested my app with it at 1080p and it works/looks as good as the HDMI adapter, which was a big surprise to me.