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

DropboxController: add streaming support (refs #9784)

UI yet todo
parent f074e3a8
......@@ -34,5 +34,6 @@
- (void)requestDirectoryListingAtPath:(NSString *)path;
- (void)downloadFileToDocumentFolder:(DBMetadata *)file;
- (void)streamFile:(DBMetadata *)file;
@end
......@@ -72,6 +72,12 @@
}
}
- (void)streamFile:(DBMetadata *)file
{
if (!file.isDirectory)
[[self restClient] loadStreamableURLForFile:file.path];
}
- (void)_triggerNextDownload
{
if (_listOfDropboxFilesToDownload.count > 0 && !_downloadInProgress) {
......@@ -159,6 +165,18 @@
[self.delegate currentProgressInformation:progress];
}
- (void)restClient:(DBRestClient*)restClient loadedStreamableURL:(NSURL*)url forFile:(NSString*)path
{
VLCAppDelegate *appDelegate = (VLCAppDelegate *)[UIApplication sharedApplication].delegate;
/* DBX returns a https URL which we don't support yet. in turn, we fall back on http */
[appDelegate openMovieFromURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@%@", url.host, url.path]]];
}
- (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error
{
APLog(@"loadStreamableURL failed with error %i", error.code);
}
#pragma mark - DBSession delegate
- (void)sessionDidReceiveAuthorizationFailure:(DBSession *)session userId:(NSString *)userId
......
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