2020 API AWARDS WINNER - BEST IN MEDIA APIs LEARN MORE

ConferenceService

The ConferenceService allows the application to manage the conference life cycle and interact with the conference.

Typical application APIs workflow:

1. The application creates a conference.

2. The application uses the fetchConference method to obtain the conference object.

3. The application can choose to either:

Participants that do not wish to participate at a conference can decline the conference invitation.

4. The application can request a specific quality of Simulcast video streams through the Simulcast method.

5. The application can start and stop streaming audio.

6. The application can start and stop streaming video.

7. During a conference, the application can:

8. The application calls the leave method to leave a conference.

The application can interact with the service through these events:

Warning: Always implement the error for each called promise before you start resolving it. You can also use the execute method but in case of exceptions, you will trigger errors.

Available in the package com.voxeet.sdk.services.ConferenceService.

Methods

mute

mute(mute: boolean): boolean

Mutes and unmutes the current participant.

Parameters

NameTypeDescription
mutebooleanthe mute state

Returns: boolean - information if the mute state has changed.

mute

mute(@NonNull participant: Participant, mute: boolean): boolean

Mutes and unmutes the specific participant.

Parameters

NameTypeDescription
participantParticipantnon null the corresponding participant
mutebooleanthe mute state

Returns: boolean - information if the mute state has changed.

isMuted

isMuted(): boolean

Gets the current mute state of the local participant.

Returns: boolean - the mute state. Returns false, if the participant is not at the conference or is not muted. Returns true, if the participant is muted.

isMuted

isMuted(@NonNull participant: Participant): boolean

Gets the current mute state of the specific participant.

Parameters

NameTypeDescription
participantParticipantnon null

Returns: boolean - the mute state. Returns false, if the participant is not at the conference or is not muted. Returns true, if the participant is muted.

isSpeaking

isSpeaking(@NonNull participant: Participant): boolean

Informs if the specific conference participant is speaking.

Parameters

NameTypeDescription
participantParticipantnon null participant

Returns: boolean - the boolean indicating if the participant is speaking.

findParticipantById

findParticipantById(@NonNull participantId: String): Participant

Informs about the instance of the desired participant.

Parameters

NameTypeDescription
participantIdStringnon null participant's ID

Returns: @Nullable Participant - the instance of the participant. The null value informs that the conference or the participant does not exist in the current time session.

getConferenceType

getConferenceType(): LocalConferenceType

Gets the current conference type.

Returns: @NonNull LocalConferenceType - the ConferenceType. the ConferenceType.NONE is a default value.

getConference

getConference(): Conference

Gets the current Conference object.

Returns: @Nullable Conference - the nullable object.

isInConference

isInConference(): boolean

Gets the current state of presence at the conference. It can be used together with the ConferenceStatus.

Returns: boolean - true if the conference currently exists or if the connection attempt to the conference is pending.

audioLevel

audioLevel(@Nullable participant: Participant): double

Gets the volume unit (VU) meter for a specific participant.

Parameters

NameTypeDescription
participantParticipantnullable participant, the value can be safely set to an incorrect one

Returns: double - the value between 0. and 1.

cancelTimeout

cancelTimeout(): ConferenceService

Enables to cancel the timeout.

Returns: @NonNull ConferenceService

decline

decline(conferenceId: String): Promise<Boolean>

Declines an invitation for the specific conference, based on the conference ID.

Parameters

NameTypeDescription
conferenceIdStringthe conference ID

Returns: @NonNull Promise<Boolean> - the promise to resolve.

startVideo

startVideo(): Promise<Boolean>

Starts the video stream for the participant, which can be either the remote participant or the local participant that belongs to the current session.

For remote participants, this method informs the Voxeet service to forward the remote participant's video to the application, which will result in streamAdded event be emitted when successful. If the remote participant has not started sending video yet then the returned promise will contain an error.

For the local participant, this method triggers the application to start sending video to the Voxeet service. The application may also opt to start sending video while it joins the conference.

The reject value informs about the PromisePermissionRefusedEventException or the MediaException. If the application does not have permission, it emits the PermissionRefusedEvent.

Returns: @NonNull Promise<Boolean>

startAudio

startAudio(): Promise<Boolean>

Starts the audio stream for the participant if the current participant is not a listener.

When using this method, the audio track status for the current user in the conference will follow those steps :

  • STARTING
  • STARTED
  • STOPPED if an exception occurred

Calling this method when a previous call is still pending will throw an IllegalStateException.

The possible exceptions are :

  • IllegalStateException, when multiple calls are used without waiting for the previous answer
  • MediaEngineException, exception with the MediaEngine, is the conference still running ?
  • PermissionRefusedEvent, is the microphone permission validated by the user ?
  • Throwable, a standard exception ocurred

Returns: @NonNull Promise<Boolean> - a promise to resolve.

stopAudio

stopAudio(): Promise<Boolean>

Stops the audio stream for the participant.

When using this method, the audio track status for the current user in the conference will follow those steps :

  • STOPPING
  • STARTED
  • STARTED if an exception occurred

Calling this method when a previous call is still pending will throw an IllegalStateException.

The possible exceptions are :

  • IllegalStateException, when multiple calls are used without waiting for the previous answer
  • MediaEngineException, exception with the MediaEngine, is the conference still running ?
  • Throwable, a standard exception ocurred

Returns: @NonNull Promise<Boolean> - a promise to resolve.

stopVideo

stopVideo(): Promise<Boolean>

Stops the local video stream. This method only works when the current participant is at the conference. Any call to this method that is outside of the conference, throws an exception in the catch block of the promise.

Returns: @NonNull Promise<Boolean> - the promise to resolve.

create

create(@Nullable conferenceAlias: String): Promise<CreateConferenceResult>

Creates a conference.

Parameters

NameTypeDescription
conferenceAliasStringnullable alias of the conference

Returns: @NonNull Promise<CreateConferenceResult> - the promise to resolve.

create

create(@NonNull conferenceCreateOptions: ConferenceCreateOptions): Promise<CreateConferenceResult>

Creates the conference based on information from the built ConferenceCreateOptions.

Parameters

NameTypeDescription
conferenceCreateOptionsConferenceCreateOptionsnon null information holder where the ID, parameters, and metadata can be passed

Returns: @NonNull Promise<CreateConferenceResult> - the conference creation information holder.

listen

listen(@NonNull conference: Conference): Promise<Conference>

Joins the conference in the listener mode in which the conference participant can only receive video and audio and cannot transmit any media.

Possible rejection causes :

  • ServerErrorException
  • InConferenceException
  • MediaEngineException
  • ParticipantAddedErrorEventException

Parameters

NameTypeDescription
conferenceConferencenon null conference

Returns: @NonNull Promise<Conference> - the promise to resolve.

broadcast

broadcast(@NonNull conference: Conference): Promise<Conference>

Joins the conference in the broadcaster mode which allows transmitting audio and video.

Possible rejection causes:

  • ServerErrorException
  • InConferenceException
  • MediaEngineException
  • ParticipantAddedErrorEventException

Parameters

NameTypeDescription
conferenceConferencenon null conference

Returns: @NonNull Promise<Conference> - the promise to resolve.

join

join(@NonNull conference: Conference): Promise<Conference>

Joins the conference.

The possible exceptions are:

  • ServerErrorException
  • InConferenceException
  • MediaEngineException
  • ParticipantAddedErrorEventException

Parameters

NameTypeDescription
conferenceConferencenon null conference

Returns: @NonNull Promise<Conference> - the promise to resolve.

join

join(@NonNull options: ConferenceJoinOptions): Promise<Conference>

Joins the conference with the conference.

The possible exception in the rejection:

  • ServerErrorException
  • InConferenceException
  • MediaEngineException
  • ParticipantAddedErrorEventException

Parameters

NameTypeDescription
optionsConferenceJoinOptionsnon null the holder of the options to join

Returns: @NonNull Promise<Conference> - the promise to resolve.

replay

replay(@NonNull conference: Conference, offset: long): Promise<Conference>

Replays the previously recorded conference.

Possible rejection causes:

  • ServerErrorException
  • InConferenceException
  • MediaEngineException
  • ParticipantAddedErrorEventException

Parameters

NameTypeDescription
conferenceConferencenon null conference
offsetlongthe offset to start with

Returns: @NonNull Promise<Conference> - the promise to resolve that indicates the result of the request.

localStats

localStats(): Map<String, JSONArray>

Provides standard WebRTC statistics for the application to implement its own quality monitoring mechanisms.

Returns: @NonNull Map<String, JSONArray> - The WebRTC Stat Matrix.

getConferenceStatus

getConferenceStatus(conferenceId: String): Promise<ConferenceStatusResult>

Gets the conference status.

Parameters

NameTypeDescription
conferenceIdStringthe conference ID

Returns: @NonNull Promise<ConferenceStatusResult> - the promise to resolve containing the ConferenceStatusResult.

simulcast

simulcast(@NonNull requested: List<ParticipantQuality>): Promise<Boolean>

Requests a specific quality of the received Simulcast video streams. It can be set only for selected conference participants or for all participants that joined the conference.

Parameters

NameTypeDescription
requestedList<ParticipantQuality>non null list of simulcast configurations

Returns: @NonNull Promise<Boolean> - the promise to resolve.

getInvitedParticipants

getInvitedParticipants(@NonNull conferenceId: String): Promise<ConferenceParticipantsInvitedResult>

Retrieves the list of participants invited to the conference.

Parameters

NameTypeDescription
conferenceIdStringnon null conference ID

Returns: @NonNull Promise<ConferenceParticipantsInvitedResult> - the promise to resolve.

leave

leave(): Promise<Boolean>

Leaves the current conference.

Returns: @NonNull Promise<Boolean>

fetchConference

fetchConference(@NonNull conferenceId: String): Promise<Conference>

Provides a Conference object that allows joining a conference.

Parameters

NameTypeDescription
conferenceIdStringnon null conference ID.

Returns: @NonNull Promise<Conference> - the ConferenceInformation in the Promise to resolve.

hasParticipants

hasParticipants(): boolean

Informs about that at least one participant is actively connected.

Returns: boolean - indicates if at least one participant is actively connected to the conference.

Events

ConferenceHistoryResult

Emitted when the application asked about historical conference elements (by calling the history restful endpoint).

Available in the package com.voxeet.sdk.events.sdk.ConferenceHistoryResult.

items (List)

The events list.

ConferenceTimeoutNoParticipantsJoinedEvent

Emitted when withinn the maximum awaiting time nobody joins the current participant at the conference.

Available in the package com.voxeet.sdk.events.sdk.ConferenceTimeoutNoParticipantsJoinedEvent.

timeout (long)

A timeout set in the SDK.

IncomingCallEvent

Emitted when an incoming call is received. This event is optional when the NotificationService is properly referenced and set up on the developer side.

Available in the package com.voxeet.sdk.events.sdk.IncomingCallEvent.

conferenceId (String)

The conference ID.

VideoStateEvent

Emitted when the local video state information has changed.

Available in the package com.voxeet.sdk.events.v2.VideoStateEvent.

mediaState (MediaState)

The new local video state.

StreamAddedEvent

Emitted in the following situations:

  • A conference participant with an enabled microphone joins a conference.
  • A conference participant starts sharing a screen.

Available in the package com.voxeet.sdk.events.v2.StreamAddedEvent.

participant (Participant)

The conference participant.

mediaStream (MediaStream)

The media stream.

StreamRemovedEvent

Emitted in the following situations:

  • A conference participant stops sharing a screen.
  • A conference participant leaves a conference.

Available in the package com.voxeet.sdk.events.v2.StreamRemovedEvent.

participant (Participant)

The conference participant.

mediaStream (MediaStream)

The media stream.

StreamUpdatedEvent

Emitted when a conference participant enables or disables camera.

Available in the package com.voxeet.sdk.events.v2.StreamUpdatedEvent.

participant (Participant)

The conference participant.

mediaStream (MediaStream)

The media stream.

ParticipantAddedEvent

Emitted when a new participant is invited to a conference or joines a conference.

Available in the package com.voxeet.sdk.events.v2.ParticipantAddedEvent.

participant (Participant)

The conference participant.

ParticipantUpdatedEvent

Emitted when a status of the Participant changes during a conference.

Available in the package com.voxeet.sdk.events.v2.ParticipantUpdatedEvent.

participant (Participant)

The conference participant.

ConferenceStatusUpdatedEvent

Emitted when ta conference changes status.

Available in the package com.voxeet.sdk.events.sdk.ConferenceStatusUpdatedEvent.

state (ConferenceStatus)

The new status.

conference (Conference)

The conference. It can be a null value in case when nobody joined the conference.

conferenceAlias (String)

The conference alias. It is a mandatory property if nobody joined the conference.