2014-10-02 111 views
0

我使用下面的代碼來捕獲圖像和視頻使用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]; 

回答

0

這似乎是Quickblox的一個錯誤。根據QuickBlox支持,我們應該設置並使用自定義視頻捕捉會話 - 這可能會解決此問題。我還沒有嘗試過。

0

的的UIImagePickerController也有cameraCaptureMode屬性。將其設置爲所需的模式。

enum { 
    UIImagePickerControllerCameraCaptureModePhoto , 
    UIImagePickerControllerCameraCaptureModeVideo 
}; 
typedef NSUInteger UIImagePickerControllerCameraCaptureMode; 
+0

它沒有效果,並在某些情況下,產生崩潰。 – Mustafa 2014-10-02 12:40:47

相關問題