Playing music at back ground: AVAudioSessionInterruptionNotification not fired

时光总嘲笑我的痴心妄想 提交于 2019-12-05 00:57:53
Teemu Pohjanlehto

I had similar problem with interrupts. iOS: Siri not available does not return AVAudioSessionInterruptionOptionShouldResume

Ended up using applicationWillResignActive and applicationDidBecomeActive instead.

There is Property of your AVCaptureSession instance: @property(nonatomic) BOOL usesApplicationAudioSession

It is YES by default just set it to NO, and will works fine.

Roc.Liu

Try to add object:session

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onAudioSessionEvent:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!