【问题标题】:upload and save video from api with UISaveVideoAtPathToSavedPhotosAlbum使用 UISaveVideoAtPathToSavedPhotosAlbum 从 api 上传和保存视频
【发布时间】:2015-07-30 16:41:40
【问题描述】:

我有一个通过我的应用程序中的一个 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");
    }
}

链接“路径”是上传文件的自己的链接,但也有查看链接。

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

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}

怎么了?

【问题讨论】:

  • 我也有同样的问题。

标签: ios objective-c iphone ios8.3


【解决方案1】:

我尝试从 NSTemporaryDirectory 执行此操作,并且成功了。看来,如果有人接受这种方式。

就我而言,我放了这个网址

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 2016-01-12
    • 1970-01-01
    • 2012-10-27
    • 2019-03-15
    相关资源
    最近更新 更多