startGameRecord() {
var bitrate = 1000
if (hf.dataMgr.gameRecordQuality === hf.constants.GAME_RECORD_QUALITY.MID) {
bitrate = 2000
}
else if (hf.dataMgr.gameRecordQuality === hf.constants.GAME_RECORD_QUALITY.HIGH) {
bitrate = 3000
}
var recorder = wx.getGameRecorder()
recorder.start({
fps: 24,
bitrate: bitrate,
hookBgm: false,
duration: 60
})
console.log("xxxxxxxxxx startGameRecord")
}
stopGameRecord(cb) {
var recorder = wx.getGameRecorder()
recorder.stop()
this.m_stopCallBack = cb
}
showShareButton(bgm, duration) {
var timeRange
if (duration >= 60 * 1000) {
timeRange = [[0, 60 * 1000]]
}
else {
timeRange = [[0, duration]]
}
var sysInfo = wx.getSystemInfoSync()
var shareBtn = wx.createGameRecorderShareButton({
style: {
left: sysInfo.screenWidth / 2,
top: sysInfo.screenHeight / 2
},
share: {
query: "test",
bgm: bgm,
timeRange: timeRange
}
})
shareBtn.show()
shareBtn.onTap((info) => {
console.log("xxxxx share Tap ", info)
})
this.m_shareBtn = shareBtn
}
hideShareBtn() {
if (this.m_shareBtn) {
this.m_shareBtn.hide()
}
}
我的代码如上图所示,很简单,都是调用的API
问题如题所示,创建分享按钮后,每次分享的都是第一次录制的游戏视频。这功能也上线这么久了,没人用吗?
createGameRecorderShareButton只需要调用一次,之后需要修改的就直接在GameRecorder实例的属性上进行修改,重新调用createGameRecorderShareButton是无效的