Merge pull request #20 from matrix-org/screen-sharing

Screen sharing
This commit is contained in:
Matthew Hodgson 2015-10-21 01:35:16 +01:00
commit feaf2a319b
3 changed files with 11 additions and 3 deletions

View file

@ -163,6 +163,12 @@ function _onAction(payload) {
payload.local_element payload.local_element
); );
} }
else if (payload.type === 'screensharing') {
newCall.placeScreenSharingCall(
payload.remote_element,
payload.local_element
);
}
else { else {
console.error("Unknown conf call type: %s", payload.type); console.error("Unknown conf call type: %s", payload.type);
} }

View file

@ -69,10 +69,10 @@ module.exports = {
}); });
}, },
onVideoClick: function() { onVideoClick: function(e) {
dis.dispatch({ dis.dispatch({
action: 'place_call', action: 'place_call',
type: "video", type: e.shiftKey ? "screensharing" : "video",
room_id: this.props.room.roomId room_id: this.props.room.roomId
}); });
}, },

View file

@ -54,8 +54,10 @@ module.exports = {
var call = CallHandler.getCall(roomId); var call = CallHandler.getCall(roomId);
if (call) { if (call) {
call.setLocalVideoElement(this.getVideoView().getLocalVideoElement()); 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()); 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') { if (call && call.type === "video" && call.state !== 'ended') {
this.getVideoView().getLocalVideoElement().style.display = "initial"; this.getVideoView().getLocalVideoElement().style.display = "initial";