如何在 iPad 应用程序上启用视频输出?
刚刚发现 iPad 的视频输出不是系统级功能,而是需要明确内置到每个应用程序中。 有没有人有这方面的经验,可以指点我示例代码? 第二个问题是:为什么苹果不把它作为一个系统功能。这是一个硬件问题,我在将其构建到我的应用程序中时应该注意吗?
Just found out that the video output of the iPad is not a system level functionality, but that it needs to be explicitly build in into each app.
Is there somebody who has any experience with this, who could point me to sample code?
Secondary question would be: why wouldn't Apple make this a system feature. Is it a hardware issue, that I should be aware of when building this into my app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
外部显示器支持
iPad 可以通过一组支持的电缆连接到外部显示器。连接后,应用程序可以使用关联的屏幕来显示内容。有关屏幕的信息(包括其支持的分辨率)可通过 UIKit 框架的接口访问。您还可以使用该框架将应用程序的窗口与一个或另一个屏幕关联起来。
UIScreen 类支持检索所有可用屏幕(包括设备的主屏幕)的屏幕对象。每个屏幕对象都包含有关屏幕本身属性的信息,包括正确考虑屏幕大小和像素长宽比的尺寸。
UIScreenMode 类提供有关屏幕的一种特定尺寸和像素长宽比设置的信息。
Windows(由 UIWindow 类表示)现在可以分配给特定屏幕。
External Display Support
An iPad can be connected to an external display through a set of supported cables. When connected, the associated screen can be used by the application to display content. Information about the screen, including its supported resolutions, is accessible through the interfaces of the UIKit framework. You also use that framework to associate your application’s windows with one screen or another.
The UIScreen class provides support for retrieving screen objects for all available screens (including the device’s main screen). Each screen object contains information about the properties of the screen itself, including the dimensions that correctly take into account the size and pixel aspect ratio of the screen.
The UIScreenMode class provides information about one particular size and pixel aspect ratio setting of a screen.
Windows (represented by the UIWindow class) can now be assigned to a specific screen.
抱歉,我似乎没有必要的资格来评论其他帖子。因此,这里有一些代码可能有助于探索新的外部显示器支持:
请注意,您仍然需要某种视频电缆。我已经使用 Apple 的分量 AV 电缆对此进行了测试。尽管笨拙,但这对于调试来说非常有用,因为它具有 USB 和 30 针连接器,因此您可以连接到 iPhone/iPad 并在调试器中运行您的应用程序。
问题是您仍然需要做一些工作来将部分显示镜像到外部屏幕,同时保留 iPhone/iPad 上的控制。您可能需要查看此链接文本灵感。
Sorry, I don't seem to have the necessary standing to comment on other posts. So, here's a bit of code that might be useful to explore new External Display Support:
Note that you still need some sort of video cable. I have tested this with Apple's Component AV Cable. Although ungainly, this is nice for debugging because it has USB and 30-pin connector, so you can be connected to iPhone/iPad and run your app in debugger.
The problem is that you will still need to do some work to mirror parts of your display to external screen, while keeping controls on iPhone/iPad. You might want to look at this link text for inspiration.
TVOutManager 类处理整个过程。
以下是信息:http://www.touchcentric.com/blog/archives/123
和 github:https://github.com/robterrell/TVOutManager
The TVOutManager class handles the entire process.
Here is the info: http://www.touchcentric.com/blog/archives/123
And github: https://github.com/robterrell/TVOutManager
现在这个讨论已经不那么重要了,因为在当前版本的 iOS 中,现在在系统级别支持显示镜像。
This discussion is now less relevant, since in current versions of iOS, display mirroring is now supported at the system level.