Video Meeting

8.1 Get XHMeetingManager instance and add video meeting event listener

XHMeetingManager meetingManager = XHClient.getInstance().getMeetingManager(this);
meetingManager.addListener(new IXHMeetingManagerListener() {
@Override
public void onJoined(String meetingID, String userID) {
//Someone has joined the meeting
}

@Override
public void onLeft(String meetingID, String userID) {
//Someone has left the meeting
}

@Override
public void onMeetingError(String meetingID, String error) {
// Some abnormal conditions may cause the meeting to go wrong
}

@Override
public void onMembersUpdated(int membersNumber) {
// The number of members has changed
}

@Override
public void onSelfKicked() {
//You are kicked
}

@Override
public void onSelfMuted(int seconds) {
//You are muted
}

@Override
public void onReceivedMessage(XHIMMessage message) {
//receive a message
}

@Override
public void onReceivePrivateMessage(XHIMMessage message) {
//receive a private message
}

@Override
public void onReceiveRealtimeData(byte[] data, String upId) {
//Receive real-time whiteboard data
}
});

8.2 XHMeetingManager API Description

/**
* Add event listeners for video meeting
* @param meetingManagerListener IXHMeetingManagerListener Related events for receiving video meeting
*/
void addListener(IXHMeetingManagerListener meetingManagerListener);

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

/**
* A view that specifies the display for the meeting participants
* @param userID User ID
* @param player StarPlayer for displaying the view
* @param isBig Set whether to display a large image of the anchor
*/
void attachPlayerView(String userID,StarPlayer player,Boolean isBig);

/**
* Create a meeting room
* @param meetingItem Specify the Live name and type
* @param callback Result callback
*/
void createMeeting(XHMeetingItem meetingItem, IXHResultCallback callback);

/**
* Join the meeting room
* @param meetingID Meeting ID
* @param callback Result callback. The sessionid will be returned upon success, which is used for query of recording records on the server.
*/
void joinMeeting(String meetingID, IXHResultCallback callback);

/**
* Leave the meeting room
* @param meetingID Meeting ID
* @param callback Result callback
*/
void leaveMeeting(String meetingID, IXHResultCallback callback);

/**
* Switch camera direction
*/
void switchCamera();

/**
* Switch camera direction
* @param cameraId Specified camera ID
*/
void switchCamera(int cameraId);

/**
* Switch to the big video preview
* @param userID The user ID of switch to the big video preview
*/
void changeToBig(String userID);

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

/**
* 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(Boolean enable);

/**
* 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(Boolean enable);

/**
* Send a message
* @param message message
* @param callback Result callback
* @return Return the sent message object
*/
XHIMMessage sendMessage(String message, IXHResultCallback callback);

/**
* Send a private message
* Private messages can only be received by the target user
* @param message message
* @param toID Target user ID
* @param callback Result callback
* @return Return the sent message object
*/
XHIMMessage sendPrivateMessage(String toID, String message, IXHResultCallback callback);

/**
* mute somebody in the meeting room
* @param chatroomID meeting room ID
* @param memberID the member who is mute
* @param muteSeconds mute time
* @param callback Result callback
*/
void muteMember(String meetingID, String memberID, int muteSeconds, IXHResultCallback callback);

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

/**
* kick out users in the meeting room
* @param chatroomID chatroom ID
* @param memberID the member who is being kicked out
* @param callback Result callback
*/
void kickMember(String meetingID, String memberID, IXHResultCallback callback);

/**
* Push RTMP stream
* @param rtmpurl Push address
* @param callback Result callback
*/
void pushRtmp(String rtmpurl,IXHResultCallback callback);

/**
* Stop pushing RTMP stream
* @param callback Result callback
*/
void stopPushRtmp(IXHResultCallback callback);

/**
* Set recorder
* @param recorder
*/
void setRecorder(IXHRecorder recorder);

/**
* Switch recorder
* @param recorder
*/
void resetRecorder(IXHRecorder recorder);

/**
* Send the real-time data
* @param data data array
*/
void sendRealtimeData(byte[] data);