setCameraCaptureState method

  1. @SupportedPlatforms.new(platforms: [IOSPlatform(apiName: 'WKWebView.setCameraCaptureState', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3763097-setcameracapturestate', available: '15.0'), LinuxPlatform(apiName: 'webkit_web_view_set_camera_capture_state', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.set_camera_capture_state.html', available: '2.34', note: 'Once state is set to NONE, it cannot be changed back. The page can request capture again using the mediaDevices API.'), MacOSPlatform(apiName: 'WKWebView.setCameraCaptureState', apiUrl: 'https://developer.apple.com/documentation/webkit/wkwebview/3763097-setcameracapturestate', available: '12.0')])
Future<void> setCameraCaptureState({
  1. required MediaCaptureState state,
})

Changes whether the webpage is using the camera to capture images or video.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • state: all platforms

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    IOSPlatform(
      apiName: 'WKWebView.setCameraCaptureState',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3763097-setcameracapturestate',
      available: '15.0',
    ),
    LinuxPlatform(
      apiName: 'webkit_web_view_set_camera_capture_state',
      apiUrl:
          'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/method.WebView.set_camera_capture_state.html',
      available: '2.34',
      note:
          'Once state is set to NONE, it cannot be changed back. The page can request capture again using the mediaDevices API.',
    ),
    MacOSPlatform(
      apiName: 'WKWebView.setCameraCaptureState',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wkwebview/3763097-setcameracapturestate',
      available: '12.0',
    ),
  ],
)
Future<void> setCameraCaptureState({required MediaCaptureState state}) {
  throw UnimplementedError(
    '${PlatformInAppWebViewControllerMethod.setCameraCaptureState.name} is not implemented on the current platform',
  );
}