Cleanup in unmuting handling

master
Daniel Berteaud 11 years ago
parent 8eacbbad85
commit 8603c0aee9
  1. 17
      public/js/vroom.js

@ -683,25 +683,28 @@ function initVroom(room) {
$('#overlay_' + data.id).append('<div id="' + div + '" class="' + cl + '"></div>'); $('#overlay_' + data.id).append('<div id="' + div + '" class="' + cl + '"></div>');
}); });
// This peer claims he changed its role (usually from participant to owner)
// Lets check this
webrtc.on('role_change', function(data){
getPeerRole(data.id);
});
// Handle unmute/resume // Handle unmute/resume
webrtc.on('unmute', function(data){ webrtc.on('unmute', function(data){
if (data.name === 'audio'){ if (data.name === 'audio'){
var el = '#mute_' + data.id; var el = '#mute_' + data.id;
peers[data.id].micMuted = false; peers[data.id].micMuted = false;
} }
else { // if (data.name === 'video') else if (data.name === 'video'){
var el = '#pause_' + data.id; var el = '#pause_' + data.id;
peers[data.id].videoPaused = false; peers[data.id].videoPaused = false;
} }
else{
return;
}
$(el).remove(); $(el).remove();
}); });
// This peer claims he changed its role (usually from participant to owner)
// Lets check this
webrtc.on('role_change', function(data){
getPeerRole(data.id);
});
// A few notif on password set/unset or lock/unlock // A few notif on password set/unset or lock/unlock
webrtc.on('room_locked', function(data){ webrtc.on('room_locked', function(data){
$('#lockLabel').addClass('btn-danger active'); $('#lockLabel').addClass('btn-danger active');

Loading…
Cancel
Save