提交 7aa47630 编写于 作者: Z Zhang Rui

IJKFFPlayerController: correct timing display

上级 b38c2d34
......@@ -50,11 +50,11 @@
- (void)refreshMediaControl
{
NSTimeInterval duration = [self.delegatePlayer duration];
NSTimeInterval position = [self.delegatePlayer currentPlaybackTime];
NSTimeInterval duration = self.delegatePlayer.duration;
NSTimeInterval position = self.delegatePlayer.currentPlaybackTime;
NSInteger intDuration = duration;
NSInteger intPosition = position;
NSInteger intDuration = duration + 0.5;
NSInteger intPosition = position + 0.5;
self.currentTimeLabel.text = [NSString stringWithFormat:@"%02d:%02d", intPosition / 60, intPosition % 60];
......
......@@ -86,23 +86,25 @@
if (!_mediaPlayer)
return;
ijkmp_seek_to(_mediaPlayer, aCurrentPlaybackTime);
ijkmp_seek_to(_mediaPlayer, aCurrentPlaybackTime * 1000);
}
- (NSTimeInterval)getCurrentPlaybackTime
- (NSTimeInterval)currentPlaybackTime
{
if (!_mediaPlayer)
return 0.0f;
return ijkmp_get_current_position(_mediaPlayer);
NSTimeInterval ret = ijkmp_get_current_position(_mediaPlayer);
return ret / 1000;
}
- (NSTimeInterval)getDuration
- (NSTimeInterval)duration
{
if (!_mediaPlayer)
return 0.0f;
return ijkmp_get_duration(_mediaPlayer);
NSTimeInterval ret = ijkmp_get_duration(_mediaPlayer);
return ret / 1000;
}
- (void)postEvent: (AVMessage *)msg
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册