概述
Skin-cameraUTS封装了Android和iOS自定义相机预览的功能。
模块调用
<xf-camera style="height:750rpx; background-color: red;" @ready="ready" @error="onError" @stop="stop" :flash="flash" :position="device">
</xf-camera>
参数说明:
position:
- 类型:字符串型
- 描述:(可选项)前置或者后置相机。(front前置 |back 后置)
flash:
- 类型:字符串型
- 描述:(可选项)是否开启闪光灯。( auto, on, off, torch)
插件接口
takePhoto
拍照
uni-app x项目(uvue)中调用示例:
import { takePhoto } from "@/uni_modules/XF-cameraUTS";
import { TakePhotoOption, TakePhotoSuccessCallbackResult } from "@/uni_modules/XF-cameraUTS/utssdk/interface.uts";
let options = {
success: (res : TakePhotoSuccessCallbackResult) => {
console.log(res)
}
} as TakePhotoOption;
takePhoto(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本