0

I've implemented a standard Swift video player:-

   let path = NSBundle.mainBundle().pathForResource(assetName, ofType: "m4v")
   let url = NSURL.fileURLWithPath(path!)
   player = AVPlayer(URL: url)
   playerViewController.player = player

Using the standard build-it controller bar at the bottom of the video. I've noticed that during playback, the built-in scrub/progress bar (the sliding control that shows the time elapsed in the video) jumps at second intervals.

Is there any way to quantise this control position to frame intervals? Or make it so that it moves continuously, rather than updating and jumping position every second.

Daniel Freeman
  • 383
  • 4
  • 11

1 Answers1

0

Yes this is normal behavior of AVPlayerViewController. It's use UISlider to show progress or update. So, it will update at every one second. It in not UIProgressView which runs linearly and not jups. It is UISlider, and it's default behavior is like this(jump). You can forward or reverse video by dragging the slider which is not possible with UIProgressView. UIProgressView generally use to showing any loading like downloading or webpageloading etc. So, AVPlayerViewController uses UISlider and it is works as per it's default behavior.

Now if you want to change this then you should customized your AVPlayerViewController that boring and hard thing. you can use UIProgressView with your customized player.

You can use only AVPlayer to play video which will not display anything like slider,time etc. It will only display video, so you can add your custom ui like progress or slider to it.

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75