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

mini playback view: add tap gesture on label and artwork/vout to push the fullscreen controller

(cherry picked from commit 0a056307b5d6a52c56bbadfbeab9993776d4d138)
parent 26d57aa9
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#import "VLCAppDelegate.h" #import "VLCAppDelegate.h"
#import "VLCPlaylistViewController.h" #import "VLCPlaylistViewController.h"
@interface VLCMiniPlaybackView () <VLCPlaybackControllerDelegate> @interface VLCMiniPlaybackView () <VLCPlaybackControllerDelegate, UIGestureRecognizerDelegate>
{ {
UIImageView *_artworkView; UIImageView *_artworkView;
UIView *_videoView; UIView *_videoView;
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
UIButton *_nextButton; UIButton *_nextButton;
UIButton *_expandButton; UIButton *_expandButton;
UILabel *_metaDataLabel; UILabel *_metaDataLabel;
UITapGestureRecognizer *_labelTapRecognizer;
UITapGestureRecognizer *_artworkTapRecognizer;
} }
@property (nonatomic, weak) VLCPlaybackController *playbackController; @property (nonatomic, weak) VLCPlaybackController *playbackController;
...@@ -91,9 +93,26 @@ ...@@ -91,9 +93,26 @@
_metaDataLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth; _metaDataLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self addSubview:_metaDataLabel]; [self addSubview:_metaDataLabel];
_labelTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)];
_labelTapRecognizer.delegate = self;
_labelTapRecognizer.numberOfTouchesRequired = 1;
[_metaDataLabel addGestureRecognizer:_labelTapRecognizer];
_metaDataLabel.userInteractionEnabled = YES;
_artworkTapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognized)];
_artworkTapRecognizer.delegate = self;
_artworkTapRecognizer.numberOfTouchesRequired = 1;
[_artworkView addGestureRecognizer:_artworkTapRecognizer];
_artworkView.userInteractionEnabled = YES;
return self; return self;
} }
- (void)tapRecognized
{
[self pushFullPlaybackView:nil];
}
- (void)previousAction:(id)sender - (void)previousAction:(id)sender
{ {
[self.playbackController backward]; [self.playbackController backward];
...@@ -171,6 +190,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -171,6 +190,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[_videoView removeFromSuperview]; [_videoView removeFromSuperview];
_videoView = nil; _videoView = nil;
} }
[_artworkView addGestureRecognizer:_artworkTapRecognizer];
} else { } else {
_artworkView.image = nil; _artworkView.image = nil;
if (_videoView) { if (_videoView) {
...@@ -179,6 +199,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -179,6 +199,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
} }
_videoView = [[UIView alloc] initWithFrame:_artworkView.frame]; _videoView = [[UIView alloc] initWithFrame:_artworkView.frame];
[_videoView setClipsToBounds:YES]; [_videoView setClipsToBounds:YES];
[_videoView addGestureRecognizer:_artworkTapRecognizer];
_videoView.userInteractionEnabled = YES;
[self addSubview:_videoView]; [self addSubview:_videoView];
controller.videoOutputView = _videoView; controller.videoOutputView = _videoView;
} }
......
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