|
@@ -203,6 +203,18 @@
|
|
[self.modeList reloadWith:self.operationNodesArray];
|
|
[self.modeList reloadWith:self.operationNodesArray];
|
|
self.modeList.indexChangedHandler = ^BOOL(NSUInteger newMode, NSUInteger oldMode, NSUInteger newIndex) {
|
|
self.modeList.indexChangedHandler = ^BOOL(NSUInteger newMode, NSUInteger oldMode, NSUInteger newIndex) {
|
|
__strong typeof(weakself) strongSelf = weakself;
|
|
__strong typeof(weakself) strongSelf = weakself;
|
|
|
|
+ if (newMode == SDK_CAPTURE_MODE_MOVIE) {
|
|
|
|
+ if ([self showAuthBoth]) {
|
|
|
|
+ return NO;
|
|
|
|
+ }
|
|
|
|
+ if ([self showAudioCamerIfNeed]) {
|
|
|
|
+ return NO;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if ([self showAuthorCamerIfNeed]) {
|
|
|
|
+ return NO;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
if ([SDKParameters shared].retainedMode == SDK_DATA_RETAINED_CLEAR) {
|
|
if ([SDKParameters shared].retainedMode == SDK_DATA_RETAINED_CLEAR) {
|
|
BOOL needAlert = NO;
|
|
BOOL needAlert = NO;
|
|
@@ -230,9 +242,9 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
if (needAlert) {
|
|
if (needAlert) {
|
|
- [QuitMultipleModeAlertViewController show:self title:@"确认提醒" text:@"切换模式会清除已拍摄数据,请确认" leftBtnTitle:@"取消" rightBtnTitle:@"确定" withLeftButtonCallBack:^(QuitMultipleModeAlertViewController * _Nonnull alertController) {
|
|
|
|
- [alertController dismissViewControllerAnimated:NO completion:^{}];
|
|
|
|
- } rightButtonCallBack:^(QuitMultipleModeAlertViewController * _Nonnull alertController) {
|
|
|
|
|
|
+// [QuitMultipleModeAlertViewController show:self title:@"确认提醒" text:@"切换模式会清除已拍摄数据,请确认" leftBtnTitle:@"取消" rightBtnTitle:@"确定" withLeftButtonCallBack:^(QuitMultipleModeAlertViewController * _Nonnull alertController) {
|
|
|
|
+// [alertController dismissViewControllerAnimated:NO completion:^{}];
|
|
|
|
+// } rightButtonCallBack:^(QuitMultipleModeAlertViewController * _Nonnull alertController) {
|
|
switch (self.mode) {
|
|
switch (self.mode) {
|
|
case SDK_CAPTURE_MODE_CONTINUOUS: {
|
|
case SDK_CAPTURE_MODE_CONTINUOUS: {
|
|
|
|
|
|
@@ -286,8 +298,8 @@
|
|
[oldModelNode didQuit];
|
|
[oldModelNode didQuit];
|
|
}
|
|
}
|
|
|
|
|
|
- [alertController dismissViewControllerAnimated:NO completion:^{}];
|
|
|
|
- }];
|
|
|
|
|
|
+// [alertController dismissViewControllerAnimated:NO completion:^{}];
|
|
|
|
+// }];
|
|
|
|
|
|
return NO;
|
|
return NO;
|
|
}
|
|
}
|
|
@@ -412,19 +424,22 @@
|
|
- (void)viewDidAppear:(BOOL)animated{
|
|
- (void)viewDidAppear:(BOOL)animated{
|
|
[super viewDidAppear:animated];
|
|
[super viewDidAppear:animated];
|
|
if(self.cameraPrepared){
|
|
if(self.cameraPrepared){
|
|
|
|
+ __block BOOL isAuthVideo = NO;
|
|
|
|
+
|
|
switch ([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]) {
|
|
switch ([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]) {
|
|
case AVAuthorizationStatusAuthorized:
|
|
case AVAuthorizationStatusAuthorized:
|
|
|
|
+ isAuthVideo = YES;
|
|
[self startCaptureSession];
|
|
[self startCaptureSession];
|
|
[[PCSMotionManager shared] startAccelerometerUpdates];
|
|
[[PCSMotionManager shared] startAccelerometerUpdates];
|
|
break;
|
|
break;
|
|
case AVAuthorizationStatusNotDetermined:{
|
|
case AVAuthorizationStatusNotDetermined:{
|
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
|
|
if(granted){
|
|
if(granted){
|
|
|
|
+ isAuthVideo = YES;
|
|
[self startCaptureSession];
|
|
[self startCaptureSession];
|
|
[[PCSMotionManager shared] startAccelerometerUpdates];
|
|
[[PCSMotionManager shared] startAccelerometerUpdates];
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- [self showAuthorCamerIfNeed];
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:CameraNotificationNotPermission object:self];
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:CameraNotificationNotPermission object:self];
|
|
}
|
|
}
|
|
}];
|
|
}];
|
|
@@ -448,9 +463,22 @@
|
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
|
|
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeAudio completionHandler:^(BOOL granted) {
|
|
if(granted){
|
|
if(granted){
|
|
[self setupMicrophone];
|
|
[self setupMicrophone];
|
|
|
|
+ if (self.mode != SDK_CAPTURE_MODE_MOVIE) {
|
|
|
|
+ if (!isAuthVideo) {
|
|
|
|
+ [self showAuthorCamerIfNeed];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
- [self showAudioCamerIfNeed];
|
|
|
|
|
|
+ if (self.mode == SDK_CAPTURE_MODE_MOVIE) {
|
|
|
|
+ if (!isAuthVideo) {
|
|
|
|
+ [self showAuthBoth];
|
|
|
|
+ } else {
|
|
|
|
+ [self showAudioCamerIfNeed];
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ [self showAuthorCamerIfNeed];
|
|
|
|
+ }
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:MicrophoneNotificationNotPermission object:self];
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:MicrophoneNotificationNotPermission object:self];
|
|
}
|
|
}
|
|
}];
|
|
}];
|
|
@@ -466,7 +494,18 @@
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-// [self showAuthorCamerIfNeed];
|
|
|
|
|
|
+
|
|
|
|
+ if (self.mode == SDK_CAPTURE_MODE_MOVIE) {
|
|
|
|
+ if (![self showAuthBoth]) {
|
|
|
|
+ [self showAudioCamerIfNeed];
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ if (![self showAuthBoth]) {
|
|
|
|
+ [self showAuthorCamerIfNeed];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
@@ -1562,7 +1601,6 @@
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
|
|
self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
|
|
- [self showAuthorCamerIfNeed];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -1571,7 +1609,6 @@
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
|
|
self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
|
|
- [self showAuthorCamerIfNeed];
|
|
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|
|
@@ -1580,9 +1617,6 @@
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
- if (![self showAuthBoth]) {
|
|
|
|
- [self showAudioCamerIfNeed];
|
|
|
|
- }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1592,7 +1626,6 @@
|
|
self.panoramaGuideView.hidden = NO;
|
|
self.panoramaGuideView.hidden = NO;
|
|
self.panoramOrientationGuideView.hidden = NO;
|
|
self.panoramOrientationGuideView.hidden = NO;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
- [self showAuthorCamerIfNeed];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1602,8 +1635,6 @@
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramaGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.panoramOrientationGuideView.hidden = YES;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
self.previewLayer.frame = self.view.layer.bounds;
|
|
- [self showAuthorCamerIfNeed];
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
break;
|
|
break;
|