Merge pull request #1388 from ZoneMinder/reload_stream_on_error

try to reload the image stream on error.
This commit is contained in:
Andrew Bauer 2016-04-04 20:57:48 -05:00
commit a0e6c004a2
1 changed files with 6 additions and 1 deletions

View File

@ -210,8 +210,13 @@ function getStreamCmdResponse( respObj, respText )
$('enableDisableAlarms').removeClass( 'hidden' ); $('enableDisableAlarms').removeClass( 'hidden' );
} }
} }
else else {
checkStreamForErrors("getStreamCmdResponse",respObj);//log them checkStreamForErrors("getStreamCmdResponse",respObj);//log them
// Try to reload the image stream.
var streamImg = document.getElementById('liveStream');
if ( streamImg )
streamImg.src = streamImg.src.replace(/rand=\d+/i,'rand='+Math.floor((Math.random() * 1000000) ));
}
var streamCmdTimeout = statusRefreshTimeout; var streamCmdTimeout = statusRefreshTimeout;
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT ) if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )