TheSpaghettiDetective / OctoPrint-Obico

GNU Affero General Public License v3.0
138 stars 42 forks source link

[Feature] Add button to Obico app/window to prevent/delay video streaming timeout #175

Open puterboy opened 2 years ago

puterboy commented 2 years ago

Currently, whenever I hide or close the window in which Obico is running and then return to the window, the video stream stalls while buffer as presumably the streaming was interrupted while the window wasn't active.

I understand why this feature may be important (even critical) when streaming remotely when bandwidth is limited/costly -- especially if using Obico cloud.

However, if you are running at home using your own local Obico-server, one should be able to override this feature and keep the streaming going all the time.

It's especially annoying when even a momentary alt-tab away from the Obico browser tab causes the stream to re-buffer -- which takes about 3-5 seconds.

Ideally, have options as follows in the Obico UI allowing for on-the-fly configuration of the following behaviors:

  1. Current behavior - stop streaming when tab/app inactive
  2. Stream forever
  3. Stop streaming
  4. Stream only when printing
  5. Continue streaming for user-configurable X minutes after tab/app is inactive.
kennethjiang commented 2 years ago

I can't reproduce it based what you described here Please list the steps to reproduce so that we can reproduce it.

puterboy commented 2 years ago

I'm not doing anything special that I know of... but this is my current context.

If this is not the intended behavior, happy to help troubleshoot. In particular, is there any easy way to access the Obico server stream directly (without the Obico app) - can I view it in my browser directly? This would help separate my Obico server from the Obico client code running in the browser or app.

kennethjiang commented 2 years ago
  • Obico (whether run in a browser tab or as an Android app) experiences a buffering delay (with white circle spinning) whenever the tab or app is activated/re-activated. The delay on the app is about 1 sec, in the browser about 3

So the stream will resume after a brief period of showing the spinner, correct? If so, it is the expected behavior.

puterboy commented 2 years ago
  • Obico (whether run in a browser tab or as an Android app) experiences a buffering delay (with white circle spinning) whenever the tab or app is activated/re-activated. The delay on the app is about 1 sec, in the browser about 3

So the stream will resume after a brief period of showing the spinner, correct? If so, it is the expected behavior.

I know it is expected :) -- hence my labeling as a FEATURE request rather than bug.

I can even understand why such pausing and restarting may be desirable in some situations but my point is that it is a PITA in others.

Perhaps when you are away from your LAN or if you are using the paid Obico Cloud service, saving bandwidth is important and waiting for the stream to restart is a necessary compromise.

But I typically access Obico from my LAN where I keep it running in a browser tab and frequently tab back-and-forth to check on it. Waiting a few seconds for the stream to resume is frustrating and serves no purpose on my LAN where bandwidth is not an issue.

I think Obico is a wonderful piece of software -- but there are some seemingly simple changes that would allow for user configuration of certain very simple and standard behaviors that I think would vastly expand the usability of the software with minimal (relatively speaking) changes to the code. But I understand if the devs are not interested in prioritizing other use cases (and for myself, it's trivial for me to edit the code and override hard-wired options now that I have figured most of it out -- but I am filing these requests because I think easy configurability would be great for other users)

kennethjiang commented 2 years ago

I'm not sure how many users will be willing to have the streaming going all the time just to cut a couple seconds of pause. Changing it is not hard. The relevant code is: https://github.com/TheSpaghettiDetective/obico-server/blob/release/frontend/src/components/StreamingBox.vue#L109 . Feel free to submit a PR that:

  1. Makes a configurable feature to have always-on streaming.
  2. Makes the configuration hidden from the main UI since it's not a frequent control for most users (unless you can prove otherwise), while discoverable enough.