[Webkit-unassigned] [Bug 198040] New: getDisplayMedia can fail when called from a user gesture handler
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 20 07:46:54 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=198040
Bug ID: 198040
Summary: getDisplayMedia can fail when called from a user
gesture handler
Product: WebKit
Version: Safari Technology Preview
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebRTC
Assignee: webkit-unassigned at lists.webkit.org
Reporter: philipp.weissensteiner at visocon.com
CC: youennf at gmail.com
Created attachment 370251
--> https://bugs.webkit.org/attachment.cgi?id=370251&action=review
getDisplayMedia example
Hi,
Since Safari Tech Preview 82
> getDisplayMedia must be called from a user gesture handler.
If said handler has an async call to say getUserMedia or enumerateDevices, before
invoking getDisplayMedia, the call will always fail with the above message.
```javascript
// my user gesture handler is called after a button is clicked
async function myUserGestureHandler() {
// both will cause a failure
// const camera = await navigator.mediaDevices.getUserMedia({ video: true });
const devices = await navigator.mediaDevices.enumerateDevices();
// calling getUserMedia here works
const screen = await navigator.mediaDevices.getDisplayMedia({ video: true });
}
```
- Invoking getUserMedia works.
- Recent Firefox and Chrome versions work too.
- Worked in Safari Tech Preview 81.
I've attached an example page demonstrating the issue.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190520/a9ec9940/attachment.html>
More information about the webkit-unassigned
mailing list