sample video capture code for iPhone4
Hi can anybody help me with video capture code for iPhone4.
i am using the following code but it does not work:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
NSArray *arraySourceTypes =[UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
if ([arraySourceTypes containsObject:(NSString *)kUTTypeMovie]){
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
imagePicker.cameraDevice=UIImagePickerControllerCameraDeviceRear;
imagePicker.cameraCaptureMode=UIImagePickerControllerCameraCaptureModeVideo;
imagePicker.videoQuality=UIImagePickerControllerQualityTypeHigh;
imag开发者_StackOverflowePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
}
else
[imagePicker release];
Use UIImagePickerController with
cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo
Read the UIImagePickerController Class Reference documentation for more details.
精彩评论