Commit 40a60e0c authored by eworx's avatar eworx Committed by Andrew Grieve
Browse files

ios: Make it easier to play media and record audio simultaneously

close #17
parent 1b0405c4
Loading
Loading
Loading
Loading
+3 −0
Changes for src/ios/CDVSound.m: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -555,7 +555,10 @@
            }
            // get the audioSession and set the category to allow recording when device is locked or ring/silent switch engaged
            if ([self hasAudioSession]) {
                if (![self.avSession.category isEqualToString:AVAudioSessionCategoryPlayAndRecord]) {
                    [self.avSession setCategory:AVAudioSessionCategoryRecord error:nil];
                }

                if (![self.avSession setActive:YES error:&error]) {
                    // other audio with higher priority that does not allow mixing could cause this to fail
                    errorMsg = [NSString stringWithFormat:@"Unable to record audio: %@", [error localizedFailureReason]];