Android Toolkit : Sample Code

// Create an object of EnxRtc in onCreate() of Activity or onCreateView() of Fragment. // To init EnxRtc object EnxRtc enxRtc = new EnxRtc(this,this,this); // To join the room, call joinRoom: which returns localStream Object. EnxStream vcxLocalStream = enxRtc.join("token","local-stream-info") // To Render stream // init EnxPLayerView object EnxPlayerView enxPlayerView = new EnxPlayerView(getActivity(),EnxPlayerView.ScalingType.SCALE_ASPECT_BALANCED,false,true); // attach render on stream vcxLocalStream.attachRenderer(enxPlayerView); // Add EnxPLayerView on your own view yourView.addView(enxPlayerView); // // Room delegate methods: void onRoomConnected(EnxRoom enxRoom, JSONObject roomMetaData){ enxRoom.publish(); } void onRoomError(JSONObject jsonObject){ // Error while connecting to the room. } // When publishing stream added to the room. void onStreamAdded(EnxStream stream){ // Streams which are added in the room. subscribe to all streams added. enxRoom.subscribe(); } // callback after subscribed stream void onSubscribedStream(EnxStream enxStream){ // render stream on your view EnxPlayerView enxPlayerView = new EnxPlayerView(getActivity(),,EnxPlayerView.ScalingType.SCALE_ASPECT_BALANCED,false,true); enxStream.attachRenderer(enxPlayerView); yourRemoteView.addView(enxPlayerView); } // For Active talker mode void onActiveTalkerList(JSONObject jsonObject){ // This delegate will call every time when active talker list gets updated and user will get the new active list. } //Where jsonObject is: { "active" : true, "activeList" : [ {"streamId":"1","mediatype" : "audiovideo", "clientId" : "a334a039-90af-4c5d-93ad-6f71ea20a36a", "name":"abc"}, {"streamId":"2","mediatype" : "audio", "clientId" : "b334a039-90af-4c5d-93ad-6f71ea20a36b","name":"abc1"}, {"streamId":"3","mediatype" : "audio", "clientId" : "c334a039-90af-4c5d-93ad-6f71ea20a36c","name":"abc2"}, {"streamId":"4","mediatype" : "audiovideo", "clientId" : "d334a039-90af-4c5d-93ad-6f71ea20a36d", "name":"abc3"}, {"streamId":"5","mediatype" : "audiovideo", "clientId" : "e334a039-90af-4c5d-93ad-6f71ea20a36e", "name":"abc4"}, {"streamId":"6","mediatype" : "audiovideo", "clientId" : "f334a039-90af-4c5d-93ad-6f71ea20a36f", "name":"abc5"} ] }