安卓11版本,下载视频uni.downloadFile并保存到相册uni.saveImageToPhotosAlbum提示成功,但相册里没有视频
其他安卓版本和iphone,可以正常保存
save(video) {
uni.showLoading()
const downloadTask = uni.downloadFile({
url: video, //视频路径
success: res => {
// console.log(res)
if (res.statusCode == 200) {
downloadTask.onProgressUpdate(red => {
let that = this;
that.percentCurrent = red.progress;
console.log(that.percentCurrent);
if (red.progress === 100) {
uni.hideLoading();
that.$api.msg('保存成功')
//当进程全部下载完成之后 在执行保存到相册的回调
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.showToast({
title: '下载成功',
icon: 'none'
});
},
fail: () => {
uni.showToast({
title: '保存失败,请稍后重试',
icon: 'none'
});
}
});
}
});
}
}
});
},