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
@@ -2110,13 +2113,14 @@ export default class CallCard extends React.Component {
2110
2113
</ div >
2111
2114
< div >
2112
2115
{ this . state . allRemoteParticipantStreams . map ( ( streamTuple ) => (
2116
+ streamTuple . participant . state === 'Connected' &&
2113
2117
< div key = { utils . getIdentifierText ( streamTuple . participant . identifier ) } >
2114
- < input
2115
- type = "checkbox"
2116
- checked = { streamTuple . isPinned }
2117
- onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2118
- />
2119
- { utils . getIdentifierText ( streamTuple . participant . identifier ) }
2118
+ < input
2119
+ type = "checkbox"
2120
+ checked = { streamTuple . isPinned }
2121
+ onChange = { ( e ) => this . handleVideoPin ( streamTuple , e ) }
2122
+ />
2123
+ { utils . getIdentifierText ( streamTuple . participant . identifier ) }
2120
2124
</ div >
2121
2125
) ) }
2122
2126
</ div >
You can’t perform that action at this time.
0 commit comments