Question

Using AVAudioPlayer we can play more than 1 song in a loop using this method:

- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag

to play the next song. But is it possible to identify the AVAudioPlayer instance since at a single time there are many AVAudioPlayer playing separate playlist in a app.

Était-ce utile?

La solution

The player (first argument) from

- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag  

is the AVAudioPlayer, that you are looking for.

So you can check it:

if ([player isEqual:self.audioPlayer1])
{
    //Do something
} 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top