init
This commit is contained in:
@@ -0,0 +1,183 @@
|
||||
# **概述**
|
||||
|
||||
XF-cameraUTS封装了Android和iOS自定义相机预览的功能。
|
||||
|
||||
## **模块调用**
|
||||
|
||||
```js
|
||||
<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)
|
||||
|
||||
|
||||
## **插件接口**
|
||||
|
||||
<div id="a0"></div>
|
||||
|
||||
# **takePhoto**
|
||||
|
||||
拍照
|
||||
|
||||
## uni-app项目中(nvue)调用示例:
|
||||
|
||||
```js
|
||||
import { takePhoto } from "@/uni_modules/XF-cameraUTS"
|
||||
|
||||
takePhoto({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## uni-app x项目(uvue)中调用示例:
|
||||
|
||||
```js
|
||||
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及更高版本
|
||||
|
||||
|
||||
<div id="a1"></div>
|
||||
|
||||
# **startRecord**
|
||||
|
||||
开始录像
|
||||
|
||||
## uni-app项目中(nvue)调用示例:
|
||||
|
||||
```js
|
||||
import { startRecord } from "@/uni_modules/XF-cameraUTS"
|
||||
|
||||
startRecord({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## uni-app x项目(uvue)中调用示例:
|
||||
|
||||
```js
|
||||
import { startRecord } from "@/uni_modules/XF-cameraUTS";
|
||||
import { CameraContextStartRecordOption, GeneralCallbackResult } from "@/uni_modules/XF-cameraUTS/utssdk/interface.uts";
|
||||
|
||||
let options = {
|
||||
success: (res : GeneralCallbackResult) => {
|
||||
console.log(res)
|
||||
}
|
||||
} as CameraContextStartRecordOption;
|
||||
startRecord(options);
|
||||
```
|
||||
|
||||
## 可用性
|
||||
|
||||
iOS、Android系统
|
||||
|
||||
可提供的1.0.0及更高版本
|
||||
|
||||
|
||||
|
||||
<div id="a2"></div>
|
||||
|
||||
# **stopRecord**
|
||||
|
||||
停止录像
|
||||
|
||||
## uni-app项目中(nvue)调用示例:
|
||||
|
||||
```js
|
||||
import { stopRecord } from "@/uni_modules/XF-cameraUTS"
|
||||
|
||||
stopRecord({
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## uni-app x项目(uvue)中调用示例:
|
||||
|
||||
```js
|
||||
import { stopRecord } from "@/uni_modules/XF-cameraUTS";
|
||||
import { CameraContextStopRecordOption, StopRecordSuccessCallbackResult } from "@/uni_modules/XF-cameraUTS/utssdk/interface.uts";
|
||||
|
||||
let options = {
|
||||
success: (res : StopRecordSuccessCallbackResult) => {
|
||||
console.log(res)
|
||||
}
|
||||
} as CameraContextStopRecordOption;
|
||||
stopRecord(options);
|
||||
```
|
||||
|
||||
## 可用性
|
||||
|
||||
iOS、Android系统
|
||||
|
||||
可提供的1.0.0及更高版本
|
||||
|
||||
|
||||
<div id="a3"></div>
|
||||
|
||||
# **switchCamera**
|
||||
|
||||
切换相机
|
||||
|
||||
## uni-app项目中(nvue)调用示例:
|
||||
|
||||
```js
|
||||
import { switchCamera } from "@/uni_modules/XF-cameraUTS"
|
||||
|
||||
switchCamera({
|
||||
position: 'back',
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
## uni-app x项目(uvue)中调用示例:
|
||||
|
||||
```js
|
||||
import { switchCamera } from "@/uni_modules/XF-cameraUTS";
|
||||
import { SwitchOption, GeneralCallbackResult } from "@/uni_modules/XF-cameraUTS/utssdk/interface.uts";
|
||||
|
||||
let options = {
|
||||
position: 'back',
|
||||
success: (res : GeneralCallbackResult) => {
|
||||
console.log(res)
|
||||
}
|
||||
} as SwitchOption;
|
||||
switchCamera(options);
|
||||
```
|
||||
|
||||
## 可用性
|
||||
|
||||
iOS、Android系统
|
||||
|
||||
可提供的1.0.8及更高版本
|
||||
Reference in New Issue
Block a user