AppleTVAppDelegate.m 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "AppleTVAppDelegate.h"
  12. #import "VLCServerListTVViewController.h"
  13. #import "VLCOpenNetworkStreamTVViewController.h"
  14. #import "VLCSettingsViewController.h"
  15. #import "VLCCloudServicesTVViewController.h"
  16. #import "VLCHTTPUploaderController.h"
  17. #import "VLCRemotePlaybackViewController.h"
  18. #import "HockeySDK.h"
  19. @interface AppleTVAppDelegate ()
  20. {
  21. UITabBarController *_mainViewController;
  22. VLCServerListTVViewController *_localNetworkVC;
  23. VLCCloudServicesTVViewController *_cloudServicesVC;
  24. VLCRemotePlaybackViewController *_remotePlaybackVC;
  25. VLCOpenNetworkStreamTVViewController *_openNetworkVC;
  26. VLCSettingsViewController *_settingsVC;
  27. }
  28. @end
  29. @implementation AppleTVAppDelegate
  30. + (void)initialize
  31. {
  32. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  33. NSDictionary *appDefaults = @{kVLCSettingContinueAudioInBackgroundKey : @(YES),
  34. kVLCSettingStretchAudio : @(NO),
  35. kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue,
  36. kVLCSettingSkipLoopFilter : kVLCSettingSkipLoopFilterNonRef,
  37. kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue,
  38. kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue,
  39. kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue,
  40. kVLCSettingSubtitlesBoldFont: kVLCSettingSubtitlesBoldFontDefaultValue,
  41. kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue,
  42. kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue,
  43. kVLCSettingEqualizerProfile : kVLCSettingEqualizerProfileDefaultValue,
  44. kVLCSettingPlaybackForwardSkipLength : kVLCSettingPlaybackForwardSkipLengthDefaultValue,
  45. kVLCSettingPlaybackBackwardSkipLength : kVLCSettingPlaybackBackwardSkipLengthDefaultValue,
  46. kVLCSettingFTPTextEncoding : kVLCSettingFTPTextEncodingDefaultValue,
  47. kVLCSettingWiFiSharingIPv6 : kVLCSettingWiFiSharingIPv6DefaultValue};
  48. [defaults registerDefaults:appDefaults];
  49. }
  50. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  51. {
  52. BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager];
  53. [hockeyManager configureWithIdentifier:@"f8697706993b44bba1c03cb7016cc325"];
  54. // Configure the SDK in here only!
  55. [hockeyManager startManager];
  56. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  57. _localNetworkVC = [[VLCServerListTVViewController alloc] initWithNibName:nil bundle:nil];
  58. _cloudServicesVC = [[VLCCloudServicesTVViewController alloc] initWithNibName:nil bundle:nil];
  59. _remotePlaybackVC = [[VLCRemotePlaybackViewController alloc] initWithNibName:nil bundle:nil];
  60. _openNetworkVC = [[VLCOpenNetworkStreamTVViewController alloc] initWithNibName:nil bundle:nil];
  61. _settingsVC = [[VLCSettingsViewController alloc] initWithNibName:nil bundle:nil];
  62. _mainViewController = [[UITabBarController alloc] init];
  63. _mainViewController.tabBar.barTintColor = [UIColor VLCOrangeTintColor];
  64. _mainViewController.viewControllers = @[[[UINavigationController alloc] initWithRootViewController:_localNetworkVC],
  65. [[UINavigationController alloc] initWithRootViewController:_cloudServicesVC],
  66. [[UINavigationController alloc] initWithRootViewController:_remotePlaybackVC],
  67. [[UINavigationController alloc] initWithRootViewController:_openNetworkVC],
  68. [[UINavigationController alloc] initWithRootViewController:_settingsVC]];
  69. self.window.rootViewController = _mainViewController;
  70. // Init the HTTP Server
  71. [VLCHTTPUploaderController sharedInstance];
  72. [self.window makeKeyAndVisible];
  73. return YES;
  74. }
  75. @end