I try the code to avoid the sleep mode interruption it's working but now I have the problem with interruption when call or sms is coming on iphone the song is stop ok at that time.Where the song is stop i want to start the song automatically when the call is end.
- (void) audioPlayerBeginInterruption: (AVAudioPlayer *) player {
if (playing) {
playing = NO;
interruptedOnPlayback = YES;
[self updateViewForPlayerState];
}
}
- (void) audioPlayerEndInterruption: (AVAudioPlayer *) player {
if (interruptedOnPlayback) {
[player prepareToPlay];
[player play];
playing = YES;
interruptedOnPlayback = NO;
}
}
but it doesn't work
please help me here thanks in advance