Commit d2139a54 authored by Felix Paul Kühne's avatar Felix Paul Kühne

fix continue playback where left-off and show progress in library starting at 5% instead of 10%

parent 69fe2079
......@@ -517,7 +517,7 @@
if (duration != 0)
playbackPositionInTime = @(lastPosition * (duration / 1000.));
}
if (playbackPositionInTime.intValue > 0 && (duration * lastPosition - duration) > 0) {
if (playbackPositionInTime.intValue > 0 && (duration * lastPosition - duration) < -60000) {
/* start time is not supported for media lists */
[_mediaPlayer.media addOptions:@{@"start-time": playbackPositionInTime}];
APLog(@"set starttime to %i", playbackPositionInTime.intValue);
......@@ -545,7 +545,7 @@
_mediaPlayer.videoAspectRatio = NULL;
/* some demuxers don't respect :start-time, so re-try here */
if (lastPosition < .95 && _mediaPlayer.position < lastPosition && (duration * lastPosition - duration) > 0)
if (lastPosition < .95 && _mediaPlayer.position < lastPosition && (duration * lastPosition - duration) < -60000)
_mediaPlayer.position = lastPosition;
[self _resetIdleTimer];
......
......@@ -231,7 +231,7 @@
if (SYSTEM_RUNS_IOS7_OR_LATER) {
CGFloat duration = mediaItem.duration.floatValue;
if (position > .1f && position < .95f && (duration * position - duration) > 0) {
if (position > .05f && position < .95f && (duration * position - duration) < -60000) {
[(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(duration * position - duration)] minuteStringValue]]];
self.mediaIsUnreadView.hidden = NO;
} else if (mediaItem.unread.intValue) {
......
......@@ -223,7 +223,7 @@
if (SYSTEM_RUNS_IOS7_OR_LATER) {
CGFloat duration = mediaItem.duration.floatValue;
if (position > .1f && position < .95f && (duration * position - duration) > 0) {
if (position > .05f && position < .95f && (duration * position - duration) < -60000) {
[(UITextView*)self.mediaIsUnreadView setText:[NSString stringWithFormat:NSLocalizedString(@"LIBRARY_MINUTES_LEFT", @""), [[VLCTime timeWithInt:(duration * position - duration)] minuteStringValue]]];
self.mediaIsUnreadView.hidden = NO;
} else if (mediaItem.unread.intValue) {
......
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