in iPhone App I am playing song with remoteioplayer. while playing a song how to know that the song has finished playing. I want set some event on that poing?
Asked
Active
Viewed 232 times
1
-
Possible dupe - see [avaudioplayer-playing-multiple-audio-files-in-sequence](http://stackoverflow.com/questions/621182/avaudioplayer-playing-multiple-audio-files-in-sequence). – Till Jun 14 '11 at 12:17
2 Answers
0
Implement AVAudioPlayerDelegate.
It has following delegate method from which you can know song has finished playing.
- (void) audioPlayerDidFinishPlaying: (AVAudioPlayer *) player
successfully: (BOOL) flag {
NSLog(@"Finished");
}
You can refer detailed documentation.
Hope it helps.

Janak Nirmal
- 22,706
- 18
- 63
- 99
0
Implement the AVAudioPlayerDelegate methods in your class. The method
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
will be fired when the AVAudioPlayer stops playback.
More info here

lostInTransit
- 70,519
- 61
- 198
- 274