onshow中使用cameraContext.startRecord 报错,闪退
先贴代码:
onShow: function () { var that = this; that.ctx = wx.createCameraContext() that.ctx.startRecord({ success: (res) => { console.log('startRecord') setTimeout(function () { that.ctx.stopRecord({ success: (res) => { that.setData({ src: res.tempVideoPath }) } }) }, 5000) } }) }, |
,这种写法在某一个版本库更新之后,突然如下错误报错:
然后在onshow中做了1秒延时,初步解决了这个问题,代码如下:
onShow: function () { var that = this; that.ctx = wx.createCameraContext() setTimeout(function(){ that.ctx.startRecord({ success: (res) => { console.log('startRecord') setTimeout(function () { that.ctx.stopRecord({ success: (res) => { that.setData({ src: res.tempVideoPath }) } }) }, 5000) } }) },1000) }, |
,但是经过多次真机测试,发现华为p9plus中,每次就会有一次微信闪退,小米机器未发现闪退现象,oppo中有闪退,但是几率特别小,可能几十次出现一次。请问这种情况该怎么解决?
还有,现在联系官方是在是太费劲了,能不能有客服保证开发人员能联系上呢。
