CallWithChatAdapterManagement interface
Functionality for managing the current call with chat.
Methods
ask |
Ask for permissions of devices. |
create |
Create the html view for a stream. |
delete |
Delete a message in the thread. |
dispose |
Dispose the html view for a stream. |
fetch |
Fetch initial state for the Chat adapter. Performs the minimal fetch necessary for ChatComposite and API methods. |
join |
Join the call with microphone initially on/off. |
leave |
Leave the call. |
load |
Load more previous messages in the chat thread history. |
mute() | Mute the current user during the call or disable microphone locally. |
query |
Query for available camera devices. |
query |
Query for available microphone devices. |
query |
Query for available microphone devices. |
remove |
Remove a participant from a Call. |
send |
Send a message in the thread. |
send |
Send a read receipt for a message. |
send |
Send typing indicator in the thread. |
set |
Set the camera to use in the call. |
set |
Set the microphone to use in the call. |
set |
Set the speaker to use in the call. |
start |
Start the call. |
start |
Start the camera. This method will start rendering a local camera view when the call is not active. |
start |
Start sharing the screen during a call. |
stop |
Stop the camera. This method will stop rendering a local camera view when the call is not active. |
stop |
Stop sharing the screen. |
unmute() | Unmute the current user during the call or enable microphone locally. |
update |
Update a message content. |
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.
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.
deleteMessage(string)
Delete a message in the thread.
function deleteMessage(messageId: string): Promise<void>
Parameters
- messageId
-
string
Returns
Promise<void>
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.
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>
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
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.
mute()
Mute the current user during the call or disable microphone locally.
function mute(): Promise<void>
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()
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>
sendMessage(string, SendMessageOptions)
Send a message in the thread.
function sendMessage(content: string, options?: SendMessageOptions): Promise<void>
Parameters
- content
-
string
- options
- SendMessageOptions
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>
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>
startCall(string[], StartCallOptions)
Start the call.
function startCall(participants: string[], options?: StartCallOptions): undefined | Call
Parameters
- participants
-
string[]
An array of participant ids to join
- options
- StartCallOptions
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>
startScreenShare()
Start sharing the screen during a call.
function startScreenShare(): 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>
stopScreenShare()
Stop sharing the screen.
function stopScreenShare(): Promise<void>
Returns
Promise<void>
unmute()
Unmute the current user during the call or enable microphone locally.
function unmute(): Promise<void>
Returns
Promise<void>
updateMessage(string, string, Record<string, string>)
Update a message content.
function updateMessage(messageId: string, content: string, metadata?: Record<string, string>): Promise<void>
Parameters
- messageId
-
string
- content
-
string
- metadata
-
Record<string, string>
Returns
Promise<void>