Compare commits

..

No commits in common. "8d4979b4840d7c5f9f3129501cfb51a52bc54cbd" and "ed9e68e73a0a18ee699377aeb6916bb8099134f4" have entirely different histories.

2 changed files with 47 additions and 34 deletions

View File

@ -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();
}
///
@ -144,23 +144,49 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
///
Future<void> doHttpCancelSpeak() async {
await getClient().cancelSpeak(state.meetingRoomInfo.value!.id, state.meetingRoomInfo.value!.roomNum, UserStore.to.userInfoEntity.value!.uid);
/*setClientRole("观众");
setMicrophoneOpen(false);
setCameraOpen(false);
setScreenShareOpen(false);
changePageState(0);*/
}
/// ------------------------------------------------------------------------------
///
Future<void> doHttpSetMicr(bool isOpenMicrophone) async {
await getClient().setMicr(state.roomNumber.value, isOpenMicrophone, UserStore.to.userInfoEntity.value!.uid);
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> doHttpSetCamer(bool isOpenCamera) async {
await getClient().setCamera(state.roomNumber.value, isOpenCamera, UserStore.to.userInfoEntity.value!.uid);
Future<void> doHttpSetCamer() async {
await getClient().setCamera(state.roomNumber.value, state.isOpenCamera.value, UserStore.to.userInfoEntity.value!.uid);
}
///
void setCameraOpen(bool isOpen){
state.isOpenCamera.value = isOpen;
doHttpSetCamer();
}
///
void hangUpVideo(){
stopPreview();
state.isOpenCamera.value = false;
changePageState(0);
doHttpSetCamer();
}
///
@ -254,7 +280,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
if(UserStore.to.userInfoEntity.value!.uid == meetingRoomUser.uid){
state.isSpeak.value = true;
state.isOpenMicrophone.value = true;
// SDK角色为主播
setClientRole("主播");
debugPrint("wgs输出===Socket-开启发言权限:主播");
}
@ -271,22 +296,14 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
state.isSpeak.value = false;
state.isOpenMicrophone.value = false;
state.isOpenCamera.value = false;
// SDK角色为观众
setClientRole("观众");
//
muteLocalVideoStream(true);
//
stopPreview();
//
state.floating.value?.close();
changePageState(0);
state.isSelf.value = false;
state.remoteUid.value = "";
debugPrint("wgs输出===Socket-关闭发言权限:观众");
}
}
doHttpSetMicr();
doHttpSetCamer();
update();
});
/// ------------------------------------------------------------------------------
@ -302,6 +319,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
}
state.users.value = state.cacheUsers.value;
state.isOpenMicrophone.value = e?[0];
doHttpSetMicr();
});
///
@ -311,7 +329,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
var listDynamic = jsonDecode(jsonStr);
MeetingRoomUser meetingRoomUser = MeetingRoomUser.fromJson(listDynamic);
if(meetingRoomUser.enableMicr == true){
debugPrint("wgs输出===Socket-用户单独开麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
debugPrint("wgs输出===Socket-用户单独开麦");
for(MeetingRoomUser mru in state.cacheUsers.value){
if(mru.uid == meetingRoomUser.uid){
mru.enableMicr = true;
@ -324,7 +342,7 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
muteLocalAudioStream(false);
}
}else{
debugPrint("wgs输出===Socket-用户单独闭麦${meetingRoomUser.uid}-${meetingRoomUser.userName}");
debugPrint("wgs输出===Socket-用户单独闭麦");
for(MeetingRoomUser mru in state.cacheUsers.value){
if(mru.uid == meetingRoomUser.uid){
mru.enableMicr = false;
@ -360,7 +378,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
for(var j = 0; j < state.cacheUsers.value.length; j++){
if(state.cacheUsers.value[j].uid == uidStr){
state.cacheUsers.value.removeAt(j);
doHttpGetTvAnchor();
}
}
}
@ -436,12 +453,6 @@ class MeetingMainLogic extends GetxController with RequestToolMixin{
if(meetingRoomUser.uid == UserStore.to.userInfoEntity.value!.uid){
state.isOpenCamera.value = false;
//
if(state.isSelf.value == true){
changePageState(0);
state.isSelf.value = false;
}
//
muteLocalVideoStream(true);
//

View File

@ -448,9 +448,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
applySpeakPermissionBottomSheet(context));
} else {
if (state.isOpenMicrophone.value == false) {
logic.doHttpSetMicr(true);
logic.setMicrophoneOpen(true);
} else {
logic.doHttpSetMicr(false);
logic.setMicrophoneOpen(false);
}
}
},
@ -484,9 +484,9 @@ class MeetingMainPageState extends State<MeetingMainPage> {
onTap: () {
if (state.isSpeak.value == true) {
if (state.isOpenCamera.value == true) {
logic.doHttpSetCamer(false);
logic.setCameraOpen(false);
} else {
logic.doHttpSetCamer(true);
logic.setCameraOpen(true);
}
}
},
@ -1530,7 +1530,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
),
)
: const CircularProgressIndicator(),
/*Positioned(
Positioned(
bottom: 110,
child: GestureDetector(
child: Image.asset(
@ -1539,9 +1539,10 @@ class MeetingMainPageState extends State<MeetingMainPage> {
height: 50.h,
),
onTap: () {
},
),
),*/
),
Positioned(
top: 16,
right: 16,
@ -1709,7 +1710,7 @@ class MeetingMainPageState extends State<MeetingMainPage> {
canvas: const VideoCanvas(uid: 0, setupMode: VideoViewSetupMode.videoViewSetupAdd),
),
),
/*Positioned(
Positioned(
bottom: 110,
child: GestureDetector(
child: Image.asset(
@ -1718,9 +1719,10 @@ class MeetingMainPageState extends State<MeetingMainPage> {
height: 50.h,
),
onTap: () {
},
),
),*/
),
Positioned(
top: 16,
right: 16,