|
|
@@ -1961,6 +1961,17 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
|
|
1961
|
1961
|
.then(transceiver => {
|
|
1962
|
1962
|
oldTrack && this.localTracks.delete(oldTrack.rtcId);
|
|
1963
|
1963
|
newTrack && this.localTracks.set(newTrack.rtcId, newTrack);
|
|
|
1964
|
+
|
|
|
1965
|
+ // Update the local SSRC cache for the case when one track gets replaced with another and no
|
|
|
1966
|
+ // renegotiation is triggered as a result of this.
|
|
|
1967
|
+ if (oldTrack && newTrack) {
|
|
|
1968
|
+ const oldTrackSSRC = this.localSSRCs.get(oldTrack.rtcId);
|
|
|
1969
|
+
|
|
|
1970
|
+ if (oldTrackSSRC) {
|
|
|
1971
|
+ this.localSSRCs.delete(oldTrack.rtcId);
|
|
|
1972
|
+ this.localSSRCs.set(newTrack.rtcId, oldTrackSSRC);
|
|
|
1973
|
+ }
|
|
|
1974
|
+ }
|
|
1964
|
1975
|
const mediaActive = mediaType === MediaType.AUDIO
|
|
1965
|
1976
|
? this.audioTransferActive
|
|
1966
|
1977
|
: this.videoTransferActive;
|