Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13572

resolveLocalFileSystemURL in camera.getPicture not works

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Duplicate
    • None
    • None
    • cordova-plugin-camera

    Description

      This error is only in Android. In other platforms works succesfully.

      If mediaType is "Camera.MediaType.PICTURE" works ok. The "imageUri" variable is for example:
      content://com.android.providers.media.documents/document/image%3A125 the resolveLocalFileSystemURL function works ok.

      If mediaType is "Camera.MediaType.VIDEO" or "Camera.MediaType.ALLMEDIA" the "imageUri" variable is for example:
      /storage/emulated/0/DCIM/Camera/VID_20171114_181057214.mp4 and the resolveLocalFileSystemURL not works. The response should be file:///storage/emulated/0/DCIM/Camera/VID_20171114_181057214.mp4

      The next code in iOS works correctly and in Android fails.

      navigator.camera.getPicture(
                  function cameraSuccess(imageUri){
                  
                      console.log(imageUri);
                      window.resolveLocalFileSystemURL(imageUri,
                      function(entry){
                          console.log("works ok");
                          console.log(entry);
                      },
                      function(error){
                          console.log("error");
                      });
              }, function cameraError(error){            
              }, {
                  destinationType: Camera.DestinationType.FILE_URI,
                  sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
                  mediaType: Camera.MediaType.VIDEO
              });
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              davidgv88 David Gonzalez
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: