ソースを参照

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年前
コミット
84b06835a9
1個のファイルの変更5行の追加1行の削除
  1. 5
    1
      modules/RTC/TraceablePeerConnection.js

+ 5
- 1
modules/RTC/TraceablePeerConnection.js ファイルの表示

@@ -1987,6 +1987,10 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
1987 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 1994
     if (this._usesUnifiedPlan) {
1991 1995
         logger.debug(`${this} TPC.replaceTrack using unified plan`);
1992 1996
         const mediaType = newTrack?.getType() ?? oldTrack?.getType();
@@ -2016,7 +2020,7 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
2016 2020
                     : this.tpcUtils.setEncodings(newTrack);
2017 2021
 
2018 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
 

読み込み中…
キャンセル
保存