Przeglądaj źródła

修改信息; 合成时隐藏之前显示的帧

harry 3 lat temu
rodzic
commit
426a345470
1 zmienionych plików z 9 dodań i 3 usunięć
  1. 9 3
      Introduce/Record/INVideoExportController.swift

+ 9 - 3
Introduce/Record/INVideoExportController.swift

@@ -124,6 +124,8 @@ class INVideoExportController: BFBaseViewController {
         subTitleL.font = UIFont.systemFont(ofSize: 24)
         subTitleL.textColor = UIColor.hexColor(hexadecimal: "#A6A6A6")
         subTitleL.textAlignment = .center
+        subTitleL.contentCompressionResistancePriority(for: NSLayoutConstraint.Axis.horizontal)
+        subTitleL.numberOfLines = 0
         backV.addSubview(subTitleL)
         
         let retryBtn = UIButton()
@@ -142,7 +144,6 @@ class INVideoExportController: BFBaseViewController {
         }
         subTitleL.snp.makeConstraints { make in
             make.left.right.equalToSuperview()
-            make.height.equalTo(40)
             make.bottom.equalTo(retryBtn.snp.top).offset(-30)
         }
         titleL.snp.makeConstraints { make in
@@ -217,6 +218,7 @@ class INVideoExportController: BFBaseViewController {
                     let item = AVPlayerItem(url: fileUrl)
                     sself.avplayer.replaceCurrentItem(with: item)
                     sself.avplayer.play()
+                    sself.playerLayer.borderColor = ThemeStyleColor.cgColor
 
                     if sself.saveAllBtn.isSelected {
                         sself.saveAllUlr = fileUrl
@@ -235,12 +237,13 @@ class INVideoExportController: BFBaseViewController {
                         case ExportError.FileNotExist.rawValue :
                             l.text = "原视频/图片文件被删除"
                         case ExportError.DiskNoSpace.rawValue :
-                            l.text = "手机存储空间不足"
+                            l.text = "存储空间不足:" + (err.userInfo["msg"] as! String)
                         case ExportError.VoiceLost.rawValue :
                             l.text = "手机录音文件丢失"
                         default:
                             l.text = "请重新尝试"
                         }
+                        l.sizeToFit()
                     }
                     sself.errorView.isHidden = false
                 }
@@ -366,7 +369,7 @@ class INVideoExportController: BFBaseViewController {
 
         playerLayer = AVPlayerLayer(player: avplayer)
         playerLayer.borderWidth = 1
-        playerLayer.borderColor = ThemeStyleColor.cgColor
+        playerLayer.borderColor = UIColor.hexColor(hexadecimal: "#1A1A1A").cgColor
         backV.layer.addSublayer(playerLayer)
 
         backV.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(playAction)))
@@ -469,6 +472,7 @@ class INVideoExportController: BFBaseViewController {
 
     // MARK: - 按钮事件
     @objc func retryAction(){
+        errorView.isHidden = true
         exportNow()
     }
     
@@ -478,6 +482,8 @@ class INVideoExportController: BFBaseViewController {
             return
         }
         isExporting = true
+        playerLayer.borderColor = UIColor.hexColor(hexadecimal: "#1A1A1A").cgColor
+        avplayer.replaceCurrentItem(with: nil)
 //        bottomView.isHidden = true
         
         if saveAllBtn.isSelected {