# uploadVideoFileToMas ^7.3.0
上传视频文件,根据传入的视频地址,使用CSS获取OSS上传相关Toekn,accessKey,accessKeySecret,endpoint,bucketName字段,最终使用OSS上传视频
# 请求参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
params | Object | Y | {}附表1 | 请求参数 |
- 附表1:params参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
url | String | Y | N/A | 服务器上传视频的url(不带域名) |
videoList | Array | Y | N/A | 上传的视频列表,数组中每个元素为视频对象,包含视频路径和视频大小(见表2) |
- 附表2:videoList参数
Prop | Type | Required | Default | Description |
---|---|---|---|---|
videoPath | String | Y | N/A | 视频路径 |
videoSize | Number | Y | N/A | 视频大小 |
# 接口调用示例
const params = {
videoList: [
{
videoPath: 'xxx/midea_meiju_weex_video/weex_1614235220.mp4',
videoSize: 3141
}
],
url: 'xxx'
}
this.$bridge
.uploadVideoFileToMas(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
// bridge v0.2.3起支持回调函数,回调函数可触发多次
this.$bridge
.uploadVideoFileToMas(
params,
res => {
this.$alert(res)
},
err => {
this.$toast(err)
}
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29