Skip to content

摄像头数据

方法名

getCameraData

用法

示例

js
if (this.$refs.refLevenArcFacePro) {
  this.$refs.refLevenArcFacePro.getCameraData(res => {
    console.log(res)
  });
}

参数说明

回调

示例

json
{
  "data": {
    "supportedPreviewSizes": [
      {
        "height": 1080,
        "width": 1920
      },
      {
        "height": 1200,
        "width": 1600
      },
      {
        "height": 1080,
        "width": 1440
      },
      {
        "height": 1080,
        "width": 1260
      },
      {
        "height": 960,
        "width": 1280
      },
      {
        "height": 1080,
        "width": 1080
      },
      {
        "height": 720,
        "width": 1584
      },
      {
        "height": 1080,
        "width": 960
      },
      {
        "height": 768,
        "width": 1280
      },
      {
        "height": 720,
        "width": 1280
      },
      {
        "height": 768,
        "width": 1024
      },
      {
        "height": 738,
        "width": 1024
      },
      {
        "height": 720,
        "width": 960
      },
      {
        "height": 540,
        "width": 960
      },
      {
        "height": 720,
        "width": 720
      },
      {
        "height": 600,
        "width": 800
      },
      {
        "height": 480,
        "width": 864
      },
      {
        "height": 540,
        "width": 720
      },
      {
        "height": 480,
        "width": 800
      },
      {
        "height": 480,
        "width": 720
      },
      {
        "height": 480,
        "width": 640
      },
      {
        "height": 400,
        "width": 640
      },
      {
        "height": 360,
        "width": 640
      },
      {
        "height": 288,
        "width": 352
      },
      {
        "height": 240,
        "width": 320
      },
      {
        "height": 180,
        "width": 320
      },
      {
        "height": 144,
        "width": 176
      }
    ],
    "cameraId": 1
  },
  "message": "",
  "code": 0
}

回调说明

参数名参数类型参数描述
messageString消息提示
dataObject数据对象
data.supportedPreviewSizesObject相机支持的预览分辨率
data.supportedPreviewSizes.widthInteger分辨率的宽
data.supportedPreviewSizes.heightInteger分辨率的高
data.cameraIdInteger当前预览的摄像头,1.前置,0.后置
codeInteger返回类型,0.成功,其他:失败