wx.shareVideoMessage是一个微信小程序转发视频到聊天接口,以 Promise风格调用。
示例代码:
// callback 写法
wx.downloadFile({
url: URL, // 下载url
success (res) {
// 下载完成后转发
wx.shareVideoMessage({
videoPath: res.tempFilePath,
success() {},
fail: console.error,
})
},
fail: console.error,
})
// async await 写法
const { tempFilePath } = await wx.downloadFile({
url: URL, // 下载url
})
// 下载完成后转发
await wx.shareVideoMessage({
videoPath: res.tempFilePath,
})
参数参考:
暂无评论,抢个沙发...