undefined

Multiparty Video Conferencing feature overview

ConnectyCube provides the Multiparty Video Conferencing solution which allows setting up 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. For more information and if you want request a Demo please contact us at https://connectycube.com/contact .

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)

Code samples

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

  • Multiparty Video Conferencing code sample for browser - request

Initialization

In order to start working with Multiparty Video Conferencing API you need to initialize a client:

const MULTIPARTY_SERVER_ENDPOINT = 'wss://...:8989';
const config = {
    server: MULTIPARTY_SERVER_ENDPOINT,
    debug: false
    // video: {quality: 'stdres'} // Possible values: 'lowres' (320x240), 'stdres' (640x480), 'hdres' (1280x720), 'fhdres' (1920x1080). Default is 'stdres'.
};
const videoConfClient = new ConnectyCube.videochatconference.Client(config);

Default multiparty server endpoint is not shared. Please use above contacts to request the endpoint for you.

Create session

Once the library has been initialized, you can start creating session. Normally, each browser tab will need a single session with the server:

const callbacks = {
    success: () => {},
    error: error => {},
    destroyed: () => {}
};

videoConfClient.createSession(callbacks);

Once a session is created, you can interact with a Video Conferencing API.

Attach Video Conferencing plugin

Next, the most important step is to attach Video Conferencing plugin, as it's what will allow you to exploit the features of a plugin to manipulate the media sent and/or received by a PeerConnection in your web page. This method will create a plugin handle internally, for which you can configure callbacks.

You also have to attach plugin to each remote user.

const isRemote = true; // or false
const userId = 12345;
const callbacks = {
    success: () => {},
    error: error => {},
    consentDialog: on => {},
    webrtcState: on => {},
    mediaState: (medium, on) => {},
    iceState: iceConnectionState => {},
    slowLink: (uplink, nacks) => {},
    oncleanup: () => {}
};

videoConfClient.attachVideoConferencingPlugin(isRemote, userId, callbacks);

For local user plugin attachment we should pass userId = null and isRemote = false.

Join video room

To jump into video chat with users you should join it:

const chatDialogId = '...';
const currentUserId = 12345;
const isAudioCallOnly = false; // or true
const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.join(chatDialogId, currentUserId, isAudioCallOnly, callbacks);

To check current joined video room use the following property:

videoConfClient.currentDialogId;

List online participants

To list online users in a video chat:

const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.listOnlineParticipants(chatDialogId, callbacks);

Callbacks

There are 4 callbacks you can listen for. You can use method on to add them:

videoConfClient.on('participantjoined', (userId, userDisplayName) => {});

videoConfClient.on('participantleft', (userId, userDisplayName) => {});

videoConfClient.on('localstream', stream => {
    ConnectyCube.videochatconference.Client.attachMediaStream($('#myvideo').get(0), stream);
});

videoConfClient.on('remotestream', (stream, userId) => {
    // do not add stream if it's already here
    if (feedViewIsAlreadyAdded(userId)) {
        return;
    }

    addFeedView(userId, false);

    ConnectyCube.videochatconference.Client.attachMediaStream($('#remotevideo' + userId).get(0), stream);
});

To remove all listeners the following code can be applied:

videoConfClient.removeAllListeners('participantjoined');
videoConfClient.removeAllListeners('participantleft');
videoConfClient.removeAllListeners('localstream');
videoConfClient.removeAllListeners('remotestream');

Mute audio

You can mute/unmute your own audio:

const muted = videoConfClient.toggleAudioMute();
console.info('Now audio is muted = ' + muted);

Mute remote user's audio

You also can mute/unmute remote user's audio:

const muted = videoConfClient.toggleRemoteAudioMute(userId);
console.info('Now remote audio is muted = ' + muted);

Mute video

You can mute/unmute your own video:

const muted = videoConfClient.toggleVideoMute();
console.info('Now video is muted = ' + muted);

Mute remote user's video

You also can mute/unmute remote user's video:

const muted = videoConfClient.toggleRemoteVideoMute(userId);
console.info('Now remote video is muted = ' + muted);

Display bitrate

There is a way to show video bitrate of remote user. The following string will be shown in element - 180 kbits/sec and will be refreshed each 1 second.

const userId = 12345;

videoConfClient.showBitrate(userId, $('#curbitrate' + userId));
videoConfClient.hideBitrate(userId, $('#curbitrate' + userId));

List video input devices (cameras)

let deviceInfo, deviceId, deviceLabel;

ConnectyCube.videochatconference.Client.listVideoinputDevices(videoinputDevices => {
    for (let i = 0; i !== videoinputDevices.length; ++i) {
        deviceInfo = videoinputDevices[i];
        deviceId = deviceInfo.deviceId;
        deviceLabel = deviceInfo.label;
    }
});

Switch video input device (camera)

In order to switch video camera you have to obtain a list of currently plugged video cameras with ConnectyCube.videochatconference.Client.listVideoinputDevices method.

const deviceId = '...';
const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.switchVideoinput(mediaDeviceId, callbacks);

Leave video room

To leave current joined video room:

const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.leave(callbacks);

Detach Video Conferencing plugin

When job is done you should detach Video Conferencing plugin - the following method detaches from the plugin and destroys the handle, tearing down the related PeerConnection if it exists:

const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.detachVideoConferencingPlugin(callbacks);

Destroy session

And the final step to fully close/cleanup everything is to destroy session:

const callbacks = {
    success: () => {},
    error: error => {}
};

videoConfClient.destroySession(callbacks);