Browse Source

move layout code for time navigation title view to separate view

Tobias Conradi 10 years ago
parent
commit
2f08666e38

+ 11 - 6
Resources/VLCMovieViewController~ipad.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="iOS"/>
         <development version="5100" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController">
@@ -11,7 +11,6 @@
                 <outlet property="albumNameLabel" destination="305" id="308"/>
                 <outlet property="artistNameLabel" destination="303" id="306"/>
                 <outlet property="artworkImageView" destination="g3j-bZ-K3S" id="fPn-6f-Kez"/>
-                <outlet property="aspectRatioButton" destination="198" id="229"/>
                 <outlet property="audioDelayIndicator" destination="FYO-Rd-Vjg" id="FVE-DI-BJ2"/>
                 <outlet property="audioDelayLabel" destination="bQc-dz-mB8" id="69P-Q3-3l3"/>
                 <outlet property="audioDelaySlider" destination="ahb-li-nqH" id="tQp-Zu-Sqd"/>
@@ -39,7 +38,6 @@
                 <outlet property="playingExternallyDescription" destination="124" id="132"/>
                 <outlet property="playingExternallyTitle" destination="125" id="133"/>
                 <outlet property="playingExternallyView" destination="123" id="131"/>
-                <outlet property="positionSlider" destination="249" id="261"/>
                 <outlet property="resetVideoFilterButton" destination="142" id="175"/>
                 <outlet property="saturationLabel" destination="150" id="166"/>
                 <outlet property="saturationSlider" destination="149" id="168"/>
@@ -50,7 +48,6 @@
                 <outlet property="spuDelayLabel" destination="NX8-Zc-K6Y" id="WLd-cA-fUn"/>
                 <outlet property="spuDelaySlider" destination="juX-HR-PqD" id="x4D-ki-Lwk"/>
                 <outlet property="statusLabel" destination="205" id="206"/>
-                <outlet property="timeDisplay" destination="300" id="302"/>
                 <outlet property="toolbar" destination="256" id="260"/>
                 <outlet property="trackNameLabel" destination="304" id="307"/>
                 <outlet property="trackSwitcherButton" destination="277" id="4wh-dZ-qaR"/>
@@ -66,7 +63,7 @@
                 <action selector="closePlayback:" destination="-1" id="134"/>
             </connections>
         </barButtonItem>
-        <view contentMode="scaleToFill" id="248" userLabel="Time view">
+        <view contentMode="scaleToFill" id="248" userLabel="Time view" customClass="VLCTimeNavigationTitleView">
             <rect key="frame" x="0.0" y="0.0" width="700" height="40"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
             <subviews>
@@ -89,6 +86,8 @@
                     <rect key="frame" x="642" y="6" width="50" height="29"/>
                     <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"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="5" maxY="0.0"/>
                     <state key="normal" image="ratioIcon.png">
                         <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"/>
@@ -104,6 +103,7 @@
                     <rect key="frame" x="571" y="6" width="66" height="30"/>
                     <autoresizingMask key="autoresizingMask" flexibleMinX="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" title="--:--">
                         <color key="titleColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
                         <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
@@ -118,6 +118,11 @@
             </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="positionSlider" destination="249" id="rvZ-Lz-yG8"/>
+                <outlet property="timeDisplayButton" destination="300" id="t3c-hv-XjU"/>
+            </connections>
         </view>
         <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="8">
             <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>

+ 17 - 12
Resources/VLCMovieViewController~iphone.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
     </dependencies>
     <objects>
         <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCMovieViewController">
@@ -10,7 +10,6 @@
                 <outlet property="albumNameLabel" destination="280" id="285"/>
                 <outlet property="artistNameLabel" destination="279" id="283"/>
                 <outlet property="artworkImageView" destination="yK6-Ph-SVE" id="Cm9-7F-iYZ"/>
-                <outlet property="aspectRatioButton" destination="202" id="222"/>
                 <outlet property="audioDelayIndicator" destination="SDv-JW-DMi" id="Krq-0k-T6o"/>
                 <outlet property="audioDelayLabel" destination="8cb-fw-YeF" id="KWQ-n9-3mr"/>
                 <outlet property="audioDelaySlider" destination="oQe-Uu-1HY" id="6Me-OE-Dpl"/>
@@ -43,7 +42,6 @@
                 <outlet property="playingExternallyDescription" destination="109" id="113"/>
                 <outlet property="playingExternallyTitle" destination="110" id="114"/>
                 <outlet property="playingExternallyView" destination="108" id="112"/>
-                <outlet property="positionSlider" destination="262" id="269"/>
                 <outlet property="resetVideoFilterButton" destination="162" id="163"/>
                 <outlet property="saturationLabel" destination="136" id="155"/>
                 <outlet property="saturationSlider" destination="135" id="152"/>
@@ -54,7 +52,7 @@
                 <outlet property="spuDelayLabel" destination="KeW-Xp-9I6" id="LMS-pz-Ajj"/>
                 <outlet property="spuDelaySlider" destination="JRI-0m-C0M" id="f8j-Iq-sH3"/>
                 <outlet property="statusLabel" destination="210" id="211"/>
-                <outlet property="timeDisplay" destination="276" id="277"/>
+                <outlet property="timeNavigationTitleView" destination="260" id="gcy-M6-dw8"/>
                 <outlet property="toolbar" destination="250" id="272"/>
                 <outlet property="trackNameLabel" destination="282" id="284"/>
                 <outlet property="trackSwitcherButton" destination="78" id="GJo-Ha-dd9"/>
@@ -68,7 +66,7 @@
             </connections>
         </placeholder>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
-        <view contentMode="scaleToFill" id="260" userLabel="Time view">
+        <view contentMode="scaleToFill" id="260" userLabel="Time view" customClass="VLCTimeNavigationTitleView">
             <rect key="frame" x="0.0" y="0.0" width="300" height="40"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
             <subviews>
@@ -91,6 +89,7 @@
                     <rect key="frame" x="241" y="6" width="59" height="29"/>
                     <autoresizingMask key="autoresizingMask" flexibleMinX="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="ratioIcon.png">
                         <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"/>
@@ -106,6 +105,7 @@
                     <rect key="frame" x="195" y="7" width="52" height="28"/>
                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
                     <fontDescription key="fontDescription" type="boldSystem" pointSize="13"/>
+                    <inset key="contentEdgeInsets" minX="5" minY="0.0" maxX="5" maxY="0.0"/>
                     <state key="normal" title="--:--">
                         <color key="titleColor" red="0.74659199620000005" green="0.74659199620000005" blue="0.74659199620000005" alpha="1" colorSpace="calibratedRGB"/>
                         <color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
@@ -121,6 +121,11 @@
             <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="positionSlider" destination="262" id="UPM-uz-5Ix"/>
+                <outlet property="timeDisplayButton" destination="276" id="xvv-Ga-gWA"/>
+            </connections>
         </view>
         <barButtonItem systemItem="done" id="85">
             <connections>
@@ -141,7 +146,7 @@
                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                     <color key="textColor" white="0.71999999999999997" alpha="1" colorSpace="calibratedWhite"/>
                     <nil key="highlightedColor"/>
-                    <color key="shadowColor" cocoaTouchSystemColor="darkTextColor"/>
+                    <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                 </label>
                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" text="Track Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" adjustsLetterSpacingToFitWidth="YES" id="282">
                     <rect key="frame" x="31" y="435" width="257" height="28"/>
@@ -149,7 +154,7 @@
                     <fontDescription key="fontDescription" type="system" pointSize="23"/>
                     <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                     <nil key="highlightedColor"/>
-                    <color key="shadowColor" cocoaTouchSystemColor="darkTextColor"/>
+                    <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                 </label>
                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" text="Artist Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" adjustsLetterSpacingToFitWidth="YES" id="279">
                     <rect key="frame" x="31" y="267" width="257" height="28"/>
@@ -157,7 +162,7 @@
                     <fontDescription key="fontDescription" type="system" pointSize="23"/>
                     <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                     <nil key="highlightedColor"/>
-                    <color key="shadowColor" cocoaTouchSystemColor="darkTextColor"/>
+                    <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                 </label>
                 <view contentMode="scaleToFill" id="91" userLabel="Movie view">
                     <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
@@ -172,7 +177,7 @@
                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                     <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
                     <nil key="highlightedColor"/>
-                    <color key="shadowColor" cocoaTouchSystemColor="lightTextColor"/>
+                    <color key="shadowColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="calibratedRGB"/>
                 </label>
                 <view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View">
                     <rect key="frame" x="0.0" y="135" width="320" height="257"/>
@@ -397,8 +402,8 @@
                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                             <fontDescription key="fontDescription" type="system" pointSize="15"/>
                             <state key="normal" title="Sleep Timer">
-                                <color key="titleColor" cocoaTouchSystemColor="lightTextColor"/>
-                                <color key="titleShadowColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
+                                <color key="titleColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="calibratedRGB"/>
+                                <color key="titleShadowColor" red="0.43529411764705883" green="0.44313725490196076" blue="0.47450980392156861" alpha="1" colorSpace="calibratedRGB"/>
                             </state>
                             <connections>
                                 <action selector="sleepTimer:" destination="-1" eventType="touchUpInside" id="3DL-TN-OVO"/>

+ 2 - 3
Sources/VLCMovieViewController.h

@@ -19,13 +19,13 @@
 @class VLCStatusLabel;
 @class VLCHorizontalSwipeGestureRecognizer;
 @class VLCVerticalSwipeGestureRecognizer;
+@class VLCTimeNavigationTitleView;
 
 @interface VLCMovieViewController : UIViewController <UIActionSheetDelegate, VLCPlaybackControllerDelegate>
 
 @property (nonatomic, strong) IBOutlet UIView *movieView;
 @property (nonatomic, strong) IBOutlet UIBarButtonItem *backButton;
-@property (nonatomic, strong) IBOutlet OBSlider *positionSlider;
-@property (nonatomic, strong) IBOutlet UIButton *timeDisplay;
+@property (nonatomic, strong) IBOutlet VLCTimeNavigationTitleView *timeNavigationTitleView;
 @property (nonatomic, strong) IBOutlet UIButton *playPauseButton;
 @property (nonatomic, strong) IBOutlet UIButton *playPauseButtonLandscape;
 @property (nonatomic, strong) IBOutlet UIButton *bwdButton;
@@ -73,7 +73,6 @@
 @property (nonatomic, strong) IBOutlet UISlider *spuDelaySlider;
 @property (nonatomic, strong) IBOutlet UILabel *spuDelayLabel;
 @property (nonatomic, strong) IBOutlet UILabel *spuDelayIndicator;
-@property (nonatomic, strong) IBOutlet UIButton *aspectRatioButton;
 @property (nonatomic, strong) IBOutlet UIButton *moreActionsButton;
 
 @property (nonatomic, strong) IBOutlet VLCFrostedGlasView *scrubIndicatorView;

+ 16 - 56
Sources/VLCMovieViewController.m

@@ -28,8 +28,8 @@
 #import "VLCMultiSelectionMenuView.h"
 #import "VLCPlaybackController.h"
 #import "UIDevice+VLC.h"
+#import "VLCTimeNavigationTitleView.h"
 
-#import "OBSlider.h"
 #import "VLCStatusLabel.h"
 
 #define INPUT_RATE_DEFAULT  1000.
@@ -171,10 +171,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
     _spuDelaySlider.accessibilityLabel = _spuDelayLabel.text;
     _spuDelaySlider.isAccessibilityElement = YES;
 
-    _positionSlider.accessibilityLabel = NSLocalizedString(@"PLAYBACK_POSITION", nil);
-    _positionSlider.isAccessibilityElement = YES;
-    _timeDisplay.isAccessibilityElement = YES;
-
     _trackSwitcherButton.accessibilityLabel = NSLocalizedString(@"OPEN_TRACK_PANEL", nil);
     _trackSwitcherButton.isAccessibilityElement = YES;
     _trackSwitcherButtonLandscape.accessibilityLabel = NSLocalizedString(@"OPEN_TRACK_PANEL", nil);
@@ -189,8 +185,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
     _videoFilterButtonLandscape.isAccessibilityElement = YES;
     _resetVideoFilterButton.accessibilityLabel = NSLocalizedString(@"VIDEO_FILTER_RESET_BUTTON", nil);
     _resetVideoFilterButton.isAccessibilityElement = YES;
-    _aspectRatioButton.accessibilityLabel = NSLocalizedString(@"VIDEO_ASPECT_RATIO_BUTTON", nil);
-    _aspectRatioButton.isAccessibilityElement = YES;
     _playPauseButton.accessibilityLabel = NSLocalizedString(@"PLAY_PAUSE_BUTTON", nil);
     _playPauseButton.isAccessibilityElement = YES;
     _playPauseButtonLandscape.accessibilityLabel = NSLocalizedString(@"PLAY_PAUSE_BUTTON", nil);
@@ -284,7 +278,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
     _swipeRecognizerDown.delegate = self;
     _tapRecognizer.delegate = self;
 
-    [self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal];
     if (SYSTEM_RUNS_IOS7_OR_LATER) {
         self.backButton.tintColor = [UIColor colorWithRed:(190.0f/255.0f) green:(190.0f/255.0f) blue:(190.0f/255.0f) alpha:1.];
         self.toolbar.tintColor = [UIColor whiteColor];
@@ -297,22 +290,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
         rect.size.height = rect.size.height + rect.origin.y;
         rect.origin.y = 0;
         self.toolbar.frame = rect;
-        rect = self.aspectRatioButton.frame;
-        rect.size.width -= 19.;
-        rect.origin.x += 19.;
-        self.aspectRatioButton.frame = rect;
-        rect = self.timeDisplay.frame;
-        rect.origin.x += 19.;
-        self.timeDisplay.frame = rect;
-        rect = self.positionSlider.frame;
-        rect.size.width += 19.;
-        self.positionSlider.frame = rect;
     } else {
-        rect = self.positionSlider.frame;
-        rect.origin.y = rect.origin.y + 3.;
-        self.positionSlider.frame = rect;
-        [self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButton"] forState:UIControlStateNormal];
-        [self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButtonHighlight"] forState:UIControlStateHighlighted];
         [self.toolbar setBackgroundImage:[UIImage imageNamed:@"seekbarBg"] forBarMetrics:UIBarMetricsDefault];
         [self.backButton setBackgroundImage:[UIImage imageNamed:@"playbackDoneButton"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
         [self.backButton setBackgroundImage:[UIImage imageNamed:@"playbackDoneButtonHighlight"] forState:UIControlStateHighlighted barMetrics:UIBarMetricsDefault];
@@ -342,9 +320,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
     initVolumeSlider(self.volumeView);
     initVolumeSlider(self.volumeViewLandscape);
 
-    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        self.positionSlider.scrubbingSpeedChangePositions = @[@(0.), @(100.), @(200.), @(300)];
-
     _playerIsSetup = NO;
 
     [self.movieView setAccessibilityLabel:NSLocalizedString(@"VO_VIDEOPLAYER_TITLE", nil)];
@@ -698,9 +673,9 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
      * within the Simulator, but especially on older ARMv7 devices, it's clearly noticeable. */
     [self performSelector:@selector(_setPositionForReal) withObject:nil afterDelay:0.3];
     if (_mediaDuration > 0) {
-        VLCTime *newPosition = [VLCTime timeWithInt:(int)(_positionSlider.value * _mediaDuration)];
-        [self.timeDisplay setTitle:newPosition.stringValue forState:UIControlStateNormal];
-        self.timeDisplay.accessibilityLabel = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"PLAYBACK_POSITION", nil), newPosition.stringValue];
+        VLCTime *newPosition = [VLCTime timeWithInt:(int)(sender.value * _mediaDuration)];
+        [self.timeNavigationTitleView.timeDisplayButton setTitle:newPosition.stringValue forState:UIControlStateNormal];
+        self.timeNavigationTitleView.timeDisplayButton.accessibilityLabel = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"PLAYBACK_POSITION", nil), newPosition.stringValue];
         _positionSet = NO;
     }
     [self _resetIdleTimer];
@@ -709,7 +684,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
 - (void)_setPositionForReal
 {
     if (!_positionSet) {
-        [VLCPlaybackController sharedInstance].mediaPlayer.position = _positionSlider.value;
+        [VLCPlaybackController sharedInstance].mediaPlayer.position = self.timeNavigationTitleView.positionSlider.value;
         _positionSet = YES;
     }
 }
@@ -733,7 +708,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
 
 - (void)_updateScrubLabel
 {
-    float speed = self.positionSlider.scrubbingSpeed;
+    float speed = self.timeNavigationTitleView.positionSlider.scrubbingSpeed;
     if (speed == 1.)
         self.currentScrubSpeedLabel.text = NSLocalizedString(@"PLAYBACK_SCRUB_HIGH", nil);
     else if (speed == .5)
@@ -766,21 +741,21 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
 {
     VLCMediaPlayer *mediaPlayer = controller.mediaPlayer;
     if (!_isScrubbing) {
-        self.positionSlider.value = [mediaPlayer position];
+        self.timeNavigationTitleView.positionSlider.value = [mediaPlayer position];
     }
 
     if (_displayRemainingTime)
-        [self.timeDisplay setTitle:[[mediaPlayer remainingTime] stringValue] forState:UIControlStateNormal];
+        [self.timeNavigationTitleView.timeDisplayButton setTitle:[[mediaPlayer remainingTime] stringValue] forState:UIControlStateNormal];
     else
-        [self.timeDisplay setTitle:[[mediaPlayer time] stringValue] forState:UIControlStateNormal];
+        [self.timeNavigationTitleView.timeDisplayButton setTitle:[[mediaPlayer time] stringValue] forState:UIControlStateNormal];
 }
 
 - (void)prepareForMediaPlayback:(VLCPlaybackController *)controller
 {
     self.trackNameLabel.text = self.artistNameLabel.text = self.albumNameLabel.text = @"";
-    self.positionSlider.value = 0.;
-    [self.timeDisplay setTitle:@"" forState:UIControlStateNormal];
-    self.timeDisplay.accessibilityLabel = @"";
+    self.timeNavigationTitleView.positionSlider.value = 0.;
+    [self.timeNavigationTitleView.timeDisplayButton setTitle:@"" forState:UIControlStateNormal];
+    self.timeNavigationTitleView.timeDisplayButton.accessibilityLabel = @"";
     if (![[UIDevice currentDevice] hasExternalDisplay])
         self.brightnessSlider.value = [UIScreen mainScreen].brightness * 2.;
     [_equalizerView reloadData];
@@ -865,24 +840,9 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
     } else
         self.artistNameLabel.text = self.albumNameLabel.text = nil;
 
-    BOOL aspectButtonHidden = self.aspectRatioButton.hidden;
-    if (audioOnly && !aspectButtonHidden) {
-        CGRect rect = self.timeDisplay.frame;
-        rect.origin.x += self.aspectRatioButton.frame.size.width;
-        self.timeDisplay.frame = rect;
-        rect = self.positionSlider.frame;
-        rect.size.width += self.aspectRatioButton.frame.size.width;
-        self.positionSlider.frame = rect;
-    } else if (aspectButtonHidden) {
-        CGRect rect = self.timeDisplay.frame;
-        rect.origin.x -= self.aspectRatioButton.frame.size.width;
-        self.timeDisplay.frame = rect;
-        rect = self.positionSlider.frame;
-        rect.size.width -= self.aspectRatioButton.frame.size.width;
-        self.positionSlider.frame = rect;
-    }
-    self.positionSlider.hidden = NO;
-    self.aspectRatioButton.hidden = audioOnly;
+    self.timeNavigationTitleView.hideAspectRatio = audioOnly;
+    self.timeNavigationTitleView.positionSlider.hidden = NO;
+
     self.videoFilterButton.hidden = audioOnly;
 }
 
@@ -1517,7 +1477,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
         self.playbackSpeedView.hidden = !_playbackSpeedViewHidden;
         _playbackSpeedViewHidden = self.playbackSpeedView.hidden;
         [self _resetIdleTimer];
-    } else if (sender == self.aspectRatioButton) {
+    } else if (sender == self.timeNavigationTitleView.aspectRatioButton) {
         [[VLCPlaybackController sharedInstance] switchAspectRatio];
     }
 }

+ 3 - 0
Sources/VLCSlider.m

@@ -16,6 +16,9 @@
 
 - (void)awakeFromNib
 {
+    self.accessibilityLabel = NSLocalizedString(@"PLAYBACK_POSITION", nil);
+    self.isAccessibilityElement = YES;
+
     if (SYSTEM_RUNS_IOS7_OR_LATER)
         [self setThumbImage:[UIImage imageNamed:@"modernSliderKnob"] forState:UIControlStateNormal];
     else {

+ 23 - 0
Sources/VLCTimeNavigationTitleView.h

@@ -0,0 +1,23 @@
+/*****************************************************************************
+ * VLCTimeNavigationTitleView.h
+ * VLC for iOS
+ *****************************************************************************
+ * Copyright (c) 2015 VideoLAN. All rights reserved.
+ * $Id$
+ *
+ * Author: Tobias Conradi <videolan # tobias-conradi.de>
+ *
+ * Refer to the COPYING file of the official project for license.
+ *****************************************************************************/
+
+#import <UIKit/UIKit.h>
+
+@class VLCOBSlider;
+
+@interface VLCTimeNavigationTitleView : UIView
+@property (weak, nonatomic) IBOutlet VLCOBSlider *positionSlider;
+@property (weak, nonatomic) IBOutlet UIButton *timeDisplayButton;
+@property (weak, nonatomic) IBOutlet UIButton *aspectRatioButton;
+
+@property (nonatomic) BOOL hideAspectRatio;
+@end

+ 66 - 0
Sources/VLCTimeNavigationTitleView.m

@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * VLCTimeNavigationTitleView.m
+ * VLC for iOS
+ *****************************************************************************
+ * Copyright (c) 2015 VideoLAN. All rights reserved.
+ * $Id$
+ *
+ * Author: Tobias Conradi <videolan # tobias-conradi.de>
+ *
+ * Refer to the COPYING file of the official project for license.
+ *****************************************************************************/
+
+
+#import "VLCTimeNavigationTitleView.h"
+#import "VLCSlider.h"
+
+@implementation VLCTimeNavigationTitleView
+
+-(void)awakeFromNib {
+
+    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
+        self.positionSlider.scrubbingSpeedChangePositions = @[@(0.), @(100.), @(200.), @(300)];
+
+    self.timeDisplayButton.isAccessibilityElement = YES;
+
+    self.aspectRatioButton.accessibilityLabel = NSLocalizedString(@"VIDEO_ASPECT_RATIO_BUTTON", nil);
+    self.aspectRatioButton.isAccessibilityElement = YES;
+
+    if (SYSTEM_RUNS_IOS7_OR_LATER) {
+        [self.aspectRatioButton setImage:[UIImage imageNamed:@"ratioIcon"] forState:UIControlStateNormal];
+    } else {
+        [self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButton"] forState:UIControlStateNormal];
+        [self.aspectRatioButton setBackgroundImage:[UIImage imageNamed:@"ratioButtonHighlight"] forState:UIControlStateHighlighted];
+    }
+
+    [self setNeedsLayout];
+}
+
+- (void)layoutSubviews
+{
+    [super layoutSubviews];
+
+    CGRect remainder = self.bounds;
+    CGRect slice;
+    if (!self.aspectRatioButton.hidden) {
+        [self.aspectRatioButton sizeToFit];
+        CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.aspectRatioButton.frame), CGRectMaxXEdge);
+        self.aspectRatioButton.frame = slice;
+    }
+
+    [self.timeDisplayButton sizeToFit];
+    CGRectDivide(remainder, &slice, &remainder, CGRectGetWidth(self.timeDisplayButton.frame), CGRectMaxXEdge);
+    self.timeDisplayButton.frame = slice;
+
+    self.positionSlider.frame = remainder;
+}
+
+- (void)setHideAspectRatio:(BOOL)hideAspectRatio
+{
+    _hideAspectRatio = hideAspectRatio;
+    self.aspectRatioButton.hidden = hideAspectRatio;
+    [self setNeedsLayout];
+}
+
+
+@end

+ 6 - 0
VLC for iOS.xcodeproj/project.pbxproj

@@ -553,6 +553,7 @@
 		DD1542121ACFF76400AFD4EC /* VLCWatchTableController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1542111ACFF76400AFD4EC /* VLCWatchTableController.m */; };
 		DD6FA7B01ACD641C006DEB2E /* VLCNowPlayingInterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6FA7AF1ACD641C006DEB2E /* VLCNowPlayingInterfaceController.m */; };
 		DDACEB561ADAD11300735484 /* WKInterfaceObject+VLCProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = DDACEB551ADAD11300735484 /* WKInterfaceObject+VLCProgress.m */; };
+		DDC10BE41AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = DDC10BE31AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m */; };
 		DDE4906C1ACDB63F00B1B5E3 /* VLCNotificationRelay.m in Sources */ = {isa = PBXBuildFile; fileRef = DDE4906B1ACDB63F00B1B5E3 /* VLCNotificationRelay.m */; };
 		DDE4906D1ACDBEA000B1B5E3 /* VLCNotificationRelay.m in Sources */ = {isa = PBXBuildFile; fileRef = DDE4906B1ACDB63F00B1B5E3 /* VLCNotificationRelay.m */; };
 		DDE490701ACE8BBC00B1B5E3 /* VLCDetailInterfaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = DDE4906F1ACE8BBC00B1B5E3 /* VLCDetailInterfaceController.m */; };
@@ -1618,6 +1619,8 @@
 		DD6FA7AF1ACD641C006DEB2E /* VLCNowPlayingInterfaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCNowPlayingInterfaceController.m; sourceTree = "<group>"; };
 		DDACEB541ADAD11300735484 /* WKInterfaceObject+VLCProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKInterfaceObject+VLCProgress.h"; sourceTree = "<group>"; };
 		DDACEB551ADAD11300735484 /* WKInterfaceObject+VLCProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKInterfaceObject+VLCProgress.m"; sourceTree = "<group>"; };
+		DDC10BE21AEE8EA700890DC3 /* VLCTimeNavigationTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCTimeNavigationTitleView.h; path = Sources/VLCTimeNavigationTitleView.h; sourceTree = SOURCE_ROOT; };
+		DDC10BE31AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCTimeNavigationTitleView.m; path = Sources/VLCTimeNavigationTitleView.m; sourceTree = SOURCE_ROOT; };
 		DDE4906A1ACDB63F00B1B5E3 /* VLCNotificationRelay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCNotificationRelay.h; sourceTree = "<group>"; };
 		DDE4906B1ACDB63F00B1B5E3 /* VLCNotificationRelay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCNotificationRelay.m; sourceTree = "<group>"; };
 		DDE4906E1ACE8BBC00B1B5E3 /* VLCDetailInterfaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCDetailInterfaceController.h; sourceTree = "<group>"; };
@@ -2122,6 +2125,8 @@
 				7D50903118F41C7900180139 /* VLCAlertView.m */,
 				7D9CB9DA1A4C55EF00BB74B4 /* VLCPlaybackNavigationController.h */,
 				7D9CB9DB1A4C55EF00BB74B4 /* VLCPlaybackNavigationController.m */,
+				DDC10BE21AEE8EA700890DC3 /* VLCTimeNavigationTitleView.h */,
+				DDC10BE31AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m */,
 			);
 			name = "UI Elements";
 			sourceTree = "<group>";
@@ -3671,6 +3676,7 @@
 				2915543C17490B9C00B86CAD /* HTTPDataResponse.m in Sources */,
 				2915543D17490B9C00B86CAD /* HTTPDynamicFileResponse.m in Sources */,
 				9BADAF45185FBD9D00108BD8 /* VLCFrostedGlasView.m in Sources */,
+				DDC10BE41AEE8EA700890DC3 /* VLCTimeNavigationTitleView.m in Sources */,
 				2915543E17490B9C00B86CAD /* HTTPErrorResponse.m in Sources */,
 				E0C04F951A25B4410080331A /* VLCDocumentPickerController.m in Sources */,
 				2915543F17490B9C00B86CAD /* HTTPFileResponse.m in Sources */,