wx.chooseVideo({
sourceType: ['album', 'camera'],
// maxDuration: 60,
success: res => {
const videoSrc = res.tempFilePath
wx.cloud.callFunction({
name: "token"
}).then(async res => {
console.log("res->", res);
const access_tokend = res.result.access_token
await wx.request({
url: 'https://api.weixin.qq.com/wxa/media_check_async?access_token=' + access_tokend,
method: "POST",
data: {
"media_url": videoSrc,
media_type: 1,
},
json: true,
success(res) {
console.log("res", res )
}
})
})
}
返回
- data:
- errcode: 0
- errmsg: "ok"
- trace_id: "44cbf5446e26e01a1cde871ef5f6377f"
- hasOwnProperty: (...)
- isPrototypeOf: (...)
- propertyIsEnumerable: (...)
- toLocaleString: (...)
- toString: (...)
使用CDN链接url地址
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/utils/Cloud.CDN.html
videoSrc 不能用临时路径的,必须https、http外网路径. 而且这个接口不能在小程序端调,代码全是问题