UIVideoEditorController
UIVideoEditorController is a view controller that presents an interface for trimming video. Its view and internal behavior are outside your control. You are expected to present the view controller’s view, probably modally (or, on the iPad, in a popover, though in fact I haven’t been able to get this view controller to work properly on the iPad no matter how I present it), and respond by way of its delegate.
Before summoning a UIVideoEditorController, be sure to call its class method canEditVideoAtPath:. Not every video format is editable, and not every device supports video editing. If this call returns NO, you can’t use an instance of this class. (This call can take some noticeable time to return.) You must also set the UIVideoEditorController instance’s delegate and videoPath before presenting it modally:
NSString* path = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"mov"];
BOOL can = [UIVideoEditorController canEditVideoAtPath:path];
if (!can) {
NSLog(@"can't edit this video");
return;
}
UIVideoEditorController* vc = [[UIVideoEditorController alloc] init];
vc.delegate = self;
vc.videoPath = path;
[self presentModalViewController:vc animated:YES];
[vc release];The view’s interface contains Cancel and Save buttons, a trimming box displaying thumbnails from the movie, a Play/Pause button, and the movie itself. The user slides the ends of the trimming box to set the beginning and end of the saved movie. The Cancel and Save buttons do not dismiss the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access