ConferenceService

The ConferenceService allows an application to manage the conference life-cycle and interact with a conference. The service allows creating, joining, and leaving conferences and managing the audio, video, and screen-share streams.

Methods

create

create(options?): Promise<Conference>

Creates a conference and returns the Conference object.

Parameters

NameTypeDescription
optionsConferenceCreateOptionsThe options for the conference creation.

Returns

Promise<Conference>


current

current(): Promise<Conference>

Returns the Conference object for the current conference.

Returns

Promise<Conference>


fetch

fetch(conferenceId?): Promise<Conference>

Returns a Conference object that can be used to join the conference. If the conference ID is not provided, the method returns the current Conference object.

Parameters

NameTypeDescription
conferenceId?stringThe conference ID.

Returns

Promise<Conference>


getAudioLevel

getAudioLevel(participant): Promise<number>

Returns the participant's audio level, in the range from 0.0 to 1.0.

Parameters

NameTypeDescription
participantParticipantThe Participant object.

Returns

Promise<number>


getLocalStats

getLocalStats(): Promise<RTCStatsType[]>

Gets the standard WebRTC statistics.

Returns

Promise<RTCStatsType[]>


getMaxVideoForwarding

getMaxVideoForwarding(): Promise<number>

Returns the maximum number of video streams that can be transmitted to the local participant.

Returns

Promise<number>


getParticipant

getParticipant(participantId): Promise<Participant>

Gets the Participant object for the specified ID.

Parameters

NameTypeDescription
participantIdStringThe participant ID.

Returns

Promise<Participant>


getParticipants

getParticipants(conference): Promise<Participant[]>

Gets the list of conference participant objects.

Parameters

NameType
conferenceConference

Returns

Promise<Participant[]>


getStatus

getStatus(conference): Promise<ConferenceStatus>

Gets the conference status.

Parameters

NameTypeDescription
conferenceConferenceThe Conference object.

Returns

Promise<ConferenceStatus>


isMuted

isMuted(): Promise<boolean>

Returns the current mute state of the local participant.

Returns

Promise<boolean>


isSpeaking

isSpeaking(participant): Promise<boolean>

Returns the participant's current speaking status for an active talker indicator.

Parameters

NameTypeDescription
participantParticipantThe Participant object.

Returns

Promise<boolean>


join

join(conference, options?): Promise<Conference>

Joins a conference and returns the Conference object.

Parameters

NameTypeDescription
conferenceConferenceThe Conference object.
options?ConferenceJoinOptionsThe additional options for the joining participant.

Returns

Promise<Conference>


listen

listen(conference, options?): 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.

Parameters

NameTypeDescription
conferenceConferenceThe Conference object.
options?ConferenceListenOptionsThe additional options for the joining participant.

Returns

Promise<Conference>


kick

kick(participant): Promise<void>

Kicks a participant out of the current conference. This actions requires you to be conference owner or to have the adequate permissions to kick a participant.

Parameters

NameTypeDescription
participantParticipantThe participant who needs to be kicked from a conference.

Returns

Promise<void>


leave

leave(options?): Promise<void>

Leaves the current conference.

Parameters

NameTypeDescription
options?ConferenceLeaveOptionsThe additional options for the leaving participant.

Returns

Promise<void>


mute

mute(participant, isMuted): Promise<boolean>

Stops playing the specified remote participants' audio to the local participant or stops playing the local participant's audio to the conference.

Note: The mute method depends on the Dolby Voice usage:

  • In conferences where Dolby Voice is not enabled, conference participants can mute themselves or remote participants.
  • In conferences where Dolby Voice is enabled, conference participants can only mute themselves.

If you wish to mute remote participants in Dolby Voice conferences, you must use the stopAudio API. This API allows the conference participants to stop receiving the specific audio streams from the server.

Parameters

NameTypeDescription
participantParticipantA remote participant.
isMutedbooleanThe mute state, true indicates that a participant is muted, false indicates that a participant is not muted.

Returns

Promise<boolean>


replay

replay(conference, replayOptions?): Promise<Conference>

Replays a previously recorded conference. For more information, see the Recording Conferences article.

Parameters

NameTypeDescription
conferenceConferenceThe Conference object.
replayOptions?ConferenceReplayOptionsThe replay options.

Returns

Promise<Conference>


videoForwarding

videoForwarding(options): Promise<any>

Sets the video forwarding functionality for the local participant. The method allows:

  • Setting the maximum number of video streams that may be transmitted to the local participant
  • Prioritizing specific participants' video streams that need to be transmitted to the local participant
  • Changing the video forwarding strategy that defines how the SDK should select conference participants whose videos will be received by the local participant

This method is available only in SDK 3.6 and later.

Parameters

NameTypeDescription
optionsVideoForwardingOptionsThe video forwarding options.

Returns

Promise<any>


startScreenShare

startScreenShare(): Promise<void>

Starts a screen sharing session.
The ScreenShare with iOS document (https://docs.dolby.io/communications-apis/docs/screenshare-with-ios) describes how to set up screen-share outside the application.
Instead of setting the following properties:

  • CommsSDK.shared.appGroup = "YOUR_APP_GROUP"
  • CommsSDK.shared.preferredExtension = "YOUR_BROADCAST_EXTENSION_BUNDLE_ID"
    Set up keys in your Info.plist file:
  • Add a new DolbyioSdkAppGroupKey as a string type and enter the group name ("YOUR_APP_GROUP").
  • Add a new DolbyioSdkPreferredExtensionKey as a string type and enter the broadcast extension bundle ID ("YOUR_BROADCAST_EXTENSION_BUNDLE_ID").

Returns

Promise<void>


stopScreenShare

stopScreenShare(): Promise<void>

Stops a screen sharing session.

Returns

Promise<void>


setSpatialDirection

setSpatialDirection(direction): Promise<void>

Sets the direction the local participant is facing in space. The method is available only for the participant who:

If the local participant hears audio from the position (0,0,0) facing down the Z-axis and locates a remote participant in the position (1,0,1), the local participant hears the remote participant from front-right. If the local participant chooses to change the direction and rotate +90 degrees about the Y-axis, then instead of hearing the speaker from the front-right position, the participant hears the speaker from the front-left position. The following video presents this example:

For more information, see the SpatialDirection model.

Parameters

NameTypeDescription
directionSpatialDirectionThe direction the local participant is facing in space.

Returns

Promise<void>


setSpatialEnvironment

setSpatialEnvironment(scale, forward, up, right): Promise<void>

Configures a spatial environment of an application, so the audio renderer understands which directions the application considers forward, up, and right and which units it uses for distance. The method is available only for the local participant who:

If not called, the SDK uses the default spatial environment, which consists of the following values:

  • forward = (0, 0, 1), where +Z axis is in front
  • up = (0, 1, 0), where +Y axis is above
  • right = (1, 0, 0), where +X axis is to the right
  • scale = (1, 1, 1), where one unit on any axis is 1 meter

The default spatial environment is presented in the following diagram:

1920

Parameters

NameTypeDescription
scaleSpatialScaleA scale that defines how to convert units from the coordinate system of an application (pixels or centimeters) into meters used by the spatial audio coordinate system. For example, if SpatialScale is set to (100,100,100), it indicates that 100 of the applications units (cm) map to 1 meter for the audio coordinates. In such a case, if the listener's location is (0,0,0)cm and a remote participant's location is (200,200,200)cm, the listener has an impression of hearing the remote participant from the (2,2,2)m location. The scale value must be greater than 0. For more information, see the Spatial Chat article.
forwardSpatialPositionA vector describing the direction the application considers as forward. The value can be either +1, 0, or -1 and must be orthogonal to up and right.
upSpatialPositionA vector describing the direction the application considers as up. The value can be either +1, 0, or -1 and must be orthogonal to forward and right.
rightSpatialPositionA vector describing the direction the application considers as right. The value can be either +1, 0, or -1 and must be orthogonal to forward and up.

Returns

Promise<void>


setSpatialPosition

setSpatialPosition(participant, position): Promise<void>

Sets a participant's position in space to enable the spatial audio experience during a conference. The method is available only for the participant who:

Depending on the specified participant in the participant parameter, the setSpatialPosition method impacts the location from which audio is heard or from which audio is rendered:

  • When the specified participant is the local participant, setSpatialPosition sets the location from which the local participant listens to the conference. If this location is not provided, the participant hears audio from the default location (0, 0, 0).

  • When the specified participant is a remote participant, setSpatialPosition ensures the remote participant's audio is rendered from the specified position in space. If the position of the remote participant is not provided, the participant does not have a default position and remains muted until a position is specified.

For example, if a local participant Eric, who does not have a set direction, calls setSpatialPosition(VoxeetSDK.session.participant, {x:3,y:0,z:0}), Eric hears audio from the position (3,0,0). If Eric also calls setSpatialPosition(Sophia, {x:7,y:1,z:2}), he hears Sophia from the position (7,1,2). In this case, Eric hears Sophia 4 meters to the right, 1 meter above, and 2 meters in front. The following graphic presents the participants' locations:

1920

Parameters

NameTypeDescription
participantParticipantThe selected participant, either local or remote. In a case of the local participant, the SDK sets the location from which the participant will hear a conference. In a case of a remote participant, the SDK sets the position from which the participant's audio will be rendered.
positionSpatialPositionThe participant's audio location.

Returns

Promise<void>


updatePermissions

updatePermissions(participantPermissions): Promise<void>

Updates the participant's conference permissions.

Parameters

NameTypeDescription
participantPermissionsParticipantPermissions[]The set of participant's conference permissions.

Returns

Promise<void>


Event handlers

onStatusChange

onStatusChange(handler): UnsubscribeFunction

Adds a listener to the conference status changed event.

Parameters

NameTypeDescription
handler(data: ConferenceStatusUpdatedEventType) => voidAn event callback function.

Returns

UnsubscribeFunction

A function that unsubscribes from event listeners.


onPermissionsChange

onPermissionsChange(handler): UnsubscribeFunction

Adds a listener to the permissions changed event.

Parameters

NameTypeDescription
handler(data: PermissionsUpdatedEventType) => voidAn event callback function.

Returns

UnsubscribeFunction

A function that unsubscribes from event listeners.


onParticipantsChange

onParticipantsChange(handler): UnsubscribeFunction

Adds a listener to the participants changed event.

Parameters

NameTypeDescription
handler(data: ParticipantChangedEventType, type?: ParticipantAdded | ParticipantUpdated) => voidAn event callback function.

Returns

UnsubscribeFunction

A function that unsubscribes from event listeners.


onStreamsChange

onStreamsChange(handler): UnsubscribeFunction

Adds a listener to the streams changed event.

Parameters

NameTypeDescription
handler(data: StreamChangedEventType, type?: StreamAdded | StreamUpdated | StreamRemoved) => voidAn event callback function.

Returns

UnsubscribeFunction

A function that unsubscribes from event listeners.