title: Setting Slider Value to Set SeekToTime in AVPlayer
body: <p>I am using <a href="https://github.com/piemonte/Player" rel="nofollow noreferrer">Player</a> library, that is using AVPlayer &amp; AVFoundation, which is quiet convenient for my case. I successfully managed to play the video and add a slider. I set the slider's min to 0 and max to duration of the video..</p>
  
  <p>At this point, in order to connect slider to current playtime, I used <a href="https://stackoverflow.com/a/34463369/4705339">this answer</a>, on StackOverflow. I setup a protocol and used <code>addPeriodicTimeObserverForInterval</code>, so slider is linked to the currentTime and moving as video moves along successfully.</p>
  
  <p>Now, here is my problem. I want to do the reverse and make - when slider moves, set currentTime of the video (forward,backward).</p>
  
  <p>I made some research and I found out that it's <code>seekToTime</code> that I should link the <code>slider.value</code> (<code>sender.value</code> in my case) but, I couldn't understand how to apply it to Player. How can I make the slider to control the currentTime?</p>
  
  <hr>
  
  <p>I am not sure if I am right, but as far as I understand, the first step should be:</p>
  
  <pre><code>protocol UserSetsTheTimeDelegate
  {
    func userSetsTheTime(result: Int)
  }
  
  class ViewController: UIViewController, PlayerDelegate {
         ...
  
    func sliderValueDidChange(sender:UISlider!) {
       print("value--\(sender.value)")
       self.delegate?.userSetsTheTime(sender.value)
    }
  }
  </code></pre>
  
  <p>And add, I think I should add the <code>UserSetsTheTimeDelegate</code> in Player.swift, but I got confused here.</p>
  
  <hr>
  
  <p><strong>Update</strong>:</p>
  
  <p>I realised that I can send the data to the Player.swift by using an instance in ViewController and adding a method in Player class. This is the first step. But now, as currentTime is getting updated (with modifying the slider) so quickly, it doesn't let me manipulate the slider value.</p>