Skip to main content

findDeviceFromConstraints

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

Find device from the device list with provided constraints

Parameters

ParameterTypeDescription
constraints| undefined | InputDeviceConstraintThe constraints to be used for the lookup
devicesIndexedDevicesThe devices to be used for the lookup

Returns

| undefined | boolean | MediaDeviceInfoLike

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