HABPanel Image Panel Holds Video Open After Refresh on iOS

Hello,

I am experiencing a highly specific issue with HABPanel and Zoneminder. Scenario:

In this scenario, for each refresh period seems to generate a new stream, but the old one remains active. If you have 4 streams on a one hour refresh, you end up with hundreds of streams after a day running, all to one device, all using bandwidth. This seems to only occur when using iOS devices, but occurs on both Chrome and Safari. I cannot replicate this issue when I visit the stream URL directly and refresh, therefore I believe this must be something going on with HABPanel.

Any ideas on how to troubleshoot further?

That is correct and not browser specific. I have fixed this on a local repo years ago. I might issue a PR for this.

Basically the <image> src attribute is replaced in an $interval call. So if you have set the interval to very small, let’s say, 500 ms, then the src is changed every half a second.

While this might work, imagine if you need to target a specific FPS such as 5 frames per second, or an interval of 200ms. The browser will make a call to the URL without checking if it was a fail or a success.

I had this issue on a small chromium browser running on a resource-limited device such as the OrangePi, and since calls are stacking up, it will not only eat your bandwidth, but also the device’s memory.

To fix this, the Angular code that does this should be replaced with a proper AJAX call, and not merely replacing the src of the <image>.

In short, it should not use $interval, but instead $timeout, where the timer (next call) is started by the $timeout when it failed or succeeded.

As a result, it is guaranteed that there will be at most only 1 call for that image at any given time.

1 Like

I apologize for the tardy reply - I somehow missed your response!

I don’t 100% understand how to attempt to resolve this on my installation. Do you have any suggestions on how I can resolve this when I am running openHAB as a Docker image?

If not, is there perhaps a bug report you could file against HABPanel to get this addressed, since you understand it in better detail (and have a working resolution)?