fix(av-moderation) Only stop screensharing on Stop everyone's video
This commit is contained in:
parent
2f8cfb3ae2
commit
e9f3625ffa
|
@ -35,9 +35,10 @@ const logger = getLogger(__filename);
|
||||||
*
|
*
|
||||||
* @param {boolean} enable - Whether to mute or unmute.
|
* @param {boolean} enable - Whether to mute or unmute.
|
||||||
* @param {MEDIA_TYPE} mediaType - The type of the media channel to mute.
|
* @param {MEDIA_TYPE} mediaType - The type of the media channel to mute.
|
||||||
|
* @param {boolean} stopScreenSharing - Whether or not to stop the screensharing.
|
||||||
* @returns {Function}
|
* @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) => {
|
return (dispatch: Dispatch<any>, getState: Function) => {
|
||||||
const isAudio = mediaType === MEDIA_TYPE.AUDIO;
|
const isAudio = mediaType === MEDIA_TYPE.AUDIO;
|
||||||
|
|
||||||
|
@ -56,7 +57,7 @@ export function muteLocal(enable: boolean, mediaType: MEDIA_TYPE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enable) {
|
if (enable && stopScreenSharing) {
|
||||||
dispatch(toggleScreensharing(false, false, true));
|
dispatch(toggleScreensharing(false, false, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +103,7 @@ export function muteAllParticipants(exclude: Array<string>, mediaType: MEDIA_TYP
|
||||||
const localId = getLocalParticipant(state).id;
|
const localId = getLocalParticipant(state).id;
|
||||||
|
|
||||||
if (!exclude.includes(localId)) {
|
if (!exclude.includes(localId)) {
|
||||||
dispatch(muteLocal(true, mediaType));
|
dispatch(muteLocal(true, mediaType, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
getRemoteParticipants(state).forEach((p, id) => {
|
getRemoteParticipants(state).forEach((p, id) => {
|
||||||
|
|
Loading…
Reference in New Issue