Super room

10.1 Get the XHSuperRoomManager instance and add the event listeners

XHSuperRoomManager superRoomManager = XHClient.getInstance().getSuperRoomManager(this);
superRoomManager.addListener(new IXHSuperRoomManagerListener() {
@Override
public void onActorJoined(String liveID, String actorID) {
// Someone has joined the super room
}

@Override
public void onActorLeft(String liveID, String actorID) {
//Someone has left the super room
}

@Override
public void onSuperRoomError(String liveID, String error) {
//Some abnormal conditions may cause the live 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 being muted
}

@Override
public void onCommandToStopPlay(String liveID) {
//You are forced to stop live.
}

@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 data
}
});

10.2 XHSuperRoomManager API Description

/**
* Add the event listener
* @param superRoomManagerListener IXHSuperRoomManagerListener Receiving related events
*/
void addListener(IXHSuperRoomManagerListener superRoomManagerListener);

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

/**
* Create a live room
* @param liveItem XHLiveItem Specify the Live name and type
* @param callback Result callback
*/
void createSuperRoom(XHSuperRoomItem superRoomItem, IXHResultCallback callback);

/**
* Join the super room
* @param roomID Live ID
* @param callback Result callback
*/
void joinSuperRoom(String roomID, IXHResultCallback callback);

/**
* Stop speaking
* @param callback Result callback
*/
void layDownMic(IXHResultCallback callback);

/**
* Apply for a speech
* @param callback Result callback. The sessionid will be returned upon success, which is used for query of recording records on the server.
*/
void pickUpMic(IXHResultCallback callback);

/**
* Leave the chat room
* @param callback Result callback
*/
void leaveSuperRoom(IXHResultCallback callback);

/**
* A view that specifies the display for the live 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);

/**
* stop to be a broadcaster
* @param toID someone who will be stopped to be a broadcaster
*/
void commandToAudience(String toID);


/**
* 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 Switch to the large image of the user ID
*/
void changeToBig(String userID);

/**
* Switch to the small video preview
* @param userID Switch to the small image of the user ID
*/
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 live room
* @param memberID the member who is mute
* @param muteSeconds mute time
* @param callback Result callback
*/
void muteMember(String memberID, int muteSeconds, IXHResultCallback callback);


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

/**
* kick out users in the live room
* @param memberID the member who is being kicked out
* @param callback Result callback
*/
void kickMember(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);