iPhone :remoteioplayer how to know that the song has finished playing
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开发者_开发百科?
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.
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
精彩评论