From 92fea2d81700a11705d2df9591a21a64c54bc6cc Mon Sep 17 00:00:00 2001 From: nilupul Date: Thu, 14 Mar 2024 16:31:39 +0530 Subject: [PATCH] fixed local user video hide issue when multiple users join on same channel --- lib/controllers/session_controller.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/controllers/session_controller.dart b/lib/controllers/session_controller.dart index cebb3bb..c3e637c 100644 --- a/lib/controllers/session_controller.dart +++ b/lib/controllers/session_controller.dart @@ -235,8 +235,8 @@ class SessionController extends ValueNotifier { clientRoleType: ClientRoleType.clientRoleBroadcaster, ), ); + removeUser(uid: value.localUid); } - removeUser(uid: value.localUid); } void updateUserVideo({required int uid, required bool videoDisabled}) { @@ -263,7 +263,11 @@ class SessionController extends ValueNotifier { value = value.copyWith(isLocalUserMuted: muted); // if remote user updates audio } else if (uid == value.mainAgoraUser.uid) { - value = value.copyWith(mainAgoraUser: AgoraUser(uid: uid, muted: muted)); + value = value.copyWith( + mainAgoraUser: AgoraUser( + uid: uid, + muted: muted, + videoDisabled: value.mainAgoraUser.videoDisabled)); } else { List tempList = value.users; int indexOfUser = tempList.indexWhere((element) => element.uid == uid);