共用方式為


CallWithChatAdapter interface

CallWithChatComposite Adapter 介面。

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

要轉譯的參與者標識碼,讓它保持未定義以建立本機相機檢視

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

繼承自Dispos.dispose

disposeStreamView(string, VideoStreamOptions)

處置數據流的 HTML 檢視。

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

參數

remoteUserId

string

要轉譯的參與者標識碼,讓它保持未定義以處置本機相機檢視

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

要選擇的相機裝置,挑選 查詢Cameras 傳回的相機裝置

options
VideoStreamOptions

控制相機串流轉譯方式的選項 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>

傳回

Promise<void>

繼承自CallWithChatAdapterManagement.setCamera

setMicrophone(AudioDeviceInfo)

將麥克風設定為在通話中使用。

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

參數

sourceInfo
AudioDeviceInfo

要選擇的麥克風裝置,挑選由 queryMicrophones 傳回的麥克風裝置

傳回

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[]

要加入的參與者標識碼陣列

傳回

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