> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# DevicePermission (class)

[Stream](/api-reference/websdk5/stream/overview)

Class that represents permission states for the microphone, speaker, camera, and screen sharing.

Firefox-specific behavior:

* Dismissing the permission popup is treated as a temporary denial

Safari-specific behavior:

* Dismissing the permission popup is treated as a temporary denial
* Permission changes in the browser settings may not update the SDK watchable properties
* When a denied permission is changed in the browser settings, the SDK watchable property remains denied, but the permission can be requested
* Temporary denial sets the SDK watchable property to denied, but allows requesting the permission again
* Denying temporarily or dismissing the permission popup 3 times blocks permission requests (even after the page refresh). Open the page in a new tab to request the permission again

**Methods**

* [requestAudioPermission](/api-reference/websdk5/stream/devicepermission#requestaudiopermission)
* [requestCameraPermission](/api-reference/websdk5/stream/devicepermission#requestcamerapermission)
* [requestPermissions](/api-reference/websdk5/stream/devicepermission#requestpermissions)

**Properties**

* [camera](/api-reference/websdk5/stream/devicepermission#camera)
* [microphone](/api-reference/websdk5/stream/devicepermission#microphone)
* [screenSharing](/api-reference/websdk5/stream/devicepermission#screensharing)
* [speaker](/api-reference/websdk5/stream/devicepermission#speaker)

## Methods

### requestAudioPermission

`requestAudioPermission(): Promise<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Requests the audio permission.

Returns a promise that resolves to a [PermissionState](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state).

**Returns:** Promise\<[PermissionState](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)>

### requestCameraPermission

`requestCameraPermission(): Promise<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Requests the camera permission.

Calling this method can affect [StreamManager.createVideoStream](/api-reference/websdk5/stream/streammanager#createvideostream) or [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).

Note: Repeated calls of this method may briefly activate the camera indicator, even when the permission is already granted.

Returns a promise that resolves to a [PermissionState](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state).

**Returns:** Promise\<[PermissionState](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)>

### requestPermissions

`requestPermissions(options: `[`RequestPermissionsOptions`](/api-reference/websdk5/stream/requestpermissionsoptions)`): Promise<`[`DevicesPermissionState`](/api-reference/websdk5/stream/devicespermissionstate)`>`

Requests permissions for camera and audio devices.

Returns a promise that resolves to a [DevicesPermissionState](/api-reference/websdk5/stream/devicespermissionstate) containing the permission states for camera, microphone, and speaker.

If the initial request fails, automatically retries each requested permission separately

**Parameters**

| Parameter | Type                                                                                   | Requirement | Description |
| --------- | -------------------------------------------------------------------------------------- | ----------- | ----------- |
| `options` | [`RequestPermissionsOptions`](/api-reference/websdk5/stream/requestpermissionsoptions) | Required    |             |

**Returns:** Promise\<[DevicesPermissionState](/api-reference/websdk5/stream/devicespermissionstate)>

## Properties

### camera

`camera: `[`ReadonlyWatchable`](/api-reference/websdk5/core/watchable/readonlywatchable)`<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Watchable property that allows getting the camera permission state.

### microphone

`microphone: `[`ReadonlyWatchable`](/api-reference/websdk5/core/watchable/readonlywatchable)`<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Watchable property that allows getting the microphone permission state.

### screenSharing

`screenSharing: `[`ReadonlyWatchable`](/api-reference/websdk5/core/watchable/readonlywatchable)`<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Watchable property that allows getting the permission state for screen sharing.

### speaker

`speaker: `[`ReadonlyWatchable`](/api-reference/websdk5/core/watchable/readonlywatchable)`<`[`PermissionState`](https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus/state)`>`

Watchable property that allows getting the speaker permission state.