- 当前 Bug 的表现(可附上截图)
- 预期表现
苹果可以保存成功
- 复现路径
- 提供一个最简复现 Demo
wx.downloadFile({
url:'https://vapi.show160.com:444/Content/Video/1457/132030682987323315.mp4',
success: function(res) {
console.log("下载文件:success");
console.log(res.tempFilePath);
// 保存图片到系统相册
wx.saveVideoToPhotosAlbum({
filePath: res.tempFilePath,
success(res) {
console.log(res);
wx.hideLoading();
wx.showToast({
title: "保存成功"
});
},
fail(res) {
console.log(res);
wx.hideLoading();
wx.showToast({
title: "保存失败"
});
}
});
},
fail: function(res) {
wx.hideLoading();
console.log("下载文件:fail");
console.log(res);
}
});
麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
机型iphonr6plus ,微信版本7.0.4,系统版本号12.0,https://developers.weixin.qq.com/s/ZUfLrgmy7M9Q
之前测试是可以保存的,但是不知道最近微信官方是否更新了什么问题优化了什么问题,现在客户说有这个问题
这边看到服务端返回的content-type是 video/mpeg,被系统当成mpg文件保存了。目前
saveVideoToPhotosAlbum只支持mp4。建议确认下视频文件格式,修改成正确的content-type
设置了头部,但是没有改变mpeg格式为mp4
需求设置服务器response的头部