@Override protected void onStreamReceived(Stream stream) { MySubscriber p = new MySubscriber(mContext, stream); // we can use connection data to obtain each user id p.setUserId(stream.getConnection().getData()); // Subscribe audio only if we have more than one player if (mSubscribers.size() != 0) { p.setSubscribeToVideo(false); } // Subscribe to this player this.subscribe(p); mSubscribers.add(p); mSubscriberStream.put(stream, p); mSubscriberConnection.put(stream.getConnection().getConnectionId(), p); mPagerAdapter.notifyDataSetChanged(); presentText("\n" + p.getName() + " has joined the chat"); }