You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-19 16:42:09 +03:00
Make inbound calls work.
This commit is contained in:
@@ -1495,7 +1495,7 @@ function setupCallEventHandler(client) {
|
|||||||
else {
|
else {
|
||||||
if (call.state !== 'ended') {
|
if (call.state !== 'ended') {
|
||||||
call._onHangupReceived(content);
|
call._onHangupReceived(content);
|
||||||
client.callList[content.call_id] = undefined; // delete the call
|
delete client.callList[content.call_id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -68,13 +68,13 @@ MatrixCall.prototype.placeVoiceCall = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Place a video call to this room.
|
* Place a video call to this room.
|
||||||
* @param {Element} localVideoElement a <code><video></code> DOM element
|
|
||||||
* to render the local camera preview.
|
|
||||||
* @param {Element} remoteVideoElement a <code><video></code> DOM element
|
* @param {Element} remoteVideoElement a <code><video></code> DOM element
|
||||||
* to render video to.
|
* to render video to.
|
||||||
|
* @param {Element} localVideoElement a <code><video></code> DOM element
|
||||||
|
* to render the local camera preview.
|
||||||
* @throws If you have not specified a listener for 'error' events.
|
* @throws If you have not specified a listener for 'error' events.
|
||||||
*/
|
*/
|
||||||
MatrixCall.prototype.placeVideoCall = function(localVideoElement, remoteVideoElement) {
|
MatrixCall.prototype.placeVideoCall = function(remoteVideoElement, localVideoElement) {
|
||||||
checkForErrorListener(this);
|
checkForErrorListener(this);
|
||||||
this.localVideoElement = localVideoElement;
|
this.localVideoElement = localVideoElement;
|
||||||
this.remoteVideoElement = remoteVideoElement;
|
this.remoteVideoElement = remoteVideoElement;
|
||||||
@@ -309,7 +309,7 @@ MatrixCall.prototype._gotUserMediaForAnswer = function(stream) {
|
|||||||
'OfferToReceiveVideo': self.type == 'video'
|
'OfferToReceiveVideo': self.type == 'video'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
self.peerConn.createAnswer(constraints, function(description) {
|
self.peerConn.createAnswer(function(description) {
|
||||||
debuglog("Created answer: " + description);
|
debuglog("Created answer: " + description);
|
||||||
self.peerConn.setLocalDescription(description, function() {
|
self.peerConn.setLocalDescription(description, function() {
|
||||||
var content = {
|
var content = {
|
||||||
@@ -324,7 +324,7 @@ MatrixCall.prototype._gotUserMediaForAnswer = function(stream) {
|
|||||||
self.state = 'connecting';
|
self.state = 'connecting';
|
||||||
}, function() {
|
}, function() {
|
||||||
debuglog("Error setting local description!");
|
debuglog("Error setting local description!");
|
||||||
});
|
}, constraints);
|
||||||
});
|
});
|
||||||
self.state = 'create_answer';
|
self.state = 'create_answer';
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user