MPMoviePlayerController播放问题
我在后台使用 MPMoviePlayerController
播放音频流时遇到问题。在前台,它可以正常播放音频,但是当应用程序转到后台时,声音就会消失,时间也会继续。我已使用 AVAudioSessionCategoryPlayback
初始化了 AVAudioSession
,并将所需的背景模式放入 info.plist 文件中的音频中。我还设置了player.useApplicationAudioSession = YES;
。这里可能出现什么问题?提前致谢 :)
I'm having trouble with playing audio stream using MPMoviePlayerController
in the background. On the foreground it's playing the audio just fine, but when the application goes to the background, sound disappears and the time keeps going. I have initialized the AVAudioSession
with AVAudioSessionCategoryPlayback
and have put the required background modes to audio in info.plist file. Also I have set player.useApplicationAudioSession = YES;
. What could be the possible problem here? Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此 ios 背景 链接指示 useApplicationAudioSession 属性值应为对于 iOS 3.2 及更高版本,设置为 NO。 (我有一个应用程序可以执行此操作,并且它在后台模式下运行良好。
This ios background link indicates that the useApplicationAudioSession property value should be set to NO for iOS 3.2 and newer. (I have an app that does this and it works fine in background mode.