Bug 1524642 - Part 2: In getReceivers/Senders, do not include stopped transceivers. r=jib
authorByron Campen [:bwc] <docfaraday@gmail.com>
Wed, 13 Feb 2019 19:09:59 +0000
changeset 458998 804dc60558dfeeb179c9ecf36b777fc1472fbae7
parent 458997 1318991460b30a27bc2f43b14bccd6a274a7b5a3
child 458999 3507a9af7c90cd08ff79161156f1facffcb0b4f9
push id35554
push userrgurzau@mozilla.com
push dateThu, 14 Feb 2019 17:00:27 +0000
treeherdermozilla-central@db6bcdbe4040 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1524642
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524642 - Part 2: In getReceivers/Senders, do not include stopped transceivers. r=jib Depends on D19548 Differential Revision: https://phabricator.services.mozilla.com/D19685
dom/media/PeerConnection.js
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -1379,21 +1379,25 @@ class RTCPeerConnection {
   }
 
   getRemoteStreams() {
     this._checkClosed();
     return [...this._receiveStreams.values()];
   }
 
   getSenders() {
-    return this.getTransceivers().map(transceiver => transceiver.sender);
+    return this.getTransceivers()
+      .filter(transceiver => !transceiver.stopped)
+      .map(transceiver => transceiver.sender);
   }
 
   getReceivers() {
-    return this.getTransceivers().map(transceiver => transceiver.receiver);
+    return this.getTransceivers()
+      .filter(transceiver => !transceiver.stopped)
+      .map(transceiver => transceiver.receiver);
   }
 
   // test-only: get the current time using the webrtc clock
   mozGetNowInRtpSourceReferenceTime() {
     return this._impl.getNowInRtpSourceReferenceTime();
   }
 
   // test-only: insert a contributing source entry for a track