You've already forked matrix-js-sdk
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:
@@ -535,7 +535,12 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
|
|||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
const error = stream;
|
const error = stream;
|
||||||
let constraints = null;
|
const constraints = {
|
||||||
|
'mandatory': {
|
||||||
|
'OfferToReceiveAudio': true,
|
||||||
|
'OfferToReceiveVideo': self.type === 'video',
|
||||||
|
},
|
||||||
|
};
|
||||||
if (stream instanceof MediaStream) {
|
if (stream instanceof MediaStream) {
|
||||||
const videoEl = this.getLocalVideoElement();
|
const videoEl = this.getLocalVideoElement();
|
||||||
|
|
||||||
@@ -570,12 +575,6 @@ MatrixCall.prototype._maybeGotUserMediaForInvite = function(stream) {
|
|||||||
} else if (error.name === 'PermissionDeniedError') {
|
} else if (error.name === 'PermissionDeniedError') {
|
||||||
debuglog('User denied access to camera/microphone.' +
|
debuglog('User denied access to camera/microphone.' +
|
||||||
' Or possibly you are using an insecure domain. Receiving only.');
|
' Or possibly you are using an insecure domain. Receiving only.');
|
||||||
constraints = {
|
|
||||||
'mandatory': {
|
|
||||||
'OfferToReceiveAudio': true,
|
|
||||||
'OfferToReceiveVideo': self.type == 'video',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
this.peerConn = _createPeerConnection(this);
|
this.peerConn = _createPeerConnection(this);
|
||||||
} else {
|
} else {
|
||||||
debuglog('Failed to getUserMedia.');
|
debuglog('Failed to getUserMedia.');
|
||||||
@@ -633,7 +632,7 @@ MatrixCall.prototype._maybeGotUserMediaForAnswer = function(stream) {
|
|||||||
const constraints = {
|
const constraints = {
|
||||||
'mandatory': {
|
'mandatory': {
|
||||||
'OfferToReceiveAudio': true,
|
'OfferToReceiveAudio': true,
|
||||||
'OfferToReceiveVideo': self.type == 'video',
|
'OfferToReceiveVideo': self.type === 'video',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
self.peerConn.createAnswer(function(description) {
|
self.peerConn.createAnswer(function(description) {
|
||||||
|
|||||||
Reference in New Issue
Block a user