我使用下面的代码使用UIImagePickerController
捕获图像和视频。代码工作正常,直到我使用Quickblox启动视频聊天。在我启动并结束视频聊天会话后,用于捕获视频的UIImagePickerController
代码停止工作,即不是捕获视频,而是呈现用于拍摄图片的控制器。有什么想法吗?
捕获图片
UIImagePickerController *controller = [[UIImagePickerController alloc] init];
controller.delegate = self;
controller.allowsEditing = NO;
controller.sourceType = UIImagePickerControllerSourceTypeCamera;
controller.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil];
[self presentViewController:controller animated:YES completion:nil];
捕获视频
UIImagePickerController *controller = [[UIImagePickerController alloc] init];
controller.sourceType = UIImagePickerControllerSourceTypeCamera;
controller.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
controller.videoQuality = UIImagePickerControllerQualityTypeLow;
controller.videoMaximumDuration = 90;
controller.delegate = self;
[self presentViewController:controller animated:YES completion:nil];
答案 0 :(得分:0)
UIImagePickerController还有一个cameraCaptureMode属性。将其设置为所需的模式。
enum {
UIImagePickerControllerCameraCaptureModePhoto ,
UIImagePickerControllerCameraCaptureModeVideo
};
typedef NSUInteger UIImagePickerControllerCameraCaptureMode;
答案 1 :(得分:0)
这似乎是Quickblox的一个错误。根据Quickblox支持,我们应该设置并使用自定义视频捕获会话 - 这可能会解决此问题。我还没试过。