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

@ -33,6 +33,28 @@ else{ @@ -33,6 +33,28 @@ else{
window.addEventListener('load', function(){
//startCounter();//shows the time spent in room
/*
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
********************************************************************************************************************************
*/
//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();
/*
********************************************************************************************************************************
********************************************************************************************************************************

Loading…
Cancel
Save