Reputation: 2066
I am working with WebRTC to make a basic video call application that works between two Android phones, I have been searching for about more than 10 days, I have understood everything regarding the Android side, but I really can't get it in the web side, signalling, TURN and STUN. Unfortunately I am not a web guy (at least not now) and I am very very confused about what to do about the servers setup. I don't even understand exactly when to use what and why. to make the story shorter what I need is:
I need a roadmap to continue in the servers setup. thank you in advance.
UPDATE: The backend has been implemented and it seems to be working cuz I receive voice without any problem, I also receive the MediaStream which contains both the video and the audio, but no video is being displayed.
private void gotRemoteStream(MediaStream stream) {
//we have remote video stream. add to the renderer.
Log.d("KingArmstring", "gotRemoteStream: 1 stream == null" + String.valueOf(stream == null));
Log.d("KingArmstring", "the value of the received stream: " + String.valueOf(stream));
final VideoTrack videoTrack = stream.videoTracks.get(0);
Log.d("TAG", "gotRemoteStream: we get here");
runOnUiThread(() -> {
try {
Log.d("TAG", "we get here");
remoteRenderer = new VideoRenderer(new VideoRenderer.Callbacks() {
@Override
public void renderFrame(VideoRenderer.I420Frame i420Frame) {
Log.d("TAG", "renderFrame: we get here");
}
});
remoteVideoView.setVisibility(View.VISIBLE);
videoTrack.addRenderer(remoteRenderer);
} catch (Exception e) {
e.printStackTrace();
}
});
}
Upvotes: 1
Views: 3022
Reputation: 2066
I have figured finally the problem, thanks to Uriel cuz his answer helped me a lot my answer can't stand alone, it can only be added to his answer. You can see that the remoteRenderer has been initialized this way:
remoteRenderer = new VideoRenderer(new VideoRenderer.Callbacks() {
@Override
public void renderFrame(VideoRenderer.I420Frame i420Frame) {
Log.d("TAG", "renderFrame: we get here");
}
});
(I have add that in the UPDATE in my qustion)
instead of that we should initialize it this way:
remoteRenderer = new VideoRenderer(remoteVideoView);
when I finish this part of the app, I will try to add a git repo for this webRTC part so that anyone can take advantage of using any part of it.
Upvotes: 1
Reputation: 14612
I played around with webRTC on Android and web. I was able to make my own project with the help of these projects:
What I suggest is to run these projects. After you success doing it, you can try to change the code to meet with your needs. Now I will explain some details about TURN and STUN.
Upvotes: 3