-
-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix getDispayMedia()
getUserMedia()
permission prompt on macOS
#1195
Comments
i think i can test 14.1.2 later today |
I can confirm that it only works on 14.1.2 after i changed |
Looks like we already know that it's fixed in 14.2.1 if 8979 is indeed the same issue so i'm just gonna try to check 14.2.0 and not the latest 14.2 patch ver |
Also a bit offtopic but the way we handle getDisplayMedia requests in general is a bit incorrect. We're never actually asking for permissions, the dialog that shows is just the display/window selection screen - firefox equivalent for reference: Afaik this is because the macos permission system, at least for screen recording, is on a "pretty please 😢" basis, meaning that apps/frameworks have to implement, read and adhere to permissions themselves. And yes, they can chose not to do this (which we effectively did too), though idk if that will cause problems in the app store. |
Hmm I think I also found something... It's tauri-apps/tauri#2600 -> So if we overwrite the responder then It might not cause by the os version, just different Web API has different OS behavior |
Okay, so i went through my old notes from a while ago and together with the new findings i'm fairly confident that the only way to fix both getUserMedia and getDisplayMedia is by using 2 private webview apis. (What's also weird is that you must have the plist for mic/cam usage for display media to work but i don't want to think about that lol) One thing i don't know yet is if macos 13 and 14 (and maybe 12) really behaved differently or if we just think/thought it did. I can look into that later, for now let's focus on 14. I will push my wip experiment onto your branch for you to try. This still has the no-permission behavior explained in my comment above but it should be fairly easy to add (i had that in my prior experiments a few months ago but sadly deleted the branch because i thought it was indeed fixed now and my changes were just over-engineered 😢 ) |
Okay so just like last time i wasn't able to actually get it working (i still had stuff commented out in my comment above 😂 ). My knowledge about obj-c, or at least obj-c in a rust project, is too lacking to finish this so i hope that you can figure it out and that what i pushed may help you. |
Ok.... so it's my turn to become a helldiver Basically, I made no progress today 😭 Here are some of my guesses so far: The permission are all passthrough something called Normally, without providing But, if we provide Also, creating a new project in Xcode and providing I'll continue the research next few days, but if there's no solution, we might need to set a stop-loss point. |
While i do hope you'll find a solution i think it's fine if we end up having a config that switches between disabling the double permission prompt for mic/cam or supporting getDisplayMedia. |
I think something is wrong with https://github.com/WebKit/WebKit/blob/a0b7f7faeffb5ec679ddd471a0f7c68a91a37715/Source/WebKit/UIProcess/Cocoa/UIDelegate.mm#L1212, so it didn't show the picker. Currently, the best we can do is add |
getDispayMedia()
getUserMedia()
permission prompt on macOS
If we expose the decision handler for |
Current Status on macOS 14
getUserMedia()
: Show permission prompt for camera and microphone twice (application level and webview level)getDispayMedia()
: Normalbut with
requestMediaCapturePermissionForOrigin
delegated in wrygetUserMedia()
: NormalgetDispayMedia()
: Permission denied due to not showing picker for a display device (SCContentSharingPicker
)A possible fix for now is delegating both
requestMediaCapturePermissionForOrigin
andrequestDisplayCapturePermissionForOrigin
. But when we are callinggetDispayMedia()
, it can choose a screen only.Upstream tracking: https://bugs.webkit.org/show_bug.cgi?id=271688
Workaround PR: #1196
--- outdated ---
The media permission prompt was suppressed when macOS 14.0 introduced
Issue: #1101, tauri-apps/tauri#2600
PR: #1111
note: #1111 brings a regression issue: tauri-apps/tauri#9178
After an OS update, which could be 14.2 (not sure), the original issue was solved by Apple, so we revert the fix:
Issue: tauri-apps/tauri#8979
PR: #1186
We need to find the affected OS version (14.0 ~ 14.x.x) and apply the version check like #1111
TODO
The text was updated successfully, but these errors were encountered: