微信小程序莫名其妙wx.saveFile 怎么都不走了,也不报错
本文介绍了微信小程序莫名其妙wx.saveFile 怎么都不走了,也不报错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
不知为何怎么都不走进wx.saveFile 方法了,就算有错也应该会报吧,完全无视了这个方法,我搞不懂了。。
<button id="video" bindtap="showVideo" >test video </button>
<view class="container">
<video src="{{videoSrc}}" hidden="{{videoHidden}}"></video>
</view>
showVideo: function(event) {
var that = this
wx.chooseVideo({
sourceType: ['album','camera'],
maxDuration: 60,
camera: 'back',
success: function(res) {
var tempFilePath = res.tempFilePath;
that.setData({ videoSrc: tempFilePath });
that.setData({videoHidden: false});console.log(tempFilePath);
wx.saveFile({
tempFilePath: res.tempFilePath,
success: function(res) {console.log(res);
var savedFilePath = res.savedFilePath;
}
})
}
})
}
解决方案
tip: 本地文件存储的大小限制为 10M
这篇关于微信小程序莫名其妙wx.saveFile 怎么都不走了,也不报错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文