How to Seek and Scrub through Video with UISlider
YouTube
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.

Comments (4)
Pavel Yurkov
5 years ago
Eric Rosenberg
6 years ago
toolmarmel
8 years ago
chikwk
8 years ago
HELP & SUPPORT