Properly hide Janus options when Janus is disabled for a given monitor.

pull/3572/head
Jonathan Bennett 2022-08-09 15:17:40 -05:00
parent d41792ae00
commit 2c48d83860
2 changed files with 9 additions and 3 deletions

View File

@ -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;
}
});

View File

@ -1180,7 +1180,6 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
?>
</td>
</tr>
<div name="JanusSettings">
<tr id="FunctionJanusAudioEnabled">
<td class="text-right pr-3"><?php echo translate('Janus Live Stream Audio') ?></td>
<td><input type="checkbox" name="newMonitor[JanusAudioEnabled]" value="1"<?php echo $monitor->JanusAudioEnabled() ? ' checked="checked"' : '' ?>/>
@ -1211,7 +1210,6 @@ echo htmlSelect('newMonitor[OutputContainer]', $videowriter_containers, $monitor
?>
</td>
</tr>
</div>
<tr>
<td class="text-right pr-3"><?php echo translate('DefaultRate') ?></td>
<td><?php echo htmlSelect('newMonitor[DefaultRate]', $rates, $monitor->DefaultRate()); ?></td>