mikedmor / OctoPrint_MultiCam

Extends the Control tab of OctoPrint, allowing the ability to switch between multiple webcam feeds.
45 stars 19 forks source link

Selected cam reverts to default upon switching tabs #5

Closed delamitry closed 1 year ago

delamitry commented 5 years ago

The selected camera reverts to the default camera when switching between browser tabs without acknowledging the change. (i.e. button still shows previously selected cam depressed) I would think the expected behavior would be to persist the selected camera when switching between browser tabs. v0.2.6

mikedmor commented 5 years ago

Some recent updates might have broken that.

By default the camera always returns to the original cam when switching tabs, but the buttons should also reflect that. When i get some time ill revisit that and see if i cant get it working again. Thanks for the bug report.

Viginox commented 5 years ago

I encountered the same issue on the web interface as well as on TouchUI on the RPI3B+. But an interesting situation occurs, when only the second camera is connected to the Raspi. Then you can not change to this camera in the Web Interface, but when using TouchUI you can switch to it for a very short time. After that, it resets to the default camera.

xoxota99 commented 5 years ago

Seeing the same issue.

ndupont-net commented 5 years ago

Hi, I confirm the same behavior, which is not too bad in the full web interface but renders it useless in TouchUI.

totalitarian commented 4 years ago

Same issue here too :(

timur-tabi commented 4 years ago

I encountered the same issue on the web interface as well as on TouchUI on the RPI3B+. But an interesting situation occurs, when only the second camera is connected to the Raspi. Then you can not change to this camera in the Web Interface, but when using TouchUI you can switch to it for a very short time. After that, it resets to the default camera.

I believe this is a TouchUI bug. TouchUI doesn't support MultiCam. See https://github.com/BillyBlaze/OctoPrint-TouchUI/issues/371

BillyBlaze commented 4 years ago

The OP's issue doesn't seem like a TouchUI bug to me but default OctoPrint behaivor:

  1. Changing the browser tabs or OctoPrint tabs will invoke an event called 'onTabChange'.
  2. That 'onTabChange' calls disableWebCam when going away from OctoPrint or Controls Tab and reset the WebCam image to an empty stream
  3. When going back to OctoPrint or Controls Tab the 'onTabChange' calls enableWebCam and restores it back to the OctoPrints default webcam image.

Like @mikedmor said, the fix to the OP's issue is either updating the button back to the correct state. Or create a hook that will set the webcam stream directly to previously selected webcam.

@timur-tabi, is this what you mean with support for MultiCam in TouchUI?

ttabi commented 4 years ago

My point is that TouchUI does not appear to recognize that the webcam buttons are associated with the camera view. TouchUI separates the camera into its own tab, distinct from the Control panel tab.

BillyBlaze commented 4 years ago

Yeah, that is what I assumed the feature request was about, but since it was linked to another bug I needed clarification that we are on the same page.

shaelr commented 4 years ago

"Or create a hook that will set the webcam stream directly to previously selected webcam"

@Billyblaze would you happen to know how create said hook?

BillyBlaze commented 4 years ago

That is something for inside the plugin. I would just override the value of settings.webcam_streamUrl when changing a webcam stream instead of overriding the image source directly.

shaelr commented 4 years ago

@mikedmor any updates with this? would be nice to have this feature working?

AbuMaia commented 4 years ago

I'd like to second the request for updates. This is quite the annoying bug.

mikedmor commented 1 year ago

Fixed in version 0.4.0rc3