瀏覽代碼

Merge branch 'master' of https://git.yishihui.com/iOS/BFRecordScreenKit

wenweiwei 3 年之前
父節點
當前提交
4cb4702f25
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11 7
      BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

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

@@ -931,6 +931,8 @@ public class BFRecordScreenController: BFBaseViewController {
             BFLog(message: "录音机初始化错误!!!")
             return
         }
+        
+        view.isUserInteractionEnabled = false
 
         let model = PQVoiceModel()
         // 开始时间
@@ -969,7 +971,8 @@ public class BFRecordScreenController: BFBaseViewController {
         isRecording = false
         progressThumV.progressView.isUserInteractionEnabled = true
         collectionView.isScrollEnabled = true
-
+        
+        view.isUserInteractionEnabled = true
         recorderManager?.stopRecord(isCancel: false)
 //        changeWithDrawBtnLayout(2)
         /*
@@ -1162,7 +1165,7 @@ public class BFRecordScreenController: BFBaseViewController {
 
         // TODO: 滑动,播放暂停,撤销时,判断是否停止录音区间,是则删除相关录音,画笔,头像,字幕
         let elems = itemModels[currItemModelIndex].voiceStickers.enumerated().filter { elem in
-            (elem.1.startTime + 0.001) <= self.currentAssetProgress.seconds && (elem.1.endTime - 0.001) > self.currentAssetProgress.seconds
+            (elem.1.startTime) <= self.currentAssetProgress.seconds && (elem.1.endTime) > self.currentAssetProgress.seconds
         }
 
         isEndPlay = false
@@ -1782,12 +1785,13 @@ extension BFRecordScreenController: UICollectionViewDelegate, UICollectionViewDa
             if isRecording {
                 endRecord()
             }
-            events.append(WithDrawModel(type: 0, timestamp: currentAssetProgress.seconds))
-            // 重设撤销栈
-            itemModels[currItemModelIndex].events = events
-            currItemModelIndex = page
+//            events.append(WithDrawModel(type: 0, timestamp: currentAssetProgress.seconds))
+//            // 重设撤销栈
+//            itemModels[currItemModelIndex].events = events
+//            events = itemModels[page].events
+            events = [WithDrawModel]()
 
-            events = itemModels[currItemModelIndex].events
+            currItemModelIndex = page
 
             let recordItem = itemModels[currItemModelIndex]
             // 暂停状态--如果是图片素材同时没有录音文件时不显示播放按钮