From d56d875a7f2604b0524417d97e5e3fd37fff9ce0 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 21 May 2014 17:45:15 +0200 Subject: [PATCH] Differ no sound detection until we effectivly joined the room --- public/js/vroom.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index f82ac06..c903850 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -819,6 +819,19 @@ function initVroom(room) { } }); + // When we joined the room + webrtc.on('joinedRoom', function(){ + // Check if sound is detected and warn if it hasn't + setTimeout(function (){ + if (maxVol < -40){ + $.notify(locale.NO_SOUND_DETECTED, { + className: 'error', + autoHide: false + }); + } + }, 10000); + }); + // Handle new video stream added: someone joined the room webrtc.on('videoAdded', function(video,peer){ addVideo(video,peer); @@ -1388,16 +1401,6 @@ function initVroom(room) { }); }, 60000); - // Check if sound is detected and warn if it hasn't - setTimeout(function (){ - if (maxVol < -40){ - $.notify(locale.NO_SOUND_DETECTED, { - className: 'error', - autoHide: false - }); - } - }, 10000); - window.onresize = function (){ $('#webRTCVideo').css('max-height', maxHeight()); $('#mainVideo>video').css('max-height', maxHeight());