微信小程序通过视频链接直接转发视频给好友
js
// 确认上传
confirmUpload() {
console.log('确认转发');
// 假设你的视频链接是 videoUrl
wx.downloadFile({
url: this.data.videoUrl, // 你的视频链接
success(res) {
// 下载成功后,res.tempFilePath 就是本地临时路径
wx.shareVideoMessage({
videoPath: res.tempFilePath, // 核心:必须传入本地路径
title: '分享标题', // 可选
success() {
console.log('分享成功');
}
})
}
})
},