enumerateDevices method
Populates devices with a list of DeviceDetails objects representing available media input devices, such as microphones, cameras, and so forth.
Implementation
Future<void> enumerateDevices({bool media = true, bool screen = true}) async {
Log.debug('enumerateDevices($media, $screen)', '$runtimeType');
try {
if (media) {
devices.value = await MediaUtils.enumerateDevices();
}
if (screen && PlatformUtils.isDesktop && !PlatformUtils.isWeb) {
displays.value = await MediaUtils.enumerateDisplays();
}
} on EnumerateDevicesException catch (e) {
addError('Failed to enumerate devices: $e');
rethrow;
}
}