也就是 几句代码 var cmr = plus.camera.getCamera(2);
var res = cmr.supportedImageResolutions[0];
var fmt = cmr.supportedImageFormats[0];
console.log("Resolution: "+res+", Format: "+fmt);
cmr.captureImage( function( path ){
console.log(res);
},
function( error ) {
alert( "Capture image failed: " + error.message );
},
);
missfei (作者)
不行啊还是不能打开前置摄像头,只能打开后面的
2025-04-07 11:57
missfei (作者)
//获取摄像头管理对象
var camera = plus.camera.getCamera(2);
//分辨率
var res = camera.supportedImageResolutions[0];
//文件格式
var fmt = camera.supportedImageFormats[0];
//图片文件保存的路径
console.log(camera)
camera.captureImage(
(path) => {
console.log("拍照成功,图片路径是: " + path);
},
(error) => {
console.log("拍照失败: " + error.message);
},
{
resolution: res,
format: fmt,
index:"2"
}
);
2025-04-07 11:59