AudioStreamer不是在后台工作在iOS5的。有什么建议么? [英] AudioStreamer not working in background in iOS5. Any suggestions?

查看:190
本文介绍了AudioStreamer不是在后台工作在iOS5的。有什么建议么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现Audiostreamer类马特·加拉格尔在我的应用程序,它在iOS4的正常工作。但是,当我切换到iOS5的后台播放没有在那里工作。

I have implemented Audiostreamer class of Matt Gallagher in my application and it works fine in ios4. But when I switched to iOS5 the background playing is not working in there.

我已经加入UIBackground模式与应用背景的plist值不跑我的应用程序。所以我觉得这个问题是另一回事。任何人都可以帮我吗?它像一个迫切。

I have added UIBackground Modes and Application does not run in Background plist values to my application. So I think the issue is something else. Can anyone help me out? Its like an urgent.

感谢

推荐答案

@j_mcnally iOS5的仿真器支持后台播放。

@j_mcnally iOS5 Simulator supports background playing.

@thoughtbreaker在马特·加拉格尔有一些流动。请问您的音频不会在后台在所有播放或一首曲目结束播放后停止。

@thoughtbreaker In Matt Gallagher there are some flows. Does your audio not play in the background at all or it stops after one track is finished playing.

如果它不是在后台播放在所有比有可能是缓冲相关的问题...
您应该使用背景到期处理程序,在你的audioStateChange方法,但只有当应用程序在后台。

If its not playing at all in the background than there may be buffering related problem... You should use Background expiration handler, in your audioStateChange method, but only when app is in the background.

UIApplication *app = [UIApplication sharedApplication];
UIBackgroundTaskIdentifier bgTask = [app beginBackgroundTaskWithExpirationHandler:nil]

}]; 

您可以通过在applicationDidEnterBackground方法中设置一个全局标志检查后台模式

You can check the background mode by setting a global flag in applicationDidEnterBackground method

另外,在您的audioStart奏法无效处理程序

Also invalidate the handler in your audioStart Playing method

[app endBackgroundTask:bgTask];

这篇关于AudioStreamer不是在后台工作在iOS5的。有什么建议么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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