WakeupAndPreWakeupStartCheckComponent

最低版本: 1.0.0最后更新: 2020/4/14

组件功能:

       唤醒及预唤醒

支持平台

平台是否支持
豹小秘
豹花/大瓶
M平台

参数

 

参数名类型
paramWakeupAndPreWakeupStartCheckParam

 

WakeupAndPreWakeupStartCheckParam

 

属性JS类型Java类型默认值必填说明最低版本
isNeedPreWakeupbooleanbooleantrueno是否需要预唤醒1.0.0
maxDistancenumberdouble3mno最大距离1.0.0
wakeupFaceDistancenumberdouble1.3mno唤醒最大距离1.0.0
wakeupFaceAngleXnumberdouble45度no唤醒最大人脸角度1.0.0
isNeedInCompleteFacebooleanbooleanyesno是否包含不完整人脸检测1.0.0
incompleteFaceCacheTimeoutnumberlong3000msno不完整人脸检测缓存时间1.0.0
isPreWakeupNeedBodybooleanbooleanyesno预唤醒是否需要检测人体1.0.0
preWakeupIntervalTimenumberlong20000msno预唤醒间隔时间1.0.0
recognizeTimeoutnumberlong2000msno人脸识别超时时间1.0.0
isWakeupNeedRecognizebooleanbooleantrueno唤醒是否需要识别1.22.0,仅豹花/大瓶有效

状态码

返回状态描述
STATUS_PRE_WAKEUP32710001预唤醒被触发

结果码

返回结果描述
RESULT_SUCCESS32610001唤醒被触发

错误码

返回错误描述
ERROR_OPEN_PERSON_DETECT_FAILED-32600004获取人脸数据失败

 

示例代码:

this.wakeupParam = new WakeupAndPreWakeupStartCheckParam(

  false,//isNeedPreWakeup

  0,//maxDistance

  0,//wakeupFaceDistance

  0,//wakeupFaceAngleX

  false,//isNeedInCompleteFace

  0,//incompleteFaceCacheTimeout

  false,//isPreWakeupNeedBody

  0,//preWakeupIntervalTime

  0//recognizeTimeout

);

<WakeupAndPreWakeupStartCheckComponent

  param={this.wakeupParam}

  onStatusUpdate={this.onStatusUpdate}

  onFinish={this.onFinish}

/>

public onStatusUpdate = (event?: ComponentEvent): boolean => {

  console.log('onStatusUpdate==================');

  if (event && event.status === ComponentStatusConst.STATUS_PRE_WAKEUP) {

      console.log('ComponentStatusConst.STATUS_PRE_WAKEUP');

   } else {

      console.log('ComponentStatusConst other States');

  }

  return true;

};

public onFinish = (event?: ComponentEvent): boolean => {

  if (event) {

      if (event.status && event.data) {

          let data = JSON.parse(event.data);

          console.log('onFinished ', data);

      } else {

           console.log('onFinished ', event.status);

      }

      return true;

  }

  return false;

};