# MediaDevices

The `mediaDevices` API that enables access to input devices such as cameras and microphones, as well as the ability to capture media streams from those devices.

## Public method summary

| **Method**                                  | **Description**                                       | **Parameters**                                                                                                                                                                                                                                                |
| ------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| getMediaDevices()                           | Returns the list of available for using media devices |                                                                                                                                                                                                                                                               |
| setAudioConstraints(deviceId)               | Selects the audio device for the session              |                                                                                                                                                                                                                                                               |
| setVideoConstraints(deviceId)               | Selects the video device for the session              |                                                                                                                                                                                                                                                               |
| doPreview(constraints)                      | Returns a preview stream for session                  |                                                                                                                                                                                                                                                               |
| changeMediaDevice(deviceId, type, selector) | Allows the user to change media device                | <ul><li>deviceId - id of selected device provided by getMediaDevices() method</li><li>type - type of device to change. Possible values are: \['camera', 'microphone', 'speaker']</li><li>querySelector for video element to replace a stream object</li></ul> |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.sceenic.co/watch-together-sdk/sscale-confluence-api-references/sscale-confluence-web-sdk-reference/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
