From 74c0c35f319f942d0bc192e3f2e5e77534ba0d8c Mon Sep 17 00:00:00 2001 From: hristoterezov Date: Wed, 1 Oct 2014 11:36:23 +0300 Subject: [PATCH] Fixes the video and audio mute icons positions. Fixes the issue with multiple elements of mute icons. --- videolayout.js | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/videolayout.js b/videolayout.js index 70c8f6189..b4c7e23f8 100644 --- a/videolayout.js +++ b/videolayout.js @@ -715,21 +715,22 @@ var VideoLayout = (function (my) { } } else { - var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted'); + if(videoMutedSpan.length == 0) { + videoMutedSpan = document.createElement('span'); + videoMutedSpan.className = 'videoMuted'; - videoMutedSpan = document.createElement('span'); - videoMutedSpan.className = 'videoMuted'; - if (audioMutedSpan) { - videoMutedSpan.right = '30px'; - } - $('#' + videoSpanId)[0].appendChild(videoMutedSpan); + $('#' + videoSpanId)[0].appendChild(videoMutedSpan); - var mutedIndicator = document.createElement('i'); - mutedIndicator.className = 'icon-camera-disabled'; - Util.setTooltip(mutedIndicator, + var mutedIndicator = document.createElement('i'); + mutedIndicator.className = 'icon-camera-disabled'; + Util.setTooltip(mutedIndicator, "Participant has
stopped the camera.", "top"); - videoMutedSpan.appendChild(mutedIndicator); + videoMutedSpan.appendChild(mutedIndicator); + } + var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted'); + videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted'); + videoMutedSpan.css({right: ((audioMutedSpan.length > 0)?'30px':'0px')}); } }; @@ -746,17 +747,14 @@ var VideoLayout = (function (my) { } } else { - var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted'); - + if(audioMutedSpan.length > 0 ) + return; audioMutedSpan = document.createElement('span'); audioMutedSpan.className = 'audioMuted'; Util.setTooltip(audioMutedSpan, - "Participant is muted", - "top"); + "Participant is muted", + "top"); - if (videoMutedSpan) { - audioMutedSpan.right = '30px'; - } $('#' + videoSpanId)[0].appendChild(audioMutedSpan); var mutedIndicator = document.createElement('i');