ConferenceService
The ConferenceService allows the application to manage the conference life cycle and interact with the conference.
Typical API workflow:
1. The application calls the create method to create a conference.
2. The application calls the fetch method to receive the conference object.
3. The application joins the conference through the join or listen method.
4. The application can interact with the conference to:
- Request a specific quality of received Simulcast video streams through the Simulcast method.
- Send audio streams using the startAudio and stopAudio methods.
- Send media and video streams using the startVideo and stopVideo methods.
- Share the screen using the startScreenShare and stopScreenShare methods.
- Replay the recorded conference through the replay method.
- Check the audio level using the audioLevel method.
- Check the speaking status of a participant using the isSpeaking method.
- Control the mute input state of conference participants through the mute method.
- Inform whether a local participant is muted.
- Control the mute output state of conference participants through the muteOutput method.
- Check WebRTC statistics through the localStats method.
- Control the audio processing state through the audioProcessing method.
5. The application calls the leave method to leave the conference.
Events are emitted in the following situations:
- A new participant joined the conference and changed status.
- A stream was added, updated, or removed.
- The conference changed its status.
Events
statusUpdated
▸ statusUpdated(status
: VTConferenceStatus)
Emitted when the conference status is updated.
Parameters:
Name | Type |
---|---|
status | VTConferenceStatus |
participantAdded
▸ participantAdded(participant
: VTParticipant)
Emitted when a participant is added to the conference. The SDK does not emit the participantAdded event for a local participant.
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
participantUpdated
▸ participantUpdated(participant
: VTParticipant)
The following graphic shows possible status changes during a conference:

Parameters:
Name | Type |
---|---|
participant | VTParticipant |
streamAdded
▸ streamAdded(participant
: VTParticipant, stream
: MediaStream)
Emitted in the following situations:
- A conference participant with disabled audio and video enables audio or video.
- A conference participant starts sharing a screen.
Each conference participant can be connected to two streams: audio and video stream
and screen-share stream
. If a participant enables audio or video, the SDK adds the audio and video stream
to the participant. However, if a participant connected to the audio and video stream
changes the stream, for example, a user with enabled audio also enables a video, the SDK updates the audio and video stream
. The following graphic shows this behavior:
When a participant joins a conference with enabled audio and video, the SDK emits the streamAdded and streamUpdated events.
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
stream | MediaStream |
streamUpdated
▸ streamUpdated(participant
: VTParticipant, stream
: MediaStream)
Emitted when a conference participant updates the audio and video stream
.
Each conference participant can be connected to two streams: audio and video stream
and screen-share stream
. If a participant enables audio or video, the SDK adds the audio and video stream
to the participant. However, if a participant connected to the audio and video stream
changes the stream, for example, a user with enabled audio also enables a video, the SDK updates the audio and video stream
. The following graphic shows this behavior:
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
stream | MediaStream |
streamRemoved
▸ streamRemoved(participant
: VTParticipant, stream
: MediaStream)
Emitted when a participant removes audio and video stream
or screen-share stream
by disabling audio and video or by stopping a screen-share presentation.
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
stream | MediaStream |
Accessors
current
▸ current: VTConference?
Provides the current conference.
Returns: VTConference?
delegate
▸ delegate: VTConferenceDelegate
Delegate, a means of communication between objects in the conference service.
Returns: VTConferenceDelegate
cryptoDelegate
▸ cryptoDelegate: VTConferenceCryptoDelegate
Encryption delegate, a means of communication between objects in the conference service.
Returns: VTConferenceCryptoDelegate
Methods
create
▸ create(options
: VTConferenceOptions?, success
: (( conference: VTConference) -> Void)?, fail
: (( error: NSError) -> Void)?)
Creates a conference.
Parameters:
Name | Type | Default |
---|---|---|
options | VTConferenceOptions? | nil |
success | ((_ conference: VTConference) -> Void)? | nil |
fail | ((_ error: NSError) -> Void)? | nil |
fetch
▸ fetch(conferenceID
: String, completion
: (VTConference) -> Void)
Provides the conference object which allows joining a conference.
Parameters:
Name | Type |
---|---|
conferenceID | String |
completion | (VTConference) -> Void |
join
▸ join(conference
: VTConference, options
: VTJoinOptions?, success
: (( conference: VTConference) -> Void)?, fail
: (( error: NSError) -> Void)?)
Joins the conference.
Parameters:
Name | Type | Default |
---|---|---|
conference | VTConference | - |
options | VTJoinOptions? | nil |
success | ((_ conference: VTConference) -> Void)? | nil |
fail | ((_ error: NSError) -> Void)? | nil |
listen
▸ listen(conference
: VTConference, success
: (( conference: VTConference) -> Void)?, fail
: (( error: NSError) -> Void)?)
Listens to the conference.
Parameters:
Name | Type | Default |
---|---|---|
conference | VTConference | - |
success | ((_ conference: VTConference) -> Void)? | nil |
fail | ((_ error: NSError) -> Void)? | nil |
replay
▸ replay(conference
: VTConference, offset
: Int?, completion
: ((_ error: NSError?) -> Void)?)
Replays the previously recorded conference.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
conference | VTConference | - | - |
offset | Int? | 0 | Replays the conference from this offset (in milliseconds) |
completion | ((_ error: NSError?) -> Void)? | nil | - |
leave
▸ leave(completion
: ((_ error: NSError?) -> Void)?)
Leaves the conference.
Parameters:
Name | Type | Default |
---|---|---|
completion | ((_ error: NSError?) -> Void)? | nil |
audioLevel
▸ audioLevel(participant
: VTParticipant): Double
Gets the current audio level of the participant, normalized between 0.0 and 1.0.
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
Returns: Double
isSpeaking
▸ isSpeaking(participant
: VTParticipant) : Bool
Gets the current participant's speaking status.
Parameters:
Name | Type |
---|---|
participant | VTParticipant |
Returns: Bool
isMuted
▸ isMuted() -> Bool
Informs whether a participant is muted.
Note: This API is no longer supported for remote participants.
mute
▸ mute(participant
: VTParticipant, isMuted
: boolean, completion
: ((_ error: NSError?) -> Void)? = nil
Stops playing the specified remote participants' audio to the local participant or stops playing the local participant's audio to the conference. The mute method does not notify the server to stop audio stream transmission. To stop sending an audio stream to the server or to stop receiving an audio stream from the server, use the stopAudio method.
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.
Parameters:
Name | Type | Default |
---|---|---|
isMuted | boolean | - |
completion | ((_ error: NSError?) -> Void)? | nil |
muteOutput
▸ muteOutput(isMuted
: boolean, completion
: ((_ error: NSError?) -> Void)?)
Controls playing remote participants' audio to the local participant.
Note: This API is only supported when the client connects to a Dolby Voice conference.
Parameters:
Name | Type | Default |
---|---|---|
isMuted | boolean | - |
completion | ((_ error: NSError?) -> Void)? | nil |
startVideo
▸ startVideo(participant
: VTParticipant?, isDefaultFrontFacing
: Bool, completion
: ((_ error: NSError?) -> Void)?)
Notifies the server to either start sending the local participant's video stream to the conference or start sending a remote participant's video stream to the local participant. The startVideo method does not control the remote participant's video stream; if a remote participant does not transmit any video stream, the local participant cannot change it using the startVideo method.
Parameters:
Name | Type | Default |
---|---|---|
participant | VTParticipant? | - |
isDefaultFrontFacing | Bool | true |
completion | ((_ error: NSError?) -> Void)? | nil |
stopVideo
▸ stopVideo(participant
: VTParticipant?, completion
: ((_ error: NSError?) -> Void)?)
Notifies the server to either stop sending the local participant's video stream to the conference or stop sending a remote participant's video stream to the local participant.
Parameters:
Name | Type | Default |
---|---|---|
participant | VTParticipant? | - |
completion | ((_ error: NSError?) -> Void)? | nil |
startAudio
▸ startAudio(participant
: VTParticipant?, completion
: ((_ error: NSError?) -> Void)?)
Notifies the server to either start sending the local participant's audio stream to the conference or start sending a remote participant's audio stream to the local participant. The startAudio method does not control the remote participant's audio stream; if a remote participant does not transmit any audio stream, the local participant cannot change it using the startAudio method.
Note: This API is no longer supported when the client connects to a Dolby Voice conference.
Parameters:
Name | Type | Default |
---|---|---|
participant | VTParticipant? | - |
completion | ((_ error: NSError?) -> Void)? | nil |
stopAudio
▸ stopAudio(participant
: VTParticipant?, completion
: ((_ error: NSError?) -> Void)?)
Notifies the server to either stop sending the local participant's audio stream to the conference or stop sending a remote participant's audio stream to the local participant.
Note: This API is no longer supported when the client connects to a Dolby Voice conference.
Parameters:
Name | Type | Default |
---|---|---|
participant | VTParticipant? | - |
completion | ((_ error: NSError?) -> Void)? | nil |
startScreenShare
▸ startScreenShare(broadcast
: boolean, completion
: ((_ error: NSError?) -> Void)?)
Starts a screen sharing session. broadcast
parameter specifies if you want to use screen share inside (false), or outside (true) app.
An article has been created to help you setting up screen share outside app.
Name | Type | Default |
---|---|---|
broadcast | boolean | false |
completion | ((_ error: NSError?) -> Void)? | nil |
stopScreenShare
▸ stopScreenShare(completion
: ((_ error: NSError?) -> Void)?)
Stops the screen sharing session.
Name | Type | Default |
---|---|---|
completion | ((_ error: NSError?) -> Void)? | nil |
simulcast
▸ simulcast(requested
: [VTParticipantQuality], completion
: ((_ error: NSError?) -> Void)?)
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.
Name | Type | Default |
---|---|---|
requested | [VTParticipantQuality] | - |
completion | ((_ error: NSError?) -> Void)? | nil |
localStats
▸ localStats(): [[String: Any]]?
Provides the WebRTC statistics.
Returns: [[String: Any]]?
audioProcessing
▸ audioProcessing(enable
: boolean)
Enables or disables audio processing.
Parameters:
Name | Type |
---|---|
enable | boolean |