Chris 5 anos atrás
pai
commit
c15fd9d2f0

+ 0 - 7
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m

@@ -203,12 +203,8 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     _previewScrollView.frame = frame;
     _previewScrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
     if (_cutInfo.cutMode == AliyunMediaCutModeScaleAspectCut) {
-        
-        [self.bottomView.ratioButton setImage:[AliyunImage imageNamed:@"cut_ratio"] forState:0];
         [self fitModeCut];
     } else {
-        
-        [self.bottomView.ratioButton setImage:[AliyunImage imageNamed:@"normal"] forState:0];
         [self fitModeFill];
     }
 }
@@ -291,7 +287,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
         [alert show];
         self.thumbnailView.userInteractionEnabled = YES;
         self.bottomView.cropButton.userInteractionEnabled = YES;
-        self.bottomView.ratioButton.userInteractionEnabled = YES;
         [self destoryAVPlayer];
         [self setAVPlayer];
  
@@ -330,7 +325,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
 - (void)cropTaskOnCancel {
     self.progressView.progress = 0;
     _bottomView.cropButton.enabled =YES;
-    _bottomView.ratioButton.enabled = YES;
     NSLog(@"cancel");
 }
 
@@ -465,7 +459,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     self.progressView.progress = 0;
     self.thumbnailView.userInteractionEnabled = YES;
     self.bottomView.cropButton.enabled = YES;
-    self.bottomView.ratioButton.enabled = YES;
     [_cutPanel cancel];
 }
 

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropThumbnailView.m

@@ -80,10 +80,10 @@
     [self addSubview:_durationLabel];
     
     _imageViewWith = ScreenWidth / 8.0 * 0.35;
-    _imageViewLeft = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"cut_bar_left"]];
+    _imageViewLeft = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_left"]];
     _imageViewLeft.frame = CGRectMake(0, 12, _imageViewWith, ScreenWidth / 8.0);
     _imageViewLeft.userInteractionEnabled = YES;
-    _imageViewRight = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"cut_bar_right"]];
+    _imageViewRight = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_right"]];
     _imageViewRight.frame = CGRectMake(ScreenWidth - _imageViewWith, 12, _imageViewWith, ScreenWidth / 8.0);
     _imageViewRight.userInteractionEnabled = YES;
     

+ 0 - 6
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropViewBottomView.h

@@ -11,18 +11,12 @@
 @protocol AliyunCropViewBottomViewDelegate <NSObject>
 
 - (void)onClickBackButton;
-- (void)onClickRatioButton;
 - (void)onClickCropButton;
 
 @end
 
 @interface AliyunCropViewBottomView : UIView
 
-/**
- 裁剪模式切换按钮
- */
-@property (nonatomic, strong) UIButton *ratioButton;
-
 /**
  确定按钮
  */

+ 7 - 12
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/View/AliyunCropViewBottomView.m

@@ -43,11 +43,13 @@
     self.backButton = [self buttonWithRect:(CGRectMake(5, 2, 40, 40)) image:[UIImage imageNamed:@"navbar_back_white"] action:@selector(backButtonAction)];
     [self addSubview:self.backButton];
     
-    self.ratioButton = [self buttonWithRect:(CGRectMake(0, 0, height, height)) image:[AliyunImage imageNamed:@"cut_ratio"] action:@selector(ratioButtonAction)];
-    self.ratioButton.center = CGPointMake(width / 2, height / 2);
-    [self addSubview:self.ratioButton];
-    
-    self.cropButton = [self buttonWithRect:(CGRectMake(width - height, 0, height, height)) image:[AliyunImage imageNamed:@"check"] action:@selector(cropButtonAction)];
+    self.cropButton = [self buttonWithRect:(CGRectMake(width - 14 - 64, 8, 64, 26)) image:nil action:@selector(cropButtonAction)];
+    [self.cropButton setTitle:@"下一步" forState:UIControlStateNormal];
+    [self.cropButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    self.cropButton.backgroundColor = [UIColor colorWithRed:98/255.0f green:204/255.0f blue:116/255.0f alpha:1];
+    self.cropButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
+    self.cropButton.layer.cornerRadius = 13;
+    self.cropButton.layer.masksToBounds = YES;
     [self addSubview:self.cropButton];
 }
 
@@ -69,15 +71,8 @@
     }
 }
 
-- (void)ratioButtonAction {
-    if (self.delegate) {
-        [self.delegate onClickRatioButton];
-    }
-}
-
 - (void)cropButtonAction {
     self.cropButton.enabled = NO;
-    self.ratioButton.enabled = NO;
     if (self.delegate) {
         [self.delegate onClickCropButton];
     }

+ 8 - 19
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -284,8 +284,6 @@ extension PublishViewController: AliyunCropViewControllerDelegate {
 // MARK: -
 extension PublishViewController {
     func getAvUrlAssetAndCrop(_ videoItem: KSMediaPickerItemModel) {
-        print("----vItemModel: \(videoItem)")
-        
         let options = PHVideoRequestOptions()
         options.isNetworkAccessAllowed = true
         options.version = PHVideoRequestOptionsVersion.current
@@ -300,7 +298,9 @@ extension PublishViewController {
             cpInfo.sourcePath = urlAsset?.url.path
             cpInfo.type = AliyunCompositionInfoTypeVideo
             
-            self?.jumpToCropVideoVc(cpInfo)
+            DispatchQueue.main.async {
+                self?.jumpToCropVideoVc(cpInfo)
+            }
         })
     }
     
@@ -323,22 +323,11 @@ extension PublishViewController {
         cutConfig?.cutMode = cropMediaConfig.cutMode
         cutConfig?.gpuCrop = cropMediaConfig.gpuCrop
         
-        
-        DispatchQueue.main.async {
-            let cropVc = AliyunCropViewController()
-            cropVc.cutInfo = cutConfig
-            cropVc.delegate = self
-            cropVc.fakeCrop = true
-            
-            //        [cropVC setValue:config forKey:@"cutInfo"];
-            //        [cropVC setValue:self forKey:@"delegate"];
-            //        [cropVC setValue:@(YES) forKey:@"fakeCrop"];
-            
-            
-            self.navigationController?.pushViewController(cropVc, animated: true)
-        }
-        
-        
+        let cropVc = AliyunCropViewController()
+        cropVc.cutInfo = cutConfig
+        cropVc.delegate = self
+        cropVc.fakeCrop = true
+        self.navigationController?.pushViewController(cropVc, animated: true)
     }
     
     // 获取原比例的视频尺寸

+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_left.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "video_edit_left@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "video_edit_left@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_left.imageset/video_edit_left@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_left.imageset/video_edit_left@3x.png


+ 22 - 0
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_right.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "video_edit_right@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "video_edit_right@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_right.imageset/video_edit_right@2x.png


BIN
RainbowPlanet/RainbowPlanet/Supporting Files/PublishModule.xcassets/video_edit_right.imageset/video_edit_right@3x.png