Skip to content
Snippets Groups Projects
Commit 9cf22aa7 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

AppleTV: fix compilation as VLCRenderer* is iOS only

parent 8f2a2b54
No related branches found
Tags 3.3.1 tv3.3.1
No related merge requests found
......@@ -105,7 +105,9 @@ NS_SWIFT_NAME(PlaybackService)
@property (nonatomic, readonly) NSDictionary *mediaOptionsDictionary;
@property (nonatomic, readonly) NSTimer *sleepTimer;
#if !TARGET_OS_TV
@property (nonatomic, nullable) VLCRendererItem *renderer;
#endif
@property (nonatomic, readonly) VLCAspectRatio currentAspectRatio;
......
......@@ -310,7 +310,9 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
[_mediaPlayer addObserver:self forKeyPath:@"time" options:0 context:nil];
[_mediaPlayer addObserver:self forKeyPath:@"remainingTime" options:0 context:nil];
#if !TARGET_OS_TV
[_mediaPlayer setRendererItem:_renderer];
#endif
[_listPlayer playItemAtNumber:@(_itemInMediaListToBePlayedFirst)];
......@@ -1282,7 +1284,11 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
- (BOOL)isPlayingOnExternalScreen
{
#if !TARGET_OS_TV
return (_renderer || [[UIDevice currentDevice] VLCHasExternalDisplay]);
#else
return [[UIDevice currentDevice] VLCHasExternalDisplay];
#endif
}
#pragma mark - background interaction
......@@ -1305,12 +1311,17 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
{
_preBackgroundWrapperView = _videoOutputViewWrapper;
#if !TARGET_OS_TV
if (!_renderer && _mediaPlayer.audioTrackIndexes.count > 0 && [_mediaPlayer isPlaying])
[self setVideoTrackEnabled:false];
if (_renderer) {
[_backgroundDummyPlayer play];
}
#else
if (_mediaPlayer.audioTrackIndexes.count > 0 && [_mediaPlayer isPlaying])
[self setVideoTrackEnabled:false];
#endif
}
- (void)applicationWillEnterForeground:(NSNotification *)notification
......@@ -1320,9 +1331,11 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
_preBackgroundWrapperView = nil;
}
#if !TARGET_OS_TV
if (_renderer) {
[_backgroundDummyPlayer stop];
}
#endif
if (_mediaPlayer.currentVideoTrackIndex == -1) {
[self setVideoTrackEnabled:true];
......@@ -1409,12 +1422,16 @@ NSString *const VLCPlaybackServicePlaybackPositionUpdated = @"VLCPlaybackService
#pragma mark - Renderer
#if !TARGET_OS_TV
- (void)setRenderer:(VLCRendererItem * __nullable)renderer
{
_renderer = renderer;
[_mediaPlayer setRendererItem:_renderer];
}
#endif
#pragma mark - PlayerDisplayController
- (void)setPlayerDisplayController:(VLCPlayerDisplayController *)playerDisplayController
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment