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

cordova-plugin-camera retuns NULL file url on success when mediaType : AllMedia (2) (only on Android)

    XMLWordPrintableJSON

Details

    Description

      Hi
      Not sure if I am doing anything wrong or it's a bug.

      I am using Phonegap / cordova CLI

      Plugin: cordova-plugin-camera (latest version 2.2.0)
      -------------------------------------------------------------------

      This is my code sample:

      ========================================================================
      var pictureSource;
      var destinationType;
      document.addEventListener("deviceready",onDeviceReady,false);
      function onDeviceReady() {
      pictureSource=navigator.camera.PictureSourceType;
      destinationType=navigator.camera.DestinationType;
      }
      function getMedia() {
      var gallery_options =

      { quality: 50, destinationType: destinationType.FILE_URI, sourceType: PictureSourceType.PHOTOLIBRARY, mediaType: 2 }

      ;
      navigator.camera.getPicture(onSuccess, onFail, gallery_options);
      }
      function onSuccess(url) {
      alert(url); // getting NULL here
      }
      =========================================================================

      As you can see, I am getting photos and videos from Gallery and destination type is file Url.
      MediaType is set to 2 which means both photos and videos.

      If mediaType is 0 > then no problem. It returns image url
      If it is 1 (video only) returns NULL
      if it is 2, returns NULL on both images and videos.

      It seems to be working only when mediaType is 0 !! (but I need both photos and videos!)

      This only happens on Android !!
      on iOS device, no issue.

      I have tried on Developers app, emulator, real device...same result!

      Any help would be much appreciated!

      S

      Attachments

        Issue Links

          Activity

            People

              vladimir.kotikov Vladimir Kotikov
              samir.3p Samir
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: