sample video capture code for iPhone4
<p>Hi can anybody help me with video capture code for iPhone4.</p>

<p>i am using the following code but it does not work:</p>

<pre><code>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];
</code></pre>
