Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access captured media on Android 11 #223

Open
inexuscore opened this issue Jun 10, 2021 · 5 comments · May be fixed by #277
Open

Can't access captured media on Android 11 #223

inexuscore opened this issue Jun 10, 2021 · 5 comments · May be fixed by #277
Milestone

Comments

@inexuscore
Copy link

I'm working on a project using Ionic 6.x, Angular 12, and Capacitor 3.
The media-capture plugin works fine as in I can capture audio/video files and get the MediaFile[] response.
But I can't access the captured files to read their contents (as base64 or array buffer, etc.).
I've tried everything I could think of, nothing works.

I'm using a Xiaomi Redmi Note 10 running Android 11. After hours wasted on this issue, I realized that this is most likely because of privacy changes introduced in Android 10+. The captured media files need to be stored in the app's cache directory or something. The fullPath returned by the plugin looks something like this:

file:///storage/emulated/0/Android/data/com.android.soundrecorder/files/filename.aac

Tried reading the file with the cordova-file plugin, the Capacitor Filesystem plugin, nothing worked.
Is there a workaround? Has this been fixed? and if so when are you planning a release?

I love working with the new versions of Ionic and Capacitor but this kind of stuff is incredibly frustrating.

@aaronksaunders
Copy link

@inexuscore I have forked a version of this plugin and have it working with ionic and capacitor - sample code with link to forked plugin - https://github.com/aaronksaunders/vue-media-capture-2

@AlanRivera16
Copy link

Could you show your code? I'm working with Filesystem of capacitor and I didn't have any problem.

@itshazlan
Copy link

itshazlan commented Dec 22, 2022

@aaronksaunders have you test it with android 11? does it work?

@erisu erisu linked a pull request Aug 7, 2023 that will close this issue
5 tasks
@hung91
Copy link

hung91 commented Nov 7, 2023

I have same problem with my Xiaomi 13 Lite. Android 12.
No problem with other android devices and android version.

@inexuscore
Copy link
Author

@inexuscore I have forked a version of this plugin and have it working with ionic and capacitor - sample code with link to forked plugin - https://github.com/aaronksaunders/vue-media-capture-2

Thanks, @aaronksaunders, I'll try it and see if I can make it work.

@breautek breautek added this to the 6.0.0 milestone Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants