var fullScreenCameraId = null;
var thresholdSlider = null;
var inProgress = false;
+var refreshInterval = 50; /* milliseconds */
/* utils */
return; /* no full screen for erroneous cameras */
}
- fullScreenCameraId = cameraId;
-
var width;
if (windowAspectRatio > aspectRatio) {
width = aspectRatio * Math.round(0.8 * windowHeight);
var cameraImg = cameraFrameDiv.find('img.camera');
cameraImg.load(function showFullScreenCamera() {
cameraFrameDiv.css('width', width);
+ fullScreenCameraId = cameraId;
runModalDialog({
title: cameraName,
return;
}
-
+
if (img.loading) {
img.loading++; /* increases each time the camera would refresh but is still loading */
- if (img.loading > 5) {
+ if (img.loading > 2 * 1000 / refreshInterval) { /* limits the retry at one every two seconds */
img.loading = 0;
}
else {
cameraFrames = $('div.page-container').find('div.camera-frame');
}
- var refreshInterval = 50;
-
cameraFrames.each(function () {
/* limit the refresh rate to 20 fps */
- var count = Math.max(1 / this.config['streaming_framerate'] * 1000 / refreshInterval);
+ var count = Math.max(1, 1 / this.config['streaming_framerate'] * 1000 / refreshInterval);
var serverSideResize = this.config['streaming_server_resize'];
var img = $(this).find('img.camera')[0];
if (img.error) {
/* in case of error, decrease the refresh rate to 1 fps */
- count = 10;
+ count = 1000 / refreshInterval;
}
if (this.refreshDivider < count) {