8000 try to allocate a new AVAudioSession for recording · next-coder/flutter-webrtc@db5fbe5 · GitHub
[go: up one dir, main page]

Skip to content

Commit db5fbe5

Browse files
committed
try to allocate a new AVAudioSession for recording
1 parent d25e18d commit db5fbe5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ios/Classes/FlutterRTCAudioRecorder.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ @implementation FlutterRTCAudioRecorder
1818

1919
-(id) initWithPath:(NSString *) path {
2020
self = [super init];
21-
recordingSession = [AVAudioSession sharedInstance];
21+
recordingSession = [[AVAudioSession alloc] init];
2222

2323
[recordingSession setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
2424
[recordingSession setActive:true error:nil];
@@ -46,6 +46,7 @@ -(id) initWithPath:(NSString *) path {
4646
}
4747

4848
-(void)stop:(OnRecordingStopped) callback {
49+
[recordingSession setActive:false error:nil];
4950
onRecordingStopped = callback;
5051
if (audioRecorder != nil) {
5152
[audioRecorder stop];

ios/Classes/FlutterWebRTCPlugin.m

Lines changed: 0 additions & 1 deletion
} else {
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult) result
496496
result([NSNumber numberWithBool:(BOOL)flag]);
497497
}];
498498
}
499-
result(nil);
500499
501500
result(FlutterMethodNotImplemented);
502501
}

0 commit comments

Comments
 (0)
0