diff --git a/web/libs/js/dash2.config.js b/web/libs/js/dash2.config.js index 280a8693..76352beb 100644 --- a/web/libs/js/dash2.config.js +++ b/web/libs/js/dash2.config.js @@ -97,10 +97,8 @@ $.ccio.form.details=function(e){ }); e.f.find('[name="details"]').val(JSON.stringify(e.ar)); }; -$('body').one('click',function(){ - window.hadFocus = true -}) $(document).ready(function(e){ + //check switch UI e.o=$.ccio.op().switches; if(e.o){ diff --git a/web/libs/js/dash2.elementbuilder.js b/web/libs/js/dash2.elementbuilder.js index a158759b..7bda74de 100644 --- a/web/libs/js/dash2.elementbuilder.js +++ b/web/libs/js/dash2.elementbuilder.js @@ -303,27 +303,15 @@ $.ccio.tm=function(x,d,z,user){ el.muted = "muted" }) }else{ - var hasFocus = $.ccio.windowFocus && hadFocus - $.each($.ccio.mon,function(frontId,monitor){ - setTimeout(() => { - var monitorId = monitor.mid - var muted = monitorMutes[monitorId] + $.each(monitorMutes,function(monitorId,choice){ + if(choice === 1){ try{ var vidEl = $('.monitor_item[mid="' + monitorId + '"] video')[0] - if(vidEl.length === 0)return; - if(muted === 1){ - vidEl.muted = true - }else{ - if(hasFocus){ - vidEl.muted = false - }else{ - console.error('User must have window active to unmute.') - } - } + vidEl.muted = true }catch(err){ - // console.log(err) + } - },2000) + } }) } break; diff --git a/web/libs/js/dash2.elements.js b/web/libs/js/dash2.elements.js index ed69bd51..b4492aa4 100644 --- a/web/libs/js/dash2.elements.js +++ b/web/libs/js/dash2.elements.js @@ -258,11 +258,7 @@ $(document).ready(function(e){ vidEl.muted = true }else{ if(masterMute !== 1){ - if($.ccio.windowFocus && hadFocus){ - vidEl.muted = false - }else{ - console.error('User must have window active to unmute.') - } + vidEl.muted = false } } var volumeIcon = monitorMutes[monitorId] !== 1 ? 'volume-up' : 'volume-off'