Twilio room does not disconnect / Webcam LED remains on
snippet in javascript

Twilio room does not disconnect / Webcam LED remains on

user4677

room.localParticipant.tracks.forEach(publication => {
    publication.track.stop();
    const attachedElements = publication.track.detach();
    console.log("unsubscribed from: " + publication.track)
    attachedElements.forEach(element => element.remove());
});