<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKUIDelegate/webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(pl)WKUIDelegate(im)webView:requestMediaCapturePermissionForOrigin:initiatedByFrame:type:decisionHandler:"
  },
  "title" : "webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:)"
}
-->

# webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:)

Determines whether a web resource, which the security origin object describes, can access to the device’s microphone audio and camera video.

```
optional func webView(_ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, decisionHandler: @escaping @MainActor @Sendable (WKPermissionDecision) -> Void)
```

## Parameters

`webView`

The web view requesting permission for microphone audio and camera video.

`origin`

An object that identifies the host name, protocol, and port number for a web resource.

`frame`

The frame that initiates the request in the web view.

`type`

An enumeration case representing a type of media capture device, like a microphone or camera.

`decisionHandler`

A closure that you call from your delegate method. Pass the permission decision you determine to the closure.

## Discussion

If you don’t implement this method in your delegate, the system returns [`WKPermissionDecision.prompt`](/documentation/WebKit/WKPermissionDecision/prompt).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)