RESOLVED DUPLICATE of bug 235544 237523
WebRTC / HTMLMediaElement - calling getDisplayMedia "unmutes" getUserMedia stream on muted video element
https://bugs.webkit.org/show_bug.cgi?id=237523
Summary WebRTC / HTMLMediaElement - calling getDisplayMedia "unmutes" getUserMedia st...
Anders Johan Dalshov
Reported 2022-03-07 04:36:56 PST
The sample code below starts a local stream with getUserMedia and adds the stream to a muted video element (muted prop set on user video element to prevent audio feedback), audio is muted as expected, but after calling getDisplayMedia (allowing the request), the video element with the user media stream will unmute and cause audio feedback. It's not even needed to add the display media stream to the other video element, calling getDisplayMedia alone is sufficient. Note that document.getElementById("user").muted will still return true even if audio feedback is clearly present. Tested with: Safari Version 15.3 (17612.4.9.1.8) / macOS 12.2.1 Safari Technology Preview Release 141 (Safari 15.4, WebKit 17614.1.3.8) / macOS 12.2.1 --- <html> <head></head> <body> <button onclick="startScreenSharing()">Start screen sharing</button> <video id="user" playsinline autoplay muted></video> <video id="display" playsinline autoplay></video> <script> window.onload = function() { navigator.mediaDevices.getUserMedia({audio: true, video: true}) .then((stream) => { document.getElementById("user").srcObject = stream; }); }; this.startScreenSharing = () => { navigator.mediaDevices.getDisplayMedia({video: true}) .then((stream) => { document.getElementById("display").srcObject = stream; }); }; </script> </body> </html>
Attachments
youenn fablet
Comment 1 2022-03-07 05:29:34 PST
Thanks for the report, this is probably fixed in bug 235544. *** This bug has been marked as a duplicate of bug 235544 ***
Note You need to log in before you can comment on or make changes to this bug.