8***@qq.com
8***@qq.com
  • 发布:2023-05-20 11:17
  • 更新:2023-05-26 11:00
  • 阅读:177

wx.saveVideoToPhotosAlbum提示保存成功,但是相册里面没有是为什么?

分类:HTML5+
uni.downloadFile({  
                        // url: JSON.parse(this.circle.videoUrl),  
                        url: this.circle.videoUrl,  
                        success: (res) => {  

                            // 2 成功下载后而且状态码为200时将视频保存到本地系统  
                            if (res.statusCode === 200) {  
                                uni.saveVideoToPhotosAlbum({  
                                    filePath: res.tempFilePath,  
                                })  
                                uni.hideLoading();  
                                // 提示用户下载成功  
                                uni.showToast({  
                                    title: "下载成功",  
                                    icon: "success"  
                                });  
                            }  
                            // 如果该资源不可下载或文件格式出错则提示用户  
                            else {  
                                uni.showToast({  
                                    title: "资源格式错误,请联系管理员"  
                                });  
                            }  
                        },  
                        fail: (res) => {  
                            console.log(res);  
                            // 下载失败提醒  
                            uni.hideLoading();  
                            uni.showToast({  
                                title: "下载失败",  
                                icon: "error"  
                            })  
                        }  
                    })
2023-05-20 11:17 负责人:无 分享
已邀请:
FullStack

FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866

saveVideoToPhotosAlbum 加 fail 回调

要回复问题请先登录注册