如何从后台继续播放

问题描述:

我正在制作一个在线广播电台应用程序。该应用程序运行良好。
通话结束后,我的收音机不恢复。我必须重新启动它。如何从后台继续播放

这里是我的代码:

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 
; 
     } 
    } 

任何一个可以帮助?

类似的问题被发现,但未获回复太...

Do not get the AudioListenerInterruptionEnd trigger

https://stackoverflow.com/q/8819315/751932

也许它可以帮助你。