Explorar o código

剔除播放/编辑废弃的OC代码

Chris %!s(int64=5) %!d(string=hai) anos
pai
achega
4e5f5cdcf5

+ 1 - 13
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -500,9 +500,7 @@
 		BD108C9B22A60C3300837DAB /* HGImage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD108C9922A60C3300837DAB /* HGImage.storyboard */; };
 		BD10CD0C22BFCC7C0040796E /* PublishMusicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD10CD0B22BFCC7C0040796E /* PublishMusicView.swift */; };
 		BD10FBFE22C6F7D90096A34E /* AliyunPublishService.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FBFB22C6F7D80096A34E /* AliyunPublishService.m */; };
-		BD10FBFF22C6F7D90096A34E /* AlivcShortVideoPublishManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FBFD22C6F7D90096A34E /* AlivcShortVideoPublishManager.m */; };
 		BD10FC0222C6F9770096A34E /* AlivcShortVideoUploadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FC0022C6F9770096A34E /* AlivcShortVideoUploadManager.m */; };
-		BD10FC0522C6F9880096A34E /* AliyunSVideoApi.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FC0322C6F9870096A34E /* AliyunSVideoApi.m */; };
 		BD10FC0822C748DA0096A34E /* AlivcAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD10FC0622C748D90096A34E /* AlivcAlertView.m */; };
 		BD11D64222E02520008FFA58 /* MusicPlayManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD11D64122E02520008FFA58 /* MusicPlayManager.swift */; };
 		BD12203622AF807C0051C7C2 /* MessagePlanetActivityController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD12203522AF807C0051C7C2 /* MessagePlanetActivityController.swift */; };
@@ -1238,14 +1236,10 @@
 		BD108C9822A60C3200837DAB /* HGImage.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = HGImage.xcassets; sourceTree = "<group>"; };
 		BD108C9922A60C3300837DAB /* HGImage.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = HGImage.storyboard; sourceTree = "<group>"; };
 		BD10CD0B22BFCC7C0040796E /* PublishMusicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishMusicView.swift; sourceTree = "<group>"; };
-		BD10FBFA22C6F7D70096A34E /* AlivcShortVideoPublishManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcShortVideoPublishManager.h; sourceTree = "<group>"; };
 		BD10FBFB22C6F7D80096A34E /* AliyunPublishService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunPublishService.m; sourceTree = "<group>"; };
 		BD10FBFC22C6F7D80096A34E /* AliyunPublishService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunPublishService.h; sourceTree = "<group>"; };
-		BD10FBFD22C6F7D90096A34E /* AlivcShortVideoPublishManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcShortVideoPublishManager.m; sourceTree = "<group>"; };
 		BD10FC0022C6F9770096A34E /* AlivcShortVideoUploadManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcShortVideoUploadManager.m; sourceTree = "<group>"; };
 		BD10FC0122C6F9770096A34E /* AlivcShortVideoUploadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcShortVideoUploadManager.h; sourceTree = "<group>"; };
-		BD10FC0322C6F9870096A34E /* AliyunSVideoApi.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunSVideoApi.m; sourceTree = "<group>"; };
-		BD10FC0422C6F9870096A34E /* AliyunSVideoApi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunSVideoApi.h; sourceTree = "<group>"; };
 		BD10FC0622C748D90096A34E /* AlivcAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlivcAlertView.m; sourceTree = "<group>"; };
 		BD10FC0722C748DA0096A34E /* AlivcAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlivcAlertView.h; sourceTree = "<group>"; };
 		BD11D64122E02520008FFA58 /* MusicPlayManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlayManager.swift; sourceTree = "<group>"; };
@@ -5375,14 +5369,10 @@
 				BD6122A322C3638300D3F513 /* AliyunEffectMvInfo.m */,
 				BD0808EB22C5BA3000D12E6A /* AliyunCompositionInfo.h */,
 				BD0808EA22C5BA3000D12E6A /* AliyunCompositionInfo.m */,
-				BD10FBFA22C6F7D70096A34E /* AlivcShortVideoPublishManager.h */,
-				BD10FBFD22C6F7D90096A34E /* AlivcShortVideoPublishManager.m */,
 				BD10FBFC22C6F7D80096A34E /* AliyunPublishService.h */,
 				BD10FBFB22C6F7D80096A34E /* AliyunPublishService.m */,
 				BD10FC0122C6F9770096A34E /* AlivcShortVideoUploadManager.h */,
 				BD10FC0022C6F9770096A34E /* AlivcShortVideoUploadManager.m */,
-				BD10FC0422C6F9870096A34E /* AliyunSVideoApi.h */,
-				BD10FC0322C6F9870096A34E /* AliyunSVideoApi.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -5505,8 +5495,8 @@
 		BDA45BFD22E45DDD009DE548 /* PublishManager */ = {
 			isa = PBXGroup;
 			children = (
-				BDA45BFE22E45EBC009DE548 /* PublishUploadProgressView.swift */,
 				BDA45C0022E47283009DE548 /* PublishUploadManager.swift */,
+				BDA45BFE22E45EBC009DE548 /* PublishUploadProgressView.swift */,
 			);
 			path = PublishManager;
 			sourceTree = "<group>";
@@ -6107,7 +6097,6 @@
 				A7FF1579228C82CE00A85748 /* OrderDetailViewController.swift in Sources */,
 				A7FF159C228D9E3D00A85748 /* OrderRefundDetailModel.swift in Sources */,
 				A76B786922CE04940047EC1B /* CommunityRecommendDetailHTMLTableViewCell.swift in Sources */,
-				BD10FC0522C6F9880096A34E /* AliyunSVideoApi.m in Sources */,
 				A7C3DD1C226422D200FA262E /* SwiftMoyaNetWorkServiceSMS.swift in Sources */,
 				BDF862A2228E41CC000DEF84 /* OrderLogisticsInfoCell.swift in Sources */,
 				A72623D322C1FFD100AEF875 /* CommunityPostMyModel.swift in Sources */,
@@ -6347,7 +6336,6 @@
 				A71738AD228AB7B2000AEA6A /* ProductCommentListModel.swift in Sources */,
 				A7C0FDF822B6671C00BC1E86 /* PopularVideoCollectionViewCell.swift in Sources */,
 				BD6122F922C36A8100D3F513 /* UIView+Progress.m in Sources */,
-				BD10FBFF22C6F7D90096A34E /* AlivcShortVideoPublishManager.m in Sources */,
 				BD61229522C3605C00D3F513 /* AliyunEffectModelTransManager.m in Sources */,
 				A7E19FA822BA2CDF009BCCE1 /* SearchProductListViewController.swift in Sources */,
 				BD4B50AE22BC815F0073B516 /* PublishFilterCollectionCell.swift in Sources */,

+ 0 - 135
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoPublishManager.h

@@ -1,135 +0,0 @@
-//
-//  AlivcShortVideoPublishManager.h
-//  AliyunVideoClient_Entrance
-//
-//  Created by Zejian Cai on 2019/1/6.
-//  Copyright © 2019年 Alibaba. All rights reserved.
-//  发布管理器:先内部合成,再上传
-
-#import <Foundation/Foundation.h>
-#import "AliyunPublishService.h"
-
-@class AlivcShortVideoPublishManager;
-@class AliyunMediaConfig;
-@class AliyunUploadSVideoInfo;
-
-typedef NS_ENUM(NSInteger,AlivcPublishStatus){
-    AlivcPublishStatusNoTStart = 0,
-    AlivcPublishStatusSuccess = 1,
-    AlivcPublishStatusPublishing,
-    AlivcPublishStatusFailure,
-    AlivcPublishStatusCancel,
-};
-
-NS_ASSUME_NONNULL_BEGIN
-
-@protocol AlivcShortVideoPublishManagerDelegate <NSObject>
-
-@required
-/**
- 发布状态回调
- 
- @param manager manager
- @param newStatus 新的状态
- */
-- (void)publishManager:(AlivcShortVideoPublishManager *)manager uploadStatusChangedTo:(AlivcPublishStatus )newStatus;
-
-/**
- 发布进度回调
- 
- @param manager manager
- @param progress 0-1
- */
-- (void)publishManager:(AlivcShortVideoPublishManager *)manager updateProgress:(CGFloat )progress;
-
-@optional
-
-- (void)publishManager:(AlivcShortVideoPublishManager *)manager succesWithVid:(NSString *)vid coverImageUrl:(NSString *)imageUrl;
-
-@end
-
-@interface AlivcShortVideoPublishManager : NSObject
-
-/**
- 单例 - 主要为了使用方便和模块间的低耦合
- 
- @return 实例
- */
-+ (instancetype)shared;
-
-/**
- 本次合成与上传发生事情的回调代理
- */
-@property (nonatomic, weak) id<AlivcShortVideoPublishManagerDelegate> managerDelegate;
-
-
-/**
- 要发布的视频信息
- */
-@property (nonatomic, copy, readonly) AliyunUploadSVideoInfo *videoInfo;
-
-
-
-/**
- 存储相册资源
-
- @param asset 相册资源
- */
-- (void)saveResources:(id )asset;
-
-/**
- 设置合成信息
- 
- @param taskPath 视频的地址
- @param mediaConfig 配置信息
- */
-- (void)setVideoPath:(NSString *)taskPath videoConfig:(AliyunMediaConfig *)mediaConfig;
-
-
-/**
- 设置上传信息
- 
- @param image 封面
- @param videoInfo 视频信息
- */
-- (void)setCoverImag:(UIImage *)image videoInfo:(AliyunUploadSVideoInfo *)videoInfo;
-
-/**
- 设置上传凭证信息 - sts方式
-
- @param keyId key
- @param keySecret secret
- @param token token
- */
-//- (void)setUploadInfoWithKey:(NSString *)keyId secres:(NSString *)keySecret token:(NSString *)token;
-
-/**
- 开始发布
- @param saveToAlbum 完成的时候是否保存至相册
- @return 成功或者失败
- */
-- (BOOL)startPublishWithSaveToAlbum:(BOOL)saveToAlbum;
-
-/**
- 取消发布
- */
-- (void)cancelPublish;
-
-/**
- 重新发布 - 用于发布过程中退后台再进来等操作
- */
-- (BOOL)restartPublishFromPreCurrentStatus;
-
-/**
- 结束整个发布流程, 用于发布成功或者异常,由外部调用。与startPublish对应,取消发布内部自己会调用这个方法
- */
-- (void)endPublishFlow;
-
-- (UIImage *)coverImage;
-
-- (AlivcPublishStatus )currentStatus;
-
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 320
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoPublishManager.m

@@ -1,320 +0,0 @@
-//
-//  AlivcShortVideoPublishManager.m
-//  AliyunVideoClient_Entrance
-//
-//  Created by Zejian Cai on 2019/1/6.
-//  Copyright © 2019年 Alibaba. All rights reserved.
-//
-
-#import "AlivcShortVideoPublishManager.h"
-#import <AssetsLibrary/AssetsLibrary.h>
-
-#import "AlivcShortVideoUploadManager.h"
-#import "AliyunMediaConfig.h"
-
-
-@interface AlivcShortVideoPublishManager () <
-AliyunIExporterCallback, AlivcShortVideoUploadManagerDelegate>
-
-//合成相关属性记录
-@property(strong, nonatomic) NSString *taskPath;
-//视频配置信息
-@property(strong, nonatomic) AliyunMediaConfig *mediaConfig;
-//合成完成之后是否保存至相册
-@property(assign, nonatomic) BOOL saveToAlbum;
-
-//在相册选择里导入的资源,这里要存储下,避免被销毁导致合成失败
-@property(strong, nonatomic) NSArray *assets;
-
-//封面图
-@property(nonatomic, copy) UIImage *coverImage;
-//发布状态记录
-@property(nonatomic, assign) AlivcPublishStatus newStatus;
-//上传sts相关属性l记录
-//@property(strong, nonatomic) NSString *key;
-//@property(strong, nonatomic) NSString *secret;
-//@property(strong, nonatomic) NSString *token;
-
-/**
- 先合成-再上传,YES:当前出于上传步骤 NO:当前出于合成步骤
- */
-@property(assign, nonatomic) BOOL isProcessToUpload;
-
-@end
-
-static AlivcShortVideoPublishManager *_instance = nil;
-static CGFloat exportRatio = 0.7; //合成暂用的时间比例
-
-@implementation AlivcShortVideoPublishManager
-#pragma mark - 单例
-
-+ (instancetype)shared {
-    if (_instance == nil) {
-        
-        _instance = [[AlivcShortVideoPublishManager alloc] init];
-    }
-    
-    return _instance;
-}
-
-+ (instancetype)allocWithZone:(struct _NSZone *)zone {
-    
-    if (_instance == nil) {
-        
-        _instance = [super allocWithZone:zone];
-    }
-    
-    return _instance;
-}
-
-- (id)copy {
-    
-    return self;
-}
-
-- (id)mutableCopy {
-    
-    return self;
-}
-
-- (id)copyWithZone:(NSZone *)zone {
-    
-    return self;
-}
-
-- (id)mutableCopyWithZone:(NSZone *)zone {
-    
-    return self;
-}
-
-#pragma mark - Publish Method
-- (void)setVideoPath:(NSString *)taskPath videoConfig:(AliyunMediaConfig *)mediaConfig {
-    _taskPath = taskPath;
-    _mediaConfig = mediaConfig;
-}
-
-- (void)setCoverImag:(UIImage *)image
-           videoInfo:(AliyunUploadSVideoInfo *)videoInfo {
-    _coverImage = image;
-    _videoInfo = videoInfo;
-}
-
-//- (void)setUploadInfoWithKey:(NSString *)keyId secres:(NSString *)keySecret token:(NSString *)token{
-//    _key = keyId;
-//    _secret = keySecret;
-//    _token = token;
-//}
-
-- (BOOL)startPublishWithSaveToAlbum:(BOOL)saveToAlbum {
-    _isProcessToUpload = NO;
-    if (_taskPath && _mediaConfig.outputPath) {
-        _saveToAlbum = saveToAlbum;
-        [AliyunPublishService service].exportCallback = self;
-        BOOL isSuccess = [[AliyunPublishService service]exportWithTaskPath:_taskPath outputPath:_mediaConfig.outputPath];
-        return isSuccess;
-    }else{
-        return NO;
-    }
-}
-
-- (void)cancelPublish {
-    [[AliyunPublishService service] cancelExport];
-    [[AliyunPublishService service] cancelUpload];
-    //由外界调用的话把状态至为fail,不至为cancel,cancel是退后台,SDK自动cancel了才是cancel状态
-    _newStatus = AlivcPublishStatusFailure;
-    [self endPublishFlow];
-}
-
-- (void)saveResources:(id)asset{
-    if ([asset isKindOfClass:[NSArray class]]) {
-        self.assets = asset;
-    }
-}
-
-- (void)endPublishFlow{
-    [self p_clearData];
-}
-
-- (void)p_clearData{
-    _taskPath = nil;
-    _mediaConfig = nil;
-//    _key = nil;
-//    _secret = nil;
-//    _token = nil;
-    _coverImage = nil;
-    _assets = nil;
-    _newStatus = AlivcPublishStatusNoTStart;
-}
-
-- (BOOL)restartPublishFromPreCurrentStatus{
-    if (_isProcessToUpload) {
-        return [self startUpload];
-    }else{
-        // - 短视频3.8.0版本及之后后台SDK会自动合成,所以这里注释掉
-//        return [self startPublishWithSaveToAlbum:_saveToAlbum];
-       
-    }
-    return YES;
-}
-
-- (UIImage *)coverImage {
-    return _coverImage;
-}
-
-- (AlivcPublishStatus)currentStatus {
-    return _newStatus;
-}
-
-
-
-#pragma mark - AliyunIExporterCallback
-- (void)exportProgress:(float)progress {
-    CGFloat allProgress = progress * exportRatio;
-    if (_managerDelegate && [_managerDelegate respondsToSelector:@selector
-                             (publishManager:updateProgress:)]) {
-        [_managerDelegate publishManager:self updateProgress:allProgress];
-    }
-}
-
-- (void)exporterDidCancel {
-    _newStatus = AlivcPublishStatusCancel;
-    if (_managerDelegate &&
-        [_managerDelegate respondsToSelector:@selector(publishManager:
-                                                       uploadStatusChangedTo:)]) {
-        [_managerDelegate publishManager:self
-                   uploadStatusChangedTo:AlivcPublishStatusCancel];
-    }
-}
-
-- (void)exporterDidStart {
-    _newStatus = AlivcPublishStatusPublishing;
-    if (_managerDelegate &&
-        [_managerDelegate respondsToSelector:@selector(publishManager:
-                                                       uploadStatusChangedTo:)]) {
-        [_managerDelegate publishManager:self
-                   uploadStatusChangedTo:AlivcPublishStatusPublishing];
-    }
-}
-
-- (void)exportError:(int)errorCode {
-    _newStatus = AlivcPublishStatusFailure;
-    if (_managerDelegate &&
-        [_managerDelegate respondsToSelector:@selector(publishManager:
-                                                       uploadStatusChangedTo:)]) {
-        [_managerDelegate publishManager:self
-                   uploadStatusChangedTo:AlivcPublishStatusFailure];
-    }
-}
-
-- (void)exporterDidEnd:(NSString *)outputPath {
-    if (_saveToAlbum) {
-        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
-        [library writeVideoAtPathToSavedPhotosAlbum:[NSURL
-                                                     fileURLWithPath:_mediaConfig
-                                                     .outputPath]
-                                    completionBlock:^(NSURL *assetURL, NSError *error) {
-                                        NSLog(@"视频已保存到相册");
-                                    }];
-    }
-    [self startUpload];
-    
-}
-
-- (BOOL)startUpload{
-    BOOL startUploadSuccess = NO;
-    _isProcessToUpload = YES;
-    //进度到exportRatio,然后开始上传
-    if (_managerDelegate && [_managerDelegate respondsToSelector:@selector
-                             (publishManager:updateProgress:)]) {
-        [_managerDelegate publishManager:self updateProgress:exportRatio];
-    }
-    
-    UIImage *coverImage = nil;
-    if (_coverImage) {
-        coverImage = _coverImage;
-    } else {
-        //取第一帧 - 外界确认一定有值,这里没法取第一帧
-    }
-    
-    AliyunUploadSVideoInfo *vInfo = nil;
-    if (_videoInfo) {
-        vInfo = _videoInfo;
-        if ([vInfo.title isEqualToString:@""] || !vInfo.title) {
-            vInfo.title = @"Default Title";
-        }
-    } else {
-        //生成必要的默认值
-        vInfo = [[AliyunUploadSVideoInfo alloc]init];
-        vInfo.title = @"Default Title";
-    }
-    
-    NSString *coverPath = [_taskPath stringByAppendingPathComponent:@"cover.png"];
-    if (!coverImage) {
-        return NO;
-    }
-    NSData *data = UIImagePNGRepresentation(coverImage);
-    [data writeToFile:coverPath atomically:YES];
-    [[AlivcShortVideoUploadManager shared] setManagerDelegate:self];
-    [[AlivcShortVideoUploadManager shared] setCoverImagePath:coverPath
-                                                   videoInfo:vInfo videoPath:self.mediaConfig.outputPath];
-    [[AlivcShortVideoUploadManager shared]startUpload];
-    return YES;
-}
-
-#pragma mark - AlivcShortVideoUploadManagerDelegate
-
-- (void)uploadManager:(AlivcShortVideoUploadManager *)manager
-       updateProgress:(CGFloat)progress {
-    
-    dispatch_async(dispatch_get_main_queue(), ^{
-        CGFloat allProgress = progress * (1 - exportRatio) + exportRatio;
-        if (_managerDelegate &&
-            [_managerDelegate respondsToSelector:@selector(publishManager:
-                                                           updateProgress:)]) {
-            [_managerDelegate publishManager:self updateProgress:allProgress];
-        }
-    });
-}
-
-- (void)uploadManager:(AlivcShortVideoUploadManager *)manager
-uploadStatusChangedTo:(AlivcUploadStatus)newStatus {
-    dispatch_async(dispatch_get_main_queue(), ^{
-        switch (newStatus) {
-            case AlivcUploadStatusCancel:
-                _newStatus = AlivcPublishStatusCancel;
-                break;
-            case AlivcUploadStatusFailure:
-                _newStatus = AlivcPublishStatusFailure;
-                break;
-            case AlivcUploadStatusSuccess:
-                _newStatus = AlivcPublishStatusSuccess;
-                break;
-            case AlivcUploadStatusUploading:
-                _newStatus = AlivcPublishStatusPublishing;
-                break;
-                
-            default:
-                break;
-        }
-        
-        if (_managerDelegate &&
-            [_managerDelegate respondsToSelector:@selector(publishManager:
-                                                           uploadStatusChangedTo:)]) {
-            [_managerDelegate publishManager:self uploadStatusChangedTo:_newStatus];
-        }
-    });
-}
-
-- (void)uploadManager:(AlivcShortVideoUploadManager *)manager succesWithVid:(NSString *)vid coverImageUrl:(NSString *)imageUrl{
-    dispatch_async(dispatch_get_main_queue(), ^{
-        
-        if (_managerDelegate && [_managerDelegate respondsToSelector:@selector(publishManager:succesWithVid:coverImageUrl:)]) {
-            [_managerDelegate publishManager:self succesWithVid:vid coverImageUrl:imageUrl];
-        }
-        
-        
-    });
-}
-
-
-@end

+ 0 - 10
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AlivcShortVideoUploadManager.m

@@ -8,8 +8,6 @@
 
 #import "AlivcShortVideoUploadManager.h"
 #import "AliyunMediaConfig.h"
-#import "AliyunPublishService.h"
-#import "AliyunSVideoApi.h"
 #import <sys/utsname.h>
 
 @interface AlivcShortVideoUploadManager () <AliyunIVodUploadCallback>
@@ -161,14 +159,6 @@ static AliyunVodPublishManager *_uploadManager = nil;
     
     [_uploadManager refreshWithUploadAuth:self.uploadAuth];
     
-//    [AliyunSVideoApi refreshVideoUploadAuthWithToken:[AliVideoClientUser shared].token videoId:self.videoId handler:^(NSString * _Nullable uploadAddress, NSString * _Nullable uploadAuth, NSError * _Nullable error) {
-//        if (error) {
-//            NSLog(@"error:%@", error.description);
-//            [self handleUploadFailed];
-//            return;
-//        }
-//        [_uploadManager refreshWithUploadAuth:uploadAuth];
-//    }];
 }
 
 

+ 0 - 66
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunSVideoApi.h

@@ -1,66 +0,0 @@
-//
-//  AliyunSVideoApi.h
-//  qusdk
-//
-//  Created by Worthy Zhang on 2019/1/2.
-//  Copyright © 2019 Alibaba Group Holding Limited. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface AliyunSVideoApi : NSObject
-
-
-/**
- 获取图片上传的凭证
-
- @param tokenString 用户token
- @param title 标题
- @param filePath 图片路径
- @param tags tag-标签
- @param handler 回调
- */
-+ (void)getImageUploadAuthWithToken:(NSString *_Nullable)tokenString
-                              title:(NSString * _Nullable)title
-                           filePath:(NSString *)filePath
-                               tags:(NSString * _Nullable)tags
-                            handler:(void (^)(NSString *_Nullable uploadAddress, NSString *_Nullable uploadAuth, NSString *_Nullable imageURL, NSString *_Nullable imageId, NSError *_Nullable error))handler;
-
-
-/**
- 获取视频上传的凭证
-
- @param tokenString 用户token
- @param title 视频标题
- @param filePath 视频路径
- @param coverURL 封面图
- @param desc 描述
- @param tags tag-标签
- @param handler 回调
- */
-+ (void)getVideoUploadAuthWithWithToken:(NSString *_Nullable)tokenString
-                                  title:(NSString *)title
-                               filePath:(NSString *)filePath
-                               coverURL:(NSString * _Nullable)coverURL
-                                   desc:(NSString *_Nullable)desc
-                                   tags:(NSString * _Nullable)tags
-                                handler:(void (^)(NSString *_Nullable uploadAddress, NSString *_Nullable uploadAuth, NSString *_Nullable videoId, NSError *_Nullable error))handler;
-
-/**
- 刷新视频上传凭证
-
- @param tokenString 用户凭证
- @param videoId 视频id
- @param handler 回调
- */
-+ (void)refreshVideoUploadAuthWithToken:(NSString *_Nullable)tokenString
-                                videoId:(NSString *)videoId
-                                handler:(void (^)(NSString *_Nullable uploadAddress, NSString *_Nullable uploadAuth, NSError *_Nullable error))handler;
-
-
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 218
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoFile/Common/Model/AliyunSVideoApi.m

@@ -1,218 +0,0 @@
-//
-//  AliyunSVideoApi.m
-//  qusdk
-//
-//  Created by Worthy Zhang on 2019/1/2.
-//  Copyright © 2019 Alibaba Group Holding Limited. All rights reserved.
-//
-
-#import "AliyunSVideoApi.h"
-#import "AlivcDefine.h"
-#import "AlivcMacro.h"
-
-
-@implementation AliyunSVideoApi
-
-+ (void)getImageUploadAuthWithToken:(NSString *)tokenString title:(NSString *)title filePath:(NSString *)filePath tags:(NSString *)tags handler:(void (^)(NSString * _Nullable, NSString * _Nullable, NSString * _Nullable, NSString * _Nullable, NSError * _Nullable))handler{
-    NSMutableDictionary *params = [NSMutableDictionary dictionary];
-    [params addEntriesFromDictionary:@{
-                                       @"imageType":@"cover",
-                                       @"imageExt":filePath.lastPathComponent.pathExtension
-                                       }];
-    if (title) {
-        [params addEntriesFromDictionary:@{@"title":title}];
-    }
-    if (tags) {
-        [params addEntriesFromDictionary:@{@"tags":tags}];
-    }
-    
-    
-    NSString *getUrl = @"/demo/getImageUploadAuth";
-    AlivcOutputProductType type = kAlivcProductType;
-    if (type == AlivcOutputProductTypeSmartVideo) {
-        getUrl = @"/vod/getImageUploadAuth";
-        if (tokenString) {
-            [params addEntriesFromDictionary:@{@"token":tokenString}];
-        }
-    }
-    
-    [self getWithPath:getUrl params:params completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
-        if (error) {
-            handler(nil, nil, nil, nil, error);
-        }else {
-            NSString *uploadAddress = [responseObject objectForKey:@"uploadAddress"];
-            NSString *uploadAuth = [responseObject objectForKey:@"uploadAuth"];
-            NSString *imageURL = [responseObject objectForKey:@"imageURL"];
-            NSString *imageId = [responseObject objectForKey:@"imageId"];
-            handler(uploadAddress, uploadAuth, imageURL, imageId, nil);
-        }
-    }];
-}
-
-+ (void)getVideoUploadAuthWithWithToken:(NSString *)tokenString title:(NSString *)title filePath:(NSString *)filePath coverURL:(NSString *)coverURL desc:(NSString *)desc tags:(NSString *)tags handler:(void (^)(NSString * _Nullable, NSString * _Nullable, NSString * _Nullable, NSError * _Nullable))handler{
-    NSMutableDictionary *params = [NSMutableDictionary dictionary];
-    [params addEntriesFromDictionary:@{
-                                       @"title":title,
-                                       @"fileName":filePath.lastPathComponent
-                                       }];
-    if (coverURL) {
-        [params addEntriesFromDictionary:@{@"coverURL":coverURL}];
-    }
-    if (desc) {
-        [params addEntriesFromDictionary:@{@"description":desc}];
-    }
-    if (tags) {
-        [params addEntriesFromDictionary:@{@"tags":tags}];
-    }
-   
-    NSString *getUrl = @"/demo/getVideoUploadAuth";
-    AlivcOutputProductType type = kAlivcProductType;
-    if (type == AlivcOutputProductTypeSmartVideo) {
-        getUrl = @"/vod/getVideoUploadAuth";
-        if (tokenString) {
-            [params addEntriesFromDictionary:@{@"token":tokenString}];
-        }
-    }
-    
-    [self getWithPath:getUrl params:params completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
-        if (error) {
-            handler(nil, nil, nil, error);
-        }else {
-            NSString *uploadAddress = [responseObject objectForKey:@"uploadAddress"];
-            NSString *uploadAuth = [responseObject objectForKey:@"uploadAuth"];
-            NSString *videoId = [responseObject objectForKey:@"videoId"];
-            handler(uploadAddress, uploadAuth, videoId, nil);
-        }
-    }];
-}
-
-
-+ (void)refreshVideoUploadAuthWithToken:(NSString *)tokenString videoId:(NSString *)videoId handler:(void (^)(NSString * _Nullable, NSString * _Nullable, NSError * _Nullable))handler{
-    NSMutableDictionary *params = [NSMutableDictionary dictionary];
-    if (videoId) {
-        [params addEntriesFromDictionary:@{@"videoId":videoId}];
-    }
-    
-    
-    NSString *getUrl = @"/demo/refreshVideoUploadAuth";
-    AlivcOutputProductType type = kAlivcProductType;
-    if (type == AlivcOutputProductTypeSmartVideo) {
-        getUrl = @"/vod/refreshVideoUploadAuth";
-        if (tokenString) {
-            [params addEntriesFromDictionary:@{@"token":tokenString}];
-        }
-    }
-    [self getWithPath:getUrl params:params completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
-        if (error) {
-            handler(nil, nil, error);
-        }else {
-            NSString *uploadAddress = [responseObject objectForKey:@"uploadAddress"];
-            NSString *uploadAuth = [responseObject objectForKey:@"uploadAuth"];
-            handler(uploadAddress, uploadAuth, nil);
-        }
-    }];
-}
-
-
-
-
-#pragma mark - Private Method
-
-+ (void)getWithPath:(NSString *)path params:(NSDictionary *)params completionHandler:(void (^)(NSURLResponse *response, id responseObject,  NSError * error))completionHandler {
-    NSString *paramsString = [self getParamsString:params];
-    NSString *urlString = [NSString
-                    stringWithFormat:@"%@%@?%@", kAlivcQuUrlString, path, paramsString];
-    
-    NSURLSessionConfiguration *sessionConfiguration =
-    [NSURLSessionConfiguration defaultSessionConfiguration];
-    
-    NSURLSession *session =
-    [NSURLSession sessionWithConfiguration:sessionConfiguration];
-    NSURL *url = [NSURL URLWithString:urlString];
-    NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url];
-    [urlRequest addValue:@"application/json"
-      forHTTPHeaderField:@"Content-Type"];
-    [urlRequest addValue:@"application/json" forHTTPHeaderField:@"Accept"];
-    
-    NSURLSessionDataTask *task =
-    [session dataTaskWithRequest:urlRequest
-               completionHandler:^(NSData *_Nullable data,
-                                   NSURLResponse *_Nullable response,
-                                   NSError *_Nullable error) {
-                   if (error) {
-                       if (completionHandler) {
-                           completionHandler(response, nil, error);
-                       }
-                       return;
-                   }
-                   
-                   if (data == nil) {
-                       NSError *emptyError =
-                       [[NSError alloc] initWithDomain:@"AliyunSVideoApi"
-                                                  code:-10000
-                                              userInfo:nil];
-                       if (completionHandler) {
-                           completionHandler(response, nil, emptyError);
-                       }
-                       return;
-                   }
-                   
-                   id jsonObj = [NSJSONSerialization
-                                 JSONObjectWithData:data
-                                 options:NSJSONReadingAllowFragments
-                                 error:&error];
-                   if (error) {
-                       completionHandler(response, nil, error);
-                       return;
-                   }
-                   
-                   NSInteger code = [[jsonObj objectForKey:@"code"] integerValue];
-                   if (code != 200) {
-                       NSError *error = [NSError errorWithDomain:@"AliyunSVideoApi" code:code userInfo:jsonObj];
-                       if (completionHandler) {
-                           completionHandler(response, nil, error);
-                       }
-                       return;
-                   }
-                   
-                   if (completionHandler) {
-                       completionHandler(response, [jsonObj objectForKey:@"data"], nil);
-                   }
-                   
-               }];
-    
-    [task resume];
-    
-    
-}
-
-
-+ (NSString *)getParamsString:(NSDictionary *)params {
-    NSMutableArray *parts = [NSMutableArray array];
-    for (id key in params.allKeys) {
-        id value = [params objectForKey:key];
-        NSString *part = [NSString stringWithFormat:@"%@=%@", [self percentEncode:key], [self percentEncode:value]];
-        [parts addObject: part];
-    }
-    
-    NSArray<NSString *> *sortedArray = [parts sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
-    NSString *string = [sortedArray componentsJoinedByString:@"&"];
-    return string;
-}
-
-+ (NSString *)percentEncode:(id)object {
-    NSString *string = [NSString stringWithFormat:@"%@", object];
-    
-    NSString * const kAFCharactersGeneralDelimitersToEncode = @":#[]@?/"; // does not include "?" or "/" due to RFC 3986 - Section 3.4
-    NSString * const kAFCharactersSubDelimitersToEncode = @"!$&'()*+,;=";
-    NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy];
-    [allowedCharacterSet removeCharactersInString:[kAFCharactersGeneralDelimitersToEncode stringByAppendingString:kAFCharactersSubDelimitersToEncode]];
-    
-    
-    NSString *percentstring = [string stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet];
-    NSString * plusReplaced = [percentstring stringByReplacingOccurrencesOfString:@"+" withString:@"%20"];
-    NSString * starReplaced = [plusReplaced stringByReplacingOccurrencesOfString:@"*" withString:@"%2A"];
-    NSString * waveReplaced = [starReplaced stringByReplacingOccurrencesOfString:@"%7E" withString:@"~"];
-    return waveReplaced;
-}
-@end

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

@@ -19,7 +19,6 @@
 #import "AliyunPathManager.h"
 #import "AlivcShortVideoRoute.h"
 #import "AliyunCompositionInfo.h"
-#import "AlivcShortVideoPublishManager.h"
 #import "AVC_ShortVideo_Config.h"
 #import "MBProgressHUD+AlivcHelper.h"
 #import "AlivcMacro.h"
@@ -417,8 +416,6 @@ typedef NS_ENUM(NSInteger, AliyunCropPlayerStatus) {
     UIViewController *editVC = [[AlivcShortVideoRoute shared] alivcViewControllerWithType:AlivcViewControlEdit];
     dispatch_async(dispatch_get_main_queue(), ^{
         [self.navigationController pushViewController:editVC animated:YES];
-        //存储点击的相册资源,防止之后合成没有相关资源导致失败
-        [[AlivcShortVideoPublishManager shared]saveResources:(NSArray *)saveAVURLAssetArray];
     });
 }