Detecting iOS AirPlay screen mirroring capabilities

一曲冷凌霜 提交于 2019-12-08 11:03:56

问题


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)


回答1:


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.



来源:https://stackoverflow.com/questions/9935144/detecting-ios-airplay-screen-mirroring-capabilities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!