Commit da70a4cd authored by Christopher Loessl's avatar Christopher Loessl Committed by Felix Paul Kühne

Fixes: Control playback with gestures

If the users disabled gestures and then started playback for the first
time, gesture recognizers weren't added to the viewController. If the
user now turned on gesture recognizers viewDidLoad wouldn't happen again
and the user had to kill the application to get gestures working.
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent c7a70e9d
......@@ -237,34 +237,32 @@
_displayRemainingTime = [[defaults objectForKey:kVLCShowRemainingTime] boolValue];
_swipeGesturesEnabled = [[defaults objectForKey:kVLCSettingPlaybackGestures] boolValue];
if (_swipeGesturesEnabled) {
_pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
_pinchRecognizer.delegate = self;
[self.view addGestureRecognizer:_pinchRecognizer];
_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)];
[_tapRecognizer setNumberOfTouchesRequired:2];
_panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panRecognized:)];
[_panRecognizer setMinimumNumberOfTouches:1];
[_panRecognizer setMaximumNumberOfTouches:1];
_swipeRecognizerLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRecognized:)];
_swipeRecognizerLeft.direction = UISwipeGestureRecognizerDirectionLeft;
_swipeRecognizerRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRecognized:)];
_swipeRecognizerRight.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:_swipeRecognizerLeft];
[self.view addGestureRecognizer:_swipeRecognizerRight];
[self.view addGestureRecognizer:_panRecognizer];
[self.view addGestureRecognizer:_tapRecognizer];
[_panRecognizer requireGestureRecognizerToFail:_swipeRecognizerLeft];
[_panRecognizer requireGestureRecognizerToFail:_swipeRecognizerRight];
_panRecognizer.delegate = self;
_swipeRecognizerRight.delegate = self;
_swipeRecognizerLeft.delegate = self;
_tapRecognizer.delegate = self;
}
_pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
_pinchRecognizer.delegate = self;
[self.view addGestureRecognizer:_pinchRecognizer];
_tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)];
[_tapRecognizer setNumberOfTouchesRequired:2];
_panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panRecognized:)];
[_panRecognizer setMinimumNumberOfTouches:1];
[_panRecognizer setMaximumNumberOfTouches:1];
_swipeRecognizerLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRecognized:)];
_swipeRecognizerLeft.direction = UISwipeGestureRecognizerDirectionLeft;
_swipeRecognizerRight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRecognized:)];
_swipeRecognizerRight.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:_swipeRecognizerLeft];
[self.view addGestureRecognizer:_swipeRecognizerRight];
[self.view addGestureRecognizer:_panRecognizer];
[self.view addGestureRecognizer:_tapRecognizer];
[_panRecognizer requireGestureRecognizerToFail:_swipeRecognizerLeft];
[_panRecognizer requireGestureRecognizerToFail:_swipeRecognizerRight];
_panRecognizer.delegate = self;
_swipeRecognizerRight.delegate = self;
_swipeRecognizerLeft.delegate = self;
_tapRecognizer.delegate = self;
_aspectRatios = @[@"DEFAULT", @"FILL_TO_SCREEN", @"4:3", @"16:9", @"16:10", @"2.21:1"];
......
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