0
votes

Hey guys a quick question!

I am making an iPad app which uses the dropbox sync api. Now I am wondering how to play movie files within my dropbox filesystem in the MPMovieplayer. Since the dropbox filesystem is not the same as the local sandbox and I don't know how to retrieve a nsurl of the file I can't play the video.

This is something I tried (my last hope) but it doesn't work:

+(NSString*)loadMovie : (DBPath*)path
{
    DBFile *file = [self openFileAtPath:path];
    NSData *data = [[NSData alloc] initWithData:[file readData:nil]];

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *vpath = [documentsDirectory stringByAppendingPathComponent:file.info.path.name];
    [[NSFileManager defaultManager] createFileAtPath:vpath contents:data attributes:nil];
    return vpath;
}
1

1 Answers

0
votes

You'll need to write the file out to local storage first. See https://forums.dropbox.com/topic.php?id=110085 on the Dropbox forum.