Browse Source

编辑页面完成

南鑫林 5 years ago
parent
commit
c3933beb2b
13 changed files with 319 additions and 368 deletions
  1. 47 27
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 0 155
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/AliyunVodUptoyouDBManager.swift
  3. 0 170
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/Model/AliyunVodUptoyouEffectsModel.swift
  4. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishArticle/ViewController/PublishArticleViewController.swift
  5. 70 4
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditNew/View/PublishEditNew/PublishEditNewVideoView.swift
  6. 6 3
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditNew/ViewController/PublishEditNewViewController.swift
  7. 24 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditVideoContent/PublishEditVideoContentViewController.swift
  8. 22 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManager.swift
  9. 54 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManagerModel.swift
  10. 15 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoView.swift
  11. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListView.swift
  12. 0 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListViewTableViewCell.swift
  13. 81 9
      RainbowPlanet/RainbowPlanet/Tools/SwiftProgressHUD/SwiftProgressHUD.swift

+ 47 - 27
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -17,8 +17,6 @@
 		A70DE55222E7E53F009E06BE /* KeyBoardInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70DE55122E7E53F009E06BE /* KeyBoardInputView.swift */; };
 		A70E3F30236FF9530039D7FC /* PublishConfirmPhotoNewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F2F236FF9520039D7FC /* PublishConfirmPhotoNewViewController.swift */; };
 		A70E3F33236FF9AD0039D7FC /* AliyunOSSManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F32236FF9AD0039D7FC /* AliyunOSSManager.swift */; };
-		A70E3F3D236FF9CD0039D7FC /* AliyunVodUptoyouDBManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F36236FF9CD0039D7FC /* AliyunVodUptoyouDBManager.swift */; };
-		A70E3F3E236FF9CD0039D7FC /* AliyunVodUptoyouEffectsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F38236FF9CD0039D7FC /* AliyunVodUptoyouEffectsModel.swift */; };
 		A70E3F3F236FF9CD0039D7FC /* AliyunVodupToyoPublishManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F3A236FF9CD0039D7FC /* AliyunVodupToyoPublishManager.swift */; };
 		A70E3F40236FF9CD0039D7FC /* AliyunVodUpToYoPublishModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F3B236FF9CD0039D7FC /* AliyunVodUpToYoPublishModel.swift */; };
 		A70E3F41236FF9CD0039D7FC /* PublishUploadProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70E3F3C236FF9CD0039D7FC /* PublishUploadProgressView.swift */; };
@@ -547,6 +545,9 @@
 		A7FF1DAD2375510D002B3435 /* PublishEditNewMusicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DAC2375510D002B3435 /* PublishEditNewMusicView.swift */; };
 		A7FF1DB1237561B2002B3435 /* PublishEditNewVolumeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DB0237561B2002B3435 /* PublishEditNewVolumeView.swift */; };
 		A7FF1DB323757C27002B3435 /* PublishEditNewMusicVolumeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DB223757C27002B3435 /* PublishEditNewMusicVolumeView.swift */; };
+		A7FF1DBA2376B9C2002B3435 /* PublishManagerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DB92376B9C2002B3435 /* PublishManagerModel.swift */; };
+		A7FF1DBC2376BA76002B3435 /* PublishManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DBB2376BA76002B3435 /* PublishManager.swift */; };
+		A7FF1DBF2376C882002B3435 /* PublishEditVideoContentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1DBE2376C882002B3435 /* PublishEditVideoContentViewController.swift */; };
 		BD01B1FA22BC673900CE9F36 /* PublishConfirmPhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD01B1F822BC673900CE9F36 /* PublishConfirmPhotoController.swift */; };
 		BD01B1FB22BC673A00CE9F36 /* PublishTakePhotoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD01B1F922BC673900CE9F36 /* PublishTakePhotoController.swift */; };
 		BD0808EC22C5BA3100D12E6A /* AliyunCompositionInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = BD0808EA22C5BA3000D12E6A /* AliyunCompositionInfo.m */; };
@@ -760,8 +761,6 @@
 		A70DE55122E7E53F009E06BE /* KeyBoardInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyBoardInputView.swift; sourceTree = "<group>"; };
 		A70E3F2F236FF9520039D7FC /* PublishConfirmPhotoNewViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishConfirmPhotoNewViewController.swift; sourceTree = "<group>"; };
 		A70E3F32236FF9AD0039D7FC /* AliyunOSSManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AliyunOSSManager.swift; sourceTree = "<group>"; };
-		A70E3F36236FF9CD0039D7FC /* AliyunVodUptoyouDBManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AliyunVodUptoyouDBManager.swift; sourceTree = "<group>"; };
-		A70E3F38236FF9CD0039D7FC /* AliyunVodUptoyouEffectsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AliyunVodUptoyouEffectsModel.swift; sourceTree = "<group>"; };
 		A70E3F3A236FF9CD0039D7FC /* AliyunVodupToyoPublishManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AliyunVodupToyoPublishManager.swift; sourceTree = "<group>"; };
 		A70E3F3B236FF9CD0039D7FC /* AliyunVodUpToYoPublishModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AliyunVodUpToYoPublishModel.swift; sourceTree = "<group>"; };
 		A70E3F3C236FF9CD0039D7FC /* PublishUploadProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishUploadProgressView.swift; sourceTree = "<group>"; };
@@ -1318,6 +1317,9 @@
 		A7FF1DAC2375510D002B3435 /* PublishEditNewMusicView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditNewMusicView.swift; sourceTree = "<group>"; };
 		A7FF1DB0237561B2002B3435 /* PublishEditNewVolumeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditNewVolumeView.swift; sourceTree = "<group>"; };
 		A7FF1DB223757C27002B3435 /* PublishEditNewMusicVolumeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditNewMusicVolumeView.swift; sourceTree = "<group>"; };
+		A7FF1DB92376B9C2002B3435 /* PublishManagerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishManagerModel.swift; sourceTree = "<group>"; };
+		A7FF1DBB2376BA76002B3435 /* PublishManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishManager.swift; sourceTree = "<group>"; };
+		A7FF1DBE2376C882002B3435 /* PublishEditVideoContentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishEditVideoContentViewController.swift; sourceTree = "<group>"; };
 		BD01B1F822BC673900CE9F36 /* PublishConfirmPhotoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishConfirmPhotoController.swift; sourceTree = "<group>"; };
 		BD01B1F922BC673900CE9F36 /* PublishTakePhotoController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PublishTakePhotoController.swift; sourceTree = "<group>"; };
 		BD0808EA22C5BA3000D12E6A /* AliyunCompositionInfo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunCompositionInfo.m; sourceTree = "<group>"; };
@@ -1645,29 +1647,11 @@
 		A70E3F34236FF9CD0039D7FC /* AliyunVodManager */ = {
 			isa = PBXGroup;
 			children = (
-				A70E3F35236FF9CD0039D7FC /* AliyunVodUptoyouDBManager */,
 				A70E3F39236FF9CD0039D7FC /* AliyunVodUpToyoPublishManager */,
 			);
 			path = AliyunVodManager;
 			sourceTree = "<group>";
 		};
-		A70E3F35236FF9CD0039D7FC /* AliyunVodUptoyouDBManager */ = {
-			isa = PBXGroup;
-			children = (
-				A70E3F36236FF9CD0039D7FC /* AliyunVodUptoyouDBManager.swift */,
-				A70E3F37236FF9CD0039D7FC /* Model */,
-			);
-			path = AliyunVodUptoyouDBManager;
-			sourceTree = "<group>";
-		};
-		A70E3F37236FF9CD0039D7FC /* Model */ = {
-			isa = PBXGroup;
-			children = (
-				A70E3F38236FF9CD0039D7FC /* AliyunVodUptoyouEffectsModel.swift */,
-			);
-			path = Model;
-			sourceTree = "<group>";
-		};
 		A70E3F39236FF9CD0039D7FC /* AliyunVodUpToyoPublishManager */ = {
 			isa = PBXGroup;
 			children = (
@@ -3493,10 +3477,14 @@
 		A7811CCC2323D25A00C2D8DE /* PublishNewModule */ = {
 			isa = PBXGroup;
 			children = (
+				A7FF1DBD2376C673002B3435 /* PublishEditVideoContent */,
+				A7FF1DB62376B50D002B3435 /* PublishManager */,
+				A7FF1DB523767149002B3435 /* PublishNewCommonView */,
 				A74CF4242372CD9100BA620E /* PublishEditNew */,
 				A7EE5AC5236C131C00309931 /* PublishNew */,
 				A70E3F2D236FF9520039D7FC /* PublishConfirmPhotoNew */,
 				A7EE5AE2236C131D00309931 /* PublishRecommendMusicNewController */,
+				A7FE09122367C892007A73EA /* PublishArticle */,
 			);
 			path = PublishNewModule;
 			sourceTree = "<group>";
@@ -4619,8 +4607,6 @@
 			isa = PBXGroup;
 			children = (
 				A7EE5AD2236C131C00309931 /* PublishNewMusicView.swift */,
-				A7EE5AD3236C131C00309931 /* PublishNewMusicListView.swift */,
-				A7EE5AD4236C131C00309931 /* PublishNewMusicListViewTableViewCell.swift */,
 			);
 			path = PublishNewMusicView;
 			sourceTree = "<group>";
@@ -5067,6 +5053,40 @@
 			path = PublishEditNewMusicVolumeView;
 			sourceTree = "<group>";
 		};
+		A7FF1DB42376711A002B3435 /* PublishNewMusicListView */ = {
+			isa = PBXGroup;
+			children = (
+				A7EE5AD3236C131C00309931 /* PublishNewMusicListView.swift */,
+				A7EE5AD4236C131C00309931 /* PublishNewMusicListViewTableViewCell.swift */,
+			);
+			path = PublishNewMusicListView;
+			sourceTree = "<group>";
+		};
+		A7FF1DB523767149002B3435 /* PublishNewCommonView */ = {
+			isa = PBXGroup;
+			children = (
+				A7FF1DB42376711A002B3435 /* PublishNewMusicListView */,
+			);
+			path = PublishNewCommonView;
+			sourceTree = "<group>";
+		};
+		A7FF1DB62376B50D002B3435 /* PublishManager */ = {
+			isa = PBXGroup;
+			children = (
+				A7FF1DBB2376BA76002B3435 /* PublishManager.swift */,
+				A7FF1DB92376B9C2002B3435 /* PublishManagerModel.swift */,
+			);
+			path = PublishManager;
+			sourceTree = "<group>";
+		};
+		A7FF1DBD2376C673002B3435 /* PublishEditVideoContent */ = {
+			isa = PBXGroup;
+			children = (
+				A7FF1DBE2376C882002B3435 /* PublishEditVideoContentViewController.swift */,
+			);
+			path = PublishEditVideoContent;
+			sourceTree = "<group>";
+		};
 		BD01B1F722BC673900CE9F36 /* PublishTakePhoto */ = {
 			isa = PBXGroup;
 			children = (
@@ -5247,7 +5267,6 @@
 			isa = PBXGroup;
 			children = (
 				BD929CCD22B904A30098C139 /* PublishViewController.swift */,
-				A7FE09122367C892007A73EA /* PublishArticle */,
 				BDE376C922C1B5350055E2EA /* AliyunVideo */,
 				BD12B67222B4E99800AEB10B /* PublishMediaPicker */,
 				BD01B1F722BC673900CE9F36 /* PublishTakePhoto */,
@@ -6193,6 +6212,7 @@
 				A7811CA5231FB13700C2D8DE /* KSTriangleIndicatorButton.m in Sources */,
 				BD13B6DA22BA03BC008BB323 /* PublishAddAddressController.swift in Sources */,
 				A747D81F235C8FA8007F4E33 /* TLAlbumPopView.swift in Sources */,
+				A7FF1DBA2376B9C2002B3435 /* PublishManagerModel.swift in Sources */,
 				A72A72BA22321DE000B21995 /* Extension+String.swift in Sources */,
 				BDAF83B222B3B67D0004BCC3 /* RecommendCommentFooter.swift in Sources */,
 				A7EE6E102305487700628D39 /* ThumbnailsManager.swift in Sources */,
@@ -6500,7 +6520,6 @@
 				A72E685422F2D7580063D967 /* ATAuthSDKManager.swift in Sources */,
 				A7D5F26322C0CF8600F8E9AF /* UserFansModel.swift in Sources */,
 				BD13B6E122BA03BC008BB323 /* PublishSelTopicCollectionCell.swift in Sources */,
-				A70E3F3D236FF9CD0039D7FC /* AliyunVodUptoyouDBManager.swift in Sources */,
 				A7D5F25F22C0614400F8E9AF /* CommunityTopicCategoryModel.swift in Sources */,
 				A7778CDF22461BAD00C7C47A /* PhoneCountryAreaSectionHeaderView.swift in Sources */,
 				A7AA9F5A22C5FB1E0086498B /* SwiftMoyaNetWorkServiceVirus.swift in Sources */,
@@ -6596,6 +6615,7 @@
 				A7C2566F22CB7A0C00420828 /* CommunityPostDetailModel.swift in Sources */,
 				A7CC7524227190FB003C4F38 /* AccountSecurityView.swift in Sources */,
 				A784F29D234C370F00E49140 /* PhotoAlbumUtil.swift in Sources */,
+				A7FF1DBF2376C882002B3435 /* PublishEditVideoContentViewController.swift in Sources */,
 				A7931E1422AF9E4000297D0A /* TopicSelectionCollectionViewCell.swift in Sources */,
 				BD0FAA4922C4663100DDFB37 /* AlivcEditItemModel.m in Sources */,
 				BD1DC6CB228D157000B89C57 /* OrderCreateBackModel.swift in Sources */,
@@ -6611,6 +6631,7 @@
 				A7BB68662269B1DD00AB07A2 /* AddressPOIView.swift in Sources */,
 				A7AA9F5D22C5FD710086498B /* VirueRecordAddParameterModel.swift in Sources */,
 				BD13B6C722BA034D008BB323 /* PublishEditAddTopicCell.swift in Sources */,
+				A7FF1DBC2376BA76002B3435 /* PublishManager.swift in Sources */,
 				BD13B6DE22BA03BC008BB323 /* PublishTopicTypeItemCollectionCell.swift in Sources */,
 				A72A72C322321DE000B21995 /* Extension+Date.swift in Sources */,
 				BD0FAA4F22C474D400DDFB37 /* AliyunCoverPickViewController.m in Sources */,
@@ -6823,7 +6844,6 @@
 				A72A72BF22321DE000B21995 /* Extension+UIButton.swift in Sources */,
 				A7B77496236B2E5600BF26F1 /* WKWebView+PAWebCookie.m in Sources */,
 				BDE376DA22C22A260055E2EA /* UIButton+AliyunBlock.m in Sources */,
-				A70E3F3E236FF9CD0039D7FC /* AliyunVodUptoyouEffectsModel.swift in Sources */,
 				A7F304B523331B0800A4850F /* IMChatRoomViewController.swift in Sources */,
 				A7FF1DB323757C27002B3435 /* PublishEditNewMusicVolumeView.swift in Sources */,
 				A7D07CBF22B73EE600186014 /* UserPersonalCenterViewController.swift in Sources */,

File diff suppressed because it is too large
+ 0 - 155
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/AliyunVodUptoyouDBManager.swift


+ 0 - 170
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/Model/AliyunVodUptoyouEffectsModel.swift

@@ -1,170 +0,0 @@
-//
-//  AliyunVodUptoyouEffectsDBModel.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/9/30.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-/// 素材类别
-///
-/// - font: 字体
-/// - paster: 动图
-/// - mv: imv
-/// - filter: 滤镜
-/// - music: 音乐
-/// - caption: 字幕
-/// - specialFilter: 特殊过滤器
-enum AliyunEffectsType : Int {
-    case font = 1
-    case paster = 2
-    case mv = 3
-    case filter = 4
-    case music = 5
-    case caption = 6
-    case specialFilter = 7
-}
-
-/// 滤镜效果
-///
-/// - none: 无效果
-/// - face: 人物
-/// - food: 食物
-/// - scenery: 风景
-/// - pet: 宠物
-/// - specialStyle: 特殊风格
-enum AliyunFilterType : Int {
-    case none = 0
-    case face = 1
-    case food = 2
-    case scenery = 3
-    case pet = 4
-    case specialStyle  = 5
-}
-
-
-class AliyunVodUptoyouEffectsModel: NSObject {
-
-    /*
-     * Local
-     */
-    
-    //素材类别
-    var effectsType: AliyunEffectsType?
-    // 用于判断数据库是否包含该资源
-    var isDBContain = false
-    // 资源路径
-    var resourcePath: String?
-    // 字体在字体库中的名称
-    var fontName : String?
-    // 字幕在config中的字体id
-    var configFontId : Int?
-    // 字幕在config中的字体name
-    var configFontName : String?
-    //滤镜的类型
-    var filterType : AliyunFilterType?
-    
-    /*
-     * 以下均为server返回字段
-     */
-    
-    // id
-    var eid : Int?
-    var isNew : Bool?
-    var level : Int?
-    
-    // 名称
-    var name : String?
-    var cnName : String?
-    var key : String?
-    var category : String?
-    
-    // 下载路径 动图 MV 字幕等在第二层
-    var url : String?
-    var md5 : String?
-    var banner : String?
-    var icon : String?
-    // 描述
-    var edescription : String?
-    var preview : String?
-    var tag : String?
-    var cat : String?
-    var previewPic : String?
-    var previewMp4 : String?
-    var duration : String?
-    var type : String?
-    var sort : String?
-    var mvList : Array<AliyunEffectMvInfoModel>?
-    
-}
-
-class AliyunEffectMvInfoModel: NSObject {
-    var resourcePath : String?
-    var aspect : String?
-    var download : String?
-    var md5 : String?
-}
-
-class AliyunEffectInfoModel: NSObject {
-    
-    /**
-     数据ID
-     */
-    var eid : Int?
-    
-    /**
-     数据类型
-     */
-    var effectType : Int?
-    
-    /**
-     滤镜类型
-     */
-    var filterType : Int?
-    
-    /**
-     滤镜分类名称
-     */
-    var filterTypeName : String?
-    /**
-     滤镜分组id
-     */
-    var groupId : Int?
-    
-    /**
-     图标
-     */
-    var icon : String??
-    
-    /**
-     名称
-     */
-    var name : String?
-    
-    /**
-     滤镜描述
-     */
-    var edescription : String?
-    
-    /**
-     是否在数据库里包含
-     */
-    var isDBContain : Bool?
-    
-    /**
-     分组名称
-     */
-    var groupName : String?
-    
-    /**
-     download URL
-     */
-    var url : String?
-    var md5 : String?
-    
-    /**
-     资源路径
-     */
-    var resourcePath : String?
-}

RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishArticle/ViewController/PublishArticleViewController.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishArticle/ViewController/PublishArticleViewController.swift


+ 70 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditNew/View/PublishEditNew/PublishEditNewVideoView.swift

@@ -25,8 +25,12 @@ class PublishEditNewVideoView: UIView {
     }
     weak var observe : NSObjectProtocol?
     
-    /// 路径
+    /// 文件路径
     var taskPath : String?
+    /// 合成导出路径
+    var outputPath : String?
+    /// 封面路径
+    var outputCoverPath : String?
     /// 是否正在播放
     var isPlaying : Bool = true
     /// 滤镜选中的selected
@@ -48,10 +52,12 @@ class PublishEditNewVideoView: UIView {
         fatalError("init(coder:) has not been implemented")
     }
     
-    init(taskPath:String?) {
+    init(taskPath:String?,outputPath:String?,outputCoverPath:String?) {
         self.init()
         frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight)
         self.taskPath = taskPath
+        self.outputPath = outputPath
+        self.outputCoverPath = outputCoverPath
         setupViews()
         setupLayouts()
         setupData()
@@ -98,6 +104,13 @@ class PublishEditNewVideoView: UIView {
         publishEditNewVideoSetView.backButton.rx.tap.subscribe(onNext: { (_) in
             UIViewController.topMost?.navigationController?.popViewController(animated: true)
         }).disposed(by: disposeBag)
+        // 下一步
+        publishEditNewVideoSetView.nextButton.rx.tap.subscribe(onNext: { [weak self] (_) in
+            guard let strongSelf = self else { return }
+            SwiftProgressHUD.shared().addShowWaitHudProgress()
+            SwiftProgressHUD.shared().changeShowWaitHudProgress(progress: 0.0)
+            strongSelf.exporter?.startExport(strongSelf.outputPath)
+        }).disposed(by: disposeBag)
         
         // 音乐
         publishEditNewVideoSetView.musicButton.rx.tap.subscribe(onNext: {[weak self] (data) in
@@ -414,6 +427,21 @@ class PublishEditNewVideoView: UIView {
 
 extension PublishEditNewVideoView {
     
+    /// 开始播放
+    func play() {
+        player?.play()
+        isPlaying = true
+        publishEditNewVideoSetView.playProgressView.playButton.isSelected = true
+
+    }
+    
+    /// 停止播放
+    func stopPlay() {
+        player?.stop()
+        isPlaying = false
+        publishEditNewVideoSetView.playProgressView.playButton.isSelected = false
+    }
+    
     
     /// 暂停播放
     func pausePlay() {
@@ -636,18 +664,56 @@ extension PublishEditNewVideoView : AliyunIPlayerCallback {
 
 extension PublishEditNewVideoView : AliyunIExporterCallback {
     func exporterDidEnd(_ outputPath: String!) {
+        NXLLog(outputPath)
+        SwiftProgressHUD.shared().hideProgress()
+        editor?.stopEdit()
+        
+        // 视频路径
+        let publishManagerVideoModel = PublishManagerVideoModel()
+        publishManagerVideoModel.outVideoPath = outputPath
+        publishManagerVideoModel.outVideoPathURL = URL(fileURLWithPath: outputPath)
+        
         
+        //旋转修正
+//        let image = image.rotate(aImage: image)
+//        let imagePath: String = (PathManager.tmpPath() ?? "") + (PathManager.randomString() ?? "")
+//        let imgData: Data? = UIImage.pngData(image)()
+//        do {
+//            try imgData?.write(to: URL(fileURLWithPath: imagePath))
+//            imageUrlPaths.append(imagePath)
+//        }
+//        catch {
+//            NXLLog("存入失败")
+//        }
+        
+        
+        // 发布路径
+        let publishManagerModel = PublishManagerModel()
+        publishManagerModel.video = publishManagerVideoModel
+
     }
     
     func exporterDidCancel() {
-        
+        SwiftProgressHUD.shared().hideProgress()
+        if isPlaying {
+            self.resumePlay()
+        }else {
+            self.pausePlay()
+        }
     }
     
     func exportProgress(_ progress: Float) {
-        
+        SwiftProgressHUD.shared().changeShowWaitHudProgress(progress: progress)
     }
     
     func exportError(_ errorCode: Int32) {
+        NXLLog(errorCode)
+        SwiftProgressHUD.shared().hideProgress()
+        if isPlaying {
+            self.resumePlay()
+        }else {
+            self.pausePlay()
+        }
         
     }
     

+ 6 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditNew/ViewController/PublishEditNewViewController.swift

@@ -10,13 +10,16 @@ import UIKit
 
 class PublishEditNewViewController: BaseViewController {
     
-    
-    
     deinit {
         NXLLog("deinit")
     }
     
+    /// 文件路径
     var taskPath : String?
+    /// 合成导出路径
+    var outputPath : String?
+    /// 封面路径
+    var outputCoverPath : String?
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -30,7 +33,7 @@ class PublishEditNewViewController: BaseViewController {
     
     /// 编辑视频View
     private lazy var publishEditNewVideoView: PublishEditNewVideoView = {
-        let publishEditNewVideoView = PublishEditNewVideoView(taskPath: taskPath)
+        let publishEditNewVideoView = PublishEditNewVideoView(taskPath: taskPath,outputPath:outputPath,outputCoverPath:outputCoverPath)
         return publishEditNewVideoView
     }()
     

+ 24 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishEditVideoContent/PublishEditVideoContentViewController.swift

@@ -0,0 +1,24 @@
+//
+//  PublishEditContentViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/9.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishEditVideoContentViewController: BaseViewController {
+
+    /// 合成导出路径
+    var outputPath : String?
+    /// 封面路径
+    var outputCoverPath : String?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+
+        // Do any additional setup after loading the view.
+    }
+
+}

+ 22 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManager.swift

@@ -0,0 +1,22 @@
+//
+//  PublishManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/9.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+
+class PublishManager: NSObject {
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    static let shared : PublishManager = PublishManager()
+    
+    /// 发布数据
+    var publishManagerModel: PublishManagerModel? = nil
+    
+}

+ 54 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishManager/PublishManagerModel.swift

@@ -0,0 +1,54 @@
+//
+//  PublishManagerModel.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/11/9.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import ObjectMapper
+
+
+class PublishManagerModel : NSObject, Mappable{
+    
+    var video : PublishManagerVideoModel?
+
+    class func newInstance(map: Map) -> Mappable?{
+        return PublishManagerModel()
+    }
+    required init?(map: Map){}
+    override init(){}
+
+    func mapping(map: Map)
+    {
+        video <- map["video"]
+        
+    }
+
+}
+
+class PublishManagerVideoModel : NSObject, Mappable{
+
+    var outCoverImagePath : String?
+    var outCoverImagePathURL : URL?
+    var outVideoPath : String?
+    var outVideoPathURL : URL?
+
+    class func newInstance(map: Map) -> Mappable?{
+        return PublishManagerVideoModel()
+    }
+    required init?(map: Map){}
+    override init(){}
+
+    func mapping(map: Map)
+    {
+        outCoverImagePath <- map["outCoverImagePath"]
+        outCoverImagePathURL <- map["outCoverImagePathURL"]
+        outVideoPath <- map["outVideoPath"]
+        outVideoPathURL <- map["outVideoPathURL"]
+        
+    }
+
+}
+

+ 15 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoView.swift

@@ -30,6 +30,8 @@ class PublishNewVideoPhotoView: BaseView {
     var selectedIndex : Int = 0
     /// 是否完成录制
     var isFinishRecorder : Bool = false
+    /// 封面图路径
+    var outputCoverPathUrl : URL?
     
     /// 添加View
     override func setupViews() {
@@ -250,6 +252,17 @@ class PublishNewVideoPhotoView: BaseView {
                                 PathURLManager.projectResourcesPath(parentURL:
                                     PathURLManager.projectRecordssPath(parentURL:
                                         PathURLManager.projectDocumentPath()))))))!
+        
+        // 设置录制视频封面输出路径
+        outputCoverPathUrl =
+            PathURLManager.projectPathExtensionPng(parentURL:
+                PathURLManager.projectFilePath(fileName:
+                    PathURLManager.randomString(), parentURL:
+                        PathURLManager.projectDateFormatPath(dateFormat: "yyyyMM", parentURL:
+                            PathURLManager.projectPicturesPath(parentURL:
+                                PathURLManager.projectResourcesPath(parentURL:
+                                    PathURLManager.projectRecordssPath(parentURL:
+                                        PathURLManager.projectDocumentPath()))))))!
         // 设置录制视频输出路径
         recorder?.outputPath = outputPathUrl.path
         //循环切换手电筒模式手电筒模式有三种,分别是off,on和auto。切换顺序:off —-> on —-> auto。默认值:off。
@@ -804,6 +817,8 @@ extension PublishNewVideoPhotoView : AliyunIRecorderDelegate {
             self?.publishNewVideoPhotoSetView.recordButton.isSelected = false
             let vc = PublishEditNewViewController()
             vc.taskPath = self?.recorder?.taskPath
+            vc.outputPath = self?.recorder?.outputPath
+            vc.outputCoverPath = self?.outputCoverPathUrl?.path
             vc.popClosure = {
                 [weak self] in
                 self?.recorder?.startPreview()

RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListView.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListView.swift


RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListViewTableViewCell.swift → RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNewCommonView/PublishNewMusicListView/PublishNewMusicListViewTableViewCell.swift


+ 81 - 9
RainbowPlanet/RainbowPlanet/Tools/SwiftProgressHUD/SwiftProgressHUD.swift

@@ -7,20 +7,35 @@
 //
 
 import UIKit
+import RxSwift
 
 @objc class SwiftProgressHUD: NSObject {
     
     private static let _sharedInstance = SwiftProgressHUD()
 
+    @objc class func shared() -> SwiftProgressHUD {
+        return _sharedInstance
+    }
+
     private override init() {} // 私有化init方法
+    
+    private let afterDelay = 1
+    
+    // 取消
+    typealias CancleClosure = () -> Void?
+    var cancleClosure : CancleClosure?
+    
+    let disposeBag = DisposeBag()
 
     lazy var hud: MBProgressHUD = {
         let hud = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
         return hud
     }()
+    
+    var hudProgress: MBProgressHUD? = nil
 
     //获取用于显示提示框的view
-    private func viewToShow() -> UIView {
+    func viewToShow() -> UIView {
         var window = UIApplication.shared.keyWindow
         if window?.windowLevel != UIWindow.Level.normal {
             let windowArray = UIApplication.shared.windows
@@ -34,12 +49,6 @@ import UIKit
         return window!
     }
 
-    private let afterDelay = 1
-
-    @objc class func shared() -> SwiftProgressHUD {
-        return _sharedInstance
-    }
-
     /// 显示等待消息
     ///
     /// - Parameter title: 加载提示语
@@ -51,6 +60,7 @@ import UIKit
         hud.bezelView.style = .blur
         hud.mode = MBProgressHUDMode.indeterminate
         hud.removeFromSuperViewOnHide = true
+        hud.margin = 10
         self.hud = hud
     }
     
@@ -62,14 +72,14 @@ import UIKit
         let hud = MBProgressHUD.showAdded(to: view, animated: true)
         hud.show(animated: true)
         hud.detailsLabel.text = title
-        hud.bezelView.style = .solidColor
+        hud.bezelView.style = .blur
         hud.bezelView.backgroundColor = UIColor.clear
         hud.mode = MBProgressHUDMode.indeterminate
         hud.removeFromSuperViewOnHide = true
+        hud.margin = 10
         self.hud = hud
     }
 
-
     /// 只显示文本
     ///
     /// - Parameter title: 显示的标题
@@ -120,6 +130,7 @@ import UIKit
         hud.customView = UIImageView(image: UIImage(named: imageName)) //自定义视图显示图片
         hud.detailsLabel.text = title
         hud.removeFromSuperViewOnHide = true
+        hud.margin = 10
         //HUD窗口显示1秒后自动隐藏
         hud.hide(animated: true, afterDelay: TimeInterval(afterDelay))
     }
@@ -132,6 +143,7 @@ import UIKit
         hud.mode = .customView //模式设置为自定义视图
         hud.customView = UIImageView(image: UIImage(named: imageName)) //自定义视图显示图片
         hud.detailsLabel.text = title
+        hud.margin = 10
         hud.removeFromSuperViewOnHide = true
         //HUD窗口显示1秒后自动隐藏
         hud.hide(animated: true, afterDelay: TimeInterval(afterDelay))
@@ -147,6 +159,7 @@ import UIKit
         hud.customView = UIImageView(image: UIImage(named: imageName)) //自定义视图显示图片
         hud.detailsLabel.text = title
         hud.removeFromSuperViewOnHide = true
+        hud.margin = 10
         //HUD窗口显示1秒后自动隐藏
         hud.hide(animated: true, afterDelay: TimeInterval(afterDelay))
     }
@@ -155,5 +168,64 @@ import UIKit
     func hide(){
         hud.hide(animated: true, afterDelay: TimeInterval(0))
     }
+    
+}
+
+// MARK: - 进度View
+extension SwiftProgressHUD {
+    
+    /// 显示进度
+    /// - Parameters:
+    ///   - title: 进度标题
+    ///   - progress: 进度值
+    func addShowWaitHudProgress() {
+         hudProgress = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
+         hudProgress?.show(animated: true)
+         hudProgress?.bezelView.style = .blur
+         hudProgress?.bezelView.backgroundColor = UIColor.clear
+         hudProgress?.mode = MBProgressHUDMode.annularDeterminate
+         hudProgress?.margin = 10
+         hudProgress?.removeFromSuperViewOnHide = true
+    }
+    
+    /// 显示进度
+    /// - Parameters:
+    ///   - title: 进度标题
+    ///   - buttonTitle: 取消按钮
+    ///   - progress: 进度值
+    ///   - cancleClosure: 取消回调
+    func addShowWaitHudProgress(buttonTitle:String,cancleClosure:@escaping CancleClosure) {
+        self.cancleClosure = cancleClosure
+        hudProgress = MBProgressHUD.showAdded(to: viewToShow(), animated: true)
+        hudProgress?.show(animated: true)
+        hudProgress?.bezelView.style = .blur
+        hudProgress?.bezelView.backgroundColor = UIColor.clear
+        hudProgress?.mode = MBProgressHUDMode.annularDeterminate
+        hudProgress?.margin = 10
+        hudProgress?.removeFromSuperViewOnHide = true
+        hudProgress?.button.setTitle(buttonTitle, for: UIControl.State.normal)
+        hudProgress?.button.rx.tap.subscribe(onNext: { [weak self] _ in
+            guard let strongSelf = self else { return }
+            if let cancleClosure = strongSelf.cancleClosure {
+                cancleClosure()
+            }
+        }).disposed(by: disposeBag)
+    }
+    
+    
+    /// 显示进度
+    /// - Parameters:
+    ///   - title: 进度标题
+    ///   - progress: 进度值
+    func changeShowWaitHudProgress(title: String = "",buttonTitle:String = "",progress:Float) {
+        hudProgress?.detailsLabel.text = "\(title)\(Int(ceil(progress*100)))%"
+        hudProgress?.progress = progress
+    }
+    
+    /// 隐藏进度
+    func hideProgress(){
+        hudProgress?.hide(animated: true, afterDelay: TimeInterval(0))
+        hudProgress = nil
+    }
 
 }