Hi All,
I'm using the forge of Camera.Reactive, but I can't find how to close the web camera after using. The camera is still open even after I change screen.
I tried this forum's solution which uses javascript, but it doesn't work for me.
https://www.outsystems.com/forums/discussion/60151/close-reactive-camera/
How can we close the camera in Camera.Reactive?
Hi Yusuke Oki,
Please enclose in container and use the visibility option and define where u want to show or collapse the container that contains Camera Reactive component.
Regards,
Faiz Khan.
Hi Faiz Khan,
Thank you for your replying.
I've tried to enclose in container and define visibility option.
However, After a reactive camera component is visible at once, even if the camera component becomes invisible, my laptop's web camera remains working.
What I'd like to do is turning off my laptop's web camera after a camera component becoming invisible.
Yusuke
Hi Yusuki,I can turn the camera off with this script.
var mediaStream = video.srcObject;
var tracks = mediaStream.getTracks();
tracks[0].stop();
tracks.forEach(function(track) { track.stop()})Please run this script through some button action.Thanks.
Hi Suriya
I had tried the javascript you shared, but it didn't work basically.
However, after running the javascript and opening developer tools of Web browsers(Chrome and Microsoft Edge) in a few times, I can turns off my pc camera.
Do you have any ideas about this situation?
Best Regards,
Hi Yusuke,
I use this Javascript code to close it:
stream.getTracks().forEach(function(track) {
track.stop();
});
It works fine for me, hope work for you.
Best regards,
Alexis Rodriguez.
hi all, as I have seen in the article here is the camera closing problem. Change the Switch Camera Icon to a Dropdown Menu to access all the device's cameras. Modify your IOS behavior. Fullscreen mode does not open when the Camera is opened. before some months I got the same problem so I took the monitor for better results.
Hello Yusuke Oki,
The solution mentioned by Alexis is the right solution as I also have used the same javascript to close the camera after clicking the picture and saving it.Regards Avinash