getUserMedia takes a long time to resolve the promise

254 views
Skip to first unread message

Matias Lopez

unread,
Jan 25, 2023, 5:24:08 PM1/25/23
to discuss-webrtc
Hi all!

Could anyone please tell me if it's required user interaction to request getUserMedia? I mean a click after the page loaded, considering our users have already given permission.

We're experimenting with weird behaviors when calling getUserMedia, sometimes the promise takes milliseconds, and others more than 2 minutes in Windows, Linux, and Mac using any Chromium-based browser without any error. Most of the cases this happens when the user does not click on the website.

Also, this block all WebRTC-based apps like Google Meet. I mean, when this happens all getUserMedia calls take the same time in all tabs.

I ensure to do not have another native app working in the background that could take the cam and mic, or the devices be disconnected, most of the tested devices have the cam and mic integrated.

This behavior never happens on mobile devices. So, what is happening?

Matias Lopez

unread,
Jan 25, 2023, 5:28:45 PM1/25/23
to discuss-webrtc

Philipp Hancke

unread,
Jan 26, 2023, 2:01:00 AM1/26/23
to discuss...@googlegroups.com
getUserMedia requires page focus to resolve, see https://groups.google.com/g/discuss-webrtc/c/hpAVnDA9Ung/m/KIsHFqP2BwAJ
But blocking in all tabs (i.e. an inter-tab-dependency) sounds unexpected. Do you have more detailed steps to reproduce?

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/c0645e71-8b72-41b4-8c14-0ac0ba5d3ce8n%40googlegroups.com.

guest271314

unread,
Jan 26, 2023, 9:43:14 PM1/26/23
to discuss-webrtc
Evidently specification authors/implementers want some kind of focus now,  even scrolling. You can alternative use an extension with Native Messaging to capture microphone and cameras and stream those tracks to the browser tab - without necessarily focusing the Tab.
Reply all
Reply to author
Forward
0 new messages