4

Im making a iPhone app and want to make a seek bar for a AVPlayer. I want to make it with a UISlider. How can I do this?

4

2 に答える 2

3

You can map the duration of the file being played by the AVPlayer to the UISlider's range (maximum and minimum values) using the duration property of AVPlayer and make changes in the slider position to set the currentTime of the AVPlayer.

于 2011-08-19T23:22:19.983 に答える
0

Change the current duration of the song by slider value

- (IBAction)currentTimeSliderTouchUpInside:(id)sender    
 {     
        [self.player stop];    
        self.player.currentTime = self.currentTimeSlider.value;    
        [self.player prepareToPlay];   
        [self play:self];   
 }
于 2013-07-19T05:40:07.197 に答える