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"?>
<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>
<deployment identifier="iOS"/>
<development version="5100" identifier="xcode"/>
......@@ -69,7 +69,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<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">
<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"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/>
......@@ -115,11 +115,28 @@
<action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="301"/>
</connections>
</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>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<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="timeDisplayButton" destination="300" id="t3c-hv-XjU"/>
</connections>
......@@ -573,6 +590,7 @@
<image name="audioTrackIcon.png" width="19" height="19"/>
<image name="backIcon.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="ratioIcon.png" width="15" height="15"/>
<image name="resetIcon.png" width="24" height="30"/>
......
<?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>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
......@@ -71,7 +71,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<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">
<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"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" none="YES" updatesFrequently="YES"/>
......@@ -117,12 +117,29 @@
<action selector="toggleTimeDisplay:" destination="-1" eventType="touchUpInside" id="278"/>
</connections>
</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>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<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="timeDisplayButton" destination="276" id="xvv-Ga-gWA"/>
</connections>
......@@ -725,6 +742,7 @@
<image name="audioTrackIcon.png" width="19" height="19"/>
<image name="backIcon.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="ratioIcon.png" width="15" height="15"/>
<image name="resetIcon.png" width="24" height="30"/>
......
......@@ -87,6 +87,7 @@
@property (nonatomic, weak) IBOutlet VLCPlaybackController *playbackController;
- (IBAction)closePlayback:(id)sender;
- (IBAction)minimizePlayback:(id)sender;
- (IBAction)positionSliderAction:(id)sender;
- (IBAction)positionSliderTouchDown:(id)sender;
......
......@@ -535,7 +535,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
return;
if (recognizer.velocity < 0.)
[self closePlayback:nil];
[self minimizePlayback:nil];
}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
......@@ -684,9 +684,15 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (IBAction)closePlayback:(id)sender
{
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
{
LOCKCHECK;
......@@ -840,7 +846,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (void)playbackDidStop:(NSNotification *)notification
{
[self closePlayback:nil];
[self minimizePlayback:nil];
}
- (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
......
......@@ -15,6 +15,7 @@
@class VLCOBSlider;
@interface VLCTimeNavigationTitleView : UIView
@property (weak, nonatomic) IBOutlet UIButton *minimizePlaybackButton;
@property (weak, nonatomic) IBOutlet VLCOBSlider *positionSlider;
@property (weak, nonatomic) IBOutlet UIButton *timeDisplayButton;
@property (weak, nonatomic) IBOutlet UIButton *aspectRatioButton;
......
......@@ -25,8 +25,12 @@
self.aspectRatioButton.accessibilityLabel = NSLocalizedString(@"VIDEO_ASPECT_RATIO_BUTTON", nil);
self.aspectRatioButton.isAccessibilityElement = YES;
[self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal];
self.minimizePlaybackButton.accessibilityLabel = NSLocalizedString(@"MINIMIZE_PLAYBACK_VIEW", nil);
self.minimizePlaybackButton.isAccessibilityElement = YES;
[self setNeedsLayout];
}
......@@ -36,6 +40,10 @@
CGRect remainder = self.bounds;
CGRect slice;
CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.minimizePlaybackButton.frame), CGRectMinXEdge);
self.minimizePlaybackButton.frame = slice;
if (!self.aspectRatioButton.hidden) {
[self.aspectRatioButton sizeToFit];
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