|
@@ -1419,8 +1419,9 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
didPlayToEndTime((shouldPlayRecordIndex, recordedAudio), newItem)
|
|
didPlayToEndTime((shouldPlayRecordIndex, recordedAudio), newItem)
|
|
}
|
|
}
|
|
avplayerTimeObserver?.invalidate()
|
|
avplayerTimeObserver?.invalidate()
|
|
- avplayerTimeObserver = recordPlayer?.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: 1000), queue: DispatchQueue.global()) { [weak self, weak recordPlayer,weak assetPlayer] time in
|
|
|
|
- guard let sself = self,let rPlay = recordPlayer,let aPlay = assetPlayer else {
|
|
|
|
|
|
+ avplayerTimeObserver = recordPlayer?.addPeriodicTimeObserver(forInterval: CMTime(value: 1, timescale: 1000), queue: DispatchQueue.global()) { [weak self, weak recordPlayer] time in
|
|
|
|
+ guard let sself = self,let rPlay = recordPlayer else {
|
|
|
|
+ BFLog(3, message: "sself为空")
|
|
return
|
|
return
|
|
}
|
|
}
|
|
BFLog(3, message: "当前播放---\(time),\(time.seconds),\(rPlay.currentItem?.currentTime().seconds ?? 0),\(rPlay.currentItem?.duration.seconds ?? 0)")
|
|
BFLog(3, message: "当前播放---\(time),\(time.seconds),\(rPlay.currentItem?.currentTime().seconds ?? 0),\(rPlay.currentItem?.duration.seconds ?? 0)")
|
|
@@ -1432,8 +1433,6 @@ public class BFRecordScreenController: BFBaseViewController {
|
|
BFLog(message: "progressTime进度\(#function)-\(progressTime.seconds)")
|
|
BFLog(message: "progressTime进度\(#function)-\(progressTime.seconds)")
|
|
periodicTimeObserver(progressTime, newItem)
|
|
periodicTimeObserver(progressTime, newItem)
|
|
if (rPlay.currentItem?.currentTime().seconds ?? 0) > (rPlay.currentItem?.duration.seconds ?? 0) - 0.1 {
|
|
if (rPlay.currentItem?.currentTime().seconds ?? 0) > (rPlay.currentItem?.duration.seconds ?? 0) - 0.1 {
|
|
- rPlay.volume = 0
|
|
|
|
- aPlay.volume = sself.noSpeakVolume
|
|
|
|
didPlayToEndTime((shouldPlayRecordIndex, recordedAudio), newItem)
|
|
didPlayToEndTime((shouldPlayRecordIndex, recordedAudio), newItem)
|
|
}
|
|
}
|
|
} as? NSKeyValueObservation
|
|
} as? NSKeyValueObservation
|