Commit 9b1a4ef2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

fullscreen playback: add minimize button so clicking 'Done' actually stops playback again

(cherry picked from commit cbe45bc1)
parent e1c6db8b
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="7706" systemVersion="14E26a" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<development version="5100" identifier="xcode"/> <development version="5100" identifier="xcode"/>
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" id="249" userLabel="Position Slider" customClass="VLCOBSlider"> <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" id="249" userLabel="Position Slider" customClass="VLCOBSlider">
<rect key="frame" x="7" y="6" width="562" height="29"/> <rect key="frame" x="60" y="6" width="509" height="29"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration"> <accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/> <accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/>
...@@ -115,11 +115,28 @@ ...@@ -115,11 +115,28 @@
<action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="301"/> <action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="301"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Fcw-5o-IdE">
<rect key="frame" x="10" y="11" width="30" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<inset key="contentEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" image="minimizePlayback">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="minimizePlayback:" destination="-1" eventType="touchUpInside" id="jj8-Gc-Fqn"/>
</connections>
</button>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections> <connections>
<outlet property="aspectRatioButton" destination="198" id="4dl-xe-M16"/> <outlet property="aspectRatioButton" destination="198" id="4dl-xe-M16"/>
<outlet property="minimizePlaybackButton" destination="Fcw-5o-IdE" id="s26-45-f9b"/>
<outlet property="positionSlider" destination="249" id="rvZ-Lz-yG8"/> <outlet property="positionSlider" destination="249" id="rvZ-Lz-yG8"/>
<outlet property="timeDisplayButton" destination="300" id="t3c-hv-XjU"/> <outlet property="timeDisplayButton" destination="300" id="t3c-hv-XjU"/>
</connections> </connections>
...@@ -573,6 +590,7 @@ ...@@ -573,6 +590,7 @@
<image name="audioTrackIcon.png" width="19" height="19"/> <image name="audioTrackIcon.png" width="19" height="19"/>
<image name="backIcon.png" width="32" height="16"/> <image name="backIcon.png" width="32" height="16"/>
<image name="forwardIcon.png" width="32" height="16"/> <image name="forwardIcon.png" width="32" height="16"/>
<image name="minimizePlayback" width="18" height="10"/>
<image name="playIcon.png" width="19" height="17"/> <image name="playIcon.png" width="19" height="17"/>
<image name="ratioIcon.png" width="15" height="15"/> <image name="ratioIcon.png" width="15" height="15"/>
<image name="resetIcon.png" width="24" height="30"/> <image name="resetIcon.png" width="24" height="30"/>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E26a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" id="262" userLabel="Position Slider" customClass="VLCOBSlider"> <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" id="262" userLabel="Position Slider" customClass="VLCOBSlider">
<rect key="frame" x="2" y="7" width="190" height="29"/> <rect key="frame" x="44" y="7" width="148" height="29"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration"> <accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/> <accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/>
...@@ -117,12 +117,29 @@ ...@@ -117,12 +117,29 @@
<action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="278"/> <action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="278"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="1XT-gb-oGz">
<rect key="frame" x="8" y="11" width="30" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<inset key="contentEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/>
<state key="normal" image="minimizePlayback">
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="minimizePlayback:" destination="-1" eventType="touchUpInside" id="LBk-8c-yjG"/>
</connections>
</button>
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/> <nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections> <connections>
<outlet property="aspectRatioButton" destination="202" id="IWW-5X-Bf0"/> <outlet property="aspectRatioButton" destination="202" id="IWW-5X-Bf0"/>
<outlet property="minimizePlaybackButton" destination="1XT-gb-oGz" id="BAx-Rb-ayD"/>
<outlet property="positionSlider" destination="262" id="UPM-uz-5Ix"/> <outlet property="positionSlider" destination="262" id="UPM-uz-5Ix"/>
<outlet property="timeDisplayButton" destination="276" id="xvv-Ga-gWA"/> <outlet property="timeDisplayButton" destination="276" id="xvv-Ga-gWA"/>
</connections> </connections>
...@@ -725,6 +742,7 @@ ...@@ -725,6 +742,7 @@
<image name="audioTrackIcon.png" width="19" height="19"/> <image name="audioTrackIcon.png" width="19" height="19"/>
<image name="backIcon.png" width="32" height="16"/> <image name="backIcon.png" width="32" height="16"/>
<image name="forwardIcon.png" width="32" height="16"/> <image name="forwardIcon.png" width="32" height="16"/>
<image name="minimizePlayback" width="18" height="10"/>
<image name="playIcon.png" width="19" height="17"/> <image name="playIcon.png" width="19" height="17"/>
<image name="ratioIcon.png" width="15" height="15"/> <image name="ratioIcon.png" width="15" height="15"/>
<image name="resetIcon.png" width="24" height="30"/> <image name="resetIcon.png" width="24" height="30"/>
......
...@@ -87,6 +87,7 @@ ...@@ -87,6 +87,7 @@
@property (nonatomic, weak) IBOutlet VLCPlaybackController *playbackController; @property (nonatomic, weak) IBOutlet VLCPlaybackController *playbackController;
- (IBAction)closePlayback:(id)sender; - (IBAction)closePlayback:(id)sender;
- (IBAction)minimizePlayback:(id)sender;
- (IBAction)positionSliderAction:(id)sender; - (IBAction)positionSliderAction:(id)sender;
- (IBAction)positionSliderTouchDown:(id)sender; - (IBAction)positionSliderTouchDown:(id)sender;
......
...@@ -535,7 +535,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -535,7 +535,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
return; return;
if (recognizer.velocity < 0.) if (recognizer.velocity < 0.)
[self closePlayback:nil]; [self minimizePlayback:nil];
} }
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
...@@ -684,9 +684,15 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -684,9 +684,15 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (IBAction)closePlayback:(id)sender - (IBAction)closePlayback:(id)sender
{ {
LOCKCHECK; LOCKCHECK;
[[UIApplication sharedApplication] sendAction:@selector(closeFullscreenPlayback) to:nil from:self forEvent:nil]; [[VLCPlaybackController sharedInstance] stopPlayback];
}
- (IBAction)minimizePlayback:(id)sender
{
LOCKCHECK;
[[UIApplication sharedApplication] sendAction:@selector(closeFullscreenPlayback) to:nil from:self forEvent:nil];
} }
- (IBAction)positionSliderAction:(UISlider *)sender - (IBAction)positionSliderAction:(UISlider *)sender
{ {
LOCKCHECK; LOCKCHECK;
...@@ -840,7 +846,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -840,7 +846,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)playbackDidStop:(NSNotification *)notification - (void)playbackDidStop:(NSNotification *)notification
{ {
[self closePlayback:nil]; [self minimizePlayback:nil];
} }
- (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState - (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
@class VLCOBSlider; @class VLCOBSlider;
@interface VLCTimeNavigationTitleView : UIView @interface VLCTimeNavigationTitleView : UIView
@property (weak, nonatomic) IBOutlet UIButton *minimizePlaybackButton;
@property (weak, nonatomic) IBOutlet VLCOBSlider *positionSlider; @property (weak, nonatomic) IBOutlet VLCOBSlider *positionSlider;
@property (weak, nonatomic) IBOutlet UIButton *timeDisplayButton; @property (weak, nonatomic) IBOutlet UIButton *timeDisplayButton;
@property (weak, nonatomic) IBOutlet UIButton *aspectRatioButton; @property (weak, nonatomic) IBOutlet UIButton *aspectRatioButton;
......
...@@ -25,8 +25,12 @@ ...@@ -25,8 +25,12 @@
self.aspectRatioButton.accessibilityLabel = NSLocalizedString(@"VIDEO_ASPECT_RATIO_BUTTON", nil); self.aspectRatioButton.accessibilityLabel = NSLocalizedString(@"VIDEO_ASPECT_RATIO_BUTTON", nil);
self.aspectRatioButton.isAccessibilityElement = YES; self.aspectRatioButton.isAccessibilityElement = YES;
[self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal]; [self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal];
self.minimizePlaybackButton.accessibilityLabel = NSLocalizedString(@"MINIMIZE_PLAYBACK_VIEW", nil);
self.minimizePlaybackButton.isAccessibilityElement = YES;
[self setNeedsLayout]; [self setNeedsLayout];
} }
...@@ -36,6 +40,10 @@ ...@@ -36,6 +40,10 @@
CGRect remainder = self.bounds; CGRect remainder = self.bounds;
CGRect slice; CGRect slice;
CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.minimizePlaybackButton.frame), CGRectMinXEdge);
self.minimizePlaybackButton.frame = slice;
if (!self.aspectRatioButton.hidden) { if (!self.aspectRatioButton.hidden) {
[self.aspectRatioButton sizeToFit]; [self.aspectRatioButton sizeToFit];
CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.aspectRatioButton.frame), CGRectMaxXEdge); CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.aspectRatioButton.frame), CGRectMaxXEdge);
......
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