小米手机企业微信中开发录像功能,CameraContext.startRecord报errMsg:“operateCamera:fail:startRecord fail”
<view class="camera" :style="{top:top_height+45+'px'}">
<camera device-position="front" flash="off" @initdone="startRecord" style="width:45px;height:45px"></camera>
</view>
startRecord(e){
console.log(e);
let that=this;
uni.getSystemInfo({
success(res) {
that.top_height = res.statusBarHeight;
}
});
const ctx=uni.createCameraContext();
console.log(ctx);
console.log('准备录制');
ctx.startRecord({
timeout:that.videoTime,
success: (res) => {
console.log('开始录像')
console.log(res);
that.videoing=true;
},
timeoutCallback:function(res){//超出录制时长
console.log(res);
that.video=res;
that.videoing=false;
},
fail:(res)=>{
console.log('开始录像失败')
console.log(res)
}
});
},
我也遇到这个问题,解决了吗