上传和保存视频从api与UISaveVideoAtPathToSavedPhotosAlbum



我有一个视频,通过我的应用程序中的一个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}

怎么了?

我试着从NSTemporaryDirectory做它,它工作了。似乎,如果一个人接受这种方式。

在这里我输入url

http://qa-elb-765904057.us-west-2.elb.amazonaws.com/plugin/execute?pluginName=xxxx&pluginMethod=xxxx&clientId=b0007920-88b4-11e5-a62a-fxxxxx&token=xxx94d60-91xx-11e5-a62a-f362d1d2xxx0&file_key=Mbxxx5v6RxxxQOR.mp4

,错误是

Video /plugin/execute cannot be saved to the saved photos album: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo=0x176644e0 {NSErrorFailingURLStringKey=file:///plugin/execute, NSErrorFailingURLKey=file:///plugin/execute, NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x17661850 "The operation couldn’t be completed. No such file or directory", NSURL=file:///plugin/execute}

似乎整个发送的url只检测到这个

/plugin/execute

相关内容

  • 没有找到相关文章

最新更新