Bug 227608
Summary: | the method getDisplayMedia only can be called from a user gesture handler | ||
---|---|---|---|
Product: | WebKit | Reporter: | walter <yafan> |
Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Critical | CC: | webkit-bug-importer, yafan, youennf |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 14 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
walter
When we share screen in Safari browser, we found there is a restriction - the method getDisplayMedia must be called from a user gesture handler
In our current meeting behaviour, we cannot call "getDisplayMedia" method from a user gesture handler directly. The reason is we need to get the presenter privilege first.
As a result, the calling of "getDisplayMedia" is from a callback handler. We got the following error from the callback handler:
```
getDisplayMedia error: InvalidAccessError InvalidAccessError: getDisplayMedia must be called from a user gesture handler.
```
At least, the calling should not fail. I think a prompt for surface picker or asking permission is acceptable.
Could Safari loosen the restriction just like Chrome browser?
I wrote a example: https://www.fanyamin.com/webrtc/examples/desktop_sharing.html
You can try it by Safari and Chrome, it is ok by Chrome but failed to start sharing by Safari.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/80360292>