fix(screenshare) disable sound when presenter stops sharing

This commit is contained in:
William Liang 2022-06-27 13:17:25 -04:00 committed by Jaya Allamsetty
parent 77da65b8ea
commit 131eed0f62
2 changed files with 6 additions and 4 deletions

View File

@ -378,6 +378,7 @@ export function hiddenParticipantLeft(id) {
* participant is allowed to not specify an associated {@code JitsiConference} * participant is allowed to not specify an associated {@code JitsiConference}
* instance. * instance.
* @param {boolean} isReplaced - Whether the participant is to be replaced in the meeting. * @param {boolean} isReplaced - Whether the participant is to be replaced in the meeting.
* @param {boolean} isVirtualScreenshareParticipant - Whether the participant is a virtual screen share participant.
* @returns {{ * @returns {{
* type: PARTICIPANT_LEFT, * type: PARTICIPANT_LEFT,
* participant: { * participant: {
@ -386,13 +387,14 @@ export function hiddenParticipantLeft(id) {
* } * }
* }} * }}
*/ */
export function participantLeft(id, conference, isReplaced) { export function participantLeft(id, conference, isReplaced, isVirtualScreenshareParticipant) {
return { return {
type: PARTICIPANT_LEFT, type: PARTICIPANT_LEFT,
participant: { participant: {
conference, conference,
id, id,
isReplaced isReplaced,
isVirtualScreenshareParticipant
} }
}; };
} }

View File

@ -52,14 +52,14 @@ function _updateScreenshareParticipants({ getState, dispatch }) {
} }
if (localScreenShare && !newLocalSceenshareSourceName) { if (localScreenShare && !newLocalSceenshareSourceName) {
dispatch(participantLeft(localScreenShare.id, conference)); dispatch(participantLeft(localScreenShare.id, conference, undefined, true));
} }
const removedScreenshareSourceNames = _.difference(previousScreenshareSourceNames, currentScreenshareSourceNames); const removedScreenshareSourceNames = _.difference(previousScreenshareSourceNames, currentScreenshareSourceNames);
const addedScreenshareSourceNames = _.difference(currentScreenshareSourceNames, previousScreenshareSourceNames); const addedScreenshareSourceNames = _.difference(currentScreenshareSourceNames, previousScreenshareSourceNames);
if (removedScreenshareSourceNames.length) { if (removedScreenshareSourceNames.length) {
removedScreenshareSourceNames.forEach(id => dispatch(participantLeft(id, conference))); removedScreenshareSourceNames.forEach(id => dispatch(participantLeft(id, conference, undefined, true)));
} }
if (addedScreenshareSourceNames.length) { if (addedScreenshareSourceNames.length) {