I want to stop the AVAudio开发者_如何学JAVAPlayer
when click on new tab. Stop an Pause button are working properly but if i am click on new tab bar the player is to be play in background so how can i stop the player.
I used:
-(void)stop_play
{
[player stop];
play.hidden=NO;
stop.hidden=YES;
}
when you click on new tab,in your action method write code like this
if(audioPlayer.playing){
[audioPlayer stop];
}
when your AVAudioPlayer playing, set one bool var as YES.. than call stop maethod with passing this bool var.. like Code here
if(isPlay)
{
isPlay = NO;
[audioPlayer stop];
}
after than you play audio set bool var again YES...
精彩评论