         uiDurationSlider.setThumbImage(UIImage(named: "Player_slider_thumb"), for: .normal)
         uiDurationSlider.maximumTrackTintColor = UIColor.clear
         uiDurationSlider.minimumTrackTintColor = UIColor.green
+        uiDurationSlider.addTarget(self, action: #selector(Player.durationSliderBegan(_:)), for: .touchDown)
+        uiDurationSlider.addTarget(self, action: #selector(Player.durationSliderMove(_:)), for: .valueChanged)
+        uiDurationSlider.addTarget(self, action: #selector(Player.durationSliderEnd(_:)), for: [.touchUpInside, .touchUpOutside, .touchCancel])
         
         uiDurationProgressView.tintColor      = UIColor ( red: 1.0, green: 1.0, blue: 1.0, alpha: 0.6 )
         uiDurationProgressView.trackTintColor = UIColor ( red: 1.0, green: 1.0, blue: 1.0, alpha: 0.3 )

        }
    }
    
    var currentDuration: (current: Float, total: Float)! {
        didSet {
            let min = Int(currentDuration.current / 60)
            let sec = Int(currentDuration.current.truncatingRemainder(dividingBy: 60))
            uiCurrentDurationLabel.text = String(format: "%02d:%02d", min, sec)
            uiDurationSlider.value = currentDuration.current / currentDuration.total
        }
    }
    

    
    func play() {
        print("play")
        setupTimer()
        player?.play()
//        uiView.fadeOut()
    }
    
    func seek(to seconds: TimeInterval) {
        let draggedTime = CMTimeMake(Int64(seconds), 1)
        player?.seek(to: draggedTime, toleranceBefore: kCMTimeZero, toleranceAfter: kCMTimeZero, completionHandler: { (finished) in
            self.setupTimer()
            self.play()
        })
    }
    
    func durationSliderBegan(_ sender: UISlider) {
        
    }
    
    func durationSliderMove(_ sender: UISlider) {
        uiCurrentDurationLabel.text = convert(duration: sender.value * Float(duration))
        seek(to: Double(sender.value) * duration)
    }
    
    func durationSliderEnd(_ sender: UISlider) {
        
    }
}

