请扫码查看示例
# getVideoDetails ^6.8
获取视频原始数据
# 请求参数
Prop | Type | Comment |
---|---|---|
src | String | 视频文件路径(相对路径) |
# 引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
1
# 参数代码示例
let params = {
src: 'localImages/IMG_003.MOV',
}
1
2
3
2
3
# 接口调用示例
let params = { src: this.src }
bridge
.getVideoDetails(params)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 返回参数
- 成功时返回
Prop | Type | Value |
---|---|---|
code | Number | 0 |
width | Number | 图片原始宽度 |
height | Number | 图片原始高度 |
fps | Number | 帧率 |
type | String | 格式 |
orientation | String | 视频角度, 默认up |
duration | Number | 时常 单位秒 |
bitrate | Number | 比特率 |
- 失败时返回
Prop | Type | Value | Comment |
---|---|---|---|
code | Number | -7 | |
msg | String | 文件不存在 |
# 返回示例
{
"code": 0,
"width": 224,
"height": 128,
"type": "vide/avc1",
"fps": 15,
"orientation": "up",
"duration": 8,
"bitrate": 131984.609375
}
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12