|
@@ -463,7 +463,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
// case paused = 0
|
|
|
// case waitingToPlayAtSpecifiedRate = 1
|
|
|
// case playing = 2
|
|
|
- if (BFAudioPlayer.shared.player?.isPlaying ?? false){
|
|
|
+ if (BFAudioPlayer.shared.player?.isPlaying ?? false || audioPlayerIsPlaying){
|
|
|
BFLog(2, message: "is playering 本次查找无效,有播放任务")
|
|
|
return
|
|
|
}
|
|
@@ -486,13 +486,14 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
// 当前播放的文件
|
|
|
|
|
|
let cureentPalyURlString = BFAudioPlayer.shared.currentAudioPathURL?.absoluteString ?? ""
|
|
|
- if cureentPalyURlString.replacingOccurrences(of: "file://", with: "") == mod.wavFilePath && (BFAudioPlayer.shared.player?.isPlaying ?? false){
|
|
|
+ if cureentPalyURlString.replacingOccurrences(of: "file://", with: "") == mod.wavFilePath || (BFAudioPlayer.shared.player?.isPlaying ?? false){
|
|
|
BFLog(2, message: "命中的和播放的文件路径一样? wavFilePath:\(mod.wavFilePath ?? "")")
|
|
|
return
|
|
|
|
|
|
}
|
|
|
BFAudioPlayer.shared.delegate = self
|
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
|
+ BFAudioPlayer.shared.player?.rate = 2.0
|
|
|
|
|
|
let tt = currentAssetProgress - mod.startCMTime
|
|
|
BFLog(1, message: "record - tt: \(tt.seconds), curr:\(currentAssetProgress.seconds) \(needPlay) mod.wavFilePath\(mod.wavFilePath ?? "")")
|
|
@@ -606,8 +607,9 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
override func pause() {
|
|
|
dispatchWorkItemIsCancel = true
|
|
|
avplayer.pause()
|
|
|
+
|
|
|
BFAudioPlayer.shared.pause()
|
|
|
-
|
|
|
+ audioPlayerIsPlaying = false
|
|
|
timerr?.invalidate()
|
|
|
timerr = nil
|
|
|
|
|
@@ -801,6 +803,7 @@ extension BFRecordScreenCameraManager: BFAudioPlayerDelegate{
|
|
|
func audioPlayerDidFinish(){
|
|
|
BFLog(message: "audioPlayerDidFinish")
|
|
|
audioPlayerIsPlaying = false
|
|
|
+ BFAudioPlayer.shared.pause()
|
|
|
}
|
|
|
|
|
|
// 播放开始
|
|
@@ -810,7 +813,7 @@ extension BFRecordScreenCameraManager: BFAudioPlayerDelegate{
|
|
|
// 播放进度
|
|
|
func playProgress(currentTime: TimeInterval, progress: Double){
|
|
|
|
|
|
- BFLog(message: "currentTime is \(currentTime)")
|
|
|
+ BFLog(message: "currentTime is \(currentTime) progress\(progress) \(BFAudioPlayer.shared.currentAudioPathURL?.absoluteString ?? "")")
|
|
|
}
|
|
|
|
|
|
}
|