I am using mjpeg format to display stream from IP-camera. The problems is that stream is unstable and i don't know when exactly it starts and so i need somehow check image url if there is for example > 5 images and then load it. Something like this, but check url before adding it to the page.
At the moment i have:
$('#image_div').append('<img width="320" height="240" border="0" src="http://'+url+':'+port+'/?up" id="image">');
$('#image').load(function(){
console.log($(this));
});
In console it looks like: https://i.stack.imgur.com/iM88J.png
If there is no stream i receiving only one of this. So i need somehow check it before adding.