DevicePermission
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(): Promise<PermissionState>
Requests the audio permission.
Returns a promise that resolves to a PermissionState.
Returns
type:
Promise<PermissionState>
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
type:
Promise<PermissionState>
requestPermissions(options: ): 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
options:
Returns
type:
Promise<DevicesPermissionState>
Props
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.