setCameraCaptureState method
- required MediaCaptureState state,
Changes whether the webpage is using the camera to capture images or video.
Officially Supported Platforms/Implementations:
- iOS WKWebView 15.0+ (Official API - WKWebView.setCameraCaptureState)
- Linux WPE WebKit 2.34+ (Official API - webkit_web_view_set_camera_capture_state):
- Once state is set to NONE, it cannot be changed back. The page can request capture again using the mediaDevices API.
- macOS WKWebView 12.0+ (Official API - WKWebView.setCameraCaptureState)
Parameters - Officially Supported Platforms/Implementations:
state: all platforms
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
Future<void> setCameraCaptureState({required MediaCaptureState state}) =>
platform.setCameraCaptureState(state: state);