File tree Expand file tree Collapse file tree 4 files changed +6
-20
lines changed
packages/stream_video_flutter/lib/src Expand file tree Collapse file tree 4 files changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -132,18 +132,8 @@ class _StreamCallParticipantsState extends State<StreamCallParticipants> {
132132 final screenShareTrack = it.screenShareTrack;
133133 final isScreenShareEnabled = it.isScreenShareEnabled;
134134
135- // If the screen share track is local, we don't have to subscribe to
136- // anything and we can directly use the mute state.
137- if (screenShareTrack is ! RemoteTrackState ) return isScreenShareEnabled;
138-
139- // If the screen share track is remote and already subscribed and
140- // received, we can directly use the mute state.
141- if (screenShareTrack.subscribed && screenShareTrack.received) {
142- return isScreenShareEnabled;
143- }
144-
145- // If it's not yet subscribed, we have to show it in order for it to
146- // start the subscription process.
135+ if (screenShareTrack == null || ! isScreenShareEnabled) return false ;
136+
147137 return true ;
148138 },
149139 );
Original file line number Diff line number Diff line change @@ -43,9 +43,7 @@ class RegularCallParticipantsContent extends StatelessWidget {
4343 CallParticipantState participant,
4444 ) {
4545 return StreamCallParticipant (
46- // We use the sessionId as the key to avoid rebuilding the widget
47- // when the participant changes.
48- key: ValueKey (participant.sessionId),
46+ key: ValueKey (participant.userId),
4947 call: call,
5048 participant: participant,
5149 );
Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ class ScreenShareCallParticipantsContent extends StatelessWidget {
3838 CallParticipantState participant,
3939 ) {
4040 return StreamCallParticipant (
41- // We use the sessionId as the key to avoid rebuilding the widget
42- // when the participant changes.
43- key: ValueKey (participant.sessionId),
41+ key: ValueKey (participant.userId),
4442 call: call,
4543 participant: participant,
4644 );
@@ -67,7 +65,7 @@ class ScreenShareCallParticipantsContent extends StatelessWidget {
6765 return Stack (
6866 children: [
6967 ScreenShareContent (
70- key: ValueKey ('${participant .sessionId } - screenShareContent' ),
68+ key: ValueKey ('${participant .userId } - screenShareContent' ),
7169 call: call,
7270 participant: participant,
7371 ),
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ class StreamVideoRenderer extends StatelessWidget {
5858 }
5959
6060 return VisibilityDetector (
61- key: Key ('${participant .sessionId }${trackState ?.muted }' ),
61+ key: Key ('${participant .userId }${ participant . sessionId }$ videoTrackType ${trackState ?.muted }' ),
6262 onVisibilityChanged: _onVisibilityChanged,
6363 child: child,
6464 );
You can’t perform that action at this time.
0 commit comments