Skip to content

[iOS 15] Add support for new delegate WKUIDelegate decideMediaCapturePermissionFor  #1671

Description

@nanosonde

Feature request / problem description
Every call to getUserMedia() from within a WKWebView instance will lead to a new permission popup requiring the user to allow/deny access to the camera and/or microphone. This is quite annoying from a user perspective.

Example use-case: I use an audio/video capable Home Assistant card to have an audio/video connection to my doorbell within HA lovelace UI.

Describe the solution you'd like
Implement the new delegate WKUIDelegate decideMediaCapturePermissionFor to handle getUserMedia() media capture permission requests so that the user does not get a permission prompt for camera/microphone with every call to getUserMedia() when loading or reloading a webpage from within an existing instance of WKWebView.

Additional context

  1. Original bug report for iOS 14.3: https://bugs.webkit.org/show_bug.cgi?id=220416
  2. Another related forum topic: https://developer.apple.com/forums/thread/669011
  3. Presentation of the new delegate on WWDC 2021 at timestamp 14:40: https://developer.apple.com/videos/play/wwdc2021/10032/
  4. A clarification about the new delegate in the Apple forum: https://developer.apple.com/forums/thread/682293
  5. getUserMedia(): https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
  6. Somehow related issue: Add microphone access (NSMicrophoneUsageDescription) #1319

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions