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>');
});
// 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
webrtc.on('unmute', function(data){
if (data.name === 'audio'){
var el = '#mute_' + data.id;
peers[data.id].micMuted = false;
}
else { // if (data.name === 'video')
else if (data.name === 'video'){
var el = '#pause_' + data.id;
peers[data.id].videoPaused = false;
}
else{
return;
}
$(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
webrtc.on('room_locked', function(data){
$('#lockLabel').addClass('btn-danger active');

Loading…
Cancel
Save