|
@@ -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
|