|
@@ -180,11 +180,15 @@ class PQStuckPointCuttingView: UIView {
|
|
|
contentWidth = scrollView.frame.width
|
|
|
}
|
|
|
scrollView.contentSize = CGSize(width: contentWidth, height: scrollView.frame.height)
|
|
|
+
|
|
|
+
|
|
|
for index in 0 ... timeLabelCount {
|
|
|
+ scrollView.viewWithTag(100 + index)?.removeFromSuperview()
|
|
|
let titleLab = UILabel(frame: CGRect(x: CGFloat(index) * (timeLineWidth + timeLineMargin) + margin, y: rateView.frame.maxY, width: timeLineWidth, height: 30))
|
|
|
titleLab.font = UIFont.systemFont(ofSize: 11)
|
|
|
titleLab.textAlignment = .center
|
|
|
titleLab.numberOfLines = 1
|
|
|
+ titleLab.tag = 100 + index
|
|
|
titleLab.backgroundColor = .clear
|
|
|
titleLab.textColor = UIColor.hexColor(hexadecimal: "#999999")
|
|
|
titleLab.text = "\((Float64(index) * Float64(timeRange)).formatDurationToHMS())"
|
|
@@ -299,6 +303,19 @@ class PQStuckPointCuttingView: UIView {
|
|
|
deinit {
|
|
|
BFLog(message: "卡点裁剪-裁剪视图销毁")
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ func moveEnd() {
|
|
|
+
|
|
|
+ let lastLine:UIView = scrollView.viewWithTag(100 + Int(videoDuration / timeRange) - 1) ?? UIView.init()
|
|
|
+
|
|
|
+ let startTime = videoDuration / lastLine.frame.maxX * scrollView.contentOffset.x
|
|
|
+ BFLog(message: "拖拽结束 - 回调\(scrollView.contentOffset) \(scrollView.contentSize) 开始时间为:\(startTime)")
|
|
|
+ if(videoDidEndDragging != nil){
|
|
|
+ videoDidEndDragging!(1,startTime,startTime + CGFloat(stuckPointEndTime - stuckPointStartTime),0)
|
|
|
+ }
|
|
|
+ resetDefaultsColor()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -308,12 +325,15 @@ extension PQStuckPointCuttingView: UIScrollViewDelegate {
|
|
|
func scrollViewDidScroll(_: UIScrollView) {}
|
|
|
|
|
|
func scrollViewDidEndDecelerating(_: UIScrollView) {
|
|
|
- BFLog(message: "拖拽结束 - 回调")
|
|
|
- resetDefaultsColor()
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+ func scrollViewDidEndDragging(_:UIScrollView,willDecelerate:Bool){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
func scrollViewDidEndScrollingAnimation(_: UIScrollView) {
|
|
|
BFLog(message: "scrollViewDidEndScrollingAnimation")
|
|
|
- resetDefaultsColor()
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|