Ver código fonte

播放进度负数容错处理

jsonwang 3 anos atrás
pai
commit
bd5791998a

+ 6 - 2
BFFramework/Classes/Stuckpoint/ViewModel/PQGPUImagePlayerView.swift

@@ -424,8 +424,12 @@ public class PQGPUImagePlayerView: UIView {
                        
                         strongSelf.progressLab.text =  "\((currTime - Double(CMTimeGetSeconds(movie.startTime ?? .zero))).formatDurationToHMS()) / 00:01"
                     } else {
- 
-                        strongSelf.progressLab.text = "\((currTime -  Double(strongSelf.showProgressStartTime)).formatDurationToHMS()) / \( (duration - Double(strongSelf.showProgressStartTime)).formatDurationToHMS())"
+                        
+                        var showTime = currTime -  Double(strongSelf.showProgressStartTime)
+                        if (showTime < 0){
+                            showTime = 0
+                        }
+                        strongSelf.progressLab.text = "\(showTime.formatDurationToHMS()) / \( (duration - Double(strongSelf.showProgressStartTime)).formatDurationToHMS())"
                     }
                 }
             }