|
var demo = api.require('baiduFaceLive');
demo.openFaceDetectView(
{
rect: {
x: 0, //左上角x坐标,默认0
y: 0, //左上角y坐标,默认0
w: 664, //宽度,默认'auto',页面从x位置开始自动充满父页面宽度
h: 500, //高度,默认'auto',页面从y位置开始自动充满父页面高度
marginLeft: 75, //相对父页面左外边距的距离,默认0
marginTop: 150, //相对父页面上外边距的距离,默认0
marginBottom: 0, //相对父页面下外边距的距离,默认0
marginRight: 0 //相对父页面右外边距的距离,默认0
},
},
function (ret, err) {
if (ret.evenType == 'success') {
//由于base64数据量大,请不要用JSON.stringify(ret)调试
alert(ret.data.bestImage);
} else {
api.toast({ msg: JSON.stringify(ret) + " " + JSON.stringify(err) });
}
}); |
|