[mediacapture-screen-share] Clarify/tweak restrictOwnAudio to say what we want (#317)

henbos has just created a new issue for https://github.com/w3c/mediacapture-screen-share:

== Clarify/tweak restrictOwnAudio to say what we want ==
restrictOwnAudio is a constrainable property and setting for whether or not [own audio restriction](https://w3c.github.io/mediacapture-screen-share/#dfn-own-audio-restriction) is applied, meaning:

> When own audio restriction is applied, the user agent MUST attempt to remove any audio from the audio being captured that was produced by the document that performed [getDisplayMedia](https://w3c.github.io/mediacapture-screen-share/#dom-mediadevices-getdisplaymedia). If the user agent is not able to remove the audio through processing it SHOULD remove the audio by excluding the document's audio from being captured. If this results in no audio being captured, the user agent MUST keep the track muted until it is able to capture audio again.

The original problem that we were trying to solve was if I am screensharing I may want to include the capture of audio, however if that audio contains the playout of remote RTCPeerConnection tracks, when I share this presentation back to the remote participants, they will hear themselves which would be maddening.

restrictOwnAudio attempts to solve this by saying to exclude audio that the application (i.e. document) is producing, but recognizing that all implementations may not be able to do this under all circumstances, there is some SHOULD language that is meant to convey that it's OK to capture less stuff than we ideally would want to as long as we can ensure that the document audio isn't included.

But there are a few issues with this:
- Saying you "MUST attempt to remove" else you "SHOULD" something else is not really testable.
- The vague choice of language may result in different browsers doing different things.
- This definition fails to capture (no pun intended) the most important thing about restrictOwnAudio, which is that we want to remove remote track audio. In some cases it may be more difficult to remove "document" than to remove "peer connection".

**Proposal**
Let's rephrase this to:
1. MUST remove audio produced by RTCPeerConnection remote tracks.
2. SHOULD remove document audio (but system-wide audio that includes "document audio w/o PC audio" is still better than no audio at all).
3. MAY cause muting if this was the only way to achieve 1).

This would allow web developers to trust that restrictOwnAudio solves their use case and help browser implementors align on behavior by being more testable. @olka @guidou

Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/317 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 28 March 2025 13:10:52 UTC