Ver Fonte

fix bug

lxy há 1 ano atrás
pai
commit
5f4fd9783d

+ 17 - 11
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSBaseViewController.m

@@ -424,6 +424,7 @@
                         [[PCSMotionManager shared] startAccelerometerUpdates];
                     }
                     else{
+                        [self showAuthorCamerIfNeed];
                         [[NSNotificationCenter defaultCenter] postNotificationName:CameraNotificationNotPermission object:self];
                     }
                 }];
@@ -449,6 +450,7 @@
                         [self setupMicrophone];
                     }
                     else{
+                        [self showAudioCamerIfNeed];
                         [[NSNotificationCenter defaultCenter] postNotificationName:MicrophoneNotificationNotPermission object:self];
                     }
                 }];
@@ -464,11 +466,7 @@
                 break;
         }
     }
-    if (![self showAuthBoth]) {
-        if (![self showAuthorCamerIfNeed]) {
-            [self showAudioCamerIfNeed];
-        }
-    }
+//    [self showAuthorCamerIfNeed];
 }
 
 - (void)viewWillDisappear:(BOOL)animated{
@@ -593,6 +591,7 @@
     }
     if(self.mode != SDK_CAPTURE_MODE_SINGLE) {
         PCSPreviewViewController *vc = [[PCSPreviewViewController alloc]init];
+        vc.modalPresentationStyle = UIModalPresentationFullScreen;
         vc.model = self.resourceModel;
         vc.selectIndex = self.mode;
         vc.dataChangeBlock = ^{
@@ -601,6 +600,7 @@
         [self presentViewController:vc animated:YES completion:nil];
     } else {
         PreviewSingleViewController* dst = [[PreviewSingleViewController alloc]init];
+        dst.modalPresentationStyle = UIModalPresentationFullScreen;
         dst.singleModeNode = self.currentOperationNode;
         if (self.resourceModel.singleArray.count > 0) {
             LenzResourceItemModel *model = self.resourceModel.singleArray.firstObject;
@@ -993,13 +993,10 @@
 
 - (void)takeStillPhoto:(AVCaptureVideoPreviewLayer*)previewLayer {
 
-    if (![self showAuthBoth]) {
-        if ([self showAuthorCamerIfNeed] || [self showAudioCamerIfNeed]) {
-            return;
-        }
-    } else {
+    if ([self showAuthorCamerIfNeed]) {
         return;
     }
+
     AVCaptureConnection *connection = [self.photoOutput connectionWithMediaType:AVMediaTypeVideo];
     
     if(connection == nil){
@@ -1557,6 +1554,7 @@
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
             self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
+            [self showAuthorCamerIfNeed];
         }
             
             break;
@@ -1565,6 +1563,7 @@
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
             self.previewLayer.frame = CGRectMake(0, (height - width*4/3)/2, width, width*4/3);
+            [self showAuthorCamerIfNeed];
         }
             
             break;
@@ -1573,6 +1572,9 @@
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
             self.previewLayer.frame = self.view.layer.bounds;
+            if (![self showAuthBoth]) {
+                [self showAudioCamerIfNeed];
+            }
 
         }
             
@@ -1582,6 +1584,8 @@
             self.panoramaGuideView.hidden = NO;
             self.panoramOrientationGuideView.hidden = NO;
             self.previewLayer.frame = self.view.layer.bounds;
+            [self showAuthorCamerIfNeed];
+
         }
             
             break;
@@ -1590,6 +1594,8 @@
             self.panoramaGuideView.hidden = YES;
             self.panoramOrientationGuideView.hidden = YES;
             self.previewLayer.frame = self.view.layer.bounds;
+            [self showAuthorCamerIfNeed];
+
         }
             
             break;
@@ -1627,7 +1633,7 @@
         }];
     }
 //    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        if(newIndex == SDK_CAPTURE_MODE_SINGLE || newIndex == SDK_CAPTURE_MODE_CONTINUOUS){
+        if(newIndex != SDK_CAPTURE_MODE_MOVIE){
             [[SDKParameters shared].items enumerateObjectsUsingBlock:^(SDKParametersItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                 if (obj.model == self.mode) {
                     [[CameraManager shared] setResolutionFor:AVCaptureDevicePositionBack with:obj.resolution.height];

+ 1 - 1
LenzCameraNativeModuleForRN/Classes/inner/PCSBaseViewController/PCSPreviewViewController.m

@@ -97,7 +97,7 @@
     if (!_player) {
         _player = [[AVPlayerViewController alloc]init];
         _player.view.hidden = YES;
-        _player.videoGravity = AVLayerVideoGravityResizeAspectFill;
+//        _player.videoGravity = AVLayerVideoGravityResizeAspectFill;
     }
     return _player;
 }

+ 1 - 1
LenzSDK.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'LenzSDK'
-  s.version          = '1.1.6'
+  s.version          = '2.0.0'
   s.summary          = 'A short description of LenzSDK.'
 
 # This description is used to generate tags and improve search results.