我使用下面的代碼來捕獲圖像和視頻使用UIImagePickerController
。代碼完美運行,直到我使用Quickblox發起視頻聊天。在我開始並結束視頻聊天會話後,用於捕獲視頻的UIImagePickerController
代碼停止工作,即不是捕獲視頻,而是呈現用於拍攝圖片的控制器。有什麼想法嗎?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];
它沒有效果,並在某些情況下,產生崩潰。 – Mustafa 2014-10-02 12:40:47