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

Re: [mediacapture-fromelement] Is mute event expected to be dispatched at MediaStreamTrack when enabled is set to false? (#80)

From: Andreas Pehrson via GitHub <sysbot+gh@w3.org>
Date: Tue, 28 May 2019 16:13:02 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-496584600-1559059981-sysbot+gh@w3.org>
> @Pehrsons Do not get that from the specification
> 
> > A muted track will however, regardless of the enabled state, render silence and blackness. A disabled track is logically equivalent to a muted track, from a consumer point of view.
This states, quite explicitly, that muted and enabled are orthogonal.

> > Enabled/disabled on the other hand is available to the application to control (and observe) via the enabled attribute.
There you have it. Enabled is a control surface for the application.

> > The result for the consumer is the same in the sense that whenever MediaStreamTrack is muted or disabled (or both) the consumer gets zero-information-content, which means silence for audio and black frames for video. In other words, media from the source only flows when a MediaStreamTrack object is both unmuted and enabled. For example, a video element sourced by a muted or disabled MediaStreamTrack (contained in a MediaStream ), is playing but rendering blackness.
> 
> Is your interpretation of the specification that setting `enabled` to false should not directly initiate any event being dispatched; specifically the `mute` event?

It should not.

> If that is the case then what is the purpose of the `enabled` attribute?

Per above, a control for the application. "muted" is for the UA to signal to the application whether the track's source is producing something or not. Setting or unsetting the "muted" state is usually explicitly outlined in specs, like received tracks from peer connections.

> And further, if the `MediaStreamTrack` is neither `muted` nor `ended` when `src` of a `<video>` element changes or when `enabled` is set to `false` then `MediaRecorder` should not stop recording https://bugs.chromium.org/p/chromium/issues/detail?id=957340.

If you're capturing a video element with `captureStream()` and changing the element's `src`, tracks will end, so then a MediaRecorder recording those tracks will stop.

Fiddling with the tracks' `enabled` state should not affect a MediaRecorder recording those tracks. As you quoted above they should be recorded as black or silence, depending on what kind of track it is.

-- 
GitHub Notification of comment by Pehrsons
Please view or discuss this issue at https://github.com/w3c/mediacapture-fromelement/issues/80#issuecomment-496584600 using your GitHub account
Received on Tuesday, 28 May 2019 16:13:03 UTC

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