title: WebRTC/getUserMedia: How to properly mute local video?
body: <p>I'm trying to implement the functionality for muting the local video <code>MediaStreamTrack</code> in my WebRTC application. Here's how I'm approaching this:</p>
  
  <pre><code>function muteVideo() {
    if (this._localStream &amp;&amp; this._localStream.getVideoTracks().length &gt; 0) {
      this._localStream.getVideoTracks()[0].enabled = false;
    }
  }
  </code></pre>
  
  <p>In Firefox, the <code>&lt;video&gt;</code> element to which the local stream is attached correctly renders blackness on mute. In Chrome, blackness is not rendered but the picture freezes. However, in both browsers, <strong>the camera's green light stays on</strong>, which is clearly undesired behavior. (I want my users to see that the application actually <em>disconnects</em> from the camera on video mute.)</p>
  
  <p>The camera's light goes off if I do <code>this._localStream.stop()</code>, but then the audio goes off, too.</p>
  
  <p>The <a href="http://dev.w3.org/2011/webrtc/editor/getusermedia.html#methods-1" rel="noreferrer">current draft</a> of the Media Capture spec mentions the <code>MediaStreamTrack.stop()</code> method but it currently seems unimplemented in Chrome and Firefox.</p>
  
  <p>So is there a way to mute local video while:</p>
  
  <ol>
  <li>Making the camera's light go off</li>
  <li>Not losing the audio track?</li>
  </ol>