提交 159f53c3 作者: 王进

增加录屏功能回调

上级 1ec76170
...@@ -89,7 +89,7 @@ class TTSDK { ...@@ -89,7 +89,7 @@ class TTSDK {
os: _selt.sdkParams.os, // 返回系统类型IOS或者android os: _selt.sdkParams.os, // 返回系统类型IOS或者android
session_key: _selt.sdkParams.session_key // 返回session_key session_key: _selt.sdkParams.session_key // 返回session_key
}); });
_selt.createGameRecorder(); // _selt.createGameRecorder();
return LoginCallBack; return LoginCallBack;
} }
} }
...@@ -455,16 +455,19 @@ class TTSDK { ...@@ -455,16 +455,19 @@ class TTSDK {
// 头条必接录屏功能 // 头条必接录屏功能
private GameRecorder: any private GameRecorder: any
private videoPath: string private videoPath: string
private createGameRecorder() { // 创建录屏对象
private createGameRecorder(startEventCallBack?, stopEventCallBack?) {
const _self = this; const _self = this;
try { try {
this.GameRecorder = (tt as any).getGameRecorderManager(); this.GameRecorder = (tt as any).getGameRecorderManager();
this.GameRecorder.onStart(res => { this.GameRecorder.onStart(res => {
console.log("$$开始录屏::麦克风状态", res); console.log("$$开始录屏::麦克风状态", res);
if(startEventCallBack) startEventCallBack();
}); });
this.GameRecorder.onStop(res => { this.GameRecorder.onStop(res => {
console.log("$$结束录屏::视频路径", res); console.log("$$结束录屏::视频路径", res);
if (res) _self.videoPath = res.videoPath; if (res) _self.videoPath = res.videoPath;
if(stopEventCallBack) stopEventCallBack();
}) })
} catch (err) { } catch (err) {
console.log("$$SDK录屏异常::gameRecorder", err); console.log("$$SDK录屏异常::gameRecorder", err);
...@@ -472,7 +475,6 @@ class TTSDK { ...@@ -472,7 +475,6 @@ class TTSDK {
} }
public startGameRecorder(recorderInfo: ttRecorderInfo) { public startGameRecorder(recorderInfo: ttRecorderInfo) {
try { try {
console.log(recorderInfo);
this.GameRecorder.start({ this.GameRecorder.start({
duration: recorderInfo.time, duration: recorderInfo.time,
microphoneEnabled: recorderInfo.useMic microphoneEnabled: recorderInfo.useMic
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论