title: AVPlayer video is freezing for some reason on rate 1
body: <p>I am trying to play local videos in my app using <code>AVPlayer</code> and <code>AVPlayerViewController</code>. The problem is that when I try to play the video at some parts the video just starts freezing and playing 1 or 2 frames per second, while the audio sounds perfectly fine. It is not a heavy video (4.5 MB, 35 seconds long), it was exported at 25 fps(using adobe premiere).</p>
  <p>I tried a couple of things to fix it, some of them fixed the freezes, but are not a good solution:</p>
  <ul>
  <li>I exported the video at 15 frames per second, this made it run fine, but it was choppy since it was 15 fps.</li>
  <li>I tried exporting the video at 150% speed, it ran smoothly.</li>
  <li>Setting the rate to 0.75 made the video run smoothly.</li>
  <li>Setting the rate higher made it freeze way more often.</li>
  <li>For some reason when I started the video half way through at 15 seconds it didn't freeze.</li>
  </ul>
  <p>This is what the code looks like:</p>
  <pre class="lang-swift prettyprint-override"><code>let videoURL: URL = Bundle.main.url(forResource: currentComic?.getVideo(), withExtension: &quot;mp4&quot;)!
  player = AVPlayer(url: videoURL)
  videoPlayerController.player = player
  videoPlayerController.showsPlaybackControls = true
  videoPlayerController.videoGravity = AVLayerVideoGravity.resizeAspectFill
  NotificationCenter.default.addObserver(self, selector: #selector(playerDidFinishPlaying), name: .AVPlayerItemDidPlayToEndTime, object: player.currentItem)
  self.present(videoPlayerController, animated: true, completion: nil)
  var item = videoPlayerController.player!.currentItem
  var previousPageCMTimeTag = CMTimeMakeWithSeconds(0, preferredTimescale: 1)
  videoPlayerController.player!.seek(to: previousPageCMTimeTag)
  videoPlayerController.player!.play()
  player.rate = 1
  </code></pre>
  <p><code>videoPlayerController</code> is a variable of <code>AVPlayerViewController</code>, and <code>player</code> is a variable of <code>AVPlayer</code>. I really hope someone can help me with this; it has been driving me crazy for the past few days.</p>