CommsAPI is a main object that allows an application to interact with Dolby.io services.

Properties

audio

audio: AudioService

Retrieves the AudioService instance that allows changing audio settings for the local and remote participants.

This API is available in SDK 3.7 and later.


command

command: CommandService

Retrieves the CommandService instance that allows sending messages to conferences.


conference

conference: ConferenceService

Retrieves the ConferenceService instance that allows interacting with conferences.


filePresentation

filePresentation: FilePresentationService

Retrieves the FilePresentationService instance that allows presenting files during conferences.


mediaDevice

mediaDevice: MediaDeviceService

Retrieves the MediaDeviceService instance that allows interacting with devices through the system.


notification

notification: NotificationService

Retrieves the NotificationService instance that allows inviting participants to a conference.


recording

recording: RecordingService

Retrieves the RecordingService instance that allows recording conferences.


session

session: SessionService

Retrieves the SessionService instance that allows using sessions.


videoPresentation

videoPresentation: VideoPresentationService

Retrieves the VideoPresentationService instance that allows presenting videos during conferences.


video

video: VideoService

Retrieves the VideoService instance that allows enabling and disabling video for the local and remote participants.

This API is available in SDK 3.7 and later.

Methods

initialize

initialize(consumerKey, consumerSecret): Promise<null>

Initializes the SDK using the customer key and secret.

Parameters

NameTypeDescription
consumerKeystringThe customer key.
consumerSecretstringThe customer secret.

Returns

Promise<null>


initializeToken

initializeToken(accessToken, refreshAccessToken): Promise<null>

Initializes the SDK with an access token that is provided by the customer backend communicating with Dolby.io servers. The token allows securing the App key and App secret.
The following diagram presents the authentication flow:

Client          Customer Server       Dolby Server
|                    |                    |
|  Get Access Token  |  /oauth2/token (1) |
|------------------->|------------------->|
|    Access Token    |    Access Token    |
|<-------------------|<-------------------|
|  initializeToken(accessToken, callback) |
|---------------------------------------->|

Where (1) is the REST API endpoint that is available on Dolby.io servers and documented on the developer portal.

The access token has a limited period of validity and needs to be refreshed for security reasons. In such case, the SDK calls the callback provided to initializeToken. The callback must return a promise containing the refreshed access token by calling the customer backend, as presented in the following diagram:

Client          Customer Server       Dolby Server
|      callback      |  /oauth2/token (2) |
|------------------->|------------------->|
|    Access Token    |    Access Token    |
|<-------------------|<-------------------|

Where (2) is the REST API endpoint that is available on Dolby.io servers and documented on the developer portal.

Parameters

NameTypeDescription
accessTokennull | stringThe access token provided by the customer's backend.
refreshAccessTokenRefreshAccessTokenTypeA callback that returns a promise when the access token needs to be refreshed. The callback parameter takes the isExpired boolean parameter to check if the previous token has expired.

Returns

Promise<null>