Commit 1ede3ba6 authored by Carola Nitz's avatar Carola Nitz

PlayingExternally: set the title of the track as title on the external screen

if an external screen is connected we're not showing the tracklabel anymore but display
that information as part of the external views title (closes ##222)
parent d5225e9b
......@@ -208,7 +208,7 @@
</button>
</subviews>
</view>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="123" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC_iOS" customModuleProvider="target">
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="123" userLabel="Playing Externally View" customClass="PlayingExternallyView" customModule="VLC" customModuleProvider="target">
<rect key="frame" x="184" y="312" width="400" height="400"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
......@@ -216,7 +216,7 @@
<rect key="frame" x="51" y="0.0" width="298" height="266"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" misplaced="YES" 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" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="125">
<rect key="frame" x="10" y="274" width="380" 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"/>
......
......@@ -100,7 +100,7 @@
<rect key="frame" x="170" y="316" width="37" height="37"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
</activityIndicatorView>
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View" customClass="VLCPlayingExternallyView" customModule="VLC" customModuleProvider="target">
<view hidden="YES" userInteractionEnabled="NO" contentMode="scaleToFill" id="108" userLabel="Playing Externally View" customClass="PlayingExternallyView" customModule="VLC" customModuleProvider="target">
<rect key="frame" x="28" y="178" width="320" height="257"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<subviews>
......@@ -108,7 +108,7 @@
<rect key="frame" x="80" 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" misplaced="YES" 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" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="110">
<rect key="frame" x="10" 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"/>
......
......@@ -25,8 +25,8 @@
"ONE_SPU_TRACK" = "One subtitles track";
"PLAYING_EXTERNALLY_TITLE" = "TV Connected";
"PLAYING_EXTERNALLY_TITLE_CHROMECAST" = "Chromecast Connected";
"PLAYING_EXTERNALLY_DESC" = "This video is playing on the TV";
"PLAYING_EXTERNALLY_ADDITION" = "\n now playing on:"; /* \n should stay in every translation */
"VFILTER_HUE" = "Hue";
"VFILTER_CONTRAST" = "Contrast";
......
......@@ -12,7 +12,7 @@
import Foundation
class VLCPlayingExternallyView: UIView {
class PlayingExternallyView: UIView {
@IBOutlet weak var playingExternallyTitle: UILabel!
@IBOutlet weak var playingExternallyDescription: UILabel!
......@@ -48,12 +48,12 @@ class VLCPlayingExternallyView: UIView {
playingExternallyDescription.text = NSLocalizedString("PLAYING_EXTERNALLY_DESC", comment:"")
}
@objc func updateUI(rendererItem: VLCRendererItem?) {
@objc func updateUI(rendererItem: VLCRendererItem?, title: String) {
if let rendererItem = rendererItem {
playingExternallyTitle.text = NSLocalizedString("PLAYING_EXTERNALLY_TITLE_CHROMECAST", comment:"")
playingExternallyTitle.text = title + NSLocalizedString("PLAYING_EXTERNALLY_ADDITION", comment:"\n should stay in every translation")
playingExternallyDescription.text = rendererItem.name
} else {
playingExternallyTitle.text = NSLocalizedString("PLAYING_EXTERNALLY_TITLE", comment: "")
playingExternallyTitle.text = title
playingExternallyDescription.text = NSLocalizedString("PLAYING_EXTERNALLY_DESC", comment:"")
}
}
......
......@@ -118,7 +118,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
}
@property (nonatomic, strong) VLCMovieViewControlPanelView *controllerPanel;
@property (nonatomic, strong) VLCService *services;
@property (nonatomic, strong) IBOutlet VLCPlayingExternallyView *playingExternalView;
@property (nonatomic, strong) IBOutlet PlayingExternallyView *playingExternalView;
@end
......@@ -757,7 +757,7 @@ typedef NS_ENUM(NSInteger, VLCPanType) {
CGFloat metaInfoAlpha = self->_audioOnly ? 1.0f : alpha;
self->_artistNameLabel.alpha = metaInfoAlpha;
self->_albumNameLabel.alpha = metaInfoAlpha;
self->_trackNameLabel.alpha = metaInfoAlpha;
self->_trackNameLabel.alpha = [self->_vpc isPlayingOnExternalScreen] ? 0.f : metaInfoAlpha;
};
void (^completionBlock)(BOOL finished) = ^(BOOL finished) {
......@@ -1137,6 +1137,7 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
[self hideShowAspectratioButton:metadata.isAudioOnly];
[_controllerPanel updateButtons];
[_playingExternalView updateUIWithRendererItem:_vpc.renderer title:metadata.title];
_audioOnly = metadata.isAudioOnly;
}
......@@ -1729,7 +1730,6 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
// if we don't have a renderer we're mirroring and don't want to show the dialog
BOOL displayExternally = view != _movieView;
[_playingExternalView shouldDisplay:displayExternally movieView:_movieView];
[_playingExternalView updateUIWithRendererItem:_vpc.renderer];
_artworkImageView.hidden = displayExternally;
if (!displayExternally && _movieView.superview != self.view) {
[self.view addSubview:_movieView];
......
......@@ -24,7 +24,7 @@
4152F1621FEF19BD00F1908B /* KeychainCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4152F1611FEF19BD00F1908B /* KeychainCoordinator.swift */; };
41533C9E2113392F00EC3ABA /* URLHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41533C9D2113392F00EC3ABA /* URLHandlerTests.swift */; };
416443862048419E00CAC646 /* DeviceMotion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 416443852048419E00CAC646 /* DeviceMotion.swift */; };
416DACB720B6DB9A001BC75D /* VLCPlayingExternallyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 416DACB620B6DB9A001BC75D /* VLCPlayingExternallyView.swift */; };
416DACB720B6DB9A001BC75D /* PlayingExternallyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 416DACB620B6DB9A001BC75D /* PlayingExternallyView.swift */; };
4170152C209A1D3600802E44 /* MediaViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4170152B209A1D3600802E44 /* MediaViewController.swift */; };
41701546209B36E800802E44 /* VLCPagingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41701545209B36E800802E44 /* VLCPagingViewController.swift */; };
417CDA231A48D1F300D9ACE7 /* VLCCloudServicesTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 417CDA211A48D1F300D9ACE7 /* VLCCloudServicesTableViewController.m */; };
......@@ -471,7 +471,7 @@
41533C9D2113392F00EC3ABA /* URLHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHandlerTests.swift; sourceTree = "<group>"; };
41533CA1211343D100EC3ABA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "VLC-iOS-Tests/Info.plist"; sourceTree = SOURCE_ROOT; };
416443852048419E00CAC646 /* DeviceMotion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DeviceMotion.swift; path = Sources/DeviceMotion.swift; sourceTree = "<group>"; };
416DACB620B6DB9A001BC75D /* VLCPlayingExternallyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VLCPlayingExternallyView.swift; sourceTree = "<group>"; };
416DACB620B6DB9A001BC75D /* PlayingExternallyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayingExternallyView.swift; sourceTree = "<group>"; };
416DEFF51FEEA76A00F4FC59 /* LayoutAnchorContainer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LayoutAnchorContainer.swift; path = Sources/LayoutAnchorContainer.swift; sourceTree = "<group>"; };
4170152B209A1D3600802E44 /* MediaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaViewController.swift; sourceTree = "<group>"; };
41701545209B36E800802E44 /* VLCPagingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = VLCPagingViewController.swift; path = Sources/VLCPagingViewController.swift; sourceTree = "<group>"; };
......@@ -2373,7 +2373,7 @@
417E68B81F321EFF00DB9BB2 /* VLCActivityViewControllerVendor.m */,
41EB91DB1F7BFF8400821AA5 /* VLCMetadata.h */,
41EB91DC1F7BFF8400821AA5 /* VLCMetadata.m */,
416DACB620B6DB9A001BC75D /* VLCPlayingExternallyView.swift */,
416DACB620B6DB9A001BC75D /* PlayingExternallyView.swift */,
);
path = SharedSources;
sourceTree = "<group>";
......@@ -3221,7 +3221,7 @@
7D3784C3183A9938009EE944 /* VLCStatusLabel.m in Sources */,
4144156C20ECE6330078EC37 /* VLCFileServerSectionTableHeaderView.swift in Sources */,
7D1276621AADA0E600F0260C /* VLCMultiSelectionMenuView.m in Sources */,
416DACB720B6DB9A001BC75D /* VLCPlayingExternallyView.swift in Sources */,
416DACB720B6DB9A001BC75D /* PlayingExternallyView.swift in Sources */,
41EC28E52136DD41004BCF0F /* MovieCollectionViewCell.swift in Sources */,
7D3784C8183A9972009EE944 /* NSString+SupportedMedia.m in Sources */,
417E68B91F321EFF00DB9BB2 /* VLCActivityViewControllerVendor.m in Sources */,
......
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