提交 7a9096ea 作者: 王进

增加隐藏分享对局回放按钮接口

上级 9f652f58
......@@ -561,7 +561,7 @@ class WechatSDK {
// console.log("--SDK当前点击次数", this.clickCounter);
}
private async clickReport() {
if(this.clickCounter > 0) {
if (this.clickCounter > 0) {
const obj = this.heartParams;
const tmp = Date.parse(new Date().toString()).toString() // 获取请求的时间戳秒
obj.time = obj.gentime = tmp.substr(0, 10);
......@@ -967,7 +967,7 @@ class WechatSDK {
const _self = this;
try {
this.GameRecorder = (wx as any).getGameRecorder();
if(!this.GameRecorder.isFrameSupported()) {
if (!this.GameRecorder.isFrameSupported()) {
if (cpCallback) cpCallback({ status: 0, msg: '设备不支持录屏功能.' });
return;
}
......@@ -996,11 +996,13 @@ class WechatSDK {
public stopGameRecorder(shareInfo) {
try {
this.GameRecorder.stop();
this.createRecorderShareButton(shareInfo);
if (this.recorderBtn) this.recorderBtn.show();
else this.createRecorderShareButton(shareInfo);
} catch (err) {
console.log("$$SDK录屏异常::gameRecorder", err);
}
}
private recorderBtn = null // 对局回放分享按钮对象
private createRecorderShareButton(shareInfo) {
const _selt = this;
let recorderShareInfo = {
......@@ -1014,19 +1016,24 @@ class WechatSDK {
paddingLeft: shareInfo.paddingLeft,
paddingRight: shareInfo.paddingRight
},
image: shareInfo.image,
icon: shareInfo.icon || '',
image: shareInfo.image || '',
text: shareInfo.text || '',
share: {
query: 'fromOpenId=' + _selt.ReportParams.openId + '&from=share&tag=0&' + (shareInfo.query ? shareInfo.query : ''),
bgm: shareInfo.bgm,
timeRange: shareInfo.timeRange
}
};
let recorderBtn = (wx as any).createGameRecorderShareButton(recorderShareInfo);
recorderBtn.onTap(res => {
this.recorderBtn = (wx as any).createGameRecorderShareButton(recorderShareInfo);
// 当分享出现异常时才会触发点击回调
this.recorderBtn.onTap(res => {
console.log('--录屏异常:', res);
recorderBtn.hide();
});
}
public hideGameRecorderShareButton() {
if(this.recorderBtn) this.recorderBtn.hide();
}
private heartParams = {
action: "heartbeat",
appid: SDKConfig.productCode,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论