https://developers.weixin.qq.com/minigame/dev/guide/open-ability/game-recorder.html
点击分享按钮,返回operateWXData: fail
var gameRecorder = wx.getGameRecorder();
var startCb = function () {
console.log('start')
setTimeout(function () {
gameRecorder.stop().then(function (res) {
console.log(222, res)
const btn = wx.createGameRecorderShareButton({
// 样式参数
style: {
left: 10,
top: 150,
height: 50,
color: '#ffffff',
textAlign: 'center',
fontSize: 16,
borderRadius: 4,
iconMarginRight: 16,
paddingLeft: 1,
paddingRight: 30,
},
// 按钮的背景图片
image: 'button.jpg',
text: '自定义文案',
icon: 'icon.jpg',
// 分享参数
share: {
query: 'a=1&b=2',
// 背景音乐的路径
bgm: 'walkin.mp3',
timeRange: [[0, 1000], [2000, 3000]],
title: {
template: 'default.score',
data: {
score: 6500
}
},
button: {
template: 'default.enter',
}
}
})
btn.show()
btn.onTap(function (res) {
console.log(111, res)
})
}).catch(function (err) {
console.log(err)
})
}, 10000)
}
gameRecorder.on('start', startCb)
gameRecorder.on('stop', function(res){
console.log(333,res)
})
gameRecorder.start({ duration: 10, bitrate: 800 })
你好,请问是什么机型?能否提供个可复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。