Skip to content

ElectronSystemPreferences.askForMediaAccess method

ElectronSystemPreferences › askForMediaAccess

Unofficial

Prompts the user for access to the given media type. Resolves with true if consent was granted and false if it was denied.

Signature:

askForMediaAccess(mediaType: "camera" | "microphone"): Promise<boolean>

Parameters:

ParameterTypeDescription
mediaType"camera" | "microphone"The media type to request access to.

Returns: Promise<boolean>A promise resolving to whether access was granted.

Platform: darwin.