检测 iOS AirPlay 屏幕镜像功能 [英] Detecting iOS AirPlay screen mirroring capabilities

查看:122
本文介绍了检测 iOS AirPlay 屏幕镜像功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 iOS 应用中开发了一种用户体验,用于在通过 AirPlay 屏幕镜像或 HDMI 输出连接的外部屏幕上显示不同的视图.我有一个启用/禁用此功能的设置,允许用户在此模式和真实镜像之间进行选择(即两个屏幕上的体验相同).

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).

由于许多 iOS 设备甚至不支持外部显示器(iPhone 3GS 及更早版本、iPod touch),而且有些设备仅支持 HDMI 输出(iPhone 4、iPad 1、带有 iOS4 的 iPad 2),我想定制设置各类设备的用户界面.

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.

我知道最好尽可能检测功能,而不是避免检查设备本身的版本.但是,我还没有在网上找到任何关于检测 AirPlay 支持的信息,只是如何编写代码.

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.

是否可以在 SDK 中检测到 AirPlay/HDMI 支持?

(Apple 的外部屏幕开发文档:http://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/CreatingWindows/CreatingWindows.html)

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

推荐答案

不,不是直接的和概括的.

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.

如果你真的认为这是不好的做法,我建议你探索 Erica Sadun 的 UIDevice 扩展——你可能会在那里找到查询足够特定功能所需的代码,以创建一个抽象,让你知道设备是否是支持 AirPlay/HDMI.如果你这样做,我希望你分享它!

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

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

顺便提一下,不要忘记 VGA 适配器.我已经用它以 1080p 测试了我的应用,它的工作/看起来与 HDMI 适配器一样好,这让我大吃一惊.

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.

这篇关于检测 iOS AirPlay 屏幕镜像功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆