Skip to content

Commit

Permalink
Fixed active Speaker bug while screenshare
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Dec 11, 2023
1 parent d54c8b0 commit f9072e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ class MeetingStore extends ChangeNotifier
for (var speaker in updateSpeakers) {
int index = peerTracks.indexWhere((previousSpeaker) =>
previousSpeaker.uid == "${speaker.peer.peerId}mainVideo");
if (index > (peersInActiveSpeakerLayout - 1)) {
if (index > ((peersInActiveSpeakerLayout + screenShareCount) - 1)) {
PeerTrackNode activeSpeaker = peerTracks[index];
peerTracks.removeAt(index);
peerTracks.insert(screenShareCount, activeSpeaker);
Expand Down

0 comments on commit f9072e5

Please sign in to comment.