Skip to content

Latest commit

 

History

History

README.md

Overview

QuickBlox provides the Multiparty Video Conferencing solution which allows to setup video conference between 10-12 people. It's built on top of WebRTC SFU technologies.

Multi-conference server is available only for Enterprise plans, with additional fee. Please refer to https://quickblox.com/developers/EnterpriseFeatures for more information and contacts.

Features supported

  • Video/Audio Conference with 10-12 people
  • Join-Rejoin video room functionality (like Skype)
  • Mute/Unmute audio/video stream (own and opponents)
  • Display bitrate
  • Switch video input device (camera)

Getting started

Integrate QuickBlox Conference sdk in your application. For using conference chat based on WEBRTC technology in your app, you must add dependency:

compile "com.quickblox:quickblox-android-sdk-conference:3.9.0"

The next params can be set before start conference.

ConferenceConfig class contains settings for conference:

ConferenceConfig.setPlugin("");
ConferenceConfig.setProtocol("");
ConferenceConfig.setUrl("");

Sign in user, create QBDialogType.GROUP dialog with users you want to join and create conference session:

ConferenceClient client = ConferenceClient.getInstance(getApplicationContext());

// Create session with Video or Audio type conference QBRTCTypes.QBConferenceType conferenceType = isVideoCall ? QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_VIDEO : QBRTCTypes.QBConferenceType.QB_CONFERENCE_TYPE_AUDIO;

client.createSession(userID, conferenceType, new ConferenceEntityCallback() { @Override public void onSuccess(ConferenceSession session) { CallActivity.start(context, dialogID); }

});

ConferenceClient instance - is a client model responsible for managing Conference session.

ConferenceClient has setAutoSubscribeAfterJoin option, which means your client will be subscribing to all online publisher after join to room.

ConferenceSession - is a session with certain Dialog, managing all current processes.

Prepare your activity class to join in video room.

In order to have an ability to receive callbacks about current ConferenceSession instance state and conference events, you must implement appropriate interfaces:

For tracking connection state implement QBRTCSessionStateCallback:

currentSession.addSessionCallbacksListener(this);
currentSession.removeSessionCallbacksListener(this);

/** * Called when session state is changed */ void onStateChanged(ConferenceSession session, BaseSession.QBRTCSessionState state);

/** *Called in case when connection with opponent is established */ void onConnectedToUser(ConferenceSession session, Integer userID);


/** * Called in case when opponent disconnected */ void onDisconnectedFromUser(ConferenceSession session, Integer userID);
/** * Called in case when connection closed with certain user. */ void onConnectionClosedForUser(ConferenceSession session, Integer userID);

For tracking conference events implement ConferenceSessionCallbacks:

currentSession.addConferenceSessionListener(this);
currentSession.removeConferenceSessionListener(this);

/** * Called when some publisher - is a user, joined to the video room */ void onPublishersReceived(ArrayList<Integer> publishers);
/** * Called when some publisher left room */ void onPublisherLeft(Integer userID);
/** * Called when Media - audio or video type is received */ void onMediaReceived(String type, boolean success);
/** * Called when slowLink is received. SlowLink with uplink=true means you notified several missing packets from server, * while uplink=false means server is not receiving all your packets. */ void onSlowLinkReceived(boolean uplink, int nacks);
/** * Called when received errors from server */ void onError(String error);
/** * Called when ConferenceSession is closed */ void onSessionClosed(ConferenceSession session);

For obtaining video and audio tracks implement interface QBRTCClientVideoTracksCallbacks and QBRTCClientAudioTracksCallbackRender. For setting video track - the QBConferenceSurfaceView class is provided.

Join to the room.

You can join to room as a listener or as a publisher. As listener you subscribe only to the publishers, not giving own video and audio streams.

QBConferenceRole conferenceRole = asListenerRole ? QBConferenceRole.LISTENER : QBConferenceRole.PUBLISHER;
currentSession.joinDialog(dialogID, conferenceRole, new QBEntityCallback<ArrayList<Integer>>());

For subscribing to the active publisher: java currentSession.subscribeToPublisher(publisherId);

Note: You should subscribe to publishers only when session state becomes “connected”. Use “onStateChanged” callback method to track session states, as described in “sample-videochat-conference” code sample.
If you are listener, then you can subscribe to publishers right after successful joinDialog.

For unsubscribing from publisher:

currentSession.unSubscribeFromPublisher(publisherId);

To leave session:

currentSession.leave();