我已經成功安裝了插件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
任何測試這對如何讓視頻採集工作任何想法?