Commit dd606337 authored by Felix Paul Kühne's avatar Felix Paul Kühne

ATV cloud services: add basic dropbox support

parent 64ef62bf
......@@ -12,16 +12,21 @@
#import "VLCCloudServicesTVViewController.h"
#import <DropboxTVSDK/DropboxSDK.h>
#import "VLCDropboxController.h"
#import "VLCDropboxTableViewController.h"
#import "SSKeychain.h"
#import "VLCPlayerDisplayController.h"
@interface VLCCloudServicesTVViewController ()
@property (nonatomic) VLCDropboxTableViewController *dropboxTableViewController;
@end
@implementation VLCCloudServicesTVViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.dropboxTableViewController = [[VLCDropboxTableViewController alloc] initWithNibName:@"VLCCloudStorageTableViewController" bundle:nil];
}
- (NSString *)title
......@@ -31,25 +36,28 @@
- (void)dropbox:(id)sender
{
if (![[VLCDropboxController sharedInstance] isAuthorized]) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Login failure"
message:@"To use Dropbox, you need to login to iCloud with the same ID to both this Apple TV and an iOS device.\nAfterwards, login to Dropbox using the VLC app on your iOS device and try again."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil)
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction * action) {
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_RETRY", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[self dropbox:nil];
}];
[alert addAction:defaultAction];
[alert addAction:cancelAction];
[self presentViewController:alert animated:YES completion:nil];
if ([[VLCDropboxController sharedInstance] restoreFromSharedCredentials]) {
[self showDetailViewController:self.dropboxTableViewController sender:self];
return;
}
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Login failure"
message:@"To use Dropbox, you need to login to iCloud with the same ID to both this Apple TV and an iOS device.\nAfterwards, login to Dropbox using the VLC app on your iOS device and try again."
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil)
style:UIAlertActionStyleDestructive
handler:^(UIAlertAction * action) {
}];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_RETRY", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
[self dropbox:nil];
}];
[alert addAction:defaultAction];
[alert addAction:cancelAction];
[self presentViewController:alert animated:YES completion:nil];
}
@end
......@@ -16,6 +16,7 @@
#define kVLCApplicationGroupIdentifier @"group.org.videolan.vlc-ios"
#define kVLCRecentURLs @"recent-urls"
#define kVLCStoreDropboxCredentials @"kVLCStoreDropboxCredentials"
#define kSupportedFileExtensions @"\\.(3gp|3gp|3gp2|3gpp|amv|asf|avi|axv|divx|dv|flv|f4v|gvi|gxf|m1v|m2p|m2t|m2ts|m2v|m4v|mks|mkv|moov|mov|mp2v|mp4|mpeg|mpeg1|mpeg2|mpeg4|mpg|mpv|mt2s|mts|mxf|mxg|nsv|nuv|oga|ogg|ogm|ogv|ogx|spx|ps|qt|rec|rm|rmvb|tod|ts|tts|vlc|vob|vro|webm|wm|wmv|wtv|xesc)$"
#define kSupportedSubtitleFileExtensions @"\\.(srt|sub|cdg|idx|utf|ass|ssa|aqt|jss|psb|rt|smi|txt|smil)$"
......
......@@ -66,6 +66,8 @@
7D00161C177056B700649F27 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 7D00161A17704DAC00649F27 /* main.js */; };
7D0117F1187F4BA400C5671C /* VLCFirstStepsFirstPageViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D0117F0187F4BA400C5671C /* VLCFirstStepsFirstPageViewController~ipad.xib */; };
7D0363AC1B2F325500CC0343 /* MediaLibrary.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7D0363A71B2F325500CC0343 /* MediaLibrary.xcdatamodeld */; };
7D0C34E61BD94DEE0058CD19 /* VLCCloudStorageTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D0C34E51BD94DEE0058CD19 /* VLCCloudStorageTableViewController.xib */; };
7D0C34E71BD951080058CD19 /* NSString+SupportedMedia.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784C5183A9972009EE944 /* NSString+SupportedMedia.m */; };
7D1052E91A4DCC1100295F08 /* VLCOneDriveTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1052E81A4DCC1100295F08 /* VLCOneDriveTableViewController.m */; };
7D1052EE1A4DCD1E00295F08 /* VLCOneDriveController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1052ED1A4DCD1E00295F08 /* VLCOneDriveController.m */; };
7D1276621AADA0E600F0260C /* VLCMultiSelectionMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D1276611AADA0E600F0260C /* VLCMultiSelectionMenuView.m */; };
......@@ -141,6 +143,10 @@
7D5CAA8C1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5CAA8B1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.m */; };
7D5DD5C717590ABF001421E3 /* About Contents.html in Resources */ = {isa = PBXBuildFile; fileRef = 7D5DD5C617590ABF001421E3 /* About Contents.html */; };
7D6069691BD92E6900AB765C /* libSDropboxSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D5278CD1BD7DE3D00D0CA0E /* libSDropboxSDK.a */; };
7D60696A1BD93ABF00AB765C /* VLCCloudStorageTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B088307183D7BEC004B5C2A /* VLCCloudStorageTableViewController.m */; };
7D60696B1BD93AC800AB765C /* VLCDropboxTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784AC183A9906009EE944 /* VLCDropboxTableViewController.m */; };
7D60696C1BD93BE200AB765C /* VLCCloudStorageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3784B0183A990F009EE944 /* VLCCloudStorageTableViewCell.m */; };
7D6069721BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D6069711BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib */; };
7D63C19018774B1700BD5256 /* VLCFirstStepsSecondPageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D63C18E18774B1700BD5256 /* VLCFirstStepsSecondPageViewController.m */; };
7D63C19518774E0100BD5256 /* VLCFirstStepsThirdPageViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D63C19418774E0100BD5256 /* VLCFirstStepsThirdPageViewController~ipad.xib */; };
7D63C19718774F1000BD5256 /* VLCFirstStepsFourthPageViewController~ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D63C19618774F1000BD5256 /* VLCFirstStepsFourthPageViewController~ipad.xib */; };
......@@ -526,6 +532,7 @@
7D0363A91B2F325500CC0343 /* MediaLibrary-2.5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MediaLibrary-2.5.xcdatamodel"; sourceTree = "<group>"; };
7D0363AA1B2F325500CC0343 /* MediaLibrary-2.6.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MediaLibrary-2.6.xcdatamodel"; sourceTree = "<group>"; };
7D0363AB1B2F325500CC0343 /* MediaLibrary-2.7.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "MediaLibrary-2.7.xcdatamodel"; sourceTree = "<group>"; };
7D0C34E51BD94DEE0058CD19 /* VLCCloudStorageTableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VLCCloudStorageTableViewController.xib; path = "VLC for Apple TV/VLCCloudStorageTableViewController.xib"; sourceTree = SOURCE_ROOT; };
7D1052E71A4DCC1100295F08 /* VLCOneDriveTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCOneDriveTableViewController.h; path = Sources/VLCOneDriveTableViewController.h; sourceTree = SOURCE_ROOT; };
7D1052E81A4DCC1100295F08 /* VLCOneDriveTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCOneDriveTableViewController.m; path = Sources/VLCOneDriveTableViewController.m; sourceTree = SOURCE_ROOT; };
7D1052EB1A4DCC4B00295F08 /* VLCOneDriveConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VLCOneDriveConstants.h; path = Sources/VLCOneDriveConstants.h; sourceTree = SOURCE_ROOT; };
......@@ -675,6 +682,7 @@
7D5CAA8A1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCTrackSelectorHeaderView.h; path = Sources/VLCTrackSelectorHeaderView.h; sourceTree = SOURCE_ROOT; };
7D5CAA8B1A4AD8E5003F2CBC /* VLCTrackSelectorHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCTrackSelectorHeaderView.m; path = Sources/VLCTrackSelectorHeaderView.m; sourceTree = SOURCE_ROOT; };
7D5DD5C617590ABF001421E3 /* About Contents.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "About Contents.html"; sourceTree = "<group>"; };
7D6069711BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = VLCCloudStorageTableViewCell.xib; path = "VLC for Apple TV/VLCCloudStorageTableViewCell.xib"; sourceTree = SOURCE_ROOT; };
7D63C18D18774B1700BD5256 /* VLCFirstStepsSecondPageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCFirstStepsSecondPageViewController.h; path = Sources/VLCFirstStepsSecondPageViewController.h; sourceTree = SOURCE_ROOT; };
7D63C18E18774B1700BD5256 /* VLCFirstStepsSecondPageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCFirstStepsSecondPageViewController.m; path = Sources/VLCFirstStepsSecondPageViewController.m; sourceTree = SOURCE_ROOT; };
7D63C19418774E0100BD5256 /* VLCFirstStepsThirdPageViewController~ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "VLCFirstStepsThirdPageViewController~ipad.xib"; path = "Resources/VLCFirstStepsThirdPageViewController~ipad.xib"; sourceTree = SOURCE_ROOT; };
......@@ -1682,11 +1690,13 @@
7DC71D281BC83138001FACAA /* xibs */ = {
isa = PBXGroup;
children = (
7D6069711BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib */,
7D3E528A1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib */,
7DEC8BDD1BD67899006E1093 /* VLCFullscreenMovieTVViewController.xib */,
7DC71D201BC83058001FACAA /* VLCAppSharesTVViewController.xib */,
7DC71D251BC830A5001FACAA /* VLCLocalNetworkTVViewController.xib */,
7D7EF3D91BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.xib */,
7D0C34E51BD94DEE0058CD19 /* VLCCloudStorageTableViewController.xib */,
);
name = xibs;
sourceTree = "<group>";
......@@ -2278,10 +2288,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7D6069721BD94AD600AB765C /* VLCCloudStorageTableViewCell.xib in Resources */,
7DEC8BDF1BD67899006E1093 /* VLCFullscreenMovieTVViewController.xib in Resources */,
7DC71D271BC830A5001FACAA /* VLCLocalNetworkTVViewController.xib in Resources */,
7DC71D221BC83058001FACAA /* VLCAppSharesTVViewController.xib in Resources */,
7DEC8C1E1BD69710006E1093 /* About Contents.html in Resources */,
7D0C34E61BD94DEE0058CD19 /* VLCCloudStorageTableViewController.xib in Resources */,
7D13294F1BA1F10100BE647E /* Assets.xcassets in Resources */,
7DEC8BE91BD68BC9006E1093 /* Settings.bundle in Resources */,
7D3E528C1BD7B5E100309D15 /* VLCCloudServicesTVViewController.xib in Resources */,
......@@ -2475,10 +2487,12 @@
buildActionMask = 2147483647;
files = (
7DEC8C1F1BD6A113006E1093 /* UIDevice+VLC.m in Sources */,
7D0C34E71BD951080058CD19 /* NSString+SupportedMedia.m in Sources */,
7DC71D211BC83058001FACAA /* VLCAppSharesTVViewController.m in Sources */,
7DEC8BED1BD68D6A006E1093 /* VLCAboutTVViewController.m in Sources */,
7DEC8BD81BD66DA8006E1093 /* VLCMiniPlaybackView.m in Sources */,
7D7EF3DA1BD56B5900CD4CEE /* VLCOpenNetworkStreamTVViewController.m in Sources */,
7D60696C1BD93BE200AB765C /* VLCCloudStorageTableViewCell.m in Sources */,
7D7EF3DD1BD5779F00CD4CEE /* VLCPlaybackController.m in Sources */,
7DEC8BDE1BD67899006E1093 /* VLCFullscreenMovieTVViewController.m in Sources */,
7DEC8BD71BD658E6006E1093 /* VLCPlayerDisplayController.m in Sources */,
......@@ -2486,10 +2500,12 @@
7D5278E21BD7E06E00D0CA0E /* VLCDropboxController.m in Sources */,
7DEC8BD91BD670EB006E1093 /* VLCPlaybackNavigationController.m in Sources */,
7DEC8BDA1BD67112006E1093 /* VLCFrostedGlasView.m in Sources */,
7D60696B1BD93AC800AB765C /* VLCDropboxTableViewController.m in Sources */,
7D1329441BA1F10100BE647E /* AppleTVAppDelegate.m in Sources */,
7D1329411BA1F10100BE647E /* main.m in Sources */,
7DC71D291BC83590001FACAA /* UIColor+Presets.m in Sources */,
7D5278E41BD7E37300D0CA0E /* VLCCloudStorageController.m in Sources */,
7D60696A1BD93ABF00AB765C /* VLCCloudStorageTableViewController.m in Sources */,
7D3E528B1BD7B5E100309D15 /* VLCCloudServicesTVViewController.m in Sources */,
7DEC8C1D1BD6913A006E1093 /* VLCSettingsAboutTableViewController.m in Sources */,
);
......@@ -2798,6 +2814,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(CONFIGURATION_BUILD_DIR)",
"$(SRCROOT)/ImportedSources/Dropbox/DropboxSDK/Classes/**",
);
INFOPLIST_FILE = "VLC for Apple TV/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......@@ -2846,6 +2863,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(CONFIGURATION_BUILD_DIR)",
"$(SRCROOT)/ImportedSources/Dropbox/DropboxSDK/Classes/**",
);
INFOPLIST_FILE = "VLC for Apple TV/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......@@ -2894,6 +2912,7 @@
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(CONFIGURATION_BUILD_DIR)",
"$(SRCROOT)/ImportedSources/Dropbox/DropboxSDK/Classes/**",
);
INFOPLIST_FILE = "VLC for Apple TV/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
......
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