Posts

Post not yet marked as solved
1 Replies
747 Views
Hi, I'm using a UIDocumentPickerViewController to allow the user to open a video file stored in cloud storage providers. In the UIDocumentPickerDelegate -> documentPicker(_ :, didPickDocumentsAt:) I check the URL is valid and simply set let video = AVURLAsset(url: url). Before this I add url.startAccessingSecurityScopedResource().  This works fine for Dropbox. For Google Drive, however, I get a valid URL, but the resulting AVAsset has both isPlayable and isReadable set to false, and the video can't play. Interestingly, this happens for some files in the drive, but not all. The files that cannot load have no video thumbnail (just generic video icon) and the ones that load correctly have a preview thumbnail - hinting that the Google Drive provider somehow treats these files differently. I've tried using the Google Drive app to make the files available offline, which I thought may make a difference, with no luck. I can't figure out what the difference is, or how to get these files to load into my AVURLAsset. One more thing - I disabled the "Privacy Screen" setting in Google Drive, which prevented any files from loading in the document picker. Any ideas? Is there a security setting I need to know about? Thanks!
Posted Last updated
.