视频会议

7.1 Create a video meeting

Create a CMeetingManager object
Add getting meeting list callback function pointer

The class which the object belongs to needs to implement the IMeetingManagerListener interface.
m_pMeetingManager = new CMeetingManager(m_pUserManager, this);
CMeetingManager::addChatroomGetListListener(this);

7.2 Callback function description

/**
* Someone has joined the meeting
* @param meetingID user ID
* @param userID meeting ID
*/
virtual void onJoined(string meetID, string userID) = 0;

/**
* Someone has left the meeting
* @param meetingID meeting ID
* @param userID the user ID who left the meeting room
*/
virtual void onLeft(string meetingID, string userID) = 0;

/**
* Some abnormal conditions may cause the meeting to go wrong. Please leave the meeting room after receiving the callback.
* @param meetingID meeting ID
* @param error error information
*/
virtual void onMeetingError(string meetingID, string error) = 0;


/**
* The number of members has changed
* @param number Number of members
*/
virtual void onMembersUpdated(int number) = 0;

/**
* You are kicked
*/
virtual void onSelfKicked() = 0;

/**
* You are being muted
*/
virtual void onSelfMuted(int seconds) = 0;

/**
* Receive a message
* @param message
*/
virtual void onReceivedMessage(CIMMessage* pMessage) = 0;

/**
* Receive a private message
* @param message
*/
virtual void onReceivePrivateMessage(CIMMessage* pMessage) = 0;
virtual int getRealtimeData(string strUserId, uint8_t* data, int len) = 0;
/**
* Receive the video data
* @param upId
* @param w width
* @param h height
* @param videoData video data
* @param videoDataLen Data length
*/
virtual int getVideoRaw(string strUserId, int w, int h, uint8_t* videoData, int videoDataLen) = 0;

7.3 The description of getting a list of meeting

The usage without AEC

 * Get the list of meeting room
*/
void getMeetingList()
{
XHMeetingManager::getMeetingList("", CHATROOM_LIST_TYPE_MEETING);
}
After calling this method, the corresponding chatroomQueryAllListOK callback function will be called.
/*
* Save the meeting room
*/
string strInfo = "{\"id\":\"";
strInfo += strMeetingId;
strInfo += "\",\"creator\":\"";
strInfo += m_pUserManager->m_ServiceParam.m_strUserId;
strInfo += "\",\"name\":\"";
strInfo += strName.GetBuffer(0);
strInfo += "\"}";
m_pMeetingManager->saveToList(m_pUserManager->m_ServiceParam.m_strUserId, CHATROOM_LIST_TYPE_MEETING, strMeetingId, strInfo);

The usage with AEC

/**
* Get the list of meeting room
*/
void getMeetingList()
{
list<ChatroomInfo> listData;
CInterfaceUrls::demoRequestMeetingList(listData, m_pUserManager);
chatroomQueryAllListOK(listData);
}
/*
* Save the meeting room
*/
string strInfo = "{\"id\":\"";
strInfo += strMeetingId;
strInfo += "\",\"creator\":\"";
strInfo += m_pUserManager->m_ServiceParam.m_strUserId;
strInfo += "\",\"name\":\"";
strInfo += strName.GetBuffer(0);
strInfo += "\"}";
CInterfaceUrls::demoSaveToList(m_pUserManager->m_ServiceParam.m_strUserId, CHATROOM_LIST_TYPE_MEETING, strMeetingId, strInfo);

7.4 XHMeetingManager API 说明

/**
* Add getting meeting list callback function
* @param pChatroomGetListListener
*/
static void addChatroomGetListListener(IChatroomGetListListener* pChatroomGetListListener);
/**
* Get a list of meeting room
* @param strUserId user ID
* @param listType list type
*/
static void getMeetingList(string strUserId, int listType);

/**
* Set the media type
* @param mediaTypeEnum Audio and video exist at the same time, or only one of them is turned on.
*/
void setRtcMediaType(int mediaTypeEnum);

/**
* Create a meeting
* @param strName name
* @param chatroomType chatroom type
* @param channelType channel type
* @return meeting id
*/
string createMeeting(string strName, int chatroomType, int channelType);
/**
* Join the meeting room
* @param strMeetingID Meeting ID
*/
bool joinMeeting(string strMeetingID);

/**
* Leave the meeting room
* @param strMeetingID Meeting ID
*/
bool leaveMeeting(string strMeetingID);

/**
* Switch to the big video preview
* @param strUserID The user ID of switch to the big video preview
*/
bool changeToBig(string strUserID);

/**
* Switch to the small video preview
* @param userID The user ID of switch to the small video preview
*/
bool changeToSmall(string strUserID);

/**
* Dynamically switch audio:the audio can be switched at any time during the live broadcast, and the status is automatically reset after the live broadcast ends.
*/
void setAudioEnable(bool bEnable);

/**
* Dynamically switch video:the video can be switched at any time during the live broadcast, and the status is automatically reset after the live broadcast ends.
*/
void setVideoEnable(bool bEnable);

/**
* Send a message
* @param strMessage message
* @return Return the sent message object
*/
CIMMessage* sendMessage(string strMessage);

/**
* Send a private message
* Private messages can only be received by the target user
* @param message message
* @param toID Target user ID
* @return Return the sent message object
*/
CIMMessage* sendPrivateMessage(string toID, string strMessage);

/**
* Mute somebody in the meeting room
* @param chatroomID meeting room ID
* @param memberID the member who is mute
* @param muteSeconds mute time
*/
bool muteMember(string meetingID, string memberID, int muteSeconds);

/**
* Unmute somebody in the meeting room
* @param chatroomID meeting room ID
* @param memberID the member who is unmute
* @param callback Result callback
*/
bool unMuteMember(string meetingID, string memberID);

/**
* Kick out users in the meeting room
* @param chatroomID chatroom ID
* @param memberID the member who is being kicked out
*/
bool kickMember(string meetingID, string memberID);

/**
* Save the meeting room to the list
* @param userId
* @param type
* @param meetingId
* @param data
*/
bool saveToList(string userId, int type, string meetingId, string data);

/**
* Delete the meeting room from the list
* @param userId userId
* @param type type
* @param meetingId meetingId
*/
void deleteFromList(string userId, int type, string meetingId);

/**
* Push RTMP stream
* @param rtmpurl Push address
*/
void pushRtmp(string rtmpurl);

/**
* Stop pushing RTMP stream
*/
void stopPushRtmp();

/**
* Insert audio data
* @param audioData
* @param dataLen
*/
void insertAudioRaw(uint8_t* audioData, int dataLen);

/**
* Insert video data
* @param videoData
* @param dataLen
* @param isBig
*/
void insertVideoRaw(uint8_t* videoData, int dataLen, int isBig);

/**
* Crop the video data
*/
int cropVideoRawNV12(int w, int h, uint8_t* videoData, int dataLen, int yuvProcessPlan, int rotation, int needMirror, uint8_t* outVideoDataBig, uint8_t* outVideoDataSmall);

/**
* Query the audio data
*/
void querySoundData(uint8_t** pData, int* nLength);