Quellcode durchsuchen

添加空为判断

jsonwang vor 3 Jahren
Ursprung
Commit
9421fec841

+ 1 - 1
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -1081,7 +1081,7 @@ public class BFRecordScreenController: BFBaseViewController {
                 //    进度监控
                self?.currentAssetProgress = CMTime(seconds: time.seconds, preferredTimescale: 1000)
                 BFLog(1, message: "curr:\(CMTimeGetSeconds(self?.currentAssetProgress ?? .zero))")
-                if CMTimeGetSeconds(item.duration) > 0 {
+                if CMTimeGetSeconds(item?.duration ?? CMTime.zero) > 0 {
                     DispatchQueue.main.async { [weak self] in
                         self?.progreddL.text = String(format: "%@", CMTimeGetSeconds(time).formatDurationToHMS())
                         let su = !(self?.isDragingProgressSlder ?? false) || (self?.isRecording ?? false && self?.isNormalPlaying ?? false)