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

CallWithChatAdapter interface

CallWithChatComposite 适配器接口。

Extends

继承的方法

askDevicePermission(PermissionConstraints)

请求设备的权限。

createStreamView(string, VideoStreamOptions)

为流创建 html 视图。

deleteMessage(string)

删除线程中的消息。

dispose()

释放复合

disposeStreamView(string, VideoStreamOptions)

释放流的 html 视图。

fetchInitialData()

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

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

getState()

获取当前状态

joinCall(boolean)

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

leaveCall(boolean)

离开呼叫。

loadPreviousChatMessages(number)

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

mute()

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

off("callEnded", CallEndedListener)
off("callError", (e: AdapterError) => void)
off("callIdChanged", CallIdChangedListener)
off("callParticipantsJoined", ParticipantsJoinedListener)
off("callParticipantsLeft", ParticipantsLeftListener)
off("chatError", (e: AdapterError) => void)
off("chatParticipantsAdded", ParticipantsAddedListener)
off("chatParticipantsRemoved", ParticipantsRemovedListener)
off("displayNameChanged", DisplayNameChangedListener)
off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)
off("isMutedChanged", IsMutedChangedListener)
off("isSpeakingChanged", IsSpeakingChangedListener)
off("messageRead", MessageReadListener)
off("messageReceived", MessageReceivedListener)
off("messageSent", MessageReceivedListener)
off("selectedMicrophoneChanged", PropertyChangedEvent)
off("selectedSpeakerChanged", PropertyChangedEvent)
offStateChange((state: CallWithChatAdapterState) => void)

取消订阅 stateChanged 事件的处理程序。

on("callEnded", CallEndedListener)
on("callError", (e: AdapterError) => void)
on("callIdChanged", CallIdChangedListener)
on("callParticipantsJoined", ParticipantsJoinedListener)
on("callParticipantsLeft", ParticipantsLeftListener)
on("chatError", (e: AdapterError) => void)
on("chatParticipantsAdded", ParticipantsAddedListener)
on("chatParticipantsRemoved", ParticipantsRemovedListener)
on("displayNameChanged", DisplayNameChangedListener)
on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)
on("isMutedChanged", IsMutedChangedListener)
on("isSpeakingChanged", IsSpeakingChangedListener)
on("messageRead", MessageReadListener)
on("messageReceived", MessageReceivedListener)
on("messageSent", MessageReceivedListener)
on("selectedMicrophoneChanged", PropertyChangedEvent)
on("selectedSpeakerChanged", PropertyChangedEvent)
onStateChange((state: CallWithChatAdapterState) => void)

将处理程序订阅到 stateChanged 事件。

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>

注解

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

继承自CallWithChatAdapterManagement.askDevicePermission

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>

注解

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

继承自CallWithChatAdapterManagement.createStreamView

deleteMessage(string)

删除线程中的消息。

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

参数

messageId

string

返回

Promise<void>

继承自CallWithChatAdapterManagement.deleteMessage

dispose()

释放复合

function dispose()

继承自一次性.dispose

disposeStreamView(string, VideoStreamOptions)

释放流的 html 视图。

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

参数

remoteUserId

string

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

options
VideoStreamOptions

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

返回

Promise<void>

注解

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

继承自CallWithChatAdapterManagement.disposeStreamView

fetchInitialData()

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

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

function fetchInitialData(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.fetchInitialData

getState()

获取当前状态

function getState(): CallWithChatAdapterState

返回

继承自AdapterState.getState

joinCall(boolean)

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

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

参数

microphoneOn

boolean

最初是否启用麦克风

返回

undefined | Call

继承自CallWithChatAdapterManagement.joinCall

leaveCall(boolean)

离开呼叫。

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

参数

forEveryone

boolean

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

返回

Promise<void>

继承自CallWithChatAdapterManagement.leaveCall

loadPreviousChatMessages(number)

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

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

参数

messagesToLoad

number

返回

Promise<boolean>

注解

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

继承自CallWithChatAdapterManagement.loadPreviousChatMessages

mute()

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

function mute(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.mute

off("callEnded", CallEndedListener)

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

参数

event

"callEnded"

继承自CallWithChatAdapterSubscriptions.off

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

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

参数

event

"callError"

listener

(e: AdapterError) => void

继承自CallWithChatAdapterSubscriptions.off

off("callIdChanged", CallIdChangedListener)

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

参数

event

"callIdChanged"

继承自CallWithChatAdapterSubscriptions.off

off("callParticipantsJoined", ParticipantsJoinedListener)

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

参数

event

"callParticipantsJoined"

继承自CallWithChatAdapterSubscriptions.off

off("callParticipantsLeft", ParticipantsLeftListener)

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

参数

event

"callParticipantsLeft"

继承自CallWithChatAdapterSubscriptions.off

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

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

参数

event

"chatError"

listener

(e: AdapterError) => void

继承自CallWithChatAdapterSubscriptions.off

off("chatParticipantsAdded", ParticipantsAddedListener)

function off(event: "chatParticipantsAdded", listener: ParticipantsAddedListener)

参数

event

"chatParticipantsAdded"

继承自CallWithChatAdapterSubscriptions.off

off("chatParticipantsRemoved", ParticipantsRemovedListener)

function off(event: "chatParticipantsRemoved", listener: ParticipantsRemovedListener)

参数

event

"chatParticipantsRemoved"

继承自CallWithChatAdapterSubscriptions.off

off("displayNameChanged", DisplayNameChangedListener)

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

参数

event

"displayNameChanged"

继承自CallWithChatAdapterSubscriptions.off

off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

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

参数

event

"isLocalScreenSharingActiveChanged"

继承自CallWithChatAdapterSubscriptions.off

off("isMutedChanged", IsMutedChangedListener)

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

参数

event

"isMutedChanged"

继承自CallWithChatAdapterSubscriptions.off

off("isSpeakingChanged", IsSpeakingChangedListener)

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

参数

event

"isSpeakingChanged"

继承自CallWithChatAdapterSubscriptions.off

off("messageRead", MessageReadListener)

function off(event: "messageRead", listener: MessageReadListener)

参数

event

"messageRead"

继承自CallWithChatAdapterSubscriptions.off

off("messageReceived", MessageReceivedListener)

function off(event: "messageReceived", listener: MessageReceivedListener)

参数

event

"messageReceived"

继承自CallWithChatAdapterSubscriptions.off

off("messageSent", MessageReceivedListener)

function off(event: "messageSent", listener: MessageReceivedListener)

参数

event

"messageSent"

继承自CallWithChatAdapterSubscriptions.off

off("selectedMicrophoneChanged", PropertyChangedEvent)

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

参数

event

"selectedMicrophoneChanged"

继承自CallWithChatAdapterSubscriptions.off

off("selectedSpeakerChanged", PropertyChangedEvent)

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

参数

event

"selectedSpeakerChanged"

继承自CallWithChatAdapterSubscriptions.off

offStateChange((state: CallWithChatAdapterState) => void)

取消订阅 stateChanged 事件的处理程序。

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

参数

handler

(state: CallWithChatAdapterState) => void

继承自AdapterState.offStateChange

on("callEnded", CallEndedListener)

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

参数

event

"callEnded"

继承自CallWithChatAdapterSubscriptions.on

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

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

参数

event

"callError"

listener

(e: AdapterError) => void

继承自CallWithChatAdapterSubscriptions.on

on("callIdChanged", CallIdChangedListener)

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

参数

event

"callIdChanged"

继承自CallWithChatAdapterSubscriptions.on

on("callParticipantsJoined", ParticipantsJoinedListener)

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

参数

event

"callParticipantsJoined"

继承自CallWithChatAdapterSubscriptions.on

on("callParticipantsLeft", ParticipantsLeftListener)

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

参数

event

"callParticipantsLeft"

继承自CallWithChatAdapterSubscriptions.on

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

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

参数

event

"chatError"

listener

(e: AdapterError) => void

继承自CallWithChatAdapterSubscriptions.on

on("chatParticipantsAdded", ParticipantsAddedListener)

function on(event: "chatParticipantsAdded", listener: ParticipantsAddedListener)

参数

event

"chatParticipantsAdded"

继承自CallWithChatAdapterSubscriptions.on

on("chatParticipantsRemoved", ParticipantsRemovedListener)

function on(event: "chatParticipantsRemoved", listener: ParticipantsRemovedListener)

参数

event

"chatParticipantsRemoved"

继承自CallWithChatAdapterSubscriptions.on

on("displayNameChanged", DisplayNameChangedListener)

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

参数

event

"displayNameChanged"

继承自CallWithChatAdapterSubscriptions.on

on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)

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

参数

event

"isLocalScreenSharingActiveChanged"

继承自CallWithChatAdapterSubscriptions.on

on("isMutedChanged", IsMutedChangedListener)

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

参数

event

"isMutedChanged"

继承自CallWithChatAdapterSubscriptions.on

on("isSpeakingChanged", IsSpeakingChangedListener)

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

参数

event

"isSpeakingChanged"

继承自CallWithChatAdapterSubscriptions.on

on("messageRead", MessageReadListener)

function on(event: "messageRead", listener: MessageReadListener)

参数

event

"messageRead"

继承自CallWithChatAdapterSubscriptions.on

on("messageReceived", MessageReceivedListener)

function on(event: "messageReceived", listener: MessageReceivedListener)

参数

event

"messageReceived"

继承自CallWithChatAdapterSubscriptions.on

on("messageSent", MessageReceivedListener)

function on(event: "messageSent", listener: MessageReceivedListener)

参数

event

"messageSent"

继承自CallWithChatAdapterSubscriptions.on

on("selectedMicrophoneChanged", PropertyChangedEvent)

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

参数

event

"selectedMicrophoneChanged"

继承自CallWithChatAdapterSubscriptions.on

on("selectedSpeakerChanged", PropertyChangedEvent)

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

参数

event

"selectedSpeakerChanged"

继承自CallWithChatAdapterSubscriptions.on

onStateChange((state: CallWithChatAdapterState) => void)

将处理程序订阅到 stateChanged 事件。

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

参数

handler

(state: CallWithChatAdapterState) => void

继承自AdapterState.onStateChange

queryCameras()

查询可用的相机设备。

function queryCameras(): Promise<VideoDeviceInfo[]>

返回

Promise<VideoDeviceInfo[]>

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

注解

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

继承自CallWithChatAdapterManagement.queryCameras

queryMicrophones()

查询可用的麦克风设备。

function queryMicrophones(): Promise<AudioDeviceInfo[]>

返回

Promise<AudioDeviceInfo[]>

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

注解

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

继承自CallWithChatAdapterManagement.queryMicrophones

querySpeakers()

查询可用的麦克风设备。

function querySpeakers(): Promise<AudioDeviceInfo[]>

返回

Promise<AudioDeviceInfo[]>

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

注解

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

继承自CallWithChatAdapterManagement.querySpeakers

removeParticipant(string)

从通话中删除参与者。

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

参数

userId

string

要删除的参与者的 UserId。

返回

Promise<void>

继承自CallWithChatAdapterManagement.removeParticipant

sendMessage(string, SendMessageOptions)

在线程中发送消息。

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

参数

content

string

返回

Promise<void>

继承自CallWithChatAdapterManagement.sendMessage

sendReadReceipt(string)

发送邮件的已读回执。

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

参数

chatMessageId

string

返回

Promise<void>

继承自CallWithChatAdapterManagement.sendReadReceipt

sendTypingIndicator()

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

function sendTypingIndicator(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.sendTypingIndicator

setCamera(VideoDeviceInfo, VideoStreamOptions)

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

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

参数

sourceInfo
VideoDeviceInfo

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

options
VideoStreamOptions

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

返回

Promise<void>

继承自CallWithChatAdapterManagement.setCamera

setMicrophone(AudioDeviceInfo)

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

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

参数

sourceInfo
AudioDeviceInfo

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

返回

Promise<void>

继承自CallWithChatAdapterManagement.setMicrophone

setSpeaker(AudioDeviceInfo)

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

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

参数

sourceInfo
AudioDeviceInfo

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

返回

Promise<void>

继承自CallWithChatAdapterManagement.setSpeaker

startCall(string[], StartCallOptions)

启动呼叫。

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

参数

participants

string[]

要加入的参与者 ID 数组

返回

undefined | Call

继承自CallWithChatAdapterManagement.startCall

startCamera(VideoStreamOptions)

启动相机。

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

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

参数

options
VideoStreamOptions

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

返回

Promise<void>

继承自CallWithChatAdapterManagement.startCamera

startScreenShare()

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

function startScreenShare(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.startScreenShare

stopCamera()

停止相机。

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

function stopCamera(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.stopCamera

stopScreenShare()

停止共享屏幕。

function stopScreenShare(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.stopScreenShare

unmute()

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

function unmute(): Promise<void>

返回

Promise<void>

继承自CallWithChatAdapterManagement.unmute

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>

继承自CallWithChatAdapterManagement.updateMessage