API | Description |
Create a SeatGridView object, supporting code creation and XML loading . | |
Enable local microphone | |
Disable local microphone | |
Pause publishing local audio stream | |
Resume publishing local audio stream | |
Anchor creates live room and starts streaming | |
Anchor stops streaming and destroys live room | |
Audience joins an anchor's live room | |
Audience leaves an anchor's live room | |
Update Room Mic Mode | |
Anchor Responds to Microphone Application/Audience Responds to Microphone Invitation | |
Anchor Cancels Microphone Invitation/Audience Cancels Microphone Application | |
Connect Mic | |
Disconnect Mic | |
Disconnect Mic | |
Anchor Invites User to Connect Mic | |
Anchor Kicks User off Mic | |
Anchor Locks Mic Position (including position lock, audio status lock, and video status lock) | |
Anchor Sets Layout Mode for Mic List | |
Set the adapter for the seat view | |
Set event callbacks | |
Remove event callbacks |
public SeatGridView(Context context)
Parameter | Type | Meaning |
context | Context | Android context object |
void startMicrophone(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void stopMicrophone()
void muteMicrophone()
void unmuteMicrophone(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void startVoiceRoom(RoomInfo roomInfo, GetRoomInfoCallback callback)
Parameter | Type | Meaning |
roomInfo | RoomInfo | Information for creating a live streaming room |
callback | ActionCallback | Callback of the operation |
void stopVoiceRoom(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void joinVoiceRoom(String roomId, GetRoomInfoCallback callback)
Parameter | Type | Meaning |
roomId | String | Live Streaming Room ID |
callback | ActionCallback | Callback of the operation |
void leaveVoiceRoom(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void updateRoomSeatMode(SeatMode seatMode, ActionCallback callback)
Parameter | Type | Meaning |
seatMode | SeatMode | FREE_TO_TAKE: Free seat mode, audience can join the seat freely without application; APPLY_TO_TAKE: Apply to join the seat mode, audience needs the anchor's consent to join the seat. |
callback | ActionCallback | Callback of the operation. |
void responseRemoteRequest(String userId, boolean agree, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | Responding user's user ID, if the current role is an audience member, the ID can be left blank |
agree | boolean | Whether to accept the request, true: accept the request, false: reject the request |
callback | ActionCallback | Callback of the operation |
void cancelRequest(String userId, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | Cancelled user's ID, if the current role is an audience member, the ID can be left blank |
callback | ActionCallback | Callback of the operation |
void takeSeat(int index, int timeout, VoiceRoomDefine.RequestCallback callback)
Parameter | Type | Meaning |
index | int | Mic position number for connecting |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform a timeout check or trigger a timeout callback |
callback | ActionCallback | Callback of the operation |
void moveToSeat(int index, ActionCallback callback)
Parameter | Type | Meaning |
index | int | Mic position number to move to |
callback | ActionCallback | Callback of the operation |
void leaveSeat(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void takeUserOnSeatByAdmin(int index, String userId, int timeout, VoiceRoomDefine.RequestCallback callback)
Parameter | Type | Meaning |
index | int | Invited Mic position number |
userId | String | Invited user ID |
timeout | int | Timeout period, unit: seconds. If set to 0, the SDK will not perform a timeout check or trigger a timeout callback |
callback | VoiceRoomDefine.RequestCallback | Callback of the operation |
void kickUserOffSeatByAdmin(String userId, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | User ID kicked off the Mic |
callback | ActionCallback | Callback of the operation |
void lockSeat(int seatIndex, TUIRoomDefine.SeatLockParams params, ActionCallback callback)
Parameter | Type | Meaning |
seatIndex | int | Mic position number to be locked |
params | TUIRoomDefine.SeatLockParams | Microphone Mute Parameters. See details: TUIRoomDefine.SeatLockParams |
callback | ActionCallback | Callback of the operation |
void setLayoutMode(LayoutMode layoutModel, SeatViewLayoutConfig layoutConfig)
Parameter | Type | Meaning |
layoutModel | Mic list layout modes, support element layout, grid layout, vertical layout, custom layout. | |
layoutConfig | Layout configuration information, effective only in custom layout mode |
void setSeatViewAdapter(VoiceRoomDefine.SeatViewAdapter adapter)
Parameter | Type | Meaning |
adapter | Seat view adapter |
void addObserver(SeatGridViewObserver observer)
Parameter | Type | Meaning |
observer | Callback object of core component |
void removeObserver(SeatGridViewObserver observer)
Parameter | Type | Meaning |
observer | Callback object of core component |
Type | Description |
Layout modes of the seat position list support element layout, grid layout, vertical layout, and custom layout | |
Alignment of seat position layout | |
Request type (apply to speak and invite to speak) | |
Size of the seat position layout | |
Microphone position layout configuration information | |
Seating Layout Row Configuration Information | |
Request Callback | |
Seat view adapter |
Type | Description |
FOCUS | Element Layout |
GRID | Grid Layout |
VERTICAL | Vertical layout |
FREE | Customized Layout |
Type | Description |
START | Seat position near the start |
END | Seat position near the end |
CENTER | Seat position near the middle |
SPACE_BETWEEN | No space before the first and after the last seat positions, evenly distribute the remaining space between other seat positions |
SPACE_AROUND | Distribute half of the space before the first and after the last seat positions, evenly distribute the remaining space between other seat positions |
SPACE_EVENLY | Evenly distribute the remaining space between all seat positions |
Type | Description |
APPLY_TO_TAKE_SEAT | Apply to speak |
INVITE_TO_TAKE_SEAT | Invite to speak |
Type | Description |
width | Layout width |
height | Layout height |
Type | Description |
rowConfigs | List of all row configuration information in the seat layout, refer to SeatViewLayoutRowConfig for content. |
rowSpacing | Seat row spacing |
Type | Description |
count | Number of seats displayed in this row |
seatSpacing | Horizontal spacing of each seat in this row (effective only when the alignment is START, END, or CENTER) |
seatSize | Size of the seat layout in this row |
alignment |
API | Description |
Request accepted | |
Request rejected | |
Request canceled | |
Request timeout | |
Request Exception |
API | Description |
Callback when creating a single seat layout. | |
Callback when updating the seat view. | |
Callback when updating user volume. |
void onAccepted(TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Response to the current request's user information |
void onRejected(TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Response to the current request's user information |
void onCancelled(TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | User information for the canceled request |
void onTimeout(TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | User information for the initiated request |
void onError(TUIRoomDefine.UserInfo userInfo, TUICommonDefine.Error error, String message);
Parameter | Type | Description |
userInfo | UserInfo | User information for the initiated request |
error | TUICommonDefine.Error | Error code |
message | String | Error message |
View createSeatView(SeatGridView seatGridView, TUIRoomDefine.SeatInfo seatInfo);
Parameter | Type | Description |
seatGridView | SeatGridView | Core components of voice chat room |
seatInfo | SeatInfo | Seat information |
void updateSeatView(SeatGridView seatGridView, TUIRoomDefine.SeatInfo seatInfo, View seatView);
Parameter | Type | Description |
seatGridView | SeatGridView | Core components of voice chat room |
seatInfo | SeatInfo | Seat information |
seatView | View | Current updated seat view |
void updateUserVolume(SeatGridView seatGridView, int volume, View seatView);
Parameter | Type | Description |
seatGridView | SeatGridView | Core components of voice chat room |
volume | int | Volume level |
seatView | View | Current seat layout view with volume changes |
Function List | Description |
Event of Room Termination Received | |
Event of Being Kicked Out of the Room Received | |
Event of Request for Speaking/Invitation to Speak Received | |
Event of Request for Speaking/Invitation to Speak Canceled | |
Event of User Kicked Off Seat Received | |
Event of User Audio Status Changed | |
Seat View Click Event |
void onRoomDismissed(String roomId);
Parameter | Type | Description |
roomId | String | Room ID |
void onKickedOutOfRoom(String roomId, TUIRoomDefine.KickedOutOfRoomReason reason, String message);
Parameter | Type | Description |
roomId | String | Room ID |
reason | KickedOutOfRoomReason | Reason for Being Kicked Out |
message | String | Description of Being Kicked Out |
void onSeatRequestReceived(VoiceRoomDefine.RequestType type, TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
type | Request type (Request for Speaking, Invitation to Speak) | |
userInfo | UserInfo | Information of the user who sent the request |
void onSeatRequestCancelled(VoiceRoomDefine.RequestType type, TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
type | Request type (Request for Speaking, Invitation to Speak) | |
userInfo | UserInfo | Information of the user who canceled the request |
void onKickedOffSeat(UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Information of the host who kicked the user off the seat |
void onUserAudioStateChanged(UserInfo userInfo, boolean hasAudio, TUIRoomDefine.ChangeReason reason);
Parameter | Type | Description |
userInfo | UserInfo | User Information |
hasAudio | boolean | Is there an audio stream |
reason | ChangeReason | Reason for audio stream change |
void onSeatViewClicked(View seatView, TUIRoomDefine.SeatInfo seatInfo);
Parameter | Type | Description |
seatView | View | Currently clicked seat view object |
seatInfo | SeatInfo | Seat information |
Was this page helpful?