Forráskód Böngészése

调整跳转调用结构

Chris 5 éve
szülő
commit
b38e442b11

+ 0 - 1
RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h

@@ -70,7 +70,6 @@
 
 #import "AliyunMagicCameraViewController.h"
 #import "AliyunCropViewController.h"
-#import "AliyunCoverPickViewController.h"
 #import "AliyunCompositionInfo.h"
 #import "AVAsset+VideoInfo.h"
 #import "AliyunMediator.h"

+ 0 - 8
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunEffectMvGroup.h

@@ -37,12 +37,4 @@ typedef NS_ENUM(NSInteger, AliyunEffectMVRatio) {
  */
 @property (nonatomic, copy) NSArray <AliyunEffectMvInfo *> *mvList;
 
-/**
- 根据MV比例获取MV资源本地路径
-
- @param r MV比例
- @return MV资源本地路径
- */
-- (NSString *)localResoucePathWithVideoRatio:(AliyunEffectMVRatio)r;
-
 @end

+ 0 - 81
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunEffectMvGroup.m

@@ -10,85 +10,4 @@
 
 @implementation AliyunEffectMvGroup
 
-
-- (NSString *)localResoucePathWithVideoRatio:(AliyunEffectMVRatio)r {
-    
-    if (!self.resourcePath) return nil;
-    
-    NSString *rootPath = [self localMVSourcePath];
-    NSString *folderName = nil;
-    NSArray *subPaths = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:rootPath error:nil];
-    if (subPaths.count) {
-        BOOL hasFolder = NO;
-        for (NSString *subPath in subPaths) {
-            if ([subPath hasPrefix:@"folder"]) {
-                hasFolder = YES;
-                folderName = subPath;
-                break;
-            }
-        }
-        if (!hasFolder) {
-            return rootPath;
-        }
-    }
-    
-    NSString *folder = folderName;
-    NSLog(@"%@",folder);
-    float videoAspect;
-    switch (r) {
-        case AliyunEffectMVRatio1To1:
-            folder = @"folder1.1";
-            videoAspect = 1 / 1.0;
-            break;
-        case AliyunEffectMVRatio16To9:
-            folder = @"folder16.9";
-            videoAspect = 16 / 9.0;
-            break;
-        case AliyunEffectMVRatio9To16:
-            folder = @"folder9.16";
-            videoAspect = 9 / 16.0;
-            break;
-        case AliyunEffectMVRatio4To3:
-            folder = @"folder4.3";
-            videoAspect = 4 / 3.0;
-            break;
-        case AliyunEffectMVRatio3To4:
-            folder = @"folder1.1";
-            videoAspect = 3 / 4.0;
-            break;
-        default:
-            break;
-    }
-    if (folder) {
-        NSString *path = [rootPath stringByAppendingPathComponent:folder];
-        BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:path];
-        if (exists) {
-            return path;
-        } else {
-            // 不存在时  取分辨率最近值的mv
-            NSDictionary *dic = @{@(fabs(videoAspect - (9/16.0))):@"folder9.16",
-                                  @(fabs(videoAspect - (3/4.0))):@"folder3.4",
-                                  @(fabs(videoAspect - (1.0))):@"folder1.1",
-                                  @(fabs(videoAspect - (4/3.0))):@"folder4.3",
-                                  @(fabs(videoAspect - (16/9.0))):@"folder16.9"};
-            NSArray *keySort = [[dic allKeys] sortedArrayUsingSelector:@selector(compare:)];
-            
-            for (int index = 0; index < keySort.count; index ++) {
-                NSNumber *currentMinKey = keySort[index];
-                NSString *currentPath = [rootPath stringByAppendingPathComponent:[dic objectForKey:currentMinKey]];
-                if ([[NSFileManager defaultManager] fileExistsAtPath:currentPath]){
-                    NSLog(@"mvPath:%@", currentPath);
-                    return currentPath;
-                }
-            }
-
-        }
-    }
-    return rootPath;
-}
-
-- (NSString *)localMVSourcePath {
-    return [NSHomeDirectory() stringByAppendingPathComponent:self.resourcePath];
-}
-
 @end

+ 12 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/VideoEdit/Controller/AliyunEditViewController.m

@@ -37,7 +37,7 @@
 #import "AliyunTimelineMediaInfo.h"
 #import "AliyunTimelineView.h"
 
-
+#import "AliyunCoverPickViewController.h"
 #import "AliyunEditButtonsView.h"
 
 //其它
@@ -620,8 +620,17 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
     [self.player stop];
     [self.editor stopEdit];
     
-    NSDictionary *coverDic = @{@"outputSize":@(_outputSize), @"videoPath":_config.outputPath};
-    [[NSNotificationCenter defaultCenter] postNotificationName: @"PushNotificationEditToCover" object: coverDic];
+    AliyunCoverPickViewController *vc = [AliyunCoverPickViewController new];
+    vc.outputSize = _outputSize;
+    vc.videoPath = _config.outputPath;
+    vc.finishHandler = ^(UIImage *image) {
+//        _image = image;
+//        _coverImageView.image = image;
+//        _backgroundView.image = image;
+        
+        NSLog(@"----coverImage == %@", image);
+    };
+    [self.navigationController pushViewController:vc animated:YES];
 }
 
 #pragma mark - Notification

+ 0 - 31
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishViewController.swift

@@ -11,11 +11,6 @@ import JXSegmentedView
 
 class PublishViewController: BaseViewController {
     
-    weak var observe : NSObjectProtocol?
-    deinit {
-        NotificationCenter.default.removeObserver(observe as Any)
-    }
-    
     // 视频选择页参数配置类
     var mediaConfig: AliyunMediaConfig {
         //默认配置
@@ -48,37 +43,11 @@ class PublishViewController: BaseViewController {
         setupViews()
         setupLayouts()
         setupData()
-        
-        let operationQueue = OperationQueue.main
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "PushNotificationEditToCover"), object: nil, queue: operationQueue) {
-            [weak self] (notification) in
-            let paraDic = notification.object as! Dictionary<String, Any>
-            let coverVc = AliyunCoverPickViewController()
-            coverVc.outputSize = paraDic["outputSize"] as! CGSize
-            coverVc.videoPath = paraDic["videoPath"] as? String
-            coverVc.finishHandler = {
-                [weak self] (image) in
-                print("----image:\n\(image)")
-            }
-            
-            self?.navigationController?.pushViewController(coverVc, animated: true)
-            
-//            AliyunCoverPickViewController *vc = [AliyunCoverPickViewController new];
-//            vc.outputSize = _outputSize;
-//            vc.videoPath = _config.outputPath;
-//            vc.finishHandler = ^(UIImage *image) {
-//                _image = image;
-//                _coverImageView.image = image;
-//                _backgroundView.image = image;
-//            };
-//            [self.navigationController pushViewController:vc animated:YES];
-        }
     }
     
     override func setupViews() {        
         view.addSubview(listContainerView)
         view.addSubview(segmentedView)
-
     }
     
     override func setupLayouts() {