bp2008 / ui3

A powerful, modern HTML5 web interface for Blue Iris.
GNU Lesser General Public License v3.0
120 stars 18 forks source link

Is it possible to polish the process by which UI3 re-establishes a connection to the stream, in relation to full screen mode? #76

Closed adam-jones-net closed 2 years ago

adam-jones-net commented 3 years ago

I have a browser window open a lot of the time with UI3 running. I usually hibernate my PC and I find that when I turn it back on, the monitor in which this browser window was running in "full screen" mode is still running in full screen. However UI3 detects an issue with the stream and so just a couple of seconds after the computer returning to user control it seems that the JS logic within UI3 forces it to refresh the web url.

This works, in that the stream starts and off it goes again. However the problem is that by refreshing the entire page it makes most modern browsers come out of their full screen mode.

It would be great if this logic that detects a problem with the stream could try to re-establish the stream by other means without having to force reload the page thereby ending full screen mode.

I've seen this happen most in the situation above when I come out of hibernation but I think i've seen it happen other times as well.

bp2008 commented 3 years ago

I'll look into it. The issue is probably the session getting lost. So as long as credentials are saved via "Log in automatically", then it should be possible for UI3 to re-establish the session. The trick is, I never coded UI3 to do that before, hence the page refresh upon session loss. I don't know how many challenges this will unearth.

adam-jones-net commented 3 years ago

Thanks for looking at this. What I've just discovered right now having turned on and come back out of hibernation is that the full screen browser the computer went into hibernation with is still full screen when the computer comes back on. When I last used the computer it was day time so the video feed was naturally in day. It's now night time at my end.

I realised that there was a msg bottom right about the video feed being lost but just as that came up it did actually manage to refresh the feed because suddenly the frozen old day images were instantly replaced with a live feed showing the cameras at night time. So it seems that UI3 did recover itself. However the browser refresh command seemed to have already been sent and within one or two seconds the entire browser page reloaded, seemingly unnecessarily.

bp2008 commented 3 years ago

Do you have anonymous authentication enabled? It is normal for the video stream to resume because of that. The web server just disregards the expired session and assigns a new anonymous session to that request. I could write pages and pages about how inconvenient this is and make your eyes glaze over from the technical details. Suffice it to say, that particular behavior is at the root of countless hours of frustration and is the main reason UI3 just reloads itself rather than trying to recover without a reload.

adam-jones-net commented 3 years ago

This is a setting in Blue Iris itself? Can you guide me to where I can find it exactly ?

bp2008 commented 3 years ago

image

bp2008 commented 3 years ago

Note that turning off anonymous access is not going to improve UI3's behavior.

adam-jones-net commented 3 years ago

I have it set to all connections as in the screenshot, which is the setting I need.

adam-jones-net commented 2 years ago

Just to clarify, this was setup as you recommended and I still get these browser page reloads

bp2008 commented 2 years ago

UI3-168 has improved handling of session loss which does not require a page reload as long as you had your credentials saved in UI3/login page.

I'm not confident that it is bug-free, but it should be an improvement!

adam-jones-net commented 2 years ago

Ok thanks so much, I will check this out once live.

adam-jones-net commented 2 years ago

I've just upgraded a day or two ago to the latest Blue Iris and this seems to work! It's now very seamless when my PC comes out of hibernation and the already open browser re-establishes a connection to the BI server. Amazing, thanks so much!