Commit d57be5a9 authored by Carola Nitz's avatar Carola Nitz

External playback: fix display of playing externally View

Refactor some code of chromecast and external displays
parent 35b39ff0
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
<outlet property="playbackSpeedLabel" destination="181" id="194"/> <outlet property="playbackSpeedLabel" destination="181" id="194"/>
<outlet property="playbackSpeedSlider" destination="180" id="191"/> <outlet property="playbackSpeedSlider" destination="180" id="191"/>
<outlet property="playbackSpeedView" destination="176" id="197"/> <outlet property="playbackSpeedView" destination="176" id="197"/>
<outlet property="playingExternallyDescription" destination="124" id="132"/> <outlet property="playingExternalView" destination="123" id="BVQ-JJ-Ckd"/>
<outlet property="playingExternallyTitle" destination="125" id="133"/>
<outlet property="playingExternallyView" destination="123" id="131"/>
<outlet property="resetVideoFilterButton" destination="142" id="175"/> <outlet property="resetVideoFilterButton" destination="142" id="175"/>
<outlet property="saturationLabel" destination="150" id="166"/> <outlet property="saturationLabel" destination="150" id="166"/>
<outlet property="saturationSlider" destination="149" id="168"/> <outlet property="saturationSlider" destination="149" id="168"/>
...@@ -209,7 +207,7 @@ ...@@ -209,7 +207,7 @@
</button> </button>
</subviews> </subviews>
</view> </view>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="123" userLabel="Playing Externally View"> <view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="123" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target">
<rect key="frame" x="184" y="312" width="400" height="400"/> <rect key="frame" x="184" y="312" width="400" height="400"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
...@@ -217,16 +215,16 @@ ...@@ -217,16 +215,16 @@
<rect key="frame" x="51" y="0.0" width="298" height="266"/> <rect key="frame" x="51" y="0.0" width="298" height="266"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="TV Connected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="125"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" text="TV Connected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="125">
<rect key="frame" x="51" y="274" width="298" height="21"/> <rect key="frame" x="10" y="274" width="380" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="This video is playing on the TV" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="124"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" text="This video is playing on the TV" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="124">
<rect key="frame" x="51" y="303" width="298" height="53"/> <rect key="frame" x="10" y="303" width="380" height="53"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
...@@ -235,6 +233,10 @@ ...@@ -235,6 +233,10 @@
</label> </label>
</subviews> </subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="playingExternallyDescription" destination="124" id="Z9R-mg-THz"/>
<outlet property="playingExternallyTitle" destination="125" id="mLx-iH-3bI"/>
</connections>
</view> </view>
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Status Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="205" customClass="VLCStatusLabel"> <label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Status Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="205" customClass="VLCStatusLabel">
<rect key="frame" x="224" y="799" width="320" height="21"/> <rect key="frame" x="224" y="799" width="320" height="21"/>
...@@ -340,7 +342,7 @@ ...@@ -340,7 +342,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="PlayingExternally.png" width="261" height="195"/> <image name="PlayingExternally.png" width="16" height="16"/>
<image name="resetIcon.png" width="24" height="30"/> <image name="resetIcon.png" width="24" height="30"/>
</resources> </resources>
</document> </document>
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
<outlet property="playbackSpeedLabel" destination="167" id="198"/> <outlet property="playbackSpeedLabel" destination="167" id="198"/>
<outlet property="playbackSpeedSlider" destination="168" id="M6M-8F-t8T"/> <outlet property="playbackSpeedSlider" destination="168" id="M6M-8F-t8T"/>
<outlet property="playbackSpeedView" destination="165" id="208"/> <outlet property="playbackSpeedView" destination="165" id="208"/>
<outlet property="playingExternallyDescription" destination="109" id="113"/> <outlet property="playingExternalView" destination="108" id="xbW-U2-ESN"/>
<outlet property="playingExternallyTitle" destination="110" id="114"/>
<outlet property="playingExternallyView" destination="108" id="112"/>
<outlet property="resetVideoFilterButton" destination="162" id="163"/> <outlet property="resetVideoFilterButton" destination="162" id="163"/>
<outlet property="saturationLabel" destination="136" id="155"/> <outlet property="saturationLabel" destination="136" id="155"/>
<outlet property="saturationSlider" destination="135" id="152"/> <outlet property="saturationSlider" destination="135" id="152"/>
...@@ -51,15 +49,15 @@ ...@@ -51,15 +49,15 @@
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="1"> <view contentMode="scaleToFill" id="1">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="yK6-Ph-SVE"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="yK6-Ph-SVE">
<rect key="frame" x="40" y="164" width="240" height="240"/> <rect key="frame" x="68" y="214" width="240" height="240"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Album Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsLetterSpacingToFitWidth="YES" id="280"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Album Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" adjustsLetterSpacingToFitWidth="YES" id="280">
<rect key="frame" x="31" y="336" width="258" height="28"/> <rect key="frame" x="31" y="397" width="313" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.72000002861022949" green="0.72000002861022949" blue="0.72000002861022949" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.72000002861022949" green="0.72000002861022949" blue="0.72000002861022949" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -67,14 +65,14 @@ ...@@ -67,14 +65,14 @@
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label> </label>
<view contentMode="scaleToFill" id="91" userLabel="Movie view"> <view contentMode="scaleToFill" id="91" userLabel="Movie view">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration"> <accessibility key="accessibilityConfiguration">
<bool key="isElement" value="YES"/> <bool key="isElement" value="YES"/>
</accessibility> </accessibility>
</view> </view>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" misplaced="YES" text="Track Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" adjustsLetterSpacingToFitWidth="YES" id="282"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" misplaced="YES" text="Track Name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="12" adjustsLetterSpacingToFitWidth="YES" id="282">
<rect key="frame" x="31" y="415" width="257" height="28"/> <rect key="frame" x="31" y="491" width="312" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="23"/> <fontDescription key="fontDescription" type="system" pointSize="23"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -82,7 +80,7 @@ ...@@ -82,7 +80,7 @@
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label> </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"> <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"/> <rect key="frame" x="31" y="316" width="312" height="28"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="23"/> <fontDescription key="fontDescription" type="system" pointSize="23"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -90,31 +88,31 @@ ...@@ -90,31 +88,31 @@
<color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="shadowColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</label> </label>
<label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Status Label" textAlignment="center" lineBreakMode="tailTruncation" minimumScaleFactor="0.5" id="210" customClass="VLCStatusLabel"> <label hidden="YES" opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Status Label" textAlignment="center" lineBreakMode="tailTruncation" minimumScaleFactor="0.5" id="210" customClass="VLCStatusLabel">
<rect key="frame" x="61" y="273" width="199" height="22"/> <rect key="frame" x="89" y="323" width="199" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
<color key="shadowColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/> <color key="shadowColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
</label> </label>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View"> <view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target">
<rect key="frame" x="0.0" y="135" width="320" height="257"/> <rect key="frame" x="28" y="178" width="320" height="257"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="PlayingExternally.png" id="111"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" image="PlayingExternally.png" id="111">
<rect key="frame" x="80" y="20" width="160" height="130"/> <rect key="frame" x="80" y="20" width="160" height="130"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="TV Connected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="110"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" text="TV Connected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="110">
<rect key="frame" x="20" y="170" width="280" height="21"/> <rect key="frame" x="10" y="170" width="300" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/> <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="This video is playing on the TV" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="109"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" text="This video is playing on the TV" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="109">
<rect key="frame" x="20" y="199" width="289" height="53"/> <rect key="frame" x="10" y="199" width="300" height="53"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/> <fontDescription key="fontDescription" type="system" pointSize="16"/>
...@@ -123,20 +121,24 @@ ...@@ -123,20 +121,24 @@
</label> </label>
</subviews> </subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<outlet property="playingExternallyDescription" destination="109" id="fXx-Nb-GGd"/>
<outlet property="playingExternallyTitle" destination="110" id="7Bd-9p-QXk"/>
</connections>
</view> </view>
<view hidden="YES" contentMode="scaleToFill" id="241" userLabel="scrubbing indicator view" customClass="VLCFrostedGlasView"> <view hidden="YES" contentMode="scaleToFill" id="241" userLabel="scrubbing indicator view" customClass="VLCFrostedGlasView">
<rect key="frame" x="0.0" y="63" width="320" height="46"/> <rect key="frame" x="0.0" y="63" width="375" height="46"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<subviews> <subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="High-Speed Scrubbing" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="244"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="High-Speed Scrubbing" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="244">
<rect key="frame" x="20" y="3" width="280" height="21"/> <rect key="frame" x="20" y="3" width="335" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Slide your finger down to adjust the scrubbing rate." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" id="246"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Slide your finger down to adjust the scrubbing rate." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsLetterSpacingToFitWidth="YES" adjustsFontSizeToFit="NO" id="246">
<rect key="frame" x="0.0" y="21" width="320" height="21"/> <rect key="frame" x="0.0" y="21" width="375" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/> <fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color key="textColor" red="0.66666666666666663" green="0.66666666666666663" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
...@@ -146,7 +148,7 @@ ...@@ -146,7 +148,7 @@
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="sRGB"/> <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.60999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
</view> </view>
<view hidden="YES" contentMode="scaleToFill" id="117" userLabel="video filters view" customClass="VLCFrostedGlasView"> <view hidden="YES" contentMode="scaleToFill" id="117" userLabel="video filters view" customClass="VLCFrostedGlasView">
<rect key="frame" x="0.0" y="342" width="320" height="198"/> <rect key="frame" x="28" y="441" width="320" height="198"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="2" id="128" customClass="VLCSlider"> <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="2" id="128" customClass="VLCSlider">
...@@ -237,7 +239,7 @@ ...@@ -237,7 +239,7 @@
</subviews> </subviews>
</view> </view>
<view hidden="YES" contentMode="scaleToFill" misplaced="YES" id="165" userLabel="speed delay Controls panel" customClass="VLCFrostedGlasView"> <view hidden="YES" contentMode="scaleToFill" misplaced="YES" id="165" userLabel="speed delay Controls panel" customClass="VLCFrostedGlasView">
<rect key="frame" x="0.0" y="294" width="320" height="163"/> <rect key="frame" x="28" y="393" width="320" height="163"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews> <subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Audio delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="8cb-fw-YeF"> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="Audio delay" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="8cb-fw-YeF">
...@@ -341,7 +343,7 @@ ...@@ -341,7 +343,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="PlayingExternally.png" width="122" height="91"/> <image name="PlayingExternally.png" width="16" height="16"/>
<image name="resetIcon.png" width="24" height="30"/> <image name="resetIcon.png" width="24" height="30"/>
</resources> </resources>
</document> </document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="VLCPlayExternallyController" customModule="VLC_iOS" customModuleProvider="target">
<connections>
<outlet property="playingExternallyView" destination="Jhp-Wu-Cyf" id="RR8-dQ-7yL"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="Jhp-Wu-Cyf" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" image="PlayingExternally.png" translatesAutoresizingMaskIntoConstraints="NO" id="CIh-qH-85s">
<rect key="frame" x="108" y="20" width="160" height="130"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="TV Connected" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R6g-jM-6Ym">
<rect key="frame" x="38" y="170" width="300" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" fixedFrame="YES" text="This video is playing on the TV" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UbH-6k-6hM">
<rect key="frame" x="38" y="199" width="300" height="53"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="highlightedColor" red="0.3803921569" green="0.3803921569" blue="0.3803921569" alpha="0.81000000000000005" colorSpace="custom" customColorSpace="sRGB"/>
</label>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="FRP-Rv-V1R"/>
<connections>
<outlet property="playingExternallyDescription" destination="UbH-6k-6hM" id="hCM-jy-NE0"/>
<outlet property="playingExternallyTitle" destination="R6g-jM-6Ym" id="3uP-nO-Yij"/>
</connections>
<point key="canvasLocation" x="122" y="-38"/>
</view>
</objects>
<resources>
<image name="PlayingExternally.png" width="16" height="16"/>
</resources>
</document>
/*****************************************************************************
* VLCPlayingExternallyView.swift
* VLC for iOS
*****************************************************************************
* Copyright (c) 2018 VideoLAN. All rights reserved.
* $Id$
*
* Authors: Carola Nitz <caro # videolan.org>
*
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
import Foundation
class VLCPlayingExternallyView: UIView {
@IBOutlet weak var playingExternallyTitle: UILabel!
@IBOutlet weak var playingExternallyDescription: UILabel!
@objc var displayView: UIView? {
return externalWindow?.rootViewController?.view
}
var externalWindow: UIWindow?
@objc func shouldDisplay(_ show: Bool) {
self.isHidden = !show
externalWindow?.isHidden = !show
if show {
guard let screen = UIScreen.screens.count > 1 ? UIScreen.screens[1] : nil else {
return
}
screen.overscanCompensation = .none
externalWindow = UIWindow(frame: screen.bounds)
guard let externalWindow = externalWindow else {
return
}
externalWindow.rootViewController = VLCExternalDisplayController()
externalWindow.screen = screen
externalWindow.rootViewController?.view.frame = externalWindow.bounds
} else {
externalWindow = nil
}
}
override func awakeFromNib() {
playingExternallyTitle.text = NSLocalizedString("PLAYING_EXTERNALLY_TITLE", comment: "")
playingExternallyDescription.text = NSLocalizedString("PLAYING_EXTERNALLY_DESC", comment:"")
}
@objc func updateUI(rendererItem: VLCRendererItem?) {
if let rendererItem = rendererItem {
playingExternallyTitle.text = NSLocalizedString("PLAYING_EXTERNALLY_TITLE_CHROMECAST", comment:"")
playingExternallyDescription.text = rendererItem.name;
} else {
playingExternallyTitle.text = NSLocalizedString("PLAYING_EXTERNALLY_TITLE", comment: "")
playingExternallyDescription.text = NSLocalizedString("PLAYING_EXTERNALLY_DESC", comment:"")
}
}
}
...@@ -35,10 +35,6 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) { ...@@ -35,10 +35,6 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) {
@property (nonatomic, strong) IBOutlet UIButton *sleepTimerButton; @property (nonatomic, strong) IBOutlet UIButton *sleepTimerButton;
@property (nonatomic, strong) IBOutlet VLCStatusLabel *statusLabel; @property (nonatomic, strong) IBOutlet VLCStatusLabel *statusLabel;
@property (nonatomic, strong) IBOutlet UIView *playingExternallyView;
@property (nonatomic, strong) IBOutlet UILabel *playingExternallyTitle;
@property (nonatomic, strong) IBOutlet UILabel *playingExternallyDescription;
@property (nonatomic, strong) IBOutlet VLCFrostedGlasView *videoFilterView; @property (nonatomic, strong) IBOutlet VLCFrostedGlasView *videoFilterView;
@property (nonatomic, strong) IBOutlet UILabel *hueLabel; @property (nonatomic, strong) IBOutlet UILabel *hueLabel;
@property (nonatomic, strong) IBOutlet UISlider *hueSlider; @property (nonatomic, strong) IBOutlet UISlider *hueSlider;
...@@ -96,6 +92,4 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) { ...@@ -96,6 +92,4 @@ typedef NS_ENUM(NSInteger, VLCMovieJumpState) {
- (void)toggleChapterAndTitleSelector; - (void)toggleChapterAndTitleSelector;
- (void)hideMenu; - (void)hideMenu;
- (void)setupCastWithCurrentRenderer;
@end @end
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
*****************************************************************************/ *****************************************************************************/
#import "VLCMovieViewController.h" #import "VLCMovieViewController.h"
#import "VLCExternalDisplayController.h"
#import "VLCEqualizerView.h" #import "VLCEqualizerView.h"
#import "VLCMultiSelectionMenuView.h" #import "VLCMultiSelectionMenuView.h"
#import "VLCPlaybackController.h" #import "VLCPlaybackController.h"
...@@ -122,7 +121,8 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -122,7 +121,8 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
} }
@property (nonatomic, strong) VLCMovieViewControlPanelView *controllerPanel; @property (nonatomic, strong) VLCMovieViewControlPanelView *controllerPanel;
@property (nonatomic, strong) UIPopoverController *masterPopoverController; @property (nonatomic, strong) UIPopoverController *masterPopoverController;
@property (nonatomic, strong) UIWindow *externalWindow; @property (nonatomic, strong) IBOutlet VLCPlayingExternallyView *playingExternalView;
@end @end
@implementation VLCMovieViewController @implementation VLCMovieViewController
...@@ -196,9 +196,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -196,9 +196,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
name:VLCPlaybackControllerPlaybackDidStop name:VLCPlaybackControllerPlaybackDidStop
object:nil]; object:nil];
if ([[UIDevice currentDevice] VLCHasExternalDisplay])
[self showOnExternalDisplay];
self.trackNameLabel.text = self.artistNameLabel.text = self.albumNameLabel.text = @""; self.trackNameLabel.text = self.artistNameLabel.text = self.albumNameLabel.text = @"";
_movieView.userInteractionEnabled = NO; _movieView.userInteractionEnabled = NO;
...@@ -434,8 +431,9 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -434,8 +431,9 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
VLCRendererDiscovererManager *manager = [VLCRendererDiscovererManager sharedInstance]; VLCRendererDiscovererManager *manager = [VLCRendererDiscovererManager sharedInstance];
manager.presentingViewController = self; manager.presentingViewController = self;
manager.delegate = self; manager.delegate = self;
if (_vpc.renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]) {
[self hidePlayingExternallyViewForRendererIfNeeded]; [self showOnDisplay:_playingExternalView.displayView];
}
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
...@@ -895,7 +893,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) { ...@@ -895,7 +893,6 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
- (IBAction)closePlayback:(id)sender - (IBAction)closePlayback:(id)sender
{ {
_playbackWillClose = YES; _playbackWillClose = YES;
[self hidePlayingExternallyViewForRendererIfNeeded];
[_vpc stopPlayback]; [_vpc stopPlayback];
} }
...@@ -1080,10 +1077,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1080,10 +1077,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[_controllerPanel updateButtons]; [_controllerPanel updateButtons];
_audioOnly = metadata.isAudioOnly; _audioOnly = metadata.isAudioOnly;
if (_audioOnly) {
// fixme: _playingExternallyView should be shown in audioOnly as well
_playingExternallyView.hidden = YES;
}
} }
- (IBAction)playPause - (IBAction)playPause
...@@ -1685,81 +1678,35 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1685,81 +1678,35 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
#pragma mark - External Display #pragma mark - External Display
- (void)showOnExternalDisplay - (void)showOnDisplay:(UIView *)view
{ {
UIScreen *screen = [UIScreen screens][1]; BOOL displayExternally = view != _movieView;
screen.overscanCompensation = UIScreenOverscanCompensationInsetApplicationFrame; [_playingExternalView shouldDisplay:displayExternally];
[_playingExternalView updateUIWithRendererItem:_vpc.renderer];
self.externalWindow = [[UIWindow alloc] initWithFrame:screen.bounds]; _vpc.videoOutputView = view;
_artworkImageView.hidden = displayExternally;
UIViewController *controller = [[VLCExternalDisplayController alloc] init];
self.externalWindow.rootViewController = controller;
[controller.view addSubview:_movieView];
controller.view.frame = screen.bounds;
_movieView.frame = screen.bounds;
self.playingExternallyView.hidden = NO;
self.externalWindow.screen = screen;
self.externalWindow.hidden = NO;
_playingExternallyTitle.text = NSLocalizedString(@"PLAYING_EXTERNALLY_TITLE", nil);
_playingExternallyDescription.text = NSLocalizedString(@"PLAYING_EXTERNALLY_DESC", nil);
}
- (void)hideFromExternalDisplay
{
[self.view addSubview:_movieView];
[self.view sendSubviewToBack:_movieView];
_movieView.frame = self.view.frame;
self.playingExternallyView.hidden = YES;
self.externalWindow.hidden = YES;
self.externalWindow = nil;
} }
- (void)handleExternalScreenDidConnect:(NSNotification *)notification - (void)handleExternalScreenDidConnect:(NSNotification *)notification
{ {
[self showOnExternalDisplay]; [self showOnDisplay:_playingExternalView.displayView];
} }
- (void)handleExternalScreenDidDisconnect:(NSNotification *)notification - (void)handleExternalScreenDidDisconnect:(NSNotification *)notification
{ {
[self hideFromExternalDisplay]; [self showOnDisplay:_movieView];
} }
#pragma mark - Renderers #pragma mark - Renderers
/**
* Checks if playingExternallyView needs to be hidden.
* If not, playingExternallyView will be shown with the current renderer name
*/
- (void)hidePlayingExternallyViewForRendererIfNeeded
{
VLCRendererItem *renderer = _vpc.renderer;
if (renderer != nil) {
// TODO: Have a better/prettier transition between local playback frame and playingExternallyView
_playingExternallyView.hidden = NO;
_playingExternallyTitle.text = NSLocalizedString(@"PLAYING_EXTERNALLY_TITLE_CHROMECAST", nil);
_playingExternallyDescription.text = renderer.name;
} else {
_playingExternallyView.hidden = YES;
}
}
- (void)setupCastWithCurrentRenderer
{
[self hidePlayingExternallyViewForRendererIfNeeded];
[_vpc mediaPlayerSetRenderer:_vpc.renderer];
}
- (void)setupRendererDiscovererManager - (void)setupRendererDiscovererManager
{ {
// Create a renderer button for VLCMovieViewController // Create a renderer button for VLCMovieViewController
_rendererButton = [VLCRendererDiscovererManager.sharedInstance setupRendererButton]; _rendererButton = [VLCRendererDiscovererManager.sharedInstance setupRendererButton];
[VLCRendererDiscovererManager.sharedInstance addSelectionHandlerWithSelectionHandler:^(VLCRendererItem * _Nonnull item) { [VLCRendererDiscovererManager.sharedInstance addSelectionHandlerWithSelectionHandler:^(VLCRendererItem * item) {
[self setupCastWithCurrentRenderer]; if (item) {
[self showOnDisplay:_playingExternalView.displayView];
}
}]; }];
} }
...@@ -1767,7 +1714,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -1767,7 +1714,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)removedCurrentRendererItem:(VLCRendererItem *)item - (void)removedCurrentRendererItem:(VLCRendererItem *)item
{ {
[self hidePlayingExternallyViewForRendererIfNeeded]; [self showOnDisplay:_movieView];
} }
@end @end
...@@ -136,6 +136,4 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -136,6 +136,4 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath; - (void)playMediaList:(VLCMediaList *)mediaList firstIndex:(NSInteger)index subtitlesFilePath:(NSString *)subsFilePath;
- (void)openVideoSubTitlesFromFile:(NSString *)pathToFile; - (void)openVideoSubTitlesFromFile:(NSString *)pathToFile;
- (void)mediaPlayerSetRenderer:(VLCRendererItem *)renderer;
@end @end
...@@ -1326,10 +1326,10 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) { ...@@ -1326,10 +1326,10 @@ typedef NS_ENUM(NSUInteger, VLCAspectRatio) {
} }