ios - Unable to saving a video to photo library -
here's code:
alassetslibrary *library = [[alassetslibrary alloc] init]; nsurl *videourl =[info objectforkey:uiimagepickercontrollermediaurl]; if ([library videoatpathiscompatiblewithsavedphotosalbum:videourl]) { [library writevideoatpathtosavedphotosalbum:videourl completionblock:^(nsurl *asseturl, nserror *error) { if (error) { nslog(@"error"); } else { nslog(@"video asseturl %@", asseturl); } }]; } else nslog(@"videoatpath not compatible photos album.");
the videourl file:///private/var/mobile/containers/data/application/b1f512ea-6d13-4df1-86db-f6166f0d533f/tmp/capture-t0x17511a30.tmp.pg4pbh/capturedvideo.mov
i maintain getting error when saving video saved photo album. , homecoming message:
video /private/var/mobile/containers/data/application/b1f512ea-6d13-4df1-86db-f6166f0d533f/tmp/capture-t0x17511a30.tmp.pg4pbh/capturedvideo.mov cannot saved saved photos album: error domain=nsurlerrordomain code=-1100 "the requested url not found on server." userinfo=0x1b3e5e40 {nserrorfailingurlstringkey=file:///private/var/mobile/containers/data/application/b1f512ea-6d13-4df1-86db-f6166f0d533f/tmp/capture-t0x17511a30.tmp.pg4pbh/capturedvideo.mov, nserrorfailingurlkey=file:///private/var/mobile/containers/data/application/b1f512ea-6d13-4df1-86db-f6166f0d533f/tmp/capture-t0x17511a30.tmp.pg4pbh/capturedvideo.mov, nslocalizeddescription=the requested url not found on server., nsunderlyingerror=0x1b2ce310 "the operation couldn’t completed. no such file or directory", nsurl=file:///private/var/mobile/containers/data/application/b1f512ea-6d13-4df1-86db-f6166f0d533f/tmp/capture-t0x17511a30.tmp.pg4pbh/capturedvideo.mov}
the error message says file doesn't exist, possibilities are:
file address not correct, can check sandbox of app see whether video file physically exists. if exist, check whether video valid , playable. invalid video rejected saved album.
or capture module didn't work, expecting file written in directory, didn't happen because capture failed.
ios video save xcode6
No comments:
Post a Comment