使用安卓原生webview打开mui界面,报:Uncaught ReferenceError: plus is not defined的错误 使用5+的api调用手机摄像头
function makePhoto2(){
var cmr = plus.camera.getCamera();
cmr.captureImage(function(p) {
plus.gallery.save(p);
plus.io.resolveLocalFileSystemURL(p, function(entry) {
var path = entry.toLocalURL();
appendFile(path);
upload('image');
}, function(e) {
mui.toast("读取拍照文件错误:" + e.message);
});
},
function(e) {}, {
filename: "_doc/gallery/",
index: 1
});
}
function makePhoto() {
hideSelectImage();
if(window.plus){
makePhoto2();
}else{
mui.toast("plus not init");
document.addEventListener('plusready',makePhoto2,false);
}
现在执行的是mui.toast("plus not init"); 一直不知道哪里出了问题,谁能帮忙回答一下 谢谢
0 个回复