Unable to load video in UIVideoEditorController

I am getting an error when UIVideoEditorController

I cannot find a video URL

that was uploaded with UIImagePicker

and saved in the dictionary.

I am using the following, but canEditVideoAtPath returns false for the following URL:

file:///private/var/mobile/Containers/Data/Application/83449852-2DC2-42AB-9FFA-C2C7931380C4/tmp/trim.28F7EE00-9F2E-4421-8E2B-8A70789CAFDE.MOV

      

Any idea why the following code won't work?

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];

}

      

I am getting error messages

The requested URL was not found on this server

      

+3


source to share


2 answers


remove file://

from path line



+2


source


Try using path (NSString *). An absolute url won't work.



[[[self.movieArray objectAtIndex:[sender tag]] objectForKey:@"MovieURL"] path]

0


source







All Articles