File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -1390,11 +1390,14 @@ export default class CallCard extends React.Component {
1390
1390
}
1391
1391
1392
1392
handleVideoPin = ( streamTuple , e ) => {
1393
- // e.preventDefault();
1394
1393
const checked = e . target . checked ;
1395
1394
const allRemoteParticipantStreams = this . state . allRemoteParticipantStreams ;
1396
1395
// If there is already 2 streams pinned and the user is trying to pin another stream, return
1397
1396
if ( allRemoteParticipantStreams . filter ( streamTuple => streamTuple . isPinned ) . length >= 2 && checked ) {
1397
+ allRemoteParticipantStreams . find ( v => v === streamTuple ) . isPinned = false ;
1398
+ this . setState ( {
1399
+ allRemoteParticipantStreams : allRemoteParticipantStreams ,
1400
+ } ) ;
1398
1401
return ;
1399
1402
}
1400
1403
@@ -2121,13 +2124,14 @@ export default class CallCard extends React.Component {
2121
2124
</ div >
2122
2125
< div >
2123
2126
{ this . state . allRemoteParticipantStreams . map ( ( streamTuple ) => (
2127
+ streamTuple . participant . state === 'Connected' &&
2124
2128
< div key = { utils . getIdentifierText ( streamTuple . participant . identifier ) } >
2125
- < input
2126
- type = "checkbox"
2127
- checked = { streamTuple . isPinned }
2128
- onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2129
- />
2130
- { utils . getIdentifierText ( streamTuple . participant . identifier ) }
2129
+ < input
2130
+ type = "checkbox"
2131
+ checked = { streamTuple . isPinned }
2132
+ onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2133
+ />
2134
+ { utils . getIdentifierText ( streamTuple . participant . identifier ) }
2131
2135
</ div >
2132
2136
) ) }
2133
2137
</ div >
You can’t perform that action at this time.
0 commit comments