From 9e9528685508ac467ed9fcccb0b649076400b40e Mon Sep 17 00:00:00 2001 From: fuenmao <980740792@qq.com> Date: Thu, 26 Dec 2024 16:52:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=9B=E5=85=A5=E6=88=BF?= =?UTF-8?q?=E9=97=B4http=20socket=20=E5=A3=B0=E7=BD=91=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wgshare/lib/pages/metting/meeting_main_logic.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wgshare/lib/pages/metting/meeting_main_logic.dart b/wgshare/lib/pages/metting/meeting_main_logic.dart index 3eb88b6..b7e5f8e 100644 --- a/wgshare/lib/pages/metting/meeting_main_logic.dart +++ b/wgshare/lib/pages/metting/meeting_main_logic.dart @@ -55,6 +55,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin { if (isInit == true) { signalRSocket(); + }else{ + initRtc(); } } @@ -97,6 +99,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin { /// 获取会议室信息 void getMeetingRoomInfo(MeetingRoomInfo meetingRoomInfo) async { state.meetingRoomInfo.value = meetingRoomInfo; + initRtc(); startTime(); } @@ -637,11 +640,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin { Future joinMeetingToSocket(bool isAgain) async { await state.hubConnection.value?.invoke("joinChannel", args: [state.roomNumber.value, false, false, false]); - if(isAgain == false){ + mergeFetch(isAgain); + /*if(isAgain == false){ + mergeFetch(isAgain); initRtc(false); }else{ mergeFetch(true); - } + }*/ } /// 离开会议室 @@ -672,7 +677,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin { /// ------------------------------------------------------------------------------声网SDK相关 /// 初始化声网SDK - Future initRtc(bool isAgain) async { + Future initRtc() async { // 请求麦克风、摄像头权限 PermissionService.requestPermissions(); @@ -706,7 +711,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin { // 成功加入会议室回调 onJoinChannelSuccess: (RtcConnection connection, int elapsed) { state.isJoinSuccess.value = true; - mergeFetch(isAgain); debugPrint("wgs输出===:RTC-自己加入会议室,ID:${connection.localUid}"); },