Pārlūkot izejas kodu

fix(TPC): Force reneg when user unmutes the first time.

This ensures that the source signaling is sent before the mute state is sent in presence. Jicofo relies on mute state from presence to check if the sender limit has been reached.
dev1
Jaya Allamsetty 3 gadus atpakaļ
vecāks
revīzija
84b06835a9
1 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 5
    1
      modules/RTC/TraceablePeerConnection.js

+ 5
- 1
modules/RTC/TraceablePeerConnection.js Parādīt failu

1987
         return Promise.resolve();
1987
         return Promise.resolve();
1988
     }
1988
     }
1989
 
1989
 
1990
+    // If a track is being added to the peerconnection for the first time, we want the source signaling to be sent to
1991
+    // Jicofo before the mute state is sent over presence. Therefore, trigger a renegotiation in this case.
1992
+    const negotiationNeeded = Boolean(!oldTrack || !this.localTracks.has(oldTrack?.rtcId));
1993
+
1990
     if (this._usesUnifiedPlan) {
1994
     if (this._usesUnifiedPlan) {
1991
         logger.debug(`${this} TPC.replaceTrack using unified plan`);
1995
         logger.debug(`${this} TPC.replaceTrack using unified plan`);
1992
         const mediaType = newTrack?.getType() ?? oldTrack?.getType();
1996
         const mediaType = newTrack?.getType() ?? oldTrack?.getType();
2016
                     : this.tpcUtils.setEncodings(newTrack);
2020
                     : this.tpcUtils.setEncodings(newTrack);
2017
 
2021
 
2018
                 // Renegotiate only in the case of P2P. We rely on 'negotiationeeded' to be fired for JVB.
2022
                 // Renegotiate only in the case of P2P. We rely on 'negotiationeeded' to be fired for JVB.
2019
-                return configureEncodingsPromise.then(() => this.isP2P);
2023
+                return configureEncodingsPromise.then(() => this.isP2P || negotiationNeeded);
2020
             });
2024
             });
2021
     }
2025
     }
2022
 
2026
 

Notiek ielāde…
Atcelt
Saglabāt