setCameraCaptureState method
- @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')])
- 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
@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',
);
}