mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Fix frozen video when screen is shared
When another participant shared the screen a new offer was requested. However, the offer was requested for the video instead of for the screen, which caused the HPB to stop the previous video connection and replace it with a new one. As receiving new offers for an existing connection is not properly handled the offer was applied to the existing peer connection, which caused the new offer to be ignored and the old peer connection to be kept (but frozen due to the HPB not sending more data for that connection). Requesting offers are not needed when the peer connection is a screen, as the HPB will automatically send the offers itself. Therefore, now offers are requested only when the connection is of "video" type. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
93c12a89de
commit
1321cb21a0
@ -109,11 +109,13 @@ public class MagicPeerConnectionWrapper {
|
|||||||
magicDataChannel.registerObserver(new MagicDataChannelObserver());
|
magicDataChannel.registerObserver(new MagicDataChannelObserver());
|
||||||
if (isMCUPublisher) {
|
if (isMCUPublisher) {
|
||||||
peerConnection.createOffer(magicSdpObserver, sdpConstraints);
|
peerConnection.createOffer(magicSdpObserver, sdpConstraints);
|
||||||
} else if (hasMCU) {
|
} else if (hasMCU && this.videoStreamType.equals("video")) {
|
||||||
|
// If the connection type is "screen" the client sharing the screen will send an
|
||||||
|
// offer; offers should be requested only for videos.
|
||||||
HashMap<String, String> hashMap = new HashMap<>();
|
HashMap<String, String> hashMap = new HashMap<>();
|
||||||
hashMap.put("sessionId", sessionId);
|
hashMap.put("sessionId", sessionId);
|
||||||
EventBus.getDefault().post(new WebSocketCommunicationEvent("peerReadyForRequestingOffer", hashMap));
|
EventBus.getDefault().post(new WebSocketCommunicationEvent("peerReadyForRequestingOffer", hashMap));
|
||||||
} else if (hasInitiated) {
|
} else if (!hasMCU && hasInitiated) {
|
||||||
peerConnection.createOffer(magicSdpObserver, sdpConstraints);
|
peerConnection.createOffer(magicSdpObserver, sdpConstraints);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user