我正在使用cordova 6.2.0,当我尝试拍照时,我的应用程序正在重启。我的代码是:
var captureImage = function (e) {
navigator.camera.getPicture(onSuccess, onFail, {
quality: 60,
destinationType: Camera.DestinationType.DATA_URL,
correctOrientation: true,
targetWidth: 768,
targetHeight: 768,
});
function onSuccess(imageData) {
imagecontainer.style.backgroundImage = "url('data:image/jpeg;base64," + imageData + "')";
}
function onFail(message) {
alert('Failed because: ' + message);
}
};
答案 0 :(得分:0)
我建议您使用Camera.DestinationType.FILE_URI选项而不是您使用的选项,因为它使用的内存较少,而且您的错误可能与内存问题有关。