浏览代码

1,修改时间短时,时间条显示00 问题

jsonwang 3 年之前
父节点
当前提交
7d8921df7f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      BFFramework/Classes/Stuckpoint/View/PQStuckPointCuttingView.swift

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

@@ -217,7 +217,7 @@ class PQStuckPointCuttingView: UIView {
             titleLab.backgroundColor = .clear
             titleLab.backgroundColor = .clear
             titleLab.textColor = UIColor.hexColor(hexadecimal: "#999999")
             titleLab.textColor = UIColor.hexColor(hexadecimal: "#999999")
           
           
-            titleLab.text = "\(Float64(Int(index) * Int(timeRange)).formatDurationToHMS())"
+            titleLab.text = "\(Float64(Int(CGFloat(index) * timeRange)).formatDurationToHMS())"
             scrollView.addSubview(titleLab)
             scrollView.addSubview(titleLab)
         }
         }
         if oneMarginTime > 0 {
         if oneMarginTime > 0 {
@@ -357,6 +357,7 @@ class PQStuckPointCuttingView: UIView {
         let lastLine:UIView = scrollView.viewWithTag(100 +  Int(videoDuration / timeRange) - 1) ?? UIView.init()
         let lastLine:UIView = scrollView.viewWithTag(100 +  Int(videoDuration / timeRange) - 1) ?? UIView.init()
         //移动后的开始时间
         //移动后的开始时间
         let startTime =  videoDuration / lastLine.frame.maxX * scrollView.contentOffset.x
         let startTime =  videoDuration / lastLine.frame.maxX * scrollView.contentOffset.x
+//        let startTime =  videoDuration * (margin + scrollView.contentOffset.x) / scrollView.contentSize.width
         //选中的时长
         //选中的时长
         let selectDuration:CGFloat = CGFloat(stuckPointEndTime - stuckPointStartTime)
         let selectDuration:CGFloat = CGFloat(stuckPointEndTime - stuckPointStartTime)
         BFLog(message: "拖拽结束 - 回调\(scrollView.contentOffset)  \(scrollView.contentSize) 开始时间为:\(startTime) 结束时间为:\(startTime + selectDuration)")
         BFLog(message: "拖拽结束 - 回调\(scrollView.contentOffset)  \(scrollView.contentSize) 开始时间为:\(startTime) 结束时间为:\(startTime + selectDuration)")