Moderator: disable screen sharing
parent
2623ef2eaa
commit
5ea482d01f
|
|
@ -1432,6 +1432,26 @@ export default class RoomClient
|
||||||
peerActions.setStopPeerVideoInProgress(peerId, false));
|
peerActions.setStopPeerVideoInProgress(peerId, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async stopPeerScreenSharing(peerId)
|
||||||
|
{
|
||||||
|
logger.debug('stopPeerScreenSharing() [peerId:"%s"]', peerId);
|
||||||
|
|
||||||
|
store.dispatch(
|
||||||
|
peerActions.setStopPeerScreenSharingInProgress(peerId, true));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await this.sendRequest('moderator:stopScreenSharing', { peerId });
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
logger.error('stopPeerScreenSharing() failed: %o', error);
|
||||||
|
}
|
||||||
|
|
||||||
|
store.dispatch(
|
||||||
|
peerActions.setStopPeerScreenSharingInProgress(peerId, false));
|
||||||
|
}
|
||||||
|
|
||||||
async muteAllPeers()
|
async muteAllPeers()
|
||||||
{
|
{
|
||||||
logger.debug('muteAllPeers()');
|
logger.debug('muteAllPeers()');
|
||||||
|
|
@ -2592,7 +2612,6 @@ export default class RoomClient
|
||||||
case 'moderator:stopVideo':
|
case 'moderator:stopVideo':
|
||||||
{
|
{
|
||||||
this.disableWebcam();
|
this.disableWebcam();
|
||||||
this.disableScreenSharing();
|
|
||||||
|
|
||||||
store.dispatch(requestActions.notify(
|
store.dispatch(requestActions.notify(
|
||||||
{
|
{
|
||||||
|
|
@ -2605,6 +2624,21 @@ export default class RoomClient
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'moderator:stopScreenSharing':
|
||||||
|
{
|
||||||
|
this.disableScreenSharing();
|
||||||
|
|
||||||
|
store.dispatch(requestActions.notify(
|
||||||
|
{
|
||||||
|
text : intl.formatMessage({
|
||||||
|
id : 'moderator.muteScreenSharingModerator',
|
||||||
|
defaultMessage : 'Moderator stopped your screen sharing'
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'moderator:kick':
|
case 'moderator:kick':
|
||||||
{
|
{
|
||||||
// Need some feedback
|
// Need some feedback
|
||||||
|
|
|
||||||
|
|
@ -86,3 +86,10 @@ export const setStopPeerVideoInProgress = (peerId, flag) =>
|
||||||
type : 'STOP_PEER_VIDEO_IN_PROGRESS',
|
type : 'STOP_PEER_VIDEO_IN_PROGRESS',
|
||||||
payload : { peerId, flag }
|
payload : { peerId, flag }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const setStopPeerScreenSharingInProgress = (peerId, flag) =>
|
||||||
|
({
|
||||||
|
type : 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS',
|
||||||
|
payload : { peerId, flag }
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -306,6 +306,33 @@ const ListPeer = (props) =>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
}
|
}
|
||||||
|
{ isModerator && screenConsumer &&
|
||||||
|
<Tooltip
|
||||||
|
title={intl.formatMessage({
|
||||||
|
id : 'tooltip.muteScreenSharing',
|
||||||
|
defaultMessage : 'Mute participant screen share globally'
|
||||||
|
})}
|
||||||
|
placement='bottom'
|
||||||
|
>
|
||||||
|
<IconButton
|
||||||
|
className={classes.buttons}
|
||||||
|
style={{ color: green[500] }}
|
||||||
|
disabled={!isModerator || peer.stopPeerScreenSharingInProgress}
|
||||||
|
onClick={(e) =>
|
||||||
|
{
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
roomClient.stopPeerScreenSharing(peer.id);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{ !screenConsumer.remotelyPaused ?
|
||||||
|
<ScreenIcon />
|
||||||
|
:
|
||||||
|
<ScreenOffIcon />
|
||||||
|
}
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,11 @@ const peer = (state = initialState, action) =>
|
||||||
stopPeerVideoInProgress : action.payload.flag
|
stopPeerVideoInProgress : action.payload.flag
|
||||||
};
|
};
|
||||||
|
|
||||||
|
case 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS':
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
stopPeerScreenSharingInProgress : action.payload.flag
|
||||||
|
};
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
@ -118,6 +123,7 @@ const peers = (state = initialState, action) =>
|
||||||
case 'REMOVE_PEER_ROLE':
|
case 'REMOVE_PEER_ROLE':
|
||||||
case 'STOP_PEER_AUDIO_IN_PROGRESS':
|
case 'STOP_PEER_AUDIO_IN_PROGRESS':
|
||||||
case 'STOP_PEER_VIDEO_IN_PROGRESS':
|
case 'STOP_PEER_VIDEO_IN_PROGRESS':
|
||||||
|
case 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS':
|
||||||
{
|
{
|
||||||
const oldPeer = state[action.payload.peerId];
|
const oldPeer = state[action.payload.peerId];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -183,5 +183,6 @@
|
||||||
"moderator.clearChat": "Moderator cleared the chat",
|
"moderator.clearChat": "Moderator cleared the chat",
|
||||||
"moderator.clearFiles": "Moderator cleared the files",
|
"moderator.clearFiles": "Moderator cleared the files",
|
||||||
"moderator.muteAudio": "Moderator muted your audio",
|
"moderator.muteAudio": "Moderator muted your audio",
|
||||||
"moderator.muteVideo": "Moderator muted your video"
|
"moderator.muteVideo": "Moderator muted your video",
|
||||||
|
"moderator.muteScreenSharing": "Moderator muted your screen sharing"
|
||||||
}
|
}
|
||||||
|
|
@ -1441,6 +1441,25 @@ class Room extends EventEmitter
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'moderator:stopScreenSharing':
|
||||||
|
{
|
||||||
|
if (!this._hasPermission(peer, MODERATE_ROOM))
|
||||||
|
throw new Error('peer not authorized');
|
||||||
|
|
||||||
|
const { peerId } = request.data;
|
||||||
|
|
||||||
|
const stopVideoPeer = this._peers[peerId];
|
||||||
|
|
||||||
|
if (!stopVideoPeer)
|
||||||
|
throw new Error(`peer with id "${peerId}" not found`);
|
||||||
|
|
||||||
|
this._notification(stopVideoPeer.socket, 'moderator:stopScreenSharing');
|
||||||
|
|
||||||
|
cb();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'moderator:closeMeeting':
|
case 'moderator:closeMeeting':
|
||||||
{
|
{
|
||||||
if (!this._hasPermission(peer, MODERATE_ROOM))
|
if (!this._hasPermission(peer, MODERATE_ROOM))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue