获取视频信息
使用说明
import { MImagePicker } from "@yl/super-jssdk";
MImagePicker.getVideoInfo(optional);
参数说明
| 参数 |
类型 |
必填 |
作用 |
| optional |
Object |
是 |
必选参数 |
optional
| 参数 |
类型 |
必填 |
作用 |
| path |
string |
是 |
待获取信息的视频路径 |
| options |
json |
否 |
可选参数 |
| type |
string |
否 |
调用插件类型,可选:image-picker、photo,默认 image-picker |
options 结构说明
| 字段名称 |
类型 |
说明 |
| firstFramePath |
string |
预览图片(即视频首帧)存储地址,为绝对路径 |
返回说明
| 参数 |
类型 |
作用 |
| resolve(result) |
Function |
成功回调。result参照下方说明 |
| reject(err) |
Function |
失败回调,err 为详细的错误信息,是一个 json 对象,例如:{"errCode": -1, "errMsg":"some explain of error."} |
result说明
{
"width": 1080,
"height": 1920,
"size": 1024,
"dateTime": "2019:03:07 18:05:20",
"rotate": 90,
"duration": 10,
"firstFramePath": "xxxx",
}
代码示例
MImagePicker.getVideoInfo({
path: cordova.file.externalDataDirectory + 'test.mp4',
})
.then(res => {
console.log('res', res);
}).catch(err => {
console.log('err', err);
})