---
title: "setCameraCaptureState(_:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webpage/setcameracapturestate(_:)"
---

# setCameraCaptureState(_:)

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

## Declaration

```swift
@MainActor final func setCameraCaptureState(_ state: WKMediaCaptureState) async
```

## Parameters

- `state`: The new capture state the page should use.

## See Also

### Managing the microphone and camera

- [cameraCaptureState](webkit/webpage/cameracapturestate.md)
- [microphoneCaptureState](webkit/webpage/microphonecapturestate.md)
- [setMicrophoneCaptureState(_:)](webkit/webpage/setmicrophonecapturestate(_:).md)
