Ping only after joining the room

Fix #98
master
Daniel Berteaud 10 years ago
parent 0d0b6afbf1
commit 7c42333af4
  1. 51
      public/js/vroom.js

@ -1463,6 +1463,31 @@ function initVroom(room) {
});
}
}, 10000);
// Ping the room every minutes
// Used to detect inactive rooms
setInterval(function(){
$.ajax({
data: {
req: JSON.stringify({
action: 'ping',
param: {
room: roomName
}
})
},
error: function(data) {
showApiError(data);
},
success: function(data) {
if (data.msg && data.msg != ''){
$.notify(data.msg, {
className: 'info',
autoHide: false
});
}
}
});
}, 60000);
}
// Notify the server a new participant has joined (ourself)
// If we were prompted for our display name before joining
@ -1943,32 +1968,6 @@ function initVroom(room) {
});
}
// Ping the room every minutes
// Used to detect inactive rooms
setInterval(function(){
$.ajax({
data: {
req: JSON.stringify({
action: 'ping',
param: {
room: roomName
}
})
},
error: function(data) {
showApiError(data);
},
success: function(data) {
if (data.msg && data.msg != ''){
$.notify(data.msg, {
className: 'info',
autoHide: false
});
}
}
});
}, 60000);
// Ping all the peers every 5 sec to measure latency
// Do this through dataChannel
setInterval(function(){

Loading…
Cancel
Save