Browse Source

修改录音播放器

harry 3 years ago
parent
commit
56c50ca85c

+ 10 - 6
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenCameraManager.swift

@@ -682,9 +682,9 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
 
 
             let currTime = startProgress + CMTime(seconds: Date().timeIntervalSince(startPlayTime), preferredTimescale: 1000)
             let currTime = startProgress + CMTime(seconds: Date().timeIntervalSince(startPlayTime), preferredTimescale: 1000)
 
 
-            if isPlay {
+            if isPlay { // 点击播放
                 wself.timerForPlay(currTime: currTime)
                 wself.timerForPlay(currTime: currTime)
-            } else {
+            } else { // 点击拍摄
                 wself.timerForRecord(currTime: currTime)
                 wself.timerForRecord(currTime: currTime)
             }
             }
 
 
@@ -694,20 +694,24 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
     }
     }
 
 
     func timerForPlay(currTime: CMTime) {
     func timerForPlay(currTime: CMTime) {
-        dele?.progreddL.text = String(format: "%@", max(0, min(currTime.seconds, (recordItem?.materialDuraion.seconds ?? 0))).formatDurationToHMS())
-        currentAssetProgress = min(currTime, (recordItem?.materialDuraion ?? .zero))
+        currentAssetProgress = max(.zero, min(currTime, (recordItem?.materialDuraion ?? .zero)))
+        dele?.progreddL.text = String(format: "%@", currentAssetProgress.seconds.formatDurationToHMS())
         dele?.progressThumV.progress = currentAssetProgress
         dele?.progressThumV.progress = currentAssetProgress
         dele?.updateSubtitle(time: currentAssetProgress)
         dele?.updateSubtitle(time: currentAssetProgress)
-        progreddL?.text = CMTimeGetSeconds(currentAssetProgress).formatDurationToHMS()
 
 
+        BFLog(1, message: "curr: \(currentAssetProgress.seconds)")
+        
         if currTime.seconds >= (recordItem?.materialDuraion.seconds ?? 0) {
         if currTime.seconds >= (recordItem?.materialDuraion.seconds ?? 0) {
             dele?.pause()
             dele?.pause()
             isPlaying = false
             isPlaying = false
             return
             return
         }
         }
 
 
-        checkCurrentPlayStatus()
+        // 检测录音的
+//        checkCurrentPlayStatus()
+        // 检测视频的
         prepareToPlayNext()
         prepareToPlayNext()
+        // 新的检测录音的
         playRecordVoice()
         playRecordVoice()
     }
     }