-
Notifications
You must be signed in to change notification settings - Fork 495
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
cordova-plugin-media-capture video not working android 13 #286
Comments
To be clear, under scoped storage rules (which is effective since API 29) you wouldn't be able to move, but you should be able to copy it using the file plugin. Files recorded will be owned by the camera app rather than your own app, therefore all write operations via the filesystem is restricted which would include the move operation. v5 of this plugin should already request the The plugin storing at |
I can't copy files from dcim to my directory within the app in this specific case even if I try to copy the file instead of moving it using cordova-plugin-file This error is being presented in newer Android 13 versions with Samsung. Other versions such as Xiaomi or Google Pixel do not occur. Or even older Android 13 with Samsung |
Can you share the code that produces this error? |
This is where the error occurs and I capture the video from media capture and pass it to the plugin file:
|
Thanks for your co-operation, it's helping me understand the full picture. based on the provided code, this does appear to be a bug... On the topic of changing the default path, we were experimenting with PR #277 though I believe that PR only changed the audio recording directory to the app's internal cache directory. I think the plugin as it stands now gets a content url which it resolves to a file url which gets passed to the webview. Perhaps we can learn from that PoC PR and use the content resolver and get the input stream so that plugin can copy the content using the media store api to the app's cache directory then it can return the file url to the cache directory instead. There is a performance concern if you're copying a large video file... but it will be necessary if we want to use the file plugin to access the file I think. The plugin I don't think exposes the content url, but if it did, then a media store plugin could be used to do file manipulation operations as well. This could allow us to avoid copying the file unless explicitly desired by the developer... as an alternate solution... |
I partially solved it by taking this file, generating a blob of it and using the file plugin to record it within my app |
my solution was. Instead of copying or moving the file received by the video plugin from the device's camera folder. It was creating a blob of this file and writing this blob directly to the desired path..
|
Bug Report
cordova-plugin-media-capture video not working android 13
Problem
In new versions of Android 13, it is not possible to move video files to the application directory, as the plugin is returning videos from the path file:///storage/emulated/0/DCIM/Camera/
What is expected to happen?
The returned path is expected to be:
file:///data/user/0/myapp/cache/
What does actually happen?
the path returned by the plugin
file:///storage/emulated/0/DCIM/Camera/
Information
use an android 13 and make a video. Check whether it will be stored in the dcim folder or in the application cache
android bug sample:
Command or Code
you need to use the cordova-media-capture plugin and make a video
and check that the video path is correct
Environment, Platform, Device
android 13
Samsung
Version information
cordova-android 12.0.0
ionic 4
android
Checklist
The text was updated successfully, but these errors were encountered: