CommonCallAdapter interface

CallComposite Adapter interface.

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)

Parameters

microphoneOn

boolean

Whether microphone is initially enabled

startCall(string[], StartCallOptions)

Start the call.

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

Parameters

participants

string[]

An array of participant ids to join

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 CallAdapterDeviceManagement.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 CallAdapterCallOperations.createStreamView

dispose()

Dispose of the Composite

function dispose()

Inherited From Disposable.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 CallAdapterCallOperations.disposeStreamView

getState()

Get the current State

function getState(): CallAdapterState

Returns

Inherited From AdapterState.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 CallAdapterCallOperations.leaveCall

mute()

Mute the current user during the call or disable microphone locally

function mute(): Promise<void>

Returns

Promise<void>

Inherited From CallAdapterCallOperations.mute

off("callEnded", CallEndedListener)

Unsubscribe function for 'callEnded' event.

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

Parameters

event

"callEnded"

Inherited From CallAdapterSubscribers.off

off("callIdChanged", CallIdChangedListener)

Unsubscribe function for 'callIdChanged' event.

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

Parameters

event

"callIdChanged"

Inherited From CallAdapterSubscribers.off

off("diagnosticChanged", DiagnosticChangedEventListner)

Unsubscribe function for 'diagnosticChanged' event.

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

Parameters

event

"diagnosticChanged"

Inherited From CallAdapterSubscribers.off

off("displayNameChanged", DisplayNameChangedListener)

Unsubscribe function for 'displayNameChanged' event.

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

Parameters

event

"displayNameChanged"

Inherited From CallAdapterSubscribers.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 CallAdapterSubscribers.off

off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.

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

Parameters

event

"isLocalScreenSharingActiveChanged"

Inherited From CallAdapterSubscribers.off

off("isMutedChanged", IsMutedChangedListener)

Unsubscribe function for 'isMutedChanged' event.

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

Parameters

event

"isMutedChanged"

Inherited From CallAdapterSubscribers.off

off("isSpeakingChanged", IsSpeakingChangedListener)

Unsubscribe function for 'isSpeakingChanged' event.

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

Parameters

event

"isSpeakingChanged"

Inherited From CallAdapterSubscribers.off

off("participantsJoined", ParticipantsJoinedListener)

Unsubscribe function for 'participantsJoined' event.

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

Parameters

event

"participantsJoined"

Inherited From CallAdapterSubscribers.off

off("participantsLeft", ParticipantsLeftListener)

Unsubscribe function for 'participantsLeft' event.

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

Parameters

event

"participantsLeft"

Inherited From CallAdapterSubscribers.off

off("selectedMicrophoneChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedMicrophoneChanged' event.

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

Parameters

event

"selectedMicrophoneChanged"

Inherited From CallAdapterSubscribers.off

off("selectedSpeakerChanged", PropertyChangedEvent)

Unsubscribe function for 'selectedSpeakerChanged' event.

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

Parameters

event

"selectedSpeakerChanged"

Inherited From CallAdapterSubscribers.off

offStateChange((state: CallAdapterState) => void)

Unsubscribes the handler to stateChanged events.

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

Parameters

handler

(state: CallAdapterState) => void

Inherited From AdapterState.offStateChange

on("callEnded", CallEndedListener)

Subscribe function for 'callEnded' event.

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

Parameters

event

"callEnded"

Inherited From CallAdapterSubscribers.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 CallAdapterSubscribers.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 CallAdapterSubscribers.on

on("displayNameChanged", DisplayNameChangedListener)

Subscribe function for 'displayNameChanged' event.

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

Parameters

event

"displayNameChanged"

Inherited From CallAdapterSubscribers.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 CallAdapterSubscribers.on

on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

Subscribe function for 'isLocalScreenSharingActiveChanged' event.

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

Parameters

event

"isLocalScreenSharingActiveChanged"

Inherited From CallAdapterSubscribers.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 CallAdapterSubscribers.on

on("isSpeakingChanged", IsSpeakingChangedListener)

Subscribe function for 'isSpeakingChanged' event.

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

Parameters

event

"isSpeakingChanged"

Inherited From CallAdapterSubscribers.on

on("participantsJoined", ParticipantsJoinedListener)

Subscribe function for 'participantsJoined' event.

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

Parameters

event

"participantsJoined"

Inherited From CallAdapterSubscribers.on

on("participantsLeft", ParticipantsLeftListener)

Subscribe function for 'participantsLeft' event.

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

Parameters

event

"participantsLeft"

Inherited From CallAdapterSubscribers.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 CallAdapterSubscribers.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 CallAdapterSubscribers.on

onStateChange((state: CallAdapterState) => void)

Subscribes the handler to stateChanged events.

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

Parameters

handler

(state: CallAdapterState) => void

Inherited From AdapterState.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 CallAdapterDeviceManagement.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 CallAdapterDeviceManagement.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 CallAdapterDeviceManagement.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 CallAdapterCallOperations.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 CallAdapterDeviceManagement.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 CallAdapterDeviceManagement.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 CallAdapterDeviceManagement.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 CallAdapterCallOperations.startCamera

startScreenShare()

Start sharing the screen during a call.

function startScreenShare(): Promise<void>

Returns

Promise<void>

Inherited From CallAdapterCallOperations.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 CallAdapterCallOperations.stopCamera

stopScreenShare()

Stop sharing the screen

function stopScreenShare(): Promise<void>

Returns

Promise<void>

Inherited From CallAdapterCallOperations.stopScreenShare

unmute()

Unmute the current user during the call or enable microphone locally

function unmute(): Promise<void>

Returns

Promise<void>

Inherited From CallAdapterCallOperations.unmute