You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/06/27 20:47:02 UTC
git commit: ios: Make it easier to play media and record audio
simultaneously
Repository: cordova-plugin-media
Updated Branches:
refs/heads/master 1b0405c43 -> 40a60e0c7
ios: Make it easier to play media and record audio simultaneously
close #17
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/40a60e0c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/40a60e0c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/40a60e0c
Branch: refs/heads/master
Commit: 40a60e0c7cb893db6e43ea564dac5363de875b7a
Parents: 1b0405c
Author: eworx <de...@eworx.gr>
Authored: Fri May 30 16:57:55 2014 +0300
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jun 27 14:46:53 2014 -0400
----------------------------------------------------------------------
src/ios/CDVSound.m | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/40a60e0c/src/ios/CDVSound.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSound.m b/src/ios/CDVSound.m
index 0dad4a6..7370026 100644
--- a/src/ios/CDVSound.m
+++ b/src/ios/CDVSound.m
@@ -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]) {
- [self.avSession setCategory:AVAudioSessionCategoryRecord error:nil];
+ 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]];