Commit 1dfa5ec7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Added option to disable playback control gestures (close #10592)

parent bd1df2f4
......@@ -2,13 +2,14 @@
------
* WiFi uploads and HTTP downloads continue in the background
(2 min on iOS 7, 10 min on iOS 6)
* Added option to disable playback control gestures (#10592)
* Fixed serial ftp downloads
* Added support for m4b, caf, oma, w64 audio files
* Stability improvements
* Stability improvements and UX tweaks (amongst others #10601)
2.2.2:
------
* Fixed audio playback regression introduced in previous update
* Fixed audio playback regression introduced in previous update (#10597)
* Updated translations to Arabic, Chinese (Hans), Dutch, Galician, Hungarian,
Portuguese
......
......@@ -56,6 +56,16 @@
<integer>3333</integer>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>EnableGesturesToControlPlayback</string>
<key>Title</key>
<string>SETTINGS_GESTURES</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
......
......@@ -46,6 +46,16 @@
<integer>3333</integer>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<true/>
<key>Key</key>
<string>EnableGesturesToControlPlayback</string>
<key>Title</key>
<string>SETTINGS_GESTURES</string>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>Type</key>
<string>PSGroupSpecifier</string>
......
B/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */
......
......@@ -53,7 +53,7 @@
else
skipLoopFilterDefaultValue = kVLCSettingSkipLoopFilterNonRef;
NSDictionary *appDefaults = @{kVLCSettingPasscodeKey : @"", kVLCSettingPasscodeOnKey : @(NO), kVLCSettingContinueAudioInBackgroundKey : @(YES), kVLCSettingStretchAudio : @(NO), kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue, kVLCSettingSkipLoopFilter : skipLoopFilterDefaultValue, kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue, kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue, kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue, kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue, kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue};
NSDictionary *appDefaults = @{kVLCSettingPasscodeKey : @"", kVLCSettingPasscodeOnKey : @(NO), kVLCSettingContinueAudioInBackgroundKey : @(YES), kVLCSettingStretchAudio : @(NO), kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue, kVLCSettingSkipLoopFilter : skipLoopFilterDefaultValue, kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue, kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue, kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue, kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue, kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue, kVLCSettingPlaybackGestures : [NSNumber numberWithBool:YES]};
[defaults registerDefaults:appDefaults];
}
......
......@@ -2,7 +2,7 @@
* VLCConstants.h
* VLC for iOS
*****************************************************************************
* Copyright (c) 2013 VideoLAN. All rights reserved.
* Copyright (c) 2013-2014 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne # videolan.org>
......@@ -36,7 +36,8 @@
#define kVLCSettingDeinterlaceDefaultValue @(0)
#define kVLCSettingNetworkCaching @"network-caching"
#define kVLCSettingNetworkCachingDefaultValue @(999)
#define kVLCSettingsDecrapifyTitles = @"MLDecrapifyTitles";
#define kVLCSettingsDecrapifyTitles @"MLDecrapifyTitles"
#define kVLCSettingPlaybackGestures @"EnableGesturesToControlPlayback"
#define kVLCShowRemainingTime @"show-remaining-time"
#define kVLCRecentURLs @"recent-urls"
......
......@@ -57,10 +57,12 @@
BOOL _swipeGesturesEnabled;
NSString * panType;
UIPinchGestureRecognizer *_pinchRecognizer;
UIPanGestureRecognizer *_panRecognizer;
UISwipeGestureRecognizer *_swipeRecognizerLeft;
UISwipeGestureRecognizer *_swipeRecognizerRight;
UITapGestureRecognizer *_tapRecognizer;
UITapGestureRecognizer *_tapOnVideoRecognizer;
}
@property (nonatomic, strong) UIPopoverController *masterPopoverController;
......@@ -88,10 +90,18 @@
[self.view removeGestureRecognizer:_swipeRecognizerRight];
if (_panRecognizer)
[self.view removeGestureRecognizer:_panRecognizer];
if (_pinchRecognizer)
[self.view removeGestureRecognizer:_pinchRecognizer];
[self.view removeGestureRecognizer:_tapOnVideoRecognizer];
_tapRecognizer = nil;
_swipeRecognizerLeft = nil;
_swipeRecognizerRight = nil;
_panRecognizer = nil;
_pinchRecognizer = nil;
_tapOnVideoRecognizer = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
#pragma mark - Managing the media item
......@@ -217,18 +227,19 @@
self.trackNameLabel.text = self.artistNameLabel.text = self.albumNameLabel.text = @"";
_movieView.userInteractionEnabled = NO;
UITapGestureRecognizer *tapOnVideoRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleControlsVisible)];
tapOnVideoRecognizer.delegate = self;
[self.view addGestureRecognizer:tapOnVideoRecognizer];
_displayRemainingTime = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCShowRemainingTime] boolValue];
_tapOnVideoRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleControlsVisible)];
_tapOnVideoRecognizer.delegate = self;
[self.view addGestureRecognizer:_tapOnVideoRecognizer];
UIPinchGestureRecognizer *pinchRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
pinchRecognizer.delegate = self;
[self.view addGestureRecognizer:pinchRecognizer];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
_displayRemainingTime = [[defaults objectForKey:kVLCShowRemainingTime] boolValue];
_swipeGesturesEnabled = [[defaults objectForKey:kVLCSettingPlaybackGestures] boolValue];
_swipeGesturesEnabled = YES;
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:)];
......@@ -351,6 +362,8 @@
{
[super viewWillAppear:animated];
_swipeGesturesEnabled = [[[NSUserDefaults standardUserDefaults] objectForKey:kVLCSettingPlaybackGestures] boolValue];
[self.navigationController setNavigationBarHidden:YES animated:YES];
if (!SYSTEM_RUNS_IOS7_OR_LATER) {
......@@ -680,12 +693,18 @@
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer
{
if (!_swipeGesturesEnabled)
return;
if (recognizer.velocity < 0.)
[self closePlayback:nil];
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
if (!_swipeGesturesEnabled)
return NO;
if (touch.view != self.view)
return NO;
......@@ -694,6 +713,9 @@
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if (!_swipeGesturesEnabled)
return NO;
return YES;
}
......
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