|
@@ -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
|
|