我收到错误,UIVideoEditorController
无法找到使用URL
加载并存储在字典中的视频UIImagePicker
。
我正在使用以下内容,但是对于以下网址,canEditVideoAtPath返回false:
file:///private/var/mobile/Containers/Data/Application/83449852-2DC2-42AB-9FFA-C2C7931380C4/tmp/trim.28F7EE00-9F2E-4421-8E2B-8A70789CAFDE.MOV
知道为什么以下代码不起作用?
NSLog(@"%@",[[self.movieArray objectAtIndex:[sender tag]] objectForKey:@"MovieURL"]);
NSString *videoPath = [NSString stringWithFormat:@"%@",[[self.movieArray objectAtIndex:[sender tag]] objectForKey:@"MovieURL"]];
UIVideoEditorController *editorController = [[UIVideoEditorController alloc] init];
if([UIVideoEditorController canEditVideoAtPath:videoPath]){
editorController.videoPath = [NSString stringWithFormat:@"%@",[[self.movieArray objectAtIndex:[sender tag]] objectForKey:@"MovieURL"]];
editorController.delegate = self;
editorController.videoQuality = UIImagePickerControllerQualityTypeHigh;
self.popoverController = [[UIPopoverController alloc] initWithContentViewController:editorController];
self.popoverController.delegate = self;
[self.popoverController presentPopoverFromRect:((UIButton *)sender).bounds inView:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
我收到错误消息
The requested URL was not found on this server
答案 0 :(得分:2)
从路径字符串中删除file://
答案 1 :(得分:1)
尝试使用 - (NSString *)路径。绝对URL不起作用。
[[[self.movieArray objectAtIndex:[sender tag]] objectForKey:@"MovieURL"] path]