|
6#
楼主 |
发表于 2017-5-24 14:34:17
|
只看该作者
谢谢,那android端接收pc端web网页调用以下代码
mTargetUserId = ID;
var cmdMsg={};
cmdMsg.cmdOption=CMD_SESSION_REQUEST;
var curSessionUser={
"srcUser":{"userId":mSelfUserId},
"tarUser":{"userId":mTargetUserId}
};
cmdMsg.curSessionUser=curSessionUser;
cmdMsg.srcUserId= mSelfUserId;
cmdMsg.tarUserId= mTargetUserId;
cmdMsg.sessionId= -1;
cmdMsg.sessionType=SESSION_TYPE_CALL;
var errorCode=BRAC_TransBuffer(mTargetUserId , JSON.stringify(cmdMsg));
AddLog("VideoCallRequest(" + "cellphone Clinet ID" + ID + ")=" + errorCode, LOG_TYPE_API);
后android应该怎么处理呢。以下代码是否可行
public void OnAnyChatTransBuffer(int dwUserid, byte[] lpBuf, int dwLen) {
String returnData = new String(lpBuf, "UTF-8");
JSONObject json = new JSONObject(returnData);
JSONObject json1 = new JSONObject(json.optString("curSessionUser"));
JSONObject json2 =new JSONObject(json1.optString("tarUser"));
int mTargetUserId = json2.optInt("userId");
anychat.VideoCallControl(AnyChatDefine.BRAC_VIDEOCALL_EVENT_REQUEST, mTargetUserId, 0, 0, 0, "");
}
还是要调用anychat.TransBuffer(0, lpBuf, lpBuf.length);
|
|