Moderator: Mute all screen sharing

auto_join_3.3
Luca 2020-05-13 10:42:03 +02:00 committed by Mészáros Mihály
parent e1f5f804b0
commit 13c38cecfd
6 changed files with 59 additions and 1 deletions

View File

@ -1508,6 +1508,26 @@ export default class RoomClient
roomActions.setStopAllVideoInProgress(false)); roomActions.setStopAllVideoInProgress(false));
} }
async stopAllPeerScreenSharing()
{
logger.debug('stopAllPeerScreenSharing()');
store.dispatch(
roomActions.setStopAllScreenSharingInProgress(true));
try
{
await this.sendRequest('moderator:stopAllScreenSharing');
}
catch (error)
{
logger.error('stopAllPeerScreenSharing() failed: %o', error);
}
store.dispatch(
roomActions.setStopAllScreenSharingInProgress(false));
}
async closeMeeting() async closeMeeting()
{ {
logger.debug('closeMeeting()'); logger.debug('closeMeeting()');

View File

@ -164,6 +164,12 @@ export const setStopAllVideoInProgress = (flag) =>
payload : { flag } payload : { flag }
}); });
export const setStopAllScreenSharingInProgress = (flag) =>
({
type : 'STOP_ALL_SCREEN_SHARING_IN_PROGRESS',
payload : { flag }
});
export const setCloseMeetingInProgress = (flag) => export const setCloseMeetingInProgress = (flag) =>
({ ({
type : 'CLOSE_MEETING_IN_PROGRESS', type : 'CLOSE_MEETING_IN_PROGRESS',

View File

@ -63,6 +63,22 @@ const ListModerator = (props) =>
/> />
</Button> </Button>
<div className={classes.divider} /> <div className={classes.divider} />
<Button
aria-label={intl.formatMessage({
id : 'room.stopAllScreenSharing',
defaultMessage : 'Stop all screen sharing'
})}
variant='contained'
color='secondary'
disabled={room.stopAllScreenSharingInProgress}
onClick={() => roomClient.stopAllPeerScreenSharing()}
>
<FormattedMessage
id='room.stopAllScreenSharing'
defaultMessage='Stop all screen sharing'
/>
</Button>
<div className={classes.divider} />
<Button <Button
aria-label={intl.formatMessage({ aria-label={intl.formatMessage({
id : 'room.closeMeeting', id : 'room.closeMeeting',

View File

@ -309,7 +309,7 @@ const ListPeer = (props) =>
{ isModerator && screenConsumer && { isModerator && screenConsumer &&
<Tooltip <Tooltip
title={intl.formatMessage({ title={intl.formatMessage({
id : 'tooltip.muteScreenSharing', id : 'tooltip.muteScreenSharingModerator',
defaultMessage : 'Mute participant screen share globally' defaultMessage : 'Mute participant screen share globally'
})} })}
placement='bottom' placement='bottom'

View File

@ -226,6 +226,9 @@ const room = (state = initialState, action) =>
case 'STOP_ALL_VIDEO_IN_PROGRESS': case 'STOP_ALL_VIDEO_IN_PROGRESS':
return { ...state, stopAllVideoInProgress: action.payload.flag }; return { ...state, stopAllVideoInProgress: action.payload.flag };
case 'STOP_ALL_SCREEN_SHARING_IN_PROGRESS':
return { ...state, stopAllScreenSharingInProgress: action.payload.flag };
case 'CLOSE_MEETING_IN_PROGRESS': case 'CLOSE_MEETING_IN_PROGRESS':
return { ...state, closeMeetingInProgress: action.payload.flag }; return { ...state, closeMeetingInProgress: action.payload.flag };

View File

@ -1441,6 +1441,19 @@ class Room extends EventEmitter
break; break;
} }
case 'moderator:stopAllScreenSharing':
{
if (!this._hasPermission(peer, MODERATE_ROOM))
throw new Error('peer not authorized');
// Spread to others
this._notification(peer.socket, 'moderator:stopScreenSharing', null, true);
cb();
break;
}
case 'moderator:stopScreenSharing': case 'moderator:stopScreenSharing':
{ {
if (!this._hasPermission(peer, MODERATE_ROOM)) if (!this._hasPermission(peer, MODERATE_ROOM))