microsoft-teamsgetusermediamediastreammediadevices

MediaDevices.getUserMedia throws exception on Windows when Zoom or MSTeams desktop clients are running (with camera on)


Environment

I have a website that can access the the user's camera and take a short video on request. I am attempting to achieve this using the MediaDevices web api.

This is all working fine except in two scenarios. When I am in a Zoom or MS Teams meeting on my Windows laptop (with camera on), I have noticed that my webapp fails to capture my video. If I use the web clients for zoom or msteams then it works as expected. Also, if I use mac OS instead of my Windows laptop then this works fine.

When I debug this I get the following error message thrown when trying to access userMedia.

DOMException: Could not start video source

The code that I am using to access UserMedia is the following:

return await navigator.mediaDevices.getUserMedia({video: true});

Is there anything I can do to allow me to user my webcam in the browser as well as on the MS Teams or Zoom clients?


Solution

  • Is there anything I can do to allow me to user my webcam in the browser as well as on the MS Teams or Zoom clients?

    No, sorry to say.

    The native videoconference client programs attach to your webcam, and so does the browser when you use gUM. The first process to attach wins.

    A second webcam may solve your problem by letting your videoconference progam use one and your browser use the other. If you use Chrome, pick the camera you want to use with your browser from the pulldown menu on this page.

    chrome://settings/content/camera