Send multiple candidates at once instead of all individually. Changes spec to include multiple candidates in a candidate(s) message.

This commit is contained in:
David Baker 2014-09-12 18:16:24 +01:00
parent 14975ce5bc
commit 842898df15
2 changed files with 58 additions and 9 deletions

View file

@ -77,13 +77,15 @@ angular.module('matrixPhoneService', [])
return;
}
call.receivedAnswer(msg);
} else if (event.type == 'm.call.candidate') {
} else if (event.type == 'm.call.candidates') {
var call = matrixPhoneService.allCalls[msg.call_id];
if (!call) {
console.log("Got candidate for unknown call ID "+msg.call_id);
console.log("Got candidates for unknown call ID "+msg.call_id);
return;
}
call.gotRemoteIceCandidate(msg.candidate);
for (var i = 0; i < msg.candidates.length; ++i) {
call.gotRemoteIceCandidate(msg.candidates[i]);
}
} else if (event.type == 'm.call.hangup') {
var call = matrixPhoneService.allCalls[msg.call_id];
if (!call) {