Closed korskantevin closed 1 year ago
You could try something like this (not tested though):
interval = 1000;
(function p() {
jQuery.get('cgi-bin/snapshot.sh?base64=yes', function(data) {
image = document.getElementById('imgSnap');
image.src = 'data:image/jpeg;base64,' + data;
}).always(function() {
setTimeout(p, interval);
});
})();
Works great! Thank you!
Added to the master. Thank you.
There is setTimeout function set to interval=1000 in all.js. in my case snapshot answer is only after 3 seconds. And "top" command via SSH says 85% user CPU usage on camera. So I think more accurate is to call on next snapshot only after receiving previous or get an error of previous call.
That is why in my case PTZ is not working оn web interface, but working fine via SSH "ptz -a right" which is ptz_h by default