For my use case i needed to use the webcam in a web block inside the sidebar widget and when closing the sidebar the camera continues open. The component works fine when capturing a image and then closing the sidebar.
So the changes that i need to do was to create a OnDestroy event in the web block WebcamFrame to close the camera.
Other option was to send back the camera object to my sidebar using a event and close the stream when closing the sidebar. I let the event still in the component so that i can use the camera object to check if is active in the sidebar.
Fixed in the latest component version (July 24th 2023)