tags:

views:

189

answers:

1

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;
    imagePicker.delegate = self;
    [self presentModalViewController:imagePicker animated:YES];   
    [imagePicker release];       
}
else
    [imagePicker release];
+1  A: 

Use UIImagePickerController with

cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo

Read the UIImagePickerController Class Reference documentation for more details.

lukya
Can you help me with a sample code,also i am using the code above and it engages the pickerview in camera mode picture not video.
TechThirsty