单人连麦 | 多人连麦 |
![]() | ![]() |
点击连麦请求按钮 | 选择连麦方式 | 发送连麦请求,等待主播同意 | 主播同意后,连麦成功 |
![]() | ![]() | ![]() | ![]() |
收到观众的连麦请求 | 点击连麦用户,打开连麦面板 | 点击同意后,连麦成功 |
![]() | ![]() | ![]() |
// 文件位置:Flutter/lib/widget/live_room/anchor/live_streaming/link/link // 主播连麦相关视图目录├── anchor_link_mic_manage_panel_widget.dart // 连麦管理面板:可接受观众连麦、拒绝观众连麦、挂断连麦└── apply_link_mic_float_widget.dart // 有观众申请连麦时,悬浮在顶层的提示连麦的视图
// 文件位置:Flutter/lib/widget/live_room/audience/component/live_streaming/link/
link // 观众连麦相关的视图目录├── select_link_mic_type_panel_widget.dart // 观众连麦弹出的选择语音连麦还是视频连麦的视图└── video_link_settings_panel_widget.dart // 视频连麦时相关参数设置面板视图
createEngine()
获取到 TUIRoomEngine 对象,进而调用连麦相关 API 函数,实现观众连麦功能。以观众 B 申请和主播 A 连麦为例,具体交互时序可参考下图。// 文件位置:Flutter/lib/service/impl/room_engine_service.dart@overrideTUIRequest takeSeat(int seatIndex, int timeout, TUIRequestCallback? requestCallback) {return roomEngine.takeSeat(seatIndex, timeout, requestCallback);}
// 文件位置:Flutter/lib/manager/observer/live_observer.dartsuper.onRequestReceived = (request) {LiveKitLogger.info("$tag onRequestReceived:[request:$request");liveController.seatController.onRequestReceived(request);};
// 文件位置:Flutter/lib/service/impl/room_engine_service.dartmTUIRoomEngine.cancelRequest(requestId, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// 文件位置:Flutter/lib/manager/observer/live_observer.dartsuper.onRequestCancelled = (requestId, userId) {LiveKitLogger.info("$tag onRequestCancelled:[requestId:$requestId,userId:$userId");liveController.seatController.onRequestCancelled(requestId, userId);};
// 文件位置:Flutter/lib/service/impl/room_engine_service.dartmTUIRoomEngine.responseRemoteRequest(requestId, true, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// 文件位置:Flutter/lib/service/impl/room_engine_service.dartmLiveService.kickUserOffSeatByAdmin(0, userId, new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
// 文件位置:Flutter/lib/service/impl/room_engine_service.dartmLiveService.leaveSeat(new TUIRoomDefine.ActionCallback() { @Override public void onSuccess() {} @Override public void onError(TUICommonDefine.Error error, String message) {} });
本页内容是否解决了您的问题?