Commit 1f5a7e47 authored by Tobias's avatar Tobias

reduce scrubbing and playback fraction difference which triggers snap to playback position

parent c5e034b1
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
return [[self alloc] initWithNibName:nil bundle:nil]; return [[self alloc] initWithNibName:nil bundle:nil];
} }
- (void)viewDidLoad { - (void)viewDidLoad
{
[super viewDidLoad]; [super viewDidLoad];
self.extendedLayoutIncludesOpaqueBars = YES; self.extendedLayoutIncludesOpaqueBars = YES;
...@@ -176,7 +177,7 @@ ...@@ -176,7 +177,7 @@
CGFloat scrubbingFraction = MAX(0.0, MIN(bar.scrubbingFraction + fractionInView,1.0)); CGFloat scrubbingFraction = MAX(0.0, MIN(bar.scrubbingFraction + fractionInView,1.0));
if (ABS(scrubbingFraction - bar.playbackFraction)<0.01) { if (ABS(scrubbingFraction - bar.playbackFraction)<0.005) {
scrubbingFraction = bar.playbackFraction; scrubbingFraction = bar.playbackFraction;
} else { } else {
translation.x = 0.0; translation.x = 0.0;
...@@ -243,7 +244,7 @@ ...@@ -243,7 +244,7 @@
int scrubbingTimeInt = MAX(1,vpc.mediaDuration*scrubbingFraction); int scrubbingTimeInt = MAX(1,vpc.mediaDuration*scrubbingFraction);
VLCTime *scrubbingTime = [VLCTime timeWithInt:scrubbingTimeInt]; VLCTime *scrubbingTime = [VLCTime timeWithInt:scrubbingTimeInt];
bar.markerTimeLabel.text = [scrubbingTime stringValue]; bar.markerTimeLabel.text = [scrubbingTime stringValue];
VLCTime *remainingTime = [VLCTime timeWithInt:(int)vpc.mediaDuration-scrubbingTime.intValue]; VLCTime *remainingTime = [VLCTime timeWithInt:-(int)(vpc.mediaDuration-scrubbingTime.intValue)];
bar.remainingTimeLabel.text = [remainingTime stringValue]; bar.remainingTimeLabel.text = [remainingTime stringValue];
} }
......
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