Learn how to add video conference calls to your app.
init()
method. The conference module allows to process conference calls. If the module is not initialized, it will not be able to create the session and process calls consequently.
init()
method before calling any other methods. If you attempt to call a method without initializing the module, the error is returned.Argument | Required | Description |
---|---|---|
conferenceServer | yes | A conference server endpoint. |
StreamSubscription
that you should unsubscribe when you need, for example, in the dispose()
method.
You can subscribe to several events at the same time. However, you should handle these events as different subscriptions. For example, if you subscribe to three events, you should call three subscribeConferenceEvent()
methods. And if you need to unsubscribe from these three events, you should have the same number of unsubscriptions.
Event | Description |
---|---|
QBConferenceEventTypes.CONFERENCE_VIDEO_TRACK_RECEIVED | A remote video track has been received by the remote participant. |
QBConferenceEventTypes.CONFERENCE_PARTICIPANT_RECEIVED | A new participant has joined a conference session. |
QBConferenceEventTypes.CONFERENCE_PARTICIPANT_LEFT | A participant has left a conference session. |
QBConferenceEventTypes.CONFERENCE_ERROR_RECEIVED | An error was received. |
QBConferenceEventTypes.CONFERENCE_CLOSED | A conference session was closed. |
QBConferenceEventTypes.CONFERENCE_STATE_CHANGED | A conference session state has been changed. |
create()
method. Each conference session is tied to a specific dialogId
taken from the QuickBlox Chat. See this section for more information about dialogs.
session
variable to be able to interact with the current conference session. For example, if you don’t store the current session, you won’t be able to hang up or reject a call.Argument | Required | Description |
---|---|---|
sessionType | yes | Conference session type: QBConferenceSessionTypes.VIDEO, QBConferenceSessionTypes.AUDIO. |
dialogId | yes | ID of the dialog. Taken from the QuickBlox Chat. |
joinAsPublisher()
method. This method joins the session and publishes your feed making you an active publisher in the room. Everyone in the room will be able to subscribe and receive your feed. Once the room is joined, you receive an array of participants’ IDs.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. Received from the QBConferenceRTCSession object that is returned in the response to the create() method. |
subscribeToParticipant()
method to subscribe to a participant.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
userId | yes | User ID. Taken from the array of participants’ IDs received in the responce to the joinAsPublisher() method. |
unsubscribeFromParticipant()
method to unsubscribe from the participant’s audio/video track.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
userId | yes | User ID. Taken from the array of participants’ IDs received in the responce to the joinAsPublisher() mthod. |
ConferenceVideoView
for remote and local video tracks to be able to show the video. The ConferenceVideoView
allows displaying the video stream while the ConferenceVideoViewController
allows to control the video view. Thus, you can play, release the video stream from video view.
ConferenceVideoView
- RTCVideoViewController
for the remote camera app of the remote peer. There can be multiple remote video tracks in the conference call. In this case, you should set up the ConferenceVideoView
for each remote video track individually.ConferenceVideoView
- RTCVideoViewController
for the local camera app of the remote peer. There can be only one local video track in the conference call.QBConferenceEventTypes.CONFERENCE_VIDEO_TRACK_RECEIVED
event. Thus, once the SDK receives data that a remote video track was received, it creates the event of CONFERENCE_VIDEO_TRACK_RECEIVED
type with userId
and sessionId
properties. See this section to learn how to subscribe the event.
After this, invoke method play()
and pass sessionId
and userId
parameters to it. If the userId
matches with the one in properties, the video starts playing.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
userId | yes | The ID of the local peer. |
opponentId | yes | The ID of the remote peer. |
enableAudio()
method.
Argument | Required | Description |
---|---|---|
sesssionId | yes | Conference session ID. |
enabled | no | Boolean parameter. Allows to enable/disable a local audio. |
enableVideo()
method.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
enabled | no | Boolean parameter. Allows to enable/disable a local video. |
switchCamera()
method to switch between the two cameras.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
switchAudioOutput()
method and pass the type of the audio device to it.
create()
method.Argument | Required | Description |
---|---|---|
output | yes | Type of the audio device:QBConferenceAudioOutputTypes.EARSPEAKER ,QBConferenceAudioOutputTypes.LOUDSPEAKER ,QBConferenceAudioOutputTypes.HEADPHONES,QBConferenceAudioOutputTypes.BLUETOOTH. |
leave()
method. After calling this method, the current session is deleted from SDK and you can’t access this session any more.
Argument | Required | Description |
---|---|---|
sessionId | yes | Conference session ID. |
ConferenceVideoView
is going to close, you have to release the conference module. Call the release()
method that allows to unregister the conference module from receiving any video conference events and closes existing signaling channels.
If you want to create another conference session after the release()
method, you should call the init()
method first to initialize the conference module. After the module is initialized, you can create another conference session by calling the create()
method.
release()
method should be called when a video track is no more valid. If you don’t call this method, you will get a memory leak.