You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/02/17 17:11:12 UTC

[GitHub] [cordova-plugin-media-capture] ataylor32 opened a new issue #210: Add the ability to specify where the capture should be saved

ataylor32 opened a new issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210


   # Feature Request
   
   ## Motivation Behind Feature
   
   For some apps, it is undesirable to have captured media visible in the user's standard photo/video viewing app (or any other app, for that matter). In these cases, the app's captured media should be isolated to the app (i.e. the captured media should be stored somewhere that's not visible to other apps).
   
   Some developers have tried getting around this by moving the captured media, but have run into a problem (see issue #133).
   
   In addition, some developers are having trouble accessing captured media (see issues #103 #135 #196).
   
   If I'm understanding correctly, this change would also be important for Android 11 (see [Google's "Storage updates in Android 11" article](https://developer.android.com/about/versions/11/privacy/storage)).
   
   ## Feature Description
   
   `CaptureAudioOptions`, `CaptureImageOptions`, and `CaptureVideoOptions` could all have a new property for specifying where the capture should be saved.
   
   ## Alternatives or Workarounds
   
   I don't know of any reliable alternatives or workarounds.


----------------------------------------------------------------
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.

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



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


[GitHub] [cordova-plugin-media-capture] chriskhongqarma commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
chriskhongqarma commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-817809257


   @breautek You are right, the camera plugin is also using FileProvider, so it is a very good reference. 


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] mirko77 commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
mirko77 commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-829228969


   @breautek all good, apparently it is an issue with custom ROMs only.


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] chriskhongqarma edited a comment on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
chriskhongqarma edited a comment on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-817805177


   Hi @ataylor32 , you are right. Since the storage update on Android 11, the app will not be able to access the media file that is saved into external storage by the plugin (using native camera app). The idea for this is to use a ContentProvider (a [FileProvider](https://developer.android.com/reference/androidx/core/content/FileProvider), in this case) as a common database to save files, so that both our app and other apps can get access to. I already implemented this for the `captureVideo` method, and it works well. 
   Please assign this issue to me, I will create a PR as soon as I finish updating `captureAudio` and `captureImage` methods.


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] mirko77 commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
mirko77 commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-827006113


   @breautek @chriskhongqarma 
   
   when recording a video with
   
   ```
   window.navigator.device.capture.captureVideo(_onCaptureVideoSuccess, _onCaptureVideoError, options);
   ```
   
   on Android < 11, I get the file path in the callback like so:
   `fullPath: "file:///storage/emulated/0/DCIM/Camera/VID_20210426_181817.mp4"` and I can correctly access it.
   
   on Android 11, I get:
   `fullPath: "file:///data/user/0/{app_id}/cache/Capture.avi"` 
   But if I navigate there with a root explorer, there is not any `Capture.avi` file, and trying to access it via code will give me an error 1 (NOT FOUND), of course.
   
   I am using the flag `android:requestLegacyExternalStorage="true"`
   
   Am I missing something? Any suggestions?


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] mirko77 commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
mirko77 commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-827028337


   @breautek I am not targeting api 30 yet
   
   ```
     <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
   ```


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] breautek commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-817807556


   Thank you @chriskhongqarma I'm looking forward in seeing that PR. I wonder if it's something easily replicatable  to the file plugin and the camera plugin?


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] ath0mas commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
ath0mas commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-962281672


   > 
   > 
   > @breautek @chriskhongqarma
   > 
   > when recording a video with
   > 
   > ```
   > window.navigator.device.capture.captureVideo(_onCaptureVideoSuccess, _onCaptureVideoError, options);
   > ```
   > 
   > on Android < 11, I get the file path in the callback like so: `fullPath: "file:///storage/emulated/0/DCIM/Camera/VID_20210426_181817.mp4"` and I can correctly access it.
   > 
   > on Android 11, I get: `fullPath: "file:///data/user/0/{app_id}/cache/Capture.avi"` But if I navigate there with a root explorer, there is not any `Capture.avi` file, and trying to access it via code will give me an error 1 (NOT FOUND), of course.
   > 
   > I am using the flag `android:requestLegacyExternalStorage="true"`
   > 
   > Am I missing something? Any suggestions?
   
   Source code for video capture fallbacks to this _stange_(?) path to `Capture.avi` when the video uri could not be resolved from `intent.getData()` (see [Capture.java#L425](https://github.com/apache/cordova-plugin-media-capture/blob/master/src/android/Capture.java#L425)) - while this is the proper way to do it (see https://developer.android.com/training/camera/videobasics#TaskVideoView) 🤷 
   
   It was introduced years ago in #13 ... but really no idea why such a file would be written in this directory 🤔 (no EXTRA_OUTPUT or so defined) ... if ever it is useful, a check with `file.exists()` may be necessary??


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

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



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


[GitHub] [cordova-plugin-media-capture] breautek commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-827026807


   Cordova does not support API 30 yet.
   
   > I am using the flag android:requestLegacyExternalStorage="true"
   
   This flag only works on API 29, it's ignored on API >= 30. Therefore for the time being, It's recommended that you use this flag while targeting API 29 and the filesystem should work provided that the user has granted you the permission to read external files.


-- 
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.

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



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


[GitHub] [cordova-plugin-media-capture] chriskhongqarma commented on issue #210: Add the ability to specify where the capture should be saved

Posted by GitBox <gi...@apache.org>.
chriskhongqarma commented on issue #210:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/210#issuecomment-817805177


   Hi @ataylor32 , you are right. Since the storage update on Android 11, the app will not be able to access the media file that is saved into external storage by the plugin (using native camera app). The idea for this is to use a ContentProvider (a [FileProvider](https://developer.android.com/reference/androidx/core/content/FileProvider), in this case) as a common database to save files, so that both our app and other apps can get access to. I already implemented this for the captureVideo method, and it works well. 
   Please assign this issue to me, I will create a PR as soon as I finish updating `captureAudio` and `captureImage` methods.


-- 
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.

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



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