@Override public void onConnected(Session session) { Log.v(TAG, "Connected to session " + session.getSessionId()); Log.v(TAG, "Starting to publish video to session " + session.getSessionId()); videoOutPublisher = new Publisher(context); videoOutPublisher .swapCamera(); // need a button to make this controlled by user, depending on phone videoOutPublisher.setPublisherListener(this); videoOutViewGroup.addView(videoOutPublisher.getView()); getSession().publish(videoOutPublisher); }
@Override public void onConnected(Session session) { Log.i(LOGTAG, "Connected to the session."); if (mPublisher == null) { mPublisher = new Publisher(VideoFlyService.this, "publisher"); mPublisher.setPublisherListener(this); // attachPublisherView(mPublisher); mSession.publish(mPublisher); } Log.i(LOGTAG, "Connected to the session."); }
public void startTransmitting(ViewGroup frame) { mPublisher = new Publisher(mContext, "You"); mPublisher.setCapturer(new CustomVideoCapturer(mContext)); // mPublisher.setRenderer(new CustomVideoRenderer(mContext)); mPublisher.setPublisherListener(mPublisherListener); mPublisher.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL); LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); frame.removeAllViews(); frame.addView(mPublisher.getView(), params); mSession.publish(mPublisher); }