Parcourir la source

Merge branch 'develop' of http://svn.ouj.com:3000/duowan_iOS/SuperShow into develop

zhongbaojian il y a 5 ans
Parent
commit
5e49cd2f44
21 fichiers modifiés avec 47 ajouts et 61 suppressions
  1. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same.imageset/炫同款@2x.png
  2. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same.imageset/炫同款@3x.png
  3. 0 22
      SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/Contents.json
  4. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/home_ic_take_same_DownLoading@2x.png
  5. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/home_ic_take_same_DownLoading@3x.png
  6. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same_background.imageset/加载时按钮@2x.png
  7. BIN
      SuperShow/Assets.xcassets/Home/home_ic_take_same_background.imageset/加载时按钮@3x.png
  8. BIN
      SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@2x.png
  9. BIN
      SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@3x.png
  10. 2 2
      SuperShow/Assets.xcassets/Home/use_template.imageset/Contents.json
  11. BIN
      SuperShow/Assets.xcassets/Home/use_template.imageset/use_template@2x.png
  12. BIN
      SuperShow/Assets.xcassets/Home/use_template.imageset/use_template@3x.png
  13. 2 2
      SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/Contents.json
  14. BIN
      SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/use_temple_bg@2x.png
  15. BIN
      SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/use_temple_bg@3x.png
  16. 5 1
      SuperShow/UI/CoolVoice/WSSCoolVoiceCutVideoViewController.swift
  17. 4 4
      SuperShow/UI/CoolVoice/WSSCoolVoiceSubtitleController.swift
  18. 14 10
      SuperShow/UI/Recommend/Views/WSSRecommendUseProgressView.swift
  19. 0 5
      SuperShow/UI/Template/Views/WSSTemplateCollectionCell.swift
  20. 14 14
      SuperShow/UI/Template/WSSCreativeTemplateEditViewController.swift
  21. 6 1
      SuperShow/UI/Template/WSSMultiVideoEditViewController.swift

BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same.imageset/炫同款@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same.imageset/炫同款@3x.png


+ 0 - 22
SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/Contents.json

@@ -1,22 +0,0 @@
-{
-  "images" : [
-    {
-      "idiom" : "universal",
-      "scale" : "1x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "home_ic_take_same_DownLoading@2x.png",
-      "scale" : "2x"
-    },
-    {
-      "idiom" : "universal",
-      "filename" : "home_ic_take_same_DownLoading@3x.png",
-      "scale" : "3x"
-    }
-  ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
-  }
-}

BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/home_ic_take_same_DownLoading@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same_DownLoading.imageset/home_ic_take_same_DownLoading@3x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same_background.imageset/加载时按钮@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_ic_take_same_background.imageset/加载时按钮@3x.png


BIN
SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@2x.png


BIN
SuperShow/Assets.xcassets/Home/home_template_cover_placeholder.imageset/home_template_cover_placeholder@3x.png


+ 2 - 2
SuperShow/Assets.xcassets/Home/home_ic_take_same.imageset/Contents.json → SuperShow/Assets.xcassets/Home/use_template.imageset/Contents.json

@@ -6,12 +6,12 @@
     },
     {
       "idiom" : "universal",
-      "filename" : "炫同款@2x.png",
+      "filename" : "use_template@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "炫同款@3x.png",
+      "filename" : "use_template@3x.png",
       "scale" : "3x"
     }
   ],

BIN
SuperShow/Assets.xcassets/Home/use_template.imageset/use_template@2x.png


BIN
SuperShow/Assets.xcassets/Home/use_template.imageset/use_template@3x.png


+ 2 - 2
SuperShow/Assets.xcassets/Home/home_ic_take_same_background.imageset/Contents.json → SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/Contents.json

@@ -6,12 +6,12 @@
     },
     {
       "idiom" : "universal",
-      "filename" : "加载时按钮@2x.png",
+      "filename" : "use_temple_bg@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "加载时按钮@3x.png",
+      "filename" : "use_temple_bg@3x.png",
       "scale" : "3x"
     }
   ],

BIN
SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/use_temple_bg@2x.png


BIN
SuperShow/Assets.xcassets/Home/use_temple_bg.imageset/use_temple_bg@3x.png


+ 5 - 1
SuperShow/UI/CoolVoice/WSSCoolVoiceCutVideoViewController.swift

@@ -22,8 +22,12 @@ class WSSCoolVoiceCutVideoViewController: WSSCutVideoViewController {
     override func setupSubViews() {
         super.setupSubViews()
 
+        var cutSeconds: Double = Double(cutMaxDuration)
+        let cutAssetDurationSeconds = AVAsset(url: videoFileUrl).duration.seconds
+        cutSeconds = Double.minimum(cutSeconds, cutAssetDurationSeconds)
+
         thumbnailView.hintLabel.text = String(format: "不可大于背景视频时长%.1fs", cutMaxDuration)
-        thumbnailView.tipLabel.text = String(format: "已选取 %.1fs", cutMaxDuration)
+        thumbnailView.tipLabel.text = String(format: "已选取 %.1fs", cutSeconds)
 
         var rate = cutMaxDuration / videoDuration
         if rate > 1.0 {

+ 4 - 4
SuperShow/UI/CoolVoice/WSSCoolVoiceSubtitleController.swift

@@ -982,7 +982,7 @@ fileprivate extension WSSCoolVoiceSubtitleController {
         if progress >= 1.0 {
             stopExportDisplayLink()
         }
-        showProgressCancelHub(progress: progress * 0.5, status: "合成...")
+        showProgressCancelHub(progress: progress * 0.5, status: "正在合成...")
     }
 
     func setupMixAudioExportDisplayLink() {
@@ -1006,7 +1006,7 @@ fileprivate extension WSSCoolVoiceSubtitleController {
 
     @objc func updateMixAudioProgress() {
         guard let progress = mixAudioExportSeesion?.progress else { return }
-        showProgressCancelHub(progress: 0.9 + progress * 0.1, status: "合成...")
+        showProgressCancelHub(progress: 0.9 + progress * 0.1, status: "正在合成...")
         if progress >= 1.0 {
             stopMixAuiodExportDisplayLink()
         }
@@ -1079,7 +1079,7 @@ fileprivate extension WSSCoolVoiceSubtitleController {
             })
         }
         effectExport?.perFrameProcessingCallback = { progress in
-            showProgressCancelHub(progress: 0.5 + (0.4 * progress), status: "合成...")
+            showProgressCancelHub(progress: 0.5 + (0.4 * progress), status: "正在合成...")
         }
         effectExport?.outputFilter.addTarget(movieWriter!)
         movieWriter?.startRecording()
@@ -1123,7 +1123,7 @@ fileprivate extension WSSCoolVoiceSubtitleController {
     }
 
     func createTextPasterInput() {
-        let rect = AVMakeRect(aspectRatio: videoSize, insideRect: view.bounds)
+        let rect = AVMakeRect(aspectRatio: videoSize, insideRect: pasterOverlayView.bounds)
         let placeholer: UIView = UIView(frame: rect)
 
         /// 初始化文字Text

+ 14 - 10
SuperShow/UI/Recommend/Views/WSSRecommendUseProgressView.swift

@@ -23,17 +23,21 @@ class WSSRecommendUseProgressView: UIView {
     var progress: CGFloat = 0.0
 
     /// UI
-
     fileprivate var bgImageView: UIImageView = {
         let imageView = UIImageView()
-        imageView.image = R.image.home_ic_take_same_background()
+        imageView.image = R.image.use_temple_bg()
         return imageView
     }()
 
-    fileprivate var coverImageView: UIImageView = {
-        let imageView = UIImageView()
-        imageView.image = R.image.home_ic_take_same()
-        return imageView
+    fileprivate var coverButton: UIButton = {
+        let button = UIButton(type: .custom)
+        button.setImage(R.image.use_template(), for: .normal)
+        button.setBackgroundImage(R.image.use_temple_bg(), for: .normal)
+        button.setTitle("使用模板", for: .normal)
+        button.titleLabel?.font = OJAFont.font15
+        button.isUserInteractionEnabled = false
+        button.setImagePosition(.left, spacing: 16)
+        return button
     }()
 
     fileprivate var progressLabel: UILabel = {
@@ -80,11 +84,11 @@ class WSSRecommendUseProgressView: UIView {
 extension WSSRecommendUseProgressView {
     func cancel() {
         progressView.progress = 1.0
-        coverImageView.isHidden = false
+        coverButton.isHidden = false
     }
 
     func updateProgress(withPercentag percentage: CGFloat, animated: Bool) {
-        coverImageView.isHidden = true
+        coverButton.isHidden = true
         progressView.progress = Double(percentage)
         progressLabel.text = String(format: "%.0f%%", percentage * 100.0)
         progressLabel.sizeToFit()
@@ -117,8 +121,8 @@ fileprivate extension WSSRecommendUseProgressView {
             make.size.equalTo(self.kProgressSize)
         }
 
-        addSubview(coverImageView)
-        coverImageView.snp.makeConstraints { make in
+        addSubview(coverButton)
+        coverButton.snp.makeConstraints { make in
             make.edges.equalToSuperview()
         }
     }

+ 0 - 5
SuperShow/UI/Template/Views/WSSTemplateCollectionCell.swift

@@ -16,11 +16,6 @@ class WSSTemplateCollectionCell: WSSBaseCollectionCell {
         didSet {
             if let m = model {
                 coverImageView.backgroundColor = OJSColor(hexRGBValue: 0x4B4B55)
-                if m.cover == nil {
-                    coverImageView.contentMode = .scaleAspectFit
-                } else {
-                    coverImageView.contentMode = .scaleAspectFill
-                }
                 coverImageView.ojs_setImage(withUrl: m.cover, placeholder: R.image.home_template_cover_placeholder())
                 nameLabel.text = m.name
 

+ 14 - 14
SuperShow/UI/Template/WSSCreativeTemplateEditViewController.swift

@@ -39,7 +39,6 @@ class WSSCreativeTemplateEditViewController: WSSMultiVideoEditViewController {
             if let cropTool = self?.cropVideoTool {
                 cropTool.stopExport()
                 self?.cropVideoTool = nil
-                self?.cropVideoTask.signal()
             }
 
             if let templateDecoder = self?.templateDecoder {
@@ -303,12 +302,13 @@ fileprivate extension WSSCreativeTemplateEditViewController {
             DispatchQueue.main.async {
                 if let currentCount = self?.cropVideoSuccessCount,
                     let totalCount = self?.creativeVideoInfoArray.count {
-                    guard progress != 1 else { return }
+                    guard let userCancel = self?.isUserCancel,
+                        progress != 1,
+                        !userCancel else { return }
                     let currentProgress = Float(currentCount) / Float(totalCount)
                     let singleProgress = 1.0 / Float(totalCount)
                     var vailProgress = 0.5 * (currentProgress + singleProgress * progress)
                     vailProgress = Float.minimum(0.5, vailProgress)
-                    print("====>progress \(vailProgress)")
                     showProgressCancelHub(progress: vailProgress, status: "正在合成...")
                 }
             }
@@ -319,20 +319,20 @@ fileprivate extension WSSCreativeTemplateEditViewController {
                                   outputFileType: AVFileType.mp4.rawValue,
                                   clipRange: cropTimeRange,
                                   completionBlock: { [weak self] success, _ in
-                                      if success {
-                                          WSSLog("🍿: 裁剪成功- \(exportURL)")
-                                          model.cropVideoPath = cropVideoOutputPath
-                                          model.mediaModel?.editVideoURL = exportURL // 合成视频的时候,从这个字段读取视频
-                                          model.mediaModel?.sourceType = .video
-
-                                      } else {
-                                          showHud(withOnlyText: "截取视频失败")
-                                          self?.isCropVideoFail = true
-                                      }
                                       DispatchQueue.main.async {
+                                          if success {
+                                              WSSLog("🍿: 裁剪成功- \(exportURL)")
+                                              model.cropVideoPath = cropVideoOutputPath
+                                              model.mediaModel?.editVideoURL = exportURL // 合成视频的时候,从这个字段读取视频
+                                              model.mediaModel?.sourceType = .video
+
+                                          } else {
+                                              showHud(withOnlyText: "截取视频失败")
+                                              self?.isCropVideoFail = true
+                                          }
                                           self?.cropVideoSuccessCount += 1
+                                          self?.cropVideoTask.signal()
                                       }
-                                      self?.cropVideoTask.signal()
 
         })
         self.cropVideoTool = cropVideoTool

+ 6 - 1
SuperShow/UI/Template/WSSMultiVideoEditViewController.swift

@@ -467,7 +467,12 @@ class WSSMultiVideoEditViewController: MTViewController {
         if itemModel.isOriginImageType {
             itemModel.videoSpeed = 1.0
         }
-        itemView.sliderView.hideVideoSpeedView(hidden: itemModel.isOriginImageType)
+
+        itemView.sliderView.hideVideoSpeedView(hidden: true)
+        /// fix: 目前没有统一都有变速功能,所以这里判断卡点Cell才会显示变速图标
+        if itemView.isKind(of: WSSTemplateSpotEditItemCell.self) {
+            itemView.sliderView.hideVideoSpeedView(hidden: itemModel.isOriginImageType)
+        }
 
         /// 更新SliderView.MaskView宽度
         if let videoDuration = itemModel.vaildVideoAsset?.duration.seconds {