Browse Source

Get ice servers via xirsys

Xirsys is used to get working ice servers. A call is made to a script on
the server (which has the necessary xirsys credentials), which in turn
get the data from xirsys and return to client.
pull/54/head
Amir Sanni 6 years ago
parent
commit
fb947bd79f
  1. 22
      js/comm.js

22
js/comm.js

@ -41,6 +41,28 @@ window.addEventListener('load', function(){ @@ -41,6 +41,28 @@ window.addEventListener('load', function(){
********************************************************************************************************************************
*/
//Get ice servers
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(e){
if(xhr.readyState == 4 && xhr.status == 200){
let res = JSON.parse(xhr.responseText);
servers = res.iceServers ? res : servers;
}
}
xhr.open("GET", "/Server.php", true);
xhr.send();
/*
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
*/
//add event listeners to the dial buttons
var initCallElems = document.getElementsByClassName('initCall');

Loading…
Cancel
Save