> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# deviceInfoToConstraints

> Converts a MediaDeviceInfo to track constraints suitable for getUserMedia.

```ts
deviceInfoToConstraints(deviceInfo): MediaTrackConstraints
```

Converts a `MediaDeviceInfo` to track constraints suitable for `getUserMedia`.

## **Parameters**

Device descriptor to convert, or `null` for unconstrained capture. See [`MediaDeviceInfo`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).

## **Returns**

`MediaTrackConstraints`

## **Examples**

```ts
client.deviceInfoToConstraints(deviceInfo);
```