1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Make inbound calls work.

This commit is contained in:
Kegan Dougal
2015-07-14 16:23:31 +01:00
parent 8a41504cbb
commit 053a5b1bea
2 changed files with 6 additions and 6 deletions

View File

@@ -1495,7 +1495,7 @@ function setupCallEventHandler(client) {
else {
if (call.state !== 'ended') {
call._onHangupReceived(content);
client.callList[content.call_id] = undefined; // delete the call
delete client.callList[content.call_id];
}
}
}

View File

@@ -68,13 +68,13 @@ MatrixCall.prototype.placeVoiceCall = function() {
/**
* Place a video call to this room.
* @param {Element} localVideoElement a <code>&lt;video&gt;</code> DOM element
* to render the local camera preview.
* @param {Element} remoteVideoElement a <code>&lt;video&gt;</code> DOM element
* to render video to.
* @param {Element} localVideoElement a <code>&lt;video&gt;</code> DOM element
* to render the local camera preview.
* @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);
this.localVideoElement = localVideoElement;
this.remoteVideoElement = remoteVideoElement;
@@ -309,7 +309,7 @@ MatrixCall.prototype._gotUserMediaForAnswer = function(stream) {
'OfferToReceiveVideo': self.type == 'video'
},
};
self.peerConn.createAnswer(constraints, function(description) {
self.peerConn.createAnswer(function(description) {
debuglog("Created answer: " + description);
self.peerConn.setLocalDescription(description, function() {
var content = {
@@ -324,7 +324,7 @@ MatrixCall.prototype._gotUserMediaForAnswer = function(stream) {
self.state = 'connecting';
}, function() {
debuglog("Error setting local description!");
});
}, constraints);
});
self.state = 'create_answer';
};