lxy 1 рік тому
батько
коміт
6e930b6a2d

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

@@ -998,7 +998,9 @@
     }
 
     AVCaptureConnection *connection = [self.photoOutput connectionWithMediaType:AVMediaTypeVideo];
-    
+    if ([connection isVideoStabilizationSupported]) {
+        connection.preferredVideoStabilizationMode = AVCaptureVideoStabilizationModeAuto;
+    }
     if(connection == nil){
 //        [self showAlertForAuthorization];
         return;
@@ -1195,6 +1197,9 @@
     
     NSURL* tmpMovieFileUrl = [NSURL fileURLWithPath:[LenzDataManager moviePath]];
     AVCaptureConnection* connection = [self.movieFileOutput connectionWithMediaType:AVMediaTypeVideo];
+    if ([connection isVideoStabilizationSupported]) {
+        connection.preferredVideoStabilizationMode = AVCaptureVideoStabilizationModeAuto;
+    }
     if(connection == nil){
 //        [self showAlertForAuthorization];
         return NO;
@@ -1272,6 +1277,9 @@
         }
         if([self configureVideoWritter]){
             AVCaptureConnection *connection = [self.videoDataOutput connectionWithMediaType:AVMediaTypeVideo];
+            if ([connection isVideoStabilizationSupported]) {
+                connection.preferredVideoStabilizationMode = AVCaptureVideoStabilizationModeAuto;
+            }
             if(connection == nil){
 //                [self showAlertForAuthorization];
                 return;