如何以编程方式在iPhone 4S上打开AirPlay屏幕镜像 [英] How can I turn on AirPlay Screen Mirroring on the iPhone 4S programmatically

查看:492
本文介绍了如何以编程方式在iPhone 4S上打开AirPlay屏幕镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为iPhone创建了一个应用程序,对于4S我想通过AirPlay支持应用程序的屏幕镜像。

I have written an app for iPhones and for the 4S I want to support screen mirroring of the application over AirPlay.

使用System AirPlay选择器和镜像打开它会反映应用程序没有任何问题。

Using the System AirPlay picker the and with Mirroring turned on it will mirror the app without any issues.

我想在应用程序中提供此选择器并使用以下基本代码:

I would like to offer this picker in the app and have used the following basic code:

MPVolumeView *volumeView = [ [MPVolumeView alloc] init] ;
[volumeView setShowsVolumeSlider:NO];
[volumeView sizeToFit];
[self.view addSubview:volumeView];

这提供了一个AirPlay选择器,我可以选择Apple TV。但是,它并不反映AirPlay上的内容。当我进入系统选择器时,它显示AppleTV已被选中,为了启用镜像,我必须在这里使用开关。

This provides an AirPlay picker and I can select the Apple TV. However it does not mirror the content over AirPlay. When I go to the system picker it shows that the AppleTV is selected, and to enable mirroring I have to use the switch here.

所以问题是,我怎么能当用户使用应用程序选择器选择AirPlay时,在应用程序中打开镜像?

So the question is, how can I turn on mirroring in the app when a user selects AirPlay using the app picker?

谢谢

推荐答案

以编程方式启用镜像的唯一方法是使用私有API。请参见此处

The only way to programmatically enable mirroring is to use private APIs. See here

这篇关于如何以编程方式在iPhone 4S上打开AirPlay屏幕镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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