start:fail onCameraFrame is not supported on your device
请问是什么原因导致的呢?
var that = this;
wx.initFaceDetect();
const context = wx.createCameraContext();
this.context = context
let listener = context.onCameraFrame((frame) => {
wx.faceDetect({
frameBuffer: frame.data,
width: frame.width,
height: frame.height,
enablePoint: true,
enableConf: true,
enableAngle: true,
enableMultiFace: true,
success: function (faceData) {
let face = faceData.faceInfo[0]
if (face.angleArray.pitch >= 0.1 || face.angleArray.roll >= 0.1 || face.angleArray.yaw >= 0.1) {
wx.showToast({
title: '请平视摄像头',
})
} else if (face.confArray.global <= 0.8 || face.confArray.leftEye <= 0.8 || face.confArray.mouth <= 0.8 || face.confArray.nose <= 0.8 || face.confArray.rightEye <= 0.8) {
wx.showToast({
title: '请勿遮挡五官',
})
} else {
// listener = null
listener.stop()
wx.showLoading({
title: '识别中',
})
// listener = null
setTimeout(() => {
wx.showToast({
title: '延迟',
})
wx.hideLoading();
// wx.showLoading({
// title: '识别中',
// })
// that.tapTakePhoto()
}, 3*1000);
}
},
fail: function (err) {
if (err.x == -1 || err.y == -1) {
wx.showLoading({
title: '识别不到人脸',
})
} else {
wx.showToast({
title: '网络错误',
})
}
},
})
})
listener.start()
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)