收藏
回答

企业微信中CameraContext.startRecord调用报startRecord fail?

小米手机企业微信中开发录像功能,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)

}

});

},


最后一次编辑于  2022-05-23
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容