Check RTSP stream selection control is valid

Add a check to make sure the RTSP Stream control is valid before adding the 'onchange' event to avoid breaking the other controls
This commit is contained in:
jaredb7
2023-04-08 14:13:44 +10:00
parent 56f168a280
commit 9988acfdbd
+2
View File
@@ -481,6 +481,7 @@ h1 {
<script>
var rtsp_stream_select = document.getElementById("rtsp_stream_select");
if (typeof (rtsp_stream_select) !== 'undefined' && rtsp_stream_select !== null) {
//When the dropdown selection is changed set the new value is settings, then restart the livestream service so it broadcasts newly selected RTSP stream
rtsp_stream_select.onchange = function () {
if (this.value !== 'undefined') {
@@ -524,6 +525,7 @@ rtsp_stream_select.onchange = function() {
}
}
}
}
var slider = document.getElementById("gain_input");
var output = document.getElementById("gain_value");