我正在使用VIMVideoPlayer播放视频,我正在尝试更新UISlider的值,以便它反映播放器的当前时间。但是,这根本不会更新该值。
UISlider的最小值为0,最大值为1,当前值为0.
委托方法是:
-(void) videoPlayerView:(VIMVideoPlayerView *)videoPlayerView didFailWithError:(NSError *)error {
}
-(void) videoPlayerViewDidReachEnd:(VIMVideoPlayerView *)videoPlayerView {
[self.playerSlider setValue:0.0 animated:YES];
}
-(void) videoPlayerViewIsReadyToPlayVideo:(VIMVideoPlayerView *)videoPlayerView {
}
- (void)videoPlayerView:(VIMVideoPlayerView *)videoPlayerView timeDidChange:(CMTime)cmTime {
float time = CMTimeGetSeconds(videoPlayerView.player.player.currentTime);
float dur = CMTimeGetSeconds(videoPlayerView.player.player.currentItem.duration);
float progress = time/dur;
NSLog(@"here : %f", progress);
if (progress > 0.0) {
[self.playerSlider setValue:progress animated:YES];
}
}
- (void)videoPlayerView:(VIMVideoPlayerView *)videoPlayerView loadedTimeRangeDidChange:(float)duration {
}