             videoPlayerController.playFromCurrentTime()
         }
     }
+    
+    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
+        //资源为空或播放器未准备好
+        guard  let asset = asset, videoPlayerController.playbackState != .unknown else {
+            return
+        }
+        //播放中
+        guard videoPlayerController.playbackState != .playing else {
+            return
+        }
+        
+        let position = scrollView.contentOffset.x + UIScreen.main.bounds.size.width / 2
+        let videoTrackLength = KeyframePickerViewCellWidth * _displayKeyframeImages.count
+        
+        let percent = position / CGFloat(videoTrackLength)
+        let currentSecond = asset.duration.seconds * Double(percent)
+        let currentTime = CMTimeMakeWithSeconds(currentSecond, asset.duration.timescale)
+        print("\(currentTime.timescale)")
+        cursorContainerViewController.seconds = currentSecond
+        videoPlayerController.seek(to: currentTime)
+    }
 }

            }
        }
    }
}

//MARK: - UICollectionView Methods
extension KeyframePickerViewController: UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout {
    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {

            self.videoPlayerController.playbackStateChangedHandler = {
                [weak self] playbackState in
                self?.videoPlayerPlaybackStateChanged(to: playbackState)
            }
            self.videoPlayerController.progressHandler = {
                [weak self] time in
                self?.videoPlayerPlayback(to: time)
            }
        }
    }
