From 0de00184c8951e6446eead4f45dbd9bccc4e2d13 Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 5 Jul 2021 10:18:59 -0700 Subject: [PATCH] fix monitor mute --- web/assets/js/bs5.monitorsUtils.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/web/assets/js/bs5.monitorsUtils.js b/web/assets/js/bs5.monitorsUtils.js index 48777abd..4a240a86 100644 --- a/web/assets/js/bs5.monitorsUtils.js +++ b/web/assets/js/bs5.monitorsUtils.js @@ -466,17 +466,21 @@ function muteMonitorAudio(monitorId){ var monitorMutes = dashboardOptions().monitorMutes || {} monitorMutes[monitorId] = monitorMutes[monitorId] === 1 ? 0 : 1 dashboardOptions('monitorMutes',monitorMutes) - var vidEl = $('.monitor_item[mid="' + monitorId + '"] video')[0] - if(monitorMutes[monitorId] === 1){ - vidEl.muted = true - }else{ - if(masterMute !== 1){ - if($.ccio.windowFocus && hadFocus){ - vidEl.muted = false - }else{ - console.error('User must have window active to unmute.') + var vidEl = $('.monitor_item[data-mid="' + monitorId + '"] video')[0] + try{ + if(monitorMutes[monitorId] === 1){ + vidEl.muted = true + }else{ + if(masterMute !== 1){ + if($.ccio.windowFocus && hadFocus){ + vidEl.muted = false + }else{ + console.error('User must have window active to unmute.') + } } } + }catch(err){ + console.log(err) } var volumeIcon = monitorMutes[monitorId] !== 1 ? 'volume-up' : 'volume-off' $(this).find('i').removeClass('fa-volume-up fa-volume-off').addClass('fa-' + volumeIcon)