LLSimpleCamera icon indicating copy to clipboard operation
LLSimpleCamera copied to clipboard

Background music pauses when camera is launched and photo is taken.

Open engineeringkyle opened this issue 10 years ago • 3 comments

I just started using the framework and I noticed that soundcloud's music stops playing. I tried using this line of code that I searched for all over Google and Stackoverflow and found this line of code [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; supposedly used to keep all forms of audio playing but it does not seem to be working.

engineeringkyle avatar Jul 01 '15 02:07 engineeringkyle

I realized that if you comment out the line [self.session addInput:_audioDeviceInput]; the music from another app will continue to play in the background.

engineeringkyle avatar Jul 02 '15 14:07 engineeringkyle

@kyco16 The above fix seems to disable the audio when recording the video. The background apps music keeps playing, but my videos don't have any audio. Did you have the same result, and did you find a fix? Thanks!

rjburdish avatar Apr 30 '16 22:04 rjburdish

This issue can be fixed by setting _session.automaticallyConfiguresApplicationAudioSession = false; and by setting AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, withOptions: [.DuckOthers, .DefaultToSpeaker]) Somewhere in your app, in AppDelegate for example. That would be great if we could have the choice to set automaticallyConfiguresApplicationAudioSession, I'll use a fork of this project in the meantime.

gosthell avatar Jul 01 '16 10:07 gosthell