Commit 75906366 authored by Soomin Lee's avatar Soomin Lee Committed by Jean-Baptiste Kempf

iOS: Fix saving of the last timeleft display method

updateDefaults() method is called when the playback is closed resetting the value of _displayRemainingTime
just before viewWillDisappear() method which writes _displayRemainingTime in the UserDefaults.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 383b77e5
......@@ -86,6 +86,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
BOOL _closeGestureEnabled;
BOOL _variableJumpDurationEnabled;
BOOL _mediaHasProjection;
BOOL _playbackWillClose;
UIPinchGestureRecognizer *_pinchRecognizer;
VLCPanType _currentPanType;
......@@ -443,6 +444,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
{
[super viewDidAppear:animated];
_viewAppeared = YES;
_playbackWillClose = NO;
[_vpc recoverDisplayedMetadata];
_vpc.videoOutputView = nil;
......@@ -533,11 +535,14 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
[super dismissViewControllerAnimated:flag completion:completion];
}
- (void) updateDefaults
- (void)updateDefaults
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
_displayRemainingTime = [[defaults objectForKey:kVLCShowRemainingTime] boolValue];
[self updateTimeDisplayButton];
if (!_playbackWillClose) {
_displayRemainingTime = [[defaults objectForKey:kVLCShowRemainingTime] boolValue];
[self updateTimeDisplayButton];
}
_volumeGestureEnabled = [[defaults objectForKey:kVLCSettingVolumeGesture] boolValue];
_playPauseGestureEnabled = [[defaults objectForKey:kVLCSettingPlayPauseGesture] boolValue];
......@@ -726,6 +731,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (IBAction)closePlayback:(id)sender
{
LOCKCHECK;
_playbackWillClose = YES;
[_vpc stopPlayback];
}
......
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