Closed dennysq closed 1 year ago
The error is self-explanatory: Safari won't allow you to access input devices without a proper user gesture. You need to call the function accessing the camera/mic/display from within a user-gesture handler (such as an element click). You have lots of resources online explaining the issue and the solution:
Hi @pabloFuente I understand your point but is very strange as you can see the code attached is inside the onclick function.
Describe the bug When I am trying to share the screen in Safari is throwing an error
Expected behavior I should be able to share the screen.
Wrong current behavior Error message: Publisher Initialization Failed. GENERIC_ERROR: InvalidAccessError: getDisplayMedia must be called from a user gesture handler. Publisher.ts: 387
OpenVidu tutorial where to replicate the error This is my code example: btnScreen.onclick = async function () {
OpenVidu deployment info I am using Openvidu 2.23 browser client.
Client device info (if applicable) Safari 15.5 (17613.2.7.1.8)![image](https://user-images.githubusercontent.com/13289508/207067274-2d1ea2d5-4f28-4c24-9024-82f74d0e36c5.png)
Screenshots
Additional context I've tried to implement everything function using await, but still is throwing the error.