W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > May 2019

Re: [mediacapture-main] When an HTMLMediaElement has srcObject set to a MediaStream where the MediaStreamTrack is muted the HTMLMediaElement muted attribute should be set to muted to reflect muted input and muted output (#583)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Fri, 03 May 2019 19:44:46 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-489217456-1556912684-sysbot+gh@w3.org>
> - `HTMLMediaElement` with `srcObject` set to `MediaStream` `muted` attribute does not toggle between `true` and `false` when the Input Device (microphone) is muted with the user toggling a control in the operating system

`element.muted` reflects the local state of the user control on the element itself, [regardless of source](https://jsfiddle.net/jib1/epcywf1v/):
```js
video.src = "videoWithoutAudio.ogg";
await new Promise(r => video.onloadedmetadata = r);
console.log(video.muted); // false
```
Source changes do not alter this value, and I don't think media streams should work any different.

There's an impedance mismatch here. Confusingly, two unrelated features are both called "mute":
 1. Track [muted](https://w3c.github.io/mediacapture-main/getusermedia.html#track-muted) & [enabled](https://w3c.github.io/mediacapture-main/getusermedia.html#track-enabled) are audio ***and video*** data ***pausing*** functions (browser & JS respectively)
 2. Element [muted](https://html.spec.whatwg.org/multipage/media.html#concept-media-muted) is a *playback user-control* that affects whether users ***hear audio***.

They're different. The former applies to both audio and video tracks, and pauses their respective data flow, which can be audio or it can be video. The latter reflects a user volume control on the element that never affects playback visuals, even when the element is assigned an audiovisual source. Even the ghosting of the control knob when the source is audioless is not conveyed in this attribute's value.

> - Firefox 68 does not dispatch  `mute` and `unmute` event at `MediaStreamTrack` target when toggling the mute and unmute control of input device (microphone) of the operating system

This sounds like it could be improved in Firefox. I see you've filed an issue, so thanks!

> The specifications should clarify that muted event MUST be fired at MediaStreamTrack when the user toggling a control in the operating system 

Specs tend to leave the details between a user agent and its user/OS up to the user agent. The exact mechanics may vary across OSes as well, so I don't think we should specify this in any more detail, but am open to hear other views.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/583#issuecomment-489217456 using your GitHub account
Received on Friday, 3 May 2019 19:44:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:23 UTC