ConnectyCube Multiparty Video Conferencing API is built on top of WebRTC protocol and based on top of WebRTC SFU architecture.
Max people per Conference call is 12.
Video Conferencing is available starting from Advanced plan .
To get a difference between P2P calling and Conference calling please read our ConnectyCube Calling API comparison blog page.
Features supported
Video/Audio Conference with up to 12 people
Join-Rejoin video room functionality (like Skype)
Guest rooms
Mute/Unmute audio/video streams
Display bitrate
Switch video input device (camera)
Connect SDK
For using Video Conferencing feature you should add a dependency (only for V1):
SDK v1 kotlin (deprecated)
implementation " com.connectycube:connectycube-android-sdk-videochat-conference: $sdkVersion "
ConferenceSession
// Create session with Video or Audio type conference
val conferenceType = CallType.VIDEO
ConnectyCube.conferenceCalls. createSession (userId, conferenceType, object :
ConferenceCallback <ConferenceSession> {
override fun onSuccess (result: ConferenceSession) {
override fun onError (ex: WsException) {
val client: ConferenceClient = ConferenceClient. getInstance (applicationContext)
// Create session with Video or Audio type conference
val conferenceType = ConferenceType.CONFERENCE_TYPE_VIDEO
client. createSession (userId, conferenceType, object : ConferenceEntityCallback<ConferenceSession> {
override fun onSuccess (session: ConferenceSession?) {
override fun onError (exception: WsException?) {
ConferenceClient client = ConferenceClient . getInstance ( getApplicationContext ()) ;
// Create session with Video or Audio type conference
RTCTypes . ConferenceType conferenceType = RTCTypes . ConferenceType . CONFERENCE_TYPE_VIDEO ;
client . createSession ( userID, conferenceType, new ConferenceEntityCallback () {
public void onSuccess ( ConferenceSession session ) {
ConferenceClient
(ConferenceCalls
v2) instance is a client model responsible for managing conference session.
ConferenceClient
has a setAutoSubscribeAfterJoin
(autoSubscribeAfterJoin
v2) option, which means your client will be subscribing to all online publishers after join to some room.
ConferenceSession
is a session within certain video room, managing all current processes.
Callbacks
In order to have an ability to receive callbacks about current ConferenceSession
instance state and conference events, you should implement appropriate interfaces:
Implement RTCSessionStateCallback
for tracking connection stat:
val sessionStateCallback = object : RTCSessionStateCallback<ConferenceSession> {
* Called when session state is changed
override fun onStateChanged (session: ConferenceSession, state: BaseSession.RTCSessionState) {}
* Called in case when opponent disconnected
override fun onDisconnectedFromUser (session: ConferenceSession, userId: Int) {}
* Called in case when connection with opponent is established
override fun onConnectedToUser (session: ConferenceSession, userId: Int) {}
* Called in case when connection closed with certain user.
override fun onConnectionClosedForUser (session: ConferenceSession, userId: Int) {}
currentSession. addSessionStateCallbacksListener (sessionStateCallback)
//currentSession.removeSessionStateCallbacksListener(sessionStateCallback)
val sessionStateCallback = object : RTCSessionStateCallback<ConferenceSession> {
* Called when session state is changed
override fun onStateChanged (session: ConferenceSession, state: BaseSession.RTCSessionState) {}
* Called in case when opponent disconnected
override fun onDisconnectedFromUser (session: ConferenceSession, userID: Int) {}
* Called in case when connection with opponent is established
override fun onConnectedToUser (session: ConferenceSession, userID: Int) {}
* Called in case when connection closed with certain user.
override fun onConnectionClosedForUser (session: ConferenceSession, userID: Int) {}
currentSession. addSessionCallbacksListener (sessionStateCallback)
//currentSession.removeSessionCallbacksListener(sessionStateCallback)
RTCSessionStateCallback sessionStateCallback = new RTCSessionStateCallback < ConferenceSession >(){
* Called when session state is changed
void onStateChanged ( ConferenceSession session , BaseSession . RTCSessionState 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 ) ;
currentSession. addSessionCallbacksListener ( sessionStateCallback ) ;
//currentSession.removeSessionCallbacksListener(sessionStateCallback);
Implement ConferenceSessionCallbacks
for tracking conference events:
val conferenceSessionCallbacks: ConferenceSessionCallbacks<ConferenceSession> = object : ConferenceSessionCallbacks<ConferenceSession> {
* Called when some publisher (user) joined to the video room
override fun onPublishersReceived (publishers: List<Int>?) {}
* Called when some publisher left room
override fun onPublisherLeft (userId: Int?) {}
* Called when media - audio or video type, is received
override fun onMediaReceived (type: String?,
* 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.
override fun onSlowLinkReceived (uplink: Boolean, lost: Int) {}
* Called when received errors from server
override fun onError (ex: WsException?) {}
* Called when ConferenceSession is closed
override fun onSessionClosed (session: ConferenceSession) {}
currentSession. addConferenceSessionListener (conferenceSessionCallbacks)
//currentSession.removeConferenceSessionListener(conferenceSessionCallbacks)
val conferenceSessionCallbacks: ConferenceSessionCallbacks<ConferenceSession> = object : ConferenceSessionCallbacks<ConferenceSession> {
* Called when some publisher (user) joined to the video room
override fun onPublishersReceived (arrayList: ArrayList<Int>) {}
* Called when some publisher left room
override fun onPublisherLeft (integer: Int) {}
* Called when media - audio or video type, is received
override fun onMediaReceived (type: String,
* 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.
override fun onSlowLinkReceived (b: Boolean, i: Int) {}
* Called when received errors from server
override fun onError (e: WsException) {}
* Called when ConferenceSession is closed
override fun onSessionClosed (conferenceSession: ConferenceSession) {}
currentSession. addConferenceSessionListener (conferenceSessionCallbacks)
//currentSession.removeConferenceSessionListener(conferenceSessionCallbacks)
ConferenceSessionCallbacks < ConferenceSession > conferenceSessionCallbacks = new ConferenceSessionCallbacks < ConferenceSession >() {
* Called when some publisher (user) joined to the video room
public void onPublishersReceived ( ArrayList < Integer > arrayList ) {
* Called when some publisher left room
public void onPublisherLeft ( Integer integer ) {
* Called when media - audio or video type, is received
public 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.
public void onSlowLinkReceived ( boolean b , int i ) {
* Called when received errors from server
public void onError ( WsException e ) {
* Called when ConferenceSession is closed
public void onSessionClosed ( ConferenceSession conferenceSession ) {
currentSession . addConferenceSessionListener ( conferenceSessionCallbacks ) ;
//currentSession.removeConferenceSessionListener(conferenceSessionCallbacks);
Video and Audio tracks
For obtaining video and audio tracks implement interface
VideoTracksCallback < ConferenceSession >
AudioTracksCallback < ConferenceSession >
RTCClientVideoTracksCallback < ConferenceSession >
RTCClientAudioTracksCallback < ConferenceSession >
RTCClientVideoTracksCallback < ConferenceSession >
RTCClientAudioTracksCallback < ConferenceSession >
For setting video track for ConferenceSession - the ConferenceSurfaceView
(RTCSurfaceView
v2) class is provided.
Join video room
You can join room as a listener or as a publisher. As listener you subscribe only to the publishers, not giving own video and audio streams.
val conferenceRole = if (asListenerRole) ConferenceRole.LISTENER else ConferenceRole.PUBLISHER
currentSession. joinDialog (dialogId, conferenceRole, object : ConferenceCallback <ArrayList<Int>> {
val conferenceRole = if (asListenerRole) ConferenceRole.LISTENER else ConferenceRole.PUBLISHER
currentSession. joinDialog (dialogID, conferenceRole, object : ConferenceEntityCallback <ArrayList<Int>> {
ConferenceRole conferenceRole = asListenerRole ? ConferenceRole . LISTENER : ConferenceRole . PUBLISHER ;
currentSession . joinDialog ( dialogID, conferenceRole, new ConferenceEntityCallback < ArrayList < Integer >> {
Subscribe/unsubscribe
For subscribing to the active publisher:
currentSession. subscribeToPublisher (publisherUserId)
currentSession. subscribeToPublisher (publisherUserId)
currentSession . subscribeToPublisher ( publisherUserId ) ;
!> Note: You should subscribe to publishers only when session state becomes connected . Use onStateChanged
callback method to track session states.
If you are a listener, then you can subscribe to publishers right after successful joinDialog
.
For unsubscribing from publisher:
currentSession. unsubscribeFromPublisher (publisherUserId)
currentSession. unsubscribeFromPublisher (publisherUserId)
currentSession . unsubscribeFromPublisher ( publisherUserId ) ;
Leave
To leave current room session: