- 用wx.downloadFile这个函数下载文件时扩展名是空的怎么回事
1、我们下载文件是通过接口 流的方式下载的,但我们下载下来后没有文件扩展名,这个是怎么回事? 我通过浏览器直接访问下载是有扩展名的。 [图片] 2、通过wx.openDocument(OBJECT) ,打开WORD文档一直打不开,我写死了一个文件名 手机上预览也是打不开。
2016-12-01 - 调用downloadFile 下载的缓存文件,怎么清除
目前想实现的功能是把视频保存到用户相册的功能。实现的方式就是,调用 wx.downloadFile的api,然后再根据下载成功的本地链接,去调用 wx.saveVideoToPhotosAlbum方法,保存到本地相册。问题如下描述 - 当前 Bug 的表现(可附上截图) 问题是,在调用wx.downloadFile方法的时候,如果我不指定存储的文件路径,也就是不设定filePath的时候,有些视频没办法保存,下载下来的视频格式为非mp4格式,或者没有后缀,如果给他手动设置filePath的话,文件会存在wx://user/...mp4 文件夹下,但是却不知道如何删除,导致一下子缓存就满了(10m),使用wx.getSavedFileList(Object object),也不能获取到这个缓存数据 代码如下 wx.downloadFile({ url: videoSrc, filePath:`${wx.env.USER_DATA_PATH}/fileName.mp4}`, //设置路径,并且设置文件名为.mp4结尾 success(res) { wx.saveVideoToPhotosAlbum({ filePath: res.filePath, success(res) { self.msg("text", "保存成功"); }, fail(res) { self.msg("text", "保存失败"); console.log(res); } }); - 预期表现 可以清除掉本地缓存,可以保存视频成功 -感谢大家的帮助
2019-05-10 - BackgroundAudioManager播放MP3中途报错
- 当前 Bug 的表现(可附上截图) [图片] - 预期表现 1:在播放音频时,在BackgroundAudioManager.onWait阶段耗费的时间过长。但是在浏览器中测试发现音频文件的加载速度并没有问题。 2:音频在播放到一半时,必定会报“音频文件错误”的错误。 console中报错信息: weapp:///pages/debug/debug.js:30 on waiting! debug.js:31 audio error! debug.js:32 {src: "https://tsn.baidu.com/text2audio?tex=%25E8%25BF%25…29&cuid=ogAH25c960dWBqxYYqhRdMzLWYrU&ctp=1&lan=zh", errCode: 10001, errMsg: "errCode:67, err:decode audio fail"}errCode: 10001errMsg: "errCode:67, err:decode audio fail"src: "https://tsn.baidu.com/text2audio?tex=%25E8%25BF%2599%25E6%2598%25AF%25E6%25AF%259B%25E6%25B3%25BD%25E4%25B8%259C%25E4%25B8%25BA%25E4%25B8%25AD%25E5%2585%25B1%25E4%25B8%25AD%25E5%25A4%25AE%25E8%25B5%25B7%25E8%258D%2589%25E7%259A%2584%25E7%25BB%2599%25E4%25B8%25AD%25E5%2585%25B1%25E4%25B8%25AD%25E5%25A4%25AE%25E4%25B8%259C%25E5%258C%2597%25E5%25B1%2580%25E7%259A%2584%25E6%258C%2587%25E7%25A4%25BA%25E3%2580%2582%25E6%25AF%259B%25E6%25B3%25BD%25E4%25B8%259C%25E5%259C%25A8%25E4%25B8%25BA%25E4%25B8%25AD%25E5%2585%25B1%25E4%25B8%25AD%25E5%25A4%25AE%25E8%25B5%25B7%25E8%258D%2589%25E7%259A%2584%25E8%25BF%2599%25E4%25B8%25AA%25E6%258C%2587%25E7%25A4%25BA%25E4%25B8%25AD%25EF%25BC%258C%25E9%25A2%2584%25E8%25A7%2581%25E5%2588%25B0%25E4%25B8%259C%25E5%258C%2597%25E6%2596%2597%25E4%25BA%2589%25E7%259A%2584%25E8%2589%25B0%25E8%258B%25A6%25E6%2580%25A7%25EF%25BC%258C%25E7%25A1%25AE%25E5%25AE%259A%25E4%25BA%2586%25E4%25B8%25AD%25E5%259B%25BD%25E5%2585%25B1%25E4%25BA%25A7%25E5%2585%259A%25E5%259C%25A8%25E4%25B8%259C%25E5%258C%2597%25E7%259A%2584%25E4%25BB%25BB%25E5%258A%25A1%25E6%2598%25AF%25E5%259C%25A8%25E8%25B7%259D%25E7%25A6%25BB%25E5%259B%25BD%25E6%25B0%2591%25E5%2585%259A%25E5%258D%25A0%25E9%25A2%2586%25E4%25B8%25AD%25E5%25BF%2583%25E8%25BE%2583%25E8%25BF%259C%25E7%259A%2584%25E5%259F%258E%25E5%25B8%2582%25E5%2592%258C%25E5%25B9%25BF%25E5%25A4%25A7%25E4%25B9%25A1%25E6%259D%2591%25EF%25BC%258C%25E5%25BB%25BA%25E7%25AB%258B%25E5%25B7%25A9%25E5%259B%25BA%25E7%259A%2584%25E6%25A0%25B9%25E6%258D%25AE%25E5%259C%25B0%25EF%25BC%258C%25E5%258F%2591%25E5%258A%25A8%25E7%25BE%25A4%25E4%25BC%2597%25EF%25BC%258C%25E9%2580%2590%25E6%25AD%25A5%25E7%25A7%25AF%25E8%2593%2584%25E5%258A%259B%25E9%2587%258F%25EF%25BC%258C%25E5%2587%2586%25E5%25A4%2587%25E5%259C%25A8%25E5%25B0%2586%25E6%259D%25A5%25E8%25BD%25AC%25E5%2585%25A5%25E5%258F%258D%25E6%2594%25BB%25E3%2580%2582&tok=24.f4a7382a79d51d6a303e75dfcec0ef23.2592000.1558171770.282335-16033429&cuid=ogAH25c960dWBqxYYqhRdMzLWYrU&ctp=1&lan=zh"__proto__: Object 3:该接口在开发工具中是正常可用的,并且使用InnerAudio接口在开发工具和真机上也是正常可用的。 - 复现路径 代码片段在手机上打开后等待即可。 - 提供一个最简复现 Demo 如代码片段
2019-04-24