You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/09/17 02:24:26 UTC
[1/2] git commit: Revert "[CB-4847] iOS 7 microphone access requires
user permission - if denied, CDVCapture, CDVSound does not handle it properly"
Updated Branches:
refs/heads/master a99ab1b4f -> 0774b9471
Revert "[CB-4847] iOS 7 microphone access requires user permission - if denied, CDVCapture, CDVSound does not handle it properly"
This reverts commit a99ab1b4f79df49b5bea34d52f68f4e6009f54ed.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/545da9e8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/545da9e8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/545da9e8
Branch: refs/heads/master
Commit: 545da9e81ab013d6fecba8f382f8106f9b9a1ea7
Parents: a99ab1b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Sep 16 17:24:11 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Sep 16 17:24:11 2013 -0700
----------------------------------------------------------------------
src/ios/CDVCapture.m | 54 ++++++++++++++---------------------------------
1 file changed, 16 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/545da9e8/src/ios/CDVCapture.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index e14f248..774c430 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -721,47 +721,25 @@
[self.recordButton setImage:stopRecordImage forState:UIControlStateNormal];
self.recordButton.accessibilityTraits &= ~[self accessibilityTraits];
[self.recordingView setHidden:NO];
- __block NSError* error = nil;
-
- void (^startRecording)(void) = ^{
- [self.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
- [self.avSession setActive:YES error:&error];
- if (error) {
- // can't continue without active audio session
- self.errorCode = CAPTURE_INTERNAL_ERR;
- [self dismissAudioView:nil];
+ NSError* error = nil;
+ [self.avSession setCategory:AVAudioSessionCategoryRecord error:&error];
+ [self.avSession setActive:YES error:&error];
+ if (error) {
+ // can't continue without active audio session
+ self.errorCode = CAPTURE_INTERNAL_ERR;
+ [self dismissAudioView:nil];
+ } else {
+ if (self.duration) {
+ self.isTimed = true;
+ [self.avRecorder recordForDuration:[duration doubleValue]];
} else {
- if (self.duration) {
- self.isTimed = true;
- [self.avRecorder recordForDuration:[duration doubleValue]];
- } else {
- [self.avRecorder record];
- }
- [self.timerLabel setText:@"0.00"];
- self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
- self.doneButton.enabled = NO;
+ [self.avRecorder record];
}
- UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
- };
-
- SEL rrpSel = NSSelectorFromString(@"requestRecordPermission:");
- if ([self.avSession respondsToSelector:rrpSel])
- {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
- [self.avSession performSelector:rrpSel withObject:^(BOOL granted){
- if (granted) {
- startRecording();
- } else {
- NSLog(@"Error creating audio session, microphone permission denied.");
- self.errorCode = CAPTURE_INTERNAL_ERR;
- [self dismissAudioView:nil];
- }
- }];
-#pragma clang diagnostic pop
- } else {
- startRecording();
+ [self.timerLabel setText:@"0.00"];
+ self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
+ self.doneButton.enabled = NO;
}
+ UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);
}
}
[2/2] git commit: Revert "[CB-4848] Fix Xcode 5 semantic issues for
Media Capture plugin"
Posted by sh...@apache.org.
Revert "[CB-4848] Fix Xcode 5 semantic issues for Media Capture plugin"
This reverts commit 43a0982529d3a251c41c9ccce6a9dd86d61cabb4.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/0774b947
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/0774b947
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/0774b947
Branch: refs/heads/master
Commit: 0774b947105b25c0b2295cb5bd02bb1a40c7b5e1
Parents: 545da9e
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Sep 16 17:24:18 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Sep 16 17:24:18 2013 -0700
----------------------------------------------------------------------
src/ios/CDVCapture.m | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/0774b947/src/ios/CDVCapture.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index 774c430..50bf0e7 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -88,8 +88,7 @@
self.inUse = YES;
- SEL pvcSel = NSSelectorFromString(@"presentViewController:::");
- if ([self.viewController respondsToSelector:pvcSel]) {
+ if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
[self.viewController presentViewController:navController animated:YES completion:nil];
} else {
[self.viewController presentModalViewController:navController animated:YES];
@@ -140,8 +139,7 @@
// CDVImagePicker specific property
pickerController.callbackId = callbackId;
- SEL pvcSel = NSSelectorFromString(@"presentViewController:::");
- if ([self.viewController respondsToSelector:pvcSel]) {
+ if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
[self.viewController presentViewController:pickerController animated:YES completion:nil];
} else {
[self.viewController presentModalViewController:pickerController animated:YES];
@@ -257,8 +255,7 @@
// CDVImagePicker specific property
pickerController.callbackId = callbackId;
- SEL pvcSel = NSSelectorFromString(@"presentViewController:::");
- if ([self.viewController respondsToSelector:pvcSel]) {
+ if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
[self.viewController presentViewController:pickerController animated:YES completion:nil];
} else {
[self.viewController presentModalViewController:pickerController animated:YES];
@@ -618,7 +615,7 @@
// timerLabel.autoresizingMask = reSizeMask;
[self.timerLabel setBackgroundColor:[UIColor clearColor]];
[self.timerLabel setTextColor:[UIColor whiteColor]];
- [self.timerLabel setTextAlignment:NSTextAlignmentCenter];
+ [self.timerLabel setTextAlignment:UITextAlignmentCenter];
[self.timerLabel setText:@"0:00"];
[self.timerLabel setAccessibilityHint:NSLocalizedString(@"recorded time in minutes and seconds", nil)];
self.timerLabel.accessibilityTraits |= UIAccessibilityTraitUpdatesFrequently;