Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MediaStream and/or MediaStreamTrack objects when input device changes? #68

Open
yuhonglin opened this issue Jun 29, 2022 · 0 comments

Comments

@yuhonglin
Copy link

Hi all,

I am relatively new to the media capture API. Recently I found after obtaining the MediaStream object, even if the input device changed, the metadata of the already-obtained MediaStream object is not updated. For example, if I do the following,

  1. In a website, use getUserMedia to obtain a stream object with "audio=true".
  2. Insert an external microphone.
  3. The system will then automatically capture audio from the external microphone. But if the metadata of the stream object doesn't change, although it is already capturing audio from the external microphone.

It seems the only way to observe this is to listen to the "MediaDevices.ondevicechange" event. And it seems video conferencing websites will recall the getUserMedia when this happens. Then they can obtain a new stream with correct metadata.

Is this an intended behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant