Audio/Video Group Conference

To add Audio/Video Group Conference support in your application,

Include CustomUI.js in your index.html file to access the Custom UI functionality in your Cordova app

All the method calls will invoke their respective callback blocks as defined below.

To use Audio/Video Chat functionality, you must have downloaded the Audio/Video Chat enabled SDK.
Note that GroupAVChat works only with the chatrooms, so you need to subscribe to the chatroom and join any chatroom.

1. Send Conference request
Before you start a conference, you need to send the conference request to the chatroom you have joined. The syntax is as follows:

 Customui.sendConferenceRequest(successCallback,failCallback);

You will get success response as follows:

{ "status":"Conference request sent successfully" }

2. Join the conference
You can join the already started conference by using the function joinConference(). The syntax is as follows:

Customui.joinConference(successCallback,failCallback);

The success response will be as follows:

{"status":"conference join success"}

3. Start Conference
Once you have sent the request for conference or made join conference request successfully then you can start the conference. The syntax is as follows:

Customui.startConferenceInContainer(container,successCallback,failCallback);

Here the container is the relative layout in which video will be displayed. There is no success callback fired here.
Make sure that before calling this function you have either sent the request for conference or called the join conference function as mentioned below, else you will get error code ‘52’ with message ‘call details not found’.

4. End conference
You can leave the conference by calling endConference() function. The conference will end when all the members leave the conference. The syntax is as follows:

Customui.endConference = function(successCallback,failCallback);

5.Toggle audio
While having conference you can turn on/off audio, so that other user cannot listen your voice. For this you can use toggleAudio() function. The syntax is as follows:

 Customui.toggleGroupAVAudioSDK(audioControlFlag,successCallback,failCallback);

6. Toggle video
While having conference you can turn on/off video, so that other user cannot see your video. For this you can use toggleVideo() function. The syntax is as follows:

Customui.toggleGroupAVVideoSDK(videoControlFlag,successCallback,failCallback);

7. Switch camera
While having a conference you can switch between your front camera and back main camera. For this you can use switchCamera() function. This function doesn’t require any parameter.

Customui.switchGroupAVCameraSDK(successCallback,failCallback);

Not finding what you need?

The CometChat team is here to help!