Revert "update monitor muting for modern browsers"

This reverts commit 55cec40869.
mitchross-coral-installer-update
Moe Alam 2020-12-01 07:26:58 -08:00
parent 7442b999d7
commit 628df16ae0
3 changed files with 7 additions and 25 deletions

View File

@ -97,10 +97,8 @@ $.ccio.form.details=function(e){
}); });
e.f.find('[name="details"]').val(JSON.stringify(e.ar)); e.f.find('[name="details"]').val(JSON.stringify(e.ar));
}; };
$('body').one('click',function(){
window.hadFocus = true
})
$(document).ready(function(e){ $(document).ready(function(e){
//check switch UI //check switch UI
e.o=$.ccio.op().switches; e.o=$.ccio.op().switches;
if(e.o){ if(e.o){

View File

@ -303,27 +303,15 @@ $.ccio.tm=function(x,d,z,user){
el.muted = "muted" el.muted = "muted"
}) })
}else{ }else{
var hasFocus = $.ccio.windowFocus && hadFocus $.each(monitorMutes,function(monitorId,choice){
$.each($.ccio.mon,function(frontId,monitor){ if(choice === 1){
setTimeout(() => {
var monitorId = monitor.mid
var muted = monitorMutes[monitorId]
try{ try{
var vidEl = $('.monitor_item[mid="' + monitorId + '"] video')[0] var vidEl = $('.monitor_item[mid="' + monitorId + '"] video')[0]
if(vidEl.length === 0)return; vidEl.muted = true
if(muted === 1){
vidEl.muted = true
}else{
if(hasFocus){
vidEl.muted = false
}else{
console.error('User must have window active to unmute.')
}
}
}catch(err){ }catch(err){
// console.log(err)
} }
},2000) }
}) })
} }
break; break;

View File

@ -258,11 +258,7 @@ $(document).ready(function(e){
vidEl.muted = true vidEl.muted = true
}else{ }else{
if(masterMute !== 1){ if(masterMute !== 1){
if($.ccio.windowFocus && hadFocus){ vidEl.muted = false
vidEl.muted = false
}else{
console.error('User must have window active to unmute.')
}
} }
} }
var volumeIcon = monitorMutes[monitorId] !== 1 ? 'volume-up' : 'volume-off' var volumeIcon = monitorMutes[monitorId] !== 1 ? 'volume-up' : 'volume-off'