android - how to select the video from gallery in phonegap? -
please me 1 how select video gallery in android , ios in cordova tried click here select video media not working me...
var picturesource; var destinationtype; var mediatype; document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { picturesource = navigator.camera.picturesourcetype; destinationtype = navigator.camera.destinationtype; mediatype = navigator.camera.mediatype; } navigator.camera.getpicture(onphotourisuccess, onfail, { destinationtype: destinationtype.file_uri, mediatype: mediatype.video, sourcetype: source }); function onphotourisuccess(imageuri) { console.log(imageuri); } function onfail(message) { console.log(message); }
i used same code implement in app can't come....
you can try snippet below:
navigator.camera.getpicture(onsuccess, onfail, { quality: 100, destinationtype: camera.destinationtype.file_uri, sourcetype: camera.picturesourcetype.photolibrary, mediatype: camera.mediatype.video });
not mediatype
can be:
camera.mediatype = { picture: 0, // allow selection of still pictures only. default. return format specified via destinationtype video: 1, // allow selection of video only, return file_uri allmedia : 2 // allow selection media types
for reference read this.
Comments
Post a Comment