From 8603c0aee95c707b728ec0ceb5ef33c4e4c6afcc Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 19 May 2014 10:52:45 +0200 Subject: [PATCH] Cleanup in unmuting handling --- public/js/vroom.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 68dcaff..57d6c29 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -683,25 +683,28 @@ function initVroom(room) { $('#overlay_' + data.id).append('
'); }); - // 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');