diff --git a/web/js/MonitorStream.js b/web/js/MonitorStream.js index bcf9321b2..a10d90008 100644 --- a/web/js/MonitorStream.js +++ b/web/js/MonitorStream.js @@ -17,11 +17,22 @@ function MonitorStream(monitorData) { this.refresh = monitorData.refresh; this.start = function(delay) { // Step 1 make sure we are streaming instead of a static image - var stream = $j('#liveStream'+this.id)[0]; - if ( ! stream ) { + var stream = $j('#liveStream'+this.id); + if (!stream.length) { console.log('No live stream'); return; } + stream = stream[0]; + if ( !stream ) { + console.log('No live stream'); + return; + } + if ( !stream.src ) { + // Website Monitors won't have an img tag + console.log('No src for #liveStream'+this.id); + console.log(stream); + return; + } src = stream.src.replace(/mode=single/i, 'mode=jpeg'); if ( -1 == src.search('connkey') ) { src += '&connkey='+this.connKey;