From 6d91551f59cc277d60257721f9d3d900473354c7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 3 May 2021 13:06:42 +0200 Subject: [PATCH] use onAddTrack instead of deprecated onAddStream --- .../conversations/xmpp/jingle/WebRTCWrapper.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java index e518d3d69..7b9caa66c 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java @@ -136,13 +136,6 @@ public class WebRTCWrapper { @Override public void onAddStream(MediaStream mediaStream) { Log.d(EXTENDED_LOGGING_TAG, "onAddStream(numAudioTracks=" + mediaStream.audioTracks.size() + ",numVideoTracks=" + mediaStream.videoTracks.size() + ")"); - final List videoTracks = mediaStream.videoTracks; - if (videoTracks.size() > 0) { - remoteVideoTrack = videoTracks.get(0); - Log.d(Config.LOGTAG, "remote video track enabled?=" + remoteVideoTrack.enabled()); - } else { - Log.d(Config.LOGTAG, "no remote video tracks found"); - } } @Override @@ -164,10 +157,9 @@ public class WebRTCWrapper { public void onAddTrack(RtpReceiver rtpReceiver, MediaStream[] mediaStreams) { final MediaStreamTrack track = rtpReceiver.track(); Log.d(EXTENDED_LOGGING_TAG, "onAddTrack(kind=" + (track == null ? "null" : track.kind()) + ",numMediaStreams=" + mediaStreams.length + ")"); - if (track != null) { - Log.d(EXTENDED_LOGGING_TAG,"onAddTrack(class="+track.getClass().getName()+")"); + if (track instanceof VideoTrack) { + remoteVideoTrack = (VideoTrack) track; } - } @Override