-
Notifications
You must be signed in to change notification settings - Fork 497
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
Provide the ability to store capture files in private app storage rather than external storage #263
Comments
Hey @jschillingApollo I was wondering if you were able to find any solution to your problem since it's been a few months now since you posted. I find myself in the same boat.. as do many others I imagine. Having all sorts of troubles on Android (IOS works perfectly) due to the whole external storage fiasco. In fact.. I haven't even yet figured out how to upload a video to the server on Android since I'm targeting API 31. Could you possibly share a small code snippet that shows how you get access to the just-recorded video so you can upload it somewhere? Would really appreciate if you could comment on what you ended up doing about this too. Many thanks! |
@vesper8 No solution yet unfortunately. We ended up removing video capture functionality from the Android version of our application temporarily while we look for a better option because this plugin is not going to work for us in its broken state. As far as accessing the video file on Android its pretty straightforward. Its the same for iOS or Android for us and we are able to upload videos just fine. Its just where the media-capture plugin stores them that's the problem. They can still be accessed the same way iOS videos are accessed using the file plugin and getting a FileEntry object from the file path. The docs give a decent overview of how the |
The steps were Step 2: Update the method captureVideo
Step 3: Update the method onVideoActivityResult
|
@losrak Thank you for the suggestion! I appreciate the help and I'll give this a try in the meantime For the package maintainers however, I would like to note that this is only a temporary solution and that the plugin itself still does not address the issue. Updating or doing a clean install of the package would not include the temporary fix and it would need to be changed manually each time and on each development environment. |
@jschillingApollo I know is not the best solution but you can fork the plugin, update the changes and install the fork repository instead of the original plugin in your project to have a clean installation |
@losrak I tried your solution but the video file is still showing up on the phone's media gallery. Attempting to delete the video using Cordova file gives me error 5. |
Feature Request
Motivation Behind Feature
The app that I help develop is currently able to record video and pictures and, after those files have been uploading to a server, the files need to be deleted from the device. This is becoming a very big issue for our Android users. Videos are automatically stored to external storage and are visible in the photo gallery. There are currently no options to prevent storage to external storage and because of this there is no way to delete the video files with our app in API 29+.
This problem would also exist for our users when taking photos, but we opted to use a different plugin for pictures. In the
cordova-plugin-camera
plugin, there is acameraOption
calledsaveToPhotoAlbum
which can be set to false to save the photo file to app storage instead of the external storage. In this case, the developer can use the filesystem plugin to delete the file when necessary and this works in API 29+. The one downside is that the camera plugin doesn't offer video recording which is why we are using media-capture plugin for video.Feature Description
The media-capture plugin should be updated to support storing captures to locations other than external storage since modifying files in that location is no longer possible on newer versions (API 29+) of Android.
At minimum, the developer should be able to configure the plugin to store captures to app storage, outside of the device's gallery.
Being able to configure the plugin to store to any storage location on the device would be a bonus, though not fully necessary.
Alternatives or Workarounds
I have not yet found any alternative solution to this problem.
I did find another issue from early 2021 regarding a similar feature request, but progress seemed to have entirely stalled on that issue.
The text was updated successfully, but these errors were encountered: