> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # getDisplayMedia > getDisplayMedia function in the WebRTC namespace. ### getDisplayMedia * `Const` **getDisplayMedia**(`constraints?`): `Promise` — 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` #### Example ```javascript await SignalWire.WebRTC.getDisplayMedia(); // MediaStream {id: "HCXy...", active: true, ...} ``` > getDisplayMedia function in the WebRTC namespace.