Commit 9b53ce8b authored by Carola Nitz's avatar Carola Nitz

VLCFullscreenMovieTVViewController: fix not parsing Metadata correctly on tvOS

closes #334
parent 2848a7dd
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#import "VLCHTTPUploaderController.h" #import "VLCHTTPUploaderController.h"
#import "VLCSiriRemoteGestureRecognizer.h" #import "VLCSiriRemoteGestureRecognizer.h"
#import "VLCNetworkImageView.h" #import "VLCNetworkImageView.h"
#import "VLCMetaData.h"
typedef NS_ENUM(NSInteger, VLCPlayerScanState) typedef NS_ENUM(NSInteger, VLCPlayerScanState)
{ {
...@@ -831,28 +832,25 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom ...@@ -831,28 +832,25 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
} }
} }
- (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller - (void)displayMetadataForPlaybackController:(VLCPlaybackController *)controller metadata:(VLCMetaData *)metadata
title:(NSString *)title
artwork:(UIImage *)artwork
artist:(NSString *)artist
album:(NSString *)album
audioOnly:(BOOL)audioOnly
{ {
NSString *title = metadata.title;
NSString *artist = metadata.artist;
NSString *albumName = metadata.albumName;
self.titleLabel.text = title; self.titleLabel.text = title;
if (metadata.isAudioOnly) {
if (audioOnly) {
self.audioArtworkImageView.image = nil; self.audioArtworkImageView.image = nil;
self.audioDescriptionTextView.hidden = YES; self.audioDescriptionTextView.hidden = YES;
[self stopAudioDescriptionAnimation]; [self stopAudioDescriptionAnimation];
if (artist != nil && album != nil) { if (artist != nil && albumName != nil) {
[UIView animateWithDuration:.3 animations:^{ [UIView animateWithDuration:.3 animations:^{
self.audioArtistLabel.text = artist; self.audioArtistLabel.text = artist;
self.audioArtistLabel.hidden = NO; self.audioArtistLabel.hidden = NO;
self.audioAlbumNameLabel.text = album; self.audioAlbumNameLabel.text = albumName;
self.audioAlbumNameLabel.hidden = NO; self.audioAlbumNameLabel.hidden = NO;
}]; }];
APLog(@"Audio-only track meta changed, tracing artist '%@' and album '%@'", artist, album); APLog(@"Audio-only track meta changed, tracing artist '%@' and album '%@'", artist, albumName);
} else if (artist != nil) { } else if (artist != nil) {
[UIView animateWithDuration:.3 animations:^{ [UIView animateWithDuration:.3 animations:^{
self.audioArtistLabel.text = artist; self.audioArtistLabel.text = artist;
......
/***************************************************************************** /*****************************************************************************
* VLC for iOS * VLC for iOS
***************************************************************************** *****************************************************************************
* Copyright (c) 2017 VideoLAN. All rights reserved. * Copyright (c) 2017-2018 VideoLAN. All rights reserved.
* $Id$ * $Id$
* *
* Authors: Carola Nitz <caro # videolan.org> * Authors: Carola Nitz <caro # videolan.org>
......
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