title: How to make custom video player with swift
body: <p>I'm trying to make a video player like youtube, with double-tap the screen to fast forward 5 seconds. But I'm having trouble implementing that. I tried using code below:</p>
  
  <pre><code>class VideoViewController: AVPlayerViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
      let doubleTap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
      doubleTap.numberOfTapsRequired = 2
      doubleTap.delegate = self
  
      self.view.addGestureRecognizer(doubleTap)
      // Do any additional setup after loading the view.
  }
  
  
  extension VideoViewController: UIGestureRecognizerDelegate {
      @objc func handleTap(_ gesture: UITapGestureRecognizer){
          print("doubletapped")
      }
  }
  </code></pre>
  
  <p>This is how I call it:</p>
  
  <pre><code>let player = AVPlayer(url: self.fileURLs[indexPath.row])
          let playerController = VideoViewController()
  
          playerController.player = player
          self.present(playerController, animated: true) {
              playerController.player!.play()
          }
  </code></pre>
  
  <p>But still Swift cannot recognize the double tap when playing video. I try to disable userinteractoin but still no luck. Anyone please give me some hints.
  Thanks!!</p>