Close Camera in React Kurento Utils

83 views
Skip to first unread message

AV

unread,
Feb 5, 2021, 10:36:34 AM2/5/21
to kurento
I am using React Kurento Utils package, I am using get user media when the component mounts, but when I try to stop the camera when component unmount camera's green light is still working. How can I stop the camera?

Claudio Destro

unread,
Feb 5, 2021, 10:43:01 AM2/5/21
to kur...@googlegroups.com
You have to stop each stream in the returned MediaStream

    const ms = await navigator.mediaDevices.getUserMedia(constraints);;
    ...
    ms.getTracks().forEach(t => t.stop());


Il giorno ven 5 feb 2021 alle ore 16:36 AV <coder...@gmail.com> ha scritto:
I am using React Kurento Utils package, I am using get user media when the component mounts, but when I try to stop the camera when component unmount camera's green light is still working. How can I stop the camera?

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/4664cbb5-7ab6-4a96-9bad-90033bcb1006n%40googlegroups.com.

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione. Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by returning e-mail. Thank you.

Rispetta l'ambiente. Non stampare questa mail se non è necessario. 
Please consider the environment before printing this.

Reply all
Reply to author
Forward
0 new messages