我已经成功安装了插件org.apache.cordova.core.media-capture。phonegap capture capture captureVideo not working phonegap 3.0.0-0.14.3
其中我对我的
的PhoneGap本地插件项目确实添加了https://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git
navigator.device.capture.captureVideo function does not respond to the call.
什么也没有发生在手机上。
如果我在呼叫的前面和后面发出警报,第一个警报会弹出,但第二个警报永远不会发生。我希望未能进入captureError回调函数 并弹出消息,但仍然没有任何反应。
/**
*
* captures the video
* A button will call this function
* Launch device video recording application,
* allowing user to capture 1 video clip
*/
function onCaptureVideo() {
var options = { limit: 1 };
alert('trying to capture');
// start image capture
navigator.device.capture.captureVideo(captureSuccess, captureError, options);
}
而且回调函数
/**
* Called when capture operation is finished
* @param mediaFiles
*/
var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
// do something interesting with the file
}
};
/**
*
* Called if something bad happens.
* @param error
*/
var captureError = function(error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');
};
这需要工作,所以我可以捕捉在Android和iOS的视频和图片,然后将它们上传到服务器。
目前我在Android三星Galaxy S4
任何测试这对如何让视频采集工作任何想法?