Share via


CallWithChatAdapterManagement interface

Functionality for managing the current call with chat.

Properties

forbidAudio

forbids audio for the specified user ids.

forbidOthersAudio

forbids audio for Teams meeting attendees except the local user.

forbidOthersVideo

forbids video for Teams meeting attendees except the local user.

forbidVideo

forbids video for the specified user ids.

permitAudio

permits audio for the specified user ids.

permitOthersAudio

permits audio for Teams meeting attendees except the local user.

permitOthersVideo

permits video for Teams meeting attendees except the local user.

permitVideo

permits video for the specified user ids.

sendDtmfTone

send dtmf tone to another participant in the call in 1:1 calls

sendRealTimeText

Send real time text

Methods

addParticipant(CommunicationUserIdentifier)
addParticipant(PhoneNumberIdentifier, AddPhoneNumberOptions)

Adds a new Participant to the call.

askDevicePermission(PermissionConstraints)

Ask for permissions of devices.

createStreamView(string, VideoStreamOptions)

Create the html view for a stream.

createTogetherModeStreamView(TogetherModeStreamOptions)

Create the html view for a togethermode stream.

deleteMessage(string)

Delete a message in the thread.

disposeLocalVideoStreamView()

Dispose the html view for a local video stream

disposeRemoteVideoStreamView(string)

Dispose the html view for a remote video stream

disposeScreenShareStreamView(string)

Dispose the html view for a screen share stream

disposeStreamView(string, VideoStreamOptions)

Dispose the html view for a stream.

disposeTogetherModeStreamView()

Dispose the html view for a togethermode stream.

downloadResourceToCache(ResourceDetails)
fetchInitialData()

Fetch initial state for the Chat adapter.

Performs the minimal fetch necessary for ChatComposite and API methods.

holdCall()

Puts the Call in a Localhold.

joinCall(boolean)

Join the call with microphone initially on/off.

joinCall(JoinCallOptions)

Join the call with options bag to set microphone/camera initial state when joining call true = turn on the device when joining call false = turn off the device when joining call 'keep'/undefined = retain devices' precall state

leaveCall(boolean)

Leave the call.

loadPreviousChatMessages(number)

Load more previous messages in the chat thread history.

lowerHand()

Lower hand for local user.

mute()

Mute the current user during the call or disable microphone locally.

muteAllRemoteParticipants()

Mute a participant

muteParticipant(string)

Mute a participant

onReactionClick(Reaction)

Send Reaction to ongoing meeting.

queryCameras()

Query for available camera devices.

queryMicrophones()

Query for available microphone devices.

querySpeakers()

Query for available microphone devices.

raiseHand()

Raise hand for local user.

removeParticipant(CommunicationIdentifier)

Remove a participant from the call.

removeParticipant(string)

Remove a participant from a Call.

removeResourceFromCache(ResourceDetails)
resumeCall()

Resumes the call from a LocalHold state.

returnFromBreakoutRoom()

Return to origin call of breakout room

sendMessage(string, SendMessageOptions)

Send a message in the thread.

sendReadReceipt(string)

Send a read receipt for a message.

sendTypingIndicator()

Send typing indicator in the thread.

setCamera(VideoDeviceInfo, VideoStreamOptions)

Set the camera to use in the call.

setCaptionLanguage(string)

Function to set caption language

setMicrophone(AudioDeviceInfo)

Set the microphone to use in the call.

setSpeaker(AudioDeviceInfo)

Set the speaker to use in the call.

setSpokenLanguage(string)

Function to set spoken language

setTogetherModeSceneSize(number, number)

Recalculate the seating positions for together mode.

startCall((CommunicationUserIdentifier | PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], StartCallOptions)

Start the call.

startCall(string[], StartCallOptions)

Start the call.

startCamera(VideoStreamOptions)

Start the camera.

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

startCaptions(StartCaptionsAdapterOptions)

Function to Start captions

startNoiseSuppressionEffect()

Start the noise suppression effect.

startScreenShare()

Start sharing the screen during a call.

startSpotlight(string[])

Start spotlight

startTogetherMode()

Start together mode.

startVideoBackgroundEffect(VideoBackgroundEffect)

Start the video background effect.

stopAllSpotlight()

Stop all spotlights

stopCamera()

Stop the camera.

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

stopCaptions(StopCaptionsAdapterOptions)

Funtion to stop captions

stopNoiseSuppressionEffect()

Start the noise suppression effect.

stopScreenShare()

Stop sharing the screen.

stopSpotlight(string[])

Stop spotlight

stopVideoBackgroundEffects()

Stop the video background effect.

submitSurvey(CallSurvey)

Send the end of call survey result

unmute()

Unmute the current user during the call or enable microphone locally.

updateBackgroundPickerImages(VideoBackgroundImage[])

Override the background picker images for background replacement effect.

updateMessage(string, string, Record<string, string>)

Update a message content.

updateSelectedVideoBackgroundEffect(VideoBackgroundEffect)

Update the selected video background effect

Property Details

forbidAudio

forbids audio for the specified user ids.

forbidAudio: (userIds: string[]) => Promise<void>

Property Value

(userIds: string[]) => Promise<void>

forbidOthersAudio

forbids audio for Teams meeting attendees except the local user.

forbidOthersAudio: () => Promise<void>

Property Value

() => Promise<void>

forbidOthersVideo

forbids video for Teams meeting attendees except the local user.

forbidOthersVideo: () => Promise<void>

Property Value

() => Promise<void>

forbidVideo

forbids video for the specified user ids.

forbidVideo: (userIds: string[]) => Promise<void>

Property Value

(userIds: string[]) => Promise<void>

permitAudio

permits audio for the specified user ids.

permitAudio: (userIds: string[]) => Promise<void>

Property Value

(userIds: string[]) => Promise<void>

permitOthersAudio

permits audio for Teams meeting attendees except the local user.

permitOthersAudio: () => Promise<void>

Property Value

() => Promise<void>

permitOthersVideo

permits video for Teams meeting attendees except the local user.

permitOthersVideo: () => Promise<void>

Property Value

() => Promise<void>

permitVideo

permits video for the specified user ids.

permitVideo: (userIds: string[]) => Promise<void>

Property Value

(userIds: string[]) => Promise<void>

sendDtmfTone

send dtmf tone to another participant in the call in 1:1 calls

public sendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>

Property Value

(dtmfTone: DtmfTone) => Promise<void>

sendRealTimeText

Send real time text

sendRealTimeText: (text: string, isFinalized: boolean) => Promise<void>

Property Value

(text: string, isFinalized: boolean) => Promise<void>

Method Details

addParticipant(CommunicationUserIdentifier)

function addParticipant(participant: CommunicationUserIdentifier): Promise<void>

Parameters

Returns

Promise<void>

addParticipant(PhoneNumberIdentifier, AddPhoneNumberOptions)

Adds a new Participant to the call.

function addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>

Parameters

participant
PhoneNumberIdentifier

Returns

Promise<void>

askDevicePermission(PermissionConstraints)

Ask for permissions of devices.

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

Parameters

constrain
PermissionConstraints

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

Returns

Promise<DeviceAccess>

Remarks

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

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.

createTogetherModeStreamView(TogetherModeStreamOptions)

Create the html view for a togethermode stream.

function createTogetherModeStreamView(options?: TogetherModeStreamOptions): Promise<void | TogetherModeStreamViewResult>

Parameters

options
TogetherModeStreamOptions

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

Returns

Remarks

This method is implemented for composite

deleteMessage(string)

Delete a message in the thread.

function deleteMessage(messageId: string): Promise<void>

Parameters

messageId

string

Returns

Promise<void>

disposeLocalVideoStreamView()

Dispose the html view for a local video stream

function disposeLocalVideoStreamView(): Promise<void>

Returns

Promise<void>

disposeRemoteVideoStreamView(string)

Dispose the html view for a remote video stream

function disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>

Parameters

remoteUserId

string

Id of the participant to dispose

Returns

Promise<void>

disposeScreenShareStreamView(string)

Dispose the html view for a screen share stream

function disposeScreenShareStreamView(remoteUserId: string): Promise<void>

Parameters

remoteUserId

string

Id of the participant to dispose the screen share stream view for.

Returns

Promise<void>

Remarks

this method is implemented for composite

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.

disposeTogetherModeStreamView()

Dispose the html view for a togethermode stream.

function disposeTogetherModeStreamView(): Promise<void>

Returns

Promise<void>

Remarks

This method is implemented for composite

downloadResourceToCache(ResourceDetails)

function downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>

Parameters

resourceDetails
ResourceDetails

Returns

Promise<void>

fetchInitialData()

Fetch initial state for the Chat adapter.

Performs the minimal fetch necessary for ChatComposite and API methods.

function fetchInitialData(): Promise<void>

Returns

Promise<void>

holdCall()

Puts the Call in a Localhold.

function holdCall(): Promise<void>

Returns

Promise<void>

joinCall(boolean)

Warning

This API is now deprecated.

Use joinCall(options?:JoinCallOptions) instead.

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

joinCall(JoinCallOptions)

Join the call with options bag to set microphone/camera initial state when joining call true = turn on the device when joining call false = turn off the device when joining call 'keep'/undefined = retain devices' precall state

function joinCall(options?: JoinCallOptions): undefined | Call

Parameters

options
JoinCallOptions

param to set microphone/camera initially on/off/use precall state.

Returns

undefined | Call

leaveCall(boolean)

Leave the call.

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

Parameters

forEveryone

boolean

Whether to remove all participants when leaving

Returns

Promise<void>

loadPreviousChatMessages(number)

Load more previous messages in the chat thread history.

function loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>

Parameters

messagesToLoad

number

Returns

Promise<boolean>

Remarks

This method is usually used to control incremental fetch/infinite scroll.

lowerHand()

Lower hand for local user.

function lowerHand(): Promise<void>

Returns

Promise<void>

mute()

Mute the current user during the call or disable microphone locally.

function mute(): Promise<void>

Returns

Promise<void>

muteAllRemoteParticipants()

Mute a participant

function muteAllRemoteParticipants(): Promise<void>

Returns

Promise<void>

muteParticipant(string)

Mute a participant

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

Parameters

userId

string

Returns

Promise<void>

onReactionClick(Reaction)

Send Reaction to ongoing meeting.

function onReactionClick(reaction: Reaction): Promise<void>

Parameters

reaction
Reaction

A value of type <xref:%40azure%2Fcommunication-calling%23Reaction>

Returns

Promise<void>

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()

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()

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()

raiseHand()

Raise hand for local user.

function raiseHand(): Promise<void>

Returns

Promise<void>

removeParticipant(CommunicationIdentifier)

Remove a participant from the call.

function removeParticipant(participant: CommunicationIdentifier): Promise<void>

Parameters

participant
CommunicationIdentifier

<xref:%40azure%2Fcommunication-common%23CommunicationIdentifier> of the participant to be removed

Returns

Promise<void>

removeParticipant(string)

Remove a participant from a Call.

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

Parameters

userId

string

UserId of the participant to remove.

Returns

Promise<void>

removeResourceFromCache(ResourceDetails)

function removeResourceFromCache(resourceDetails: ResourceDetails)

Parameters

resourceDetails
ResourceDetails

resumeCall()

Resumes the call from a LocalHold state.

function resumeCall(): Promise<void>

Returns

Promise<void>

returnFromBreakoutRoom()

Return to origin call of breakout room

function returnFromBreakoutRoom(): Promise<void>

Returns

Promise<void>

sendMessage(string, SendMessageOptions)

Send a message in the thread.

function sendMessage(content: string, options?: SendMessageOptions): Promise<void>

Parameters

content

string

Returns

Promise<void>

sendReadReceipt(string)

Send a read receipt for a message.

function sendReadReceipt(chatMessageId: string): Promise<void>

Parameters

chatMessageId

string

Returns

Promise<void>

sendTypingIndicator()

Send typing indicator in the thread.

function sendTypingIndicator(): Promise<void>

Returns

Promise<void>

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>

setCaptionLanguage(string)

Function to set caption language

function setCaptionLanguage(language: string): Promise<void>

Parameters

language

string

language set for caption

Returns

Promise<void>

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>

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>

setSpokenLanguage(string)

Function to set spoken language

function setSpokenLanguage(language: string): Promise<void>

Parameters

language

string

spoken language

Returns

Promise<void>

setTogetherModeSceneSize(number, number)

Recalculate the seating positions for together mode.

function setTogetherModeSceneSize(width: number, height: number)

Parameters

width

number

Width of the container

height

number

Height of the container

Remarks

This method is implemented for composite

startCall((CommunicationUserIdentifier | PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], StartCallOptions)

Start the call.

function startCall(participants: (CommunicationUserIdentifier | PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], options?: StartCallOptions): undefined | Call

Parameters

participants

(CommunicationUserIdentifier | PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[]

An array of <xref:%40azure%2Fcommunication-common%23CommunicationIdentifier> to be called

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

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>

startCaptions(StartCaptionsAdapterOptions)

Function to Start captions

function startCaptions(options?: StartCaptionsAdapterOptions): Promise<void>

Parameters

options
StartCaptionsAdapterOptions

options for start captions

Returns

Promise<void>

startNoiseSuppressionEffect()

Start the noise suppression effect.

function startNoiseSuppressionEffect(): Promise<void>

Returns

Promise<void>

startScreenShare()

Start sharing the screen during a call.

function startScreenShare(): Promise<void>

Returns

Promise<void>

startSpotlight(string[])

Start spotlight

function startSpotlight(userIds?: string[]): Promise<void>

Parameters

userIds

string[]

Returns

Promise<void>

startTogetherMode()

Start together mode.

function startTogetherMode(): Promise<void>

Returns

Promise<void>

Remarks

This method is implemented for composite

startVideoBackgroundEffect(VideoBackgroundEffect)

Start the video background effect.

function startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void>

Parameters

videoBackgroundEffect
VideoBackgroundEffect

Returns

Promise<void>

stopAllSpotlight()

Stop all spotlights

function stopAllSpotlight(): Promise<void>

Returns

Promise<void>

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>

stopCaptions(StopCaptionsAdapterOptions)

Funtion to stop captions

function stopCaptions(options?: StopCaptionsAdapterOptions): Promise<void>

Parameters

Returns

Promise<void>

stopNoiseSuppressionEffect()

Start the noise suppression effect.

function stopNoiseSuppressionEffect(): Promise<void>

Returns

Promise<void>

stopScreenShare()

Stop sharing the screen.

function stopScreenShare(): Promise<void>

Returns

Promise<void>

stopSpotlight(string[])

Stop spotlight

function stopSpotlight(userIds?: string[]): Promise<void>

Parameters

userIds

string[]

Returns

Promise<void>

stopVideoBackgroundEffects()

Stop the video background effect.

function stopVideoBackgroundEffects(): Promise<void>

Returns

Promise<void>

submitSurvey(CallSurvey)

Send the end of call survey result

function submitSurvey(survey: CallSurvey): Promise<undefined | CallSurveyResponse>

Parameters

survey
CallSurvey

Returns

Promise<undefined | CallSurveyResponse>

unmute()

Unmute the current user during the call or enable microphone locally.

function unmute(): Promise<void>

Returns

Promise<void>

updateBackgroundPickerImages(VideoBackgroundImage[])

Override the background picker images for background replacement effect.

function updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[])

Parameters

backgroundImages

VideoBackgroundImage[]

Array of custom background images.

updateMessage(string, string, Record<string, string>)

Update a message content.

function updateMessage(messageId: string, content: string, options?: Record<string, string>): Promise<void>

Parameters

messageId

string

content

string

options

Record<string, string>

Returns

Promise<void>

updateSelectedVideoBackgroundEffect(VideoBackgroundEffect)

Update the selected video background effect

function updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect)

Parameters

selectedVideoBackground
VideoBackgroundEffect