You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/08/07 22:50:15 UTC

[GitHub] [cordova-plugin-file] skmbr commented on issue #426: Storage updates in Android 11

skmbr commented on issue #426:
URL: https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-894715087


   I've read through this entire thread (trying to follow as much as I can), the Google docs on scoped storage, and other issues and stackoverflow posts and I'm still not 100% sure that this issue applies to me, so if anyone can tell me I'd really appreciate it...
   
   For a feature I'm working on (involving opening a video, overlaying text on it with canvas, and capturing the output) I need the video and page to be same origin. So I've tried to use API30 and cordova-android@10.0.1 for the WebViewAssetLoader functionality to serve my app from https://localhost.
   
   The problem I have is that after updating (from API29 / cordova-android@9.1), when I select a video from the photo library, using previously working code like this:
   
   ```
             navigator.camera.getPicture(
               file => {
                 file = file.indexOf('file://') === 0 ? file : 'file://' + file
                 window.resolveLocalFileSystemURL(file, (fileEntry) => {
                   this.video = fileEntry.toInternalURL() // Vue.js data property that populates video src
                 })
               },
   
               () => {},
   
               {
                 destinationType: Camera.DestinationType.FILE_URI,
                 sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                 mediaType: Camera.MediaType.VIDEO
               }
             )
           }
   ```
   ... I get an error like this in the console:
   
   `GET cdvfile://localhost/sdcard/DCIM/Camera/VID_20210802_200106.mp4 net::ERR_UNKNOWN_URL_SCHEME`
   
   If I go back to API29 / cordova-android@9.1 it works fine again.
   
   Where I'm not sure if this is the same issue is from comments like this one by @HarelM https://github.com/apache/cordova-plugin-file/issues/426#issuecomment-751977160 :
   
   > @Vatsov Are you reading a file a user selects? If so I don't think there's an issue that is related to Android 11, or at least I hope not as you open the file picker and this should be OK even in Android 11 as far as I know.
   
   ...and things that I read in google's docs that seem to suggest that reading the users photo/video library is treated differently to accessing other types of file.
   
   Regardless, I've still tried adding the MANAGE_EXTERNAL_STORAGE permission, but that hasn't seemed to have any effect.
   
   So can anyone tell me if this is the same issue? Or is it a different one caused by the upgrade to API30 and/or cordova-android@10.0.1 ?
   
   To be honest I'm feeling a little out of my depth here and would very much like to get back to my cosy javascript safe place! :)
   
   Thanks in advance for any help or suggestions!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org