mediacapture-extensions
mediacapture-extensions copied to clipboard
Update MediaStream and/or MediaStreamTrack objects when input device changes?
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,
- In a website, use getUserMedia to obtain a stream object with "audio=true".
- Insert an external microphone.
- 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?