Stop camera doesn't turn off the camera
iamajvillalobos opened this issue · 9 comments
The stop()
method doesn't seem to turn off the camera. See this video https://drive.google.com/file/d/1ASBcPxJ1i1GrU0sCjNgrEloTi46TciCL/view?usp=sharing
@iamarmanjon Thank You. This should now be fixed in v1.2.5
Trying this on my project and also on the demo. But it seems the closing of the tracks is inconsistent. I'm not sure actually if this is a problem with the HTML5 API. Because alternatively, I tried to close the tracks myself. Finding the video
tag, getting the srcObject
and closing the tracks myself. It works inconsistently too.
Here's a video again for demonstration:
https://drive.google.com/file/d/1R-OimOPm49yRLP-nlsjKqJ2oZ758He5U/view?usp=sharing
@iamarmanjon I had the same issue while testing, it seems the very first time when the page loads and you try to stop it the webcam doesn't seem to stop. If you start and stop it again without refreshing it'll stop.
In both cases it stops the track and empties the video srcObject. I am not entirely sure what else needs to happen in order to properly stop it. The API i used in the component is a copy paste from the HTML5 API shown here:
https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop#Example
I am open for suggestions or help in trying to fix this.
Thanks for putting some time into it. I will do some research on my end too. Will update you.
Any solution for that?
I have the same issue. Any research?
Any solution on this? Tried to stop the tracks manually too but no success... I notice some strange behavior on opening chrome DevTools. Sometimes turns off the webcam after i call the stop function on tracks.
may you can try this one, its works as expected.
i am make own camera component based this in my project.
https://webrtc.github.io/samples/src/content/devices/input-output/