I am using windows phone, cordova/phonegap. How is possible to pick a video from gallery as it was a picture?
The official plugin seems to work for picture only.
Here is the code:
function getVideo() {
var options = { quality: 80 };
options["sourceType"] = 0 | 2;
options["mediaType"] = 1;
navigator.camera.getPicture(onVideoSuccess, onFail, options);
}
var onVideoSuccess = function (fileuri) {
console.log("fileuri " + fileuri);
}
var onFail = function (err) {
console.log("onFail");
}
This way I can select the pictures only, shall I change any parameter to select the video files?
Thanks
It took some time to find it, but it is indeed possible by setting the MediaType.
Found it in this answer: Pick an image / video using PhoneGap in Android More info: http://docs.phonegap.com/en/1.4.0/phonegap_camera_camera.md.html#Camera
FYI:
So in your code, you should change
to:
to select only videos, or to:
to select only pictures, or to:
to select both.