Skip to content

Commit

Permalink
Fixed screenshare bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Mar 18, 2024
1 parent 18e5d7b commit f699f38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
39 changes: 15 additions & 24 deletions packages/hms_room_kit/lib/src/meeting/meeting_grid_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,28 @@ class MeetingGridComponent extends StatelessWidget {
Widget build(BuildContext context) {
return Selector<
MeetingStore,
Tuple7<List<PeerTrackNode>, bool, int, int, MeetingMode,
PeerTrackNode?, int>>(
selector: (_, meetingStore) => Tuple7(
Tuple6<List<PeerTrackNode>, bool, int, int, MeetingMode,
int>>(
selector: (_, meetingStore) => Tuple6(
meetingStore.peerTracks,
meetingStore.isHLSLink,
meetingStore.peerTracks.length,
meetingStore.screenShareCount,
meetingStore.meetingMode,
meetingStore.peerTracks.isNotEmpty
? meetingStore.peerTracks[meetingStore.screenShareCount]
: null,
meetingStore.viewControllers.length),
builder: (_, data, __) {
if (data.item3 == 0 || data.item7 == 0) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(
strokeWidth: 2,
color: HMSThemeColors.primaryDefault,
),
const SizedBox(
height: 10,
),
if (context.read<MeetingStore>().peers.isNotEmpty)
HMSTitleText(
text: "Please wait for broadcaster to join",
textColor: HMSThemeColors.onSurfaceHighEmphasis)
],
));

///If there are no peerTracks or the view controllers are empty we show an empty tapable container
if (data.item3 == 0 || data.item6 == 0) {
return GestureDetector(
onTap: () => visibilityController?.toggleControlsVisibility(),
child:
Container(
color: Colors.transparent,
height: double.infinity,
width: double.infinity,
)
);
}
return Selector<MeetingStore, Tuple2<MeetingMode, HMSPeer?>>(
selector: (_, meetingStore) =>
Expand Down
4 changes: 2 additions & 2 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ class MeetingStore extends ChangeNotifier
if (each.isLocal) {
int index = peerTracks
.indexWhere((element) => element.uid == "${each.peerId}mainVideo");
if (index == -1 &&
(each.audioTrack != null || each.videoTrack != null)) {
if (index == -1) {
///We add tile for local peer irrespective of whether it can publish or not
peerTracks.add(PeerTrackNode(
peer: each,
uid: "${each.peerId}mainVideo",
Expand Down

0 comments on commit f699f38

Please sign in to comment.