Skip to main content

findDeviceFromConstraints

function findDeviceFromConstraints(constraints, devices): 
| boolean
| MediaDeviceInfoLike
| undefined;

Find device from the device list with provided constraints

Parameters

ParameterTypeDescription
constraints| InputDeviceConstraint | undefinedThe constraints to be used for the lookup
devicesIndexedDevicesThe devices to be used for the lookup

Returns

| boolean | MediaDeviceInfoLike | undefined

true means it can be any devices, undefined means not found, otherwise, the matched device will be returned