DeviceManager interface
The Device Manager is used to handle system media devices such as cameras, microphones, and speakers.
Properties
is |
Whether the device host can select speaker output. |
selected |
The microphone device that is being used. |
selected |
The speaker device that is being used. |
Methods
ask |
Show browser prompt to ask the front end user for permission to use the specified device. |
get |
Get a list of available video devices for use. |
get |
Get a list of available microphone devices for use. |
get |
Get a list of available speaker devices for use. |
off("audio |
Unsubscribe function for audioDevicesUpdated event. |
off("selected |
Unsubscribe function for selectedMicrophoneChanged event. |
off("selected |
Unsubscribe function for selectedSpeakerChanged event. |
off("video |
Unsubscribe function for videoDevicesUpdated event. |
on("audio |
Subscribe function for audioDevicesUpdated . |
on("selected |
Subscribe function for selectedMicrophoneChanged event. |
on("selected |
Subscribe function for selectedSpeakerChanged event. |
on("video |
Subscribe function for videoDevicesUpdated event. |
select |
Selects the microphone device to use. |
select |
Select the speaker device to use. |
Property Details
isSpeakerSelectionAvailable
Whether the device host can select speaker output.
isSpeakerSelectionAvailable: boolean
Property Value
boolean
selectedMicrophone
The microphone device that is being used.
selectedMicrophone?: AudioDeviceInfo
Property Value
selectedSpeaker
The speaker device that is being used.
selectedSpeaker?: AudioDeviceInfo
Property Value
Method Details
askDevicePermission(PermissionConstraints)
Show browser prompt to ask the front end user for permission to use the specified device.
function askDevicePermission(permissionConstraints: PermissionConstraints): Promise<DeviceAccess>
Parameters
- permissionConstraints
- PermissionConstraints
configures which permission (audio/video) to request.
Returns
Promise<DeviceAccess>
The permissions that were granted by the user.
getCameras()
Get a list of available video devices for use.
function getCameras(): Promise<VideoDeviceInfo[]>
Returns
Promise<VideoDeviceInfo[]>
getMicrophones()
Get a list of available microphone devices for use.
function getMicrophones(): Promise<AudioDeviceInfo[]>
Returns
Promise<AudioDeviceInfo[]>
getSpeakers()
Get a list of available speaker devices for use.
function getSpeakers(): Promise<AudioDeviceInfo[]>
Returns
Promise<AudioDeviceInfo[]>
off("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)
Unsubscribe function for audioDevicesUpdated event.
function off(event: "audioDevicesUpdated", listener: CollectionUpdatedEvent<AudioDeviceInfo>)
Parameters
- event
-
"audioDevicesUpdated"
event name.
- listener
callback fn that was used to subscribe to this event.
off("selectedMicrophoneChanged", PropertyChangedEvent)
Unsubscribe function for selectedMicrophoneChanged event.
function off(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)
Parameters
- event
-
"selectedMicrophoneChanged"
event name.
- listener
- PropertyChangedEvent
callback fn that will be called when value of this property will change.
off("selectedSpeakerChanged", PropertyChangedEvent)
Unsubscribe function for selectedSpeakerChanged event.
function off(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)
Parameters
- event
-
"selectedSpeakerChanged"
event name.
- listener
- PropertyChangedEvent
callback fn that will be called when value of this property will change.
off("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)
Unsubscribe function for videoDevicesUpdated event.
function off(event: "videoDevicesUpdated", listener: CollectionUpdatedEvent<VideoDeviceInfo>)
Parameters
- event
-
"videoDevicesUpdated"
event name.
- listener
callback fn that was used to subscribe to this event.
on("audioDevicesUpdated", CollectionUpdatedEvent<AudioDeviceInfo>)
Subscribe function for audioDevicesUpdated .
function on(event: "audioDevicesUpdated", listener: CollectionUpdatedEvent<AudioDeviceInfo>)
Parameters
- event
-
"audioDevicesUpdated"
event name.
- listener
callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.
on("selectedMicrophoneChanged", PropertyChangedEvent)
Subscribe function for selectedMicrophoneChanged event.
function on(event: "selectedMicrophoneChanged", listener: PropertyChangedEvent)
Parameters
- event
-
"selectedMicrophoneChanged"
event name.
- listener
- PropertyChangedEvent
callback fn that will be called when value of this property will change.
on("selectedSpeakerChanged", PropertyChangedEvent)
Subscribe function for selectedSpeakerChanged event.
function on(event: "selectedSpeakerChanged", listener: PropertyChangedEvent)
Parameters
- event
-
"selectedSpeakerChanged"
event name.
- listener
- PropertyChangedEvent
callback fn that will be called when value of this property will change.
on("videoDevicesUpdated", CollectionUpdatedEvent<VideoDeviceInfo>)
Subscribe function for videoDevicesUpdated event.
function on(event: "videoDevicesUpdated", listener: CollectionUpdatedEvent<VideoDeviceInfo>)
Parameters
- event
-
"videoDevicesUpdated"
event name.
- listener
callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.
selectMicrophone(AudioDeviceInfo)
Selects the microphone device to use.
function selectMicrophone(microphoneDevice: AudioDeviceInfo): Promise<void>
Parameters
- microphoneDevice
- AudioDeviceInfo
Microphone device information.
Returns
Promise<void>
selectSpeaker(AudioDeviceInfo)
Select the speaker device to use.
function selectSpeaker(speakerDevice: AudioDeviceInfo): Promise<void>
Parameters
- speakerDevice
- AudioDeviceInfo
Speaker device information.
Returns
Promise<void>