diff --git a/Project/src/App.css b/Project/src/App.css index f8d8a6c..f365e89 100644 --- a/Project/src/App.css +++ b/Project/src/App.css @@ -402,11 +402,6 @@ div.ms-Checkbox>input[type="checkbox"]+label.ms-Checkbox-label>span.ms-Checkbox- } } -.stream-container.pinned { - order: 0; - flex: 0 100% !important; -} - .stream-container { order: 1; display: none; @@ -414,6 +409,15 @@ div.ms-Checkbox>input[type="checkbox"]+label.ms-Checkbox-label>span.ms-Checkbox- flex: 0 20%; } +.stream-container.pinned { + order: 0; + flex: 0 100% !important; +} + +.stream-container.pinning-is-active { + flex: 0 25% !important; +} + .stream-container.stream-count-1, .stream-container.stream-count-2, .stream-container.stream-count-3, diff --git a/Project/src/MakeCall/CallCard.js b/Project/src/MakeCall/CallCard.js index 4ac49e0..76e489a 100644 --- a/Project/src/MakeCall/CallCard.js +++ b/Project/src/MakeCall/CallCard.js @@ -129,6 +129,7 @@ export default class CallCard extends React.Component { isAudioPermitted: meetingMediaAccess?.isAudioPermitted, isVideoPermitted: meetingMediaAccess?.isVideoPermitted, }, + isPinningActive: false, showPin2VideosList: false, }; this.selectedRemoteParticipants = new Set(); @@ -1392,9 +1393,10 @@ export default class CallCard extends React.Component { // e.preventDefault(); const checked = e.target.checked; const allRemoteParticipantStreams = this.state.allRemoteParticipantStreams; + // If there is already 2 streams pinned and the user is trying to pin another stream, return if (allRemoteParticipantStreams.filter(streamTuple => streamTuple.isPinned).length >= 2 && checked) { return; - } + } allRemoteParticipantStreams.forEach(v => { if (streamTuple === v) { @@ -1404,7 +1406,10 @@ export default class CallCard extends React.Component { } }); - this.setState({ allRemoteParticipantStreams: allRemoteParticipantStreams }, () => { + this.setState({ + allRemoteParticipantStreams: allRemoteParticipantStreams, + isPinningActive: allRemoteParticipantStreams.some(v => v.isPinned) + }, () => { this.updateListOfParticipantsToRender('Pinned videos changed'); }); } @@ -1521,6 +1526,7 @@ export default class CallCard extends React.Component { key={`${utils.getIdentifierText(v.participant.identifier)}-${v.stream.mediaStreamType}-${v.stream.id}`} ref={v.streamRendererComponentRef} stream={v.stream} + isPinningActive={this.state.isPinningActive} isPinned={v.isPinned} remoteParticipant={v.participant} dominantSpeakerMode={this.state.dominantSpeakerMode} diff --git a/Project/src/MakeCall/FunctionalStreamRenderer.js b/Project/src/MakeCall/FunctionalStreamRenderer.js index 6221763..7476ad9 100644 --- a/Project/src/MakeCall/FunctionalStreamRenderer.js +++ b/Project/src/MakeCall/FunctionalStreamRenderer.js @@ -7,6 +7,7 @@ import VideoReceiveStats from './VideoReceiveStats'; export const FunctionalStreamRenderer = forwardRef(({ remoteParticipant, stream, + isPinningActive, isPinned, dominantRemoteParticipant, dominantSpeakerMode, @@ -144,35 +145,42 @@ export const FunctionalStreamRenderer = forwardRef(({ if (stream.isAvailable) { return ( -