Resume play music, after AVAudioPlayer

My application has the ability to call. Sound used to call AVAudioPlayer. The problem is that after a call to my application, if the music played in the background (for example, in the application "Music"), it does not restore music to play.

Tried some of the methods in this forum, but unfortunately nothing has helped. Help please, how can I solve this problem? Sorry for my english.


I solved this problem for myself. I check the music is playing or not, if yes then stop the music and put the flag.

thirdPartyPlayer = [MPMusicPlayerController iPodMusicPlayer];
[thirdPartyPlayer stop];
if (thirdPartyPlayer.playbackState == MPMusicPlaybackStateInterrupted || thirdPartyPlayer.playbackState == MPMusicPlaybackStatePlaying)
{
    isThirdPartyPlayerPlay = true;
}

Then when the call ends, I restore play back music, if there is a flag.

 if (isThirdPartyPlayerPlay)
{
    [thirdPartyPlayer play];
    isThirdPartyPlayerPlay = NO;
}
链接地址: http://www.djcxy.com/p/57458.html

上一篇: 在Firefox中访问第三方Cookie

下一篇: 继AVAudioPlayer后播放音乐