|
@@ -1944,7 +1944,11 @@ TraceablePeerConnection.prototype.replaceTrack = function(oldTrack, newTrack) {
|
1944
|
1944
|
// Jicofo before the mute state is sent over presence. Therefore, trigger a renegotiation in this case. If we
|
1945
|
1945
|
// rely on "negotiationneeded" fired by the browser to signal new ssrcs, the mute state in presence will be sent
|
1946
|
1946
|
// before the source signaling which is undesirable.
|
1947
|
|
- const negotiationNeeded = Boolean(!oldTrack || !this.localTracks.has(oldTrack?.rtcId));
|
|
1947
|
+ // Send the presence before signaling for a new screenshare source. This is needed for multi-stream support since
|
|
1948
|
+ // videoType needs to be availble at remote track creation time so that a fake tile for screenshare can be added.
|
|
1949
|
+ // FIXME - This check needs to be removed when the client switches to the bridge based signaling for tracks.
|
|
1950
|
+ const isNewTrackScreenshare = !oldTrack && newTrack?.getVideoType() === VideoType.DESKTOP;
|
|
1951
|
+ const negotiationNeeded = !isNewTrackScreenshare && Boolean(!oldTrack || !this.localTracks.has(oldTrack?.rtcId));
|
1948
|
1952
|
|
1949
|
1953
|
if (this._usesUnifiedPlan) {
|
1950
|
1954
|
logger.debug(`${this} TPC.replaceTrack using unified plan`);
|