Browse Source

fix(JingleSessionPC) Do not force track removal at pc level on user leave.

When a user leaves, the ssrcs associated with the ep are removed from the remote description and a renegotiation is forced. The browser then fires 'removetrack' event on the associated MediaStream when sRD is called with ssrcs removed. The remote track is then disposed of in the event handler. Therefore, there is no need to delete the tracks at the TPC level before renegotiation. This also prevents the 'Removed track not found for stream' events from showing up in the browser console log.
dev1
Jaya Allamsetty 3 years ago
parent
commit
161835ec58
2 changed files with 2 additions and 3 deletions
  1. 1
    2
      modules/xmpp/JingleSessionPC.js
  2. 1
    1
      types/auto/modules/xmpp/JingleSessionPC.d.ts

+ 1
- 2
modules/xmpp/JingleSessionPC.js View File

@@ -1720,7 +1720,7 @@ export default class JingleSessionPC extends JingleSession {
1720 1720
     }
1721 1721
 
1722 1722
     /**
1723
-     * Handles the deletion of the remote tracks and SSRCs associated with a remote endpoint.
1723
+     * Handles the deletion of SSRCs associated with a remote user from the remote description when the user leaves.
1724 1724
      *
1725 1725
      * @param {string} id Endpoint id of the participant that has left the call.
1726 1726
      * @returns {void}
@@ -1730,7 +1730,6 @@ export default class JingleSessionPC extends JingleSession {
1730 1730
             const removeSsrcInfo = this.peerconnection.getRemoteSourceInfoByParticipant(id);
1731 1731
 
1732 1732
             if (removeSsrcInfo.length) {
1733
-                this.peerconnection.removeRemoteTracks(id);
1734 1733
                 const oldLocalSdp = new SDP(this.peerconnection.localDescription.sdp);
1735 1734
                 const newRemoteSdp = this._processRemoteRemoveSource(removeSsrcInfo);
1736 1735
 

+ 1
- 1
types/auto/modules/xmpp/JingleSessionPC.d.ts View File

@@ -393,7 +393,7 @@ export default class JingleSessionPC extends JingleSession {
393 393
      */
394 394
     removeRemoteStream(elem: any): void;
395 395
     /**
396
-     * Handles the deletion of the remote tracks and SSRCs associated with a remote endpoint.
396
+     * Handles the deletion of SSRCs associated with a remote user from the remote description when the user leaves.
397 397
      *
398 398
      * @param {string} id Endpoint id of the participant that has left the call.
399 399
      * @returns {void}

Loading…
Cancel
Save