Commit 68d279d7 authored by Mike JS. Choi's avatar Mike JS. Choi Committed by Carola Nitz

[Playback] Update initial control center playback position

parent 39e96176
......@@ -1113,8 +1113,10 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
CGFloat lastPosition = .0;
NSInteger duration = 0;
if (item.lastPosition)
if (item.lastPosition) {
lastPosition = item.lastPosition.floatValue;
}
duration = item.duration.intValue;
if (lastPosition < .95 && _mediaPlayer.position < lastPosition) {
......@@ -1125,7 +1127,7 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
continuePlayback = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingContinuePlayback] integerValue];
if (continuePlayback == 1) {
_mediaPlayer.position = lastPosition;
[self jumpForward:(duration * lastPosition) / 1000.];
} else if (continuePlayback == 0) {
VLCAlertView *alert = [[VLCAlertView alloc] initWithTitle:NSLocalizedString(@"CONTINUE_PLAYBACK", nil)
message:[NSString stringWithFormat:NSLocalizedString(@"CONTINUE_PLAYBACK_LONG", nil), item.title]
......@@ -1134,7 +1136,7 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
otherButtonTitles:NSLocalizedString(@"BUTTON_CONTINUE", nil), nil];
alert.completion = ^(BOOL cancelled, NSInteger buttonIndex) {
if (!cancelled) {
_mediaPlayer.position = lastPosition;
[self setPlaybackPosition:lastPosition];
}
};
[alert show];
......
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