共用方式為


StatefulDeviceManager interface

定義由具狀態在 <xref:%40azure%2Fcommunication-calling%23DeviceManager>上新增的其他方法。

Extends

屬性

selectCamera

DeviceManagerState中設定 selectedCamera。 這是完全由開發人員驅動的,而且不會以任何方式系結至 <xref:%40azure%2Fcommunication-calling%23DeviceManager>。 它完全包含在 StatefulDeviceManager中。 請參閱 <xref:DeviceManagerState.selectedCamera>。

繼承的屬性

isSpeakerSelectionAvailable

裝置主機是否可以選取喇叭輸出。

selectedMicrophone

正在使用的麥克風裝置。

selectedSpeaker

正在使用的喇叭裝置。

繼承的方法

askDevicePermission(PermissionConstraints)

顯示瀏覽器提示,要求前端使用者取得使用指定裝置的許可權。

getCameras()

取得可用的視訊裝置清單以供使用。

getMicrophones()

取得可用的麥克風裝置清單以供使用。

getSpeakers()

取得可用的喇叭裝置清單以供使用。

off("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)

取消訂閱 audioDevicesUpdated 事件的函式。

off("selectedMicrophoneChanged", PropertyChangedEvent)

針對 selectedMicrophoneChanged 事件取消訂閱函式。

off("selectedSpeakerChanged", PropertyChangedEvent)

針對 selectedSpeakerChanged 事件取消訂閱函式。

off("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)

videoDevicesUpdated 事件的取消訂閱函式。

on("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)

audioDevicesUpdated 的 Subscribe 函式。

on("selectedMicrophoneChanged", PropertyChangedEvent)

SelectedMicrophoneChanged 事件的訂閱函式。

on("selectedSpeakerChanged", PropertyChangedEvent)

selectedSpeakerChanged 事件的訂閱函式。

on("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)

videoDevicesUpdated 事件的 Subscribe 函式。

selectMicrophone(AudioDeviceInfo)

選取要使用的麥克風裝置。

selectSpeaker(AudioDeviceInfo)

選取要使用的喇叭裝置。

屬性詳細資料

selectCamera

DeviceManagerState中設定 selectedCamera。 這是完全由開發人員驅動的,而且不會以任何方式系結至 <xref:%40azure%2Fcommunication-calling%23DeviceManager>。 它完全包含在 StatefulDeviceManager中。 請參閱 <xref:DeviceManagerState.selectedCamera>。

selectCamera: (VideoDeviceInfo: any) => void

屬性值

(VideoDeviceInfo: any) => void

繼承的屬性詳細資料

isSpeakerSelectionAvailable

裝置主機是否可以選取喇叭輸出。

isSpeakerSelectionAvailable: boolean

屬性值

boolean

繼承自 DeviceManager.isSpeakerSelectionAvailable

selectedMicrophone

正在使用的麥克風裝置。

selectedMicrophone?: AudioDeviceInfo

屬性值

繼承自 DeviceManager.selectedMicrophone

selectedSpeaker

正在使用的喇叭裝置。

selectedSpeaker?: AudioDeviceInfo

屬性值

繼承自 DeviceManager.selectedSpeaker

繼承的方法的詳細資料

askDevicePermission(PermissionConstraints)

顯示瀏覽器提示,要求前端使用者取得使用指定裝置的許可權。

function askDevicePermission(permissionConstraints: PermissionConstraints): Promise<DeviceAccess>

參數

permissionConstraints
PermissionConstraints

設定要要求的許可權(音訊/視訊)。

傳回

Promise<DeviceAccess>

使用者授與的許可權。

繼承自 DeviceManager.askDevicePermission

getCameras()

取得可用的視訊裝置清單以供使用。

function getCameras(): Promise<VideoDeviceInfo[]>

傳回

Promise<VideoDeviceInfo[]>

繼承自 DeviceManager.getCameras

getMicrophones()

取得可用的麥克風裝置清單以供使用。

function getMicrophones(): Promise<AudioDeviceInfo[]>

傳回

Promise<AudioDeviceInfo[]>

繼承自 DeviceManager.getMicrophones

getSpeakers()

取得可用的喇叭裝置清單以供使用。

function getSpeakers(): Promise<AudioDeviceInfo[]>

傳回

Promise<AudioDeviceInfo[]>

繼承自 DeviceManager.getSpeakers

off("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)

取消訂閱 audioDevicesUpdated 事件的函式。

function off(event: "audioDevicesUpdated", listener: CollectionUpdatedEvent<AudioDeviceInfo>)

參數

event

"audioDevicesUpdated"

事件名稱。

listener

CollectionUpdatedEvent<AudioDeviceInfo>

回呼 fn,用來訂閱此事件。

繼承自 DeviceManager.off

off("selectedMicrophoneChanged", PropertyChangedEvent)

針對 selectedMicrophoneChanged 事件取消訂閱函式。

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

參數

event

"selectedMicrophoneChanged"

事件名稱。

listener
PropertyChangedEvent

回呼 fn,會在此屬性的值變更時呼叫。

繼承自 DeviceManager.off

off("selectedSpeakerChanged", PropertyChangedEvent)

針對 selectedSpeakerChanged 事件取消訂閱函式。

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

參數

event

"selectedSpeakerChanged"

事件名稱。

listener
PropertyChangedEvent

回呼 fn,會在此屬性的值變更時呼叫。

繼承自 DeviceManager.off

off("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)

videoDevicesUpdated 事件的取消訂閱函式。

function off(event: "videoDevicesUpdated", listener: CollectionUpdatedEvent<VideoDeviceInfo>)

參數

event

"videoDevicesUpdated"

事件名稱。

listener

CollectionUpdatedEvent<VideoDeviceInfo>

回呼 fn,用來訂閱此事件。

繼承自 DeviceManager.off

on("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)

audioDevicesUpdated 的 Subscribe 函式。

function on(event: "audioDevicesUpdated", listener: CollectionUpdatedEvent<AudioDeviceInfo>)

參數

event

"audioDevicesUpdated"

事件名稱。

listener

CollectionUpdatedEvent<AudioDeviceInfo>

回呼 fn,會在此集合變更時呼叫,它會傳遞已新增和移除元素的陣列。

繼承自 DeviceManager.on

on("selectedMicrophoneChanged", PropertyChangedEvent)

SelectedMicrophoneChanged 事件的訂閱函式。

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

參數

event

"selectedMicrophoneChanged"

事件名稱。

listener
PropertyChangedEvent

回呼 fn,會在此屬性的值變更時呼叫。

繼承自 DeviceManager.on

on("selectedSpeakerChanged", PropertyChangedEvent)

selectedSpeakerChanged 事件的訂閱函式。

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

參數

event

"selectedSpeakerChanged"

事件名稱。

listener
PropertyChangedEvent

回呼 fn,會在此屬性的值變更時呼叫。

繼承自 DeviceManager.on

on("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)

videoDevicesUpdated 事件的 Subscribe 函式。

function on(event: "videoDevicesUpdated", listener: CollectionUpdatedEvent<VideoDeviceInfo>)

參數

event

"videoDevicesUpdated"

事件名稱。

listener

CollectionUpdatedEvent<VideoDeviceInfo>

回呼 fn,會在此集合變更時呼叫,它會傳遞已新增和移除元素的陣列。

繼承自 DeviceManager.on

selectMicrophone(AudioDeviceInfo)

選取要使用的麥克風裝置。

function selectMicrophone(microphoneDevice: AudioDeviceInfo): Promise<void>

參數

microphoneDevice
AudioDeviceInfo

麥克風裝置資訊。

傳回

Promise<void>

繼承自 DeviceManager.selectMicrophone

selectSpeaker(AudioDeviceInfo)

選取要使用的喇叭裝置。

function selectSpeaker(speakerDevice: AudioDeviceInfo): Promise<void>

參數

speakerDevice
AudioDeviceInfo

喇叭裝置資訊。

傳回

Promise<void>

繼承自 DeviceManager.selectSpeaker