你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

CallWithChatAdapterManagement interface

用于通过聊天管理当前呼叫的功能。

方法

askDevicePermission(PermissionConstraints)

请求设备的权限。

createStreamView(string, VideoStreamOptions)

为流创建 html 视图。

deleteMessage(string)

删除线程中的消息。

disposeStreamView(string, VideoStreamOptions)

释放流的 html 视图。

fetchInitialData()

提取聊天适配器的初始状态。

执行 ChatComposite 和 API 方法所需的最小提取。

joinCall(boolean)

最初打开/关闭麦克风加入呼叫。

leaveCall(boolean)

离开呼叫。

loadPreviousChatMessages(number)

在聊天线程历史记录中加载更多以前的消息。

mute()

呼叫期间将当前用户静音或在本地禁用麦克风。

queryCameras()

查询可用的相机设备。

queryMicrophones()

查询可用的麦克风设备。

querySpeakers()

查询可用的麦克风设备。

removeParticipant(string)

从通话中删除参与者。

sendMessage(string, SendMessageOptions)

在线程中发送消息。

sendReadReceipt(string)

发送邮件的已读回执。

sendTypingIndicator()

在线程中发送键入指示器。

setCamera(VideoDeviceInfo, VideoStreamOptions)

设置在调用中使用的相机。

setMicrophone(AudioDeviceInfo)

设置在通话中使用的麦克风。

setSpeaker(AudioDeviceInfo)

设置在呼叫中使用的扬声器。

startCall(string[], StartCallOptions)

启动呼叫。

startCamera(VideoStreamOptions)

启动相机。

当调用不处于活动状态时,此方法将开始呈现本地相机视图。

startScreenShare()

开始在通话期间共享屏幕。

stopCamera()

停止相机。

当调用不处于活动状态时,此方法将停止呈现本地相机视图。

stopScreenShare()

停止共享屏幕。

unmute()

呼叫期间取消当前用户的静音,或在本地启用麦克风。

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

更新消息内容。

方法详细信息

askDevicePermission(PermissionConstraints)

请求设备的权限。

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

参数

constrain
PermissionConstraints

定义访问本地设备的约束 <xref:%40azure%2Fcommunication-calling%23PermissionConstraints>

返回

Promise<void>

注解

如果尚未授予权限,将弹出浏览器权限窗口。

createStreamView(string, VideoStreamOptions)

为流创建 html 视图。

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

参数

remoteUserId

string

要呈现的参与者的 ID,将其保留为未定义以创建本地相机视图

options
VideoStreamOptions

用于控制视频流的呈现方式的选项 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

返回

Promise<void | CreateVideoStreamViewResult>

注解

此方法是针对复合实现的。

deleteMessage(string)

删除线程中的消息。

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

参数

messageId

string

返回

Promise<void>

disposeStreamView(string, VideoStreamOptions)

释放流的 html 视图。

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

参数

remoteUserId

string

要呈现的参与者的 ID,将其保留为未定义以释放本地相机视图

options
VideoStreamOptions

用于控制视频流的呈现方式的选项 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

返回

Promise<void>

注解

此方法是针对复合实现的。

fetchInitialData()

提取聊天适配器的初始状态。

执行 ChatComposite 和 API 方法所需的最小提取。

function fetchInitialData(): Promise<void>

返回

Promise<void>

joinCall(boolean)

最初打开/关闭麦克风加入呼叫。

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

参数

microphoneOn

boolean

最初是否启用麦克风

返回

undefined | Call

leaveCall(boolean)

离开呼叫。

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

参数

forEveryone

boolean

离开时是否删除所有参与者

返回

Promise<void>

loadPreviousChatMessages(number)

在聊天线程历史记录中加载更多以前的消息。

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

参数

messagesToLoad

number

返回

Promise<boolean>

注解

此方法通常用于控制增量提取/无限滚动。

mute()

呼叫期间将当前用户静音或在本地禁用麦克风。

function mute(): Promise<void>

返回

Promise<void>

queryCameras()

查询可用的相机设备。

function queryCameras(): Promise<VideoDeviceInfo[]>

返回

Promise<VideoDeviceInfo[]>

视频设备信息实体的数组 <xref:%40azure%2Fcommunication-calling%23VideoDeviceInfo>

注解

应在 askDevicePermission () 之后调用此方法

queryMicrophones()

查询可用的麦克风设备。

function queryMicrophones(): Promise<AudioDeviceInfo[]>

返回

Promise<AudioDeviceInfo[]>

音频设备信息实体的数组 <xref:%40azure%2Fcommunication-calling%23AudioDeviceInfo>

注解

应在 askDevicePermission () 之后调用此方法

querySpeakers()

查询可用的麦克风设备。

function querySpeakers(): Promise<AudioDeviceInfo[]>

返回

Promise<AudioDeviceInfo[]>

音频设备信息实体的数组 <xref:%40azure%2Fcommunication-calling%23AudioDeviceInfo>

注解

应在 askDevicePermission () 之后调用此方法

removeParticipant(string)

从通话中删除参与者。

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

参数

userId

string

要删除的参与者的 UserId。

返回

Promise<void>

sendMessage(string, SendMessageOptions)

在线程中发送消息。

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

参数

content

string

返回

Promise<void>

sendReadReceipt(string)

发送邮件的已读回执。

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

参数

chatMessageId

string

返回

Promise<void>

sendTypingIndicator()

在线程中发送键入指示器。

function sendTypingIndicator(): Promise<void>

返回

Promise<void>

setCamera(VideoDeviceInfo, VideoStreamOptions)

设置在调用中使用的相机。

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

参数

sourceInfo
VideoDeviceInfo

要选择的相机设备,选择 queryCameras 返回的相机设备

options
VideoStreamOptions

用于控制如何呈现相机流的选项 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

返回

Promise<void>

setMicrophone(AudioDeviceInfo)

设置在通话中使用的麦克风。

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

参数

sourceInfo
AudioDeviceInfo

麦克风设备可供选择,选择查询麦克风返回的麦克风设备

返回

Promise<void>

setSpeaker(AudioDeviceInfo)

设置在呼叫中使用的扬声器。

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

参数

sourceInfo
AudioDeviceInfo

要选择的扬声器设备,选择 querySpeakers 返回的一个

返回

Promise<void>

startCall(string[], StartCallOptions)

启动呼叫。

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

参数

participants

string[]

要加入的参与者 ID 数组

返回

undefined | Call

startCamera(VideoStreamOptions)

启动相机。

当调用不处于活动状态时,此方法将开始呈现本地相机视图。

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

参数

options
VideoStreamOptions

用于控制视频流的呈现方式的选项 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

返回

Promise<void>

startScreenShare()

开始在通话期间共享屏幕。

function startScreenShare(): Promise<void>

返回

Promise<void>

stopCamera()

停止相机。

当调用不处于活动状态时,此方法将停止呈现本地相机视图。

function stopCamera(): Promise<void>

返回

Promise<void>

stopScreenShare()

停止共享屏幕。

function stopScreenShare(): Promise<void>

返回

Promise<void>

unmute()

呼叫期间取消当前用户的静音,或在本地启用麦克风。

function unmute(): Promise<void>

返回

Promise<void>

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

更新消息内容。

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

参数

messageId

string

content

string

metadata

Record<string, string>

返回

Promise<void>