From 56d4d40b1070e167e190d9dca6586ec0dafca5ca Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 17 Mar 2015 17:26:14 +0100 Subject: [PATCH] Keep our local video muted to prevent feedback --- public/js/vroom.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/js/vroom.js b/public/js/vroom.js index 5a3c803..f2c9d75 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -826,14 +826,14 @@ function initVroom(room) { function handlePreviewClick(el, id){ var wait = 1; // There's already a main video, let's hide it - // and delay the new one so the fade out as time to complete + // and delay the new one so the fade out has time to complete if ($('#mainVideo video').length > 0){ $('#mainVideo').hide(200); wait = 200; - // Play all preview + // Play all previews // the one in the mainVid was muted $('#webRTCVideo video').each(function(){ - if ($(this).get(0).volume == 0){ + if ($(this).get(0).volume == 0 && $(this).attr('id') !== 'webRTCVideoLocal'){ $(this).get(0).volume= .7; } }); @@ -873,8 +873,13 @@ function initVroom(room) { $(this).get(0).play(); } }); - el.get(0).volume = 0; - $('#mainVideo video').get(0).volume = 1; + if (el.attr('id') !== 'webRTCVideoLocal'){ + el.get(0).volume = 0; + $('#mainVideo video').get(0).volume = 1; + } + else { + $('#mainVideo video').get(0).volume = 0; + } } $('#mainVideo').show(200); }