diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 5086107..a936a14 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -1448,6 +1448,26 @@ export default class RoomClient 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() { logger.debug('muteAllPeers()'); @@ -1488,6 +1508,26 @@ export default class RoomClient 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() { logger.debug('closeMeeting()'); @@ -2608,7 +2648,6 @@ export default class RoomClient case 'moderator:stopVideo': { this.disableWebcam(); - this.disableScreenSharing(); store.dispatch(requestActions.notify( { @@ -2621,6 +2660,21 @@ export default class RoomClient 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': { // Need some feedback diff --git a/app/src/actions/peerActions.js b/app/src/actions/peerActions.js index 5672b47..1a1e2d3 100644 --- a/app/src/actions/peerActions.js +++ b/app/src/actions/peerActions.js @@ -86,3 +86,9 @@ export const setStopPeerVideoInProgress = (peerId, flag) => type : 'STOP_PEER_VIDEO_IN_PROGRESS', payload : { peerId, flag } }); + +export const setStopPeerScreenSharingInProgress = (peerId, flag) => + ({ + type : 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS', + payload : { peerId, flag } + }); diff --git a/app/src/actions/roomActions.js b/app/src/actions/roomActions.js index 5ae45e3..a73e18a 100644 --- a/app/src/actions/roomActions.js +++ b/app/src/actions/roomActions.js @@ -164,6 +164,12 @@ export const setStopAllVideoInProgress = (flag) => payload : { flag } }); +export const setStopAllScreenSharingInProgress = (flag) => + ({ + type : 'STOP_ALL_SCREEN_SHARING_IN_PROGRESS', + payload : { flag } + }); + export const setCloseMeetingInProgress = (flag) => ({ type : 'CLOSE_MEETING_IN_PROGRESS', diff --git a/app/src/components/MeetingDrawer/ParticipantList/ListModerator.js b/app/src/components/MeetingDrawer/ParticipantList/ListModerator.js index c10506a..2fff283 100644 --- a/app/src/components/MeetingDrawer/ParticipantList/ListModerator.js +++ b/app/src/components/MeetingDrawer/ParticipantList/ListModerator.js @@ -63,6 +63,22 @@ const ListModerator = (props) => />
+ +
); diff --git a/app/src/reducers/peers.js b/app/src/reducers/peers.js index 32d6fef..8e6a7f7 100644 --- a/app/src/reducers/peers.js +++ b/app/src/reducers/peers.js @@ -82,6 +82,11 @@ const peer = (state = initialState, action) => stopPeerVideoInProgress : action.payload.flag }; + case 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS': + return { + ...state, + stopPeerScreenSharingInProgress : action.payload.flag + }; default: return state; } @@ -118,6 +123,7 @@ const peers = (state = initialState, action) => case 'REMOVE_PEER_ROLE': case 'STOP_PEER_AUDIO_IN_PROGRESS': case 'STOP_PEER_VIDEO_IN_PROGRESS': + case 'STOP_PEER_SCREEN_SHARING_IN_PROGRESS': { const oldPeer = state[action.payload.peerId]; diff --git a/app/src/reducers/room.js b/app/src/reducers/room.js index d784219..193e8e0 100644 --- a/app/src/reducers/room.js +++ b/app/src/reducers/room.js @@ -226,6 +226,9 @@ const room = (state = initialState, action) => case 'STOP_ALL_VIDEO_IN_PROGRESS': return { ...state, stopAllVideoInProgress: action.payload.flag }; + case 'STOP_ALL_SCREEN_SHARING_IN_PROGRESS': + return { ...state, stopAllScreenSharingInProgress: action.payload.flag }; + case 'CLOSE_MEETING_IN_PROGRESS': return { ...state, closeMeetingInProgress: action.payload.flag }; diff --git a/app/src/translations/cn.json b/app/src/translations/cn.json index 2e4338c..c5f79e4 100644 --- a/app/src/translations/cn.json +++ b/app/src/translations/cn.json @@ -88,6 +88,7 @@ "tooltip.muteParticipantAudioModerator": null, "tooltip.muteParticipantVideoModerator": null, "tooltip.muteScreenSharingModerator": null, + "room.stopAllScreenSharing": null, "label.roomName": "房间名称", "label.chooseRoomButton": "继续", @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/cs.json b/app/src/translations/cs.json index b76dc3b..c1ea569 100644 --- a/app/src/translations/cs.json +++ b/app/src/translations/cs.json @@ -63,6 +63,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -186,5 +187,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null -} + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null +} \ No newline at end of file diff --git a/app/src/translations/de.json b/app/src/translations/de.json index e0cf1da..9339d4f 100644 --- a/app/src/translations/de.json +++ b/app/src/translations/de.json @@ -64,6 +64,7 @@ "room.about": "Über", "room.shortcutKeys": "Tastaturkürzel", "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": "Du bist stummgeschaltet. Halte die SPACE-Taste um zu sprechen", @@ -187,5 +188,6 @@ "moderator.clearChat": "Moderator hat Chat gelöscht", "moderator.clearFiles": "Moderator hat geteilte Dateiliste gelöscht", "moderator.muteAudio": "Moderator hat dich stummgeschaltet", - "moderator.muteVideo": "Moderator hat dein Video gestoppt" + "moderator.muteVideo": "Moderator hat dein Video gestoppt", + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/dk.json b/app/src/translations/dk.json index 0236280..edeb619 100644 --- a/app/src/translations/dk.json +++ b/app/src/translations/dk.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/el.json b/app/src/translations/el.json index 25df1a7..6807831 100644 --- a/app/src/translations/el.json +++ b/app/src/translations/el.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/en.json b/app/src/translations/en.json index ec6c612..30c21d7 100644 --- a/app/src/translations/en.json +++ b/app/src/translations/en.json @@ -64,6 +64,7 @@ "room.about": "About", "room.shortcutKeys": "Shortcut Keys", "room.browsePeersSpotlight": "Browse participants into Spotlight", + "room.stopAllScreenSharing": "Stop all screen sharing", "me.mutedPTT": "You are muted, hold down SPACE-BAR to talk", @@ -187,5 +188,6 @@ "moderator.clearChat": "Moderator cleared the chat", "moderator.clearFiles": "Moderator cleared the files", "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" +} \ No newline at end of file diff --git a/app/src/translations/es.json b/app/src/translations/es.json index 8075ff5..4e0c12a 100644 --- a/app/src/translations/es.json +++ b/app/src/translations/es.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/fr.json b/app/src/translations/fr.json index ea87e99..0f2ac0b 100644 --- a/app/src/translations/fr.json +++ b/app/src/translations/fr.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -186,5 +187,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/hr.json b/app/src/translations/hr.json index 1e9bce1..59873d4 100644 --- a/app/src/translations/hr.json +++ b/app/src/translations/hr.json @@ -64,6 +64,7 @@ "room.about": "O programu", "room.shortcutKeys": "Prečaci", "room.browsePeersSpotlight": "Pretražite sudionike u središtu pažnje", + "room.stopAllScreenSharing": null, "me.mutedPTT": "Utišani ste, pritisnite i držite SPACE tipku za razgovor", @@ -187,5 +188,6 @@ "moderator.clearChat": "Moderator je izbrisao razgovor", "moderator.clearFiles": "Moderator je izbrisao datoteke", "moderator.muteAudio": "Moderator je utišao tvoj zvuk", - "moderator.muteVideo": "Moderator je zaustavio tvoj video" + "moderator.muteVideo": "Moderator je zaustavio tvoj video", + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/hu.json b/app/src/translations/hu.json index 58d485a..d525aff 100644 --- a/app/src/translations/hu.json +++ b/app/src/translations/hu.json @@ -63,7 +63,8 @@ "room.help": "Segítség", "room.about": "Névjegy", "room.shortcutKeys": "Billentyűparancsok", - "room.browsePeersSpotlight": null, + "room.browsePeersSpotlight": "Résztvevők böngészése", + "room.stopAllScreenSharing": "Minden képernyőmegosztás leállítása", "me.mutedPTT": "Némítva vagy, ha beszélnél nyomd le a szóköz billentyűt", @@ -187,5 +188,6 @@ "moderator.clearChat": "A moderátor kiürítette a chat történelmet", "moderator.clearFiles": "A moderátor kiürítette a file megosztás történelmet", "moderator.muteAudio": "A moderátor elnémította a hangod", - "moderator.muteVideo": "A moderátor elnémította a videód" + "moderator.muteVideo": "A moderátor elnémította a videód", + "moderator.muteScreenSharing": "A moderátor leállította képernyőmegosztásod" } diff --git a/app/src/translations/it.json b/app/src/translations/it.json index 243eaca..02b53e7 100644 --- a/app/src/translations/it.json +++ b/app/src/translations/it.json @@ -64,7 +64,8 @@ "room.about": "Informazioni su", "room.shortcutKeys": "Scorciatoie da tastiera", "room.browsePeersSpotlight": null, - + "room.stopAllScreenSharing": null, + "me.mutedPTT": "Sei mutato, tieni premuto SPAZIO per parlare", "roles.gotRole": "Hai ottenuto il ruolo: {role}", @@ -187,5 +188,6 @@ "moderator.clearChat": "Il moderatore ha pulito la chat", "moderator.clearFiles": "Il moderatore ha pulito i file", "moderator.muteAudio": "Il moderatore ha mutato il tuo audio", - "moderator.muteVideo": "Il moderatore ha fermato il tuo video" + "moderator.muteVideo": "Il moderatore ha fermato il tuo video", + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/lv.json b/app/src/translations/lv.json index 824e26b..62ee61e 100644 --- a/app/src/translations/lv.json +++ b/app/src/translations/lv.json @@ -63,6 +63,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": "Jūs esat noklusināts. Turiet taustiņu SPACE-BAR, lai runātu", @@ -181,5 +182,6 @@ "moderator.clearChat": "Moderators nodzēsa tērziņus", "moderator.clearFiles": "Moderators notīrīja failus", "moderator.muteAudio": "Moderators noklusināja jūsu mikrofonu", - "moderator.muteVideo": "Moderators atslēdza jūsu kameru" + "moderator.muteVideo": "Moderators atslēdza jūsu kameru", + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/nb.json b/app/src/translations/nb.json index 10f387a..5bafeb6 100644 --- a/app/src/translations/nb.json +++ b/app/src/translations/nb.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": "Du er dempet, hold nede SPACE for å snakke", @@ -187,5 +188,6 @@ "moderator.clearChat": "Moderator tømte chatten", "moderator.clearFiles": "Moderator fjernet filer", "moderator.muteAudio": "Moderator mutet lyden din", - "moderator.muteVideo": "Moderator mutet videoen din" + "moderator.muteVideo": "Moderator mutet videoen din", + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/pl.json b/app/src/translations/pl.json index 948a62d..7612f99 100644 --- a/app/src/translations/pl.json +++ b/app/src/translations/pl.json @@ -64,6 +64,7 @@ "room.about": "O pogramie", "room.shortcutKeys": "Skróty klawiaturowe", "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": "Masz wyciszony mikrofon, przytrzymaj spację aby mówić", @@ -187,5 +188,6 @@ "moderator.clearChat": "Moderator wyczyścił chat", "moderator.clearFiles": "Moderator wyczyścił pliki", "moderator.muteAudio": "Moderator wyciszył audio", - "moderator.muteVideo": "Moderator wyciszył twoje video" + "moderator.muteVideo": "Moderator wyciszył twoje video", + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/pt.json b/app/src/translations/pt.json index b354e65..a2a3310 100644 --- a/app/src/translations/pt.json +++ b/app/src/translations/pt.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/ro.json b/app/src/translations/ro.json index d718998..7161bd4 100644 --- a/app/src/translations/ro.json +++ b/app/src/translations/ro.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/tr.json b/app/src/translations/tr.json index 8647707..1876bab 100644 --- a/app/src/translations/tr.json +++ b/app/src/translations/tr.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -179,5 +180,6 @@ "devices.screenSharingError": "Ekranınıza erişilirken bir hata oluştu", "devices.cameraDisconnected": "Kamera bağlı değil", - "devices.cameraError": "Kameranıza erişilirken bir hata oluştu" + "devices.cameraError": "Kameranıza erişilirken bir hata oluştu", + "moderator.muteScreenSharing": null } diff --git a/app/src/translations/tw.json b/app/src/translations/tw.json index 83f0c02..99c32d7 100644 --- a/app/src/translations/tw.json +++ b/app/src/translations/tw.json @@ -63,7 +63,8 @@ "room.help": "幫助", "room.about": "關於", "room.shortcutKeys": "鍵盤快速鍵", - + "room.stopAllScreenSharing": null, + "me.mutedPTT": "您已靜音,請按下 空白鍵 來說話", "roles.gotRole": "您已取得身份: {role}", @@ -186,5 +187,6 @@ "moderator.clearChat": "管理員清除了聊天", "moderator.clearFiles": "管理員清除了所有檔案", "moderator.muteAudio": "您已被管理員靜音", - "moderator.muteVideo": "您的視訊已被管理員關閉" + "moderator.muteVideo": "您的視訊已被管理員關閉", + "moderator.muteScreenSharing": null } \ No newline at end of file diff --git a/app/src/translations/uk.json b/app/src/translations/uk.json index dce9425..2ee6774 100644 --- a/app/src/translations/uk.json +++ b/app/src/translations/uk.json @@ -64,6 +64,7 @@ "room.about": null, "room.shortcutKeys": null, "room.browsePeersSpotlight": null, + "room.stopAllScreenSharing": null, "me.mutedPTT": null, @@ -187,5 +188,6 @@ "moderator.clearChat": null, "moderator.clearFiles": null, "moderator.muteAudio": null, - "moderator.muteVideo": null -} \ No newline at end of file + "moderator.muteVideo": null, + "moderator.muteScreenSharing": null +} \ No newline at end of file diff --git a/server/lib/Room.js b/server/lib/Room.js index 74accc4..f110327 100644 --- a/server/lib/Room.js +++ b/server/lib/Room.js @@ -1441,6 +1441,38 @@ class Room extends EventEmitter 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': + { + 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': { if (!this._hasPermission(peer, MODERATE_ROOM))