diff --git a/src/CallHandler.js b/src/CallHandler.js index d0cf16f801..cf8460db6c 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -163,6 +163,12 @@ function _onAction(payload) { payload.local_element ); } + else if (payload.type === 'screensharing') { + newCall.placeScreenSharingCall( + payload.remote_element, + payload.local_element + ); + } else { console.error("Unknown conf call type: %s", payload.type); } diff --git a/src/controllers/molecules/RoomHeader.js b/src/controllers/molecules/RoomHeader.js index d16e3cbd42..b0bf0002da 100644 --- a/src/controllers/molecules/RoomHeader.js +++ b/src/controllers/molecules/RoomHeader.js @@ -69,10 +69,10 @@ module.exports = { }); }, - onVideoClick: function() { + onVideoClick: function(e) { dis.dispatch({ action: 'place_call', - type: "video", + type: e.shiftKey ? "screensharing" : "video", room_id: this.props.room.roomId }); }, diff --git a/src/controllers/molecules/voip/CallView.js b/src/controllers/molecules/voip/CallView.js index c8fab1fba4..4dd488c2dc 100644 --- a/src/controllers/molecules/voip/CallView.js +++ b/src/controllers/molecules/voip/CallView.js @@ -54,8 +54,10 @@ module.exports = { var call = CallHandler.getCall(roomId); if (call) { call.setLocalVideoElement(this.getVideoView().getLocalVideoElement()); - // N.B. the remote video element is used for playback for audio for voice calls call.setRemoteVideoElement(this.getVideoView().getRemoteVideoElement()); + // give a separate element for audio stream playback - both for voice calls + // and for the voice stream of screen captures + call.setRemoteAudioElement(this.getVideoView().getRemoteAudioElement()); } if (call && call.type === "video" && call.state !== 'ended') { this.getVideoView().getLocalVideoElement().style.display = "initial";