麦克风逻辑重新梳理
This commit is contained in:
parent
ed9e68e73a
commit
3b1fbc837c
|
|
@ -95,7 +95,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
void getMeetingRoomAllUser(List<MeetingRoomUser> meetingRoomUsers) async {
|
||||
state.users.value = meetingRoomUsers;
|
||||
state.cacheUsers.value = meetingRoomUsers;
|
||||
doHttpGetTvAnchor();
|
||||
// doHttpGetTvAnchor();
|
||||
}
|
||||
|
||||
/// 启动计时
|
||||
|
|
@ -153,20 +153,8 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
|
||||
/// ------------------------------------------------------------------------------麦克风相关(操作)
|
||||
/// 用户开闭麦
|
||||
Future<void> doHttpSetMicr() async {
|
||||
await getClient().setMicr(state.roomNumber.value, state.isOpenMicrophone.value, UserStore.to.userInfoEntity.value!.uid);
|
||||
}
|
||||
|
||||
/// 设置麦克风是否开启
|
||||
Future<void> setMicrophoneOpen(bool isOpen) async{
|
||||
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;
|
||||
doHttpSetMicr();
|
||||
Future<void> doHttpSetMicr(bool isOpenMicrophone) async {
|
||||
await getClient().setMicr(state.roomNumber.value, isOpenMicrophone, UserStore.to.userInfoEntity.value!.uid);
|
||||
}
|
||||
|
||||
/// ------------------------------------------------------------------------------视频-屏幕相关(操作)
|
||||
|
|
@ -301,9 +289,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
debugPrint("wgs输出===:Socket-关闭发言权限:观众");
|
||||
}
|
||||
}
|
||||
doHttpSetMicr();
|
||||
doHttpSetCamer();
|
||||
update();
|
||||
});
|
||||
|
||||
/// ------------------------------------------------------------------------------麦克风相关回调
|
||||
|
|
@ -319,7 +304,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
}
|
||||
state.users.value = state.cacheUsers.value;
|
||||
state.isOpenMicrophone.value = e?[0];
|
||||
doHttpSetMicr();
|
||||
});
|
||||
|
||||
/// 用户单独开闭麦回调
|
||||
|
|
@ -329,7 +313,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
var listDynamic = jsonDecode(jsonStr);
|
||||
MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic);
|
||||
if(meetingRoomUser.enableMicr == true){
|
||||
debugPrint("wgs输出===:Socket-用户单独开麦");
|
||||
debugPrint("wgs输出===:Socket-用户单独开麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
|
||||
for(MeetingRoomUser mru in state.cacheUsers.value){
|
||||
if(mru.uid == meetingRoomUser.uid){
|
||||
mru.enableMicr = true;
|
||||
|
|
@ -342,7 +326,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
|
|||
muteLocalAudioStream(false);
|
||||
}
|
||||
}else{
|
||||
debugPrint("wgs输出===:Socket-用户单独闭麦");
|
||||
debugPrint("wgs输出===:Socket-用户单独闭麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
|
||||
for(MeetingRoomUser mru in state.cacheUsers.value){
|
||||
if(mru.uid == meetingRoomUser.uid){
|
||||
mru.enableMicr = false;
|
||||
|
|
|
|||
|
|
@ -448,9 +448,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
|
|||
applySpeakPermissionBottomSheet(context));
|
||||
} else {
|
||||
if (state.isOpenMicrophone.value == false) {
|
||||
logic.setMicrophoneOpen(true);
|
||||
logic.doHttpSetMicr(true);
|
||||
} else {
|
||||
logic.setMicrophoneOpen(false);
|
||||
logic.doHttpSetMicr(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue