Commit 09e05855 authored by Tobias's avatar Tobias

workaround issue with [VLCMediaPlayer setTime:]

parent 6e7615b3
......@@ -366,7 +366,7 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
VLCMediaPlayer *player = vpc.mediaPlayer;
if (player.isPlaying) {
[player jumpForward:VLCJumpInterval];
[self jumpInterval:VLCJumpInterval];
} else {
[self scrubbingJumpInterval:VLCJumpInterval];
}
......@@ -377,12 +377,27 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
VLCMediaPlayer *player = vpc.mediaPlayer;
if (player.isPlaying) {
[player jumpBackward:VLCJumpInterval];
[self jumpInterval:-VLCJumpInterval];
} else {
[self scrubbingJumpInterval:-VLCJumpInterval];
}
}
- (void)jumpInterval:(NSInteger)interval
{
NSInteger duration = [VLCPlaybackController sharedInstance].mediaDuration;
if (duration==0) {
return;
}
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
VLCMediaPlayer *player = vpc.mediaPlayer;
CGFloat intervalFraction = ((CGFloat)interval)/((CGFloat)duration);
CGFloat currentFraction = player.position;
currentFraction += intervalFraction;
player.position = currentFraction;
}
- (void)scrubbingJumpInterval:(NSInteger)interval
{
NSInteger duration = [VLCPlaybackController sharedInstance].mediaDuration;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment