Commit 7e7d9c57 authored by Tobias's avatar Tobias

don't use VLCPlayerDisplayController on TV

parent 6d1280b1
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
#import "VLCPlaybackController.h" #import "VLCPlaybackController.h"
#if TARGET_OS_TV
#import "VLCFullscreenMovieTVViewController.h"
#endif
#if DOWNLOAD_SUPPORTED #if DOWNLOAD_SUPPORTED
#import "VLCDownloadViewController.h" #import "VLCDownloadViewController.h"
...@@ -179,11 +182,22 @@ ...@@ -179,11 +182,22 @@
#pragma mark - File Streaming #pragma mark - File Streaming
- (void)showMovieViewController
{
#if TARGET_OS_TV
VLCFullscreenMovieTVViewController *moviewVC = [VLCFullscreenMovieTVViewController fullscreenMovieTVViewController];
[self.viewController presentViewController:moviewVC
animated:YES
completion:nil];
#endif
}
- (void)streamMediaList:(VLCMediaList *)mediaList startingAtIndex:(NSInteger)startIndex - (void)streamMediaList:(VLCMediaList *)mediaList startingAtIndex:(NSInteger)startIndex
{ {
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance]; VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playMediaList:mediaList firstIndex:startIndex]; [vpc playMediaList:mediaList firstIndex:startIndex];
[self showMovieViewController];
} }
- (void)streamFileForItem:(id<VLCNetworkServerBrowserItem>)item - (void)streamFileForItem:(id<VLCNetworkServerBrowserItem>)item
...@@ -205,6 +219,7 @@ ...@@ -205,6 +219,7 @@
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance]; VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playURL:URLToPlay subtitlesFilePath:URLofSubtitle]; [vpc playURL:URLToPlay subtitlesFilePath:URLofSubtitle];
[self showMovieViewController];
} }
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
#import "VLCDropboxController.h" #import "VLCDropboxController.h"
#import "NSString+SupportedMedia.h" #import "NSString+SupportedMedia.h"
#import "VLCPlaybackController.h" #import "VLCPlaybackController.h"
#if TARGET_OS_TV #if !TARGET_OS_TV
#import "VLCPlayerDisplayController.h"
#else
#import "VLCActivityManager.h" #import "VLCActivityManager.h"
#import "VLCMediaFileDiscoverer.h" #import "VLCMediaFileDiscoverer.h"
#endif #endif
...@@ -326,7 +324,7 @@ ...@@ -326,7 +324,7 @@
[alert addAction:defaultAction]; [alert addAction:defaultAction];
[[[VLCPlayerDisplayController sharedInstance] childViewController] presentViewController:alert animated:YES completion:nil]; [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alert animated:YES completion:nil];
#endif #endif
} }
......
...@@ -116,6 +116,12 @@ ...@@ -116,6 +116,12 @@
NSURL *url = [NSURL URLWithString:selectedObject.downloadPath]; NSURL *url = [NSURL URLWithString:selectedObject.downloadPath];
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance]; VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playURL:url successCallback:nil errorCallback:nil]; [vpc playURL:url successCallback:nil errorCallback:nil];
#if TARGET_OS_TV
VLCFullscreenMovieTVViewController *movieVC = [VLCFullscreenMovieTVViewController fullscreenMovieTVViewController];
[self presentViewController:movieVC
animated:YES
completion:nil];
#endif
} }
[self.tableView deselectRowAtIndexPath:indexPath animated:NO]; [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
......
...@@ -280,7 +280,7 @@ NSString *const VLCPlaybackControllerPlaybackDidFail = @"VLCPlaybackControllerPl ...@@ -280,7 +280,7 @@ NSString *const VLCPlaybackControllerPlaybackDidFail = @"VLCPlaybackControllerPl
}]; }];
[alert addAction:defaultAction]; [alert addAction:defaultAction];
[alert addAction:cancelAction]; [alert addAction:cancelAction];
[[[VLCPlayerDisplayController sharedInstance] childViewController] presentViewController:alert animated:YES completion:nil]; [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:alert animated:YES completion:nil];
#endif #endif
} else } else
[self _playNewMedia]; [self _playNewMedia];
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#import "VLCAppSharesTVViewController.h" #import "VLCAppSharesTVViewController.h"
#import "VLCLocalNetworkTVViewController.h" #import "VLCLocalNetworkTVViewController.h"
#import "VLCOpenNetworkStreamTVViewController.h" #import "VLCOpenNetworkStreamTVViewController.h"
#import "VLCPlayerDisplayController.h"
#import "VLCSettingsAboutTableViewController.h" #import "VLCSettingsAboutTableViewController.h"
#import "VLCCloudServicesTVViewController.h" #import "VLCCloudServicesTVViewController.h"
...@@ -73,9 +72,7 @@ ...@@ -73,9 +72,7 @@
[[UINavigationController alloc] initWithRootViewController:_localNetworkVC], [[UINavigationController alloc] initWithRootViewController:_localNetworkVC],
_cloudServicesVC, _openNetworkVC, _aboutSettingsVC]; _cloudServicesVC, _openNetworkVC, _aboutSettingsVC];
VLCPlayerDisplayController *playerDisplayController = [VLCPlayerDisplayController sharedInstance]; self.window.rootViewController = _mainViewController;
playerDisplayController.childViewController = _mainViewController;
self.window.rootViewController = playerDisplayController;
[self.window makeKeyAndVisible]; [self.window makeKeyAndVisible];
return YES; return YES;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#import "UIColor+Presets.h" #import "UIColor+Presets.h"
#import "VLCTVConstants.h" #import "VLCTVConstants.h"
#import "UIViewController+VLCAlert.h" #import "UIViewController+VLCAlert.h"
#import "VLCFullscreenMovieTVViewController.h"
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[UIDevice currentDevice] systemVersion].floatValue >= [v floatValue]) #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[UIDevice currentDevice] systemVersion].floatValue >= [v floatValue])
......
...@@ -24,4 +24,6 @@ ...@@ -24,4 +24,6 @@
@property (readwrite, nonatomic, weak) IBOutlet UILabel *titleLabel; @property (readwrite, nonatomic, weak) IBOutlet UILabel *titleLabel;
@property (readwrite, nonatomic, weak) IBOutlet UILabel *bufferingLabel; @property (readwrite, nonatomic, weak) IBOutlet UILabel *bufferingLabel;
+ (instancetype) fullscreenMovieTVViewController;
@end @end
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
*****************************************************************************/ *****************************************************************************/
#import "VLCFullscreenMovieTVViewController.h" #import "VLCFullscreenMovieTVViewController.h"
#import "VLCPlayerDisplayController.h"
@interface VLCFullscreenMovieTVViewController () @interface VLCFullscreenMovieTVViewController ()
{ {
...@@ -21,6 +20,11 @@ ...@@ -21,6 +20,11 @@
@implementation VLCFullscreenMovieTVViewController @implementation VLCFullscreenMovieTVViewController
+ (instancetype)fullscreenMovieTVViewController
{
return [[self alloc] initWithNibName:nil bundle:nil];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
...@@ -28,10 +32,6 @@ ...@@ -28,10 +32,6 @@
self.edgesForExtendedLayout = UIRectEdgeAll; self.edgesForExtendedLayout = UIRectEdgeAll;
NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self
selector:@selector(appBecameActive:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[center addObserver:self [center addObserver:self
selector:@selector(playbackDidStop:) selector:@selector(playbackDidStop:)
name:VLCPlaybackControllerPlaybackDidStop name:VLCPlaybackControllerPlaybackDidStop
...@@ -109,22 +109,9 @@ ...@@ -109,22 +109,9 @@
APLog(@"%s", __PRETTY_FUNCTION__); APLog(@"%s", __PRETTY_FUNCTION__);
} }
- (void)appBecameActive:(NSNotification *)aNotification
{
VLCPlayerDisplayController *pdc = [VLCPlayerDisplayController sharedInstance];
if (pdc.displayMode == VLCPlayerDisplayControllerDisplayModeFullscreen) {
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc recoverDisplayedMetadata];
if (vpc.videoOutputView != self.movieView) {
vpc.videoOutputView = nil;
vpc.videoOutputView = self.movieView;
}
}
}
- (void)playbackDidStop:(NSNotification *)aNotification - (void)playbackDidStop:(NSNotification *)aNotification
{ {
[[UIApplication sharedApplication] sendAction:@selector(closeFullscreenPlayback) to:nil from:self forEvent:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
- (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState - (void)mediaPlayerStateChanged:(VLCMediaPlayerState)currentState
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#import "VLCOpenNetworkStreamTVViewController.h" #import "VLCOpenNetworkStreamTVViewController.h"
#import "VLCPlaybackController.h" #import "VLCPlaybackController.h"
#import "VLCPlayerDisplayController.h" #import "VLCPlayerDisplayController.h"
#import "VLCFullscreenMovieTVViewController.h"
@interface VLCOpenNetworkStreamTVViewController () @interface VLCOpenNetworkStreamTVViewController ()
{ {
...@@ -103,10 +104,11 @@ ...@@ -103,10 +104,11 @@
- (void)_openURLStringAndDismiss:(NSString *)url - (void)_openURLStringAndDismiss:(NSString *)url
{ {
[VLCPlayerDisplayController sharedInstance].displayMode = VLCPlayerDisplayControllerDisplayModeFullscreen;
VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance]; VLCPlaybackController *vpc = [VLCPlaybackController sharedInstance];
[vpc playURL:[NSURL URLWithString:url] subtitlesFilePath:nil]; [vpc playURL:[NSURL URLWithString:url] subtitlesFilePath:nil];
[self presentViewController:[VLCFullscreenMovieTVViewController fullscreenMovieTVViewController]
animated:YES
completion:nil];
} }
@end @end
...@@ -206,8 +206,6 @@ ...@@ -206,8 +206,6 @@
7DDD0429172D98E5005A7B10 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DDD0428172D98E5005A7B10 /* CFNetwork.framework */; }; 7DDD0429172D98E5005A7B10 /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DDD0428172D98E5005A7B10 /* CFNetwork.framework */; };
7DDFF4251BDFD23300913BD1 /* VLCCone512x512.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DDFF4241BDFD23300913BD1 /* VLCCone512x512.png */; }; 7DDFF4251BDFD23300913BD1 /* VLCCone512x512.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DDFF4241BDFD23300913BD1 /* VLCCone512x512.png */; };
7DE56C1A1AD93F9100E8CA00 /* VLCPlaybackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE56C191AD93F9100E8CA00 /* VLCPlaybackController.m */; }; 7DE56C1A1AD93F9100E8CA00 /* VLCPlaybackController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE56C191AD93F9100E8CA00 /* VLCPlaybackController.m */; };
7DEC8BD71BD658E6006E1093 /* VLCPlayerDisplayController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD510B6F1B14E564003BA71C /* VLCPlayerDisplayController.m */; };
7DEC8BD81BD66DA8006E1093 /* VLCMiniPlaybackView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D95610A1AF3E9E800779745 /* VLCMiniPlaybackView.m */; };
7DEC8BD91BD670EB006E1093 /* VLCPlaybackNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9CB9DB1A4C55EF00BB74B4 /* VLCPlaybackNavigationController.m */; }; 7DEC8BD91BD670EB006E1093 /* VLCPlaybackNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9CB9DB1A4C55EF00BB74B4 /* VLCPlaybackNavigationController.m */; };
7DEC8BDA1BD67112006E1093 /* VLCFrostedGlasView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BADAF44185FBD9D00108BD8 /* VLCFrostedGlasView.m */; }; 7DEC8BDA1BD67112006E1093 /* VLCFrostedGlasView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BADAF44185FBD9D00108BD8 /* VLCFrostedGlasView.m */; };
7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DEC8BDC1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m */; }; 7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DEC8BDC1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m */; };
...@@ -2677,7 +2675,6 @@ ...@@ -2677,7 +2675,6 @@
DD3EFF4A1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserPlex.m in Sources */, DD3EFF4A1BDEBCE500B68579 /* VLCLocalNetworkServiceBrowserPlex.m in Sources */,
DD3EABEF1BE14720003668DA /* VLCPlaybackControlsFocusView.m in Sources */, DD3EABEF1BE14720003668DA /* VLCPlaybackControlsFocusView.m in Sources */,
7DEC8BED1BD68D6A006E1093 /* VLCAboutTVViewController.m in Sources */, 7DEC8BED1BD68D6A006E1093 /* VLCAboutTVViewController.m in Sources */,
7DEC8BD81BD66DA8006E1093 /* VLCMiniPlaybackView.m in Sources */,
DD3EFF3A1BDEBCE500B68579 /* VLCLocalNetworkServiceVLCMedia.m in Sources */, DD3EFF3A1BDEBCE500B68579 /* VLCLocalNetworkServiceVLCMedia.m in Sources */,
7D7EF3DA1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.m in Sources */, 7D7EF3DA1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.m in Sources */,
DD3EFF521BDEBCE500B68579 /* VLCPlexWebAPI.m in Sources */, DD3EFF521BDEBCE500B68579 /* VLCPlexWebAPI.m in Sources */,
...@@ -2690,7 +2687,6 @@ ...@@ -2690,7 +2687,6 @@
7D13347C1BE132EA0012E919 /* VLCLocalNetworkServiceBrowserUPnP.m in Sources */, 7D13347C1BE132EA0012E919 /* VLCLocalNetworkServiceBrowserUPnP.m in Sources */,
DDEAECF11BDFE9E800756C83 /* VLCServerListTVTableViewController.m in Sources */, DDEAECF11BDFE9E800756C83 /* VLCServerListTVTableViewController.m in Sources */,
7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */, 7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */,
7DEC8BD71BD658E6006E1093 /* VLCPlayerDisplayController.m in Sources */,
DD3EFF501BDEBCE500B68579 /* VLCPlexParser.m in Sources */, DD3EFF501BDEBCE500B68579 /* VLCPlexParser.m in Sources */,
7D44085A1BDA8DCE0080FB42 /* VLCBoxTableViewController.m in Sources */, 7D44085A1BDA8DCE0080FB42 /* VLCBoxTableViewController.m in Sources */,
DD3EFF4E1BDEBCE500B68579 /* VLCNetworkServerBrowserPlex.m in Sources */, DD3EFF4E1BDEBCE500B68579 /* VLCNetworkServerBrowserPlex.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