*** id: 4a0184c8-e8e6-4a77-abaa-2d866a546b8a title: getDisplayMedia slug: /js/reference/webrtc/get-display-media description: getDisplayMedia function in the WebRTC namespace. max-toc-depth: 3 ---------------- ### 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 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, ...} ```