我有一个使用相机功能的黑莓APP。科尔多瓦Phonegap相机getpicture不能在与DATA_URL选项的BlackBerry上工作
代码库来自内的PhoneGap 2.3.0
提供的 “示例应用程序” 的索引HTML已线加入
<input type="button" value="Take Picture" onclick="app.takePhoto();" />
的index.js具有的功能添加:
takePhoto: function(){
navigator.camera.getPicture(this.cameraSuccess,
this.cameraError,
{ quality: 50,
destinationType: Camera.DestinationType.DATA_URL
});
},
cameraSuccess: function(imageData){
console.log(imageData);
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
},
cameraError: function(){
alert("error!");
}
如果我运行波纹模拟器,在铬的错误控制台读取:
Received Event: deviceready cordova-2.3.0.js:8165
Received Event: deviceready ripple.js:39
blob:http%3A//localhost/1b218c8e-6902-4780-a652-8f7f4d52fe28 cordova-2.3.0.js:8165
blob:http%3A//localhost/1b218c8e-6902-4780-a652-8f7f4d52fe28 ripple.js:39
GET data:image/jpeg;base64,blob:http%3A//localhost/1b218c8e-6902-4780-a652-8f7f4d52fe28
如果我运行模拟器,增加图像的相机数据后,我得到一个错误弹出错误日志中写道:
1:01:16.054: cordovaExample [2013-01-14 18:55:03.858]: Error in error callback: Camera1387674010 = ReferenceError: Can't find variable: imageData
当我在设备上运行,我真的不知道怎么样读取错误输出。
根据我所展示的内容,为什么我的手机差距应用程序未在黑莓手机上拍照?
这是正确的!谢谢 :) –