You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2023/07/20 06:52:57 UTC

[cordova-plugin-media-capture] branch master updated: fix(ios): set category before creating AVAudioRecorder (#269)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-media-capture.git


The following commit(s) were added to refs/heads/master by this push:
     new 8547af0  fix(ios): set category before creating AVAudioRecorder (#269)
8547af0 is described below

commit 8547af0f25701b2c02ca99a6ffbad20b4f1aadc9
Author: Ken Naito <fi...@gmail.com>
AuthorDate: Thu Jul 20 15:52:51 2023 +0900

    fix(ios): set category before creating AVAudioRecorder (#269)
---
 src/ios/CDVCapture.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 24e111f..d777a06 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -735,6 +735,8 @@
         }
     }
 
+    [self.avSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];
+    
     // create file to record to in temporary dir
 
     NSString* docsPath = [NSTemporaryDirectory()stringByStandardizingPath];   // use file system temporary directory
@@ -793,7 +795,6 @@
         __weak CDVAudioRecorderViewController* weakSelf = self;
 
         void (^startRecording)(void) = ^{
-            [weakSelf.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
             [weakSelf.avSession setActive:YES error:&error];
             if (error) {
                 // can't continue without active audio session


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org