|
@@ -45,7 +45,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
|
|
|
var startTime = Date()
|
|
var startTime = Date()
|
|
var videoModel = PQEditVisionTrackMaterialsModel()
|
|
var videoModel = PQEditVisionTrackMaterialsModel()
|
|
-
|
|
|
|
|
|
+ var playingVoiceMode : PQVoiceModel?
|
|
// 用于打开摄像头初始流程
|
|
// 用于打开摄像头初始流程
|
|
static var initOpenCamera: Bool = true
|
|
static var initOpenCamera: Bool = true
|
|
|
|
|
|
@@ -453,13 +453,21 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
BFLog(message: "找到音频开始时间:\(mod.startCMTime.seconds)结束 \(mod.endCMTime.seconds) currentAssetProgress is \(currentAssetProgress.seconds)")
|
|
BFLog(message: "找到音频开始时间:\(mod.startCMTime.seconds)结束 \(mod.endCMTime.seconds) currentAssetProgress is \(currentAssetProgress.seconds)")
|
|
|
|
|
|
// 当前播放的文件
|
|
// 当前播放的文件
|
|
|
|
+ if playingVoiceMode == mod {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ playingVoiceMode = mod
|
|
|
|
|
|
let cureentPalyURlString = BFAudioPlayer.shared.currentAudioPathURL?.absoluteString ?? ""
|
|
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 ?? "")")
|
|
BFLog(2, message: "命中的和播放的文件路径一样? wavFilePath:\(mod.wavFilePath ?? "")")
|
|
|
|
+ if !(BFAudioPlayer.shared.player?.isPlaying ?? false) {
|
|
|
|
+ audioPlayerIsPlaying = true
|
|
|
|
+ BFAudioPlayer.shared.playOrPause()
|
|
|
|
+ }
|
|
return
|
|
return
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
BFAudioPlayer.shared.delegate = self
|
|
BFAudioPlayer.shared.delegate = self
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
BFAudioPlayer.shared.configPlayer(audioPathURL: URL(fileURLWithPath: mod.wavFilePath))
|
|
|
|
|
|
@@ -569,7 +577,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
dispatchWorkItemIsCancel = true
|
|
dispatchWorkItemIsCancel = true
|
|
avplayer.pause()
|
|
avplayer.pause()
|
|
BFAudioPlayer.shared.pause()
|
|
BFAudioPlayer.shared.pause()
|
|
-
|
|
|
|
|
|
+ playingVoiceMode = nil
|
|
timerr?.invalidate()
|
|
timerr?.invalidate()
|
|
timerr = nil
|
|
timerr = nil
|
|
|
|
|
|
@@ -588,7 +596,7 @@ class BFRecordScreenCameraManager: BFRecordScreenBaseManager {
|
|
|
|
|
|
playerCoverIV.image = getThumbImageAtTime(urlAsset: AVURLAsset(url: URL(fileURLWithPath: mod.locationPath)), time: currentAssetProgress - mod.timelineCMIn)
|
|
playerCoverIV.image = getThumbImageAtTime(urlAsset: AVURLAsset(url: URL(fileURLWithPath: mod.locationPath)), time: currentAssetProgress - mod.timelineCMIn)
|
|
playerCoverIV.isHidden = false
|
|
playerCoverIV.isHidden = false
|
|
-
|
|
|
|
|
|
+
|
|
avplayerReplaceItem(newItem: AVPlayerItem(url: URL(fileURLWithPath: mod.locationPath)))
|
|
avplayerReplaceItem(newItem: AVPlayerItem(url: URL(fileURLWithPath: mod.locationPath)))
|
|
|
|
|
|
// prepareToPlayNext(needPlay: false)
|
|
// prepareToPlayNext(needPlay: false)
|