CallWithChatAdapter interface
CallWithChatComposite Adapter 介面。
- Extends
繼承的方法
繼承的方法的詳細資料
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
要轉譯的參與者標識碼,讓它保持未定義以建立本機相機檢視
- options
- VideoStreamOptions
控制影片串流轉譯方式的選項 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>
傳回
Promise<void | CreateVideoStreamViewResult>
備註
這個方法會針對複合實作。
deleteMessage(string)
刪除線程中的訊息。
function deleteMessage(messageId: string): Promise<void>
參數
- messageId
-
string
傳回
Promise<void>
dispose()
disposeStreamView(string, VideoStreamOptions)
處置數據流的 HTML 檢視。
function disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>
參數
- remoteUserId
-
string
要轉譯的參與者標識碼,讓它保持未定義以處置本機相機檢視
- options
- VideoStreamOptions
控制影片串流轉譯方式的選項 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>
傳回
Promise<void>
備註
這個方法會針對複合實作。
fetchInitialData()
擷取聊天配接器的初始狀態。
執行 ChatComposite 和 API 方法所需的最小擷取。
function fetchInitialData(): Promise<void>
傳回
Promise<void>
getState()
取得目前狀態
function getState(): CallWithChatAdapterState
傳回
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>
off("callEnded", CallEndedListener)
function off(event: "callEnded", listener: CallEndedListener)
參數
- event
-
"callEnded"
- listener
- CallEndedListener
off("callError", (e: AdapterError) => void)
function off(event: "callError", listener: (e: AdapterError) => void)
參數
- event
-
"callError"
- listener
-
(e: AdapterError) => void
off("callIdChanged", CallIdChangedListener)
function off(event: "callIdChanged", listener: CallIdChangedListener)
參數
- event
-
"callIdChanged"
- listener
- CallIdChangedListener
off("callParticipantsJoined", ParticipantsJoinedListener)
function off(event: "callParticipantsJoined", listener: ParticipantsJoinedListener)
參數
- event
-
"callParticipantsJoined"
- listener
- ParticipantsJoinedListener
off("callParticipantsLeft", ParticipantsLeftListener)
function off(event: "callParticipantsLeft", listener: ParticipantsLeftListener)
參數
- event
-
"callParticipantsLeft"
- listener
- ParticipantsLeftListener
off("chatError", (e: AdapterError) => void)
function off(event: "chatError", listener: (e: AdapterError) => void)
參數
- event
-
"chatError"
- listener
-
(e: AdapterError) => void
off("chatParticipantsAdded", ParticipantsAddedListener)
function off(event: "chatParticipantsAdded", listener: ParticipantsAddedListener)
參數
- event
-
"chatParticipantsAdded"
- listener
- ParticipantsAddedListener
off("chatParticipantsRemoved", ParticipantsRemovedListener)
function off(event: "chatParticipantsRemoved", listener: ParticipantsRemovedListener)
參數
- event
-
"chatParticipantsRemoved"
- listener
- ParticipantsRemovedListener
off("displayNameChanged", DisplayNameChangedListener)
function off(event: "displayNameChanged", listener: DisplayNameChangedListener)
參數
- event
-
"displayNameChanged"
- listener
- DisplayNameChangedListener
off("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)
function off(event: "isLocalScreenSharingActiveChanged", listener: IsLocalScreenSharingActiveChangedListener)
參數
- event
-
"isLocalScreenSharingActiveChanged"
off("isMutedChanged", IsMutedChangedListener)
function off(event: "isMutedChanged", listener: IsMutedChangedListener)
參數
- event
-
"isMutedChanged"
- listener
- IsMutedChangedListener
off("isSpeakingChanged", IsSpeakingChangedListener)
function off(event: "isSpeakingChanged", listener: IsSpeakingChangedListener)
參數
- event
-
"isSpeakingChanged"
- listener
- IsSpeakingChangedListener
off("messageRead", MessageReadListener)
function off(event: "messageRead", listener: MessageReadListener)
參數
- event
-
"messageRead"
- listener
- MessageReadListener
off("messageReceived", MessageReceivedListener)
function off(event: "messageReceived", listener: MessageReceivedListener)
參數
- event
-
"messageReceived"
- listener
- MessageReceivedListener
off("messageSent", MessageReceivedListener)
function off(event: "messageSent", listener: MessageReceivedListener)
參數
- event
-
"messageSent"
- listener
- MessageReceivedListener
off("selectedMicrophoneChanged", PropertyChangedEvent)
function off(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)
參數
- event
-
"selectedMicrophoneChanged"
- listener
- PropertyChangedEvent
off("selectedSpeakerChanged", PropertyChangedEvent)
function off(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)
參數
- event
-
"selectedSpeakerChanged"
- listener
- PropertyChangedEvent
offStateChange((state: CallWithChatAdapterState) => void)
將處理程式取消訂閱至 stateChanged 事件。
function offStateChange(handler: (state: CallWithChatAdapterState) => void)
參數
- handler
-
(state: CallWithChatAdapterState) => void
on("callEnded", CallEndedListener)
function on(event: "callEnded", listener: CallEndedListener)
參數
- event
-
"callEnded"
- listener
- CallEndedListener
on("callError", (e: AdapterError) => void)
function on(event: "callError", listener: (e: AdapterError) => void)
參數
- event
-
"callError"
- listener
-
(e: AdapterError) => void
on("callIdChanged", CallIdChangedListener)
function on(event: "callIdChanged", listener: CallIdChangedListener)
參數
- event
-
"callIdChanged"
- listener
- CallIdChangedListener
on("callParticipantsJoined", ParticipantsJoinedListener)
function on(event: "callParticipantsJoined", listener: ParticipantsJoinedListener)
參數
- event
-
"callParticipantsJoined"
- listener
- ParticipantsJoinedListener
on("callParticipantsLeft", ParticipantsLeftListener)
function on(event: "callParticipantsLeft", listener: ParticipantsLeftListener)
參數
- event
-
"callParticipantsLeft"
- listener
- ParticipantsLeftListener
on("chatError", (e: AdapterError) => void)
function on(event: "chatError", listener: (e: AdapterError) => void)
參數
- event
-
"chatError"
- listener
-
(e: AdapterError) => void
on("chatParticipantsAdded", ParticipantsAddedListener)
function on(event: "chatParticipantsAdded", listener: ParticipantsAddedListener)
參數
- event
-
"chatParticipantsAdded"
- listener
- ParticipantsAddedListener
on("chatParticipantsRemoved", ParticipantsRemovedListener)
function on(event: "chatParticipantsRemoved", listener: ParticipantsRemovedListener)
參數
- event
-
"chatParticipantsRemoved"
- listener
- ParticipantsRemovedListener
on("displayNameChanged", DisplayNameChangedListener)
function on(event: "displayNameChanged", listener: DisplayNameChangedListener)
參數
- event
-
"displayNameChanged"
- listener
- DisplayNameChangedListener
on("isLocalScreenSharingActiveChanged", IsLocalScreenSharingActiveChangedListener)
function on(event: "isLocalScreenSharingActiveChanged", listener: IsLocalScreenSharingActiveChangedListener)
參數
- event
-
"isLocalScreenSharingActiveChanged"
on("isMutedChanged", IsMutedChangedListener)
function on(event: "isMutedChanged", listener: IsMutedChangedListener)
參數
- event
-
"isMutedChanged"
- listener
- IsMutedChangedListener
on("isSpeakingChanged", IsSpeakingChangedListener)
function on(event: "isSpeakingChanged", listener: IsSpeakingChangedListener)
參數
- event
-
"isSpeakingChanged"
- listener
- IsSpeakingChangedListener
on("messageRead", MessageReadListener)
function on(event: "messageRead", listener: MessageReadListener)
參數
- event
-
"messageRead"
- listener
- MessageReadListener
on("messageReceived", MessageReceivedListener)
function on(event: "messageReceived", listener: MessageReceivedListener)
參數
- event
-
"messageReceived"
- listener
- MessageReceivedListener
on("messageSent", MessageReceivedListener)
function on(event: "messageSent", listener: MessageReceivedListener)
參數
- event
-
"messageSent"
- listener
- MessageReceivedListener
on("selectedMicrophoneChanged", PropertyChangedEvent)
function on(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)
參數
- event
-
"selectedMicrophoneChanged"
- listener
- PropertyChangedEvent
on("selectedSpeakerChanged", PropertyChangedEvent)
function on(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)
參數
- event
-
"selectedSpeakerChanged"
- listener
- PropertyChangedEvent
onStateChange((state: CallWithChatAdapterState) => void)
訂閱處理程式至 stateChanged 事件。
function onStateChange(handler: (state: CallWithChatAdapterState) => void)
參數
- handler
-
(state: CallWithChatAdapterState) => 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
- options
- SendMessageOptions
傳回
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
要選擇的相機裝置,挑選 查詢Cameras 傳回的相機裝置
- options
- VideoStreamOptions
控制相機串流轉譯方式的選項 <xref:%40azure%2Fcommunication-calling%23VideoStreamOptions>
傳回
Promise<void>
setMicrophone(AudioDeviceInfo)
將麥克風設定為在通話中使用。
function setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>
參數
- sourceInfo
- AudioDeviceInfo
要選擇的麥克風裝置,挑選由 queryMicrophones 傳回的麥克風裝置
傳回
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[]
要加入的參與者標識碼陣列
- options
- StartCallOptions
傳回
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>