我使用Alfie Hanssen的VimeoUpload:https://github.com/alfiehanssen
我需要我的应用将视频设置为私有或密码保护。
我还需要格式化文件名:strTitle,strCharacter,strStage .mp4
我在DropBox中使用的文件名如下:
#pragma mark - DropBox
- (void) didHomeToDropbox:(NSNotification*)notification {
[self uploadVideoToDropBox];
}
- (void) uploadVideoToDropBox {
NSString* strTitle = [AuditionObject sharedManager].strAuditionTitle;
NSString* strCharacter = [AuditionObject sharedManager].strCharacter;
NSString* strStage = [[NSUserDefaults standardUserDefaults] objectForKey:UserStageName];
NSString* prefix;
if (strStage) {
prefix = [NSString stringWithFormat:@"%@-%@-%@", strTitle, strCharacter, strStage];
}else {
prefix = [NSString stringWithFormat:@"%@-%@", strTitle, strCharacter];
}
NSString *fileName = [Util getFileName:prefix Type:@"mp4"];
NSString *destinationPath = @"/";
NSURL *videoURL = [NSURL URLWithString:[AuditionObject sharedManager].strVideoPath];
[SVProgressHUD show];
self.restClient = [[DBRestClient alloc] initWithSession:[DBSession sharedSession]];
self.restClient.delegate = self;
dispatch_async(dispatch_get_main_queue(), ^{
[self.restClient uploadFile:fileName toPath:destinationPath withParentRev:nil fromPath:[videoURL path]];
});
}
Vimeo设置在这里:
#pragma mark - Vimeo
- (void) uploadVideoToVimeo {
[SVProgressHUD show];
AppDelegate *app = (AppDelegate*)[UIApplication sharedApplication].delegate;
[app startUpload];
}
- (void) didSuccessHomeToVimeo:(NSNotification*)notification {
[AuditionObject sharedManager].isUploaded = YES;
[self ChangePlistData];
[_collectionView reloadData];
}
答案 0 :(得分:0)
感谢@ user3634131发帖,
您可以设置视频隐私值,VimeoUpload支持此值。请查看README文件以获取相关说明。您还可以查看VideoSettings课程。请参阅此处了解您可以传递的list of privacy values。
您可以指定视频的标题(请参阅上面的链接),但不能指定Vimeo服务器上的实际文件名。如果您愿意,您当然可以控制本地文件名,这完全取决于您。