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 API workflow:

1. The application calls the create method to create a conference.

2. The application then joins the conference through the join or listen method.

3. The application can interact with the conference to:

  • Request a specific quality of received Simulcast video streams through the Simulcast method.
  • 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 state of conference participants through the mute method.
  • Check WebRTC statistics through the localStats method.

4. The application calls the leave method to leave the conference.

Events are emitted in the following situations:

Events

statusUpdated

statusUpdated(status: VTConferenceStatus)

Emitted when the conference status is updated.

Parameters:

NameType
statusVTConferenceStatus

participantAdded

participantAdded(participant: VTParticipant)

Emitted when a participant is added to the conference.

Parameters:

NameType
participantVTParticipant

participantUpdated

participantUpdated(participant: VTParticipant)

Emitted when the participant's status is updated.

Parameters:

NameType
participantVTParticipant

streamAdded

streamAdded(participant: VTParticipant, stream: MediaStream)

Emitted in the following situations:

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

Parameters:

NameType
participantVTParticipant
streamMediaStream

streamUpdated

streamUpdated(participant: VTParticipant, stream: MediaStream)

Emitted when a conference participant enables or disables camera.

Parameters:

NameType
participantVTParticipant
streamMediaStream

streamRemoved

streamRemoved(participant: VTParticipant, stream: MediaStream)

Emitted in the following situations:

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

Parameters:

NameType
participantVTParticipant
streamMediaStream

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:

NameTypeDefault
optionsVTConferenceOptions?nil
success((_ conference: VTConference) -> Void)?nil
fail((_ error: NSError) -> Void)?nil

fetch

fetch(conferenceID: String, completion: (VTConference) -> Void)

Provides a Conference object that allows joining a conference.

Parameters:

NameType
conferenceIDString
completion(VTConference) -> Void

join

join(conference: VTConference, options: VTJoinOptions?, success: (( conference: VTConference) -> Void)?, fail: (( error: NSError) -> Void)?)

Joins the conference.

Parameters:

NameTypeDefault
conferenceVTConference-
optionsVTJoinOptions?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:

NameTypeDefault
conferenceVTConference-
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:

NameTypeDefaultDescription
conferenceVTConference--
offsetInt?0Replays the conference from this offset (in milliseconds)
completion((_ error: NSError?) -> Void)?nil-

leave

leave(completion: ((_ error: NSError?) -> Void)?)

Leaves the conference.

Parameters:

NameTypeDefault
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:

NameType
participantVTParticipant

Returns: Double


isSpeaking

isSpeaking(participant: VTParticipant) : Bool

Gets the current participant's speaking status.

Parameters:

NameType
participantVTParticipant

Returns: Bool


mute

mute(participant: VTParticipant, isMuted: boolean)

Mutes the participant.

Parameters:

NameType
participantParticipant
isMutedboolean

startVideo

startVideo(participant: VTParticipant?, isDefaultFrontFacing: Bool, completion: ((_ error: NSError?) -> Void)?)

Starts a video stream for the participant.

Parameters:

NameTypeDefault
participantVTParticipant?-
isDefaultFrontFacingBooltrue
completion((_ error: NSError?) -> Void)?nil

stopVideo

stopVideo(participant: VTParticipant?, completion: ((_ error: NSError?) -> Void)?)

Stops the video stream for the participant.

Parameters:

NameTypeDefault
participantVTParticipant?-
completion((_ error: NSError?) -> Void)?nil


startAudio

startAudio(participant: VTParticipant?, completion: ((_ error: NSError?) -> Void)?)

Starts an audio stream for the participant.

Parameters:

NameTypeDefault
participantVTParticipant?-
completion((_ error: NSError?) -> Void)?nil

stopAudio

stopAudio(participant: VTParticipant?, completion: ((_ error: NSError?) -> Void)?)

Stops an audio stream for the participant.

Parameters:

NameTypeDefault
participantVTParticipant?-
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.

NameTypeDefault
broadcastbooleanfalse
completion((_ error: NSError?) -> Void)?nil

stopScreenShare

stopScreenShare(completion: ((_ error: NSError?) -> Void)?)

Stops the screen sharing session.

NameTypeDefault
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.

NameTypeDefault
requested[VTParticipantQuality]-
completion((_ error: NSError?) -> Void)?nil

localStats

localStats(): [[String: Any]]?

Provides the WebRTC statistics.

Returns: [[String: Any]]?