rFlex / SCRecorder

iOS camera engine with Vine-like tap to record, animatable filters, slow motion, segments editing
Apache License 2.0
3.06k stars 583 forks source link

SCRecorder do not record while bluetooth headset is connected #332

Open JoniStep opened 8 years ago

JoniStep commented 8 years ago

The App hangs on calling line "dispatch_sync(_sessionQueue, block);" in "- (void)record" method of SCRecorder while bluetooth headset is connected.

Wherein the method "- (BOOL)application:didFinishLaunchingWithOptions:" has the next code below:

AVAudioSession *session1 = [AVAudioSession sharedInstance]; [session1 setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers|AVAudioSessionCategoryOptionDefaultToSpeaker|AVAudioSessionCategoryOptionAllowBluetooth error:nil]; [session1 setActive:YES error:nil]; [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];

What could you suggest to resolve this issue?

vfa-nhannv commented 7 years ago

i have same issue. :(

d-litvinenko commented 6 years ago

Upd.

jlindberg-oss commented 6 years ago

+1. Has Anyone figured out how to get Bluetooth working with SCRecorder?

monurcevik commented 4 years ago

Fixed this issue by removing everything except:

.mixWithOthers AND .defaultSpeaker.

For some reason, adding .allowBluetooth makes it NOT work with Bluetooth. Final config:

try AVAudioSession.sharedInstance().setCategory(.playAndRecord, mode: .videoRecording, options: [.mixWithOthers, .defaultToSpeaker])