如何从后台恢复播放
我正在制作一个在线广播电台应用程序。该应用程序运行良好。
通话结束后我的收音机无法恢复。我必须再次重新启动它。
这是我的代码:
void MyAudioSessionInterruptionListener(void *inClientData, UInt32 inInterruptionState)
{
ShoutcastAudioStreamer *radio = (ShoutcastAudioStreamer*)inClientData;
if (inInterruptionState == kAudioSessionBeginInterruption) {
[radio stop];
NSLog(@"kAudioSessionBeginInterruption");
}
else if (inInterruptionState == kAudioSessionEndInterruption) {
// [radio start]; // this doesn't work - radio is gone
;
}
}
有人可以帮忙吗?
I am making an online radio station app. The app works good.
My radio doesn't resume after the call is ended. And I have to restart it again.
Here is my code:
void MyAudioSessionInterruptionListener(void *inClientData, UInt32 inInterruptionState)
{
ShoutcastAudioStreamer *radio = (ShoutcastAudioStreamer*)inClientData;
if (inInterruptionState == kAudioSessionBeginInterruption) {
[radio stop];
NSLog(@"kAudioSessionBeginInterruption");
}
else if (inInterruptionState == kAudioSessionEndInterruption) {
// [radio start]; // this doesn't work - radio is gone
;
}
}
Can any one help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现了类似的问题,但也没有回复...
不要获取 AudioListenerInterruptionEnd 触发器
https://stackoverflow.com/q/8819315/751932
也许它可以帮助你。
similar questions were found, but without reply too...
Do not get the AudioListenerInterruptionEnd trigger
https://stackoverflow.com/q/8819315/751932
Probably it can help you.