Conferencing

Lifecycle

Every conference consists of a few events described below. Each event refers to a User element. Every stream related event refers to MediaStreamWithType element.

Note: If you don’t use any stream related events, the server can trigger an ON AIR status for the specific user. This is caused by asynchronous WebRTC network stack layer implementation. The UI or UX should consider this and set proper statuses in such situations.

The conference notifies about the events by the following command:

VoxeetSDK.conference.on('EVENT_TO_CATCH', (**parameter associated with the event**) => {
})

VoxeetSDK.shared.conference.delegate = self

extension YourClass: VTConferenceDelegate {
    func participantAdded(participant: VTParticipant) {}
    func participantUpdated(participant: VTParticipant) {}
    func statusUpdated(status: VTConferenceStatus) {}
    func streamAdded(participant: VTParticipant, stream: MediaStream) {}
    func streamUpdated(participant: VTParticipant, stream: MediaStream) {}
    func streamRemoved(participant: VTParticipant, stream: MediaStream) {}
}

@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(@NonNull TheEventToCatch event) {

}

Where EVENT_TO_CATCH represents the following events:

participantAdded

Informs that a new user joined the conference and can be in any possible state.

participantUpdated

Informs that status of the user changed.

streamAdded

Informs that a new media stream was added to the user.

streamUpdated

Informs that the media stream changed.

streamRemoved

Informs that the media stream was removed from the user.

Manage conference

The first step for every conference is a conference creation. You can find the instruction on how to create a conference in the description below.

The standard hierarchy of conference stages:

1. A person or a server creates a conference.

2. A host invites other participants.

3. All the participants join the conference.

4. Participants interact with each other during the conference.

5. Users leave the conference.

6. The conference is automatically deleted.

Creating a conference

To create a conference, use the create command, as in the example below. In such a case, SDK will provide you a conference ID which you should use while joining the conference.

VoxeetSDK.conference.create(options: ConferenceOptions)

There is one optional parameter that can be set:

  • options: ConferenceOptions - it contains all options available for the conference. An additional description of the options is on the ConferenceOptions page.

let options = VTConferenceOptions()
options.alias = alias

VoxeetSDK.shared.conference.create(options: options, success: { conference in 
}, fail: { error in
})

There is one optional parameter that can be set:

  • options: VTConferenceOptions - it contains all options available for the conference. An additional description of the options is on the ConferenceOptions page.

VoxeetSDK.conference().create("conftest4").then(new PromiseExec<CreateConferenceResult, Object>() {
    @Override
    public void onCall(@Nullable CreateConferenceResult result, @NonNull Solver<Object> solver) {

    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});

The parameters can be :

  • conferenceAlias: String optionnal name for the conference

or

  • options : ConferenceCreateInformation instance of ConferenceCreateInformation obtained from a builder instance (ConferenceCreateInformation.Builder). An additional description of the options is on the ConferenceCreateInformation.Builder page.

A conference can be also automatically created while the user joins a conference. This method is not recommended.

Returns

To check if your code works correctly, use the Promise<Conference> command. It returns various information about a conference. More information is avaliable on the ConferenceInfos page.

To check if your code works correctly, use the Promise<CreateConferenceResult> command. It returns various information about a conference. More information is avaliable on the CreateConferenceResult page.

Joining a conference

When the conference is created, participants can join it. You can find the instruction on how to join a conference in the description below.

At first, set proper audio and video settings:

// For example
const constraints = {
  audio: true,
  video: {
    width: {
      min: "320",
      max: "1280"
    },
    height: {
      min: "240",
      max: "720"
    }
  }
};

To join a conference, use the join method available in the ConferenceService of the SDK, as in the example below:

var constraints = {audio: true, video: true};

VoxeetSDK.conference.join(conferenceId, {constraints: constraints})
  .then((info) => {

  })
  .catch((error) => {

  });

Additionally, you should configure the following parameters:

  • conferenceId: String - alias or ID of the conference
  • options: CallOptions - options of the call described on the CallOptions page
  • listen: Boolean - term identifying if the user is a listener

To join a conference, use the join method available in the VTConferenceService of the SDK, as in the example below:

let options = VTJoinOptions()
options.constraints.video = false

VoxeetSDK.shared.conference.join(conference: conference, options: joinOptions, success: { conference in
}, fail: { error in
})

To join a conference, use the join method available in the ConferenceService of the SDK, as in the example below:

VoxeetSDK.conference().join(conferenceId).then(new PromiseExec<Boolean, Object>() {
    @Override
    public void onCall(@Nullable Boolean result, @NonNull Solver<Object> solver) {

    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});

Additionally, you should configure the following parameters:

  • conferenceId: String - id of the conference

or

  • options : ConferenceJoinInformation instance of ConferenceJoinInformation obtained from a builder instance (ConferenceJoinInformation.Builder). An additional description of the options is on the ConferenceJoinInformation.Builder page.

Returns

To check if your code works correctly, use the Promise<ConferenceInfos> command. It returns various information about a conference. More information is avaliable on the ConferenceInfos page.

To check if your code works correctly, use the Promise<Boolean> command.

Mute/Unmute

To mute or unmute users, use this method. It mutes other conference participants locally. It means that if you mute a specific conference participant, the rest of the conference members will still hear this user. Use the code below to use this method.

    VoxeetSDK.conference.mute(participant, isMuted)
    .catch((error) => {
    // Error occurred during mute user
    });

VoxeetSDK.shared.conference.mute(participant: VTParticipant, isMuted: isMuted)

not on my watch

TODO isn't it the mute/unmute locally method? - if not, then this one is missing TODO need for Android? (iOS as well???)

Start video

To start a video during a conference use the code below.

    VoxeetSDK.conference.startVideo(participant)
    .catch((error) => {
    // Error occurred during start video
    });

VoxeetSDK.shared.conference.startVideo(participant: VTParticipant, completion: { error in })

VoxeetSDK.conference().startVideo().then(new PromiseExec<Boolean, Object>() {
    @Override
    public void onCall(@Nullable Boolean result, @NonNull Solver<Object> solver) {

    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});

Stop video

To stop a video during a conference use the code below.

    VoxeetSDK.conference.stopVideo(participant)
    .catch((error) => {
    // Error occurred during stop video
    });

VoxeetSDK.shared.conference.stopVideo(participant: VTParticipant, completion: { error in })

VoxeetSDK.conference().stopVideo().then(new PromiseExec<Boolean, Object>() {
    @Override
    public void onCall(@Nullable Boolean result, @NonNull Solver<Object> solver) {

    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});

Leaving a conference

To let participants leave a conference, use the code below.

Use leave method available in the ConferenceService of the SDK as in the example below:

VoxeetSDK.conference.leave()
.catch((error) => {
  // Error occurred during leave
});

Use leave method available in the VTConferenceService of the SDK as in the example below:

VoxeetSDK.shared.conference.leave { error in }

Use leave method available in the ConferenceService of the SDK as in the example below:

VoxeetSDK.conference().leave().then(new PromiseExec<Boolean, Object>() {
    @Override
    public void onCall(@Nullable Boolean result, @NonNull Solver<Object> solver) {
        
    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});

Returns

To check if your code works correctly, use the Promise<void> command.

Use leave method available in the ConferenceService of the SDK as in the example below:

VoxeetSDK.conference().leave().then(new PromiseExec<Boolean, Object>() {
    @Override
    public void onCall(@Nullable Boolean result, @NonNull Solver<Object> solver) {
        
    }
}).error(new ErrorPromise() {
    @Override
    public void onError(@NonNull Throwable error) {

    }
});