if camera_id not in config.get_camera_ids():
raise HTTPError(404, 'no such camera')
+ import time
+ time.sleep(100)
+
camera_config = config.get_camera(camera_id)
if camera_config['@proto'] != 'v4l2':
def on_response(response):
setTimeout(refreshCameraFrames, 100);
}
+function checkCameraErrors() {
+ /* properly triggers the onerror event on the cameras whose imgs were not successfully loaded,
+ * but the onerror event hasn't been triggered, for some reason (seems to happen in Chrome) */
+ var cameraFrames = $('div.page-container').find('img.camera');
+
+ cameraFrames.each(function () {
+ if (this.complete === true && this.naturalWidth === 0 && !this.error) {
+ $(this).error();
+ }
+ });
+
+ setTimeout(checkCameraErrors, 500);
+}
+
/* startup function */
initUI();
fetchCurrentConfig();
refreshCameraFrames();
+ checkCameraErrors();
});