Skip to navigation

DevicePermission (class)

Web SDK v5 API reference
View as Markdown

Stream

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

requestAudioPermission(): Promise<PermissionState>

Requests the audio permission.

Returns a promise that resolves to a PermissionState.

Returns: Promise<PermissionState>

requestCameraPermission

requestCameraPermission(): Promise<PermissionState>

Requests the camera permission.

Calling this method can affect StreamManager.createVideoStream or 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.

Returns: Promise<PermissionState>

requestPermissions

requestPermissions(options: RequestPermissionsOptions): Promise<DevicesPermissionState>

Requests permissions for camera and audio devices.

Returns a promise that resolves to a DevicesPermissionState containing the permission states for camera, microphone, and speaker.

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

Parameters

ParameterTypeRequirementDescription
optionsRequestPermissionsOptionsRequired

Returns: Promise<DevicesPermissionState>

Properties

camera

Watchable property that allows getting the camera permission state.

microphone

Watchable property that allows getting the microphone permission state.

screenSharing

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

speaker

Watchable property that allows getting the speaker permission state.