AppleTVAppDelegate.m 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 configureWithBetaIdentifier:@"0114ca8e265244ce588d2ebd035c3577"
  54. liveIdentifier:@"c95f4227dff96c61f8b3a46a25edc584"
  55. delegate:nil];
  56. // Configure the SDK in here only!
  57. [hockeyManager startManager];
  58. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  59. _localNetworkVC = [[VLCServerListTVViewController alloc] initWithNibName:nil bundle:nil];
  60. _cloudServicesVC = [[VLCCloudServicesTVViewController alloc] initWithNibName:nil bundle:nil];
  61. _remotePlaybackVC = [[VLCRemotePlaybackViewController alloc] initWithNibName:nil bundle:nil];
  62. _openNetworkVC = [[VLCOpenNetworkStreamTVViewController alloc] initWithNibName:nil bundle:nil];
  63. _settingsVC = [[VLCSettingsViewController alloc] initWithNibName:nil bundle:nil];
  64. _mainViewController = [[UITabBarController alloc] init];
  65. _mainViewController.tabBar.barTintColor = [UIColor VLCOrangeTintColor];
  66. _mainViewController.viewControllers = @[[[UINavigationController alloc] initWithRootViewController:_localNetworkVC],
  67. [[UINavigationController alloc] initWithRootViewController:_cloudServicesVC],
  68. [[UINavigationController alloc] initWithRootViewController:_remotePlaybackVC],
  69. [[UINavigationController alloc] initWithRootViewController:_openNetworkVC],
  70. [[UINavigationController alloc] initWithRootViewController:_settingsVC]];
  71. self.window.rootViewController = _mainViewController;
  72. // Init the HTTP Server
  73. [VLCHTTPUploaderController sharedInstance];
  74. [self.window makeKeyAndVisible];
  75. return YES;
  76. }
  77. @end