in the GetHelp Section I came across this topic:https://discourse.octoprint.org/t/webcam-activates-leds/3361 and it made me think about implementing an energy saving feature in my lightslider plugin. So it only activates the led_strip when the webcamstream is viewed and turns it off if not.
As @supertaz mentioned in the discussion
I want to modify the components outside of the octoprint as little as possible (keep things simple so even a not so tech savvy person can use the plugin).
So I looked into the way octoprint pauses the webcam stream when the tab is not focused.
I found the js function which starts and stops the mjpg_stream.
From the looks of it, with reading the value of
webcamImage.attr("src"); or the return of the
webcamLoaded() function it should be possible to detect if the stream is running or stopped.
Can another plugin (which already places some buttons/slider on the control tab) read the mentioned value or call the function?
Better yet, can this plugin be notified when the value or return value of the function changes?