SessionService

The SessionService allows opening and closing sessions. Opening a session is mandatory before interacting with any service.

Methods

close

close(): Promise<void>

Closes the current session.

Returns

Promise<void>


getParticipant

getParticipant(): Promise<Participant>

Provides the local participant object that belongs to the current session.

Returns

Promise<Participant>


isOpen

isOpen(): Promise<Boolean>

Returns if a session that connects the SDK with the Dolby.io platform is opened or not.

Returns

Promise<Boolean>


open

open(participantInfo?): Promise<void>

Opens a new session. If you initialize the SDK with a client access token, provide the external ID in the REST API request, not in the open method. Otherwise, you may expect the platform to either ignore the external ID provided in the open method or receive an error if the provided ID is different from the one provided in the REST API request.

Note: The external ID field in this API has been deprecated; now you can provide the external ID only when requesting a client access token. If you provide to this API an external ID that is different from the one in your client access token, it will be rejected.

Parameters

NameTypeDescription
participantInfoParticipantInfoThe optional information about the local participant.

Returns

Promise<void>


updateParticipantInfo

updateParticipantInfo(name, avatarUrl): Promise<void>

Updates the local participant's name and avatar URL. This method is supported in SDK 3.10 and later.

Parameters

NameTypeDescription
nameStringThe participant's name.
avatarUrlStringThe URL of the participant's avatar.

Returns

Promise<void>