如何支持AirPlay的在iOS6的背景 [英] How to support airplay in the background in iOS6

查看:169
本文介绍了如何支持AirPlay的在iOS6的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序应该视频流的通过的Airplay的AppleTV的,即使当应用程序在后台。

My app should stream video's to an AppleTV via Airplay, even when the app is in the background.

在iOS5中,它的工作完美。在iOS6的没有。

Under iOS5 it worked perfectly. In iOS6 it does not.

X code给出了我去precated警告在此行code的:

Xcode gives me a deprecated warning on this line of code:

moviePlayerViewController.moviePlayer.useApplicationAudioSession = NO;

这是为什么我的应用程序无法正常工作了的原因。什么是这片code在iOS6的?

Is this the reason why my app isn't functioning correctly anymore. What is the equivalent of this piece of code in iOS6?

推荐答案

找到了解决办法:这个问题可以通过设置合适的AVAudioSessionCategory解决

Found the solution: this problem can be solved by setting the right AVAudioSessionCategory

NSError *setCategoryError = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error: &setCategoryError];

这篇关于如何支持AirPlay的在iOS6的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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