CallAdapter interface

An Adapter interface specific for Azure Communication identity which extends CommonCallAdapter.

Extends

Methods

joinCall(boolean)

Join the call with microphone initially on/off.

startCall(string[], StartCallOptions)

Start the call.

Inherited Methods

askDevicePermission(PermissionConstraints)

Ask for permissions of devices.

createStreamView(string, VideoStreamOptions)

Create the html view for a stream.

dispose()

Dispose of the Composite

disposeStreamView(string, VideoStreamOptions)

Dispose the html view for a stream.

getState()

Get the current State

leaveCall(boolean)

Leave the call

mute()

Mute the current user during the call or disable microphone locally

off("callEnded", CallEndedListener)

Unsubscribe function for 'callEnded' event.

off("callIdChanged", CallIdChangedListener)

Unsubscribe function for 'callIdChanged' event.

off("diagnosticChanged", DiagnosticChangedEventListner)

Unsubscribe function for 'diagnosticChanged' event.

off("displayNameChanged", DisplayNameChangedListener)

Unsubscribe function for 'displayNameChanged' event.

off("error", (e: AdapterError) => void)

Unsubscribe function for 'error' event.

off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.

off("isMutedChanged", IsMutedChangedListener)

Unsubscribe function for 'isMutedChanged' event.

off("isSpeakingChanged", IsSpeakingChangedListener)

Unsubscribe function for 'isSpeakingChanged' event.

off("participantsJoined", ParticipantsJoinedListener)

Unsubscribe function for 'participantsJoined' event.

off("participantsLeft", ParticipantsLeftListener)

Unsubscribe function for 'participantsLeft' event.

off("selectedMicrophoneChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedMicrophoneChanged' event.

off("selectedSpeakerChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedSpeakerChanged' event.

offStateChange((state: CallAdapterState) => void)

Unsubscribes the handler to stateChanged events.

on("callEnded", CallEndedListener)

Subscribe function for 'callEnded' event.

on("callIdChanged", CallIdChangedListener)

Subscribe function for 'callIdChanged' event.

on("diagnosticChanged", DiagnosticChangedEventListner)

Subscribe function for 'diagnosticChanged' event.

This event fires whenever there is a change in user facing diagnostics about the ongoing call.

on("displayNameChanged", DisplayNameChangedListener)

Subscribe function for 'displayNameChanged' event.

on("error", (e: AdapterError) => void)

Subscribe function for 'error' event.

on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Subscribe function for 'isLocalScreenSharingActiveChanged' event.

on("isMutedChanged", IsMutedChangedListener)

Subscribe function for 'isMutedChanged' event.

on("isSpeakingChanged", IsSpeakingChangedListener)

Subscribe function for 'isSpeakingChanged' event.

on("participantsJoined", ParticipantsJoinedListener)

Subscribe function for 'participantsJoined' event.

on("participantsLeft", ParticipantsLeftListener)

Subscribe function for 'participantsLeft' event.

on("selectedMicrophoneChanged", PropertyChangedEvent)

Subscribe function for 'selectedMicrophoneChanged' event.

This event fires whenever the user selects a new microphone device.

on("selectedSpeakerChanged", PropertyChangedEvent)

Subscribe function for 'selectedSpeakerChanged' event.

This event fires whenever the user selects a new speaker device.

onStateChange((state: CallAdapterState) => void)

Subscribes the handler to stateChanged events.

queryCameras()

Query for available camera devices.

queryMicrophones()

Query for available microphone devices.

querySpeakers()

Query for available microphone devices.

removeParticipant(string)

Remove a participant from the call.

setCamera(VideoDeviceInfo, VideoStreamOptions)

Set the camera to use in the call.

setMicrophone(AudioDeviceInfo)

Set the microphone to use in the call.

setSpeaker(AudioDeviceInfo)

Set the speaker to use in the call.

startCamera(VideoStreamOptions)

Start the camera This method will start rendering a local camera view when the call is not active

startScreenShare()

Start sharing the screen during a call.

stopCamera()

Stop the camera This method will stop rendering a local camera view when the call is not active

stopScreenShare()

Stop sharing the screen

unmute()

Unmute the current user during the call or enable microphone locally

Method Details

joinCall(boolean)

Join the call with microphone initially on/off.

function joinCall(microphoneOn?: boolean): undefined | Call

Parameters

microphoneOn

boolean

Whether microphone is initially enabled

Returns

undefined | Call

startCall(string[], StartCallOptions)

Start the call.

function startCall(participants: string[], options?: StartCallOptions): undefined | Call

Parameters

participants

string[]

An array of participant ids to join

Returns

undefined | Call

Inherited Method Details

askDevicePermission(PermissionConstraints)

Ask for permissions of devices.

function askDevicePermission(constrain: PermissionConstraints): Promise<void>

Parameters

constrain
PermissionConstraints

Define constraints for accessing local devices <xref:%40azure%2Fcommunication-calling%23PermissionConstraints>

Returns

Promise<void>

Remarks

Browser permission window will pop up if permissions are not granted yet

Inherited From CommonCallAdapter.askDevicePermission

createStreamView(string, VideoStreamOptions)

Create the html view for a stream.

function createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>

Parameters

remoteUserId

string

Id of the participant to render, leave it undefined to create the local camera view

options
VideoStreamOptions

Options to control how video streams are rendered <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

Returns

Promise<void | CreateVideoStreamViewResult>

Remarks

This method is implemented for composite

Inherited From CommonCallAdapter.createStreamView

dispose()

Dispose of the Composite

function dispose()

Inherited From CommonCallAdapter.dispose

disposeStreamView(string, VideoStreamOptions)

Dispose the html view for a stream.

function disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>

Parameters

remoteUserId

string

Id of the participant to render, leave it undefined to dispose the local camera view

options
VideoStreamOptions

Options to control how video streams are rendered <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

Returns

Promise<void>

Remarks

This method is implemented for composite

Inherited From CommonCallAdapter.disposeStreamView

getState()

Get the current State

function getState(): CallAdapterState

Returns

Inherited From CommonCallAdapter.getState

leaveCall(boolean)

Leave the call

function leaveCall(forEveryone?: boolean): Promise<void>

Parameters

forEveryone

boolean

Whether to remove all participants when leaving

Returns

Promise<void>

Inherited From CommonCallAdapter.leaveCall

mute()

Mute the current user during the call or disable microphone locally

function mute(): Promise<void>

Returns

Promise<void>

Inherited From CommonCallAdapter.mute

off("callEnded", CallEndedListener)

Unsubscribe function for 'callEnded' event.

function off(event: "callEnded", listener: CallEndedListener)

Parameters

event

"callEnded"

Inherited From CommonCallAdapter.off

off("callIdChanged", CallIdChangedListener)

Unsubscribe function for 'callIdChanged' event.

function off(event: "callIdChanged", listener: CallIdChangedListener)

Parameters

event

"callIdChanged"

Inherited From CommonCallAdapter.off

off("diagnosticChanged", DiagnosticChangedEventListner)

Unsubscribe function for 'diagnosticChanged' event.

function off(event: "diagnosticChanged", listener: DiagnosticChangedEventListner)

Parameters

event

"diagnosticChanged"

Inherited From CommonCallAdapter.off

off("displayNameChanged", DisplayNameChangedListener)

Unsubscribe function for 'displayNameChanged' event.

function off(event: "displayNameChanged", listener: DisplayNameChangedListener)

Parameters

event

"displayNameChanged"

Inherited From CommonCallAdapter.off

off("error", (e: AdapterError) => void)

Unsubscribe function for 'error' event.

function off(event: "error", listener: (e: AdapterError) => void)

Parameters

event

"error"

listener

(e: AdapterError) => void

Inherited From CommonCallAdapter.off

off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.

function off(event: "isLocalScreenSharingActiveChanged", listener: IsLocalScreenSharingActiveChangedListener)

Parameters

event

"isLocalScreenSharingActiveChanged"

Inherited From CommonCallAdapter.off

off("isMutedChanged", IsMutedChangedListener)

Unsubscribe function for 'isMutedChanged' event.

function off(event: "isMutedChanged", listener: IsMutedChangedListener)

Parameters

event

"isMutedChanged"

Inherited From CommonCallAdapter.off

off("isSpeakingChanged", IsSpeakingChangedListener)

Unsubscribe function for 'isSpeakingChanged' event.

function off(event: "isSpeakingChanged", listener: IsSpeakingChangedListener)

Parameters

event

"isSpeakingChanged"

Inherited From CommonCallAdapter.off

off("participantsJoined", ParticipantsJoinedListener)

Unsubscribe function for 'participantsJoined' event.

function off(event: "participantsJoined", listener: ParticipantsJoinedListener)

Parameters

event

"participantsJoined"

Inherited From CommonCallAdapter.off

off("participantsLeft", ParticipantsLeftListener)

Unsubscribe function for 'participantsLeft' event.

function off(event: "participantsLeft", listener: ParticipantsLeftListener)

Parameters

event

"participantsLeft"

Inherited From CommonCallAdapter.off

off("selectedMicrophoneChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedMicrophoneChanged' event.

function off(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)

Parameters

event

"selectedMicrophoneChanged"

Inherited From CommonCallAdapter.off

off("selectedSpeakerChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedSpeakerChanged' event.

function off(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)

Parameters

event

"selectedSpeakerChanged"

Inherited From CommonCallAdapter.off

offStateChange((state: CallAdapterState) => void)

Unsubscribes the handler to stateChanged events.

function offStateChange(handler: (state: CallAdapterState) => void)

Parameters

handler

(state: CallAdapterState) => void

Inherited From CommonCallAdapter.offStateChange

on("callEnded", CallEndedListener)

Subscribe function for 'callEnded' event.

function on(event: "callEnded", listener: CallEndedListener)

Parameters

event

"callEnded"

Inherited From CommonCallAdapter.on

on("callIdChanged", CallIdChangedListener)

Subscribe function for 'callIdChanged' event.

function on(event: "callIdChanged", listener: CallIdChangedListener)

Parameters

event

"callIdChanged"

Remarks

The event will be triggered when callId of current user changed.

Inherited From CommonCallAdapter.on

on("diagnosticChanged", DiagnosticChangedEventListner)

Subscribe function for 'diagnosticChanged' event.

This event fires whenever there is a change in user facing diagnostics about the ongoing call.

function on(event: "diagnosticChanged", listener: DiagnosticChangedEventListner)

Parameters

event

"diagnosticChanged"

Inherited From CommonCallAdapter.on

on("displayNameChanged", DisplayNameChangedListener)

Subscribe function for 'displayNameChanged' event.

function on(event: "displayNameChanged", listener: DisplayNameChangedListener)

Parameters

event

"displayNameChanged"

Inherited From CommonCallAdapter.on

on("error", (e: AdapterError) => void)

Subscribe function for 'error' event.

function on(event: "error", listener: (e: AdapterError) => void)

Parameters

event

"error"

listener

(e: AdapterError) => void

Inherited From CommonCallAdapter.on

on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Subscribe function for 'isLocalScreenSharingActiveChanged' event.

function on(event: "isLocalScreenSharingActiveChanged", listener: IsLocalScreenSharingActiveChangedListener)

Parameters

event

"isLocalScreenSharingActiveChanged"

Inherited From CommonCallAdapter.on

on("isMutedChanged", IsMutedChangedListener)

Subscribe function for 'isMutedChanged' event.

function on(event: "isMutedChanged", listener: IsMutedChangedListener)

Parameters

event

"isMutedChanged"

Remarks

The event will be triggered whenever current user or remote user mute state changed

Inherited From CommonCallAdapter.on

on("isSpeakingChanged", IsSpeakingChangedListener)

Subscribe function for 'isSpeakingChanged' event.

function on(event: "isSpeakingChanged", listener: IsSpeakingChangedListener)

Parameters

event

"isSpeakingChanged"

Inherited From CommonCallAdapter.on

on("participantsJoined", ParticipantsJoinedListener)

Subscribe function for 'participantsJoined' event.

function on(event: "participantsJoined", listener: ParticipantsJoinedListener)

Parameters

event

"participantsJoined"

Inherited From CommonCallAdapter.on

on("participantsLeft", ParticipantsLeftListener)

Subscribe function for 'participantsLeft' event.

function on(event: "participantsLeft", listener: ParticipantsLeftListener)

Parameters

event

"participantsLeft"

Inherited From CommonCallAdapter.on

on("selectedMicrophoneChanged", PropertyChangedEvent)

Subscribe function for 'selectedMicrophoneChanged' event.

This event fires whenever the user selects a new microphone device.

function on(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)

Parameters

event

"selectedMicrophoneChanged"

Inherited From CommonCallAdapter.on

on("selectedSpeakerChanged", PropertyChangedEvent)

Subscribe function for 'selectedSpeakerChanged' event.

This event fires whenever the user selects a new speaker device.

function on(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)

Parameters

event

"selectedSpeakerChanged"

Inherited From CommonCallAdapter.on

onStateChange((state: CallAdapterState) => void)

Subscribes the handler to stateChanged events.

function onStateChange(handler: (state: CallAdapterState) => void)

Parameters

handler

(state: CallAdapterState) => void

Inherited From CommonCallAdapter.onStateChange

queryCameras()

Query for available camera devices.

function queryCameras(): Promise<VideoDeviceInfo[]>

Returns

Promise<VideoDeviceInfo[]>

An array of video device information entities <xref:%40azure%2Fcommunication-calling%23VideoDeviceInfo>

Remarks

This method should be called after askDevicePermission()

Inherited From CommonCallAdapter.queryCameras

queryMicrophones()

Query for available microphone devices.

function queryMicrophones(): Promise<AudioDeviceInfo[]>

Returns

Promise<AudioDeviceInfo[]>

An array of audio device information entities <xref:%40azure%2Fcommunication-calling%23AudioDeviceInfo>

Remarks

This method should be called after askDevicePermission()

Inherited From CommonCallAdapter.queryMicrophones

querySpeakers()

Query for available microphone devices.

function querySpeakers(): Promise<AudioDeviceInfo[]>

Returns

Promise<AudioDeviceInfo[]>

An array of audio device information entities <xref:%40azure%2Fcommunication-calling%23AudioDeviceInfo>

Remarks

This method should be called after askDevicePermission()

Inherited From CommonCallAdapter.querySpeakers

removeParticipant(string)

Remove a participant from the call.

function removeParticipant(userId: string): Promise<void>

Parameters

userId

string

Id of the participant to be removed

Returns

Promise<void>

Inherited From CommonCallAdapter.removeParticipant

setCamera(VideoDeviceInfo, VideoStreamOptions)

Set the camera to use in the call.

function setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>

Parameters

sourceInfo
VideoDeviceInfo

Camera device to choose, pick one returned by queryCameras

options
VideoStreamOptions

Options to control how the camera stream is rendered <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

Returns

Promise<void>

Inherited From CommonCallAdapter.setCamera

setMicrophone(AudioDeviceInfo)

Set the microphone to use in the call.

function setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>

Parameters

sourceInfo
AudioDeviceInfo

Microphone device to choose, pick one returned by queryMicrophones

Returns

Promise<void>

Inherited From CommonCallAdapter.setMicrophone

setSpeaker(AudioDeviceInfo)

Set the speaker to use in the call.

function setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>

Parameters

sourceInfo
AudioDeviceInfo

Speaker device to choose, pick one returned by querySpeakers

Returns

Promise<void>

Inherited From CommonCallAdapter.setSpeaker

startCamera(VideoStreamOptions)

Start the camera This method will start rendering a local camera view when the call is not active

function startCamera(options?: VideoStreamOptions): Promise<void>

Parameters

options
VideoStreamOptions

Options to control how video streams are rendered <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

Returns

Promise<void>

Inherited From CommonCallAdapter.startCamera

startScreenShare()

Start sharing the screen during a call.

function startScreenShare(): Promise<void>

Returns

Promise<void>

Inherited From CommonCallAdapter.startScreenShare

stopCamera()

Stop the camera This method will stop rendering a local camera view when the call is not active

function stopCamera(): Promise<void>

Returns

Promise<void>

Inherited From CommonCallAdapter.stopCamera

stopScreenShare()

Stop sharing the screen

function stopScreenShare(): Promise<void>

Returns

Promise<void>

Inherited From CommonCallAdapter.stopScreenShare

unmute()

Unmute the current user during the call or enable microphone locally

function unmute(): Promise<void>

Returns

Promise<void>

Inherited From CommonCallAdapter.unmute