title: Invoking getLocalStreams on closed/closing peer connection
body: <p>I'm trying to invoke <code>getLocalStreams</code> on a "closing" peer connection. (I'm not sure if the peer connection is actually closed at this point).</p>
  
  <pre><code>peerConnection.onsignalingstatechange = function (e) {
      if (e.target.iceConnectionState === 'closed') {
        var streams = e.target.getLocalStreams();
        ...
      }
  }
  </code></pre>
  
  <p>However, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1259728" rel="nofollow">this seems to cause Firefox to crash</a>.</p>
  
  <p>I'm trying to access the local streams through the peer connection, so I don't have to keep track of them myself. (This doesn't seem far fetched, since the peer connections offers <code>getLocalStreams</code>).</p>
  
  <p>I'm wondering if there is another way to close any open streams, without keeping track of the streams myself?</p>
  
  <p>Before using the <code>peerConnection.onsignalingstatechange</code> event handler I tried accessing the streams (<code>getLocalStreams</code>) when the connection is actually closed and I get an <code>InvalidStateError: Peer connection is closed</code>.</p>