Skip to content

Multiparty Video Conferencing feature overview

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)

Code samples

There are ready-to-go FREE code samples to help you better understand how to integrate multiparty video conferencing calling capabilities in your apps:

  • Multiparty Video Conferencing code sample, ObjC - request

Prerequisites

Multiparty Video Conferencing API is based on top of regular Video Calling API, so it’s good to learn its API as well.

Config

ConferenceConfig class introduces new setting for Conference - conference endpoint.

ConferenceConfig.companion.url = ""

Note

Endpoint should be a correct ConnectyCube Conference server endpoint.

Use this method to get a current conference endpoint (default is nil):

ConferenceConfig.companion.url

Conference client

Conference module has its own client which is described in current part.

Conference client delegate

Conference client delegate is inherited from base client delegate and has all of its protocol methods implemented as well.

Base client delegate protocol methods

All protocol methods below have their own explanation inlined and are optional.

/**
* Called when session state has been changed.
*
* @param session P2PSession instance
* @param state session state
*
*/
func onStateChanged(session: BaseSession<AnyObject>, state: BaseSessionRTCSessionState) {}
/\*\*
- Called in case when connection with opponent is established
-
- @param session P2PSession instance
- @param userId ID of opponent
\*/
func onConnectedToUser(session: BaseSession<AnyObject>, userId: Int32) {}
/\*\*
- Called in case when connection failed with user
-
- @param session P2PSession instance
- @param userId ID of opponent
\*/
func onDisconnectedFromUser(session: BaseSession<AnyObject>, userId: Int32) {}
/\*\*
- Called in case when connection is closed for user
-
- @param session P2PSession
- @param userId ID of opponent
\*/
func onConnectionClosedForUser(session: BaseSession<AnyObject>, userId: Int32) {}
/\*\*
- Called when received remote video track from user
-
- @param videoTrack ConnectycubeVideoTrack instance
- @param userId ID of user
\*/
func onRemoteVideoTrackReceive(session: BaseSession<AnyObject>, videoTrack: ConnectycubeVideoTrack, userId: Int32) {}
/\*\*
- Called when received remote audio track from user
-
- @param videoTrack ConnectycubeAudioTrack instance
- @param userId ID of user
\*/
func onRemoteAudioTrackReceive(session: BaseSession<AnyObject>, audioTrack: ConnectycubeAudioTrack, userId: Int32) {}

Conference client delegate protocol methods

All protocol methods below are conference client specific, optional to be implemented and have their own explanation inlined.

/**
* Called when some publisher (user) joined to the video room
*/
func onPublisherLeft(userId: KotlinInt?) {}
/\*\*
- Called when some publisher left room
\*/
func onPublishersReceived(publishers: [KotlinInt]?) {}
/\*\*
- Called when media - audio or video type, is received
\*/
func onMediaReceived(type: String?, success\_ success: Bool) {}
/\*\*
- 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.
\*/
func onSlowLinkReceived(uplink: Bool, lost: Int32) {}
/\*\*
- Called when received errors from server
\*/
func onError(ex\_ ex: WsException?) {}
/\*\*
- Called when ConferenceSession is closed
\*/
func onSessionClosed(session: ConferenceBaseSession) {}

Conference client interface

ConferenceCalls is a singleton based class which is used to create and operate with conference sessions.

//MARK: ConferenceCallback
let conferenceType = CallType.video
ConnectyCube().conferenceCalls.createSession(userId: userId, callType: conferenceType, callback: self)
extension YourClass: ConferenceCallback {
func onSuccess(result: Any?) {
let conferenceSession = result as! ConferenceSession
}
func onError(ex: WsException) {
}
}

In order to create new conference session you should use method below:

class ConferenceCallbackJoinDialog: ConferenceCallback {
func onSuccess(result: Any?) {
let userIds: [Int] = result as! [Int]
}
func onError(ex: WsException) {
}
}
conferenceSession.joinDialog(dialogId: dialogId, conferenceRole: conferenceRole, callback: ConferenceCallbackJoinDialog())

Conference session

ConferenceSession is inherited from base session class, and has all of its basics, such as state, currentUserId, localMediaStream, ability to get remote audio and video tracks for a specific user IDs.

You can subscribe and unsubscribe from publishers using methods below.

conferenceSession.subscribeToPublisher(publisherId: publisherId)
conferenceSession.unsubscribeFromPublisher(publisherId: publisherId)

And in order to close/leave session you can perform the following method:

conferenceSession.leave()

Note

You do not need to be joined as publisher in order to perform subscription based operations in session.

Examples and implementations

sample-videochat-conference-objc is a great example of our ConnectyCubeCalls Conference module, classes to look at: CallViewController.