I use UIImagePickerController in part of my application, which allows the user to select a video from a camera roll. The problem I am facing is that when I select certain videos from the image view controller at runtime, I get a dialog box that says “Operation could not be completed” and the application freezes.
The error and freezing occur as soon as you click on the video that you want from the camera’s clip, and before you click the “Select” button - therefore, when an error didFinishPickingMediaWithInfo() is not already running.
Error triggering videos are not damaged files, as I can perfectly observe them using my Camera Camera application directly.
Here is the code that I have in my project to set up a UIImagePickerViewController:
videoViewController = UIImagePickerController() videoViewController.delegate = self videoViewController.sourceType = UIImagePickerControllerSourceType.PhotoLibrary videoViewController.mediaTypes = [kUTTypeMovie as String] videoViewController.allowsEditing = false videoViewController.modalPresentationStyle = .CurrentContext
The two files that trigger this error have one thing in common - they were both emailed to me from another phone. But if they are not corrupt, what could happen?
ios swift uiimagepickercontroller
Clayj
source share