getGameRecorder,添加监听事件,start正常执行,stop会报错sdk内部错误?
const canvas = wx.createCanvas();const context = canvas.getContext('2d');const recorder = wx.getGameRecorder()console.log('是否支持录制游戏画面', recorder.isFrameSupported())const gameRecorderShareButton = wx.createGameRecorderShareButton({ style: { top: 200, width: 200, height: 50 }, text: "分享", share: { title:{ template:"", data:"" }, button:{ template:"" }, query: "", timeRange: [0, 5000] }})// start 事件的回调函数的执行表示录制的真正开始recorder.on('start', () => { // 真正开始录制后的 5 秒后结束录制 console.log("真正开始录制后的 5 秒后结束录制")})// stop 事件的回调函数的执行表示录制完成recorder.on('stop', (res) => { console.log(`对局回放时长: ${res.duration}`)})recorder.on('error', (res) => { console.log(res,"error")})var o = 1;wx.onTouchStart(function(res) { // 发起开始录制的调用 if (o == 1) { recorder.start({}); o++ } else { recorder.stop(); }}) |
会报错fail internal failed (sdk内部错误)
是我代码哪里用的不对,还是真的是sdk错了???
