requestCapturePermission method

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

Requests Android screen-capture permission. The granted projection data lives on this factory's GetUserMediaImpl, so the subsequent getDisplayMedia call must be issued through this same instance.

Implementation

Future<bool> requestCapturePermission({bool fullScreenOnly = false}) async {
  _checkDisposed('requestCapturePermission');
  if (!WebRTC.platformIsAndroid) {
    throw Exception('requestCapturePermission only supported for Android');
  }
  final result = await WebRTC.invokeMethod(
    'requestCapturePermission',
    <String, dynamic>{
      'factoryId': factoryId,
      'fullScreenOnly': fullScreenOnly,
    },
  );
  return result == true;
}