Swift: YouTube - How to Seek and Scrub AVPlayer with UISlider (Ep 18)

Profile Picture
- Published on Aug 21, 2016馃審 Public

Happy Sunday everyone. Let's continue building out our video player by introducing a video duration label and a UISlider component that allows us to jump to different portions of our clip. First, we look at how to figure out the duration by inspecting AVPlayer currentItem's duration property. Converting this value into seconds is somewhat tricky so I'll go through step by step how to do this. Next we'll take a look at using a UISlider component to seek and scrub through our video. By utilizing the zero to one value of our slider and video duration, we can use seekToTime on AVPlayer to bounce from point to point very easily. Have fun and enjoy. Completed Source Code https://www.letsbuildthatapp.com/cour... Twitter Slide Out Menu Course https://www.letsbuildthatapp.com/cour... Podcasts Course https://www.letsbuildthatapp.com/cour... Intermediate Training Core Data https://www.letsbuildthatapp.com/cour... Instagram Firebase Course https://www.letsbuildthatapp.com/cour... Facebook Group https://www.facebook.com/groups/12406... Follow me on Twitter: https://twitter.com/buildthatapp