From 2c48d83860c2ee652e3a0a5008aeeab077833673 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 9 Aug 2022 15:17:40 -0500 Subject: [PATCH] Properly hide Janus options when Janus is disabled for a given monitor. --- web/skins/classic/views/js/monitor.js | 10 +++++++++- web/skins/classic/views/monitor.php | 2 -- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/views/js/monitor.js b/web/skins/classic/views/js/monitor.js index f36f3e2b3..a80ea031f 100644 --- a/web/skins/classic/views/js/monitor.js +++ b/web/skins/classic/views/js/monitor.js @@ -262,18 +262,26 @@ function initPage() { window.location.assign('?view=console'); }); - //manage the Janus audio check + //manage the Janus settings div if (document.getElementsByName("newMonitor[JanusEnabled]")[0].checked) { document.getElementById("FunctionJanusAudioEnabled").hidden = false; + document.getElementById("FunctionJanusProfileOverride").hidden = false; + document.getElementById("FunctionJanusUseRTSPRestream").hidden = false; } else { document.getElementById("FunctionJanusAudioEnabled").hidden = true; + document.getElementById("FunctionJanusProfileOverride").hidden = true; + document.getElementById("FunctionJanusUseRTSPRestream").hidden = true; } document.getElementsByName("newMonitor[JanusEnabled]")[0].addEventListener('change', function() { if (this.checked) { document.getElementById("FunctionJanusAudioEnabled").hidden = false; + document.getElementById("FunctionJanusProfileOverride").hidden = false; + document.getElementById("FunctionJanusUseRTSPRestream").hidden = false; } else { document.getElementById("FunctionJanusAudioEnabled").hidden = true; + document.getElementById("FunctionJanusProfileOverride").hidden = true; + document.getElementById("FunctionJanusUseRTSPRestream").hidden = true; } }); diff --git a/web/skins/classic/views/monitor.php b/web/skins/classic/views/monitor.php index e5b88aec8..644e8f2fb 100644 --- a/web/skins/classic/views/monitor.php +++ b/web/skins/classic/views/monitor.php @@ -1180,7 +1180,6 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor ?> -
JanusAudioEnabled() ? ' checked="checked"' : '' ?>/> @@ -1211,7 +1210,6 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor ?> -
DefaultRate()); ?>