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

# getDisplayMedia

> getDisplayMedia function in the WebRTC namespace.

### getDisplayMedia

* `Const` **getDisplayMedia**(`constraints?`): `Promise<MediaStream>` — See [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) for more details.

Prompts the user to share the screen and asynchronously returns a [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream) object associated with a display or part of it.

#### Parameters

**`constraints`** `MediaStreamConstraints`

An optional [MediaStreamConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints) object specifying requirements for the returned [MediaStream](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream).

---

#### Returns

`Promise<MediaStream>`

#### Example

```javascript
await SignalWire.WebRTC.getDisplayMedia(); // MediaStream {id: "HCXy...", active: true, ...}
```