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


   > 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 [email protected] for the 
WebViewAssetLoader functionality to serve my app from https://localhost.
   > 
   > The problem I have is that after updating (from API29 / 
[email protected]), 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 / [email protected] it works fine again.
   > 
   > Where I'm not sure if this is the same issue is from comments like this 
one by @HarelM [#426 
(comment)](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 [email protected] ?
   > 
   > 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!
   I dont try this but i think you can solve your issue using this as suggest 
[here](https://cordova.apache.org/announcements/2021/07/20/cordova-android-10.0.0.html)
   `<preference name="AndroidInsecureFileModeEnabled" value="true" />` 
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to