cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samir (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-11367) cordova-plugin-camera retuns NULL file url on success when mediaType : 2 (only on Android)
Date Thu, 02 Jun 2016 21:55:59 GMT
Samir created CB-11367:
--------------------------

             Summary: cordova-plugin-camera retuns NULL file url on success when mediaType
: 2 (only on Android)
                 Key: CB-11367
                 URL: https://issues.apache.org/jira/browse/CB-11367
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
         Environment: Cordova CLI
            Reporter: Samir


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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message