void joinRoom(long roomId, String peerIdentifier, boolean isVideo) { QavsdkControl qavsdkControl = ((FacekallApplication) mContext).getQavsdkControl(); if ((qavsdkControl != null) && (qavsdkControl.getAVContext() != null)) { qavsdkControl.setPeerIdentifier(peerIdentifier); Log.e(TAG, "WL_DEBUG joinRoom peerIdentifier = " + peerIdentifier); Log.e(TAG, "WL_DEBUG joinRoom roomId = " + roomId); AVRoom.Info roomInfo = new AVRoom.Info( AVRoom.AV_ROOM_PAIR, roomId, 0, isVideo ? AVRoom.AV_MODE_VIDEO : AVRoom.AV_MODE_AUDIO, peerIdentifier, null, 0); // create room qavsdkControl.getAVContext().joinRoom(mRoomDelegate, roomInfo); mIsInJoinRoom = true; mIsVideo = isVideo; } else { Log.e(TAG, "WL_DEBUG joinRoom qavsdkControl = " + (qavsdkControl == null)); mIsInJoinRoom = false; mIsVideo = false; } }
/** 关闭房间 */ int closeRoom() { Log.e(TAG, "WL_DEBUG closeRoom"); QavsdkControl qavsdk = ((FacekallApplication) mContext).getQavsdkControl(); if ((qavsdk != null) && (qavsdk.getAVContext() != null)) { AVContext avContext = qavsdk.getAVContext(); mIsInCloseRoom = true; int result = avContext.closeRoom(mCloseRoomCompleteCallback); return result; } else { Log.e(TAG, "WL_DEBUG joinRoom qavsdkControl = " + (qavsdk == null)); mIsInCloseRoom = false; return -1; } }