fix(av-moderation) Only stop screensharing on Stop everyone's video

This commit is contained in:
robertpin 2021-09-24 10:53:41 +03:00 committed by Дамян Минков
parent 2f8cfb3ae2
commit e9f3625ffa
1 changed files with 4 additions and 3 deletions

View File

@ -35,9 +35,10 @@ const logger = getLogger(__filename);
*
* @param {boolean} enable - Whether to mute or unmute.
* @param {MEDIA_TYPE} mediaType - The type of the media channel to mute.
* @param {boolean} stopScreenSharing - Whether or not to stop the screensharing.
* @returns {Function}
*/
export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE) {
export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE, stopScreenSharing: boolean = false) {
return (dispatch: Dispatch<any>, getState: Function) => {
const isAudio = mediaType === MEDIA_TYPE.AUDIO;
@ -56,7 +57,7 @@ export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE) {
return;
}
if (enable) {
if (enable && stopScreenSharing) {
dispatch(toggleScreensharing(false, false, true));
}
@ -102,7 +103,7 @@ export function muteAllParticipants(exclude: Array<string>, mediaType: MEDIA_TYP
const localId = getLocalParticipant(state).id;
if (!exclude.includes(localId)) {
dispatch(muteLocal(true, mediaType));
dispatch(muteLocal(true, mediaType, true));
}
getRemoteParticipants(state).forEach((p, id) => {