Reputation: 3
I'm getting error when downloading video from photos. The video is stored in iCloud and displaying in photos.
My swift code:
let picker = UIImagePickerController()
picker.delegate = self
picker.sourceType = .photoLibrary
picker.mediaTypes = [kUTTypeMovie as NSString as String]
picker.present(imag, animated: true, completion: nil)
public func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
let videoAsset = AVURLAsset.init(url:(info[UIImagePickerControllerMediaURL] as! NSURL) as URL)
}
When UIImagePickerController
presented, It's displaying all video file in controller. And then I'm selecting one video that is stored in iCloud. Sometimes I'm getting below error. Not every time.
Can anyone help me to get out this?
Upvotes: 0
Views: 1353
Reputation: 16
Upvotes: 0