视频捕获代码不适用于iphone 4

时间:2010-07-20 12:28:18

标签: iphone

我使用UiImagePickerController在iPhone 3GS中捕获了视频,但同样的应用程序没有使用iPhone 4上的摄像头,它在iPhone 3GS(OS 4)上运行良好。

以下是我用来使用摄像机的代码。

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.mediaTypes =  [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];   
[imagePicker release];

1 个答案:

答案 0 :(得分:0)

你需要指定你的 UIImagePickerControllerCameraDevice 要么 UIImagePickerControllerCameraDeviceRearUIImagePickerControllerCameraDeviceFront 在iPhone 4上

另外,设置

UIImagePickerControllerCameraCaptureModeUIImagePickerControllerCameraCaptureModeVideo

iPhone UIImageController Reference