任何人都可以帮我解决iPhone4的视频捕获代码问题。
我正在使用以下代码,但它不起作用:
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];
答案 0 :(得分:2)
将UIImagePickerController与
一起使用 cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo
阅读UIImagePickerController Class Reference文档了解更多详情。