Single-person co-mic | Multi-person co-mic |
| |
Click the co-mic request button | Choose the way to connect the microphone | Send a connection request and wait for the host to agree | After the host agrees, the connection is successful |
| | | |
Received the audience's connection request | Click on the connected mic user to open the connection dashboard | After clicking agree, the connection is successful |
| | |
// File Location:tuilivekit/src/main/java/
com/trtc/uikit/livekit/view/liveroom/view/anchor/livestreaming/link // Host mic connection related view directory├── AnchorApplyLinkMicAdapter.java // Adapter for the list of users applying for mic connection├── AnchorLinkMicAdapter.java // Adapter for the list of users with successful mic connections└── AnchorLinkMicManagePanel.java // Mic connection management panel: can accept audience mic connection, reject audience mic connection, hang up mic connection
// File Location:tuilivekit/src/main/java/
com/trtc/uikit/livekit/view/liveroom/view/audience/livestreaming/
link // Audience mic connection related view directory├── SelectLinkMicTypePanel.java // View for audience to choose between voice or video mic connection├── VideoLinkSettingsPanel.java // Parameter settings panel view for video mic connection└── VideoSettingsAdapter.java // Adapter for video mic connection parameter settings
createEngine()
, and then call the related API functions to implement the audience mic connection feature. As an example, Audience B requests to connect the mic with Anchor A. The specific interaction sequence can be referred to in the diagram below.// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javamTUIRoomEngine.takeSeat(seatIndex, timeout, new TUIRoomDefine.RequestCallback() { @Override public void onAccepted(String requestId, String userId) { // Host agrees to mic request callback } @Override public void onRejected(String requestId, String userId, String message) { // Host rejects mic request callback } @Override public void onCancelled(String requestId, String userId) { // Audience cancels mic request callback } @Override public void onTimeout(String requestId, String userId) { // Audience mic request timeout callback } @Override public void onError(String requestId, String userId, TUICommonDefine.Error error, String message) { // Mic request sends failure callback } });
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/manager/observer/RoomEngineObserver.java@Override public void onRequestReceived(TUIRoomDefine.Request request) { LiveKitLog.info(mTag + " onRequestReceived:[request:" + new Gson().toJson(request) + "]"); mLiveController.getSeatController().onRequestReceived(request); }
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javamTUIRoomEngine.cancelRequest(requestId, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/manager/observer/RoomEngineObserver.javapublic void onRequestCancelled(TUIRoomDefine.Request request, TUIRoomDefine.UserInfo operateUser) { LiveKitLog.info(mTag + " onRequestCancelled:[request:" + request + ",operateUser:" + operateUser + "]"); mLiveController.getSeatController().onRequestCancelled(request, operateUser); }
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javamTUIRoomEngine.responseRemoteRequest(requestId, true, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javamLiveService.kickUserOffSeatByAdmin(0, userId, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// File Location:TUILiveKit/src/Main/java/com/trtc/uikit/livekit/service/impl/LiveServiceImpl.javamLiveService.leaveSeat(new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
Was this page helpful?