Try This code..
-(void)recordVideo{
imagePicker = [[UIImagePickerController alloc]init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [[NSArray alloc]initWithObjects:(NSString *) kUTTypeMovie, (NSString *) kUTTypeMPEG4, nil];
imagePicker.videoQuality = UIImagePickerControllerQualityTypeIFrame1280x720;
[imagePicker setVideoMaximumDuration:10.0f];
sourceType = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
if (![sourceType containsObject:(NSString *) kUTTypeMovie]) {
NSLog(@"Can not Save Video");
}
[self presentModalViewController:imagePicker animated:YES];
}
Make sure that, you have to set allowsEditing
to YES
before presenting the controller.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.