title: Twilio room does not disconnect / Webcam LED remains on
body: <p>I am implementing twilio video into my js application. The behavior I would like is that should the remote participant disconnect from the room the local participant should also leave the room and the webcam should deactivate.</p>
  
  <p>However what is happening is that the participant leaves and the webcam LED is still on and it still seems to stream to twilio until I close the browser.</p>
  
  <p>How would I go about resolving this?</p>
  
  <pre><code>   function connectVideo(accessToken){
  
              const Video = Twilio.Video;
  
              Video.connect(accessToken, { name: customerToken}).then(room =&gt; {
                  console.log('Connected to Room "%s"', room.name);
                  inCall = 1
  
                  room.participants.forEach(participantConnected);
                  room.on('participantConnected', participantConnected);
                  room.once('participantDisconnected', participant =&gt; {
                      console.log(`Participant "${participant.identity}" has disconnected from the Room!`);
                      room.disconnect();
                     var div = document.getElementById(participant.sid);
                      div.remove()
                      inCall = 0
                  });
  
                  room.on('disconnected', room =&gt; {
                      // Detach the local media elements
                      room.localParticipant.tracks.forEach(publication =&gt; {
                          const attachedElements = publication.track.detach();
                          console.log("unsubscribed from: " + publication.track)
                          attachedElements.forEach(element =&gt; element.remove());
                      });
                  });
              });
  
              function participantConnected(participant) {
                  console.log('Participant "%s" connected', participant.identity);
                  const div = document.createElement('div');
                  div.id = participant.sid;
                  participant.on('trackSubscribed', track =&gt; trackSubscribed(div, track));
                  participant.on('trackUnsubscribed', trackUnsubscribed);
                  participant.tracks.forEach(publication =&gt; {
                      if (publication.isSubscribed) {
                          trackSubscribed(div, publication.track);
                      }
                  });
                  document.body.appendChild(div);
              }
              function trackSubscribed(div, track) {
                  div.appendChild(track.attach());
              }
  
              function trackUnsubscribed(track) {
                  track.detach().forEach(element =&gt; element.remove());
              }
          }
  </code></pre>