Appearance
初始化配置
注意
- uniappx项目中配置的属性名称为
configX - uniapp项目配置的属性名称为
config
配置方式
js
import JSONObject from 'com.alibaba.fastjson.JSONObject'
//组件引用
const refLevenUvc = ref<LevenUtsUvcElement | null>(null)
//组件初始化配置
const config : UTSJSONObject = {
//视图的圆角值
"radius": 10,
//摄像头旋转角度
"rotation": 90,
//图片文件保存目录
"pictureDir": "/storage/emulated/0/Pictures/LevenUvcCamera/",
//视频保存目录
"videoDir": "/storage/emulated/0/Movies/LevenUvcCamera/",
//默认打开的摄像头deviceName,如果不是通过这个打开默认摄像头请不需要此参数
// "deviceName": "/dev/bus/usb/003/003",
//默认打开的摄像头产品名称
// "productName": "RXGD-CAMERA",
//默认分辨率
// size: {
// width: 800,
// height: 600,
// fps: 30
// }
}js
data() {
return {
config: {
//视图的圆角值
radius: 10,
//摄像头旋转角度
rotation: 90,
//图片文件保存目录
pictureDir: "/storage/emulated/0/Pictures/LevenUvcCamera/",
//视频保存目录
videoDir: "/storage/emulated/0/Movies/LevenUvcCamera/",
//默认打开的摄像头deviceName,如果不是通过这个打开默认摄像头请留空
// deviceName: "/dev/bus/usb/003/003",
//默认打开的摄像头产品名称
// productName: "RXGD-CAMERA",
//默认分辨率
// size: {
// width: 800,
// height: 600,
// fps: 30
// }
}
}
},参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 参数描述 |
|---|---|---|---|---|
| radius | Integer | 否 | 0 | 摄像头预览圆角 |
| rotation | Integer | 否 | 0 | 摄像头旋转角度 |
| pictureDir | String | 否 | 项目目录下 | 图片保存目录 |
| videoDir | String | 否 | 项目目录下 | 录像保存目录 |
| deviceName | String | 否 | 无 | 默认打开的摄像头路径,如:/dev/bus/usb/003/003 |
| productName | String | 否 | 无 | 默认打开的摄像头产品名称,如:RXGD-CAMERA |
| size | Object | 否 | 无 | 默认分辨率 |
| size.width | Integer | 否 | 无 | 分辨率的宽 |
| size.height | Integer | 否 | 无 | 分辨率的高 |
| size.fps | Integer | 否 | 30 | 帧率 |
