I'm using AVPlayer to stream a audio file for my project. The problem what I'm facing is the audio file plays after getting pop from the AudioPlayerVC. Everything is okay when the audio plays on the AudioPlayerVC. It stops, plays and pauses too on AudioPlayerVC. But on the buffering time when I return back it plays after some sec. I can listen sound but cann't stop or else. I'd appreciate any help on this, thank you!
- (IBAction)backAction:(id)sender {
if (_audioToPlay.playing == YES) {
[_audioToPlay stop];
} else if (_audioToPlay.playing == NO || _audioToPlay.volume == 1.0 ) {
_audioToPlay.volume = 0.0;
[_audioToPlay stop];
}
[self.navigationController popViewControllerAnimated:YES];
}
Aucun commentaire:
Enregistrer un commentaire