标签:调用像头时默认摄像
if(![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误提示" message:@"没有发现摄像头" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
return;
}
UIImagePickerController *pickerVideo = [[UIImagePickerController alloc] init];
pickerVideo.sourceType = UIImagePickerControllerSourceTypeCamera;
pickerVideo.delegate = self;
pickerVideo.allowsEditing = YES;
pickerVideo.videoQuality = 2;
pickerVideo.videoMaximumDuration = 60.0f;
pickerVideo.cameraDevice = UIImagePickerControllerCameraDeviceFront;
pickerVideo.mediaTypes = [NSArray arrayWithObject:@"public.movie"];
[self presentViewController:pickerVideo animated:YES completion:nil];
标签:调用像头时默认摄像
原文地址:http://5828666.blog.51cto.com/5818666/1577631