开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜