Bug 237523

Summary: WebRTC / HTMLMediaElement - calling getDisplayMedia "unmutes" getUserMedia stream on muted video element
Product: WebKit Reporter: Anders Johan Dalshov <ajdalshov>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: youennf
Priority: P2    
Version: Safari 15   
Hardware: Mac (Intel)   
OS: macOS 12   

Description Anders Johan Dalshov 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. / macOS 12.2.1
Safari Technology Preview Release 141 (Safari 15.4, WebKit 17614.1.3.8) / macOS 12.2.1

	<button onclick="startScreenSharing()">Start screen sharing</button>
	<video id="user" playsinline autoplay muted></video>
	<video id="display" playsinline autoplay></video>
		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;
Comment 1 youenn fablet 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 ***