How to determine the moment of breakage broadcast mjpg in the img?

As the element:
<img src="/cam.mjpg">
To determine the flow interrupted?
Event load is triggered when the displayed first frame, such as the events progress, stalled, suspend, loadend do not work.
The event error is triggered only if the original server responded with an error, if after a successful connection has been shut down, it does not work.
So far, the only option is to check every few seconds naturalWidth, which is changed to 0 when the stream is interrupted, and it is not always transmitted at the end of the blank image, it shows my last and then this method is also not working.
Perhaps this could be implemented somehow more right? Through the event which
March 12th 20 at 07:59
0 answer

Find more questions by tags ImagesHTMLJavaScript