Merge pull request #905 from nextcloud/fix-frozen-video-when-screen-is-shared

[v8.0.x] Fix frozen video when screen is shared
This commit is contained in:
Biswajit Das 2020-10-03 00:00:47 +01:00 committed by GitHub
commit 518d1ea62e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,11 +109,13 @@ public class MagicPeerConnectionWrapper {
magicDataChannel.registerObserver(new MagicDataChannelObserver());
if (isMCUPublisher) {
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.put("sessionId", sessionId);
EventBus.getDefault().post(new WebSocketCommunicationEvent("peerReadyForRequestingOffer", hashMap));
} else if (hasInitiated) {
} else if (!hasMCU && hasInitiated) {
peerConnection.createOffer(magicSdpObserver, sdpConstraints);
}