Commit 41504492 authored by Vincent L. Cone's avatar Vincent L. Cone Committed by Felix Paul Kühne

Change behavior of the transport bar to match the newer style in...

Change behavior of the transport bar to match the newer style in AVPlayerViewController Embed hint icons for transport bar instead of loading them from AVKit.
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent cf998d67
......@@ -12,6 +12,12 @@
"filename" : "App Icon - Small.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "Top Shelf Image Wide-1.imageset",
"role" : "top-shelf-image-wide"
},
{
"size" : "1920x720",
"idiom" : "tv",
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "tv",
"filename" : "NowPlayingFastForward.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "tv",
"filename" : "NowPlayingSkip10Backward.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "tv",
"filename" : "NowPlayingSkip10Forward.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -218,6 +218,10 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
}
}
if (!self.canScrub) {
return;
}
switch (panGestureRecognizer.state) {
case UIGestureRecognizerStateCancelled:
case UIGestureRecognizerStateFailed:
......@@ -469,6 +473,7 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
return;
}
} else {
if (self.canJump) {
switch (recognizer.touchLocation) {
case VLCSiriRemoteTouchLocationLeft:
hint = VLCTransportBarHintJumpBackward10;
......@@ -480,6 +485,9 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
hint = VLCTransportBarHintNone;
break;
}
} else {
hint = VLCTransportBarHintNone;
}
}
break;
case UIGestureRecognizerStateEnded:
......@@ -500,14 +508,15 @@ typedef NS_ENUM(NSInteger, VLCPlayerScanState)
- (void)handleSiriPressUpAtLocation:(VLCSiriRemoteTouchLocation)location
{
BOOL canJump = [self canJump];
switch (location) {
case VLCSiriRemoteTouchLocationLeft:
if (self.isSeekable) {
if (canJump && self.isSeekable) {
[self jumpBackward];
}
break;
case VLCSiriRemoteTouchLocationRight:
if (self.isSeekable) {
if (canJump && self.isSeekable) {
[self jumpForward];
}
break;
......@@ -662,6 +671,17 @@ static const NSInteger VLCJumpInterval = 10000; // 10 seconds
return [VLCPlaybackController sharedInstance].mediaPlayer.isSeekable;
}
- (BOOL)canJump
{
// to match the AVPlayerViewController behavior only allow jumping when playing.
return [VLCPlaybackController sharedInstance].isPlaying;
}
- (BOOL)canScrub
{
// to match the AVPlayerViewController behavior only allow scrubbing when paused.
return ![VLCPlaybackController sharedInstance].isPlaying;
}
#pragma mark -
- (void)updateTimeLabelsForScrubbingFraction:(CGFloat)scrubbingFraction
......
......@@ -139,9 +139,7 @@ static inline void sharedSetup(VLCTransportBar *self) {
break;
}
if (imageName) {
// FIXME: TODO: don't use the images from AVKit
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/AVKit.framework"];
return [UIImage imageNamed:imageName inBundle:bundle compatibleWithTraitCollection:nil];
return [UIImage imageNamed:imageName];
}
return nil;
}
......
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