优化进入房间http socket 声网调用顺序逻辑

This commit is contained in:
fuenmao 2024-12-26 16:52:17 +08:00
parent 0cf4b4761e
commit 9e95286855
1 changed files with 8 additions and 4 deletions

View File

@ -55,6 +55,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
if (isInit == true) { if (isInit == true) {
signalRSocket(); signalRSocket();
}else{
initRtc();
} }
} }
@ -97,6 +99,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ///
void getMeetingRoomInfo(MeetingRoomInfo meetingRoomInfo) async { void getMeetingRoomInfo(MeetingRoomInfo meetingRoomInfo) async {
state.meetingRoomInfo.value = meetingRoomInfo; state.meetingRoomInfo.value = meetingRoomInfo;
initRtc();
startTime(); startTime();
} }
@ -637,11 +640,13 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
Future<void> joinMeetingToSocket(bool isAgain) async { Future<void> joinMeetingToSocket(bool isAgain) async {
await state.hubConnection.value?.invoke("joinChannel", await state.hubConnection.value?.invoke("joinChannel",
args: [state.roomNumber.value, false, false, false]); args: [state.roomNumber.value, false, false, false]);
if(isAgain == false){ mergeFetch(isAgain);
/*if(isAgain == false){
mergeFetch(isAgain);
initRtc(false); initRtc(false);
}else{ }else{
mergeFetch(true); mergeFetch(true);
} }*/
} }
/// ///
@ -672,7 +677,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
/// ------------------------------------------------------------------------------SDK相关 /// ------------------------------------------------------------------------------SDK相关
/// SDK /// SDK
Future<void> initRtc(bool isAgain) async { Future<void> initRtc() async {
// //
PermissionService.requestPermissions(); PermissionService.requestPermissions();
@ -706,7 +711,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
// //
onJoinChannelSuccess: (RtcConnection connection, int elapsed) { onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
state.isJoinSuccess.value = true; state.isJoinSuccess.value = true;
mergeFetch(isAgain);
debugPrint("wgs输出===RTC-自己加入会议室ID${connection.localUid}"); debugPrint("wgs输出===RTC-自己加入会议室ID${connection.localUid}");
}, },