diff --git a/lib/client.js b/lib/client.js
index 5462467e3..613d85b88 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -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];
}
}
}
diff --git a/lib/webrtc/call.js b/lib/webrtc/call.js
index e23f1657b..753a2dff7 100644
--- a/lib/webrtc/call.js
+++ b/lib/webrtc/call.js
@@ -68,13 +68,13 @@ MatrixCall.prototype.placeVoiceCall = function() {
/**
* Place a video call to this room.
- * @param {Element} localVideoElement a <video>
DOM element
- * to render the local camera preview.
* @param {Element} remoteVideoElement a <video>
DOM element
* to render video to.
+ * @param {Element} localVideoElement a <video>
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';
};