Are there any delegate methods in AVPlayer class? I need to handle interruptions such as phone call etc. AVAudioPlayer supports. If AVPlayer doesn't support it, how to stream audio with AVAudioPlayer?
AVPlayer
doesn't have the methods you want but you can use AVAudioSession
object instead
1) Select AVAudioSession
object (for example [AVAudioSession sharedInstance]
)
2) Set it active by calling setActive:error:
method
3) Set its delegate (class implementing AVAudioSessionDelegate
protocol)
4) Implement delegate's methods such as
-(void)beginInterruption;
-(void)endInterruptionWithFlags:(NSUInteger)flags;
-(void)endInterruption;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With