Jump to content
  • 0

Cam remains always on


elia pimpinicchio
 Share

Question

Hi,

i'm develop a SPA which have integrated a conference page, to have a video call. 
the problem is that when i go to videocall and after come back to my profile, the cam remain always on (i see this because alienware have near the webcam a led, and this remains always on).

Is there a way to turn off the camera when i change page of my application??

Best Regards.

Elia Pimpinicchio
Link to comment
Share on other sites

  • Answers 3
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

3 answers to this question

Recommended Posts

  • 0

Hi,

We are getting the camera with getUserMedia of JavaScript in our example pages. Let's say you take the stream as localstream;

localstream.getTracks()[0].stop();

will stop the camera track. 

 

I hope this will help you
Thanks
Link to comment
Share on other sites

  • 0
Hi,

if i want, after the stop, to restart the camera track? 
Because on the documentation  of  getVideoTrack i haven't seen the start() method. 

my scope is to turn off the camera when people click on turn off, and the dual situation. My problem at this moment is that when i stop track, i can't restart this.

In which way can I solve this problem?

Best Regards.

Elia

Link to comment
Share on other sites

  • 0

Hi,

I assume you keep your local stream in a variable since we stopped using localstream.getTracks()[0].stop(); 

After this you can use this code to enable track again;

var track = localStream.getVideoTracks()[0];
track.enabled = true;

At the worst scenario you can call getUserMedia again to restart the camera.

I hope this may help you.
Tahir
Link to comment
Share on other sites

 Share

×
×
  • Create New...