Trying to allow user to upload video from camera roll using PHPickerViewController (eventually to firebase storage) which is why I'm trying to get the url, but I'm getting this annoying error:
Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.video" UserInfo={NSLocalizedDescription=Cannot load representation of type public.video}
Here is some code:
func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult])
{
dismiss(animated: true, completion: nil)
guard let itemProvider = results.first?.itemProvider else { print("isbeingcalled"); return }
itemProvider.loadFileRepresentation(forTypeIdentifier: UTType.video.identifier)
{ (url, error) in
guard error == nil else { print(error!); return /**Alert**/ }
print(url!)
}
I've seen some other posts saying it might be a bug, so if it is, then what should I do?