申请/禁止发言与打开/关闭麦克风逻辑优化

This commit is contained in:
fuenmao 2024-11-28 15:04:20 +08:00
parent 92db340c86
commit 423ad947c2
15 changed files with 66 additions and 44 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 896 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 907 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

View File

@ -139,6 +139,18 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
BaseStructureResult res = await getClient().cancelSpeak(state.meetingRoomInfo.value!.id, state.meetingRoomInfo.value!.roomNum, UserStore.to.userInfoEntity.value!.uid);
}
///
void setMicrophoneOpen(bool isOpen){
state.isOpenMicrophone.value = isOpen;
for(var i = 0; i < state.cacheUsers.value.length; i++){
if(state.cacheUsers.value[i].uid == UserStore.to.userInfoEntity.value!.uid){
state.cacheUsers.value[i].enableMicr = isOpen;
}
}
state.users.value = state.cacheUsers.value;
setEnableLocalAudio(isOpen);
}
/// --------------------------signalR Socket相关
/// Socket长连接
Future<void> signalRSocket() async {
@ -194,6 +206,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
}
if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = true;
state.isOpenMicrophone.value = true;
setEnableLocalAudio(true);
}
}else{
@ -207,6 +220,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
}
if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = false;
state.isOpenMicrophone.value = false;
setEnableLocalAudio(false);
}
}
@ -285,7 +299,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
));
//
state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(true);
state.rctEngine.value?.setDefaultAudioRouteToSpeakerphone(false);
joinMeetingToRtc();

View File

@ -53,6 +53,8 @@ class MeetingMainState {
///
late RxBool isSpeak = false.obs;
///
late RxBool isOpenMicrophone = false.obs;
///
late RxList<MeetingRoomMsg> meetingRoomMsgs = RxList([]);

View File

@ -60,7 +60,7 @@ class MeetingMainPage extends StatelessWidget {
SizedBox(width: 16.w),
GestureDetector(
child: Image.asset(
state.communicationMode.value == 1 ? 'assets/images/index_copy.png' : state.communicationMode.value == 3 ? 'assets/images/meeting_main_camera_open.png' : 'assets/images/meeting_main_audio.png',
state.communicationMode.value == 1 ? 'assets/images/meeting_main_receiver.png' : 'assets/images/meeting_main_speaker.png',
width: 20.w,
height: 20.h,
),
@ -118,16 +118,33 @@ class MeetingMainPage extends StatelessWidget {
logic.changeMeetingInfoState(true);
},
),
GestureDetector(
child: Container(
Container(
width: 92.w,
alignment: Alignment.centerRight,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
///
Visibility(
visible: state.isSpeak.value,
child: GestureDetector(
child: Image.asset(
'assets/images/meeting_main_hang_up.png',
width: 22.w,
height: 22.h,
),
onTap: () {
logic.doHttpCancelSpeak();
},
),
),
SizedBox(width: 16.w),
/// 退
GestureDetector(
child: Image.asset(
'assets/images/meeting_leave.png',
width: 20.w,
height: 20.h,
),
),
onTap: () {
Get.bottomSheet(
isScrollControlled: true,
@ -137,6 +154,9 @@ class MeetingMainPage extends StatelessWidget {
)
],
),
)
],
),
),
///
@ -228,16 +248,20 @@ class MeetingMainPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
state.isSpeak.value == true ? 'assets/images/meeting_main_microphone_mute.png' : 'assets/images/meeting_main_microphone_default.png',
state.isSpeak.value == false
? 'assets/images/meeting_main_sqfy.png'
: state.isOpenMicrophone.value == true
? 'assets/images/meeting_main_microphone_default.png'
: 'assets/images/meeting_main_sqfy.png',
width: 22.w,
height: 22.h,
),
SizedBox(height: 4.h),
Text(
' 静音 ',
state.isSpeak.value == false ? '申请发言' : state.isOpenMicrophone.value == true ? "手动静音" : "解除静音",
style: TextStyle(
fontSize: 12.sp,
color: state.isSpeak.value == true ? ColorUtil.Color_85_117_242 : ColorUtil.Color_202_202_202),
color: ColorUtil.Color_202_202_202),
)
],
),
@ -249,7 +273,11 @@ class MeetingMainPage extends StatelessWidget {
context)
);
}else{
logic.doHttpCancelSpeak();
if(state.isOpenMicrophone.value == false){
logic.setMicrophoneOpen(true);
}else{
logic.setMicrophoneOpen(false);
}
}
},
),
@ -260,7 +288,7 @@ class MeetingMainPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/meeting_main_camera_default.png',
'assets/images/meeting_main_sp.png',
width: 22.w,
height: 22.h,
),
@ -328,28 +356,6 @@ class MeetingMainPage extends StatelessWidget {
);
},
),
///
/*GestureDetector(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/meeting_main_more_default.png',
width: 22.w,
height: 22.h,
),
SizedBox(height: 4.h),
Text(
' 更多 ',
style: TextStyle(
fontSize: 12.sp,
color: ColorUtil.Color_202_202_202),
)
],
),
onTap: () {},
)*/
],
),
)