benwtrent / janus-gateway-android

This is an API wrapper that utilizes the native WebRTC build and is made to ease communication with the janus-gateway
MIT License
112 stars 73 forks source link

JanusActivity modification for VideoRoomTest #28

Open saket424 opened 6 years ago

saket424 commented 6 years ago

Can someone post the changes that are necessary for JanusActivity.java to work with VideoRoomTest instead of the default EchoTest

The EchoTest sample works if I use ws:// and I now want to graduate to VideoRooomTest next

Thanks

saket424 commented 6 years ago

/ EGLContext con = VideoRendererGui.getEGLContext(); echoTest = new EchoTest(localRender, remoteRender); echoTest.initializeMediaContext(JanusActivity.this, true, true, true, con); echoTest.Start(); /

            EGLContext con = VideoRendererGui.getEGLContext();
            VideoRenderer.Callbacks[] renderers = new VideoRenderer.Callbacks[1];
            renderers[0] = remoteRender;
            videoRoomTest = new VideoRoomTest(localRender, renderers);
            videoRoomTest.initializeMediaContext(JanusActivity.this, true, true, true, con);
            videoRoomTest.Start();

This sort of works for one remote stream. I see both local and remote video on android On browser, I see local video and a black screen instead of video from android. The black screen flips and tracks orientation changes -- just a black video instead of android camera video

Also how does this generalize for multiple renderes. Anyone with a working sample of JanusActivity for VideoRoomTest who can post their code ?

Thanks in advance

saket424 commented 6 years ago

Black screen video was some temporary glitch and went away when I restarted my browser

Still, would like a sample that has the Janus activity illustration of how to detect and handle more than one remote publisher

Thanks

emall2018 commented 5 years ago

Hi, Please how did you manage to run the project?

fukemy commented 4 years ago

same problem here, can someone help

gogocake commented 4 years ago

Same problem, still need help

gogocake commented 4 years ago

I tried to use saket424 's Code EGLContext con = VideoRendererGui.getEGLContext(); VideoRenderer.Callbacks[] renderers = new VideoRenderer.Callbacks[1]; renderers[0] = remoteRender; videoRoomTest = new VideoRoomTest(localRender, renderers); videoRoomTest.initializeMediaContext(JanusActivity.this, true, true, true, con); videoRoomTest.Start(); to modify the JanusActivity.java and change the code @Override public List getIceServers() { return new ArrayList(); } in VideoRoomTest.java to @Override public List getIceServers() { ArrayList iceServers=new ArrayList(); PeerConnection.IceServer iceserver = new PeerConnection.IceServer("stun:stun.l.google.com:19302"); iceServers.add(iceserver); return iceServers; } can see the android & PC screen both in browser, but the android screen is revolved