Do not create offer for received screen share

When the HPB is not used and a PeerConnectionWrapper is created it
always sent an offer if the local session ID is higher than the remote
session ID. However, in the case of screen shares the participant
sharing the screen always sends an offer, no matter the session ID.
Therefore, when that offer was received the new PeerConnectionWrapper
object sent a new offer, which in turn created an extra connection in
the browser.

Although the screen share connection happens to work the underlying
behaviour was wrong, so now no offer is sent for received screen share
connections and it is always waited until the offer is sent by the other
participant.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2023-01-12 17:52:21 +01:00 committed by Marcel Hibbe (Rebase PR Action)
parent 66f987cefb
commit 53c9c1cf8c

View File

@ -181,7 +181,9 @@ public class PeerConnectionWrapper {
// set the recipient session ID in the assembled call message.
NCSignalingMessage ncSignalingMessage = createBaseSignalingMessage("requestoffer");
signalingMessageSender.send(ncSignalingMessage);
} else if (!hasMCU && hasInitiated) {
} else if (!hasMCU && hasInitiated && "video".equals(this.videoStreamType)) {
// If the connection type is "screen" the client sharing the screen will send an
// offer; offers should be created only for videos.
peerConnection.createOffer(magicSdpObserver, mediaConstraints);
}
}