fix monitor mute and unmute in Live Grid

email-send-options-from-account
Moe 2021-11-08 14:47:25 -08:00
parent 9baca18736
commit 27bd0a60f7
2 changed files with 12 additions and 5 deletions

View File

@ -734,6 +734,13 @@ function setSwitchUIState(systemSwitch,toggleState){
}
}
var dashboardSwitchCallbacks = {}
function runDashboardSwitchCallback(systemSwitch){
var theSwitches = dashboardOptions().switches
var afterAction = dashboardSwitchCallbacks[systemSwitch]
if(afterAction){
afterAction(theSwitches[systemSwitch])
}
}
function dashboardSwitch(systemSwitch){
var theSwitches = dashboardOptions().switches
if(!theSwitches){
@ -748,8 +755,7 @@ function dashboardSwitch(systemSwitch){
theSwitches[systemSwitch]=1
}
dashboardOptions('switches',theSwitches)
var afterAction = dashboardSwitchCallbacks[systemSwitch]
if(afterAction)afterAction(theSwitches[systemSwitch])
runDashboardSwitchCallback(systemSwitch)
setSwitchUIState(systemSwitch,theSwitches[systemSwitch])
}

View File

@ -1078,12 +1078,13 @@ $(document).ready(function(e){
dashboardSwitchCallbacks.monitorMuteAudio = function(toggleState){
var monitorMutes = dashboardOptions().monitorMutes || {}
$('.monitor_item video').each(function(n,vidEl){
var monitorId = $(this).parents('[mid]').attr('mid')
var el = $(this)
var monitorId = el.parents('[data-mid]').attr('data-mid')
if(toggleState === 1){
vidEl.muted = true
el.attr('muted','muted')
}else{
if(monitorMutes[monitorId] !== 1){
vidEl.muted = false
el.removeAttr('muted')
}
}
})