使用UISaveVideoAtPathToSavedPhotosAlbum从api上传和保存视频

时间:2015-07-30 16:41:40

标签: ios objective-c iphone ios8.3

我的视频通过我的应用程序中的一个api显示。我想上传并将其保存在我的设备上,我正在使用此代码:

- (IBAction)saveMovie:(id)sender {

    NSString *path = @"http://development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4";

    if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)){
        UISaveVideoAtPathToSavedPhotosAlbum(path, nil, nil, nil);
        [self alert];
    } else {
        NSLog(@"incompatible video");
    }
}

链接“path”是一个自己的链接,用于上传文件,但也有视图链接。

当我调用接收答案的方法时

Video http://development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4 cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x1660f300 {NSErrorFailingURLStringKey=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4, NSErrorFailingURLKey=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4, NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x16542030 "The operation couldn’t be completed. No such file or directory", NSURL=file:///http:/xerofit-development.s3.amazonaws.com/uploads/f1a97ec0-e47f-470e-96a6-de98d2235dd0/Biceps.mp4}

出了什么问题?

0 个答案:

没有答案