# recordVideo ^4.4.0
录制视频
# 调用方式
recordVideo(params)
1
返回 Promise,使用 then/catch 或 await 处理结果。 接收单个业务参数;是否需要传参按下方参数表约定,无业务参数时可省略。具体字段及返回数据由宿主原生约定。
# 请求参数
| Prop | type | Required | Default | Description |
|---|---|---|---|---|
| limitCount | Number | Y | - | 上传数量限制 |
| videoDuration | String | Y | - | 视频时长 |
| limitSize | String | Y | - | 视频大小限制 |
# 接口调用示例
const params = {
limitCount: 1,
videoDuration: '60',
limitSize: '20480'
}
this.$bridge.recordVideo(params).then(res => {
this.$bridge.toast(res)
}).catch(err => {
this.$bridge.toast(err)
})
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# 返回参数
- 成功
{
"data":
[
{
"videoSize":777,
"coverSize":74,
"videoPath":"midea_meiju_weex_video/weex_1701853402001.mp4",
"cover":"/var/mobile/Containers/Data/Application/8E4A2427-C9DB-48D1-B1DD-A552CF5A5F54/Documents/midea_meiju_weex_video/weex_1701853402.png"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
- 失败
{
"msg": "用户取消从相册选择视频",
"code": "-11"
}
1
2
3
4
2
3
4