Skip to content

Commit

Permalink
Fixed active Speaker bug while screenshare (#1659)
Browse files Browse the repository at this point in the history
Co-authored-by: ygit <[email protected]>
  • Loading branch information
Decoder07 and ygit authored Dec 11, 2023
1 parent 68ed1ba commit ace5a7c
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 ace5a7c

Please sign in to comment.