xcode 如何开始使用airplay?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11279818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:44:54  来源:igfitidea点击:

How to get started with airplay?

iphoneobjective-ciosxcodeairplay

提问by moshikafya

I am trying to get started with iOS Airplay (split screen and mirroring) and it seems like there is pretty much nothing on the web about this. I am looking for a sample app or a step by step tutorial to set up Airplay on my app, basically to share my screen, not necessarily audio or video (although I am fine with starting with that its that is more simple).

我正在尝试开始使用 iOS Airplay(分屏和镜像),但似乎网络上几乎没有关于此的任何内容。我正在寻找示例应用程序或分步教程来在我的应用程序上设置 Airplay,基本上是为了共享我的屏幕,不一定是音频或视频(尽管我可以从它开始,因为它更简单)。

Can anyone point me to somewhere helpful to learn more about it (besides the iOS library)?

任何人都可以指点我一些有助于了解更多信息的地方(除了 iOS 库)?

回答by omz

Have a look at the AirPlay Overview documentation, especially the chapter Enriching Your App for AirPlay.

查看AirPlay 概述文档,尤其是为 AirPlay 丰富您的应用程序一章。

For mirroring, you don't have to do much at all. If you want different content to appear on the AirPlay-connected screen, you basically have to create a separate UIWindowand set its screenproperty to the corresponding UIScreen.

对于镜像,您根本不需要做太多事情。如果你想让不同的内容出现在 AirPlay 连接的屏幕上,你基本上必须单独创建一个UIWindow并将其screen属性设置为对应的UIScreen.

回答by thunderw

I think what you need to read is "Multiple Display Programming Guide for iOS". Airplay is more related to audio or video than "Multiple Display".

我认为您需要阅读的是“iOS 多显示器编程指南”。Airplay 与“多显示器”相比,与音频或视频的相关性更大。

An Additional Window Is Needed to Support an External Display

需要额外的窗口来支持外部显示器

If your app supports an external device display, you need to create a separate window object to represent the content to display on it. You can show the same content on both displays—this feature is called mirroring and it happens by default—or you can show different content on each display.

如果您的应用程序支持外部设备显示,则需要创建一个单独的窗口对象来表示要在其上显示的内容。您可以在两个显示器上显示相同的内容——此功能称为镜像,默认情况下会发生——或者您可以在每个显示器上显示不同的内容。

Read Presenting Content on an External Displayfor step by step tutorial.

阅读在外部显示器上呈现内容以获取分步教程。

回答by quellish

This may be helpful: https://github.com/quellish/AirplayDemo

这可能会有所帮助:https: //github.com/quellish/AirplayDemo

It shows how to use the airplay display as a secondary screen.

它展示了如何将 Airplay 显示器用作辅助屏幕。