From f2292b49be48814d4c710a5e65d888c7ec6daee0 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 27 Feb 2024 16:46:22 +0100 Subject: [PATCH] add compatibility for janus 1.x Signed-off-by: Marcel Hibbe --- .../nextcloud/talk/webrtc/PeerConnectionWrapper.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java index 9fc1ce98e52..4c8196eb8f4 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/PeerConnectionWrapper.java @@ -398,8 +398,7 @@ public void onBufferedAmountChange(long l) { @Override public void onStateChange() { if (dataChannel != null && - dataChannel.state() == DataChannel.State.OPEN && - "status".equals(dataChannel.label())) { + dataChannel.state() == DataChannel.State.OPEN) { sendInitialMediaStatus(); } } @@ -535,10 +534,12 @@ public void onRemoveStream(MediaStream mediaStream) { @Override public void onDataChannel(DataChannel dataChannel) { - if ("status".equals(dataChannel.label()) || "JanusDataChannel".equals(dataChannel.label())) { - PeerConnectionWrapper.this.dataChannel = dataChannel; - PeerConnectionWrapper.this.dataChannel.registerObserver(new MagicDataChannelObserver()); + if (PeerConnectionWrapper.this.dataChannel != null) { + Log.w(TAG, "Data channel with label " + PeerConnectionWrapper.this.dataChannel.label() + + " exists, but received onDataChannel event for DataChannel with label " + dataChannel.label()); } + PeerConnectionWrapper.this.dataChannel = dataChannel; + PeerConnectionWrapper.this.dataChannel.registerObserver(new MagicDataChannelObserver()); } @Override