Skip to content

Commit feaf2a3

Browse files
committed
Merge pull request element-hq#20 from matrix-org/screen-sharing
Screen sharing
2 parents 3d8d9ba + 3b988b0 commit feaf2a3

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

‎src/CallHandler.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ function _onAction(payload) {
163163
payload.local_element
164164
);
165165
}
166+
else if (payload.type === 'screensharing') {
167+
newCall.placeScreenSharingCall(
168+
payload.remote_element,
169+
payload.local_element
170+
);
171+
}
166172
else {
167173
console.error("Unknown conf call type: %s", payload.type);
168174
}

‎src/controllers/molecules/RoomHeader.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ module.exports = {
6969
});
7070
},
7171

72-
onVideoClick: function() {
72+
onVideoClick: function(e) {
7373
dis.dispatch({
7474
action: 'place_call',
75-
type: "video",
75+
type: e.shiftKey ? "screensharing" : "video",
7676
room_id: this.props.room.roomId
7777
});
7878
},

‎src/controllers/molecules/voip/CallView.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ module.exports = {
5454
var call = CallHandler.getCall(roomId);
5555
if (call) {
5656
call.setLocalVideoElement(this.getVideoView().getLocalVideoElement());
57-
// N.B. the remote video element is used for playback for audio for voice calls
5857
call.setRemoteVideoElement(this.getVideoView().getRemoteVideoElement());
58+
// give a separate element for audio stream playback - both for voice calls
59+
// and for the voice stream of screen captures
60+
call.setRemoteAudioElement(this.getVideoView().getRemoteAudioElement());
5961
}
6062
if (call && call.type === "video" && call.state !== 'ended') {
6163
this.getVideoView().getLocalVideoElement().style.display = "initial";

0 commit comments

Comments
 (0)