Browse Source

no message

南鑫林 5 years ago
parent
commit
358371e481
100 changed files with 4032 additions and 1694 deletions
  1. 3 3
      RainbowPlanet/Podfile
  2. 343 238
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  3. 2 1
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  4. 1 0
      RainbowPlanet/RainbowPlanet/Macro/RainbowPlanet-Bridging-Header.h
  5. 267 0
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliPlayerManager/AliPlayerManager.swift
  6. 0 281
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunOSSManager/AliyunOSSManager.swift
  7. 0 46
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodUpToYoPublishModel.swift
  8. 0 344
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodupToyoPublishManager.swift
  9. 0 188
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/PublishUploadProgressView.swift
  10. 0 155
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/AliyunVodUptoyouDBManager.swift
  11. 0 170
      RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUptoyouDBManager/Model/AliyunVodUptoyouEffectsModel.swift
  12. 303 0
      RainbowPlanet/RainbowPlanet/Manager/PathManager/PathURLManager.swift
  13. 7 0
      RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityRecommendMusicListModel.swift
  14. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/AlivcShortVideoImage.bundle/watermark.png
  15. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/VideoResources/tail.png
  16. BIN
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/VideoResources/watermark.png
  17. 17 21
      RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift
  18. 0 120
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishConfirmPhotoNew/PublishConfirmPhotoNewViewController.swift
  19. 18 2
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewEffect/PublishNewEffectFilterView/PublishNewEffectFilterCollectionViewCell.swift
  20. 32 3
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewEffect/PublishNewEffectFilterView/PublishNewEffectFilterView.swift
  21. 203 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListView.swift
  22. 149 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListViewTableViewCell.swift
  23. 230 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicView.swift
  24. 76 3
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewRecorderPreview.swift
  25. 103 2
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoSetView.swift
  26. 226 29
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoView.swift
  27. 53 44
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewController/PublishNewViewController.swift
  28. 4 4
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewModel/PublishNewViewModel.swift
  29. 177 0
      RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishRecommendMusicNewController/ViewController/PublishRecommendMusicNewController.swift
  30. 7 6
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift
  31. 2 2
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaServiceCommunityApi.swift
  32. 42 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceDownLoad/SwiftMoyaNetWorkServiceDownLoad.swift
  33. 90 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceDownLoad/SwiftMoyaServiceDownLoadApi.swift
  34. 24 20
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift
  35. 41 12
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift
  36. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/color.png
  37. 71 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/config.json
  38. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/icon.png
  39. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/光圈/config.json
  40. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/光圈/icon.png
  41. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/color.png
  42. 73 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/config.json
  43. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/icon.png
  44. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/color.png
  45. 71 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/config.json
  46. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/icon.png
  47. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/color.png
  48. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/config.json
  49. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/icon.png
  50. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/模糊/config.json
  51. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/模糊/icon.png
  52. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/波普/config.json
  53. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/波普/icon.png
  54. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/color.png
  55. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/config.json
  56. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/icon.png
  57. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/color.png
  58. 72 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/config.json
  59. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/icon.png
  60. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/color.png
  61. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/config.json
  62. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/icon.png
  63. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/灰白/config.json
  64. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/灰白/icon.png
  65. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/color.png
  66. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/config.json
  67. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/icon.png
  68. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/焦黄/config.json
  69. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/焦黄/icon.png
  70. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/color.png
  71. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/config.json
  72. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/icon.png
  73. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/素描/config.json
  74. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/素描/icon.png
  75. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/color.png
  76. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/color2.png
  77. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/config.json
  78. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/icon.png
  79. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color.png
  80. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color2.png
  81. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color3.png
  82. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color4.png
  83. 74 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/config.json
  84. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/icon.png
  85. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/胶片/config.json
  86. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/胶片/icon.png
  87. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/蓝调/config.json
  88. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/蓝调/icon.png
  89. 69 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/迷糊/config.json
  90. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/迷糊/icon.png
  91. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/color.png
  92. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/config.json
  93. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/icon.png
  94. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/color.png
  95. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/config.json
  96. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/icon.png
  97. 70 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/config.json
  98. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/icon.png
  99. BIN
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/s3.png
  100. 0 0
      RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/马赛克/config.json

+ 3 - 3
RainbowPlanet/Podfile

@@ -104,15 +104,15 @@ target 'RainbowPlanet' do
   pod 'BaiduMapKit'
   
   #=====================AliyunVideoSDK===========
+  #共同依赖的库
+  pod 'QuCore-ThirdParty'
+  pod 'AlivcConan', '0.9.5'
   #短视频SDK
   pod 'AliyunVideoSDKPro', '3.11.0'  #短视频核心库
   pod 'VODUpload'  #短视频上传,不使用上传功能可以不依赖此库
   #播放器SDK
   pod 'AliPlayerPartSDK_iOS', '4.7.1' #播放器和短视频SDK同时集成时使用这个
   #    pod 'AliPlayerSDK_iOS', '4.7.1' #单独集成播放器时使用这个
-  #共同依赖的库
-  pod 'QuCore-ThirdParty'
-  pod 'AlivcConan', '0.9.5'
   
   #=====================融云IMSDK===========
   #融云 IM 通讯能力库

File diff suppressed because it is too large
+ 343 - 238
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj


+ 2 - 1
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -187,7 +187,8 @@ class BaseTabbarViewController: NSObject {
                 if index != 3 {
                     let pickVc = PublishViewController()
                     pickVc.index = index
-                    //            let  pickVc = PublishNewViewController()
+//                    let  pickVc = PublishNewViewController()
+//                    pickVc.index = index
                     let nav = BaseNavigationViewController.init(rootViewController: pickVc)
                     nav.modalPresentationStyle = .fullScreen
                     BaseTabbarViewController.shared.esTabBarController.present(nav, animated: true, completion: nil)

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

@@ -66,6 +66,7 @@
 
 // 阿里云短视频
 #import <AliyunVideoSDKPro/AliyunVideoSDKPro.h>
+#import <AliyunPlayer/AliyunPlayer.h>
 // 阿里云一建登录
 #import "ATAuthSDK/ATAuthSDK.h"
 

+ 267 - 0
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliPlayerManager/AliPlayerManager.swift

@@ -0,0 +1,267 @@
+//
+//  AliPlayerManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/26.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+
+
+
+class AliPlayerManager: NSObject {
+    
+    deinit {
+        NXLLog("deinit")
+    }
+    
+    static let shared : AliPlayerManager = AliPlayerManager()
+    
+//=============================音频=============================================
+    
+    typealias StartPlayClosure = (() -> Void)?
+    var startPlayClosure : StartPlayClosure?
+    
+    lazy var audioPlayer: AliPlayer = {
+        let audioPlayer = AliPlayer()
+        audioPlayer?.delegate = self
+        return audioPlayer!
+    }()
+    
+//=============================视频===========================================
+    
+    lazy var videoPlayer: AliPlayer = {
+        let videoPlayer = AliPlayer()
+        videoPlayer?.delegate = self
+        return videoPlayer!
+    }()
+    
+    
+}
+
+// MARK: - 音乐播放
+extension AliPlayerManager {
+    
+    /// 开始播放音频
+    ///
+    /// - Parameters:
+    ///   - url: 网络链接
+    ///   - pathUrl: 本地链接
+    func initAudioPlayer(url:String? = nil, pathUrl:String? = nil,startPlayClosure :StartPlayClosure? = nil) {
+        
+        self.startPlayClosure = startPlayClosure
+        
+        if url != nil {
+            audioPlayer.setUrlSource(AVPUrlSource().url(with: url))
+        }
+        if pathUrl != nil {
+            audioPlayer.setUrlSource(AVPUrlSource().fileURL(withPath: pathUrl))
+        }
+        
+        audioPlayer.enableLog = false
+        audioPlayer.isLoop = true
+        audioPlayer.isMuted = false
+        audioPlayer.isAutoPlay = true
+        audioPlayer.prepare()
+    }
+}
+
+
+// MARK: - 视频播放
+extension AliPlayerManager {
+    func initVideoPlayer() {
+        
+    }
+}
+
+extension AliPlayerManager : AVPDelegate {
+    /**
+     @brief 播放器事件回调
+     @param player 播放器player指针
+     @param eventType 播放器事件类型
+     @see AVPEventType
+     */
+    func onPlayerEvent(_ player: AliPlayer!, eventType: AVPEventType) {
+        switch eventType {
+        case AVPEventPrepareDone:
+            // 准备完成事件
+            break
+        case AVPEventAutoPlayStart:
+            // 自动播放开始事件
+            if player == audioPlayer {
+                if let startPlayClosure = startPlayClosure {
+                    startPlayClosure!()
+                }
+            }
+            break
+        case AVPEventFirstRenderedStart:
+            // 首帧显示
+            break
+        case AVPEventCompletion:
+            // 播放完成
+            break
+        case AVPEventLoadingStart:
+            // 缓冲开始
+            break
+        case AVPEventLoadingEnd:
+            // 缓冲完成
+            break
+        case AVPEventSeekEnd:
+            // 跳转完成
+            break
+        case AVPEventLoopingStart:
+            // 循环播放开始
+            break
+        default:
+            break;
+        }
+    }
+    
+    /**
+     @brief 播放器事件回调
+     @param player 播放器player指针
+     @param eventWithString 播放器事件类型
+     @param description 播放器事件说明
+     @see AVPEventType
+     */
+    func onPlayerEvent(_ player: AliPlayer!, eventWithString: AVPEventWithString, description: String!) {
+        
+    }
+    
+    /**
+     @brief 错误代理回调
+     @param player 播放器player指针
+     @param errorModel 播放器错误描述,参考AVPErrorModel
+     @see AVPErrorModel
+     */
+    func onError(_ player: AliPlayer!, errorModel: AVPErrorModel!) {
+        
+    }
+    
+    /**
+     @brief 视频大小变化回调
+     @param player 播放器player指针
+     @param width 视频宽度
+     @param height 视频高度
+     @param rotation 视频旋转角度
+     */
+    func onVideoSizeChanged(_ player: AliPlayer!, width: Int32, height: Int32, rotation: Int32) {
+        
+    }
+    
+    /**
+     @brief 视频当前播放位置回调
+     @param player 播放器player指针
+     @param position 视频当前播放位置
+     */
+    func onCurrentPositionUpdate(_ player: AliPlayer!, position: Int64) {
+        
+    }
+    
+    /**
+     @brief 视频缓存位置回调
+     @param player 播放器player指针
+     @param position 视频当前缓存位置
+     */
+    func onBufferedPositionUpdate(_ player: AliPlayer!, position: Int64) {
+        
+    }
+    
+    /**
+     @brief 视频缓冲进度回调
+     @param player 播放器player指针
+     @param progress 缓存进度0-100
+     */
+    func onLoadingProgress(_ player: AliPlayer!, progress: Float) {
+        
+    }
+    
+    /**
+     @brief 获取track信息回调
+     @param player 播放器player指针
+     @param info track流信息数组
+     @see AVPTrackInfo
+     */
+    func onTrackReady(_ player: AliPlayer!, info: [AVPTrackInfo]!) {
+        
+    }
+    
+    /**
+     @brief track切换完成回调
+     @param player 播放器player指针
+     @param info 切换后的信息 参考AVPTrackInfo
+     @see AVPTrackInfo
+     */
+    func onTrackChanged(_ player: AliPlayer!, info: AVPTrackInfo!) {
+        
+    }
+    
+    /**
+     @brief 字幕显示回调
+     @param player 播放器player指针
+     @param index 字幕显示的索引号
+     @param subtitle 字幕显示的字符串
+     */
+    func onSubtitleShow(_ player: AliPlayer!, index: Int32, subtitle: String!) {
+        
+    }
+    
+    /**
+     @brief 字幕隐藏回调
+     @param player 播放器player指针
+     @param index 字幕显示的索引号
+     */
+    func onSubtitleHide(_ player: AliPlayer!, index: Int32) {
+        
+    }
+    /**
+     @brief 获取缩略图成功回调
+     @param positionMs 指定的缩略图位置
+     @param fromPos 此缩略图的开始位置
+     @param toPos 此缩略图的结束位置
+     @param image 缩图略图像指针,对于mac是NSImage,iOS平台是UIImage指针
+     */
+    func onGetThumbnailSuc(_ positionMs: Int64, fromPos: Int64, toPos: Int64, image: Any!) {
+        
+    }
+    
+    /**
+     @brief 获取缩略图失败回调
+     @param positionMs 指定的缩略图位置
+     */
+    func onGetThumbnailFailed(_ positionMs: Int64) {
+        
+    }
+    
+    /**
+     @brief 播放器状态改变回调
+     @param player 播放器player指针
+     @param oldStatus 老的播放器状态 参考AVPStatus
+     @param newStatus 新的播放器状态 参考AVPStatus
+     @see AVPStatus
+     */
+    func onPlayerStatusChanged(_ player: AliPlayer!, oldStatus: AVPStatus, newStatus: AVPStatus) {
+        
+    }
+    
+    /**
+     @brief 获取截图回调
+     @param player 播放器player指针
+     @param image 图像
+     @see AVPImage
+     */
+    func onCaptureScreen(_ player: AliPlayer!, image: UIImage!) {
+        
+    }
+    
+    /**
+     @brief SEI回调
+     @param type 类型
+     @param data 数据
+     @see AVPImage
+     */
+    func onSEIData(_ player: AliPlayer!, type: Int32, data: Data!) {
+        
+    }
+}

+ 0 - 281
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunOSSManager/AliyunOSSManager.swift

@@ -1,281 +0,0 @@
-//
-//  AliyunOSSManager.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/10/18.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import AliyunOSSiOS
-
-let kAliyunOSSAccessKeyId: String = "LTAIG2eCY5UdheM1"
-let kAliyunOSSAccessKeySecret: String = "4RJTcJkZsOJIby2oewUFHqUJxUR1vm"
-let kAliyunOSSBucketPublic: String = "uptoyo"
-let kAliyunOSSBucketPrivate: String = "uptoyo"
-let kAliyunOSSEndpoint: String = "https://oss-cn-zhangjiakou.aliyuncs.com"
-let kAliyunOSSImageEndpoint: String = "http://oss.uptoyo.com"
-let kAliyunOSSSecurityToken: String = "SecurityToken"
-
-
-
-typealias AliyunOSSManagerProgressBlock = (Float) -> Void
-typealias AliyunOSSManagerResultBlockUrl = (Bool, String?) -> Void
-typealias AliyunOSSManagerResultBlockUrls = (Bool, Array<String>?) -> Void
-
-class AliyunOSSManager: NSObject {
-
-    deinit {
-        NXLLog("deinit")
-    }
-    
-    static let shared : AliyunOSSManager = AliyunOSSManager()
-    
-    var client : OSSClient?
-    
-    var configOSSStsModel : ConfigOSSStsModel?
-    
-    /// 初始化AliyunOSS
-    func initAliyunOSSManager(completion: @escaping successCallBack) {
-        
-        SwiftMoyaNetWorkServiceConfig.shared().configOSSStsApi(completion: {
-            [weak self] (configOSSStsModel) -> (Void) in
-            self?.configOSSStsModel = configOSSStsModel as? ConfigOSSStsModel
-            // 1. credential
-            let credential = OSSStsTokenCredentialProvider(accessKeyId: self?.configOSSStsModel?.accessKeyId ?? "", secretKeyId: self?.configOSSStsModel?.accessKeySecret ?? "", securityToken: self?.configOSSStsModel?.stsToken ?? "")
-            
-
-            // 2. OSSClient配置参数
-            let configuration = OSSClientConfiguration()
-            configuration.maxRetryCount = 3
-            configuration.timeoutIntervalForRequest = 20
-//            configuration.isHttpdnsEnable = false
-//            configuration.crc64Verifiable = false
-            // 3. 初始OSS化客户端
-            self?.client = OSSClient(endpoint: kAliyunOSSEndpoint, credentialProvider: credential, clientConfiguration: configuration)
-            completion(nil)
-            
-        }) { (loadingStatus) in
-            SwiftProgressHUD.shared().showText("获取token失败")
-            return
-        }
-        
-    }
-    
-    
-    /// 创建请求
-    ///
-    /// - Parameters:
-    ///   - image: 图片
-    ///   - progressBlock: 进度条
-    /// - Returns: 返回
-    func getPut(image:UIImage,
-                progressBlock:@escaping AliyunOSSManagerProgressBlock)-> OSSPutObjectRequest {
-        
-        // 0.初始化客户端
-        initAliyunOSSManager { (_) -> (Void) in
-            
-        }
-        // 1.上传请求
-        let put = OSSPutObjectRequest()
-        
-        // 1.1.设置bucketName (文件夹名,与OSS对应)
-        put.bucketName = configOSSStsModel?.bucket ?? ""
-        
-        // 1.2.文件名路径
-        put.objectKey = AliyunOSSManager.objectKey()
-        
-        // 1.3.上传对象(图片data)
-        put.uploadingData = Data.imageCompressForSize(sourceImage: image, targetPx: 750.0) ?? image.pngData()!
-        
-        // 1.4.上传进度
-        put.uploadProgress = { (bytesSent , totalByteSent , totalBytesExpectedToSend) in
-            let progress = totalByteSent/totalBytesExpectedToSend
-            progressBlock(Float(progress))
-        }
-        return put
-        
-    }
-    
-    
-    /// 异步上传 单张图片
-    ///
-    /// - Parameters:
-    ///   - image: 图片
-    ///   - progressBlock: 进度
-    ///   - resultBlockUrl: 完成返回的url
-    func uploadPhotoAsync(image:UIImage,
-                          progressBlock:@escaping AliyunOSSManagerProgressBlock,
-                          resultBlockUrl:@escaping AliyunOSSManagerResultBlockUrl) {
-        
-        // 1. 创建请求
-        let put = getPut(image: image, progressBlock: progressBlock)
-        
-        // 2. 上传
-        let putTast = client?.putObject(put)
-        
-        putTast?.continue({ (task) -> Any? in
-            if (task.error != nil) {
-                NXLLog("上传失败:\(String(describing: task.error))")
-                DispatchQueue.main.async {
-                    resultBlockUrl(false,nil)
-                }
-            }else {
-                NXLLog("上传成功")
-                DispatchQueue.main.async {
-                    // 上传成功后的图片UrlStr
-                    let urlSting = kAliyunOSSImageEndpoint + "/" + put.objectKey
-                    resultBlockUrl(true,urlSting)
-                }
-            }
-            return nil
-        })
-        
-    }
-    
-    /// 同步上传 单张图片
-    ///
-    /// - Parameters:
-    ///   - image: 图片
-    ///   - progressBlock: 进度
-    ///   - resultBlockUrl: 完成返回的url
-    func uploadPhotoSync(image:UIImage,
-                          progressBlock:@escaping AliyunOSSManagerProgressBlock,
-                          resultBlockUrl:@escaping AliyunOSSManagerResultBlockUrl){
-        
-        // 1. 创建请求
-        let put = getPut(image: image, progressBlock: progressBlock)
-        
-        // 2. 上传
-        let putTast = client?.putObject(put)
-        
-        putTast?.continue({ (task) -> Any? in
-            if (task.error != nil) {
-                NXLLog("上传成功")
-                DispatchQueue.main.async {
-                    // 上传成功后的图片UrlStr
-                    // 上传成功后的图片UrlStr
-                    let urlSting = kAliyunOSSImageEndpoint + "/" + put.objectKey
-                    resultBlockUrl(true,urlSting)
-                }
-            }else {
-                NXLLog("上传失败:\(String(describing: task.error))")
-                DispatchQueue.main.async {
-                    resultBlockUrl(false,nil)
-                }
-            }
-            return nil
-        }).waitUntilFinished()
-    }
-    
-    
-    /// 多图上传
-    ///
-    /// - Parameters:
-    ///   - images: 多图
-    ///   - progressBlock: 进度
-    ///   - resultBlockUrl: 返回url
-    ///   - isAsync: 是否异步
-    func uploadPhotos(images:Array<UIImage>,
-                      progressBlock:@escaping AliyunOSSManagerProgressBlock,
-                      resultBlockUrls:@escaping AliyunOSSManagerResultBlockUrls,
-                      isAsync:Bool)  {
-        // 0.初始化客户端
-        initAliyunOSSManager { (_) -> (Void) in
-            // 1.线程队列
-            let queue = OperationQueue()
-            // 1.1最大线程数
-            queue.maxConcurrentOperationCount = images.count
-            var imageUrls = Array<String>()
-            
-            for image in images {
-                //创建operation
-                let operation = BlockOperation { [weak self] () -> Void in
-                    // 1.上传请求
-                    let put = OSSPutObjectRequest()
-                    
-                    // 1.1.设置bucketName (文件夹名,与OSS对应)
-                    put.bucketName = self?.configOSSStsModel?.bucket ?? ""
-                    
-                    // 1.2.文件名路径
-                    put.objectKey = AliyunOSSManager.objectKey()
-                    
-                    // 1.3.上传对象(图片data)
-                    put.uploadingData = Data.imageCompressForSize(sourceImage: image, targetPx: 1280.0) ?? image.pngData()!
-                    
-                    // 图片url
-                    // 上传成功后的图片UrlStr
-                    let urlSting = kAliyunOSSImageEndpoint + "/" + put.objectKey
-                    imageUrls.append(urlSting)
-                    
-                    // 1.4.上传进度
-                    //                put.uploadProgress = { (bytesSent , totalByteSent , totalBytesExpectedToSend) in
-                    //                    let progress = totalByteSent/totalBytesExpectedToSend
-                    //                    progressBlock(Float(progress))
-                    //                }
-                    
-                    // 1.5.上传
-                    let putTast = self?.client?.putObject(put)
-                    
-                    putTast?.continue({ (task) -> Any? in
-                        if (task.error != nil) {
-                            NXLLog("上传失败:\(String(describing: task.error))")
-                            
-                        }else {
-                            let result = task.result as? OSSPutObjectResult
-                            NXLLog("上传成功")
-                            NXLLog("Result - requestId: \(result?.requestId ?? ""),headerFields:\(String(describing: result?.httpResponseHeaderFields))")
-                            
-                        }
-                        return nil
-                    }).waitUntilFinished()
-                    
-                    // 异步
-                    if isAsync {
-                        if image == images.last {
-                            NXLLog("上传完成")
-                            resultBlockUrls(true,imageUrls)
-                        }
-                    }
-                    
-                }
-                if queue.operations.count != 0 {
-                    operation.addDependency(queue.operations.last!)
-                }
-                
-                queue.addOperation(operation)
-            }
-            
-            //同步
-            if !isAsync {
-                queue.waitUntilAllOperationsAreFinished()
-                resultBlockUrls(true,imageUrls)
-            }
-        }
-        
-    }
-}
-
-extension AliyunOSSManager {
-    
-    
-    /// 图片路径
-    static func objectKey() -> String {
-        
-        /// 时间文件夹
-        let dateStr = Date.dateToString(Date(), dateFormat: "yyyyMM")
-        
-        /// 时间戳
-        let dateTimeStamp = Date().timeStamp()
-        
-        /// 随机字符串
-        let randomString = PathManager.randomString()!
-        
-        /// 图片名
-        let imgName = "\(Int(dateTimeStamp))" + "_" + randomString + ".png"
-        
-        /// 路径
-        let objectKey = dateStr + "/" + imgName
-        return objectKey
-    }
-}

+ 0 - 46
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodUpToYoPublishModel.swift

@@ -1,46 +0,0 @@
-//
-//  AliyunVodupToYoPublishModel.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/8/10.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class AliyunVodUpToYoPublishModel: NSObject {
-    
-    /// 发布类型
-    ///
-    /// - image: 图片
-    /// - video: 视频
-    enum PublishType {
-        case image
-        case video
-    }
-    
-    /// 上传到后端
-    var title: String?
-    var content: String?
-    var locationString: String?
-    var topicIds: Array<String>?
-    
-    //图片/视频
-    var publishType : PublishType?
-    
-    //图片
-    var images: Array<UIImage>?
-    var imageUrlPaths:Array<String>?
-    var imageUrls = Array<String>()
-    
-    //视频
-    var videoPath: String?
-    var videoCoverImage: UIImage?
-    var videoCoverImageUrlPath: String?
-    var pushVideoId: String?
-    var pushVideoCoverImageUrl: String?
-    
-    /// 授权凭证
-    var uploadAuth : String?
-    
-}

+ 0 - 344
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/AliyunVodupToyoPublishManager.swift

@@ -1,344 +0,0 @@
-//
-//  AliyunVodupToyoPublishManager.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/8/10.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import SwiftyJSON
-
-class AliyunVodUpToyoPublishManager: NSObject {
-    
-    deinit {
-        NXLLog("deinit")
-    }
-    
-    static let shared : AliyunVodUpToyoPublishManager = AliyunVodUpToyoPublishManager()
-    
-    /// 参数模型
-    var aliyunVodUpToYoPublishModel : AliyunVodUpToYoPublishModel?
-    
-    /// 进度条View
-    var progressView :PublishUploadProgressView?
-    
-    /// 是否上传视频
-    var isUploadingVideo: Bool = true
-    
-    /// 多图上传次数
-    var curTimes : Int = 0
-    
-    /// 多图上传的进度值
-    var imagesProgressValue : CGFloat = 0.0
-   
-    /// 阿里云上传发布管理
-    var aliyunVodPublishManager: AliyunVodPublishManager?
-    
-    /// 发布
-    ///
-    /// - Parameters:
-    ///   - aliyunVodUpToYoPublishModel: 发布参数
-    ///   - view: 发布View
-    func publish(aliyunVodUpToYoPublishModel:AliyunVodUpToYoPublishModel?,view:UIView?) {
-       
-        let aliyunVodPublishManager = AliyunVodPublishManager()
-        aliyunVodPublishManager.uploadCallback = self
-        self.aliyunVodPublishManager = aliyunVodPublishManager
-        self.aliyunVodUpToYoPublishModel = aliyunVodUpToYoPublishModel
-        progressView = PublishUploadProgressView.publishUploadProgressView(attachedView: view)
-        progressView?.attachedView?.isHidden = false
-        self.progressView?.curUploadStatus = nil
-        
-        if self.aliyunVodUpToYoPublishModel?.publishType == .video { //视频
-            progressView?.imageView.image = aliyunVodUpToYoPublishModel?.videoCoverImage
-            videoUploadAuth()
-        }else if self.aliyunVodUpToYoPublishModel?.publishType == .image  { //图片
-            writePhotosToFileAndSetPath()
-        }
-    }
-    
-    func destroy() {
-        self.isUploadingVideo = true
-        self.curTimes = 0
-        self.imagesProgressValue = 0.0
-        self.progressView?.curUploadStatus = nil
-    }
-
-}
-// MARK: - video
-extension AliyunVodUpToyoPublishManager {
-    // 获取视频上传地址和凭证(视频)
-    func videoUploadAuth() {
-        
-        var title = ""
-        if self.aliyunVodUpToYoPublishModel?.title == nil || self.aliyunVodUpToYoPublishModel?.title == "" {
-            title = self.aliyunVodUpToYoPublishModel?.content ?? ""
-        }else {
-            title = self.aliyunVodUpToYoPublishModel?.title ?? ""
-        }
-
-        SwiftMoyaNetWorkServiceCommunity.shared().communityVideoUploadAuthApi(title:title, filename: "\(self.aliyunVodUpToYoPublishModel?.videoPath?.suffix(20) ?? "")", cover_url: self.aliyunVodUpToYoPublishModel?.videoCoverImageUrlPath ?? "", completion: {
-            [weak self] (communityVideoAuthModel) -> (Void) in
-            let communityVideoAuthModel = communityVideoAuthModel as? CommunityVideoAuthModel
-            self?.aliyunVodUpToYoPublishModel?.pushVideoId = communityVideoAuthModel?.videoId
-            self?.aliyunVodUpToYoPublishModel?.uploadAuth = communityVideoAuthModel?.uploadAuth
-            self?.uploadVideo(communityVideoAuthModel: communityVideoAuthModel)
-        }) { [weak self] _ in
-            self?.progressView?.attachedView?.isHidden = true
-            self?.destroy()
-        }
-    }
-    
-    /// 上传视频
-    ///
-    /// - Parameter communityVideoAuthModel: 上传地址和凭证(图片)
-    func uploadVideo(communityVideoAuthModel:CommunityVideoAuthModel?) {
-        //上传视频
-        aliyunVodPublishManager?.uploadVideo(withPath: self.aliyunVodUpToYoPublishModel?.videoPath ?? "", uploadAddress: communityVideoAuthModel?.uploadAddress ?? "", uploadAuth: communityVideoAuthModel?.uploadAuth ?? "")
-    }
-    // 获取视频上传地址和凭证(视频封面图片)
-    func videoCoverImageUploadAuth(){
-        SwiftMoyaNetWorkServiceCommunity.shared().communityImageUploadAuth(completion: {
-            [weak self] (communityImageAuthModel) -> (Void) in
-            let communityImageAuthModel = communityImageAuthModel as? CommunityImageAuthModel
-            
-            let imgWidth  = Int(self?.aliyunVodUpToYoPublishModel?.videoCoverImage?.size.width ?? 0)
-            let imgHeight = Int(self?.aliyunVodUpToYoPublishModel?.videoCoverImage?.size.height ?? 0)
-            let urlStr = String(format: "%@?%ld_%ld", communityImageAuthModel?.imageURL ?? "", imgWidth, imgHeight)
-            // 设置主图
-            self?.aliyunVodUpToYoPublishModel?.pushVideoCoverImageUrl = urlStr
-            self?.aliyunVodUpToYoPublishModel?.uploadAuth = communityImageAuthModel?.uploadAuth
-            self?.uploadVideoCoverImage(communityImageAuthModel: communityImageAuthModel)
-        }) {[weak self] _ in
-            self?.destroy()
-        }
-    }
-    
-    /// 上传视频封面图
-    ///
-    /// - Parameter communityVideoAuthModel: 上传地址和凭证(图片)
-    func uploadVideoCoverImage(communityImageAuthModel:CommunityImageAuthModel?) {
-        aliyunVodPublishManager?.uploadImage(withPath: self.aliyunVodUpToYoPublishModel?.videoCoverImageUrlPath ?? "", uploadAddress: communityImageAuthModel?.uploadAddress ?? "", uploadAuth: communityImageAuthModel?.uploadAuth ?? "")
-    }
-    
-    
-    // 发布视频
-    func publishVideo() {
-        
-        let topicJsonStr = JSON(self.aliyunVodUpToYoPublishModel?.topicIds as Any).description
-        let imgs = [self.aliyunVodUpToYoPublishModel?.pushVideoCoverImageUrl]
-        let imgsJsonStr = JSON(imgs as Any).description
-        
-        SwiftMoyaNetWorkServiceCommunity.shared().communityPublishApi(type: "video", img: self.aliyunVodUpToYoPublishModel?.pushVideoCoverImageUrl ?? "", topic_ids: topicJsonStr, video: self.aliyunVodUpToYoPublishModel?.pushVideoId ?? "", title: self.aliyunVodUpToYoPublishModel?.title ?? "", content: self.aliyunVodUpToYoPublishModel?.content ?? "", location: self.aliyunVodUpToYoPublishModel?.locationString ?? "", imgs: imgsJsonStr, completion: {
-            [weak self] (communityPublishModel) -> (Void) in
-            let communityPublishModel = communityPublishModel as? CommunityPublishModel
-            VirusViewModel.shared.publishVirueRecordAddApi(postId: communityPublishModel?.postId, postType: "video", title: self?.aliyunVodUpToYoPublishModel?.title, content: self?.aliyunVodUpToYoPublishModel?.content, postCover: self?.aliyunVodUpToYoPublishModel?.videoCoverImageUrlPath,completion:{
-                [weak self] in
-                self?.progressView?.curUploadStatus = .success
-                self?.progressView?.attachedView?.isHidden = true
-                self?.destroy()
-                NotificationCenter.default.post(name: NSNotification.Name("PublishPostSuccess"), object: nil)
-                }, fail: {
-                    
-            })
-
-        }) { [weak self] _ in
-            self?.progressView?.attachedView?.isHidden = true
-            self?.destroy()
-        }
-    }
-}
-
-// MARK: - image
-extension AliyunVodUpToyoPublishManager {
-    // 存储图片路径
-    func writePhotosToFileAndSetPath() {
-        if !(aliyunVodUpToYoPublishModel?.images?.isEmpty ?? true) {
-            var imageUrlPaths = Array<String>()
-            for image in (aliyunVodUpToYoPublishModel?.images)! {
-                //旋转修正
-                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("存入失败")
-                }
-            }
-            
-            aliyunVodUpToYoPublishModel?.imageUrlPaths = imageUrlPaths
-            imageUploadAuth()
-        }
-    }
-    
-    // 获取上传地址和凭证(图片)
-    func imageUploadAuth(){
-        SwiftMoyaNetWorkServiceCommunity.shared().communityImageUploadAuth(completion: {
-            [weak self] (communityImageAuthModel) -> (Void) in
-            let communityImageAuthModel = communityImageAuthModel as? CommunityImageAuthModel
-            self?.progressView?.imageView.image = self?.aliyunVodUpToYoPublishModel?.images?[(self?.curTimes)!]
-            
-            let imgWidth  = Int(self?.aliyunVodUpToYoPublishModel?.images?[(self?.curTimes)!].size.width ?? 0)
-            let imgHeight = Int(self?.aliyunVodUpToYoPublishModel?.images?[(self?.curTimes)!].size.height ?? 0)
-            let urlStr = String(format: "%@?%ld_%ld", communityImageAuthModel?.imageURL ?? "", imgWidth, imgHeight)
-            self?.aliyunVodUpToYoPublishModel?.imageUrls.append(urlStr)
-            self?.aliyunVodUpToYoPublishModel?.uploadAuth = communityImageAuthModel?.uploadAuth
-            self?.uploadImage(communityImageAuthModel: communityImageAuthModel)
-        }) {[weak self] _ in
-            self?.progressView?.attachedView?.isHidden = true
-            self?.destroy()
-        }
-    }
-    
-    /// 上传图片
-    ///
-    /// - Parameter communityVideoAuthModel: 上传地址和凭证(图片)
-    func uploadImage(communityImageAuthModel:CommunityImageAuthModel?) {
-        if !(self.aliyunVodUpToYoPublishModel?.imageUrlPaths?.isEmpty ?? true) {
-             aliyunVodPublishManager?.uploadImage(withPath: self.aliyunVodUpToYoPublishModel?.imageUrlPaths?[(self.curTimes)] ?? "", uploadAddress: communityImageAuthModel?.uploadAddress ?? "", uploadAuth: communityImageAuthModel?.uploadAuth ?? "")
-        }else {
-            self.progressView?.attachedView?.isHidden = true
-            self.destroy()
-            SwiftProgressHUD.shared().showText("图片路径存储错误,请重新上传")
-        }
-    }
-    
-    
-    // 发布图片
-    func publishImage() {
-        
-        let topicJsonStr = JSON(self.aliyunVodUpToYoPublishModel?.topicIds as Any).description
-        let imgsJsonStr = JSON(self.aliyunVodUpToYoPublishModel?.imageUrls as Any).description
-        
-        SwiftMoyaNetWorkServiceCommunity.shared().communityPublishApi(type: "image", img: self.aliyunVodUpToYoPublishModel?.imageUrls.first ?? "", topic_ids: topicJsonStr, title: self.aliyunVodUpToYoPublishModel?.title ?? "", content: self.aliyunVodUpToYoPublishModel?.content ?? "", location: self.aliyunVodUpToYoPublishModel?.locationString ?? "", imgs: imgsJsonStr, completion: {
-            [weak self] (communityPublishModel) -> (Void) in
-            let communityPublishModel = communityPublishModel as? CommunityPublishModel
-            VirusViewModel.shared.publishVirueRecordAddApi(postId: communityPublishModel?.postId, postType: "image", title: self?.aliyunVodUpToYoPublishModel?.title, content: self?.aliyunVodUpToYoPublishModel?.content, postCover: self?.aliyunVodUpToYoPublishModel?.imageUrls.first,completion:{
-                [weak self] in
-                self?.progressView?.curUploadStatus = .success
-                self?.progressView?.attachedView?.isHidden = true
-                self?.destroy()
-                NotificationCenter.default.post(name: NSNotification.Name("PublishPostSuccess"), object: nil)
-                }, fail: { [weak self] in
-                    self?.progressView?.attachedView?.isHidden = true
-                    self?.destroy()
-            })
-
-        }) { [weak self] _ in
-            self?.progressView?.attachedView?.isHidden = true
-            self?.destroy()
-        }
-    }
-    
-}
-
-extension AliyunVodUpToyoPublishManager: AliyunIVodUploadCallback {
-    
-    /// 上传成功
-    ///
-    /// - Parameter manager: AliyunVodPublishManager
-    func publishManagerUploadSuccess(_ manager: AliyunVodPublishManager) {
-        if self.aliyunVodUpToYoPublishModel?.publishType == .video { //发布视频
-            if isUploadingVideo {
-                isUploadingVideo = false
-                videoCoverImageUploadAuth()
-            }else {
-                publishVideo()
-            }
-        }else if self.aliyunVodUpToYoPublishModel?.publishType == .image { //图片
-            // 图片上传流程
-            self.curTimes += 1
-            if self.curTimes < self.aliyunVodUpToYoPublishModel?.images?.count ?? 1 {
-                self.imagesProgressValue = CGFloat(CGFloat(self.curTimes)/CGFloat((self.aliyunVodUpToYoPublishModel?.images?.count ?? 1)))
-                // 继续上传
-                self.imageUploadAuth()
-            }else {
-                // 图片上传成功,去发布
-                self.publishImage()
-            }
-
-        }
-    }
-
-    /// 上传失败
-    ///
-    /// - Parameters:
-    ///   - manager: AliyunVodPublishManager
-    ///   - code: 错误码
-    ///   - message: 错误描述
-    func publishManager(_ manager: AliyunVodPublishManager, uploadFailedWithCode code: String, message: String) {
-        self.progressView?.curUploadStatus = .failure
-        self.destroy()
-        manager.cancelUpload()
-    }
-    
-    /// 上传进度
-    ///
-    /// - Parameters:
-    ///   - manager: AliyunVodPublishManager
-    ///   - uploadedSize: 已上传数据大小
-    ///   - totalSize: 所有数据大小
-    func publishManager(_ manager: AliyunVodPublishManager, uploadProgressWithUploadedSize uploadedSize: Int64, totalSize: Int64) {
-        let uploadedSizeStr = "\(uploadedSize)" as NSString
-        let totalSizeStr = "\(totalSize)" as NSString
-        self.progressView?.curUploadStatus = .uploading
-        if (manager.uploadState == .video) { //上传视频
-            if isUploadingVideo {
-                let progressValue : CGFloat = CGFloat(uploadedSizeStr.doubleValue / totalSizeStr.doubleValue / 2.0)
-                DispatchQueue.main.async(execute: {
-                    [weak self] in
-                    self?.progressView?.uploadProgress = progressValue
-                })
-
-            }else {
-                let progressValue : CGFloat = CGFloat(uploadedSizeStr.doubleValue / totalSizeStr.doubleValue / 2.0) + 0.5
-                DispatchQueue.main.async(execute: {
-                    [weak self] in
-                    self?.progressView?.uploadProgress = progressValue
-                })
-            }
-        }else {
-            if self.aliyunVodUpToYoPublishModel?.publishType == .video { //上传视频封面图
-                let progressValue : CGFloat = CGFloat(uploadedSizeStr.doubleValue / totalSizeStr.doubleValue / 2.0) + 0.5
-                DispatchQueue.main.async(execute: {
-                    [weak self] in
-                    self?.progressView?.uploadProgress = progressValue
-                })
-            }else if self.aliyunVodUpToYoPublishModel?.publishType == .image {
-                DispatchQueue.main.async(execute: {
-                    [weak self] in
-                    let imagesStr = "\(self?.aliyunVodUpToYoPublishModel?.images?.count ?? 1)" as NSString
-                    let progressValue : CGFloat = CGFloat(uploadedSizeStr.doubleValue / totalSizeStr.doubleValue / imagesStr.doubleValue) + (self?.imagesProgressValue ?? 0.0)
-                    // 更新进度
-                    self?.progressView?.uploadProgress = progressValue
-                })
-            }
-        }
-    }
-    
-    /// 上传token过期
-    ///
-    /// - Parameter manager: AliyunVodPublishManager
-    func publishManagerUploadTokenExpired(_ manager: AliyunVodPublishManager) {
-        manager.refresh(withUploadAuth: self.aliyunVodUpToYoPublishModel?.uploadAuth ?? "")
-    }
-    
-    /// 上传超时,开始尝试重试
-    ///
-    /// - Parameter manager: AliyunVodPublishManager
-    func publishManagerUploadRetry(_ manager: AliyunVodPublishManager) {
-        NXLLog("继续上传")
-    }
-
-    /// 重试成功,开始继续上传
-    ///
-    /// - Parameter manager: AliyunVodPublishManager
-    func publishManagerUploadRetryResume(_ manager: AliyunVodPublishManager) {
-        NXLLog("重试成功")
-    }
-    
-}

+ 0 - 188
RainbowPlanet/RainbowPlanet/Manager/AliyunManager/AliyunVodManager/AliyunVodUpToyoPublishManager/PublishUploadProgressView.swift

@@ -1,188 +0,0 @@
-//
-//  PublishUploadProgressView.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/7/21.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  发布进度のView
-
-import UIKit
-import FWPopupView
-import RxSwift
-import RxCocoa
-
-/// 跳转方式
-///
-/// - none: 默认
-/// - push: push
-enum UploadStatus{
-    case uploading
-    case success
-    case failure
-}
-
-class PublishUploadProgressView: FWPopupView {
-    
-    
-    
-    let disposeBag = DisposeBag()
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    
-    func setupViews() {
-        self.backgroundColor = kffffffColor
-        addSubview(imageView)
-        addSubview(progressLabel)
-        addSubview(progressView)
-        addSubview(failedLabel)
-        addSubview(failedCloseButton)
-    }
-    
-    func setupLayouts() {
-        imageView.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.centerY.equalToSuperview()
-            make.size.equalTo(44)
-        }
-        progressLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(imageView.snp.right).offset(10)
-            make.top.equalTo(14)
-            make.height.equalTo(20)
-        }
-        progressView.snp.makeConstraints { (make) in
-            make.top.equalTo(progressLabel.snp.bottom).offset(10)
-            make.left.equalTo(imageView.snp.right).offset(10)
-            make.right.equalTo(-15)
-            make.height.equalTo(4)
-        }
-        failedLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(imageView.snp.right).offset(10)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(20)
-        }
-        failedCloseButton.snp.makeConstraints { (make) in
-            make.right.equalTo(-3)
-            make.centerY.equalToSuperview()
-            make.size.equalTo(44)
-        }
-    }
-    
-    lazy var imageView: UIImageView = {
-        let imageView = UIImageView()
-        imageView.image = kImage(name: "default_pic")
-        imageView.contentMode =  .scaleAspectFill
-        imageView.clipsToBounds = true
-        return imageView
-    }()
-    
-    private lazy var progressLabel: UILabel = {
-        let progressLabel = UILabel()
-        progressLabel.textColor = k333333Color
-        progressLabel.font = kRegularFont14
-        progressLabel.textAlignment = .left
-        return progressLabel
-    }()
-    
-    private lazy var progressView: UIProgressView = {
-        let progressView = UIProgressView(progressViewStyle: .default)
-        progressView.setProgress(0, animated: false)
-        progressView.progressTintColor = kThemeColor //进度颜色
-        progressView.trackTintColor = kd8d8d8Color //剩余进度颜色
-        progressView.cornerRadius = 2
-        progressView.masksToBounds = true
-        return progressView
-    }()
-    
-    private lazy var failedLabel: UILabel = {
-        let failedLabel = UILabel()
-        failedLabel.text = "发布失败..."
-        failedLabel.textColor = k333333Color
-        failedLabel.font = kRegularFont14
-        failedLabel.textAlignment = .left
-        return failedLabel
-    }()
-    
-    private lazy var failedCloseButton: UIButton = {
-        let failedCloseButton = UIButton(type: UIButton.ButtonType.custom)
-        failedCloseButton.setImage(kImage(name: "popup_btn_close_black"), for: .normal)
-        failedCloseButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.hide()
-            self?.attachedView?.isHidden = true
-            
-        }).disposed(by: disposeBag)
-        return failedCloseButton
-    }()
-    
-    var curUploadStatus : UploadStatus? {
-        didSet {
-            if curUploadStatus != nil {
-                judgeShowStatus()
-            }
-        }
-    }
-    
-    var uploadProgress: CGFloat? {
-        didSet {
-            progressView.setProgress(Float(self.uploadProgress ?? 0), animated: true)
-            
-            var progressValue: Float = Float(self.uploadProgress ?? 0)
-            progressValue = progressValue * 100
-            let proValueStr: String = String(format: "正在上传中%.0f%%", progressValue)
-            progressLabel.text = proValueStr
-        }
-    }
-    
-    class func publishUploadProgressView(attachedView:UIView?) -> PublishUploadProgressView {
-        let view = PublishUploadProgressView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 62))
-        view.curUploadStatus = .uploading
-        let vProperty = FWPopupViewProperty()
-        vProperty.popupCustomAlignment = .topCenter
-        vProperty.popupViewEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0 )
-        vProperty.popupAnimationType = .frame
-        vProperty.maskViewColor = UIColor(white: 0, alpha: 0.5)
-        vProperty.touchWildToHide = "0"
-        vProperty.maskViewColor = UIColor.clear
-        view.vProperty = vProperty
-        view.attachedView = attachedView
-        view.show()
-        return view
-    }
-    
-}
-
-extension PublishUploadProgressView {
-    
-    
-    func judgeShowStatus() -> Void {
-        switch curUploadStatus {
-        case .uploading?:
-            progressLabel.isHidden = false
-            progressView.isHidden = false
-            failedLabel.isHidden = true
-            failedCloseButton.isHidden = true
-            progressLabel.text = "正在上传中..."
-        case .success?:
-            progressLabel.isHidden = false
-            progressView.isHidden = false
-            failedLabel.isHidden = true
-            failedCloseButton.isHidden = true
-            progressLabel.text = "上传成功!发布中..."
-        case .failure?:
-            progressLabel.isHidden = true
-            progressView.isHidden = true
-            failedLabel.isHidden = false
-            failedCloseButton.isHidden = false
-        case .none:
-            break
-        }
-    }
-}

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?
-}

+ 303 - 0
RainbowPlanet/RainbowPlanet/Manager/PathManager/PathURLManager.swift

@@ -0,0 +1,303 @@
+//
+//  PathURLManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/25.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+
+class PathURLManager: NSObject {
+    
+    /// 获取程序的Home目录 ./
+    ///
+    /// - Returns: 获取程序的Home目录
+    private class func homePath() -> URL? {
+        return URL(fileURLWithPath: NSHomeDirectory())
+    }
+    
+    /// 获取Documnets目录  ./Documents
+    ///
+    /// - Returns: 获取Documnets目录
+    private class func documentPath() -> URL? {
+        return FileManager.default.urls(for: .documentDirectory,in: .userDomainMask).first
+    }
+    
+    /// 获取Library目录 ./Library
+    ///
+    /// - Returns: 获取Library目录
+    private class func libraryPath() -> URL? {
+        return FileManager.default.urls(for: .libraryDirectory,in: .userDomainMask).first
+    }
+    
+    /// 获取Caches目录  ./Library/Caches
+    ///
+    /// - Returns: 获取Caches目录
+    private class func cachesPath() -> URL? {
+        return FileManager.default.urls(for: .cachesDirectory,in: .userDomainMask).first
+    }
+    
+    /// 获取tmp目录  ./tmp
+    ///
+    /// - Returns: 获取tmp目录
+    class func tmpPath() -> URL? {
+        return URL(fileURLWithPath: NSTemporaryDirectory())
+    }
+    
+    /// 清除指定路径的文件
+    ///
+    /// - Parameter pathString: 清除指定路径的文件
+    class func clearPath(pathURL:URL) {
+        do {
+            try  FileManager.default.removeItem(at: pathURL)
+        } catch {
+            NXLLog("清理\(pathURL)失败")
+        }
+    }
+}
+
+// MARK: - 创建项目目录路径
+extension PathURLManager {
+    
+    /// 获取Documnets目录 ./Documents/UpToYo
+    ///
+    /// - Returns: 获取Documnets目录
+    class func projectDocumentPath() -> URL? {
+        return documentPath()?.appendingPathComponent("UpToYo")
+    }
+    
+    /// 获取Library目录 ./Library/UpToYo
+    ///
+    /// - Returns: 获取Library目录
+    class func projectLibraryPath() -> URL? {
+        let uptoyo = libraryPath()?.appendingPathComponent("UpToYo")
+        return createDirectory(pathURL: uptoyo)
+    }
+    
+    /// 获取Caches目录 ./Library/Caches/UpToYo
+    ///
+    /// - Returns: 获取Caches目录
+    class func projectCachesPath() -> URL? {
+        let uptoyo = cachesPath()?.appendingPathComponent("UpToYo")
+        return createDirectory(pathURL: uptoyo)
+    }
+    
+    /// 获取tmp目录  ./tmp/UpToYo
+    ///
+    /// - Returns: 获取tmp目录
+    class func projectTmpPath() -> URL? {
+        let uptoyo = tmpPath()?.appendingPathComponent("UpToYo")
+        return createDirectory(pathURL: uptoyo)
+    }
+}
+
+// MARK: - 创建项目目录文件夹
+extension PathURLManager {
+    
+    /// 下载文件
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectDownloadsPath(parentURL:URL?) -> URL? {
+        let downloads = parentURL?.appendingPathComponent("Downloads")
+        return createDirectory(pathURL: downloads)
+    }
+    
+    
+    /// 录制
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectRecordssPath(parentURL:URL?) -> URL? {
+        let resources = parentURL?.appendingPathComponent("Records")
+        return createDirectory(pathURL: resources)
+    }
+    
+}
+
+// MARK: - 创建资源目录
+extension PathURLManager {
+    
+    /// 资源文件
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectResourcesPath(parentURL:URL?) -> URL? {
+        let resources = parentURL?.appendingPathComponent("Resources")
+        return createDirectory(pathURL: resources)
+    }
+    
+}
+
+// MARK: - 创建资源下的目录
+extension PathURLManager {
+    
+    /// 图片文件夹
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectPicturesPath(parentURL:URL?) -> URL? {
+        let pictures = parentURL?.appendingPathComponent("Pictures")
+        return createDirectory(pathURL: pictures)
+    }
+    
+    /// 视频文件夹
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectVideosPath(parentURL:URL?) -> URL? {
+        let videos = parentURL?.appendingPathComponent("Videos")
+        return createDirectory(pathURL: videos)
+    }
+    
+    /// 音频文件夹
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectAudiosPath(parentURL:URL?) -> URL? {
+        let audios = parentURL?.appendingPathComponent("Audios")
+        return createDirectory(pathURL: audios)
+    }
+    
+}
+
+// MARK: - 时间文件夹
+extension PathURLManager {
+    
+    /// 日期文件
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectDatePath(parentURL:URL?) -> URL? {
+        let dateString = parentURL?.appendingPathComponent(PathURLManager.dateString())
+        return createDirectory(pathURL: dateString)
+    }
+    
+    /// 自定义格式生成日期文件
+    ///
+    /// - Parameters:
+    ///   - dateFormat: 日期格式
+    ///   - parentURL: 上一级的URL
+    /// - Returns: 下载文件下载文件
+    class func projectDateFormatPath(dateFormat:String,parentURL:URL?) -> URL? {
+        let dateString = parentURL?.appendingPathComponent(PathURLManager.dateString(dateFormat: dateFormat))
+        return createDirectory(pathURL: dateString)
+    }
+    
+}
+
+// MARK: - 文件名
+extension PathURLManager {
+    ///
+    /// - Parameters:
+    ///   - fileName: 文件名
+    ///   - parentURL: 上一级的URL
+    /// - Returns: 文件路径
+    class func projectFilePath(fileName:String,parentURL:URL?) -> URL? {
+        let fileUrlPath = parentURL?.appendingPathComponent(fileName)
+        return fileUrlPath
+    }
+}
+
+// MARK: - 生成日期
+extension PathURLManager {
+    
+    /// 生成日期
+    ///
+    /// - Returns: 日期字符串
+    class func dateString() -> String {
+        let dateStr = Date.dateToString(Date(), dateFormat: "yyyyMMdd")
+        return dateStr
+    }
+    
+    /// 自定义格式生成日期
+    ///
+    /// - Returns: 日期字符串
+    class func dateString(dateFormat:String) -> String {
+        let dateStr = Date.dateToString(Date(), dateFormat: dateFormat)
+        return dateStr
+    }
+}
+
+
+
+// MARK: - 生成随机字符串
+extension PathURLManager {
+    /// 生成随机字符串
+    ///
+    /// - Returns: 随机字符串
+    class func randomString() -> String {
+        let puuid = CFUUIDCreate(nil)
+        let uuidString = CFUUIDCreateString(nil, puuid)
+        let result = CFStringCreateCopy(nil, uuidString)
+        return result! as String
+    }
+}
+
+// MARK: - 后缀
+extension PathURLManager {
+    
+    /// video
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 路径
+    class func projectPathExtensionMp4(parentURL:URL?) -> URL? {
+        let pathExtensionUrl = parentURL?.appendingPathExtension("mp4")
+        return pathExtensionUrl
+    }
+    
+    /// audio
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 路径
+    class func projectPathExtensionMp3(parentURL:URL?) -> URL? {
+        let pathExtensionUrl = parentURL?.appendingPathExtension("mp3")
+        return pathExtensionUrl
+    }
+    
+    /// png
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 路径
+    class func projectPathExtensionPng(parentURL:URL?) -> URL? {
+        let pathExtensionUrl = parentURL?.appendingPathExtension("png")
+        return pathExtensionUrl
+    }
+    
+    /// jpg
+    ///
+    /// - Parameter parentURL: 上一级的URL
+    /// - Returns: 路径
+    class func projectPathExtensionJpg(parentURL:URL?) -> URL? {
+        let pathExtensionUrl = parentURL?.appendingPathExtension("jpg")
+        return pathExtensionUrl
+    }
+
+    
+}
+
+
+// MARK: - 创建路径
+extension PathURLManager {
+    /// 创建路径
+    ///
+    /// - Parameter pathURL: 路径
+    /// - Returns: 创建好的路径
+    class func createDirectory(pathURL:URL?) -> URL? {
+        //判断是否有路径
+        if FileManager.default.fileExists(atPath: pathURL?.path ?? "") {
+            return pathURL
+        }else {
+            do {
+                try FileManager.default.createDirectory(atPath: pathURL?.path ?? "", withIntermediateDirectories: true, attributes: nil)
+                return pathURL
+            } catch {
+                NXLLog("路径错误")
+                return nil
+            }
+        }
+    }
+}
+
+

+ 7 - 0
RainbowPlanet/RainbowPlanet/Model/CommunityModel/CommunityRecommendMusicListModel.swift

@@ -45,6 +45,13 @@ class CommunityMusicItemModel : NSObject, Mappable{
     // 本地添加,用于控制状态
     var isPlaying : Bool? = false
     
+    // 本地名字
+    var musicName : String?
+    // 是否选中
+    var isSelected : Bool? = false
+    // 是否使用
+    var isUse :Bool? = false
+    
     
     class func newInstance(map: Map) -> Mappable?{
         return CommunityMusicItemModel()

BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/AlivcShortVideoImage.bundle/watermark.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/VideoResources/tail.png


BIN
RainbowPlanet/RainbowPlanet/Modules/PublishModule/AliyunVideo/AlivcShortVideo/ShortVideoResource/VideoResources/watermark.png


+ 17 - 21
RainbowPlanet/RainbowPlanet/Modules/PublishModule/PublishMusicAbout/PublishMusicListController.swift

@@ -48,7 +48,7 @@ class PublishMusicListController: BaseViewController {
         navigationBar.isHidden = true
         view.backgroundColor = UIColor.clear
         
-        view.addSubview(tableView)        
+        view.addSubview(tableView)
     }
     
     override func setupLayouts() {
@@ -126,7 +126,7 @@ extension PublishMusicListController : UITableViewDelegate, UITableViewDataSourc
     }
     
     public func scrollViewDidScroll(_ scrollView: UIScrollView) {
-        self.listViewDidScrollCallback?(scrollView)
+        listViewDidScrollCallback?(scrollView)
     }
     
 }
@@ -155,9 +155,9 @@ extension PublishMusicListController {
                 if recommendMusicListModel?.pagination?.currentPage == 1 {
                     self?.musicItemMdlArr.removeAll()
                     self?.tableView.resetNoMoreData()
-
+                    
                 }
-//                self?.createDisableMusicItem()
+                //                self?.createDisableMusicItem()
                 self?.musicItemMdlArr = (self?.musicItemMdlArr)! + (recommendMusicListModel?.data!)!
                 
                 self?.tableView.reloadData()
@@ -173,25 +173,21 @@ extension PublishMusicListController {
     
     /// 获取分类下所有音乐
     func communityCateMusicListApi(page:Int, categoryId:Int) {
-        SwiftMoyaNetWorkServiceCommunity.shared().communityCateMusicListApi(categoryID: categoryId, page: page) { [weak self] (categoryMusicListModel) -> (Void) in
+        
+        SwiftMoyaNetWorkServiceCommunity.shared().communityCateMusicListApi(completion: {
+            [weak self] (categoryMusicListModel) -> (Void) in
             let categoryMusicListModel = categoryMusicListModel as? CommunityRecommendMusicListModel
-            if categoryMusicListModel?.pagination?.currentPage ?? 1 <= categoryMusicListModel?.pagination?.totalPages ?? 1 {
-                if categoryMusicListModel?.pagination?.currentPage == 1 {
-                    self?.musicItemMdlArr.removeAll()
-                    self?.tableView.resetNoMoreData()
-
-                }
-//                self?.createDisableMusicItem()
-                self?.musicItemMdlArr = (self?.musicItemMdlArr)! + (categoryMusicListModel?.data!)!
-                
-                self?.tableView.reloadData()
-                if  self?.musicItemMdlArr.count ?? 0 >= categoryMusicListModel?.pagination?.total ?? 0 {
-                    self?.tableView.endFooterNoMoreData()
-                }
-                
-            } else {
-                self?.tableView.endFooterNoMoreData()
+            DIYEmptyView.emptyNoDataTableView(tableView: self?.tableView)
+            
+            if categoryMusicListModel?.pagination?.currentPage == 1{
+                self?.musicItemMdlArr.removeAll()
+                self?.tableView.resetNoMoreData()
             }
+            self?.musicItemMdlArr = (self?.musicItemMdlArr)! + (categoryMusicListModel?.data!)!
+            self?.tableView.reloadData()
+            MJRefreshManager.mjRefreshManagerNoHiddenFooter(tableView: self?.tableView, pagination: categoryMusicListModel?.pagination)
+        }) { [weak self] (loadingStatus) in
+            MJRefreshManager.mjRefreshManagerLoadingStatus(tableView: self?.tableView,loadingStatus: loadingStatus)
         }
     }
     

+ 0 - 120
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishConfirmPhotoNew/PublishConfirmPhotoNewViewController.swift

@@ -1,120 +0,0 @@
-//
-//  PublishConfirmPhotoNewViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/9/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class PublishConfirmPhotoNewViewController: BaseViewController {
-
-   override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var photoImg: UIImage? {
-        didSet {
-            photoImageView.image = self.photoImg
-        }
-    }
-    
-    typealias PubImgClosure = (_ selectedAssetArray: Array<UIImage>) -> Void
-    var pubImgClosure: PubImgClosure?
-    
-    typealias BackClosure = () -> Void
-    var backClosure: BackClosure?
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override var shouldAutorotate: Bool {
-        return false
-    }
-    
-    override func setupViews() {
-        navigationBar.isHidden = true
-        statusBarStyle = .lightContent
-        self.view.backgroundColor = UIColor.black
-        
-        view.addSubview(photoImageView)
-        view.addSubview(retakeBtn)
-        view.addSubview(usePhotoBtn)
-    }
-    
-    override func setupLayouts() {
-        photoImageView.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-            make.width.equalTo(kScreenWidth)
-            make.height.equalTo(kScreenWidth * 16 / 9)
-        }
-        retakeBtn.snp.makeConstraints { (make) in
-            make.left.equalTo(photoImageView.snp.left)
-            make.bottom.equalTo(-kSafeTabBarHeight)
-            make.width.equalTo(125)
-            make.height.equalTo(48)
-        }
-        usePhotoBtn.snp.makeConstraints { (make) in
-            make.right.equalTo(photoImageView.snp.right)
-            make.bottom.equalTo(-kSafeTabBarHeight)
-            make.width.equalTo(125)
-            make.height.equalTo(48)
-        }
-    }
-    
-    override func setupData() {
-        retakeBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.navigationController?.popViewController(animated: true)
-        }).disposed(by: disposeBag)
-        
-        usePhotoBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            PHPhotoLibrary.shared().performChanges({
-                
-            }, completionHandler: { [weak self] (success, error) in
-                    // 写入相册成功后,回到主线程进行流程
-                    DispatchQueue.main.async {
-                         [weak self] in
-                        if success != true{
-                            SwiftProgressHUD.shared().showText("保存失败")
-                            return
-                        }
-                        let imageArr: Array<UIImage> = [(self?.photoImg)!]
-                        if let pubImgClosure = self?.pubImgClosure {
-                            pubImgClosure(imageArr)
-                        }
-                    }
-            })
-            
-        }).disposed(by: disposeBag)
-    }
-    
-    private lazy var photoImageView: UIImageView = {
-        let photoImageView = UIImageView()
-        photoImageView.contentMode = .scaleAspectFit
-        return photoImageView
-    }()
-    
-    private lazy var retakeBtn: UIButton = {
-        let retakeBtn = UIButton(type: UIButton.ButtonType.custom)
-        retakeBtn.setTitle("重拍", for: .normal)
-        retakeBtn.setTitleColor(kffffffColor, for: .normal)
-        retakeBtn.titleLabel?.font = kMediumFont15
-       
-        return retakeBtn
-    }()
-    
-    private lazy var usePhotoBtn: UIButton = {
-        let usePhotoBtn = UIButton(type: UIButton.ButtonType.custom)
-        usePhotoBtn.setTitle("使用照片", for: .normal)
-        usePhotoBtn.setTitleColor(kffffffColor, for: .normal)
-        usePhotoBtn.titleLabel?.font = kMediumFont15
-        
-        return usePhotoBtn
-    }()
-
-}

+ 18 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewEffect/PublishNewEffectFilterView/PublishNewEffectFilterCollectionViewCell.swift

@@ -61,7 +61,6 @@ class PublishNewEffectFilterCollectionViewCell: UICollectionViewCell {
     
     private lazy var iconImageView: UIImageView = {
         let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "video_pic_filter_artwork")
         iconImageView.cornerRadius = 52/2
         iconImageView.masksToBounds = true
         return iconImageView
@@ -74,17 +73,34 @@ class PublishNewEffectFilterCollectionViewCell: UICollectionViewCell {
         iconView.layer.borderWidth = 2
         iconView.cornerRadius = 52/2
         iconView.masksToBounds = true
+        iconView.isHidden = true
         return iconView
     }()
     
     private lazy var titleLabel: UILabel = {
         let titleLabel = UILabel()
-        titleLabel.text = "滤镜"
         titleLabel.textColor = kffffffColor
         titleLabel.font = kRegularFont12
         titleLabel.textAlignment = .center
         titleLabel.numberOfLines = 1
         return titleLabel
     }()
+    
+    override var isSelected: Bool {
+        didSet {
+            if isSelected {
+                iconView.isHidden = false
+            }else {
+                iconView.isHidden = true
+            }
+        }
+    }
+    
+    var aliyunFilterModel : AliyunFilterModel? {
+        didSet {
+            titleLabel.text = aliyunFilterModel?.name
+            iconImageView.image = kImage(name: aliyunFilterModel?.icon ?? "video_pic_filter_artwork")
+        }
+    }
 
 }

+ 32 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewEffect/PublishNewEffectFilterView/PublishNewEffectFilterView.swift

@@ -12,6 +12,8 @@ class PublishNewEffectFilterView: BaseView {
 
     override func setupViews() {
         addSubview(collectionView)
+        collectionView.selectItem(at: IndexPath(item: 0, section: 0), animated: true, scrollPosition: UICollectionView.ScrollPosition.centeredHorizontally)
+
     }
     
     override func setupLayouts() {
@@ -22,7 +24,7 @@ class PublishNewEffectFilterView: BaseView {
         
     }
     
-    private lazy var collectionView: UICollectionView = {
+    lazy var collectionView: UICollectionView = {
         let collectionView = UICollectionView.init(frame: CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height), collectionViewLayout: collectionViewLayout)
         collectionView.backgroundColor = UIColor.clear
         collectionView.delegate = self;
@@ -41,6 +43,9 @@ class PublishNewEffectFilterView: BaseView {
         collectionViewLayout.sectionInset = UIEdgeInsets(top: 30, left: 14, bottom: 15, right: 14)
         return collectionViewLayout
     }()
+    
+    typealias DidSelectCloSure = (Int,AliyunEffectFilter ) -> Void
+    var didSelectCloSure : DidSelectCloSure?
 
 }
 
@@ -51,17 +56,41 @@ extension PublishNewEffectFilterView: UICollectionViewDelegateFlowLayout,UIColle
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 10
+        return aliyunFiltersModel?.filters?.count ?? 0
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         let cell = PublishNewEffectFilterCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+        cell.aliyunFilterModel = aliyunFiltersModel?.filters?[indexPath.row]
         return cell
         
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-
+        let aliyunFilterModel = aliyunFiltersModel?.filters?[indexPath.row]
+        
+        /// 初始化滤镜
+        let aliyunEffectFilter = AliyunEffectFilter()
+        
+        let bundle = Bundle.main.bundlePath
+        /// 路径
+        let str =  bundle + (aliyunFilterModel?.resourcePath ?? "")
+        aliyunEffectFilter.path = str
+        
+        /// 图片路径
+        let iconPath = bundle + "/" + (aliyunFilterModel?.icon ?? "")
+        aliyunEffectFilter.icon = iconPath
+        
+        // 滤镜名字
+        aliyunEffectFilter.name = aliyunFilterModel?.name
+        
+        // 滤镜id
+        aliyunEffectFilter.setEffectVid((aliyunFilterModel?.eid)!)
+        
+        if let didSelectCloSure = didSelectCloSure {
+            didSelectCloSure(indexPath.row,aliyunEffectFilter)
+        }
+        collectionView.scrollToItem(at: indexPath, at: UICollectionView.ScrollPosition.centeredHorizontally, animated: true)
     }
 }
 

+ 203 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListView.swift

@@ -0,0 +1,203 @@
+//
+//  PublishNewMusicListView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/24.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+
+var publishNewMusicSelectedindexPath : IndexPath? = nil
+
+class PublishNewMusicListView: BaseView {
+    
+    
+    var categoryId : Int = 0
+    var index : Int? = nil
+    var communityMusicItemModels : Array<CommunityMusicItemModel> = []
+    
+    override func setupViews() {
+        addSubview(tableView)
+    }
+    
+    override func setupLayouts() {
+        tableView.snp.makeConstraints { (make) in
+            make.edges.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        tableView.addHeader(withBeginRefresh: true, animation: false) {
+            [weak self] (page) in
+            self?.communityCateMusicListApi(page: 1)
+        }
+        tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
+            [weak self] (page) in
+            self?.communityCateMusicListApi(page: page)
+        })
+    }
+    
+    lazy var tableView: UITableView = {
+        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
+        tableView.separatorStyle = .none
+        tableView.backgroundColor = UIColor.clear
+        tableView.dataSource = self
+        tableView.delegate = self
+        tableView.showsVerticalScrollIndicator = false
+        tableView.showsHorizontalScrollIndicator = false
+        return tableView
+    }()
+    
+    /// 获取分类下所有音乐
+    func communityCateMusicListApi(page:Int) {
+        
+        SwiftMoyaNetWorkServiceCommunity.shared().communityCateMusicListApi(categoryID:categoryId, page:page,completion: {
+            [weak self] (communityRecommendMusicListModel) -> (Void) in
+            let communityRecommendMusicListModel = communityRecommendMusicListModel as? CommunityRecommendMusicListModel
+            DIYEmptyView.emptyNoDataTableView(tableView: self?.tableView)
+
+            if communityRecommendMusicListModel?.pagination?.currentPage == 1{
+                self?.communityMusicItemModels.removeAll()
+                self?.tableView.resetNoMoreData()
+            }
+            self?.communityMusicItemModels = (self?.communityMusicItemModels)! + (communityRecommendMusicListModel?.data!)!
+            self?.tableView.reloadData()
+            MJRefreshManager.mjRefreshManagerNoHiddenFooter(tableView: self?.tableView, pagination: communityRecommendMusicListModel?.pagination)
+            self?.tableView.mj_header.isHidden = true
+        }) { [weak self] (loadingStatus) in
+            MJRefreshManager.mjRefreshManagerLoadingStatus(tableView: self?.tableView,loadingStatus: loadingStatus)
+        }
+    }
+
+}
+
+extension PublishNewMusicListView : UITableViewDelegate, UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+        return 1
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return communityMusicItemModels.count
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        let cell = PublishNewMusicListViewTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+        let communityMusicItemModel = communityMusicItemModels[indexPath.row]
+        if publishNewMusicSelectedindexPath == nil {
+            communityMusicItemModel.isSelected = false
+            cell.isSelected = false
+        }else {
+            if publishNewMusicSelectedindexPath?.section == index {
+                if publishNewMusicSelectedindexPath?.row == indexPath.row {
+                    communityMusicItemModel.isSelected = true
+                    cell.isSelected = true
+                }else {
+                    communityMusicItemModel.isSelected = false
+                    cell.isSelected = false
+                }
+            }else {
+                communityMusicItemModel.isSelected = false
+                cell.isSelected = false
+            }
+        }
+        cell.communityMusicItemModel = communityMusicItemModel
+        return cell
+    }
+    
+    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
+        let cell = tableView.cellForRow(at: indexPath) as? PublishNewMusicListViewTableViewCell
+        
+        if publishNewMusicSelectedindexPath?.row != indexPath.row {
+            publishNewMusicSelectedindexPath = IndexPath(row: indexPath.row, section: index ?? 0)
+            var mp3url = kApiDownloadPrefix() + "/music/"
+            mp3url = cell?.communityMusicItemModel?.url?.substring(fromIndex: mp3url.count) ?? ""
+            cell?.communityMusicItemModel?.musicName = mp3url
+            
+            let pathUrl =
+                PathURLManager.projectFilePath(fileName: mp3url, parentURL: PathURLManager.projectDateFormatPath(dateFormat: "yyyyMM", parentURL:
+                    PathURLManager.projectAudiosPath(parentURL:
+                        PathURLManager.projectResourcesPath(parentURL:
+                            PathURLManager.projectDownloadsPath(parentURL:
+                                PathURLManager.projectDocumentPath())))))!
+            
+            if FileManager.default.fileExists(atPath: pathUrl.path) {
+                cell?.isSelected = true
+                publishNewMusicSelectedindexPath?.row = indexPath.row
+                cell?.activityIndicatorView.stopAnimating()
+                cell?.iconImageView.isHidden = false
+                //播放
+                AliPlayerManager.shared.initAudioPlayer(pathUrl: pathUrl.path,startPlayClosure: {
+                    cell?.iconImageView.image = kImage(name: "music_btn_pause")
+                })
+            } else {
+                SwiftMoyaNetWorkServiceDownLoad.shared().musicApi(mp3url: mp3url, progressClosure: {
+                    [weak cell] progress in
+                    cell?.activityIndicatorView.startAnimating()
+                    cell?.iconImageView.isHidden = true
+                    
+                    }, completion: { [weak cell] (_) -> (Void) in
+                        cell?.isSelected = true
+                        cell?.activityIndicatorView.stopAnimating()
+                        cell?.iconImageView.isHidden = false
+                        publishNewMusicSelectedindexPath?.row = indexPath.row
+                        //播放
+                        AliPlayerManager.shared.initAudioPlayer(url: cell?.communityMusicItemModel?.url,startPlayClosure: {
+                            cell?.iconImageView.image = kImage(name: "music_btn_pause")
+                        })
+                        
+                }) { [weak cell] (loadingStatus) in
+                    cell?.isSelected = false
+                    cell?.activityIndicatorView.stopAnimating()
+                    cell?.iconImageView.isHidden = false
+                    publishNewMusicSelectedindexPath = nil
+                }
+            }
+        }else {
+            //暂停播放
+            AliPlayerManager.shared.audioPlayer.pause()
+            cell?.iconImageView.image = kImage(name: "music_btn_play")
+            cell?.isSelected = false
+            publishNewMusicSelectedindexPath = nil
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
+        let cell = tableView.cellForRow(at: indexPath) as? PublishNewMusicListViewTableViewCell
+        cell?.isSelected = false
+        cell?.iconImageView.image = kImage(name: "music_btn_play")
+    }
+    
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 50
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        return 0.000001
+    }
+    
+    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return 0.000001
+    }
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+    
+}
+
+// MARK: - JXContainerListDelegate
+extension PublishNewMusicListView : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return self
+    }
+    
+    func listWillAppear() {
+        self.tableView.reloadData()
+    }
+
+}

+ 149 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicListViewTableViewCell.swift

@@ -0,0 +1,149 @@
+//
+//  PublishNewMusicListViewTableViewCell.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/24.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import RxSwift
+
+class PublishNewMusicListViewTableViewCell: UITableViewCell {
+    
+    let disposeBag = DisposeBag()
+    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> PublishNewMusicListViewTableViewCell {
+        let ID = "PublishNewMusicListViewTableViewCell"
+        tableView.register(PublishNewMusicListViewTableViewCell.self, forCellReuseIdentifier: ID)
+        let cell : PublishNewMusicListViewTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! PublishNewMusicListViewTableViewCell
+        cell.indexPath = indexPath
+        return cell
+    }
+    
+    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
+        super.init(style: style, reuseIdentifier: reuseIdentifier)
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    var indexPath: IndexPath?
+    
+    //MRAK: - 设置View
+    private func setupViews() {
+        self.selectionStyle = .none
+        backgroundColor = UIColor.clear
+        
+        addSubview(iconImageView)
+        addSubview(activityIndicatorView)
+        addSubview(titleLabel)
+        addSubview(playImageView)
+        addSubview(useButton)
+    }
+    
+    private func setupLayouts() {
+        iconImageView.snp.makeConstraints { (make) in
+            make.left.equalTo(14)
+            make.centerY.equalToSuperview()
+            make.size.equalTo(18)
+        }
+        
+        activityIndicatorView.snp.makeConstraints { (make) in
+            make.left.equalTo(14)
+            make.centerY.equalToSuperview()
+            make.size.equalTo(18)
+        }
+        
+        titleLabel.snp.makeConstraints { (make) in
+            make.left.equalTo(iconImageView.snp.right).offset(8)
+            make.centerY.equalToSuperview()
+            make.height.equalTo(20)
+            make.right.equalTo(-14)
+        }
+        
+        useButton.snp.makeConstraints { (make) in
+            make.right.equalTo(-14)
+            make.centerY.equalToSuperview()
+            make.width.equalTo(64)
+            make.height.equalTo(26)
+        }
+        
+        playImageView.snp.makeConstraints { (make) in
+            make.centerX.equalTo(useButton)
+            make.centerY.equalToSuperview()
+        }
+        
+    }
+    
+    func setupData() {
+        useButton.rx.tap.subscribe(onNext: { [weak self] in
+            
+        }).disposed(by: disposeBag)
+    }
+    
+    lazy var iconImageView: UIImageView = {
+        let iconImageView = UIImageView()
+        iconImageView.image = kImage(name: "music_btn_play")
+        return iconImageView
+    }()
+    
+    lazy var activityIndicatorView: UIActivityIndicatorView = {
+        let activityIndicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.white)
+        return activityIndicatorView
+    }()
+    
+    private lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel()
+        titleLabel.textColor = kffffffColor
+        titleLabel.font = kMediumFont14
+        titleLabel.textAlignment = .left
+        return titleLabel
+    }()
+    
+    private lazy var playImageView: UIImageView = {
+        let playImageView = UIImageView()
+        playImageView.image = kImage(name: "music_ico_selected")
+        playImageView.isHidden = true
+        return playImageView
+    }()
+    
+    
+    private lazy var useButton: UIButton = {
+        let useButton = UIButton(type: UIButton.ButtonType.custom)
+        useButton.setTitle("使用", for: UIControl.State.normal)
+        useButton.titleLabel?.font = kRegularFont13
+        useButton.setBackgroundImage(UIImage.imageWithColor(color: kThemeColor), for: UIControl.State.normal)
+        useButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
+        useButton.layer.cornerRadius = 13
+        useButton.layer.masksToBounds = true
+        useButton.isHidden = true
+        return useButton
+    }()
+    
+    override var isSelected: Bool {
+        didSet{
+            communityMusicItemModel?.isSelected = isSelected
+            if isSelected {
+//                iconImageView.image = kImage(name: "music_btn_pause")
+//                playImageView.isHidden = false
+                useButton.isHidden = false
+            }else {
+//                iconImageView.image = kImage(name: "music_btn_play")
+//                playImageView.isHidden = true
+                useButton.isHidden = true
+            }
+        }
+    }
+    
+    var communityMusicItemModel : CommunityMusicItemModel? {
+        didSet {
+            titleLabel.text = communityMusicItemModel?.name
+        }
+    }
+    
+
+}

+ 230 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewMusicView/PublishNewMusicView.swift

@@ -0,0 +1,230 @@
+//
+//  PublishNewMusicView.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/24.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+
+class PublishNewMusicView: BaseView {
+    
+    var index : Int = 0
+    var musicCategoryNames = Array<String>()
+    var musicCategorys : Array<MusicCategoryItemModel> = [] {
+        didSet {
+            guard !(musicCategorys.isEmpty) else { return }
+            for categoryMdl in musicCategorys {
+                musicCategoryNames.append(categoryMdl.name!)
+            }
+        }
+    }
+    
+    override func setupViews() {
+        configRectCorner(corner: [.topLeft,.topRight], radii: CGSize(width: 8, height: 8))
+        clipsToBounds = true
+        addSubview(vibrancyView)
+        addSubview(closeButton)
+        addSubview(noUseMusicButton)
+        addSubview(segmentedView)
+        addSubview(recommendMusicLabel)
+        addSubview(listContainerView)
+
+    }
+    
+    override func setupLayouts() {
+
+        vibrancyView.snp.makeConstraints { (make) in
+            make.bottom.left.right.equalToSuperview()
+            make.height.equalTo(kScreenHeight - kSafeStatusBarHeight)
+        }
+        
+        closeButton.snp.makeConstraints { (make) in
+            make.top.equalTo(9)
+            make.left.equalTo(12)
+            make.size.equalTo(26)
+        }
+        
+        noUseMusicButton.snp.makeConstraints { (make) in
+            make.centerY.equalTo(closeButton)
+            make.right.equalTo(-14)
+        }
+        
+        segmentedView.snp.makeConstraints { (make) in
+            make.left.right.equalToSuperview()
+            make.top.equalTo(48)
+            make.height.equalTo(44)
+        }
+        recommendMusicLabel.snp.makeConstraints { (make) in
+            make.bottom.equalTo(-25)
+            make.height.equalTo(20)
+            make.centerX.equalToSuperview()
+        }
+        
+        listContainerView.snp.makeConstraints { (make) in
+            make.top.equalTo(segmentedView.snp.bottom)
+            make.left.right.equalToSuperview()
+            make.bottom.equalTo(recommendMusicLabel.snp.top).offset(-20)
+        }
+        
+    }
+    
+    override func setupData() {
+        /// 获取音乐分类
+        communityGetMusicCategoryApi()
+        
+        recommendMusicLabel.addClickText("点击推荐", attributeds: [NSAttributedString.Key.font:kMediumFont14!,NSAttributedString.Key.foregroundColor:kffffffColor], transmitBody: nil) {
+            (data) in
+            let vc = PublishRecommendMusicNewController()
+            AliPlayerManager.shared.audioPlayer.pause()
+            vc.backClosure = {
+                AliPlayerManager.shared.audioPlayer.start()
+            }
+            UIViewController.topMost?.navigationController?.pushViewController(vc, animated: true)
+        }
+    }
+    
+    
+    // 毛玻璃效果
+    lazy var vibrancyView: UIVisualEffectView = {
+        let vibrancyView = UIVisualEffectView(frame: self.frame)
+        vibrancyView.effect = UIBlurEffect(style: .dark)
+        return vibrancyView
+    }()
+    
+    /// 关闭按钮
+    lazy var closeButton: UIButton = {
+        let closeButton = UIButton(type: UIButton.ButtonType.custom)
+        closeButton.setImage(kImage(name: "video_btn_close_white"), for: UIControl.State.normal)
+        return closeButton
+    }()
+    
+    //1.初始化JXSegmentedViewx
+    private lazy var segmentedView: JXSegmentedView = {
+        let segmentedView = JXSegmentedView()
+        segmentedView.backgroundColor = .clear
+        segmentedView.delegate = self
+        segmentedView.dataSource = segmentedDataSourceMusic
+        segmentedView.indicators = [indicator]
+        segmentedView.contentEdgeInsetLeft = 14
+        segmentedView.contentEdgeInsetRight = 14
+        segmentedView.listContainer = listContainerView
+        return segmentedView
+    }()
+    
+    //2.初始化dataSource
+    private lazy var segmentedDataSourceMusic: JXSegmentedTitleDataSource = {
+        let segmentedDataSource = JXSegmentedTitleDataSource()
+        segmentedDataSource.isTitleColorGradientEnabled = true
+        segmentedDataSource.isItemSpacingAverageEnabled = false
+        segmentedDataSource.isTitleZoomEnabled = true
+        segmentedDataSource.titleNormalColor = k999999Color
+        segmentedDataSource.titleSelectedColor = kffffffColor
+        segmentedDataSource.titleNormalFont = kRegularFont14!
+        segmentedDataSource.titleSelectedFont = kBoldFont22
+        segmentedDataSource.isTitleStrokeWidthEnabled = true
+        //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
+        segmentedDataSource.itemSpacing = 34
+        return segmentedDataSource
+    }()
+    
+    //3.初始化指示器indicator
+    private lazy var indicator: JXSegmentedIndicatorLineView = {
+        let indicator = JXSegmentedIndicatorLineView()
+        indicator.indicatorColor = .white
+        indicator.indicatorHeight = 3
+        indicator.indicatorWidth = 20
+        return indicator
+    }()
+    
+    //4.初始化JXSegmentedListContainerView
+    private lazy var listContainerView: JXSegmentedListContainerView = {
+        let listContainerView = JXSegmentedListContainerView(dataSource: self)
+        return listContainerView
+    }()
+    
+    /// 不使用音乐
+    lazy var noUseMusicButton: UIButton = {
+        let noUseMusicButton = UIButton(type: UIButton.ButtonType.custom)
+        noUseMusicButton.setTitle("不使用音乐", for: UIControl.State.normal)
+        noUseMusicButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        noUseMusicButton.titleLabel?.font = kRegularFont15
+        return noUseMusicButton
+    }()
+    
+    // 推荐音乐
+    private lazy var recommendMusicLabel: FMLinkLabel = {
+        let recommendMusicLabel = FMLinkLabel()
+        recommendMusicLabel.text = "没有找到想要的音乐?点击推荐"
+        recommendMusicLabel.numberOfLines = 0
+        recommendMusicLabel.textColor = k999999Color
+        recommendMusicLabel.font = kRegularFont14
+        return recommendMusicLabel
+    }()
+    
+    /// 获取音乐分类
+    func communityGetMusicCategoryApi() {
+        SwiftMoyaNetWorkServiceCommunity.shared().communityGetMusicCategoryApi() {
+            [weak self] (musicCategoryListModel) -> (Void) in
+            let musicCategoryListModel = musicCategoryListModel as? CommunityMusicCategoryListModel
+            
+            guard !(musicCategoryListModel?.data?.isEmpty ?? true) else { return }
+            self?.musicCategorys = (musicCategoryListModel?.data)!
+            self?.segmentedDataSourceMusic.titles = (self?.musicCategoryNames)!
+            self?.segmentedView.selectItemAt(index: (self?.index)!)
+            self?.segmentedView.defaultSelectedIndex = (self?.index)!
+            self?.segmentedDataSourceMusic.reloadData(selectedIndex: (self?.index)!)
+            self?.segmentedView.reloadData()
+            self?.listContainerView.defaultSelectedIndex =  (self?.index)!
+            self?.listContainerView.reloadData()
+
+        }
+    }
+
+}
+
+extension PublishNewMusicView : JXSegmentedViewDelegate {
+    
+    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
+    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+        listContainerView.didClickSelectedItem(at: index)
+    }
+    
+    // 点击选中的情况才会调用该方法
+    func segmentedView(_ segmentedView: JXSegmentedView, didClickSelectedItemAt index: Int) {
+        //传递didClickSelectedItemAt事件给listContainerView,必须调用!!!
+    }
+    
+    // 滚动选中的情况才会调用该方法(未支持滚动选中)
+    func segmentedView(_ segmentedView: JXSegmentedView, didScrollSelectedItemAt index: Int) {
+        print("\n------滚动选中\(index)")
+    }
+    
+    // 正在滚动中的回调
+    func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
+        self.segmentedView.backgroundColor = .clear
+        //传递scrolling事件给listContainerView,必须调用!!!
+    }
+    
+    /// 是否允许点击选中目标index的item
+    func segmentedView(_ segmentedView: JXSegmentedView, canClickItemAt index: Int) -> Bool {
+        return true
+    }
+}
+
+extension PublishNewMusicView : JXSegmentedListContainerViewDataSource {
+    func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
+        if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
+            return titleDataSource.dataSource.count
+        }
+        return 0
+    }
+    func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
+        let musicListView = PublishNewMusicListView()
+        musicListView.categoryId = musicCategorys[index].id ?? 0
+        return musicListView
+    }
+}
+

+ 76 - 3
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewRecorderPreview.swift

@@ -8,7 +8,33 @@
 
 import UIKit
 
-class PublishNewRecorderPreview: UIView {
+class PublishNewRecorderPreview: BaseView {
+    
+    override func setupViews() {
+        // 滤镜名字
+        addSubview(filterNameLabel)
+        // 左滑手势
+        addLeftSwipe()
+        // 右滑手势
+        addRightSwipe()
+    }
+    
+    override func setupLayouts() {
+        // 滤镜名字
+        filterNameLabel.snp.makeConstraints { (make) in
+            make.top.equalTo(kNavBarTotalHeight + 20)
+            make.centerX.equalToSuperview()
+        }
+    }
+    
+    /// 滤镜名字
+    lazy var filterNameLabel: UILabel = {
+        let filterNameLabel = UILabel()
+        filterNameLabel.alpha = 0
+        filterNameLabel.font = kMediumFont20
+        filterNameLabel.textColor = kffffffColor
+        return filterNameLabel
+    }()
 
     lazy var tap: UITapGestureRecognizer = {
         let tap = UITapGestureRecognizer(target: self, action: #selector(tapAction))
@@ -16,14 +42,32 @@ class PublishNewRecorderPreview: UIView {
         tap.numberOfTouchesRequired = 1
         return tap
     }()
-     /// 添加手势
+    
+    lazy var leftSwipe: UISwipeGestureRecognizer = {
+        let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(leftSwipeAction))
+        leftSwipe.direction = .left
+        return leftSwipe
+    }()
+    
+    lazy var rightSwipe: UISwipeGestureRecognizer = {
+        let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(rightSwipeAction))
+        rightSwipe.direction = .right
+        return rightSwipe
+    }()
+    
+   
+    /// 添加轻点手势
     func addTap() {
         addGestureRecognizer(tap)
     }
+    
+    
+    
     /// 移除手势
     func removetap() {
         removeGestureRecognizer(tap)
     }
+    
     /// 点击手势
     typealias TapClosure = () -> Void
     var tapClosure : TapClosure?
@@ -32,5 +76,34 @@ class PublishNewRecorderPreview: UIView {
             tapClosure()
         }
     }
-
+    
+    
+    /// 添加左滑手势
+    func addLeftSwipe() {
+        addGestureRecognizer(leftSwipe)
+    }
+    
+    /// 添加有滑动滑手势
+    func addRightSwipe() {
+        addGestureRecognizer(rightSwipe)
+    }
+    
+    /// 左滑手势
+    typealias LeftSwipeClosure = () -> Void
+    var leftSwipeClosure : LeftSwipeClosure?
+    @objc func leftSwipeAction() {
+        if let leftSwipeClosure = leftSwipeClosure {
+            leftSwipeClosure()
+        }
+    }
+    
+    /// 右滑手势
+    typealias RightSwipeClosure = () -> Void
+    var rightSwipeClosure : RightSwipeClosure?
+    @objc func rightSwipeAction() {
+        if let rightSwipeClosure = rightSwipeClosure {
+            rightSwipeClosure()
+        }
+    }
+    
 }

+ 103 - 2
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoSetView.swift

@@ -21,6 +21,10 @@ class PublishNewVideoPhotoSetView: BaseView {
         addSubview(filterButton)
         // 美颜
         addSubview(beautyButton)
+        // 闪光灯
+        addSubview(flashButton)
+        // 音乐
+        addSubview(musicButton)
         // 录制按钮
         addSubview(recordButton)
         // 回删按钮
@@ -31,6 +35,10 @@ class PublishNewVideoPhotoSetView: BaseView {
         addSubview(durationTimeLabel)
         // 录制时间小红点
         addSubview(durationTimeDotLabel)
+        // 左滑手势
+        addLeftSwipe()
+        // 右滑手势
+        addRightSwipe()
     }
     
     override func setupLayouts() {
@@ -74,8 +82,25 @@ class PublishNewVideoPhotoSetView: BaseView {
             make.width.equalTo(30)
         }
         beautyButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 6)
-
         
+        // 闪光灯
+        flashButton.snp.makeConstraints { (make) in
+            make.top.equalTo(beautyButton.snp.bottom).offset(20)
+            make.right.equalTo(-26)
+            make.height.equalTo(50)
+            make.width.equalTo(36)
+        }
+        flashButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 6)
+        
+        // 音乐
+        musicButton.snp.makeConstraints { (make) in
+            make.top.equalTo(beautyButton.snp.bottom).offset(20)
+            make.right.equalTo(-26)
+            make.height.equalTo(50)
+            make.width.equalTo(30)
+        }
+        musicButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.top, imageTitleSpace: 6)
+
         // 回删按钮
         deleteButton.snp.makeConstraints { (make) in
             make.centerY.equalTo(recordButton)
@@ -105,7 +130,6 @@ class PublishNewVideoPhotoSetView: BaseView {
         }
     }
     
-    
     /// 录视频进度条
     lazy var progressView: PublishNewProgressView = {
         let progressView = PublishNewProgressView(frame: CGRect(x: 14, y: kSafeStatusBarHeight+19, width: kScreenWidth-28, height: 5))
@@ -155,6 +179,29 @@ class PublishNewVideoPhotoSetView: BaseView {
         return beautyButton
     }()
     
+    /// 闪光灯
+    lazy var flashButton: UIButton = {
+        let flashButton = UIButton()
+        flashButton.setImage(kImage(name: "video_ico_flashlight_auto"), for: UIControl.State.normal)
+        flashButton.setTitle("闪光灯", for: UIControl.State.normal)
+        flashButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        flashButton.titleLabel?.font = kRegularFont12
+        flashButton.alpha = 0
+        return flashButton
+    }()
+    
+    /// 音乐
+    lazy var musicButton: UIButton = {
+        let musicButton = UIButton()
+        musicButton.setImage(kImage(name: "video_ico_music"), for: UIControl.State.normal)
+        musicButton.setImage(kImage(name: "video_ico_music_pre"), for: UIControl.State.selected)
+        musicButton.setTitle("音乐", for: UIControl.State.normal)
+        musicButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
+        musicButton.titleLabel?.font = kRegularFont12
+        musicButton.alpha = 0
+        return musicButton
+    }()
+    
     /// 拍摄录制按钮
     lazy var recordButton: UIButton = {
         let recordButton = UIButton(type: UIButton.ButtonType.custom)
@@ -203,8 +250,27 @@ class PublishNewVideoPhotoSetView: BaseView {
         return durationTimeDotLabel
     }()
     
+    /// 左滑手势
+    lazy var leftSwipe: UISwipeGestureRecognizer = {
+        let leftSwipe = UISwipeGestureRecognizer(target: self, action: #selector(leftSwipeAction))
+        leftSwipe.direction = .left
+        return leftSwipe
+    }()
+    
+    /// 右滑手势
+    lazy var rightSwipe: UISwipeGestureRecognizer = {
+        let rightSwipe = UISwipeGestureRecognizer(target: self, action: #selector(rightSwipeAction))
+        rightSwipe.direction = .right
+        return rightSwipe
+    }()
+    
     /// 更新录制视频返回按钮的位置
     func closeVideoUpMakeConstraints(duration:TimeInterval) {
+        UIView.animate(withDuration: duration) {
+            [weak self] in
+            self?.flashButton.alpha = 0
+            self?.musicButton.alpha = 1
+        }
         closeButton.snp.updateConstraints { (make) in
             make.top.equalTo(kNavBarTotalHeight)
         }
@@ -216,6 +282,13 @@ class PublishNewVideoPhotoSetView: BaseView {
     
     /// 更新拍照返回按钮的位置
     func closePhotoUpMakeConstraints(duration:TimeInterval) {
+        
+        UIView.animate(withDuration: duration) {
+            [weak self] in
+            self?.flashButton.alpha = 1
+            self?.musicButton.alpha = 0
+        }
+        
         closeButton.snp.updateConstraints { (make) in
             make.top.equalTo(kSafeStatusBarHeight + 11)
         }
@@ -225,5 +298,33 @@ class PublishNewVideoPhotoSetView: BaseView {
         }
     }
     
+    /// 添加左滑手势
+    func addLeftSwipe() {
+        addGestureRecognizer(leftSwipe)
+    }
+    
+    /// 添加有滑动滑手势
+    func addRightSwipe() {
+        addGestureRecognizer(rightSwipe)
+    }
+    
+    /// 左滑手势
+    typealias LeftSwipeClosure = () -> Void
+    var leftSwipeClosure : LeftSwipeClosure?
+    @objc func leftSwipeAction() {
+        if let leftSwipeClosure = leftSwipeClosure {
+            leftSwipeClosure()
+        }
+    }
+    
+    /// 右滑手势
+    typealias RightSwipeClosure = () -> Void
+    var rightSwipeClosure : RightSwipeClosure?
+    @objc func rightSwipeAction() {
+        if let rightSwipeClosure = rightSwipeClosure {
+            rightSwipeClosure()
+        }
+    }
+    
 
 }

+ 226 - 29
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/View/PublishNewView/PublishNewVideoPhotoView.swift

@@ -25,13 +25,16 @@ class PublishNewVideoPhotoView: BaseView {
     /// 录制最小时长
     let minDuration : CGFloat = 3.0
     
+    /// 滤镜选中的selected
+    var selectedIndex : Int = 0
+    
     /// 添加View
     override func setupViews() {
         backgroundColor = UIColor.black
         addSubview(recorderPreview)
         addSubview(publishNewVideoPhotoSetView)
         addSubview(effectFilterBeautyView)
-        
+        addSubview(musicView)
     }
     
     /// 布局
@@ -50,24 +53,38 @@ class PublishNewVideoPhotoView: BaseView {
             let vc = UIViewController.topMost
             vc?.navigationController?.dismiss(animated: true, completion: nil)
         }).disposed(by: disposeBag)
-        
         // 翻转
         publishNewVideoPhotoSetView.cameraFlipButton.rx.tap.subscribe(onNext: {[weak self] (data) in
             self?.setCameraFlip()
         }).disposed(by: disposeBag)
-        
         // 滤镜
         publishNewVideoPhotoSetView.filterButton.rx.tap.subscribe(onNext: {[weak self] (data) in
             self?.effectFilterBeautyView.filterBeautyType = .filter
             self?.effectFilterBeautyViewisHidden(isHidden: false)
         }).disposed(by: disposeBag)
-        
         // 美颜
         publishNewVideoPhotoSetView.beautyButton.rx.tap.subscribe(onNext: {[weak self] (data) in
             self?.effectFilterBeautyView.filterBeautyType = .beauty
             self?.effectFilterBeautyViewisHidden(isHidden: false)
         }).disposed(by: disposeBag)
-        
+        // 音乐
+        publishNewVideoPhotoSetView.musicButton.rx.tap.subscribe(onNext: {[weak self] (data) in
+            self?.musicViewisHidden(isHidden: false)
+        }).disposed(by: disposeBag)
+        // 闪光灯
+        publishNewVideoPhotoSetView.flashButton.rx.tap.subscribe(onNext: {[weak self] (data) in
+            if self?.recorder?.torchMode == .auto {
+                self?.recorder?.switchTorch(with: AliyunIRecorderTorchMode.on)
+                self?.publishNewVideoPhotoSetView.flashButton.setImage(kImage(name: "video_ico_flashlight"), for: UIControl.State.normal)
+            } else if self?.recorder?.torchMode == .on {
+                self?.recorder?.switchTorch(with: AliyunIRecorderTorchMode.off)
+                self?.publishNewVideoPhotoSetView.flashButton.setImage(kImage(name: "video_ico_flashlight_close"), for: UIControl.State.normal)
+            } else if self?.recorder?.torchMode == .off {
+                self?.recorder?.switchTorch(with: AliyunIRecorderTorchMode.auto)
+                self?.publishNewVideoPhotoSetView.flashButton.setImage(kImage(name: "video_ico_flashlight_auto"), for: UIControl.State.normal)
+            }
+
+        }).disposed(by: disposeBag)
         //录制/拍摄
         publishNewVideoPhotoSetView.recordButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             // 开始录制/暂停录制
@@ -88,44 +105,123 @@ class PublishNewVideoPhotoView: BaseView {
                 self?.publishNewVideoPhotoSetView.recordButton.isSelected = false
             }
         }).disposed(by: disposeBag)
-        
         // 回删视频
         publishNewVideoPhotoSetView.deleteButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             /// 回删视频
             self?.deleteVideo()
         }).disposed(by: disposeBag)
-        
         // 完成录制
         publishNewVideoPhotoSetView.finishButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             /// 回删视频
             self?.finishTakeVideo()
         }).disposed(by: disposeBag)
-
-        // 点击手势
-        recorderPreview.tapClosure = {
+        // 左滑 滤镜 加 1
+        publishNewVideoPhotoSetView.leftSwipeClosure = {
+            [weak self] in
+            self?.filterPlus()
+        }
+        // 右滑 滤镜 减 1
+        publishNewVideoPhotoSetView.rightSwipeClosure = {
             [weak self] in
-            // 隐藏滤镜
-            self?.effectFilterBeautyViewisHidden(isHidden: true)
+            self?.filterLess()
         }
+        
+        
         // 美颜等级设置
         effectFilterBeautyView.effectBeautyView.didSelectCloSure = {
             [weak self] beautifyValue in
             self?.recorder?.beautifyValue = beautifyValue
         }
+        // 美颜滤镜设置
+        effectFilterBeautyView.effectFilterView.didSelectCloSure = {
+            [weak self] (index, aliyunEffectFilter) in
+            self?.selectedIndex = index
+            if index == 0 {
+                self?.recorder?.deleteFilter()
+            }else {
+                self?.recorder?.apply(aliyunEffectFilter)
+            }
+            self?.showFilterNameLabel(aliyunEffectFilter: aliyunEffectFilter)
+        }
+        
+        
+        // 关闭音乐按钮
+        musicView.closeButton.rx.tap.subscribe(onNext: { [weak self] (data) in
+            AliPlayerManager.shared.audioPlayer.stop()
+            self?.musicViewisHidden(isHidden: true)
+        }).disposed(by: disposeBag)
+        
+        // 不使用音乐按钮
+        musicView.noUseMusicButton.rx.tap.subscribe(onNext: { [weak self] (data) in
+            self?.recorder?.apply(AliyunEffectMusic())
+            AliPlayerManager.shared.audioPlayer.stop()
+            self?.musicViewisHidden(isHidden: true)
+        }).disposed(by: disposeBag)
+        
+        
+        // 左滑 滤镜 加 1
+        recorderPreview.leftSwipeClosure = {
+            [weak self] in
+            self?.filterPlus()
+        }
+        // 右滑 滤镜 减 1
+        recorderPreview.rightSwipeClosure = {
+            [weak self] in
+            self?.filterLess()
+        }
+        // 点击手势
+        recorderPreview.tapClosure = {
+            [weak self] in
+            if  self?.effectFilterBeautyView.alpha == 1 {
+                // 隐藏滤镜
+                self?.effectFilterBeautyViewisHidden(isHidden: true)
+            }
+            
+            if  self?.musicView.alpha == 1 {
+                // 隐藏音乐
+                self?.musicViewisHidden(isHidden: true)
+            }
+        }
+        
     }
     
     /// SDK录制类
     lazy var recorder: AliyunIRecorder? = {
-        
+//        let recorder : AliyunIRecorder? = AliyunIRecorder()
+//        recorder?.reStartPreview(withVideoSize: CGSize(width: 720, height: 1280))
+//        recorder?.preview = recorderPreview
+//        recorder?.delegate = self
         let recorder = AliyunIRecorder.init(delegate: self, videoSize: CGSize(width: 720, height: 1280))
+        
         // 预览View
         recorder?.preview = recorderPreview
+        //创建文件夹路径
+        let taskPathUrl =
+            PathURLManager.projectDateFormatPath(dateFormat: "yyyyMM", parentURL:
+                PathURLManager.projectVideosPath(parentURL:
+                    PathURLManager.projectResourcesPath(parentURL:
+                        PathURLManager.projectRecordssPath(parentURL:
+                            PathURLManager.projectDocumentPath()))))!
         //清除录制路径
-        PathManager.clearRecrodPath()
+        PathURLManager.clearPath(pathURL: taskPathUrl)
+
         // 设置文件夹路径
-        recorder?.taskPath = PathManager.aliyunVodCreateRecrodPath() ?? ""
+        recorder?.taskPath = taskPathUrl.path
+        
+        // 设置录制视频输出路径
+        let outputPathUrl =
+            PathURLManager.projectPathExtensionMp4(parentURL:
+                PathURLManager.projectFilePath(fileName:
+                    PathURLManager.randomString(), parentURL:
+                        PathURLManager.projectDateFormatPath(dateFormat: "yyyyMM", parentURL:
+                            PathURLManager.projectVideosPath(parentURL:
+                                PathURLManager.projectResourcesPath(parentURL:
+                                    PathURLManager.projectRecordssPath(parentURL:
+                                        PathURLManager.projectDocumentPath()))))))!
         // 设置录制视频输出路径
-        recorder?.outputPath = PathManager.aliyunVodCreateRecrodOutputPath() ?? ""
+        recorder?.outputPath = outputPathUrl.path
+        //循环切换手电筒模式手电筒模式有三种,分别是off,on和auto。切换顺序:off —-> on —-> auto。默认值:off。
+        recorder?.switchTorch(with: AliyunIRecorderTorchMode.off)
         // 美颜状态
         recorder?.beautifyStatus = true;
         // 设置美颜度 [0,100]
@@ -158,7 +254,6 @@ class PublishNewVideoPhotoView: BaseView {
         return recorder!
     }()
     
-    
     /// 摄像头
     lazy var recorderPreview : PublishNewRecorderPreview = {
         let recorderPreview = PublishNewRecorderPreview(frame: bounds)
@@ -169,12 +264,19 @@ class PublishNewVideoPhotoView: BaseView {
         let publishNewVideoPhotoSetView = PublishNewVideoPhotoSetView()
         return publishNewVideoPhotoSetView
     }()
+    
     /// 滤镜跟美颜
     lazy var effectFilterBeautyView: PublishNewEffectFilterBeautyView = {
         let effectFilterBeautyView = PublishNewEffectFilterBeautyView(frame: CGRect(x: 0, y: kScreenHeight, width: kScreenWidth, height: 48 + 125 + kSafeTabBarHeight))
         return effectFilterBeautyView
     }()
     
+    /// 音乐
+    lazy var musicView : PublishNewMusicView = {
+        let musicView = PublishNewMusicView(frame: CGRect(x: 0, y: kScreenHeight, width: kScreenWidth, height: kScreenHeight - kSafeStatusBarHeight))
+        return musicView
+    }()
+    
 }
 
 
@@ -183,6 +285,7 @@ extension PublishNewVideoPhotoView {
     
     /// 开始拍视频
     func startTakeVideo() {
+        
         DispatchQueue.main.async {
             [weak self] in
             self?.recorder?.startRecording()
@@ -210,6 +313,7 @@ extension PublishNewVideoPhotoView {
         publishNewVideoPhotoSetView.cameraFlipButton.isHidden = true
         publishNewVideoPhotoSetView.filterButton.isHidden = true
         publishNewVideoPhotoSetView.beautyButton.isHidden = true
+        publishNewVideoPhotoSetView.musicButton.isHidden = true
 
     }
     
@@ -219,6 +323,7 @@ extension PublishNewVideoPhotoView {
         publishNewVideoPhotoSetView.cameraFlipButton.isHidden = false
         publishNewVideoPhotoSetView.filterButton.isHidden = false
         publishNewVideoPhotoSetView.beautyButton.isHidden = false
+        publishNewVideoPhotoSetView.musicButton.isHidden = false
     }
     
     /// 完成拍视频
@@ -231,16 +336,14 @@ extension PublishNewVideoPhotoView {
     
     /// 拍照
     func takePhoto() {
-        DispatchQueue.main.async {
-            [weak self] in
-            self?.recorder?.takePhoto({ (image, rawImage) in
+        recorder?.takePhoto({(image, rawImage) in
+            DispatchQueue.main.async {
                 // 跳转到使用照片页面
-                let vc = UIViewController.topMost
                 let publishConfirmPhotoNewVC  = PublishConfirmPhotoNewViewController()
                 publishConfirmPhotoNewVC.photoImg = image
-                vc?.navigationController?.pushViewController(publishConfirmPhotoNewVC, animated: true)
-            })
-        }
+                UIViewController.topMost?.navigationController?.pushViewController(publishConfirmPhotoNewVC, animated: true)
+            }
+        })
     }
     /// 回删视频
     func deleteVideo() {
@@ -338,18 +441,26 @@ extension PublishNewVideoPhotoView {
             [weak self] in
             self?.publishNewVideoPhotoSetView.progressView.alpha = alpha
         }
-        // 更新关闭按钮的位置
+        // 更新关闭/闪光灯/音乐按钮的位置
         closeMakeConstraints(duration: duration)
     }
     
-    /// 更新关闭按钮的位置
+    /// 更新关闭/闪光灯/音乐按钮的位置
     ///
     /// - Parameter duration: 0.5s
     func closeMakeConstraints(duration:TimeInterval) {
         if PublishNewViewModel.shared.publishNewRecorderType == .video {
             publishNewVideoPhotoSetView.closeVideoUpMakeConstraints(duration: duration)
+            // 设置闪光灯icon
+            recorder?.switchTorch(with: AliyunIRecorderTorchMode.off)
+            publishNewVideoPhotoSetView.flashButton.setImage(kImage(name: "video_ico_flashlight_close"), for: UIControl.State.normal)
+
         }else  if PublishNewViewModel.shared.publishNewRecorderType == .photo {
             publishNewVideoPhotoSetView.closePhotoUpMakeConstraints(duration: duration)
+            // 设置闪光灯icon
+            recorder?.switchTorch(with: AliyunIRecorderTorchMode.auto)
+            publishNewVideoPhotoSetView.flashButton.setImage(kImage(name: "video_ico_flashlight_auto"), for: UIControl.State.normal)
+
         }
     }
     
@@ -378,14 +489,18 @@ extension PublishNewVideoPhotoView {
     }
     
     
-    /// 滤镜是否显示
+    /// 滤镜美颜是否显示
     ///
     /// - Parameter isHidden: 是否隐藏
     func effectFilterBeautyViewisHidden(isHidden:Bool) {
         var offsetY : CGFloat = kScreenHeight
         if isHidden {
             offsetY = kScreenHeight
-            segmentedViewAlpha(alpha:1)
+            if recorderDuration == 0 {
+                segmentedViewAlpha(alpha:1)
+            }else {
+                segmentedViewAlpha(alpha:0)
+            }
             // 移除点击手势
             recorderPreview.removetap()
         }else {
@@ -407,6 +522,87 @@ extension PublishNewVideoPhotoView {
             }
         }
     }
+    
+    //滤镜 减 1
+    func filterLess() {
+        if selectedIndex > 0 {
+            selectedIndex = selectedIndex - 1
+        }else {
+            selectedIndex = (aliyunFiltersModel?.filters?.count ?? 1) - 1
+        }
+        //选中滤镜
+        didSelectFilter()
+    }
+    
+    //滤镜 加 1
+    func filterPlus() {
+        if selectedIndex < ((aliyunFiltersModel?.filters?.count ?? 0) - 1) {
+            selectedIndex = selectedIndex + 1
+        }else {
+            selectedIndex = 0
+        }
+        //选中滤镜
+        didSelectFilter()
+    }
+    
+    /// 选中滤镜
+    func didSelectFilter() {
+        let indexPath = IndexPath(row: self.selectedIndex , section: 0)
+        effectFilterBeautyView.effectFilterView.collectionView(effectFilterBeautyView.effectFilterView.collectionView, didSelectItemAt: indexPath)
+        effectFilterBeautyView.effectFilterView.collectionView.selectItem(at: indexPath, animated: true, scrollPosition: UICollectionView.ScrollPosition.centeredHorizontally)
+    }
+    /// 滤镜名字显示
+    ///
+    /// - Parameter aliyunEffectFilter: 滤镜模型
+    func showFilterNameLabel(aliyunEffectFilter:AliyunEffectFilter) {
+        
+        recorderPreview.filterNameLabel.alpha = 1
+        recorderPreview.filterNameLabel.text = aliyunEffectFilter.name
+        UIView.animate(withDuration: 2, animations: {
+            [weak self] in
+            self?.recorderPreview.filterNameLabel.alpha = 1
+            }, completion: {
+                [weak self] (finished) in
+                UIView.animate(withDuration: 2, animations: {
+                    [weak self] in
+                    self?.recorderPreview.filterNameLabel.alpha = 0
+                })
+        })
+    }
+    
+    /// 音乐是否显示
+    ///
+    /// - Parameter isHidden: 是否隐藏
+    func musicViewisHidden(isHidden:Bool) {
+        var offsetY : CGFloat = kScreenHeight
+        if isHidden {
+            offsetY = kScreenHeight
+            if recorderDuration == 0 {
+                segmentedViewAlpha(alpha:1)
+            }else {
+                segmentedViewAlpha(alpha:0)
+            }
+            // 移除点击手势
+            recorderPreview.removetap()
+        }else {
+            offsetY = kSafeStatusBarHeight
+            segmentedViewAlpha(alpha:0)
+            // 添加点击手势
+            recorderPreview.addTap()
+        }
+        UIView.animate(withDuration: 0.5) {
+            [weak self] in
+            self?.musicView.frame = CGRect(x: 0, y: offsetY, width: kScreenWidth, height: kScreenHeight -
+                kSafeStatusBarHeight)
+            if isHidden {
+                self?.musicView.alpha = 0
+                self?.publishNewVideoPhotoSetView.alpha = 1
+            }else {
+                self?.musicView.alpha = 1
+                self?.publishNewVideoPhotoSetView.alpha = 0
+            }
+        }
+    }
 }
 
 // MARK: - 代理
@@ -555,6 +751,7 @@ extension PublishNewVideoPhotoView : AliyunIRecorderDelegate {
      @param error 异常
      */
     func recoderError(_ error: Error!) {
-        
+        NXLLog(error)
+        SwiftProgressHUD.shared().showText("录制异常")
     }
 }

+ 53 - 44
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewController/PublishNewViewController.swift

@@ -30,6 +30,7 @@ class PublishNewViewController: BaseViewController {
     
     /// viewModel
     var publishNewViewModel: PublishNewViewModel?
+    var index : Int = 0
 
 
     override func viewDidLoad() {
@@ -67,6 +68,7 @@ class PublishNewViewController: BaseViewController {
         publishNewViewModel?.scrollView = scrollView
         publishNewViewModel?.publishNewAuthorizationView = publishNewAuthorizationView
         publishNewViewModel?.segmentedView = segmentedView
+
         
         /// 授权
         if NXLPermission.isDenied(.photoLibrary) ||
@@ -75,6 +77,13 @@ class PublishNewViewController: BaseViewController {
         {
             PublishNewViewModel.shared.scrollView?.isHidden = true
             PublishNewViewModel.shared.publishNewAuthorizationView?.isHidden = false
+        }else {
+            //开启预览
+            if index == 0 {
+                setRecorder(index: index, isStartPreview: false)
+            }else {
+                setRecorder(index: index, isStartPreview: true)
+            }
         }
         
         
@@ -103,7 +112,6 @@ class PublishNewViewController: BaseViewController {
     private lazy var publishNewVideoPhotoView: PublishNewVideoPhotoView = {
         let publishNewVideoPhotoView = PublishNewVideoPhotoView(frame: CGRect(x: kScreenWidth, y: 0, width: kScreenWidth, height: kScreenHeight))
         publishNewVideoPhotoView.backgroundColor = UIColor.black
-
         return publishNewVideoPhotoView
     }()
     
@@ -114,8 +122,8 @@ class PublishNewViewController: BaseViewController {
         segmentedView.delegate = self
         segmentedView.dataSource = segmentedDataSourceAlbum
         segmentedView.indicators = [indicator]
-        segmentedView.selectItemAt(index: 0)
-        segmentedView.defaultSelectedIndex = 0
+        segmentedView.selectItemAt(index: index)
+        segmentedView.defaultSelectedIndex = index
         return segmentedView
     }()
     
@@ -132,7 +140,7 @@ class PublishNewViewController: BaseViewController {
         segmentedDataSource.titleSelectedFont = kBoldFont22
         segmentedDataSource.isTitleStrokeWidthEnabled = true
         //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
-        segmentedDataSource.reloadData(selectedIndex: 0)
+        segmentedDataSource.reloadData(selectedIndex: index)
         return segmentedDataSource
     }()
     
@@ -162,62 +170,63 @@ class PublishNewViewController: BaseViewController {
         return indicator
     }()
     
-}
-
-// MARK: - JXSegmentedViewDelegate
-extension PublishNewViewController : JXSegmentedViewDelegate {
-    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
-    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
-        switch index {
-        case 0:
-            scrollView.setContentOffset(CGPoint(x: 0, y:0), animated: true)
-            segmentedDataSourceAlbum.reloadData(selectedIndex: 0)
-            segmentedView.dataSource = segmentedDataSourceAlbum
-            DispatchQueue.main.async {
-                [weak self] in
-                if self?.statusBarStyle != .default {
-                    self?.statusBarStyle = .default
-                }
-            }
-            //停止预览摄像头
-            publishNewVideoPhotoView.recorder?.stopPreview()
-            PublishNewViewModel.shared.publishNewRecorderType = .none
-        case 1:
+    
+    /// 选择中segmentedview
+    ///
+    /// - Parameters:
+    ///   - isStartPreview: 是否开启预览
+    ///   - publishNewRecorderType: 类型
+    func setRecorder(index:Int,isStartPreview:Bool) {
+        PublishNewViewModel.shared.publishNewRecorderType = PublishNewViewModel.PublishNewRecorderType(rawValue: index)!
+        if isStartPreview {
             scrollView.setContentOffset(CGPoint(x: kScreenWidth, y:0), animated: true)
-            segmentedDataSourceVideoPhoto.reloadData(selectedIndex: 1)
+            segmentedDataSourceVideoPhoto.reloadData(selectedIndex: index)
             segmentedView.dataSource = segmentedDataSourceVideoPhoto
-
             DispatchQueue.main.async {
                 [weak self] in
                 if self?.statusBarStyle != .lightContent {
                     self?.statusBarStyle = .lightContent
                 }
             }
-            // 录制视频
-            PublishNewViewModel.shared.publishNewRecorderType = .video
+            if PublishNewViewModel.shared.publishNewRecorderType == .photo {
+                publishNewVideoPhotoView.setProgressViewAlpha(alpha: 0,duration: 0.5)
+
+            }
+            if PublishNewViewModel.shared.publishNewRecorderType == .video {
+                // 是否显示进度条
+                publishNewVideoPhotoView.setProgressViewAlpha(alpha: 1,duration: 0.5)
+            }
             // 开始预览摄像头
             publishNewVideoPhotoView.recorder?.startPreview()
-            // 是否显示进度条
-            publishNewVideoPhotoView.setProgressViewAlpha(alpha: 1,duration: 0.5)
 
-        case 2:
-            scrollView.setContentOffset(CGPoint(x: kScreenWidth, y:0), animated: true)
-            segmentedDataSourceVideoPhoto.reloadData(selectedIndex: 2)
-            segmentedView.dataSource = segmentedDataSourceVideoPhoto
+        }else {
+            scrollView.setContentOffset(CGPoint(x: 0, y:0), animated: true)
+            segmentedDataSourceAlbum.reloadData(selectedIndex: index)
+            self.segmentedView.dataSource = segmentedDataSourceAlbum
             DispatchQueue.main.async {
                 [weak self] in
-                if self?.statusBarStyle != .lightContent {
-                    self?.statusBarStyle = .lightContent
+                if self?.statusBarStyle != .default {
+                    self?.statusBarStyle = .default
                 }
             }
-            // 拍照
-            PublishNewViewModel.shared.publishNewRecorderType = .photo
-            // 开始预览摄像头
-            publishNewVideoPhotoView.recorder?.startPreview()
-            // 是否显示进度条
-            publishNewVideoPhotoView.setProgressViewAlpha(alpha: 0,duration: 0.5)
-
+            //停止预览摄像头
+            publishNewVideoPhotoView.recorder?.stopPreview()
+        }
+    }
+    
+}
 
+// MARK: - JXSegmentedViewDelegate
+extension PublishNewViewController : JXSegmentedViewDelegate {
+    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
+    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
+        switch index {
+        case 0:
+            setRecorder(index: index, isStartPreview: false)
+        case 1:
+            setRecorder(index: index, isStartPreview: true)
+        case 2:
+            setRecorder(index: index, isStartPreview: true)
         default:
             break
         }

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishNew/ViewModel/PublishNewViewModel.swift

@@ -23,10 +23,10 @@ class PublishNewViewModel: NSObject {
     /// - none: 没有
     /// - video: 视频
     /// - photo: 拍照
-    enum PublishNewRecorderType {
-        case none
-        case video
-        case photo
+    enum PublishNewRecorderType : Int {
+        case none = 0
+        case video = 1
+        case photo = 2
     }
 
     /// 底层View

+ 177 - 0
RainbowPlanet/RainbowPlanet/Modules/PublishNewModule/PublishRecommendMusicNewController/ViewController/PublishRecommendMusicNewController.swift

@@ -0,0 +1,177 @@
+//
+//  PublishRecommendMusicNewController.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/7/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  推荐音乐
+
+import UIKit
+import IQKeyboardManagerSwift
+import SwiftyMediator
+
+class PublishRecommendMusicNewController: BaseViewController {
+    
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+    }
+    
+    typealias BackClosure = (() ->Void)?
+    var backClosure :BackClosure?
+    
+    override func viewDidLoad() {
+        
+        super.viewDidLoad()
+        setupViews()
+        setupLayouts()
+        setupData()
+    }
+    
+    override func setupViews() {
+        statusBarStyle = .lightContent
+        navigationBar.barBackgroundColor = UIColor.black
+        navigationBar.title = "推荐音乐"
+        navigationBar.titleLabelColor = kffffffColor
+        navigationBar.wr_setLeftButton(image: kImage(name: "navbar_back_white")!)
+        navigationBar.wr_setRightButton(title: "提交", titleColor: kffffffColor)
+        navigationBar.rightButton.titleLabel!.font = kRegularFont14
+        view.backgroundColor = UIColor.black
+        view.addSubview(cardBackView)
+        cardBackView.addSubview(sepLineView)
+        cardBackView.addSubview(nameTextView)
+        cardBackView.addSubview(linkTextView)
+        view.addSubview(recommendLabel)
+    }
+    
+    override func setupLayouts() {
+        cardBackView.snp.makeConstraints { (make) in
+            make.top.equalTo(kSafeStatusBarHeight + 44 + 20)
+            make.left.equalTo(14)
+            make.right.equalTo(-14)
+            make.height.equalTo(160)
+        }
+        sepLineView.snp.makeConstraints { (make) in
+            make.top.equalTo(80)
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+            make.height.equalTo(0.5)
+        }
+        nameTextView.snp.makeConstraints { (make) in
+            make.top.equalTo(20)
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+            make.height.equalTo(40)
+        }
+        linkTextView.snp.makeConstraints { (make) in
+            make.bottom.equalTo(-20)
+            make.left.equalTo(15)
+            make.right.equalTo(-15)
+            make.height.equalTo(40)
+        }
+        
+        recommendLabel.snp.makeConstraints { (make) in
+            make.centerX.equalToSuperview()
+            make.bottom.equalTo(-25)
+            make.height.equalTo(20)
+        }
+    }
+    
+    override func setupData() {
+        
+        navigationBar.onClickRightButton = {
+            [weak self] in
+            let name = self?.nameTextView.text
+            let url  = self?.linkTextView.text
+            
+            if name == nil || name == "" {
+                SwiftProgressHUD.shared().showText("请填写歌曲名称")
+                return
+            }
+            
+            self?.communityUploadMusicApi(name!, url ?? "")
+        }
+        nameTextView.rx.text.orEmpty.changed.subscribe(onNext: {
+            [weak self] (text) in
+            TextLimitTool.restrictionInputTextView((self?.nameTextView)!, maxNumber: 150)
+        }).disposed(by: disposeBag)
+        
+        linkTextView.rx.text.orEmpty.changed.subscribe(onNext: {
+            [weak self] (text) in
+            TextLimitTool.restrictionInputTextView((self?.linkTextView)!, maxNumber: 150)
+        }).disposed(by: disposeBag)
+        
+        recommendLabel.addClickText("内容授权协议", attributeds: [NSAttributedString.Key.foregroundColor:kffffffColor], transmitBody: nil) {
+            (data) in
+            Mediator.push(H5RouterModuleType.pushContentId7)
+        }
+    }
+    
+    lazy var cardBackView: UIView = {
+        let cardBackView = UIView()
+        cardBackView.backgroundColor = kffffffColor
+        cardBackView.cornerRadius = 8
+        cardBackView.masksToBounds = true
+        return cardBackView
+    }()
+    
+    lazy var sepLineView: UIView = {
+        let sepLineView = UIView()
+        sepLineView.backgroundColor = k999999Color
+        return sepLineView
+    }()
+    
+    private lazy var nameTextView: IQTextView = {
+        let nameTextView = IQTextView()
+        nameTextView.backgroundColor = kffffffColor
+        nameTextView.textColor = UIColor.black
+        nameTextView.font = kRegularFont16
+        nameTextView.placeholder = "输入歌曲名称"
+        nameTextView.placeholderTextColor = k999999Color
+        return nameTextView
+    }()
+    
+    private lazy var linkTextView: IQTextView = {
+        let linkTextView = IQTextView()
+        linkTextView.backgroundColor = kffffffColor
+        linkTextView.textColor = UIColor.black
+        linkTextView.font = kRegularFont16
+        linkTextView.placeholder = "输入歌曲链接(选填)"
+        linkTextView.placeholderTextColor = k999999Color
+        return linkTextView
+    }()
+    
+    lazy var recommendLabel: FMLinkLabel = {
+        let recommendLabel = FMLinkLabel()
+        recommendLabel.text = "点击提交代表您同意 内容授权协议"
+        recommendLabel.textColor = k999999Color
+        recommendLabel.font = kRegularFont12
+        return recommendLabel
+    }()
+    
+    override func didMove(toParent parent: UIViewController?) {
+        if !(parent != nil) {
+            if let backClosure = self.backClosure {
+                backClosure!()
+            }
+        }
+    }
+    
+}
+
+extension PublishRecommendMusicNewController {
+    /// 用户上传音乐
+    func communityUploadMusicApi(_ name: String, _ url: String) {
+        let userName = UserModel.shared().getModel()?.username ?? ""
+        let uid = UserModel.shared().getModel()?.uid ?? 0
+        
+        SwiftMoyaNetWorkServiceCommunity.shared().communityUploadMusicApi(name: name.trimmingCharacters(in: .whitespaces), username: userName, url: url, uid: uid) {[weak self] (data) -> (Void) in
+            // 上传成功,返回
+            SwiftProgressHUD.shared().showText("提交成功")
+            if let backClosure = self?.backClosure {
+                backClosure!()
+            }
+            self?.navigationController?.popViewController(animated: true)
+        }
+        
+    }
+}

+ 7 - 6
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaNetWorkServiceCommunity.swift

@@ -266,7 +266,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         }) {
             (loadingStatus) in
         }
-
+        
     }
     
     // MARK: - 热门推荐音乐列表
@@ -311,7 +311,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
     ///   - category_id: 分类ID
     ///   - page: 分页
     ///   - completion: 回调
-    func communityCateMusicListApi(categoryID:Int = 0, page:Int = 1, completion: @escaping successCallBack) {
+    func communityCateMusicListApi(categoryID:Int = 0, page:Int = 1, completion: @escaping successCallBack,fail: @escaping failCallback) {
         var parameters = Dictionary<String,Any>()
         parameters.updateValue(categoryID, forKey: "category_id")
         parameters.updateValue(page, forKey: "page")
@@ -321,6 +321,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
             completion(communityMusicListModel)
         }) {
             (loadingStatus) in
+            fail(loadingStatus)
         }
     }
     
@@ -492,7 +493,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
             (loadingStatus) in
             fail(loadingStatus)
         }
-
+        
     }
     
     
@@ -576,7 +577,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
                 completion("")
             }) {
                 (loadingStatus) in
-               
+                
             }
         })
     }
@@ -594,7 +595,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         SwiftMoyaNetWorkManager.shared.requestObject(CommunityCircleModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityCircle(parameters: parameters)), completion: { (communityCircleModel) in
             completion(communityCircleModel)
         }) { (loadingStatus) in
-             fail(loadingStatus)
+            fail(loadingStatus)
         }
     }
     
@@ -785,7 +786,7 @@ public class SwiftMoyaNetWorkServiceCommunity: NSObject {
         if replyUsername != "" {
             parameters.updateValue(replyUsername, forKey: "reply_username")
         }
-    
+        
         SwiftMoyaNetWorkManager.shared.requestObject(CommunityCircleCommentModel.self, target: MultiTarget(SwiftMoyaServiceCommunityApi.communityCircleCommentPost(parameters: parameters)), completion: {  (communityCircleCommentModel) in
             completion(communityCircleCommentModel)
         }) {

+ 2 - 2
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceCommunity/SwiftMoyaServiceCommunityApi.swift

@@ -257,7 +257,7 @@ public enum SwiftMoyaServiceCommunityApi {
     case communityCirclePictures(parameters:Dictionary<String, Any>)
     case communityCirclePicturePost(parameters:Dictionary<String, Any>)
     case communityCirclePictureDelete(parameters:Dictionary<String, Any>)
-
+    
 }
 
 extension SwiftMoyaServiceCommunityApi: TargetType {
@@ -458,7 +458,7 @@ extension SwiftMoyaServiceCommunityApi: TargetType {
              .communityCirclePictureDelete
             :
             return .delete
-
+            
         }
     }
     

+ 42 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceDownLoad/SwiftMoyaNetWorkServiceDownLoad.swift

@@ -0,0 +1,42 @@
+//
+//  SwiftMoyaNetWorkServiceDownLoad.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/25.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+
+
+import Moya
+import SwiftyJSON
+import ObjectMapper
+
+public class SwiftMoyaNetWorkServiceDownLoad: NSObject {
+    private static let _sharedInstance = SwiftMoyaNetWorkServiceDownLoad()
+    
+    private override init() {} // 私有化init方法
+    
+    class func shared() -> SwiftMoyaNetWorkServiceDownLoad {
+        return _sharedInstance
+    }
+    
+    /// 下载mp3
+    ///
+    /// - Parameters:
+    ///   - mp3url: mp3url
+    ///   - completion: 完成
+    ///   - fail: 失败
+    func musicApi(mp3url:String,progressClosure:@escaping loadProgressClosure,completion: @escaping successCallBack,fail: @escaping failCallback) {
+        SwiftMoyaNetWorkManager.shared.requestDownloadObject(target: MultiTarget(SwiftMoyaServiceDownLoadApi.music(mp3url: mp3url)), progressClosure: {
+            progress in
+            progressClosure(progress)
+        }, completion: { (_) in
+            completion(nil)
+        }) { (loadingStatus) in
+            fail(loadingStatus)
+        }
+    }
+    
+}

+ 90 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceDownLoad/SwiftMoyaServiceDownLoadApi.swift

@@ -0,0 +1,90 @@
+//
+//  SwiftMoyaServiceDownLoadApi.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/10/25.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+import Moya
+
+// MARK: - 下载音乐
+/// 下载音乐
+public let kMusicApi = "/music/"
+
+/// 下载
+///
+/// - music: 下载音乐
+public enum SwiftMoyaServiceDownLoadApi {
+    case music(mp3url:String)
+}
+
+extension SwiftMoyaServiceDownLoadApi: TargetType {
+    
+    public var baseURL: URL {
+        switch self {
+        case .music
+            :
+            return URL(string: kApiDownloadPrefix())!
+        }
+    }
+    
+    public var path: String {
+        switch self {
+        case .music(let mp3url):
+            return kMusicApi + mp3url
+        }
+    }
+    
+    public var method: Moya.Method {
+        switch self {
+        case .music
+            :
+            return .get
+        }
+    }
+    
+    // MARK: - 请求任务事件(这里附带上参数)
+    public var task: Task {
+        switch self {
+        case .music(_)
+            :
+            return .downloadDestination(DefaultDownloadDestination)
+        }
+    }
+    
+    
+    // MARK: - 是否执行Alamofire验证
+    public var validate: Bool {
+        return false
+    }
+    
+    // MARK: - 这个就是做单元测试模拟的数据,只会在单元测试文件中有作用
+    public var sampleData: Data {
+        return "{}".data(using: String.Encoding.utf8)!
+    }
+    
+    // MARK: - 请求头
+    public var headers: [String : String]? {
+        return (headerParameters(headerType: .defaultHeader) as! [String : String])
+    }
+}
+
+//定义下载的DownloadDestination(不改变文件名,遇到同名文件会覆盖)
+private let DefaultDownloadDestination: DownloadDestination = { temporaryURL, response in
+    
+    return (DefaultDownloadDir.appendingPathComponent(response.suggestedFilename!),
+            [.removePreviousFile])
+}
+
+
+////默认下载保存地址(用户文档目录)
+let DefaultDownloadDir: URL = {
+    return
+        PathURLManager.projectDateFormatPath(dateFormat: "yyyyMM", parentURL: PathURLManager.projectAudiosPath(parentURL:
+                PathURLManager.projectResourcesPath(parentURL:
+                    PathURLManager.projectDownloadsPath(parentURL:
+                        PathURLManager.projectDocumentPath()))))!
+}()
+

+ 24 - 20
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/ApiMacro.swift

@@ -1,23 +1,13 @@
-//
-//  ApiMacro.swift
-//  CreaditPayment
-//
-//  Created by 南鑫林 on 2018/7/28.
-//  Copyright © 2018年 南鑫林. All rights reserved.
-//
-
-import Foundation
-
 /// Service
 let kPersonalService = false
-let kDevelopSever = false
-let kBetaSever = true
+let kDevelopSever = true
+let kBetaSever = false
 let kProductSever = false
 
 /// H5Service
 let kH5PersonalService = false
-let kH5DevelopSever = false
-let kH5BetaSever = true
+let kH5DevelopSever = true
+let kH5BetaSever = false
 let kH5ProductSever = false
 
 // MARK: - 数据服务器
@@ -41,13 +31,13 @@ public func kApiVirusPrefix() -> String {
         return ""
     }else if kDevelopSever /** 接口前缀-开发服务器*/ {
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.dev.caihongxingqiu.com/virus") + "/v2")
-//        return "https://api.dev.caihongxingqiu.com/virus/v2"
+        //        return "https://api.dev.caihongxingqiu.com/virus/v2"
     } else if kBetaSever /** 接口前缀-测试服务器*/{
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.dev.caihongxingqiu.com/beta/virus") + "/v2")
-//        return "https://api.dev.caihongxingqiu.com/beta/virus/v2"
+        //        return "https://api.dev.caihongxingqiu.com/beta/virus/v2"
     }else if kProductSever /** 接口前缀-生产服务器*/ {
         return ((ConfigModel.shared.object()?.virusUrl ?? "https://api.virus.caihongxingqiu.net") + "/v2")
-//        return "https://api.virus.caihongxingqiu.net"
+        //        return "https://api.virus.caihongxingqiu.net"
     }else {
         return ""
     }
@@ -69,6 +59,21 @@ public func kApiH5Prefix() -> String {
     }
 }
 
+// MARK: - download
+public func kApiDownloadPrefix() -> String {
+    if kPersonalService /** 接口前缀-个人服务器*/ {
+        return "http://oss.caihongxingqiu.net"
+    }else if kDevelopSever /** 接口前缀-开发服务器*/ {
+        return "http://oss.caihongxingqiu.net"
+    } else if kBetaSever /** 接口前缀-测试服务器*/{
+        return "http://oss.caihongxingqiu.net"
+    }else if kProductSever /** 接口前缀-生产服务器*/ {
+        return "http://oss.caihongxingqiu.net"
+    }else {
+        return ""
+    }
+}
+
 
 /// 头部类型
 ///
@@ -85,7 +90,7 @@ public enum HeaderType {
 
 public func headerParameters(headerType:HeaderType = .defaultHeader) -> Dictionary<String,Any> {
     var parameters = Dictionary<String,Any>()
-
+    
     switch headerType {
     case .defaultHeader:
         parameters.updateValue("application/x-www-form-urlencoded", forKey: "Content-Type")
@@ -106,7 +111,7 @@ public func headerParameters(headerType:HeaderType = .defaultHeader) -> Dictiona
         parameters.updateValue(token, forKey: "Authorization")
         break
     }
-
+    
     return parameters
 }
 
@@ -114,7 +119,6 @@ public func appInfoHeader(parameters:Dictionary<String,Any>) -> Dictionary<Strin
     var parameters = parameters
     parameters.updateValue(AppInfo.vendor, forKey: "vendor")
     parameters.updateValue(AppInfo.clientName.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlFragmentAllowed) as Any, forKey: "clientName")
-
     parameters.updateValue(AppInfo.clientVersion, forKey: "clientVersion")
     parameters.updateValue(AppInfo.osName, forKey: "osName")
     parameters.updateValue(AppInfo.osVersion, forKey: "osVersion")

+ 41 - 12
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

@@ -30,6 +30,8 @@ enum SwiftMoyaNetWorkManagerLoadingStatus {
 typealias successCallBack = (Any?) -> (Void)
 /// 失败回调
 typealias failCallback = (_ loadingStatus:SwiftMoyaNetWorkManagerLoadingStatus) -> Void
+/// 进度
+typealias loadProgressClosure = (ProgressResponse) -> Void
 
 
 public class SwiftMoyaNetWorkManager: NSObject {
@@ -48,9 +50,10 @@ public class SwiftMoyaNetWorkManager: NSObject {
     typealias successCallObjectBack = (_ T: BaseMappable) -> Void
     /// 成功回调带泛型 对象数组
     typealias successCallArrayObjectback = (_ T: [BaseMappable]) -> Void
+    
     /// 失败回调
     var failCallback : failCallback?
-
+    
 }
 
 extension SwiftMoyaNetWorkManager {
@@ -96,7 +99,7 @@ extension SwiftMoyaNetWorkManager {
     func failCallShowText(fail:@escaping failCallback) {
         DispatchQueue.main.async {
             [weak self] in
-//            SwiftProgressHUD.shared().showText("网络链接失败,请检查网络")
+            //            SwiftProgressHUD.shared().showText("网络链接失败,请检查网络")
             self?.failNoNetwork(fail:fail)
         }
     }
@@ -142,7 +145,7 @@ extension SwiftMoyaNetWorkManager {
             .disposed(by: disposeBag)
     }
     
-
+    
     // MARK: 泛型网络请求返回任意值
     /// 泛型网络请求返回任意值
     /// 网络请求
@@ -158,7 +161,7 @@ extension SwiftMoyaNetWorkManager {
             .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated))
             .observeOn(MainScheduler.instance)
             .subscribe(onSuccess: { [weak self] element in
-
+                
                 guard let element = element else {
                     self?.failNoData(fail: fail)
                     return
@@ -197,7 +200,7 @@ extension SwiftMoyaNetWorkManager {
             }
             .disposed(by: disposeBag)
     }
-
+    
     // MARK: 泛型网络请求返回对象
     /// 泛型网络请求返回对象
     /// 网络请求
@@ -214,7 +217,7 @@ extension SwiftMoyaNetWorkManager {
             .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated))
             .observeOn(MainScheduler.instance)
             .subscribe(onSuccess: { [weak self] element in
-
+                
                 guard let element = element else {
                     self?.failNoData(fail: fail)
                     return
@@ -252,6 +255,32 @@ extension SwiftMoyaNetWorkManager {
             }
             .disposed(by: disposeBag)
     }
+    
+    // MARK: 下载对象
+    /// 下载对象
+    ///
+    /// - Parameters:
+    ///   - target: 请求地址加参数
+    ///   - completion: 完成
+    ///   - fail: 失败
+    func requestDownloadObject(target: MultiTarget,progressClosure:@escaping loadProgressClosure,completion: @escaping successCallAnyBack,fail:@escaping failCallback) {
+        networkConnect(fail: fail)
+        provider
+            .rx
+            .requestWithProgress(target)
+            .subscribeOn(ConcurrentDispatchQueueScheduler(qos: .userInitiated))
+            .subscribeOn(MainScheduler.instance)
+            .subscribe(onNext: { (progress) in
+                NXLLog("当前进度: \(progress.progress)")
+                progressClosure(progress)
+            }, onError: { [weak self] (error) in
+                NXLLog(error)
+                self?.failCallShowText(fail: fail)
+                }, onCompleted: {
+                    NXLLog("下载完毕")
+                    completion("")
+            }).disposed(by: disposeBag)
+    }
 }
 
 // MARK: - 泛型
@@ -329,7 +358,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
                 let json = try JSON(response.mapJSON())
                 if response.statusCode == 200 {
                     self.log(response: response, json: json)
-
+                    
                     let rootModel = RootModel(JSONString: json.description)
                     let data = JSON(json["data"]).description
                     rootModel?.data = data
@@ -362,7 +391,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
     
     // MARK: 泛型返回对象
     func mapObject<T: BaseMappable>(_ type: T.Type) -> Single<T?> {
-
+        
         return flatMap { response -> Single<T?> in
             do {
                 let json = try JSON(response.mapJSON())
@@ -372,7 +401,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
                     let data = JSON(json["data"]).description
                     rootModel?.data = data
                     if rootModel!.code  == 0 {
-
+                        
                         let mapper = T(JSONString:  rootModel!.data ?? "")
                         return Single<T?>.just(mapper)
                     }else if rootModel!.code  == 1 {
@@ -390,7 +419,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
                     self.logError(response: response)
                     return Single<T?>.just(nil)
                 }
-
+                
             } catch {
                 self.logError(response: response)
                 return Single<T?>.just(nil)
@@ -409,7 +438,7 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
                     let data = JSON(json["data"]).description
                     rootModel?.data = data
                     if rootModel!.code  == 0 {
-
+                        
                         let mapper = Mapper<T>().mapArray(JSONString: rootModel!.data!)
                         return Single<[T]?>.just(mapper)
                     }else if rootModel!.code  == 1 {
@@ -442,7 +471,7 @@ extension PrimitiveSequence {
     func showFailInfo(rootModel:RootModel) {
         SwiftProgressHUD.shared().hide()
         SwiftProgressHUD.shared().showText(rootModel.msg ?? "信息有误!!!")
-       
+        
     }
     
     func log(response:Response,json:JSON) {

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/color.png


File diff suppressed because it is too large
+ 71 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/优雅/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/光圈/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/光圈/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/color.png


File diff suppressed because it is too large
+ 73 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/思念/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/color.png


File diff suppressed because it is too large
+ 71 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/朝阳/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "柔柔", 
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/柔柔/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/模糊/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/模糊/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/波普/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/波普/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "车恩尚", 
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/浓烈/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/color.png


File diff suppressed because it is too large
+ 72 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海盐/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "海蓝", 
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/海蓝/icon.png


+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/灰白/config.json

@@ -0,0 +1,69 @@
+{
+    "musicName": null,
+    "name": "灰白",
+    "animations": [
+                   {
+                   "frames": [
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 0,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              },
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 449,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              }
+                              ],
+                   "name": "main"
+                   }
+                   ], 
+    "music": "music.mp3", 
+    "effects": [
+                {
+                "src": "", 
+                "range": "", 
+                "video": "main", 
+                "eid": 1
+                }, 
+                {
+                "filterName": "BlackWhite",
+                "range": "", 
+                "eid": 2, 
+                "src": "1"
+                }
+                ], 
+    "filters": [
+                {
+                "images": [
+                ], 
+                "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float v = (value.r+value.g+value.b)/3.0;gl_FragColor = vec4(v,v,v,1.0);\n} ", 
+                "name": "BlackWhite"
+                }
+                ], 
+    "time": [
+             0
+             ], 
+    "icon": "icon.png",
+    "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/灰白/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "炽黄",
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/炽黄/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/焦黄/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/焦黄/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "粉桃", 
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/粉桃/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/素描/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/素描/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/color.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/color2.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "红润", 
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/红润/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color2.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color3.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/color4.png


File diff suppressed because it is too large
+ 74 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/经典/icon.png


+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/胶片/config.json

@@ -0,0 +1,69 @@
+{
+    "musicName": null,
+    "name": "胶片",
+    "animations": [
+                   {
+                   "frames": [
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 0,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              },
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 449,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              }
+                              ],
+                   "name": "main"
+                   }
+                   ], 
+    "music": "music.mp3", 
+    "effects": [
+                {
+                "src": "", 
+                "range": "", 
+                "video": "main", 
+                "eid": 1
+                }, 
+                {
+                "filterName": "Mosaic",
+                "range": "", 
+                "eid": 2, 
+                "src": "1"
+                }
+                ], 
+    "filters": [
+                {
+                "images": [
+                ], 
+                "fragment": "varying highp vec2 textureCoordinate;\n \n uniform sampler2D inputImageTexture;\n \n void main()\n {\n    lowp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);\n    \n    gl_FragColor = vec4((1.0 - textureColor.rgb), textureColor.w);\n }",
+                "name": "BlackWhite"
+                }
+                ], 
+    "time": [
+             0
+             ], 
+    "icon": "icon.png",
+    "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/胶片/icon.png


+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/蓝调/config.json

@@ -0,0 +1,69 @@
+{
+    "musicName": null,
+    "name": "蓝调",
+    "animations": [
+                   {
+                   "frames": [
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 0,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              },
+                              {
+                              "a": 0.0,
+                              "fx": 0.0,
+                              "fw": 480.0,
+                              "track": "a",
+                              "h": 1.0,
+                              "fh": 480.0,
+                              "cy": 240.0,
+                              "cx": 240.0,
+                              "t": 449,
+                              "w": 1.0,
+                              "fy": 0.0,
+                              "y": 240.0,
+                              "x": 240.0
+                              }
+                              ],
+                   "name": "main"
+                   }
+                   ], 
+    "music": "music.mp3", 
+    "effects": [
+                {
+                "src": "", 
+                "range": "", 
+                "video": "main", 
+                "eid": 1
+                }, 
+                {
+                "filterName": "Mosaic",
+                "range": "", 
+                "eid": 2, 
+                "src": "1"
+                }
+                ], 
+    "filters": [
+                {
+                "images": [
+                ], 
+                "fragment": "varying highp vec2 textureCoordinate;\n \n uniform sampler2D inputImageTexture;\n \n \n void main()\n {\n     highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate);\n     \n     gl_FragColor = vec4(textureColor.r , textureColor.g * 0.9, textureColor.b , textureColor.a);\n }",
+                "name": "BlackWhite"
+                }
+                ], 
+    "time": [
+             0
+             ], 
+    "icon": "icon.png",
+    "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/蓝调/icon.png


File diff suppressed because it is too large
+ 69 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/迷糊/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/迷糊/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "闪耀",
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/闪耀/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/color.png


+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/config.json

@@ -0,0 +1,70 @@
+{
+  "musicName": null, 
+  "name": "阳光",
+  "animations": [
+    {
+      "frames": [
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 0, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }, 
+        {
+          "a": 0.0, 
+          "fx": 0.0, 
+          "fw": 480.0, 
+          "track": "a", 
+          "h": 1.0, 
+          "fh": 480.0, 
+          "cy": 240.0, 
+          "cx": 240.0, 
+          "t": 449, 
+          "w": 1.0, 
+          "fy": 0.0, 
+          "y": 240.0, 
+          "x": 240.0
+        }
+      ], 
+      "name": "main"
+    }
+  ], 
+  "music": "music.mp3", 
+  "effects": [
+    {
+      "src": "", 
+      "range": "", 
+      "video": "main", 
+      "eid": 1
+    }, 
+    {
+      "filterName": "LookColor", 
+      "range": "", 
+      "eid": 2, 
+      "src": "1"
+    }
+  ], 
+  "filters": [
+    {
+      "images": [
+        "color.png"
+      ], 
+      "fragment": " \nprecision highp float;\nvarying highp vec2 textureCoordinate; \nuniform sampler2D inputImageTexture;\nuniform sampler2D inputImageTexture2;\nvoid main()\n{\n vec4 value = texture2D(inputImageTexture, textureCoordinate);\n float r = texture2D(inputImageTexture2, vec2(value.r, 0.5)).r;\n float g = texture2D(inputImageTexture2, vec2(value.g, 0.5)).g;\n float b = texture2D(inputImageTexture2, vec2(value.b, 0.5)).b;\n gl_FragColor = vec4(r,g,b,1.0);\n} ", 
+      "name": "LookColor"
+    }
+  ], 
+  "time": [
+    0
+  ], 
+  "icon": "icon.png",
+  "musicIcon": "icon_music.png"
+}

BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/阳光/icon.png


File diff suppressed because it is too large
+ 70 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/config.json


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/icon.png


BIN
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/雪梨/s3.png


+ 0 - 0
RainbowPlanet/RainbowPlanet/Src/AliyunResource/Filter/FilterResource/马赛克/config.json


Some files were not shown because too many files changed in this diff