Skip to content

Commit

Permalink
add compatibility for janus 1.x
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
  • Loading branch information
mahibi committed Mar 4, 2024
1 parent abe9a9d commit fcf6c84
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fcf6c84

Please sign in to comment.