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


   > 
   > 
   > > 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 [#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 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!
   > > 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" />`
   
   
   Is your Application has File permissions enabled ? Check Android Manifest 
for these three
   
   `<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
     <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>`
   
   if not add these in your `AndroidManifest.xml` . Try to build with these. if 
problem exists reply me under same thread.


-- 
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-unsubscr...@cordova.apache.org

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



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

Reply via email to