DeviceManager
Summary
Singleton class to manage media devices.Remarks
This class can be used to get a list of available media devices both audio and video.Example: Example to get a list of available audio devices
const devices = await DeviceManager.getInstance().getDevices('audioinput');
// or async
DeviceManager.getInstance().getDevices('audioinput').then((devices) => {
// do something with devices
});
Methods
getDevices
Returns a list of available media devices.
Signature
getDevices(kind?: MediaDeviceKind, requestPermissions: boolean)
Name | Type | Description |
---|---|---|
kind optional | MediaDeviceKind | Optional media device kind to filter by. |
requestPermissions | boolean | Whether to request permissions if no devices are found. |
Returns
Promise
<MediaDeviceInfo[]
> Promise resolving to a list of media devices.