1

Please review following code and let me know what I need to change for showing remote video. Audio is playing fine. Working Latest library of Webrtc.In onAddStream method I have get Videotrack size of 1 but is not render in remoteVideoTrack addSink method.

 private PeerConnection createPeerConnection(PeerConnectionFactory peerConnectionFactory, boolean isLocal) {
    //
    PeerConnection.RTCConfiguration rtcConfig = new PeerConnection.RTCConfiguration(getServerList());
    //
    PeerConnection.Observer pcObserver = new CustomPeerConnectionObserver("localPeerCreation") {
        @Override
        public void onIceCandidate(IceCandidate iceCandidate) {
            super.onIceCandidate(iceCandidate);
            //SignallingClient.getInstance().sendICECandidate(iceCandidate);
            if (iceCandidate.serverUrl.length() > 1)
                SignallingClient.getInstance().sendICECandidate(iceCandidate);
        }

        @Override
        public void onAddStream(MediaStream mediaStream) {
            super.onAddStream(mediaStream);
            Log.e("mytagVFrame", "Video Frame is OUt == " + mediaStream.videoTracks.size());
            VideoTrack remoteVideoTrack = mediaStream.videoTracks.get(0);
            remoteVideoTrack.setEnabled(true);
            ProxyVideoSink videoSink = new ProxyVideoSink();
            videoSink.setTarget(mRemoteSurfaceViewRenderer);
            remoteVideoTrack.addSink(videoSink);
        }
    };
    return peerConnectionFactory.createPeerConnection(rtcConfig, pcObserver);
    //
}
halfelf
  • 9,737
  • 13
  • 54
  • 63

1 Answers1

0

I had the same problem. I discovered I was calling EglBase.create(); in two different places