加入房间回调异步处理

This commit is contained in:
zher52 2022-02-10 17:34:27 +08:00
parent be3b5a1134
commit c11559375e

View File

@ -201,14 +201,6 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
mRemoteViewList.get(0).changeUser(mTRTCCloud, mUserList.get(0)); mRemoteViewList.get(0).changeUser(mTRTCCloud, mUserList.get(0));
mTRTCCloud.enterRoom(trtcParams, TRTCCloudDef.TRTC_APP_SCENE_VIDEOCALL); mTRTCCloud.enterRoom(trtcParams, TRTCCloudDef.TRTC_APP_SCENE_VIDEOCALL);
JSONObject object = new JSONObject();
try {
object.put("room",mRoomId);
object.put("userId",mUserId);
CordovaEventKit.kit.fireEvent("onLayoutChangeMessage",object);
} catch (JSONException e) {
e.printStackTrace();
}
} }
@Override @Override
@ -355,6 +347,19 @@ public class VideoCallingActivity extends TRTCBaseActivity implements View.OnCli
} }
} }
@Override
public void onEnterRoom(int result){
JSONObject object = new JSONObject();
try {
object.put("room",mRoomId);
object.put("userId",mUserId);
CordovaEventKit.kit.fireEvent("onLayoutChangeMessage",object);
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override @Override
public void onError(int errCode, String errMsg, Bundle extraInfo) { public void onError(int errCode, String errMsg, Bundle extraInfo) {
Log.d(TAG, "sdk callback onError"); Log.d(TAG, "sdk callback onError");