API | Description |
Create LiveCoreView object, supporting both code creation and XML loading methods. | |
Start camera capture and display the captured video on LiveCoreView. | |
Turn on the local microphone | |
Pause publishing local audio stream? | |
Turns the local camera off | |
Turn off the local microphone | |
Anchor creates a live streaming room and starts streaming | |
Anchor stops streaming and destroys the live room | |
Audience member joins an anchor's live streaming room | |
Audience member leaves an anchor's live streaming room | |
Audience member requests to connect with the anchor | |
Audience member cancels the request to connect with the anchor | |
Anchor responds to the audience member's request for connection | |
Anchor disconnects the connected audience member | |
Audience member stops the connection with the anchor themselves | |
Anchor requests to connect with another anchor in a different live room | |
Anchor cancels the request to connect with another anchor in a different live room | |
Anchor responds to the connection request | |
Anchor disconnects the connection | |
Register a connection event callback | |
Unregister a connection event callback | |
Set the layout mode of the connected broadcaster's video screen | |
Set a view adapter for adding widgets to the broadcaster's video screen |
public LiveCoreView(Context context)
Parameters | Type | Meaning |
context | Context | Android context object |
public void startCamera(boolean useFrontCamera, ActionCallback callback)
Parameters | Type | Meaning |
useFrontCamera | boolean | true: use front camera, false: use rear camera |
callback | ActionCallback | Callback of the operation |
void startMicrophone(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void muteMicrophone(boolean mute)
Parameter | Type | Meaning |
mute | boolean | true: Pause video stream publishing, false: Normal video stream publishing |
void stopCamera()
void stopMicrophone()
void startLiveStream(RoomInfo roomInfo, GetRoomInfoCallback callback)
Parameter | Type | Meaning |
roomInfo | RoomInfo | Create live room information |
callback | ActionCallback | Callback of the operation |
void stopLiveStream(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void joinLiveStream(String roomId, GetRoomInfoCallback callback)
Parameter | Type | Meaning |
roomId | String | Live room ID |
callback | ActionCallback | Callback of the operation |
void leaveLiveStream(ActionCallback callback)
Parameter | Type | Meaning |
callback | ActionCallback | Callback of the operation |
void requestIntraRoomConnection(String userId, int timeout, boolean openCamera, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | User ID. If left blank, it represents the anchor's user ID. |
timeout | int | Request timeout duration, unit: seconds. |
openCamera | boolean | Whether to turn on the camera after a successful mic connection. true: video mic connect, false: voice mic connect. |
callback | ActionCallback | Callback of operations. |
void cancelIntraRoomConnection(String userId, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | User ID of the user who cancels the mic connection. If left blank, it represents the anchor's user ID. |
callback | ActionCallback | Callback of the operation |
void respondIntraRoomConnection(String userId, boolean isAccepted, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | Responding user's User ID |
isAccepted | isAccepted | Whether to accept the mic connection request. true: accept the mic connection request, false: reject the mic connection request |
callback | ActionCallback | Callback of the operation |
void disconnectUser(String userId, ActionCallback callback)
Parameter | Type | Meaning |
userId | String | The anchor needs to disconnect the co-anchoring user's ID |
callback | ActionCallback | Callback of the operation |
void terminateIntraRoomConnection()
void requestCrossRoomConnection(String roomId, int timeout, ActionCallback callback)
Parameter | Type | Meaning |
roomId | String | Room ID of the cross-room connection request. |
timeout | int | Request timeout duration, unit: seconds. |
callback | ActionCallback | Callback of operations. |
void cancelCrossRoomConnection(String roomId, ActionCallback callback)
Parameter | Type | Meaning |
roomId | String | Room ID to cancel the connection |
callback | ActionCallback | Callback of the operation |
void respondToCrossRoomConnection(String roomId, boolean isAccepted, ActionCallback callback)
Parameter | Type | Meaning |
roomId | String | Room ID for the response to the connection |
isAccepted | boolean | Whether to agree to the connection, true: agree to the connection, false: reject the connection |
callback | ActionCallback | Callback of the operation |
void terminateCrossRoomConnection()
void registerConnectionObserver(ConnectionObserver observer)
Parameter | Type | Meaning |
observer | Callback object for connection events |
void unregisterConnectionObserver(ConnectionObserver observer)
Parameter | Type | Meaning |
observer | Callback object for connection events |
void setLayoutMode(LayoutMode layoutModel, String layoutJson)
Parameter | Type | Meaning |
layoutModel | Layout mode during connection, supporting grid layout, floating window layout, and custom layout. | |
layoutJson | String | Layout JSON string |
void setVideoViewAdapter(LiveCoreViewDefine.VideoViewAdapter viewAdapter)
Parameter | Type | Meaning |
viewAdapter | View adapter for adding widgets to the broadcaster's video screen |
Type | Description |
Set callback events for core control connections. | |
Layout mode during connection, supporting grid layout, floating window layout, and custom layout. | |
Connection view adapter interface, which allows you to add widgets to each audio and video stream view by implementing this interface. |
Type | Description |
Callback for changes in the list of connected users. | |
Callback for receiving a connection request. | |
Callback for receiving a request to cancel the connection. | |
Callback for connection request approval. | |
Callback for connection request rejection. | |
Callback for connection request timeout. | |
Callback for the host disconnecting the mic connection with this viewer. | |
Callback for the viewer actively disconnecting. | |
Callback for changes in the cross-room connection room list. | |
Callback for receiving a cross-room connection request. | |
Callback for receiving a request to cancel the cross-room connection. | |
Received callback for consent to cross-room connection | |
Received callback for cross-room connection rejection | |
Received callback for cross-room connection timeout. | |
Received callback for cross-room disconnection. | |
Received callback for room termination. |
Type | Description |
GRID_LAYOUT | Grid Layout. |
FLOAT_LAYOUT | Floating Window Layout. |
FREE_LAYOUT | Custom Layout. |
API | Description |
Callback when creating a connected audience view. The View created through this API will be displayed on the connected audience's view. | |
Callback when updating the connected audience view. | |
Callback when creating a connected host view, the View created through this API will be displayed on the connected host's view. | |
Callback when updating the connected host view. |
void onConnectedUsersUpdated(List<UserInfo> userList, List<UserInfo> joinList, List<UserInfo> leaveList);
Parameter | Type | Description |
userList | List<UserInfo> | List of connected users |
joinList | List<UserInfo> | Newly connected users |
leaveList | List<UserInfo> | Users who have left the connection |
void onUserConnectionRequest(UserInfo inviterUser);
Parameter | Type | Description |
inviterUser | UserInfo | Information of the user applying for connection |
void onUserConnectionCancelled(UserInfo inviterUser);
Parameter | Type | Description |
inviterUser | UserInfo | Information of the user canceling the connection |
void onUserConnectionAccepted(UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Information of users who agreed to the mic connection |
void onUserConnectionRejected(UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Information of users who rejected the mic connection |
void onUserConnectionTimeout(UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Information of users whose mic connection request timed out |
vvoid onUserConnectionTerminated();
void onUserConnectionExited(UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | User information |
void onConnectedRoomsUpdated(List<RoomInfo> roomList);
Parameter | Type | Description |
roomList | List<RoomInfo> | Room list |
void onCrossRoomConnectionRequest(RoomInfo roomInfo);
Parameter | Type | Description |
roomInfo | RoomInfo | Information of the live room applying for connection |
void onCrossRoomConnectionCancelled(RoomInfo roomInfo);
Parameter | Type | Description |
roomInfo | RoomInfo | Information of the live room cancelling the connection application |
void onCrossRoomConnectionAccepted(RoomInfo roomInfo);
Parameter | Type | Description |
roomInfo | RoomInfo | Information of the live room agreeing to the connection |
void onCrossRoomConnectionRejected(RoomInfo roomInfo);
Parameter | Type | Description |
roomInfo | RoomInfo | Information of the live room rejecting the connection |
void onCrossRoomConnectionTimeout(RoomInfo inviter, RoomInfo invitee);
Parameter | Type | Description |
inviter | RoomInfo | Information of the live room applying for connection |
invitee | RoomInfo | Information of the live room invited for connection |
void onCrossRoomConnectionExited(RoomInfo roomInfo);
Parameter | Type | Description |
roomInfo | RoomInfo | Information of the live room exiting the connection |
void onRoomDismissed(String roomId);
Parameter | Type | Description |
roomId | String | Room ID |
View createCoGuestView(TUIRoomDefine.UserInfo userInfo);
Parameter | Type | Description |
userInfo | UserInfo | Information of the user connected to the mic |
void updateCoGuestView(TUIRoomDefine.UserInfo userInfo, View coGuestView);
Parameter | Type | Description |
userInfo | UserInfo | Information of the user connected to the mic |
coGuestView | View |
View createCoHostView(TUILiveConnectionManager.ConnectionUser connectionUser);
Parameter | Type | Description |
connectionUser | ConnectionUser | Information of the connected host |
void updateCoHostView(TUILiveConnectionManager.ConnectionUser connectionUser, View coHostView);
Parameter | Type | Description |
connectionUser | ConnectionUser | Information of the connected host |
coHostView | View |
Was this page helpful?