|
@@ -20,7 +20,8 @@ export class SdkUtil {
|
|
|
|
|
|
public static videoAd:any =null;
|
|
|
|
|
|
- public static tt_isSupportSidebar:boolean = false; //抖音_是否支持侧边栏
|
|
|
+ public static tt_systemInfo: any = null; //抖音_系统信息
|
|
|
+ public static tt_isSupportSidebar:boolean = false; //抖音_是否支持侧边栏
|
|
|
public static tt_isToEnterFromSidebar:boolean = false; //抖音_是否从侧边栏进入
|
|
|
|
|
|
private static tt_gameRecorder:any = null; //抖音游戏录制
|
|
@@ -28,6 +29,11 @@ export class SdkUtil {
|
|
|
private static tt_totalRecord:number = 300; //抖音总录制时间
|
|
|
private static tt_isRecording:boolean = false; //抖音是否录制中
|
|
|
|
|
|
+ public static init() {
|
|
|
+ this.ttRegisterSidebar()
|
|
|
+ this.ttGetSystemInfo()
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 自定义事件统计
|
|
|
*
|
|
@@ -231,6 +237,20 @@ export class SdkUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 抖音获取系统信息
|
|
|
+ */
|
|
|
+ public static ttGetSystemInfo() {
|
|
|
+ if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
|
|
|
+ tt.getSystemInfo({
|
|
|
+ success:(res) => {
|
|
|
+ // console.log('tt.getSystemInfo=',res)
|
|
|
+ SdkUtil.tt_systemInfo = res
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 抖音侧边栏
|
|
|
*
|
|
@@ -302,6 +322,11 @@ export class SdkUtil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ if(this.tt_systemInfo.platform == 'devtools') {
|
|
|
+ console.log('抖音模拟器')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if(this.ttIsScreenRecording()==true) {
|
|
|
this.ttStopScreenRecording()
|
|
|
}
|
|
@@ -322,6 +347,7 @@ export class SdkUtil {
|
|
|
this.tt_gameRecorder.onError((e)=> {
|
|
|
console.log('ttGameRecord error:',e)
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 抖音关闭屏幕录制
|