Explorar el Código

音乐时长错误容错判断 “就吃一口”

jsonwang hace 3 años
padre
commit
95b3433b67

+ 5 - 1
BFFramework/Classes/Stuckpoint/Controller/PQStuckPointEditerController.swift

@@ -999,7 +999,11 @@ class PQStuckPointEditerController: PQBaseViewController {
 
                 // 6,进度回调
                 self.playerView.progress = { [weak self] currentTime, tatolTime, _ in
-
+                    
+                    if(CMTimeGetSeconds(self?.playeTimeRange.duration ?? .zero) <= 0.0){
+                        BFLog(message: "时长错误!!!!")
+                        return
+                    }
                     // 更新进度
                     let progress = (currentTime - CMTimeGetSeconds(self?.playeTimeRange.start ?? .zero)) / CMTimeGetSeconds(self?.playeTimeRange.duration ?? .zero)
                     BFLog(message: "\(currentTime) \(tatolTime) 显示播放器进度为: \(progress)")

+ 2 - 1
BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

@@ -264,7 +264,8 @@ class PQStuckPointCuttingView: UIView {
     /// progress <#progress description#>
     func updateProgress(progress: CGFloat) {
         
-        if(progress <= 0 || lineLayerArray.count == 0){
+
+        if(progress <= 0 || lineLayerArray.count == 0 || progress.isNaN){
             BFLog(message: "progress is error ")
             return
         }