var isViedo = false;
var cmr;
var photoFilePath = new Array();
var videoFilePath = [];
mui.plusReady(function(){
document.getElementById('takePhotoBtn').addEventListener('tap',function(){
var cmr = plus.camera.getCamera();
cmr.captureImage(captureSuccess,error,{filename:'_doc/camera/'});
});
document.getElementById('scanBtn').addEventListener('tap',function(){
mui.openWindow({
url:'fileScan.html',
id:'fileScan.html',
show:{
autoShow:true
},
extras:{
recordFile:recordFilePath,
photoFile:photoFilePath,
videoFile:videoFilePath
}
});
});
document.getElementById("takeVideoBtn").addEventListener('tap',function(){
isViedo = true;
cmr = plus.camera.getCamera();
cmr.startVideoCapture(function(path){
videoFilePath.push(path);
},function(e){
alert("摄像失败:"+e.message);
},{filename:'_doc/video/'});
});
});
function captureSuccess(path){
photoFilePath.push(path);
}
function error(e){
alert(e.message);
}
相关分类