Skip to content

Commit

Permalink
Merge pull request ZoneMinder#1388 from ZoneMinder/reload_stream_on_e…
Browse files Browse the repository at this point in the history
…rror

try to reload the image stream on error.
  • Loading branch information
Andrew Bauer committed Apr 5, 2016
2 parents 1f62982 + 123a1a8 commit a0e6c00
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion web/skins/classic/views/js/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,13 @@ function getStreamCmdResponse( respObj, respText )
$('enableDisableAlarms').removeClass( 'hidden' );
}
}
else
else {
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;
if ( alarmState == STATE_ALARM || alarmState == STATE_ALERT )
Expand Down

0 comments on commit a0e6c00

Please sign in to comment.