申请/禁止发言与打开/关闭麦克风逻辑优化
|
After Width: | Height: | Size: 617 B |
|
After Width: | Height: | Size: 613 B |
|
After Width: | Height: | Size: 571 B |
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 896 B |
|
After Width: | Height: | Size: 951 B |
|
After Width: | Height: | Size: 907 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 367 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 448 B |
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class MeetingMainState {
|
|||
|
||||
/// 是否被允许发言
|
||||
late RxBool isSpeak = false.obs;
|
||||
/// 是否打开麦克风
|
||||
late RxBool isOpenMicrophone = false.obs;
|
||||
|
||||
/// 聊天数据
|
||||
late RxList<MeetingRoomMsg> meetingRoomMsgs = RxList([]);
|
||||
|
|
|
|||
|
|
@ -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: () {},
|
||||
)*/
|
||||
],
|
||||
),
|
||||
)
|
||||
|
|
|
|||