requestCapturePermission method

  1. @experimental
Future<bool> requestCapturePermission({
  1. bool fullScreenOnly = false,
})

Requests permission to capture the screen before starting a screen share.

On Android this shows the MediaProjection consent dialog, on macOS it triggers the screen recording permission check. Returns true when permission was granted. On platforms that do not require an upfront request this is a no-op that returns true, so it is safe to call unconditionally.

Experimental: this API may change in a future release.

Implementation

@experimental
Future<bool> requestCapturePermission({bool fullScreenOnly = false}) async {
  if (lkPlatformIs(PlatformType.android) || lkPlatformIs(PlatformType.macOS)) {
    return rtc.Helper.requestCapturePermission(fullScreenOnly: fullScreenOnly);
  }
  return true;
}