1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

webrtc/call: Always offer to receive audio/video for video call

This allows people without (or denying access to) a webcam to make a
video call and receive audio and video from the peer.
This commit is contained in:
Robert Swain
2017-04-12 20:09:23 +02:00
parent b33dcfe6ff
commit 88948c3cfd

View File

@@ -535,7 +535,12 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
const self = this;
const error = stream;
let constraints = null;
const constraints = {
'mandatory': {
'OfferToReceiveAudio': true,
'OfferToReceiveVideo': self.type === 'video',
},
};
if (stream instanceof MediaStream) {
const videoEl = this.getLocalVideoElement();
@@ -570,12 +575,6 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
} else if (error.name === 'PermissionDeniedError') {
debuglog('User denied access to camera/microphone.' +
' Or possibly you are using an insecure domain. Receiving only.');
constraints = {
'mandatory': {
'OfferToReceiveAudio': true,
'OfferToReceiveVideo': self.type == 'video',
},
};
this.peerConn = _createPeerConnection(this);
} else {
debuglog('Failed to getUserMedia.');
@@ -633,7 +632,7 @@ MatrixCall.prototype._maybeGotUserMediaForAnswer = function(stream) {
const constraints = {
'mandatory': {
'OfferToReceiveAudio': true,
'OfferToReceiveVideo': self.type == 'video',
'OfferToReceiveVideo': self.type === 'video',
},
};
self.peerConn.createAnswer(function(description) {