fluidd-core / fluidd

Fluidd, the klipper UI.
https://docs.fluidd.xyz
GNU General Public License v3.0
1.39k stars 425 forks source link

[v1.14.0] Camera feed is not stopped in Firefox when not visible #317

Closed LucidityCrash closed 2 years ago

LucidityCrash commented 3 years ago

Affected Version(s):

Platform:

(Information about your platform, like the OS or browser you are using.) Windows and Android using Firefox

Reproduction Steps:

Firefox on both Windows: Start camera feed and watch traffic on Pi using tcpdump. Collapse camera feed or navigtate to different tab and traffic continues until page reloaded.

Firefox on Android: Collapse camera feed or navigtate to different tab and traffic continues until page reloaded. Turning off the screen does not stop the feed traffic Disabling the camera in settings does not stop the feed traffic.

Chrome on Windows: Collapsing the camera pane or navigating to a new tab causes traffic to stop after a some time - not more than 30s on when changing tabs, but quicker on panel collapse.

Chrome on Android: Much slower to disconnect than Windows, seems to disconnect when collapsing the panel or turning off ghe screen, but not when changing tabs, and once you've changed tabs it doesn't seem to disconnect even if you go back to the main page and collapse the panel. Turning off the screen on the device does not appear to stop the stream when it is in this state.

Ramalama2 commented 3 years ago

Hi, im unsure if this has even something todo woth fluidd. The stream gets piped from mjpg-streamer, similar to an iframe.

And additionally to that the browser (changing tabs) behaviour, depends how the browser is setted to keep alive the session. If you turn off your display, the browser still runs... If you close the lid, the computer goes to standby or sth similar and the browser isn't active...

However, this doesn't looks for me like anything fluidd related. Cheers

LucidityCrash commented 3 years ago

However, this doesn't looks for me like anything fluidd related.

This : https://github.com/cadriel/fluidd/issues/32 and https://github.com/cadriel/fluidd/issues/107 would suggest otherwise

Ramalama2 commented 3 years ago

However, this doesn't looks for me like anything fluidd related.

This :

32 and #107

would suggest otherwise

Yes, and i don't know tbh how he does this 🤦 However, good to know, crossing fingers for you 👍

cadriel commented 3 years ago

I'll take another look at this.

Its a bit hacky the way this is implemented, because I essentially remove the src from the image when either the tab loses focus, or is otherwise collapsed - however, different browsers handle it differently.

The reality is that mjpeg is a less than ideal solution to streaming video tho - so we'll see where I end up.

matmen commented 2 years ago

I can't reproduce this on either Firefox or Chrome (both on Windows) using adaptive MJPG streaming. Is this still an issue?

matmen commented 2 years ago

Closing because of staleness. If this is still a problem, feel free to re-open.