Browse Source

Merge branch 'dev' of https://git.yishihui.com/iOS/BFRecordScreenKit into dev
合并代码

jsonwang 3 years ago
parent
commit
518f1f7427

+ 11 - 12
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -174,6 +174,7 @@ public class BFRecordScreenController: BFBaseViewController {
             if currMediaType == .Video {
                 (cell as? BFVideoCoverViewCell)?.rotationView()
             }
+            searchStopAtRecordRange()
         }
     }
     
@@ -224,7 +225,7 @@ public class BFRecordScreenController: BFBaseViewController {
             soundSettingBtn.isHidden = isNormalPlaying
             voiceSettingBtn.isHidden = isNormalPlaying
             withDrawBtn.isHidden = isNormalPlaying
-            recordBtn.isHidden = isNormalPlaying
+            updateRecordBtnStatus(isNormalPlaying)
             cameraFlipBtn.isHidden = !(!isNormalPlaying && (currMediaType == .Camera) && !isDragingProgressSlder)
         }
     }
@@ -422,7 +423,7 @@ public class BFRecordScreenController: BFBaseViewController {
         let btn = UIButton(type: .custom)
         btn.setImage(imageInRecordScreenKit(by: "subtitleBtn_on"), for: .normal)
         btn.setTitle("function_subtitle".BFLocale, for: .normal)
-        btn.titleLabel?.font = UIFont.systemFont(ofSize: 10)
+        btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
         btn.addTarget(self, action: #selector(subTitleClick), for: .touchUpInside)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
@@ -434,7 +435,7 @@ public class BFRecordScreenController: BFBaseViewController {
         let btn = UIButton(type: .custom)
         btn.setImage(imageInRecordScreenKit(by: "soundBtn"), for: .normal)
         btn.setTitle("function_voice".BFLocale, for: .normal)
-        btn.titleLabel?.font = UIFont.systemFont(ofSize: 10)
+        btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
         btn.addTarget(self, action: #selector(soundSetting), for: .touchUpInside)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
@@ -446,7 +447,7 @@ public class BFRecordScreenController: BFBaseViewController {
         let btn = UIButton(type: .custom)
         btn.setImage(imageInRecordScreenKit(by: "TTS"), for: .normal)
         btn.setTitle("变声", for: .normal)
-        btn.titleLabel?.font = UIFont.systemFont(ofSize: 10)
+        btn.titleLabel?.font = UIFont.systemFont(ofSize: 12)
         btn.addTarget(self, action: #selector(voiceSetting), for: .touchUpInside)
         btn.imageEdgeInsets = UIEdgeInsets(top: -20, left: 4, bottom: 0, right: -4)
         btn.titleEdgeInsets = UIEdgeInsets(top: 20, left: -40, bottom: -20, right: 0)
@@ -644,6 +645,8 @@ public class BFRecordScreenController: BFBaseViewController {
         navigationController?.isNavigationBarHidden = true
         hiddenNavigation()
         UIApplication.shared.isIdleTimerDisabled = true
+        
+        searchStopAtRecordRange()
     }
     
     public override func viewDidAppear(_ animated: Bool) {
@@ -652,6 +655,7 @@ public class BFRecordScreenController: BFBaseViewController {
         // 设置默认值
         setSubtitleStyle(settingModel: subtitleSettingView.subtitle.setting)
     }
+    
 
     override public func viewWillDisappear(_ animated: Bool) {
         super.viewWillDisappear(animated)
@@ -1701,7 +1705,7 @@ public class BFRecordScreenController: BFBaseViewController {
 
                 wself.changeProgress(changCMTime: wself.convertProgressToCMTime(process))
                 
-                if wself.currMediaType != .Video && CMTimeCompare(wself.rscurrentManager.recordItem?.materialDuraion ?? .zero, .zero) != 0 {
+                if wself.currMediaType != .Video && CMTimeCompare(wself.rscurrentManager.recordItem?.materialDuraion ?? .zero, .zero) != 0 && process < 1 {
                     wself.recordBtn.isHidden = true
                     wself.deleteRecordBtn.isHidden = false
                 }
@@ -2183,23 +2187,18 @@ public class BFRecordScreenController: BFBaseViewController {
         
         rscurrentManager.play()
         
-        deleteRecordBtn.isHidden = true
-
         subtitleBtn.isHidden = true
         voiceSettingBtn.isHidden = true
         soundSettingBtn.isHidden = true
         withDrawBtn.isHidden = true
         recordBtn.isHidden = true
+        deleteRecordBtn.isHidden = true
         
     }
 
     public func pause() {
 //        BFLog(1, message: "暂停播放")
         isNormalPlaying = false
-
-        subtitleBtn.isHidden = false
-        soundSettingBtn.isHidden = false
-        withDrawBtn.isHidden = false
         
         assetPlayer.pause()
         recordPlayer.pause()
@@ -2747,6 +2746,7 @@ public extension BFRecordScreenController {
                     wself.resetCurrentProgress()
                     // 录制播放结束后显示录制按钮
                     wself.recordBtn.isHidden = false
+                    wself.deleteRecordBtn.isHidden = true
                 } else {
                     // 注:矫正进度--一段录音播放结束后当前指针应该到当前录音结束点
                     let next = wself.itemModels[wself.currItemModelIndex ].voiceStickers[(recordInfo?.0 ?? 0) + 1].startCMTime
@@ -2757,7 +2757,6 @@ public extension BFRecordScreenController {
                 }
             }
         }) { [weak self] _, _ in
-            
             guard let wself = self else { return }
             
             if wself.currMediaType == .Image {