Feature
MLVBLiveRoom event callback APIs
Introduction
APIs for the callback of room exit, debugging events, errors, and more.
Error callback.
void onError(int errCode, String errMsg, Bundle extraInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errMsg | String | Error message |
extraInfo | Bundle | Additional information, such as the user for which the error is generated. It generally does not require attention and is displayed for local errors by default. |
Introduction
This callback indicates that the SDK encounters an unrecoverable error. Such errors must be listened for, and UI reminders should be sent to users depending on the situation.
Warning callback.
void onWarning(int warningCode, String warningMsg, Bundle extraInfo)
Parameters
Parameter | Type | Description |
---|---|---|
warningCode | int | Warning code |
warningMsg | String | Warning information |
extraInfo | Bundle | Additional information, such as the user for which the warning is generated. It generally does not require attention and is displayed for local errors by default. |
void onDebugLog(String log)
Callback of room termination.
void onRoomDestroy(String roomID)
Parameters
Parameter | Type | Description |
---|---|---|
roomID | String | Room ID |
Introduction
When a host exits a room, all users in the room will receive this callback notification.
Notification of the room entry of a new host.
void onAnchorEnter(AnchorInfo anchorInfo)
Parameters
Parameter | Type | Description |
---|---|---|
anchorInfo | AnchorInfo | ID of the new host who enters the room |
Introduction
When a new host enters a room, the host already in the room and mic connect viewers will receive the notification of the new host's room entry, and they can call MLVBLiveRoom#startRemoteView(AnchorInfo, TXCloudVideoView, PlayCallback) to display the video image of the new host.
Note:Common viewers in the live room will not receive notifications of host entry and exit.
Notification of the room exit of a host.
void onAnchorExit(AnchorInfo anchorInfo)
Parameters
Parameter | Type | Description |
---|---|---|
anchorInfo | AnchorInfo | ID of the user who exits the room |
Introduction
When a host exits a room, the host in the room and mic connect viewers will receive the notification of the host's room exit, and they can call MLVBLiveRoom#stopRemoteView(AnchorInfo) to close the video image of the host.
Note:Common viewers in the live room will not receive notifications of host entry and exit.
Notification of the room entry of a viewer.
void onAudienceEnter(AudienceInfo audienceInfo)
Parameters
Parameter | Type | Description |
---|---|---|
audienceInfo | AudienceInfo | Information of the viewer who enters the room |
Notification of the room exit of a viewer.
void onAudienceExit(AudienceInfo audienceInfo)
Parameters
Parameter | Type | Description |
---|---|---|
audienceInfo | AudienceInfo | Information of the viewer who exits the room |
Callback of host receiving a mic connect request from a viewer.
void onRequestJoinAnchor(AnchorInfo anchorInfo, String reason)
Parameters
Parameter | Type | Description |
---|---|---|
anchorInfo | AnchorInfo | Information of the viewer |
reason | String | Reason for mic connect |
Notification of being kicked out of mic connect received by mic connect viewer.
void onKickoutJoinAnchor()
Introduction
If a mic connect viewer receives a message of being kicked out of mic connect by the host, the viewer needs to call MLVBLiveRoom#kickoutJoinAnchor(String) to exit mic connect.
Notification of a cross-room competition request.
void onRequestRoomPK(AnchorInfo anchorInfo)
Parameters
Parameter | Type | Description |
---|---|---|
anchorInfo | AnchorInfo | Information of the host who initiates cross-room mic connect |
Introduction
If a host receives a competition request from the host of another room and accepts the competition, the invited host needs to call MLVBLiveRoom#startRemoteView(AnchorInfo, TXCloudVideoView, PlayCallback) to display the video image of the inviting host.
Notification of the stop of cross-room competition.
void onQuitRoomPK(AnchorInfo anchorInfo)
Callback of the receipt of a text message.
void onRecvRoomTextMsg(String roomID, String userID, String userName, String userAvatar, String message)
Parameters
Parameter | Type | Description |
---|---|---|
roomID | String | Room ID |
userID | String | Sender ID |
userName | String | Sender nickname |
userAvatar | String | Sender profile photo |
message | String | Text message |
Callback of the receipt of a custom message.
void onRecvRoomCustomMsg(String roomID, String userID, String userName, String userAvatar, String cmd, String message)
Parameters
Parameter | Type | Description |
---|---|---|
roomID | String | Room ID |
userID | String | Sender ID |
userName | String | Sender nickname |
userAvatar | String | Sender profile photo |
cmd | String | Custom CMD |
message | String | Custom message content |
Feature
Login result callback APIs
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
Viewer list getting result callback APIs
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess(ArrayList< RoomInfo > roomInfoList)
Parameters
Parameter | Type | Description |
---|---|---|
roomInfoList | ArrayList< RoomInfo > | Room list |
Feature
Viewer list getting result callback APIs
Introduction
When viewers enter a room, the backend adds their information to the viewer list of the room. A viewer list can contain up to 30 viewers.
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess(ArrayList< AudienceInfo > audienceInfoList)
Parameters
Parameter | Type | Description |
---|---|---|
audienceInfoList | ArrayList< AudienceInfo > | Viewer list |
Feature
Room creation result callback APIs
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess(String RoomID)
Parameters
Parameter | Type | Description |
---|---|---|
RoomID | String | Room ID |
Feature
Room entry result callback APIs
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
Room exit result callback APIs
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of viewer's mic connect request results
Callback of host accepting mic connect.
void onAccept()
Callback of host rejecting mic connect.
void onReject(String reason)
Parameters
Parameter | Type | Description |
---|---|---|
reason | String | Reason for rejection |
Callback of request timeout.
void onTimeOut()
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Feature
APIs for the callback of mic connect status entering results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of mic connect status exiting results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of cross-room competition request results
Callback of host accepting cross-room competition.
void onAccept(AnchorInfo anchorInfo)
Parameters
Parameter | Type | Description |
---|---|---|
anchorInfo | AnchorInfo | Information of the invited host |
Callback of host rejecting cross-room competition.
void onReject(String reason)
Parameters
Parameter | Type | Description |
---|---|---|
reason | String | Reason for rejection |
Callback of request timeout.
void onTimeOut()
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Feature
APIs for the callback of cross-room competition exiting results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
Player callback APIs
Start callback.
void onBegin()
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Callback of other events.
void onEvent(int event, Bundle param)
Parameters
Parameter | Type | Description |
---|---|---|
event | int | Event ID |
param | Bundle | Additional information of the event |
Feature
APIs for the callback of text message sending results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of custom text message sending results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of custom information setting results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
Success callback.
void onSuccess()
Feature
APIs for the callback of custom information getting results
Error callback.
void onError(int errCode, String errInfo)
Parameters
Parameter | Type | Description |
---|---|---|
errCode | int | Error code |
errInfo | String | Error information |
APIs for the callback of custom text message getting results
void onGetCustomInfo(Map< String, Object > customInfo)
Parameters
Parameter | Type | Description |
---|---|---|
customInfo | Map< String, Object > | Custom information |
Was this page helpful?