小米10,使用camera组件,调用stopRecord没有成功回调,然后通过点击事件调用方法一直返回错误operateCamera:fail:is stopping
startTimer: function () {
let that = this;
this.data.timer = setInterval(function () {
that.data.time.second--;
if (that.data.time.second === 1 && that.data.status.record === "recording") {
that.stopRecord();
}
that.setData({
time: that.data.time
})
}, 1000)
},
stopTimer: function () {
clearInterval(this.data.timer);
},
stratRecord: function () {
let that = this;
this.cameraContext.startRecord({
success: function (res) {
console.log('开始录制')
that.startTimer();
},
fail: function (res) {
},
})
},
stopRecord: function () {
let that = this;
this.cameraContext.stopRecord({
success: function (res) {
console.log('停止录制');
that.data.video = res.tempVideoPath;
that.data.img = res.tempThumbPath;
that.stopTimer();
that.data.status.record = 'success';
that.data.time.second = 5;
that.setData({
status: that.data.status,
video: that.data.video,
img: that.data.img,
time: that.data.time
})
},
fail: function (res) {
console.log(res);
if(res.errMsg === "operateCamera:fail:is stopping"){
} else {
that.stopTimer();
that.data.status.record === 'not';
that.data.time.second = 5;
that.setData({
status: that.data.status,
time: that.data.time
})
}
},
})
},
加q1412727078,帮你解决
问题解决了吗
遇到同样问题,huwei--p40,一加手机,解决了吗?
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
fail呢?
请学会如何「提问」(👈戳我)