Browse Source

裁剪fixed

Chris 5 years ago
parent
commit
edca25ba47

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoCommonFile/Tools/PathManager/AliyunPathManager.m

@@ -13,11 +13,11 @@
 #pragma mark - Public
 
 + (NSString *)aliyunRootPath {
-    return [[self rootPath] stringByAppendingPathComponent:@"com.duanqu.demo"];
+    return [[self rootPath] stringByAppendingPathComponent:@"com.rainbow.project"];
 }
 
 + (NSString *)quCachePath {
-    return [[self cachePath] stringByAppendingPathComponent:@"com.duanqu.demo"];
+    return [[self cachePath] stringByAppendingPathComponent:@"com.rainbow.project"];
 }
 
 + (NSString *)compositionRootDir {
@@ -26,7 +26,7 @@
 
 + (NSString *)quRelativeRootPath {
     
-    return @"Documents/com.duanqu.demo";
+    return @"Documents/com.rainbow.project";
 }
 
 //+ (NSString *)createCompositionDir {

+ 2 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoCrop/Controller/AliyunCropViewController.m

@@ -118,7 +118,7 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     [self.previewScrollView addGestureRecognizer:tapGesture];
     
     if (!_cutInfo.phAsset) {
-        self.thumbnailView = [[AliyunCropThumbnailView alloc] initWithFrame:CGRectMake(0, ScreenHeight - 40 - ScreenWidth/8.0 - 12 - SafeBottom, ScreenWidth, ScreenWidth / 8 + 12) withCutInfo:_cutInfo];
+        self.thumbnailView = [[AliyunCropThumbnailView alloc] initWithFrame:CGRectMake(0, ScreenHeight - 20 - 110 - SafeBottom, ScreenWidth, 110) withCutInfo:_cutInfo];
         self.thumbnailView.delegate = (id<AliyunCutThumbnailViewDelegate>)self;
         [self.view addSubview:self.thumbnailView];
     }
@@ -369,8 +369,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     }
     _cutPanel = [[AliyunCrop alloc] init];
     _cutPanel.delegate = (id<AliyunCropDelegate>)self;
-//    _cutPanel.inputPath = tmp32Path;
-//    _cutPanel.outputPath = mp32Path;
     _cutPanel.inputPath = _cutInfo.sourcePath;
     _cutPanel.outputPath = _cutInfo.outputPath;
 
@@ -406,7 +404,7 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     
     NSLog(@"TestLog, %@:%@", @"log_crop_start_time", @([NSDate date].timeIntervalSince1970));
 
-    int res =[_cutPanel startCrop];
+    int res = [_cutPanel startCrop];
     if (res == -100002){
         dispatch_async(dispatch_get_main_queue(), ^{
             [MBProgressHUD showWarningMessage:@"当前视频格式不支持" inView:[UIApplication sharedApplication].keyWindow];

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

@@ -56,11 +56,11 @@
 
 - (void)setupCollectionView {
     UICollectionViewFlowLayout *followLayout = [[UICollectionViewFlowLayout alloc] init];
-    followLayout.itemSize = CGSizeMake(ScreenWidth / 8.0 , ScreenWidth / 8.0);
+    followLayout.itemSize = CGSizeMake(ScreenWidth / 8.0 , 72);
     followLayout.minimumLineSpacing = 0;
     followLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
     
-    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 12, ScreenWidth, ScreenWidth / 8.0) collectionViewLayout:followLayout];
+    _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 38, ScreenWidth, 72) collectionViewLayout:followLayout];
     _collectionView.dataSource = (id<UICollectionViewDataSource>)self;
     [_collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"];
     [self addSubview:_collectionView];
@@ -69,29 +69,29 @@
 - (void)setupSubviews {
     
     _progressView = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"progress"]];
-    _progressView.bounds = CGRectMake(0, 0, ScreenWidth / 8.0, ScreenWidth / 8.0);
+    _progressView.bounds = CGRectMake(0, 0, ScreenWidth / 8.0, 72);
     _progressView.center = CGPointMake(0, CGRectGetMidY(self.bounds) + 6);
     [self addSubview:_progressView];
     
-    _durationLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 0, ScreenWidth - 200, 12)];
-    _durationLabel.textColor = RGBToColor(240, 84, 135);
-    _durationLabel.textAlignment = 1;
-    _durationLabel.font = [UIFont systemFontOfSize:12];
+    _durationLabel = [[UILabel alloc] initWithFrame:CGRectMake(14, 0, ScreenWidth - 200, 18)];
+    _durationLabel.textColor = [UIColor whiteColor];
+    _durationLabel.textAlignment = UITextAlignmentLeft;
+    _durationLabel.font = [UIFont systemFontOfSize:13];
     [self addSubview:_durationLabel];
     
     _imageViewWith = ScreenWidth / 8.0 * 0.35;
     _imageViewLeft = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_left"]];
-    _imageViewLeft.frame = CGRectMake(0, 12, _imageViewWith, ScreenWidth / 8.0);
+    _imageViewLeft.frame = CGRectMake(0, 38, _imageViewWith, 72);
     _imageViewLeft.userInteractionEnabled = YES;
     _imageViewRight = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"video_edit_right"]];
-    _imageViewRight.frame = CGRectMake(ScreenWidth - _imageViewWith, 12, _imageViewWith, ScreenWidth / 8.0);
+    _imageViewRight.frame = CGRectMake(ScreenWidth - _imageViewWith, 38, _imageViewWith, 72);
     _imageViewRight.userInteractionEnabled = YES;
     
     
-    _topLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3 , 12, ScreenWidth - _imageViewWith *2 + 6, 3)];
+    _topLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3 , 38, ScreenWidth - _imageViewWith *2 + 6, 3)];
     _topLineView.backgroundColor = [AliyunIConfig config].cutTopLineColor;
     
-    _underLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3, _imageViewLeft.frame.size.height + 12 - 3  , ScreenWidth - _imageViewWith *2 + 6, 3)];
+    _underLineView = [[UIImageView alloc]initWithFrame:CGRectMake(_imageViewWith - 3, _imageViewLeft.frame.size.height + 38 - 3  , ScreenWidth - _imageViewWith *2 + 6, 3)];
     _underLineView.backgroundColor = [AliyunIConfig config].cutBottomLineColor;
     
     [self addSubview:_topLineView];
@@ -101,8 +101,8 @@
     [self addSubview:_imageViewRight];
     
 
-    _imageViewLeftMask = [[UIImageView alloc]initWithFrame:CGRectMake(0, 12, 0, _imageViewLeft.frame.size.height)];
-    _imageViewRightMask = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageViewRight.frame), 12, 0, _imageViewLeft.frame.size.height)];
+    _imageViewLeftMask = [[UIImageView alloc]initWithFrame:CGRectMake(0, 38, 0, _imageViewLeft.frame.size.height)];
+    _imageViewRightMask = [[UIImageView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageViewRight.frame), 38, 0, _imageViewLeft.frame.size.height)];
     
     _imageViewLeftMask.backgroundColor = [AliyunIConfig config].backgroundColor;
     _imageViewLeftMask.alpha = 0.8;
@@ -113,14 +113,14 @@
     [self addSubview:_imageViewRightMask];
 
     _imageViewBackground = [[UIImageView alloc] initWithImage:[AliyunImage imageNamed:@"paster_time_edit_slider_bg"]];
-    _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
+    _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
     [self addSubview:_imageViewBackground];
     
 }
 
 - (void)loadThumbnailData {
     
-    _durationLabel.text = [NSString stringWithFormat:@"%.2f",_cutInfo.endTime - _cutInfo.startTime];
+    _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs",_cutInfo.endTime - _cutInfo.startTime];
     CMTime startTime = kCMTimeZero;
     NSMutableArray *array = [NSMutableArray array];
 //    CMTime addTime = CMTimeMake(1000,1000);
@@ -233,8 +233,8 @@
             _imageViewLeftMask.frame = maskFrame;
             
             _cutInfo.startTime = left;
-            _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
-            _durationLabel.text = [NSString stringWithFormat:@"%.2f",_cutInfo.endTime - _cutInfo.startTime];
+            _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
+            _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs",_cutInfo.endTime - _cutInfo.startTime];
             if ([_delegate respondsToSelector:@selector(cutBarDidMovedToTime:)]) {
                 [_delegate cutBarDidMovedToTime:left];
             }
@@ -251,8 +251,8 @@
             maskFrame.origin.x = frame.origin.x + frame.size.width;
             maskFrame.size.width = ScreenWidth - maskFrame.origin.x;
             _imageViewRightMask.frame = maskFrame;
-            _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), ScreenWidth / 8.0);
-            _durationLabel.text = [NSString stringWithFormat:@"%.2f", _cutInfo.endTime - _cutInfo.startTime];
+            _imageViewBackground.frame = CGRectMake(CGRectGetMaxX(_imageViewLeft.frame), CGRectGetMinY(_imageViewLeft.frame), CGRectGetMinX(_imageViewRight.frame) - CGRectGetMaxX(_imageViewLeft.frame), 72);
+            _durationLabel.text = [NSString stringWithFormat:@"已选取%.1fs", _cutInfo.endTime - _cutInfo.startTime];
             if ([_delegate respondsToSelector:@selector(cutBarDidMovedToTime:)]) {
                 [_delegate cutBarDidMovedToTime:right];
             }

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

@@ -8,6 +8,7 @@
 
 #import "AliyunCropViewBottomView.h"
 #import "AVC_ShortVideo_Config.h"
+#import "AlivcMacro.h"
 
 @interface AliyunCropViewBottomView ()
 
@@ -46,7 +47,7 @@
     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.backgroundColor = RGBToColor(98, 204, 116);
     self.cropButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
     self.cropButton.layer.cornerRadius = 13;
     self.cropButton.layer.masksToBounds = YES;